/* MindPath Labs trailer: the First light palette in a darker, film-frame setting. */
:root {
  --night: #0b0a09;
  --ink: #121110;
  --panel: #171614;
  --bone: #ece6da;
  --haze: #a39e93;
  --ember: #c4572e;
  --line: rgba(236, 230, 218, 0.12);
  --sans: "Helvetica Neue", Helvetica, Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, monospace;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --bar: clamp(44px, 7vh, 64px);
}
* { box-sizing: border-box; margin: 0; }
html { scroll-behavior: smooth; scroll-snap-type: y proximity; }
html { background: var(--night); }
body { background: transparent; color: var(--bone); font: 17px/1.5 var(--sans); -webkit-font-smoothing: antialiased; overflow-x: hidden; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--ember); outline-offset: 3px; }

/* live 3D landscape behind the scenes (terrain.js) */
#terrain { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; opacity: 0; transition: opacity 3s ease; pointer-events: none; }
#terrain.live { opacity: .58; }
main { position: relative; z-index: 1; }

/* letterbox */
.bar { position: fixed; left: 0; right: 0; height: var(--bar); z-index: 30; background: #000; display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 0 clamp(16px, 3vw, 36px); font: 11px var(--mono); letter-spacing: .2em; color: var(--haze); }
.bar.top { top: 0; }
.bar.bottom { bottom: 0; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--bone); }
.tc { font-variant-numeric: tabular-nums; }
.tc::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--ember); margin-right: 10px; animation: blink 1.6s steps(2) infinite; }
.scrub { flex: 1; max-width: 520px; height: 2px; background: var(--line); position: relative; }
.scrub i { position: absolute; inset: 0 auto 0 0; width: 0; background: var(--ember); }
.talk-link { color: var(--bone); text-decoration: none; border: 1px solid var(--line); padding: 7px 12px; border-radius: 999px; }
.talk-link:hover { border-color: var(--ember); }

/* film grain, vignette and faint scanlines over everything */
.fx { position: fixed; inset: 0; pointer-events: none; z-index: 20;
  background:
    radial-gradient(ellipse at center, transparent 55%, rgba(0, 0, 0, .55) 100%),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, .018) 0 1px, transparent 1px 3px); }
.fx::after { content: ""; position: absolute; inset: -50%; opacity: .07; animation: grain 1s steps(6) infinite;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E"); }

/* scenes */
.scene { min-height: 100vh; padding: calc(var(--bar) + 60px) clamp(20px, 6vw, 96px); display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; gap: 26px; position: relative; scroll-snap-align: start; }
.big { font-size: clamp(42px, 7.5vw, 112px); font-weight: 500; letter-spacing: -.035em; line-height: 1; max-width: 16ch; }
.mid { font-size: clamp(34px, 5vw, 68px); font-weight: 500; letter-spacing: -.03em; line-height: 1.05; }
.small { font: 12px var(--mono); letter-spacing: .28em; color: var(--haze); text-transform: uppercase; }
.lede { font-size: 21px; color: var(--haze); max-width: 40ch; }
.hint { font: 12px var(--mono); letter-spacing: .24em; text-transform: uppercase; color: var(--haze); position: absolute; bottom: calc(var(--bar) + 28px); }
.hint span { display: inline-block; color: var(--ember); animation: nudge 1.4s ease-in-out infinite; }
[data-decode] { font-variant-ligatures: none; }

/* scene 2: the path that keeps escaping */
.switchback { position: absolute; height: 70vh; opacity: .5; }
.switchback path { fill: none; stroke: var(--ember); stroke-width: 1.5; stroke-dasharray: 1; stroke-dashoffset: 1; transition: stroke-dashoffset 3s var(--ease); }
.scene.in .switchback path { stroke-dashoffset: 0; }
.scene h2, .scene p { position: relative; }
.scene .hint { position: absolute; animation: appear 1s ease 1.6s both; }

/* scene 3: first light */
.scene-art { width: min(560px, 80vw); height: auto; overflow: visible; }
.ridge { fill: none; stroke: var(--bone); stroke-width: 14; stroke-dasharray: 1; stroke-dashoffset: 1; }
.sun { fill: var(--ember); transform: translateY(220px); }
.first-light.in .ridge { animation: draw 1.8s var(--ease) .1s forwards; }
.first-light.in .sun { animation: rise 2.4s var(--ease) 1.2s forwards; }
.first-light .title { font-size: clamp(36px, 5.5vw, 80px); }

/* scene 4: the files */
.dossiers { perspective: 1200px; list-style: none; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; width: min(1100px, 100%); text-align: left; }
.file { transform-style: preserve-3d; backdrop-filter: blur(6px); background: color-mix(in srgb, var(--panel) 86%, transparent); border: 1px solid var(--line); border-radius: 4px; padding: 22px 22px 24px; display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto auto; column-gap: 16px; row-gap: 8px; align-items: center; position: relative; transition: border-color .4s; }
.file:hover { border-color: var(--accent); }
.file.reveal.in.tilt { transform: rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)); transition: border-color .4s, transform .15s linear; }
.file::before { content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity .4s;
  background: radial-gradient(380px circle at var(--mx, 50%) var(--my, 50%), color-mix(in srgb, var(--accent) 16%, transparent), transparent 60%); }
