/* ============ CHUCKSQUATCH · ORIGINS — CRYPTID FOOTAGE ============ */

:root {
  --void: #050705;
  --pine: #0c1710;
  --ir: #8dff4f;
  --ir-dim: rgba(141, 255, 79, 0.55);
  --bone: #e8e4d8;
  --bone-dim: rgba(232, 228, 216, 0.55);
  --paper: #e8e4d8;
  --ink: #16190f;
  --red: #e23b3b;
  --archivo: 'Archivo Black', sans-serif;
  --barlow: 'Barlow Condensed', sans-serif;
  --vcr: 'VT323', monospace;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  background: var(--void);
  color: var(--bone);
  font-family: var(--barlow);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

.osd-font {
  font-family: var(--vcr);
  font-size: 1.05rem;
  letter-spacing: 0.06em;
  color: var(--ir);
  text-shadow: 0 0 6px rgba(141, 255, 79, 0.55);
}

/* ---------- preloader ---------- */
#preloader {
  position: fixed; inset: 0; z-index: 100;
  background: var(--void);
  display: flex; align-items: center; justify-content: center;
  transition: opacity 0.6s ease, visibility 0.6s;
}
#preloader.done { opacity: 0; visibility: hidden; }
.pre-box { display: flex; flex-direction: column; gap: 1rem; align-items: flex-start; }
.pre-osd { font-family: var(--vcr); font-size: 1.4rem; color: var(--ir); text-shadow: 0 0 8px rgba(141,255,79,0.6); }
.pre-osd.dim { font-size: 1rem; color: var(--ir-dim); }
.pre-bar { width: 260px; height: 10px; border: 1px solid var(--ir-dim); }
.pre-bar span { display: block; height: 100%; width: 20%; background: var(--ir); animation: preload 1.1s linear infinite; }
@keyframes preload { 0% { margin-left: 0; } 100% { margin-left: 80%; } }

/* ---------- fixed layers ---------- */
#scene { position: fixed; inset: 0; width: 100vw; height: 100vh; z-index: 0; display: block; }

/* The CSS .grain layer is DELETED (Phase C.2).  It ran a second grain field at a second clock
   (feTurbulence, steps(4)/0.8s = 5 fps) stacked on the shader's 60 fps one, and — because it
   was a fixed full-viewport overlay — it covered the PAPER evidence rooms too: measured 7.83
   noise std on flat paper at 1920, 10.29 at portrait.  The paper rooms are now clean. */

/* ---------- OSD frame ---------- */
#osd {
  position: fixed; inset: 0; z-index: 5; pointer-events: none;
  font-family: var(--vcr); color: var(--ir);
  text-shadow: 0 0 6px rgba(141, 255, 79, 0.55);
  font-size: clamp(0.95rem, 1.6vw, 1.25rem);
  transition: opacity 0.4s;
}
#osd.osd-off { opacity: 0; }
.osd-tl { position: absolute; top: 4.6rem; left: 1.6rem; }
.osd-tr { position: absolute; top: 4.6rem; right: 1.6rem; }
.osd-tr b { color: var(--bone); font-weight: 400; }
.osd-bl { position: absolute; bottom: 1.4rem; left: 1.6rem; display: flex; flex-direction: column; gap: 0.15rem; }
.osd-br { position: absolute; bottom: 1.4rem; right: 1.6rem; color: var(--ir-dim); }
#recDot { color: var(--red); text-shadow: 0 0 8px rgba(226, 59, 59, 0.8); animation: blink 1.1s steps(1) infinite; }
#recDot.stopped { animation: none; color: var(--bone-dim); text-shadow: none; }
@keyframes blink { 0%, 60% { opacity: 1; } 61%, 100% { opacity: 0.15; } }
.osd-log-line { opacity: 0; }

/* ---------- bounding box ---------- */
/* left/top/width/height are written every frame from camera.project() — see updateSubject().
   The values here are only what the box looks like before it is ever shown. */
