/* content-tunnel.css: the opening of /content. Draft 2026-12-04, founder review before live.

   Two states, one markup:
     base (no JavaScript, reduced motion, or the script failed): the headline over a still collage
       of our own posts. Calm, complete, one screen tall.
     .ctt-on (added by content-tunnel.js): the section grows tall, the stage sticks to the window,
       and the page's own scroll flies a camera down a tunnel whose walls are the same posts.
   The headline and the buttons are never hidden on the first screen, never faded in.
   No box-shadows anywhere (tokens.css removes them): depth comes from fog, light falloff, hairline
   rims and a glass sheen on each frame. */

.ctt{position:relative; isolation:isolate; background:var(--bg)}
/* the same height in both states (100lvh, like the sticky stage), so the headline never moves when the
   tunnel switches on */
.ctt-stage{position:relative; min-height:100vh; display:grid; place-items:center;
  padding:clamp(88px,11vh,120px) 0 clamp(40px,6vh,72px); overflow:clip}

/* ── the copy, in the middle of the screen ── */
.ctt-copy{position:relative; z-index:3; width:min(100% - 32px, 760px); text-align:center;
  display:flex; flex-direction:column; align-items:center}
.ctt-copy .label{justify-content:center; color:#B9BEC3}   /* brighter than the usual label: it sits over the tunnel */
.ctt-copy .ct-h1{font-size:clamp(46px,7vw,104px)}
.ctt-copy .ct-sub{margin-left:auto; margin-right:auto; max-width:34ch; color:#C3C7CB}
.ctt-copy .ct-actions{justify-content:center}
.ctt-copy .ct-fine{margin-left:auto; margin-right:auto}

/* ── the fog: a dark pool behind the words, and the light at the far end of the tunnel ── */
.ctt-fog{position:absolute; inset:0; z-index:2; pointer-events:none;
  background:radial-gradient(120% 90% at 50% 50%, transparent 52%, rgba(8,9,11,.72) 100%)}
/* the pool of shade behind the words keeps them readable while the tunnel flies past */
.ctt-fog::before{content:''; position:absolute; inset:0;
  background:radial-gradient(42% 44% at 50% 52%, rgba(8,9,11,.9), rgba(8,9,11,.76) 48%, rgba(8,9,11,.32) 80%, transparent 100%)}
.ctt-fog::after{content:''; position:absolute; inset:0; opacity:var(--ctt-spd,0);
  background:radial-gradient(90% 75% at 50% 50%, transparent 46%, rgba(4,5,7,.78) 100%)}

/* ── base: the still collage ── */
/* Shown only when the tunnel is not: reduced motion, no JavaScript (a noscript copy), or when the script
   gives up (.ctt-still). Otherwise display:none, so its lazy pictures are never fetched. */
.ctt-collage{position:absolute; inset:-4% -2%; z-index:1; display:none; pointer-events:none;
  grid-template-columns:repeat(6,1fr); gap:clamp(10px,1.2vw,18px); align-content:center;
  opacity:.4; transform:perspective(1400px) rotateX(9deg) scale(1.04)}
.ctt-c, .ctt-t{position:relative; display:block; overflow:hidden; border-radius:var(--r-card,14px);
  background:#0D0F12; border:1px solid rgba(242,243,241,.13)}
.ctt-c{aspect-ratio:9/16}
.ctt-c img, .ctt-t img, .ctt-t video{position:absolute; inset:0; width:100%; height:100%; object-fit:cover; display:block}
/* glass: a soft sheen from the top left, and a thin bright rim along the top edge */
.ctt-c::after, .ctt-t::after{content:''; position:absolute; inset:0; border-radius:inherit; pointer-events:none;
  background:
    linear-gradient(128deg, rgba(255,255,255,.16) 0%, rgba(255,255,255,.05) 22%, transparent 42%),
    linear-gradient(180deg, rgba(255,255,255,.10), transparent 1.5%),
    linear-gradient(0deg, rgba(0,0,0,.28), transparent 30%)}
.ctt.ctt-still .ctt-collage, .ctt-collage.ctt-ns{display:grid}
@media (prefers-reduced-motion: reduce){ .ctt-collage{display:grid} }
.ctt-c:nth-child(n+7){transform:translateY(8%)}
@media (max-width:760px){
  .ctt-collage{grid-template-columns:repeat(3,1fr); inset:-6% -18%; opacity:.36}
  .ctt-c:nth-child(n+7){transform:none}
  .ctt-c:nth-child(3n+2){transform:translateY(-12%)}
}

/* ── the tunnel ── */
.ctt-scene{display:none}
.ctt.ctt-on{height:var(--ctt-run,330vh)}
.ctt.ctt-on .ctt-stage{position:sticky; top:0; height:100vh; min-height:0}
@supports (height:100lvh){ .ctt-stage{min-height:100lvh} .ctt.ctt-on .ctt-stage{height:100lvh} }
.ctt.ctt-on .ctt-scene{display:block; position:absolute; inset:0; z-index:1; pointer-events:none; perspective:var(--ctt-p,820px);
  perspective-origin:50% 50%; opacity:0; transition:opacity .9s var(--ease-out,ease)}
.ctt.ctt-on.ctt-lit .ctt-scene{opacity:1}
/* the far light: a faint blue glow where the walls meet */
.ctt.ctt-on .ctt-stage::before{content:''; position:absolute; inset:0; z-index:0; pointer-events:none;
  background:radial-gradient(22% 26% at 50% 50%, rgba(var(--orb-glow),.20), rgba(var(--orb-glow),.05) 55%, transparent 80%)}

.ctt-world{position:absolute; left:50%; top:50%; width:0; height:0; transform-style:preserve-3d}
.ctt-t{position:absolute; left:calc(var(--tw) / -2); top:calc(var(--th) / -2); width:var(--tw); height:var(--th);
  backface-visibility:hidden; -webkit-backface-visibility:hidden; opacity:0}
.ctt-t img, .ctt-t video{opacity:0; transition:opacity .5s ease}
.ctt-t.ld img, .ctt-t video.ld{opacity:1}
/* fog darkens a frame (content-tunnel.js sets brightness), it never turns it see-through,
   so near frames still hide the ones behind them the way real objects do */

@media (max-width:760px){
  .ctt-stage{padding:92px 0 32px}
  .ctt{--ctt-run:230vh}
  /* the words cover most of a phone's width, so the band behind them is darker and wider */
  .ctt-fog{background:radial-gradient(130% 80% at 50% 50%, transparent 50%, rgba(8,9,11,.7) 100%)}
  .ctt-fog::before{background:
    linear-gradient(180deg, transparent 14%, rgba(8,9,11,.62) 26%, rgba(8,9,11,.74) 40%, rgba(8,9,11,.74) 70%, rgba(8,9,11,.5) 82%, transparent 92%),
    radial-gradient(70% 34% at 50% 52%, rgba(8,9,11,.6), transparent 100%)}
}

@media (prefers-reduced-motion: reduce){
  .ctt-t img, .ctt-t video, .ctt.ctt-on .ctt-scene{transition:none}
}
