/* Home: cinematic film-reel of projects + slide-over project panel. */
:root {
  --black: #0a0908;
  --base: #131110;
  --cream: #f1ebe1;
  --cream-2: #b9b1a5;
  --dim: #7c756b;
  --line: rgb(241 235 225 / .14);
  --ember: #d0643f;
  --serif: "Instrument Serif", Georgia, serif;
  --sans: "Geist", system-ui, "Segoe UI", sans-serif;
  --mono: "Geist Mono", ui-monospace, Consolas, monospace;
  --pad: clamp(16px, 2.6vw, 36px);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--black);
  color: var(--cream);
  font: 400 16px/1.55 var(--sans);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
img, video { display: block; max-width: 100%; }
:focus-visible { outline: 2px solid var(--ember); outline-offset: 3px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.mono { font: 400 11px/1.4 var(--mono); letter-spacing: .12em; text-transform: uppercase; }

/* ---------- chrome ---------- */
.top {
  position: fixed; inset: 0 0 auto; z-index: 20;
  display: flex; justify-content: space-between; align-items: flex-start; gap: 16px;
  padding: var(--pad);
  pointer-events: none;
}
.top > * { pointer-events: auto; }
.brand { text-decoration: none; display: grid; gap: 4px; }
.brand b { font: 500 14px/1 var(--sans); letter-spacing: .2em; text-transform: uppercase; }
.brand span { color: var(--dim); }
.menu { display: flex; gap: clamp(14px, 2.4vw, 30px); list-style: none; margin: 0; padding: 0; }
.menu a { text-decoration: none; color: var(--cream-2); transition: color .2s; }
.menu a:hover, .menu a[aria-current] { color: var(--cream); }

.hud {
  position: fixed; left: var(--pad); bottom: var(--pad); z-index: 20;
  max-width: min(36vw, 460px);
  pointer-events: none;
}
.hud__count { color: var(--dim); display: flex; gap: 10px; align-items: center; }
.hud__count i { display: block; width: 36px; height: 1px; background: var(--line); }
.hud__title {
  font: 400 clamp(42px, 4.6vw, 74px)/.95 var(--serif);
  letter-spacing: -.02em;
  margin: 14px 0 12px;
}
.hud__title em { color: var(--ember); }
.hud__kind { color: var(--cream-2); }
.hud [data-swap] { transition: opacity .35s ease, transform .35s ease; }
.hud.is-swapping [data-swap] { opacity: 0; transform: translateY(8px); }

.hint {
  position: fixed; right: var(--pad); bottom: var(--pad); z-index: 20;
  color: var(--dim); text-align: right; pointer-events: none;
}
.hint b { color: var(--cream-2); font-weight: 400; }

/* ---------- reel ---------- */
.reel { position: fixed; inset: 0; touch-action: none; cursor: grab; user-select: none; -webkit-user-select: none; }
.reel.is-dragging { cursor: grabbing; }
.reel canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.reel__frames { position: absolute; inset: 0; list-style: none; margin: 0; padding: 0; }
.reel__strip { position: absolute; left: 0; right: 0; background: var(--base); }

.frame {
  position: absolute; left: 0; top: 0;
  display: block; text-decoration: none;
  border-radius: 10px; overflow: hidden;
  will-change: transform;
  background: #000;
}
.frame img, .frame video {
  width: 100%; height: 100%; object-fit: cover;
  filter: saturate(.8) contrast(1.05);
  transition: filter .5s, opacity .5s;
  pointer-events: none;
}
.frame:not(.is-active) img, .frame:not(.is-active) video { filter: saturate(.25) brightness(.45); }
.frame__code {
  position: absolute; left: 14px; top: 100%;
  transform: translateY(4px); line-height: 1;
  color: #e9a45b; opacity: .55; white-space: nowrap;
  font-size: 9px; letter-spacing: .3em;
  pointer-events: none;
}
.frame-wrap { position: absolute; left: 0; top: 0; will-change: transform; }

/* WebGL draws the media; DOM frames stay as hit targets and labels */
.has-gl .frame { background: transparent; overflow: visible; }
.has-gl .frame img, .has-gl .frame video { opacity: 0; }
.has-gl .reel__strip { display: none; }

.shade { position: fixed; left: 0; right: 0; height: 15vh; pointer-events: none; z-index: 5; }
.shade--top { top: 0; background: linear-gradient(var(--black) 8%, transparent); }
.shade--bottom { bottom: 0; background: linear-gradient(transparent, var(--black) 92%); }

/* ---------- cursor ---------- */
.cursor {
  position: fixed; left: 0; top: 0; z-index: 30;
  width: 88px; height: 88px; margin: -44px 0 0 -44px;
  border-radius: 50%;
  display: grid; place-items: center;
  border: 1px solid rgb(241 235 225 / .5);
  color: var(--cream);
  pointer-events: none;
  transform: translate3d(-200px, -200px, 0) scale(.35);
  transition: background .25s, border-color .25s, opacity .25s;
  opacity: 0;
  mix-blend-mode: normal;
}
.cursor span { opacity: 0; transition: opacity .2s; }
.cursor.is-on { opacity: 1; }
.cursor.is-view { background: var(--cream); color: var(--black); border-color: var(--cream); }
.cursor.is-view span, .cursor.is-drag span { opacity: 1; }
@media (hover: none), (pointer: coarse) { .cursor { display: none; } }

/* ---------- panel ---------- */
.panel {
  position: fixed; inset: 0; z-index: 40;
  visibility: hidden;
}
.panel.is-open { visibility: visible; }
.panel__backdrop {
  position: absolute; inset: 0; background: rgb(0 0 0 / .6);
  opacity: 0; transition: opacity .5s ease;
  backdrop-filter: blur(3px);
}
.panel.is-open .panel__backdrop { opacity: 1; }
.panel__sheet {
  position: absolute; top: 0; right: 0; bottom: 0;
  width: min(820px, 100vw);
  background: #15130f;
  border-left: 1px solid var(--line);
  overflow-y: auto; overscroll-behavior: contain;
  transform: translateX(100%);
  transition: transform .65s cubic-bezier(.7, 0, .2, 1);
}
.panel.is-open .panel__sheet { transform: none; }
.panel__close {
  position: sticky; top: 0; z-index: 2;
  display: flex; justify-content: space-between; align-items: center;
  padding: 18px var(--pad);
  background: linear-gradient(#15130f 70%, transparent);
}
.panel__close button {
  font: inherit; color: var(--cream); background: none; cursor: pointer;
  border: 1px solid var(--line); border-radius: 999px; padding: 9px 16px;
}
.panel__close button:hover { background: var(--cream); color: var(--black); }
.panel__body { padding: 8px var(--pad) 72px; }
.panel__kicker { color: var(--ember); }
.panel h2 {
  font: 400 clamp(52px, 7vw, 98px)/.92 var(--serif); letter-spacing: -.01em;
  margin: 14px 0 22px;
}
.panel__lede { font: 400 clamp(22px, 2vw, 27px)/1.35 var(--serif); color: var(--cream-2); margin: 0 0 32px; max-width: 40ch; }
.panel__hero { border-radius: 8px; overflow: hidden; margin: 0 0 32px; background: #000; }
.panel__hero img, .panel__hero video { width: 100%; aspect-ratio: 16/9; object-fit: cover; }
.panel__meta {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 18px 24px; margin: 0 0 40px; padding: 20px 0;
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
}
.panel__meta dt { color: var(--dim); margin-bottom: 6px; }
.panel__meta dd { margin: 0; font-size: 15px; }
.panel__section { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 24px; margin: 0 0 36px; }
.panel__section h3 { color: var(--dim); margin: 4px 0 0; font-weight: 400; }
.panel__section p, .panel__section li { font: 400 16.5px/1.65 var(--sans); color: var(--cream); }
.panel__section p { margin: 0 0 1em; }
.panel__section ul { margin: 0; padding-left: 1.1em; }
.panel__section li { margin-bottom: .45em; }
.panel__section li::marker { color: var(--dim); }
.panel__gallery { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 8px 0 40px; }
.panel__gallery figure { margin: 0; }
.panel__gallery figure.wide { grid-column: 1 / -1; }
.panel__gallery img { width: 100%; border-radius: 6px; }
.panel__gallery figcaption { color: var(--dim); margin-top: 8px; }
.panel__links { display: flex; flex-wrap: wrap; gap: 12px; }
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 18px; border-radius: 999px;
  border: 1px solid var(--line); text-decoration: none; font-size: 14px;
}
.btn:hover { background: var(--cream); color: var(--black); }
.btn--ember { background: var(--ember); border-color: var(--ember); color: #fff; }
.btn--ember:hover { background: var(--cream); border-color: var(--cream); }
.panel__next { margin-top: 56px; padding-top: 24px; border-top: 1px solid var(--line); }
.panel__next a { display: block; text-decoration: none; font: 400 clamp(34px, 4vw, 52px)/1.05 var(--serif); margin-top: 10px; }
.panel__next a:hover { color: var(--ember); }

@media (max-width: 720px) {
  .hud { max-width: none; right: var(--pad); }
  .hint { display: none; }
  .brand span { display: none; }
  .panel__section { grid-template-columns: 1fr; gap: 8px; }
  .panel__gallery { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  .panel__sheet, .panel__backdrop, .hud [data-swap] { transition: none; }
}

.has-cursor .reel, .has-cursor .reel * { cursor: none; }
.panel__sheet:focus { outline: none; }
@media (max-width: 720px) {
  .frame__code { display: none; }
}
.panel__gallery video { width: 100%; border-radius: 6px; background: #000; }
@media (max-width: 620px) { .menu__ext { display: none; } }

/* ---------- welcome screen ---------- */
.intro { display: none; }
.intro-open .intro {
  display: block; position: fixed; inset: 0; z-index: 60;
  background: var(--black); overflow: hidden;
  clip-path: inset(0 0 0 0);
  transition: clip-path .7s cubic-bezier(.7, 0, .25, 1);
}
.intro.is-leaving { clip-path: inset(50% 0 50% 0); }
.intro.is-leaving .intro__content, .intro.is-leaving .intro__chrome { opacity: 0; transition: opacity .25s; }

.intro__bg { position: absolute; inset: 0; }
.intro__bg img {
  position: absolute; inset: -4%; width: 108%; height: 108%; object-fit: cover;
  opacity: 0; filter: saturate(.3) brightness(.3) blur(4px);
  animation: introPan 9s linear infinite;
}
.intro__bg img.is-on { opacity: 1; transition: opacity 1.6s ease; }
.intro__bg img:not(.is-on) { transition: opacity 1.6s ease; }
@keyframes introPan { from { transform: scale(1) translateX(0); } to { transform: scale(1.06) translateX(-1.5%); } }
.intro__bg::after {
  content: ""; position: absolute; inset: 0;
  background:
    linear-gradient(90deg, rgb(10 9 8 / .94) 0%, rgb(10 9 8 / .72) 48%, rgb(10 9 8 / .35) 100%),
    radial-gradient(ellipse at 50% 50%, transparent 40%, rgb(0 0 0 / .7) 100%);
}
.intro__grain {
  position: absolute; inset: -50%; opacity: .14; pointer-events: none; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='220' height='220'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  animation: introGrain .9s steps(6) infinite;
}
@keyframes introGrain { 0% { transform: translate(0, 0); } 50% { transform: translate(-6%, 4%); } 100% { transform: translate(3%, -5%); } }

.intro__chrome { position: absolute; inset: var(--pad); pointer-events: none; color: var(--dim); }
.intro__chrome i { position: absolute; width: 22px; height: 22px; border-color: rgb(241 235 225 / .35); border-style: solid; border-width: 0; }
.intro__chrome i:nth-child(1) { top: 0; left: 0; border-top-width: 1px; border-left-width: 1px; }
.intro__chrome i:nth-child(2) { top: 0; right: 0; border-top-width: 1px; border-right-width: 1px; }
.intro__chrome i:nth-child(3) { bottom: 0; left: 0; border-bottom-width: 1px; border-left-width: 1px; }
.intro__chrome i:nth-child(4) { bottom: 0; right: 0; border-bottom-width: 1px; border-right-width: 1px; }
.intro__tc { position: absolute; right: 34px; bottom: 6px; }
.intro__rec { position: absolute; left: 34px; bottom: 6px; display: flex; gap: 8px; align-items: center; }
.intro__rec b { width: 7px; height: 7px; border-radius: 50%; background: var(--ember); animation: introBlink 1.2s steps(2) infinite; }
@keyframes introBlink { 50% { opacity: .15; } }

.intro__skip {
  position: absolute; top: var(--pad); right: var(--pad); z-index: 2;
  color: var(--cream-2); text-decoration: none; padding: 10px 4px;
}
.intro__skip:hover { color: var(--cream); }

.intro__content {
  position: relative; z-index: 1; height: 100%;
  display: flex; flex-direction: column; justify-content: center;
  max-width: 1180px; margin: 0 auto; padding: 72px clamp(24px, 6vw, 88px);
  transition: opacity .3s;
}
.intro__kicker { color: var(--ember); margin: 0 0 18px; }
.intro__name {
  font: 400 clamp(64px, 11vw, 176px)/.86 var(--serif); letter-spacing: -.01em;
  margin: 0 0 14px; color: var(--cream);
}
.intro__name em { color: var(--ember); }
.intro__role { font: 400 clamp(24px, 2.6vw, 36px)/1.2 var(--serif); font-style: italic; color: var(--cream); margin: 0 0 12px; }
.intro__who { font: 400 clamp(15px, 1.3vw, 18px)/1.55 var(--sans); color: var(--cream-2); max-width: 44ch; margin: 0 0 40px; }
.intro__help-label { color: var(--dim); margin: 0 0 12px; }
.intro__help ol {
  list-style: none; margin: 0 0 38px; padding: 0;
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 32px; max-width: 760px;
  border-top: 1px solid var(--line);
}
.intro__help li {
  display: flex; gap: 14px; align-items: baseline; padding: 12px 0;
  border-bottom: 1px solid var(--line); font-size: 15px; line-height: 1.4;
}
.intro__help li .mono { color: var(--ember); flex: none; }
.intro__go { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.intro__hint { color: var(--dim); margin: 0; }

/* ticket-stub Enter button */
.ticket {
  --notch: 9px;
  display: inline-flex; align-items: stretch; padding: 0; border: 0; cursor: pointer;
  background: none; color: var(--black); font: 500 13px/1 var(--mono); letter-spacing: .2em; text-transform: uppercase;
  filter: drop-shadow(0 10px 30px rgb(208 100 63 / .25));
  transition: transform .2s;
}
.ticket:hover { transform: translateY(-2px); }
.ticket > span {
  background: var(--cream); padding: 19px 26px;
  -webkit-mask: radial-gradient(circle var(--notch) at 0 0, #0000 98%, #000) top left,
                radial-gradient(circle var(--notch) at 0 100%, #0000 98%, #000) bottom left;
  -webkit-mask-size: 100% 51%; -webkit-mask-repeat: no-repeat;
          mask: radial-gradient(circle var(--notch) at 0 0, #0000 98%, #000) top left,
                radial-gradient(circle var(--notch) at 0 100%, #0000 98%, #000) bottom left;
          mask-size: 100% 51%; mask-repeat: no-repeat;
}
.ticket__main { border-radius: 6px 0 0 6px; -webkit-mask: none !important; mask: none !important; }
.ticket__stub { border-left: 2px dashed var(--black); border-radius: 0 6px 6px 0; padding-inline: 20px !important; }
.ticket:focus-visible { outline: 2px solid var(--ember); outline-offset: 5px; }

/* staged reveal */
.intro [data-in] { opacity: 0; transform: translateY(18px); }
.intro.is-playing [data-in] {
  animation: introIn .9s cubic-bezier(.2, .7, .2, 1) forwards;
  animation-delay: calc(var(--d, 0) * 1s);
}
.intro__name .line { display: block; overflow: hidden; padding-bottom: .06em; }
.intro__name .line > span { display: inline-block; transform: translateY(105%); }
.intro.is-playing .intro__name .line > span { animation: introRise 1.1s cubic-bezier(.2, .8, .1, 1) forwards; animation-delay: calc(var(--d, 0) * 1s); }
@keyframes introIn { to { opacity: 1; transform: none; } }
@keyframes introRise { to { transform: none; } }

@media (max-width: 720px) {
  .intro__content { justify-content: flex-end; padding-bottom: 64px; }
  .intro__help ol { grid-template-columns: 1fr; margin-bottom: 28px; }
  .intro__help li { padding: 9px 0; font-size: 14px; }
  .intro__who { margin-bottom: 22px; }
  .intro__rec { display: none; }
}
@media (max-height: 700px) and (min-width: 721px) {
  .intro__name { font-size: clamp(56px, 9vw, 120px); }
  .intro__help li { padding: 8px 0; }
}
@media (prefers-reduced-motion: reduce) {
  .intro__bg img, .intro__grain, .intro__rec b { animation: none; }
  .intro [data-in], .intro__name .line > span { opacity: 1; transform: none; animation: none !important; }
  .intro-open .intro { transition: none; }
}
@media (hover: none) { .intro__hint { display: none; } }
.panel__hero iframe { display: block; width: 100%; aspect-ratio: 16 / 9; border: 0; }
.hud__section { color: var(--ember); margin: 0 0 10px; }
@media (max-width: 720px) { .menu { gap: 12px; } .menu a { font-size: 14px; } }
@media (max-width: 440px) {
  .brand b { font-size: 0; letter-spacing: 0; }
  .brand b::before { content: "TJL"; font-size: 14px; letter-spacing: .2em; }
  .menu { gap: 11px; }
  .menu a { font-size: 13.5px; }
}
