/* ==========================================================
   Thunder Creatives — ingamana-style studio site
   ========================================================== */
:root {
  --bg: #ffffff;
  --fg: #0a0a0a;
  --muted: #8a8a8a;
  --red: #ea1313;
  --wash: rgba(232, 232, 232, 0.82);
  --x-line: rgba(120, 120, 120, 0.45);
  --overlay: rgba(14, 14, 14, 0.9);
  --pad: 16px;
  --gap: 16px;
  --meta: 26px;          /* label strip under each tile — mirrored in app.js */
  --ease: cubic-bezier(.16, 1, .3, 1);
  --small: 11px;
}
@media (max-width: 700px) {
  :root { --pad: 12px; --gap: 8px; --small: 10px; }
}

*, *::before, *::after { box-sizing: border-box; }
html { overflow-anchor: none; -webkit-text-size-adjust: 100%; }
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-stopped { overflow: hidden; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: 'Archivo', 'Helvetica Neue', Arial, sans-serif;
  font-variation-settings: 'wdth' 100;
  font-weight: 600;
  font-size: var(--small);
  line-height: 1.12;
  text-transform: uppercase;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
html.modal-open { overflow: hidden; }
a { color: inherit; text-decoration: none; }

/* hover stretch — letters widen one after another (js wraps each letter in .ch) */
.stretch .ch {
  font-variation-settings: 'wdth' 100;
  transition: font-variation-settings .5s var(--ease);
  transition-delay: calc(var(--i) * 14ms);
}
a:hover .ch, a:focus-visible .ch, button:hover > .ch, button:focus-visible > .ch,
.tile:hover .tile__name .ch, .tile:focus-visible .tile__name .ch { font-variation-settings: 'wdth' 125; }
button { font: inherit; color: inherit; text-transform: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
ul, dl, dd, p, h1, h2, h3 { margin: 0; padding: 0; list-style: none; font-size: inherit; font-weight: inherit; }
img, video { display: block; max-width: 100%; }
:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Header (difference blend keeps it readable over images) ---------- */
.head {
  position: fixed; inset: 0 0 auto 0; z-index: 20;
  display: grid; grid-template-columns: 1fr 1fr 1fr; align-items: start;
  padding: calc(var(--pad) + 2px) calc(var(--pad) + 4px);
  color: #fff; mix-blend-mode: difference; pointer-events: none;
}
.head a { pointer-events: auto; }
.head-bg {
  position: fixed; inset: 0 0 auto 0; z-index: 19; pointer-events: none;
  height: var(--head-h, 72px);
  background: rgba(255, 255, 255, .72);
  -webkit-backdrop-filter: blur(16px) saturate(1.4);
  backdrop-filter: blur(16px) saturate(1.4);
  box-shadow: 0 1px 0 rgba(0, 0, 0, .06);
  opacity: 0; transition: opacity .35s ease;
}
html.is-scrolled .head-bg { opacity: 1; }
html.modal-open .head-bg { opacity: 0; }
.head__brand, .head-logo { display: block; width: fit-content; }
.head__brand img, .head-logo img { display: block; height: clamp(26px, 2.3vw, 38px); width: auto; }
.head-logo {
  position: fixed; z-index: 21; pointer-events: none;
  top: calc(var(--pad) + 2px); left: calc(var(--pad) + 4px);
}
.head__tag { justify-self: start; margin-left: -12%; }
.head__right { text-align: right; }
@media (max-width: 700px) {
  .head { grid-template-columns: 1fr 1fr; }
  .head__tag { display: none; }
}

/* ---------- Cylinder wordmark ---------- */
.wordmark {
  position: relative;
  height: .8em;
  font-size: 19vw;
  font-weight: 900;
  font-variation-settings: 'wdth' 100;
  line-height: 1;
  overflow: hidden;
  user-select: none;
  margin: 0 var(--pad);
}
.wordmark span {
  position: absolute; left: 0; top: 0;
  transform-origin: 0 0;
  white-space: pre;
  will-change: transform;
  line-height: .9;
}
.wordmark .bolt { color: var(--red); }
.wordmark .bolt svg { display: block; height: .7em; width: .3em; margin-top: .055em; fill: currentColor; }
.wordmark .copy { color: var(--fg); }

/* ---------- Work stage: fixed, rows positioned by js ---------- */
.stage {
  position: fixed; inset: 0; z-index: 1;
  overflow: hidden;
  background: var(--bg);
  will-change: transform;
}
.stage__mark { position: absolute; top: 0; left: 0; right: 0; will-change: transform; }

/* ---------- Hero headline (sits above the first row, moves up with it) ---------- */
.hero {
  position: relative;
  height: 100%;
  padding: 64px var(--pad) 56px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center;
  text-transform: none;
}
.hero__title {
  margin: 0;
  font-size: clamp(34px, 5vw, 92px);
  font-weight: 700;
  font-variation-settings: 'wdth' 100;
  line-height: 1;
  letter-spacing: -0.035em;
}
.hero__line { display: block; }
.hero__muted { color: #b9b9b9; }
.hero__accent { color: var(--red); }
.hero__sub {
  margin: clamp(14px, 2.4vh, 26px) 0 0;
  font-size: clamp(16px, 1.5vw, 26px);
  font-weight: 500;
  letter-spacing: -0.015em;
}
.hero__stats {
  list-style: none;
  display: flex; align-items: stretch;
  margin: clamp(24px, 5vh, 60px) 0 0; padding: 0;
}
.hero__stats li {
  display: flex; align-items: center; gap: 12px;
  padding: 0 clamp(16px, 2vw, 32px);
  text-align: left;
}
.hero__stats li + li { border-left: 1px solid #dcdcdc; }
.hero__stats strong {
  font-size: clamp(26px, 2.4vw, 42px);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1;
}
.hero__stats span {
  font-size: var(--small);
  font-weight: 500;
  line-height: 1.3;
  text-transform: uppercase;
  color: var(--muted);
}

/* entrance: pieces rise in one after another, the bolt flickers on */
.hero > *, .hero__line { animation: hero-rise 1.1s var(--ease) both; }
.hero__line:nth-child(1) { animation-delay: .15s; }
.hero__line:nth-child(2) { animation-delay: .27s; }
.hero__sub { animation-delay: .45s; }
.hero__stats { animation-delay: .6s; }
.hero__title { animation: none; }
.hero__zone {
  position: absolute; left: calc(var(--pad) + 4px); right: calc(var(--pad) + 4px); bottom: 10px;
  display: flex; justify-content: space-between; gap: 16px;
  font-size: var(--small); font-weight: 600; text-transform: uppercase; text-align: left;
}
.hero__zone p { margin: 0; }
.hero__zone p + p { color: var(--muted); text-align: right; }
.hero__zone-label { color: var(--red); margin-right: .6em; }
@keyframes hero-rise { from { opacity: 0; transform: translateY(28px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  .hero > *, .hero__line { animation: none; }
}
@media (max-width: 700px) {
  .hero { padding-top: 48px; }
  .hero__title { font-size: 7.6vw; }
  .hero__zone p + p { display: none; }
  .hero__stats li { flex-direction: column; align-items: center; gap: 6px; text-align: center; padding: 0 14px; }
}

.grid { position: absolute; inset: 0; }
.row { position: absolute; top: 0; left: 0; right: 0; will-change: transform; }
.work-spacer { height: 400vh; }
@media (max-width: 700px) { .wordmark { font-size: 24vw; } }

.row__track {
  position: absolute; top: 0; left: 0;
  display: flex; gap: var(--gap);
  transform: translateX(calc(50vw - (var(--k) + .5) * var(--w) - var(--k) * var(--gap)));
}
.tile {
  flex: 0 0 var(--w);
  width: var(--w);
  text-align: left;
  display: block;
}
.tile__media {
  position: relative;
  overflow: hidden;
  aspect-ratio: 5 / 3;
  background: #eeeeee;
}
.tile__media img, .tile__media video {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover;
  transform: scale(1.001);
  transition: transform .9s var(--ease), filter .5s ease;
}
.tile__media video { opacity: 0; transition: opacity .4s ease; }
.tile.is-playing .tile__media video { opacity: 1; }
.tile:hover .tile__media img,
.tile:hover .tile__media video,
.tile:focus-visible .tile__media img { transform: scale(1.06); }

.tile__meta {
  height: var(--meta);
  display: flex; justify-content: space-between; align-items: center; gap: 8px;
  white-space: nowrap; overflow: hidden;
}
.tile__name { display: flex; align-items: center; gap: 4px; overflow: hidden; }
.tile__label { overflow: hidden; text-overflow: ellipsis; }
.tile__year { flex: none; }

/* ---------- Studio info (small type grid) ---------- */
.info {
  position: relative; z-index: 2; background: var(--bg);
  padding: 22vh 14vw 16vh 14vw;
}
.info__row {
  display: grid;
  grid-template-columns: 7vw minmax(0, 1fr) minmax(0, 1.25fr);
  column-gap: 2.6vw;
  margin-bottom: 11vh;
}
.info__label { font-weight: 600; align-self: start; }
.info__body--wide { grid-column: 2 / 4; }
.info__body--from2 { grid-column: 2 / 3; }
.info__row > .info__body--wide + .info__body,
.info__row > .info__body--wide + .info__body + .info__body { margin-top: 2.8em; }
.info__body p + p { margin-top: 1.4em; }
.info__head { font-weight: 800; }
.info__services { list-style: none; padding: 0; margin: 1.4em 0 0; }
.info__kicker { margin-top: 1.4em; }
.info__split { display: grid; grid-template-columns: 9vw 1fr; align-items: start; }
.info__links { margin-top: 1.4em; }

/* contact form, same small uppercase type */
.cform { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 2.6vw; align-content: start; }
.cform label { display: flex; flex-direction: column; gap: 4px; }
.cform__wide, .cform__btn, .cform__status { grid-column: 1 / -1; }
.cform input, .cform select, .cform textarea {
  font: inherit; text-transform: inherit; color: var(--fg);
  background: transparent; border: 0; border-bottom: 1px solid #cfcfcf; border-radius: 0;
  padding: 4px 0 6px; outline: none; resize: vertical;
}
.cform input:focus, .cform select:focus, .cform textarea:focus { border-bottom-color: var(--fg); }
.cform__btn { justify-self: start; margin-top: 4px; font-weight: 800; }
.cform__btn:hover, .cform__btn:focus-visible { color: var(--red); }
.cform__btn:disabled { opacity: .55; cursor: wait; }
.cform__trap { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.cform__status { min-height: 1.2em; margin: 0; }
.cform__status.is-ok { color: #1a7f37; }
.cform__status.is-error { color: var(--red); }
.cform .is-invalid { border-bottom-color: var(--red); }

@media (max-width: 900px) {
  .info { padding: 16vh var(--pad) 10vh; }
  .info__row { grid-template-columns: 1fr; row-gap: 1.2em; margin-bottom: 8vh; }
  .info__body--wide, .info__body--from2 { grid-column: auto; }
  .info__row > .info__body--wide + .info__body,
  .info__row > .info__body--wide + .info__body + .info__body { margin-top: .6em; }
  .info__split { grid-template-columns: 1fr; row-gap: 1em; }
  .info__label { color: var(--muted); }
  .cform { grid-template-columns: 1fr; }
}

/* ---------- Footer ---------- */
.foot { position: relative; z-index: 2; background: var(--bg); padding-bottom: var(--pad); }
.foot__bar {
  display: flex; justify-content: space-between;
  padding: 6px calc(var(--pad) + 4px) 0;
}

/* ---------- Project popup ---------- */
.modal {
  position: fixed; inset: 0; z-index: 50;
  background: var(--overlay);
  opacity: 0;
  transition: opacity .5s ease;
}
.modal.is-open { opacity: 1; }
.modal[hidden] { display: none; }
.modal:focus { outline: none; }
.modal__scroll {
  position: absolute; inset: 0;
  overflow-y: auto; overscroll-behavior: contain;
  cursor: none;
}
.modal__grid {
  display: grid;
  grid-template-columns: minmax(0, 74fr) minmax(0, 26fr);
  column-gap: 1.6vw;
  padding: 5vh var(--pad) 40vh;   /* room so the last block can scroll high enough to fully unfold */
  min-height: 100%;
}
.modal__media { display: flex; flex-direction: column; gap: var(--gap); cursor: none; }
.modal__info {
  position: sticky; top: 5vh; align-self: start;
  color: #fff; cursor: auto;
  font-size: 12px; line-height: 1.1;
  transform: translateY(24px); opacity: 0;
  transition: transform .9s var(--ease) .15s, opacity .6s ease .15s;
}
.modal.is-open .modal__info { transform: none; opacity: 1; }

.mi__title { font-size: 15px; font-weight: 800; }
.mi__year { font-size: 9px; margin-top: 2px; }
.mi__list { margin-top: 18px; }
.mi__list dt { font-size: 8px; margin-top: 12px; color: rgba(255, 255, 255, .7); }
.mi__list dd { font-weight: 800; }
.mi__desc { margin-top: 22px; text-transform: none; font-weight: 500; font-size: 13px; line-height: 1.35; max-width: 34ch; color: rgba(255, 255, 255, .82); }
.mi__links { margin-top: 26px; font-weight: 800; }
.mi__nav { display: flex; gap: 18px; margin-top: 30px; }
.mi__btn { font-weight: 800; }
.mi__count { margin-top: 30px; font-size: 9px; color: rgba(255, 255, 255, .55); }

/* media blocks */
.mb { margin: 0; position: relative; overflow: hidden; background: #1a1a1a; cursor: auto; }
.mb img, .mb video { width: 100%; height: auto; }
.mb--panel {
  display: flex; align-items: center; justify-content: center;
  gap: 3%;
  padding: 7% 7%;
}
.mb--panel .mb__item { flex: var(--ar, 1) 1 0; min-width: 0; }
.mb--panel .mb__item img,
.mb--panel .mb__item video { box-shadow: 0 30px 60px -30px rgba(0, 0, 0, .45); }
.mb--single .mb__item { flex: 0 1 auto; }
.mb--single .mb__item img,
.mb--single .mb__item video { width: auto; max-width: 100%; max-height: 78vh; margin: 0 auto; }

/* popup blocks unfold from the left as they scroll in (scale + opacity set by js) */
.mb { transform-origin: 0 0; will-change: transform, opacity; }
.mb--full .mb__inner, .mb--panel .mb__inner { display: block; }
.mb--panel .mb__inner { display: flex; align-items: center; justify-content: center; gap: inherit; width: 100%; }

/* "close" label that follows the pointer over the dark backdrop */
.modal__cursor {
  position: fixed; left: 0; top: 0; z-index: 2; pointer-events: none;
  color: #fff; font-size: 11px; font-weight: 800;
  padding: 6px 9px; border: 1px solid rgba(255, 255, 255, .6); border-radius: 99px;
  transform: translate(-50%, -50%);
  opacity: 0; transition: opacity .2s ease;
}
.modal__cursor.is-on { opacity: 1; }

@media (max-width: 900px) {
  .modal__grid { grid-template-columns: 1fr; row-gap: 28px; padding-top: 64px; }
  .modal__info { position: relative; top: 0; order: -1; }
  .modal__scroll { cursor: auto; }
  .modal__cursor { display: none; }
  .mi__nav { position: fixed; top: 0; left: 0; right: 0; justify-content: space-between; padding: 16px var(--pad); background: linear-gradient(rgba(14,14,14,.95), rgba(14,14,14,0)); margin: 0; z-index: 3; }
}

@media (prefers-reduced-motion: reduce) {
  .stretch .ch { transition: none; }
  .modal__info { transition: none; transform: none; opacity: 1; }
  .tile__media img { transition: none; }
}