#bbox {
  position: fixed; z-index: 5; pointer-events: none;
  width: 24vmin; height: 34vmin;
  top: 38vh; left: 20vw;
  opacity: 0;
  transition: opacity 0.18s linear;
}
#bbox::before, #bbox::after,
#bbox .bbox-label::before, #bbox .bbox-label::after { content: ''; position: absolute; width: 22px; height: 22px; border: 2px solid var(--ir); }
#bbox::before { top: 0; left: 0; border-right: none; border-bottom: none; }
#bbox::after { top: 0; right: 0; border-left: none; border-bottom: none; }
#bbox .bbox-label::before { bottom: 0; left: 0; top: auto; border-right: none; border-top: none; }
#bbox .bbox-label::after { bottom: 0; right: 0; top: auto; border-left: none; border-top: none; }
.bbox-label {
  position: absolute; inset: 0;
  font-family: var(--vcr); color: var(--ir); font-size: 1rem;
  display: flex; align-items: flex-start; justify-content: center;
  padding-top: 0.4rem; margin-top: -2.2rem;
  text-shadow: 0 0 6px rgba(141, 255, 79, 0.55);
}

/* ---------- header ---------- */
.site-head {
  position: fixed; top: 0; left: 0; right: 0; z-index: 20;
  display: flex; justify-content: space-between; align-items: center;
  padding: 1.2rem 1.6rem;
  mix-blend-mode: difference; /* stays legible over the paper evidence room */
}
.head-mark { font-family: var(--archivo); font-size: 1rem; letter-spacing: 0.05em; color: var(--bone); }
.head-meta { display: flex; gap: 0.5rem; }
.chip {
  font-family: var(--barlow); font-weight: 600; font-size: 0.72rem;
  letter-spacing: 0.2em; padding: 0.32rem 0.7rem;
  border: 1px solid rgba(232, 228, 216, 0.28); border-radius: 2px;
  color: var(--bone-dim);
}
.chip-green {
  border-color: rgba(141, 255, 79, 0.55); color: var(--ir);
  text-shadow: 0 0 6px rgba(141, 255, 79, 0.4);
}

/* ---------- sections ---------- */
main { position: relative; z-index: 10; }

/* HERO */
.hero {
  height: 100vh;
  display: flex; flex-direction: column; align-items: flex-start; justify-content: center;
  padding: 0 1.5rem 0 clamp(1.5rem, 7vw, 8rem);
}
.hero-eyebrow { margin-bottom: 1.4rem; }
.hero-title {
  font-family: var(--archivo);
  font-size: clamp(4.5rem, 17vw, 17rem);
  line-height: 0.92; letter-spacing: 0.005em;
  color: var(--bone);
}
.hero-title .line { display: block; overflow: hidden; }
.hero-title .chars { display: inline-block; }
.hero-tag {
  font-family: var(--barlow); font-weight: 600;
  font-size: clamp(1.1rem, 2.6vw, 2rem);
  letter-spacing: 0.42em; color: var(--ir);
  text-shadow: 0 0 8px rgba(141, 255, 79, 0.45);
  margin-top: 0.6rem;
}
.hero-sub {
  margin-top: 2rem; font-weight: 400;
  font-size: clamp(1rem, 1.5vw, 1.25rem); line-height: 1.65;
  color: var(--bone-dim); letter-spacing: 0.04em;
}
.scroll-cue {
  position: absolute; bottom: 6.4rem; left: 50%; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 0.7rem;
  color: var(--ir-dim);
}
.cue-line { width: 1px; height: 42px; background: linear-gradient(to bottom, var(--ir), transparent); animation: cuePulse 1.8s ease-in-out infinite; }
@keyframes cuePulse { 0%, 100% { opacity: 0.3; } 50% { opacity: 1; } }

/* FOOTAGE */
.footage { height: 300vh; }
.footage-pin { position: sticky; top: 0; height: 100vh; }
.footage-note {
  position: absolute; top: 12vh; left: 50%; transform: translateX(-50%);
  white-space: nowrap; opacity: 0;
}

/* EVIDENCE — paper room */
/* Phase D.3 — the paper room used to end in a 212-level razor cut with 65-81% of the frame
   below it as dead void (paper/void boundary measured at 31% down the frame at 1920, 18% at
   portrait).  Bottom padding is halved so the cards sit closer to the edge, and the last 13%
   of the paper dissolves into the scene instead of being guillotined by it. */
