/* the reel (js/reel.js): a tall section whose stage sticks to the viewport while
   the scroll flies a three.js camera past each demo. */
.reel { display: none; --reel-lead: 12vh; --edge: max(var(--m), calc(50vw - 800px)); } /* --edge: on very wide screens the words stay near the demo, not at the window's edge */
html.reel-on .reel { display: block; position: relative; background: #070a14; } /* dark under the stage too: no hairline where the band meets it */

.reel-stage {
  position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden;
  color: #fff;
  background: #070a14; /* reel.js paints the backdrop in the canvas */
}
.reel-gl { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }

.reel-hud {
  position: absolute; z-index: 3; left: var(--edge); right: var(--edge); top: 30px;
  display: flex; align-items: center; gap: 18px;
  font: 500 13px/1 var(--mono); letter-spacing: .02em; color: rgba(255, 255, 255, .85);
}
.reel-title { font-weight: 600; color: #fff; }
.reel-group { margin-right: auto; padding-left: 18px; border-left: 1px solid rgba(255, 255, 255, .3); } /* "at exowatt" / "personal": reel.js keeps it on the current stop */
.reel-bar { width: min(220px, 30vw); height: 2px; background: rgba(255, 255, 255, .18); overflow: hidden; }
@media (max-width: 1200px) { .reel-hud { top: 78px; } } /* below the dock, which takes the middle of the top */
.reel-bar i { display: block; height: 100%; transform-origin: 0 50%; transform: scaleX(0); background: #fff; }

.reel-copy {
  position: absolute; z-index: 2; top: 50%; translate: 0 -50%;
  width: min(40vw, 580px); opacity: 0; pointer-events: none; /* reel.js fades the current stop in. never visibility:hidden (keyboard + screen readers) */
  will-change: transform, opacity;
}
.reel-copy:nth-of-type(odd) { left: var(--edge); }   /* screen on the right */
.reel-copy:nth-of-type(even) { right: var(--edge); }  /* screen on the left */
.reel-kicker { font: 500 13px/1.3 var(--mono); letter-spacing: .02em; color: rgba(255, 255, 255, .86); }
.reel-copy, .reel-hud { text-shadow: 0 1px 2px rgba(7, 10, 20, .5), 0 1px 16px rgba(7, 10, 20, .6); } /* the backdrop moves: the words keep their own shade */
/* and a soft dark pool under each block of words, so they read the same wherever the colour drifts */
.reel-copy::before { content: ''; position: absolute; inset: -70px -90px; z-index: -1; pointer-events: none; background: radial-gradient(closest-side, rgba(7, 10, 20, .62), rgba(7, 10, 20, .4) 55%, rgba(7, 10, 20, 0)); }
.reel-pitch { color: #fff; }
.reel-name { margin-top: 14px; font-weight: 600; font-size: clamp(44px, 5.2vw, 96px); line-height: .9; letter-spacing: -0.06em; color: #fff; padding-bottom: .06em; }
.reel-pitch { margin-top: 20px; font-size: clamp(17px, 1.45vw, 21px); line-height: 1.45; letter-spacing: -0.01em; color: rgba(255, 255, 255, .86); max-width: 34ch; }
.reel-links { margin-top: 12px; display: flex; flex-wrap: wrap; gap: 0 22px; font-size: 15px; font-weight: 500; }
.reel-links a { display: inline-flex; align-items: center; min-height: 44px; color: #fff; text-decoration: underline; text-decoration-color: rgba(255, 255, 255, .4); text-underline-offset: 5px; text-decoration-thickness: 1.5px; }
.reel-links a:hover { text-decoration-color: #fff; }
.reel-btn { height: 44px; padding: 0 20px; border: 0; border-radius: 999px; font: 500 15px/1 var(--sans); color: #0b1020; background: #fff; cursor: pointer; } /* fixed ink: the button is white in both themes */

.reel-end {
  position: absolute; z-index: 2; left: 0; right: 0; bottom: 0; text-align: center;
  padding: 16vh var(--m) 9vh; opacity: 0; pointer-events: none;
  background: linear-gradient(rgba(7, 10, 20, 0), rgba(7, 10, 20, .88) 42%, #070a14); /* a dark floor, so the words and the button never sit on a screen */
}
.reel-end p { font-weight: 600; font-size: clamp(28px, 3.6vw, 52px); letter-spacing: -0.04em; line-height: 1.05; margin: 0 auto 22px; max-width: 18ch; text-wrap: balance; }

@media (max-width: 760px), (max-aspect-ratio: 9/10) {

  .reel-copy, .reel-copy:nth-of-type(odd), .reel-copy:nth-of-type(even) { left: var(--m); right: var(--m); width: auto; top: auto; bottom: 7vh; translate: none; }
  .reel-name { font-size: clamp(48px, 15vw, 76px); margin-top: 8px; }
  .reel-pitch { margin-top: 12px; font-size: 16px; }
  .reel-links { margin-top: 6px; }
  .reel-hud { top: 72px; gap: 12px; white-space: nowrap; }
  /* phones: the words sit along the bottom, so the shade is a floor under all of them */
  .reel-copy::before { display: none; }
  .reel-stage::after { content: ''; position: absolute; inset: 42% 0 0; z-index: 1; pointer-events: none; background: linear-gradient(rgba(7, 10, 20, 0), rgba(7, 10, 20, .72) 45%, rgba(7, 10, 20, .86)); }
  .reel-group { padding-left: 12px; }
  .reel-end { padding-bottom: 7vh; }
  .reel-bar { width: 22vw; }
}

/* ease from the page into the dark reel and back out, instead of a hard edge. short: a tall band reads as a blank */
html.reel-on .reel::before { content: ""; display: block; height: var(--reel-lead); background: linear-gradient(var(--bg), color-mix(in srgb, var(--c2) 45%, #070a14) 55%, color-mix(in srgb, var(--c0) 35%, #070a14) 80%, #070a14); }
/* the way out is its own element: inside the section the sticky stage would cover it */
.reel-fade { display: none; }
html.reel-on .reel-fade { display: block; height: 12vh; background: linear-gradient(#070a14, color-mix(in srgb, var(--c0) 35%, #070a14) 22%, color-mix(in srgb, var(--c2) 45%, #070a14) 48%, var(--bg)); }
/* every stage starts from the flat dark the band (or the reel) above it ends on, so there's no seam */
.reel-stage::before { content: ''; position: absolute; inset: 0 0 auto; height: 18vh; z-index: 1; pointer-events: none; background: linear-gradient(#070a14, rgba(7, 10, 20, 0)); }
/* the dock's "projects" lands with the reel pinned, not on the band above it */
#projects { scroll-margin-top: calc(-1 * var(--reel-lead) - 80px); }
html:not(.reel-on) #projects { scroll-margin-top: 0; }

/* no webgl2, or reduced motion: reel.js never starts. the reel becomes a plain dark list of the same words. */
html:not(.reel-on) #projects { display: block; padding: clamp(48px, 9vh, 88px) 0; color: #fff;
  background:
    repeating-radial-gradient(ellipse 120% 90% at 20% -10%, rgba(255, 255, 255, 0) 0 38px, rgba(255, 255, 255, .035) 38px 39px),
    radial-gradient(70% 55% at 12% 8%, color-mix(in srgb, var(--c1) 34%, transparent), transparent 70%),
    radial-gradient(60% 60% at 92% 38%, color-mix(in srgb, var(--c2) 30%, transparent), transparent 70%),
    radial-gradient(80% 50% at 40% 104%, color-mix(in srgb, var(--c0) 46%, transparent), transparent 72%),
    #070a14; }
html:not(.reel-on) #projects .reel-copy::before, html:not(.reel-on) #projects .reel-stage::before, html:not(.reel-on) #projects .reel-stage::after { display: none; }
html:not(.reel-on) #projects .reel-stage { position: static; height: auto; overflow: visible; background: none; max-width: 1180px; margin: 0 auto; padding: 0 var(--m); display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 36px 40px; }
html:not(.reel-on) #projects .reel-gl, html:not(.reel-on) #projects .reel-count, html:not(.reel-on) #projects .reel-group, html:not(.reel-on) #projects .reel-bar { display: none; }
html:not(.reel-on) #projects .reel-hud, html:not(.reel-on) #projects .reel-end { position: static; grid-column: 1 / -1; }
html:not(.reel-on) #projects .reel-copy { position: static; translate: none; width: auto; opacity: 1; pointer-events: auto; }
html:not(.reel-on) #projects .reel-name { font-size: clamp(30px, 4vw, 40px); line-height: 1; }
html:not(.reel-on) #projects .reel-pitch { font-size: 16px; max-width: none; }
html:not(.reel-on) #projects .reel-end { opacity: 1; pointer-events: auto; text-align: left; padding: 0; background: none; }
html:not(.reel-on) #projects .reel-end p { margin-left: 0; font-size: 22px; max-width: none; }
html:not(.reel-on) #projects .reel-copy .reel-btn { display: none; } /* one ask at the end, not six */