.file:hover::before { opacity: 1; }
.file .no { grid-column: 1 / -1; font: 10px var(--mono); letter-spacing: .24em; color: var(--accent); }
.file img { border-radius: 12px; grid-row: 2 / 4; }
.file img.light { background: #fff; }
.file h3 { font-size: 13px; font-weight: 500; letter-spacing: .24em; text-transform: uppercase; }
.file h3 a { color: inherit; text-decoration: underline 1px var(--accent); text-underline-offset: 4px; }
.redact { color: var(--haze); font-size: 15px; position: relative; }
.redact::after { content: ""; position: absolute; inset: 0 -4px; background: #000; transform-origin: right; transition: transform .9s var(--ease) calc(var(--d, 0s) + .5s); }
.file.in .redact::after { transform: scaleX(0); }

/* scene 5: capabilities */
.can { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.can li { font-size: clamp(26px, 3.8vw, 52px); font-weight: 500; letter-spacing: -.025em; line-height: 1.15; opacity: .25; transition: opacity .8s; }
.can li.in { opacity: 1; }
.can li.ember { color: var(--ember); }

/* scene 6: classified */
.classified { position: relative; width: min(560px, 90vw); padding: 34px 30px; border: 1px dashed var(--line); display: flex; flex-direction: column; gap: 14px; }
.classified p { display: flex; gap: 10px; }
.classified b { display: block; height: 16px; width: 100%; background: #000; border: 1px solid #1d1c1a; }
.classified .w80 { width: 80%; } .classified .w60 { width: 60%; } .classified .w50 { width: 50%; } .classified .w40 { width: 40%; }
.stamp { z-index: 2; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%) rotate(-8deg) scale(1.6); opacity: 0; font: 600 22px var(--mono); letter-spacing: .3em; color: var(--ember); border: 2px solid var(--ember); padding: 8px 16px; transition: transform .5s cubic-bezier(.3, 1.6, .5, 1) 1.4s, opacity .2s 1.4s; }
.classified.in .stamp { opacity: .9; transform: translate(-50%, -50%) rotate(-8deg) scale(1); }

/* scene 7: let's talk */
.transmit { width: min(680px, 100%); display: grid; grid-template-columns: 1fr 1fr; gap: 14px; text-align: left; margin-top: 10px; }
.transmit label { display: flex; flex-direction: column; gap: 8px; font: 11px var(--mono); letter-spacing: .22em; text-transform: uppercase; color: var(--haze); }
.transmit .wide { grid-column: 1 / -1; }
.transmit input, .transmit textarea { font: 17px var(--sans); color: var(--bone); background: var(--panel); border: 1px solid var(--line); border-radius: 4px; padding: 14px 16px; letter-spacing: 0; text-transform: none; resize: vertical; transition: border-color .3s; }
.transmit input:focus, .transmit textarea:focus { outline: none; border-color: var(--ember); }
.transmit button { grid-column: 1 / -1; justify-self: start; font: 13px var(--sans); letter-spacing: .16em; text-transform: uppercase; color: var(--night); background: var(--bone); border: 0; border-radius: 999px; padding: 15px 28px; cursor: pointer; transition: transform .25s var(--ease), background .25s; }
.transmit button:hover { background: #fff; transform: translateY(-2px); }
.transmit button span { color: var(--ember); }
.status { grid-column: 1 / -1; font: 12px var(--mono); letter-spacing: .18em; text-transform: uppercase; color: var(--ember); min-height: 1.5em; }

/* scene 8: end card */
.end-mark { border-radius: 22px; }
.end-name { font-size: 18px; letter-spacing: .5em; margin-right: -.5em; }

/* scroll reveal (trailer.js adds .in) */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity 1s var(--ease) var(--d, 0s), transform 1s var(--ease) var(--d, 0s); }
.reveal.in { opacity: 1; transform: none; }

@keyframes appear { from { opacity: 0; } }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes rise { to { transform: none; } }
@keyframes blink { 50% { opacity: .2; } }
@keyframes nudge { 50% { transform: translateX(5px); } }
@keyframes grain { 0% { transform: translate(0, 0); } 33% { transform: translate(-4%, 3%); } 66% { transform: translate(3%, -5%); } 100% { transform: translate(-2%, 2%); } }

@media (max-width: 900px) {
  .dossiers { grid-template-columns: 1fr; }
  .transmit { grid-template-columns: 1fr; }
  .scrub { display: none; }
}
@media (max-width: 520px) {
  .scene-name { display: none; }
  .bar { justify-content: space-between; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal, .can li { opacity: 1; transform: none; }
  .ridge, .switchback path { stroke-dashoffset: 0; }
  .sun { transform: none; }
  .redact::after { transform: scaleX(0); }
  .stamp { opacity: .9; transform: translate(-50%, -50%) rotate(-8deg); }
}