.evidence {
  background-color: transparent;
  color: var(--ink);
  padding: 14vh clamp(1.5rem, 6vw, 7rem) 9vh;
  position: relative;
  background-image:
    url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='p'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23p)' opacity='0.05'/%3E%3C/svg%3E"),
    linear-gradient(to bottom, var(--paper) 0%, var(--paper) 87%, rgba(232, 228, 216, 0.72) 95%, rgba(232, 228, 216, 0) 100%);
}
.ev-head { display: flex; align-items: flex-start; gap: 3rem; flex-wrap: wrap; margin-bottom: 8vh; }
.ev-head h2 {
  font-family: var(--archivo);
  font-size: clamp(3rem, 9vw, 8.5rem); line-height: 0.9;
  color: var(--ink);
}
.stamp {
  font-family: var(--archivo);
  border: 4px solid var(--red); color: var(--red);
  padding: 0.5rem 1.4rem; letter-spacing: 0.12em;
  transform: rotate(-8deg); opacity: 0.85;
  font-size: clamp(1.2rem, 3vw, 2.4rem);
  width: fit-content;
  mask-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='r'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.4' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23r)' opacity='0.92'/%3E%3C/svg%3E");
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='r'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.4' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23r)' opacity='0.92'/%3E%3C/svg%3E");
}
.stamp-small { position: absolute; top: 8px; right: 8px; font-size: 0.8rem; border-width: 2px; padding: 0.15rem 0.5rem; }
.board {
  position: relative;
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 2rem 1.5rem;
}
.strings { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0; }
.strings path { stroke: rgba(226, 59, 59, 0.55); stroke-width: 2; fill: none; }
.card {
  position: relative; z-index: 1;
  background: #fdfcf7;
  padding: 0.7rem 0.7rem 0.9rem;
  box-shadow: 0 14px 34px rgba(22, 25, 15, 0.28);
  width: 100%;
}
.card img { width: 100%; display: block; }
.card figcaption {
  font-family: var(--barlow); font-weight: 600; font-size: 0.78rem;
  letter-spacing: 0.14em; color: #3a3d2e; margin-top: 0.6rem;
  text-transform: uppercase;
}
.pin {
  position: absolute; top: -9px; left: 50%; transform: translateX(-50%);
  width: 16px; height: 16px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #f0605c, var(--red) 60%, #8f1f1f);
  box-shadow: 0 3px 5px rgba(0, 0, 0, 0.35);
}
.c1 { grid-column: 1 / 4; transform: rotate(-2.5deg); }
.c2 { grid-column: 4 / 8; transform: rotate(1.6deg) translateY(3rem); }
.c3 { grid-column: 8 / 11; transform: rotate(-1.2deg); }
.c4 { grid-column: 2 / 5; transform: rotate(2.2deg) translateY(2rem); }
.c5 { grid-column: 7 / 10; transform: rotate(-2deg) translateY(4.5rem); }
.dark-card img { background: #101408; }
.c2 { position: relative; }
/* the composite now stands IN the frame's clearing — feet on the duff, left of the two lit
   trunks — instead of floating over the caption at an arbitrary offset */
.frame-wrap { position: relative; display: block; line-height: 0; }
.frame-subject {
  position: absolute; top: auto; bottom: 18%; left: 22%; width: 13% !important;
  filter: blur(1.1px) brightness(0.4) contrast(1.15);
  opacity: 0.92;
}
.note-card { background: #f6f2e4; min-height: 260px; display: flex; flex-direction: column; justify-content: space-between; }
.note-co { color: #4b5233; font-size: 1rem; text-shadow: none; }
.note-big {
  font-family: var(--archivo); font-size: clamp(1.4rem, 2.6vw, 2.2rem);
  line-height: 1.02; color: var(--ink); margin: 1rem 0;
}

/* EXHIBIT A */
.exhibit { height: 280vh; }
.exhibit-pin {
  position: sticky; top: 0; height: 100vh; overflow: hidden;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3vh;
}
.ex-title {
  font-family: var(--archivo);
  font-size: clamp(3rem, 10vw, 9.5rem); line-height: 1; color: var(--bone);
  text-align: center;
}
.ex-title span { color: transparent; -webkit-text-stroke: 2px var(--ir); text-shadow: 0 0 30px rgba(141, 255, 79, 0.25); }
.ex-stage {
  display: flex; align-items: center; justify-content: center;
  gap: clamp(1.5rem, 5vw, 5rem); flex-wrap: wrap;
}
.ex-photo {
  width: min(40vmin, 380px);
  background: #fdfcf7; padding: 0.7rem;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.7);
  transform: rotate(-1.5deg);
  position: relative;
  will-change: transform, filter;
}
.ex-photo img { width: 100%; display: block; }
.ex-tag {
  position: absolute; bottom: -1.9rem; left: 0.7rem;
  color: var(--ir);
}
.ex-stats { list-style: none; display: flex; flex-direction: column; gap: 1.4rem; }
.ex-stats li { display: flex; align-items: baseline; gap: 1.1rem; }
.ex-stats .k { font-size: 0.95rem; color: var(--ir-dim); }
.ex-stats .v {
  font-family: var(--archivo); font-size: clamp(0.95rem, 1.8vw, 1.4rem);
  line-height: 1.12; letter-spacing: 0.03em; color: var(--bone);
}
.ex-stats .v.big {
  font-size: clamp(2.8rem, 5.5vw, 4.8rem); color: var(--ir);
  text-shadow: 0 0 18px rgba(141, 255, 79, 0.45);
}

/* HOMELAND */
.homeland {
  height: 160vh;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; gap: 1.6rem; padding: 0 1.5rem;
}
.homeland h2 {
  font-family: var(--archivo);
  font-size: clamp(3rem, 9.5vw, 9rem); line-height: 0.95; color: var(--bone);
  text-shadow: 0 6px 60px rgba(5, 7, 5, 0.9);
}
.homeland h2 em { font-style: normal; color: var(--ir); text-shadow: 0 0 24px rgba(141, 255, 79, 0.45); }
.homeland p { color: var(--bone-dim); }

/* CTA */
.cta {
  min-height: 95vh;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 0 1.5rem;
}
.cta-stack { position: relative; }
.cta-title {
  font-family: var(--archivo);
  font-size: clamp(4rem, 14vw, 14rem); line-height: 0.95;
  color: transparent; -webkit-text-stroke: 2px rgba(232, 228, 216, 0.75);
}
.cta-stamp {
  position: absolute; top: 50%; left: 50%;
  transform: translate(-50%, -50%) rotate(-10deg);
  font-size: clamp(1.6rem, 4.5vw, 3.6rem);
}
.cta-domain { margin-top: 2.6rem; font-size: 1.25rem; }
.cta-honest { margin-top: 0.8rem; color: var(--bone-dim); letter-spacing: 0.05em; }
/* the way home + the one contact route */
.cta-domain a, .cta-honest a, .foot a { color: inherit; text-decoration: none; border-bottom: 1px solid currentColor; }
.cta-domain a:hover, .cta-honest a:hover, .foot a:hover { color: var(--ir, #8dff4f); }

/* FOOTER */
.foot {
  display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
  padding: 1.8rem;
  border-top: 1px solid rgba(232, 228, 216, 0.1);
}
.foot .osd-font { font-size: 0.9rem; color: var(--ir-dim); }
.foot-dim { opacity: 0.55; }
/* keep the footer label clear of the fixed bottom-right OSD readout (SP 120min · AUX IR) */
@media (min-width: 760px) { .foot .foot-dim { margin-right: 11rem; } }

/* ---------- responsive ---------- */
@media (max-width: 760px) {
  .osd-tl { top: 4.2rem; left: 1rem; }
  .osd-tr { top: 4.2rem; right: 1rem; }
  .board { grid-template-columns: repeat(6, 1fr); gap: 1.6rem 1rem; }
  .c1 { grid-column: 1 / 5; }
  .c2 { grid-column: 2 / 7; transform: rotate(1.6deg); }
  .c3 { grid-column: 1 / 5; }
  .c4 { grid-column: 2 / 6; }
  .c5 { grid-column: 1 / 6; transform: rotate(-2deg); }
  .strings { display: none; }
  #bbox { width: 40vmin; height: 56vmin; }
  .ex-stats { flex-direction: row; flex-wrap: wrap; gap: 1rem 2rem; justify-content: center; }
}

@media (prefers-reduced-motion: reduce) {
  .cue-line, #recDot { animation: none; }
}
