/* ============================================================
   RV — FORJA
   A void where the only light is molten.
   Structure borrowed from Dala's discipline (pure black, scale
   over weight, no containers). Light borrowed from RV's own
   gradient — the color temperature of heated steel.
   ============================================================ */

/* ---------- 1. Tokens ---------- */

:root {
  /* Surface — the void is the design. There are no panels. */
  --void: #000000;
  --void-lift: #08080a;

  /* Type */
  --bone: #ffffff;
  --silver: #c6c6cb;
  --ash: #9a9aa2;
  /* Recessive, but still 4.5:1 on the void — these carry the mono labels. */
  --dim: #74747d;

  /* Light — RV's identity, used as emission not as fill */
  --ember: #f08113;
  --ember-lo: #f8a23b;
  --ember-hi: #e94d1d;
  --flame: linear-gradient(135deg, #f8a23b 0%, #f08113 48%, #e94d1d 100%);

  /* A single cold accent, for instrumentation only */
  --signal: #3ddbd9;

  /* Hairlines — the only structure allowed */
  --rule: rgba(255, 255, 255, 0.09);
  --rule-strong: rgba(255, 255, 255, 0.16);

  /* Type families */
  --sans: 'Switzer', 'Helvetica Neue', -apple-system, BlinkMacSystemFont, sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, 'SF Mono', Menlo, monospace;

  /* Fluid type scale — Dala's steps, made responsive */
  --t-display: clamp(3.25rem, 8.6vw, 7.06rem);   /* 113px */
  --t-heading-lg: clamp(2.5rem, 5.8vw, 4.875rem); /* 78px */
  --t-heading: clamp(2rem, 3.6vw, 3rem);          /* 48px */
  --t-heading-sm: clamp(1.75rem, 2.9vw, 2.625rem);/* 42px */
  --t-subheading: clamp(1.5rem, 2.4vw, 2.25rem);  /* 36px */
  --t-heading-xs: 1.6875rem;                      /* 27px */
  --t-body: 1.125rem;                             /* 18px */
  --t-nav: 0.875rem;                              /* 14px */
  --t-caption: 0.75rem;                           /* 12px */

  /* Rhythm — 6px base, Dala's unit */
  --s-6: 6px;
  --s-12: 12px;
  --s-18: 18px;
  --s-24: 24px;
  --s-30: 30px;
  --s-36: 36px;
  --s-60: 60px;
  --s-96: 96px;
  --s-120: 120px;

  --page: 1280px;
  --gutter: clamp(1.5rem, 5vw, 3.5rem);
  /* Editorial breathing room, capped to the 60–120px Dala rhythm. */
  --section: clamp(4.5rem, 8vw, 7.5rem);

  --r: 24px;
  --r-full: 9999px;

  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-io: cubic-bezier(0.65, 0, 0.35, 1);
  --loader-progress: 0;
}

/* ---------- 2. Reset & base ---------- */

*,
*::before,
*::after { box-sizing: border-box; }

* { margin: 0; padding: 0; }

html {
  background: var(--void);
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  background: var(--void);
  color: var(--bone);
  font-family: var(--sans);
  font-size: var(--t-body);
  font-weight: 300;
  line-height: 1.5;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: 'ss01' on;
}

img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; }

::selection { background: var(--ember); color: #000; }

:focus-visible {
  outline: 2px solid var(--ember);
  outline-offset: 4px;
  border-radius: 2px;
}

/* ---------- 3. Loader ---------- */

html.is-loading,
html.is-loading body {
  overflow: hidden;
}

.loader {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  overflow: hidden;
  background: #000;
  opacity: 1;
  visibility: visible;
  transition: opacity 0.7s var(--ease), visibility 0s linear 0.7s;
}

.js .loader { display: grid; }

.js:not(.is-loading) .loader {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.loader::before {
  content: '';
  position: absolute;
  inset: 18% 24%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(240, 129, 19, 0.13), transparent 66%);
  filter: blur(64px);
  transform: scale(var(--loader-glow-scale, 0.72));
  opacity: var(--loader-glow-opacity, 0.28);
  transition: transform 0.5s var(--ease), opacity 0.5s var(--ease);
}

.loader__frame {
  position: relative;
  width: 100%;
  min-height: 100%;
  padding: clamp(1.5rem, 5vw, 3.5rem);
  display: grid;
  grid-template-rows: 1fr auto auto;
  gap: 1.15rem;
}

.loader__brand {
  position: relative;
  place-self: center;
  display: inline-flex;
  align-items: center;
  gap: 1rem;
  animation: loader-breathe 1.8s var(--ease-io) infinite;
}

.loader__brand::before,
.loader__brand::after {
  content: '';
  position: absolute;
  inset: 50% auto auto 50%;
  z-index: -1;
  background: linear-gradient(90deg, transparent, var(--rule-strong), transparent);
  opacity: 0.7;
}

.loader__brand::before {
  width: min(52vw, 32rem);
  height: 1px;
  transform: translate(-50%, -50%);
}

.loader__brand::after {
  width: 1px;
  height: min(36vh, 18rem);
  background: linear-gradient(transparent, var(--rule-strong), transparent);
  transform: translate(-50%, -50%);
}

.loader__mark {
  width: clamp(2.75rem, 5vw, 3.375rem);
  filter: drop-shadow(0 0 24px rgba(240, 129, 19, 0.38));
}

.loader__word {
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  font-weight: 400;
  line-height: 0.8;
  letter-spacing: -0.06em;
}

.loader__readout {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  font-family: var(--mono);
  font-size: 0.6875rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.loader__label { color: var(--dim); }

.loader__value {
  color: var(--bone);
  font-size: clamp(1.25rem, 2.5vw, 2rem);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.04em;
  line-height: 0.8;
}

.loader__track {
  position: relative;
  height: 1px;
  overflow: hidden;
  background: var(--rule);
}

.loader__fill {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, var(--ember-hi), var(--ember-lo), #fff);
  box-shadow: 0 0 16px rgba(240, 129, 19, 0.7);
  transform: scaleX(var(--loader-progress));
  transform-origin: left;
  transition: transform 0.55s var(--ease);
}

@keyframes loader-breathe {
  0%, 100% { opacity: 0.72; transform: scale(0.985); }
  50% { opacity: 1; transform: scale(1); }
}

/* ---------- 4. Atmosphere ---------- */

.atmosphere {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

#forge-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

/* Vignette — pulls the eye to center, deepens the void at the edges */
.atmosphere::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 48% 58% at 76% 45%, rgba(240, 129, 19, 0.035), transparent 70%),
    radial-gradient(ellipse 120% 90% at 58% 44%, transparent 28%, rgba(0, 0, 0, 0.58) 80%, #000 100%);
}

/* Film grain — keeps large black fields from banding, adds tooth */
.grain {
  position: fixed;
  inset: -50%;
  z-index: 2;
  pointer-events: none;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain 6s steps(6) infinite;
  will-change: transform;
}

@keyframes grain {
  0%   { transform: translate(0, 0); }
  16%  { transform: translate(-3%, -2%); }
  33%  { transform: translate(2%, -4%); }
  50%  { transform: translate(-2%, 3%); }
  66%  { transform: translate(3%, 1%); }
  83%  { transform: translate(-1%, -3%); }
  100% { transform: translate(0, 0); }
}

.shell {
  position: relative;
  z-index: 1;
}

/* ---------- 4. Layout primitives ---------- */

.wrap {
  width: 100%;
  max-width: var(--page);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section { padding-block: var(--section); }

/* The nav is fixed, so a raw anchor jump parks the heading underneath it. */
section[id],
main[id] { scroll-margin-top: clamp(5.5rem, 11vh, 7.5rem); }

/* A hairline is the only divider that exists here */
.rule {
  height: 1px;
  background: var(--rule);
  border: 0;
}

/* ---------- 5. Typography ---------- */

/* Hierarchy comes from scale and tracking, never from weight. */
.display,
.h-lg,
.h,
.h-sm {
  font-weight: 400;
  line-height: 1.04;
  letter-spacing: -0.04em;
  text-wrap: balance;
}

.display { font-size: var(--t-display); }
.h-lg    { font-size: var(--t-heading-lg); }
.h       { font-size: var(--t-heading); line-height: 1.08; }
.h-sm    { font-size: var(--t-heading-sm); line-height: 1.1; }

.lede {
  font-size: clamp(1.0625rem, 1.4vw, 1.25rem);
  font-weight: 200;
  line-height: 1.55;
  color: var(--silver);
  max-width: 46ch;
  letter-spacing: -0.005em;
}

/* The particle field sits behind every section. A tight black halo on running
   copy is invisible against the void but guarantees contrast wherever the
   field happens to drift. */
.lede,
.head__lede,
.who__body p,
.cap__body p,
.work__desc,
.readout__v,
.stat__k,
.footer__link {
  text-shadow: 0 0 22px rgba(0, 0, 0, 0.95), 0 0 7px rgba(0, 0, 0, 0.85);
}

.display,
.h-lg,
.h,
.h-sm,
.work__name,
.cap__title,
.stat__n {
  text-shadow: 0 0 34px rgba(0, 0, 0, 0.75);
}

/* Molten text — reserved for the single emphasized phrase per view */
.molten {
  background: var(--flame);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* Technical label. Engineering heritage, deliberately machine-like. */
.label {
  font-family: var(--mono);
  font-size: var(--t-caption);
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--ash);
  display: inline-flex;
  align-items: center;
  gap: 0.75em;
  line-height: 1;
}

.label--ember { color: var(--ember); }

.label::before {
  content: '';
  width: 1.5em;
  height: 1px;
  background: currentColor;
  opacity: 0.55;
  flex: none;
}

.label--bare::before { display: none; }

/* Tracked-out mono runs long; at phone widths it tips the eyebrow onto a
   second line and the rule-plus-text lockup falls apart. */
@media (max-width: 640px) {
  .label { letter-spacing: 0.13em; }
  .label::before { width: 1.1em; }
}

.idx {
  font-family: var(--mono);
  font-size: var(--t-caption);
  letter-spacing: 0.14em;
  color: var(--dim);
  font-variant-numeric: tabular-nums;
}

/* ---------- 6. Buttons ---------- */

.btn {
  --btn-pad: 1.05rem 1.9rem;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.7em;
  padding: var(--btn-pad);
  border-radius: var(--r-full);
  font-family: var(--mono);
  font-size: var(--t-nav);
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
  isolation: isolate;
  overflow: hidden;
  transition: transform 0.5s var(--ease), box-shadow 0.5s var(--ease), color 0.4s var(--ease);
}

/* The one filled action per view. It is the brightest thing on screen. */
.btn--ember {
  color: #12060a;
  background: var(--flame);
  box-shadow: 0 0 0 rgba(240, 129, 19, 0);
}

.btn--ember::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(135deg, #ffc885 0%, #f8a23b 50%, #f08113 100%);
  opacity: 0;
  transition: opacity 0.45s var(--ease);
}

.btn--ember:hover {
  box-shadow: 0 0 44px -6px rgba(240, 129, 19, 0.65);
}

.btn--ember:hover::after { opacity: 1; }

/* Ghost — no container, hierarchy from type alone */
.btn--ghost {
  padding-inline: 0;
  color: var(--silver);
  gap: 0.85em;
}

.btn--ghost .btn__line {
  width: 2.25rem;
  height: 1px;
  background: currentColor;
  transition: width 0.55s var(--ease), background 0.4s;
}

.btn--ghost:hover { color: var(--bone); }
.btn--ghost:hover .btn__line { width: 3.5rem; background: var(--ember); }

.btn__arrow { transition: transform 0.5s var(--ease); }
.btn:hover .btn__arrow { transform: translate(3px, -3px); }

/* ---------- 7. Navigation ---------- */

.nav {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 60;
  padding-block: var(--s-24);
  transition: transform 0.6s var(--ease), background 0.6s, backdrop-filter 0.6s, padding 0.6s var(--ease);
}

.nav.is-stuck {
  padding-block: var(--s-12);
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.88), rgba(0, 0, 0, 0));
}

.nav.is-hidden { transform: translateY(-110%); }

.nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-24);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
}

.brand__mark {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  transition: transform 0.6s var(--ease), filter 0.6s var(--ease);
}

.brand:hover .brand__mark {
  transform: rotate(-8deg) scale(1.06);
  filter: drop-shadow(0 0 14px rgba(240, 129, 19, 0.7));
}

.brand__word {
  font-size: 1.15rem;
  font-weight: 500;
  letter-spacing: -0.045em;
}

.brand__sub {
  font-family: var(--mono);
  font-size: 0.625rem;
  letter-spacing: 0.24em;
  color: var(--dim);
  text-transform: uppercase;
  margin-left: 0.15rem;
  align-self: flex-end;
  padding-bottom: 0.3rem;
}

.nav__links {
  display: flex;
  gap: clamp(1.25rem, 3vw, 2.5rem);
}

.nav__link {
  position: relative;
  font-family: var(--mono);
  font-size: var(--t-nav);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ash);
  padding-block: 0.25rem;
  transition: color 0.35s var(--ease);
}

.nav__link::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 1px;
  background: var(--ember);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.5s var(--ease);
}

.nav__link:hover { color: var(--bone); }

.nav__link:hover::after {
  transform: scaleX(1);
  transform-origin: left;
}

.nav__cta { --btn-pad: 0.8rem 1.5rem; }

@media (max-width: 860px) {
  .nav__links { display: none; }
  .brand__sub { display: none; }
}

@media (max-width: 520px) {
  .nav__cta { display: none; }
}

/* ---------- 8. Hero ---------- */

.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-top: clamp(6rem, 11vh, 8rem);
  padding-bottom: var(--s-60);
}

.hero__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: center;
  gap: clamp(3rem, 8vw, 8rem);
}

.hero__copy {
  position: relative;
  z-index: 2;
  min-width: 0;
}

.hero__head {
  max-width: 14ch;
  font-size: clamp(3.25rem, 5.85vw, 5.3rem);
  margin-top: clamp(1.25rem, 2.6vw, 2rem);
}

.display .line {
  display: block;
  overflow: hidden;
}

.display .line > span {
  display: block;
  will-change: transform;
}

.hero__lede {
  margin-top: clamp(1.5rem, 3vw, 2.25rem);
  max-width: 44ch;
}

.hero__actions {
  display: flex;
  align-items: center;
  gap: clamp(1.25rem, 3vw, 2.5rem);
  flex-wrap: wrap;
  margin-top: clamp(2rem, 4vw, 3rem);
}

/* The canvas owns the sculpture. This column is its negative-space plinth and
   keeps the object out of the copy. */
.hero__visual {
  position: relative;
  min-height: clamp(25rem, 52vw, 42rem);
  isolation: isolate;
}

.hero__visual::before {
  content: '';
  position: absolute;
  inset: 11% 2% 10%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(240, 129, 19, 0.105), transparent 68%);
  filter: blur(54px);
  opacity: 0.72;
}

/* Instrumentation strip — reads like a machine readout, grounds the poetry */
.hero__readout {
  margin-top: auto;
  padding-top: clamp(3rem, 8vh, 5.5rem);
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--s-24);
  flex-wrap: wrap;
}

.readout {
  display: flex;
  gap: clamp(1.5rem, 4vw, 3.5rem);
  flex-wrap: wrap;
}

.readout__item {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.readout__k {
  font-family: var(--mono);
  font-size: 0.625rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--dim);
}

.readout__v {
  font-size: 0.9375rem;
  font-weight: 400;
  color: var(--silver);
  letter-spacing: -0.01em;
}

.readout__v .dot {
  display: inline-block;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--signal);
  margin-right: 0.5rem;
  vertical-align: middle;
  box-shadow: 0 0 8px var(--signal);
  animation: pulse 2.4s var(--ease-io) infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%      { opacity: 0.4; transform: scale(0.8); }
}

.scroll-cue {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  font-family: var(--mono);
  font-size: 0.625rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--dim);
}

.scroll-cue__track {
  position: relative;
  width: 1px;
  height: 42px;
  background: var(--rule);
  overflow: hidden;
}

.scroll-cue__track::after {
  content: '';
  position: absolute;
  inset-inline: 0;
  top: -60%;
  height: 60%;
  background: linear-gradient(to bottom, transparent, var(--ember));
  animation: trickle 2.2s var(--ease-io) infinite;
}

@keyframes trickle {
  0%   { top: -60%; }
  100% { top: 100%; }
}

@media (min-width: 900px) {
  .hero__grid { grid-template-columns: minmax(0, 0.92fr) minmax(20rem, 1.08fr); }
}

@media (max-width: 899px) {
  .hero {
    min-height: auto;
    padding-top: clamp(7rem, 14vh, 8rem);
    padding-bottom: var(--s-36);
  }

  .hero__grid { gap: var(--s-12); }

  .hero__visual {
    min-height: clamp(26rem, 112vw, 34rem);
    margin-top: calc(-1 * var(--s-12));
  }

  .hero__readout { padding-top: var(--s-36); }
}

/* ---------- 9. Ticker ---------- */

.ticker {
  position: relative;
  padding-block: var(--s-24);
  border-block: 1px solid var(--rule);
  overflow: hidden;
  --fade: 12%;
  -webkit-mask-image: linear-gradient(to right, transparent, #000 var(--fade), #000 calc(100% - var(--fade)), transparent);
  mask-image: linear-gradient(to right, transparent, #000 var(--fade), #000 calc(100% - var(--fade)), transparent);
}

.ticker__row {
  display: flex;
  width: max-content;
  animation: slide 42s linear infinite;
}

.ticker:hover .ticker__row { animation-play-state: paused; }

@keyframes slide {
  to { transform: translateX(-50%); }
}

.ticker__group {
  display: flex;
  align-items: center;
  flex: none;
}

.ticker__item {
  display: inline-flex;
  align-items: center;
  gap: 1.5rem;
  padding-inline: 1.5rem;
  font-family: var(--mono);
  font-size: 0.8125rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ash);
  white-space: nowrap;
  transition: color 0.4s;
}

.ticker__item::after {
  content: '';
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--ember);
  opacity: 0.5;
}

.ticker__item:hover { color: var(--bone); }

.sig {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: 0.75rem;
  padding-top: 1.75rem;
  border-top: 1px solid var(--rule);
}

.sig__mark {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  flex: none;
}

.sig__name {
  font-size: 0.9375rem;
  color: var(--bone);
  letter-spacing: -0.01em;
}

.sig__role {
  font-family: var(--mono);
  font-size: 0.6875rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--dim);
  display: block;
  margin-top: 0.2rem;
}

/* ---------- 10a. Who ---------- */

.who {
  display: grid;
  gap: clamp(2.5rem, 6vw, 5rem);
  align-items: center;
}

@media (min-width: 900px) {
  .who { grid-template-columns: 0.85fr 1fr; }
}

/* The portrait was graded so its studio backdrop is already near-black; the
   mask carries the rest, so he emerges from the void instead of sitting in a
   framed rectangle. No border, no shadow — same rule as everything else here. */
.who__photo img {
  width: 100%;
  border-radius: var(--r);
  -webkit-mask-image: linear-gradient(to bottom, #000 55%, rgba(0, 0, 0, 0.35) 84%, transparent 100%);
  mask-image: linear-gradient(to bottom, #000 55%, rgba(0, 0, 0, 0.35) 84%, transparent 100%);
}

.who__body {
  display: flex;
  flex-direction: column;
  gap: var(--s-24);
}

.who__body .h-sm { margin-bottom: var(--s-6); }

.who__body p {
  font-weight: 200;
  color: var(--silver);
  max-width: 46ch;
}

/* ---------- 11. Capabilities ---------- */

.cap {
  position: relative;
  display: grid;
  gap: var(--s-24) var(--s-36);
  padding-block: clamp(var(--s-36), 4.5vw, var(--s-60));
  border-top: 1px solid var(--rule);
  transition: border-color 0.6s var(--ease);
  isolation: isolate;
}

.cap:last-child { border-bottom: 1px solid var(--rule); }

/* A light source that tracks the cursor across the row */
.cap::before {
  content: '';
  position: absolute;
  inset: -1px 0 auto 0;
  height: 1px;
  background: var(--flame);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.75s var(--ease);
}

.cap:hover::before { transform: scaleX(1); }

.cap::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 50%), rgba(240, 129, 19, 0.09), transparent 70%);
  opacity: 0;
  transition: opacity 0.6s var(--ease);
  pointer-events: none;
}

.cap:hover::after { opacity: 1; }

@media (min-width: 900px) {
  .cap {
    grid-template-columns: 5.5rem minmax(0, 1fr) minmax(0, 1.05fr);
    align-items: start;
  }
}

.cap__idx { padding-top: var(--s-12); }

.cap__title {
  font-size: var(--t-subheading);
  font-weight: 400;
  letter-spacing: -0.035em;
  line-height: 1.1;
  transition: transform 0.7s var(--ease);
}

.cap__title em {
  font-style: normal;
  display: block;
  color: var(--ash);
  transition: color 0.6s var(--ease);
}

.cap:hover .cap__title { transform: translateX(10px); }
.cap:hover .cap__title em { color: var(--ember); }

.cap__body {
  display: flex;
  flex-direction: column;
  gap: var(--s-24);
  padding-top: var(--s-6);
}

.cap__body p {
  font-weight: 200;
  color: var(--silver);
  max-width: 48ch;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.tag {
  font-family: var(--mono);
  font-size: 0.6875rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ash);
  padding: 0.4rem 0.85rem;
  border: 1px solid var(--rule);
  border-radius: var(--r-full);
  transition: color 0.4s, border-color 0.4s, background 0.4s;
}

.cap:hover .tag {
  border-color: var(--rule-strong);
  color: var(--silver);
}

/* ---------- 12. Work ---------- */

.head {
  display: grid;
  gap: var(--s-24);
  margin-bottom: clamp(var(--s-36), 5vw, var(--s-60));
}

.head > div {
  display: grid;
  gap: var(--s-18);
}

@media (min-width: 900px) {
  .head {
    grid-template-columns: 1.3fr 1fr;
    align-items: end;
    gap: var(--s-60);
  }
}

.head__lede {
  font-weight: 200;
  color: var(--ash);
  max-width: 40ch;
  padding-bottom: var(--s-6);
}

.work {
  display: grid;
  gap: clamp(var(--s-60), 7vw, var(--s-96)) var(--s-60);
}

@media (min-width: 860px) {
  .work { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  /* Break the grid: offset the right column into a zigzag rhythm */
  .work__item:nth-child(even) {
    padding-top: clamp(var(--s-30), 4vw, var(--s-60));
  }
}

.work__item {
  perspective: 1400px;
}

.work__card {
  display: block;
  transform-style: preserve-3d;
  transform: rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
  transition: transform 0.9s var(--ease);
  will-change: transform;
}

.work__stage {
  position: relative;
  border-radius: var(--r);
  overflow: hidden;
  transform-style: preserve-3d;
  background: var(--void-lift);
  isolation: isolate;
}

.work__shot {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  object-position: top left;
  border-radius: var(--r);
  transform: scale(1.001);
  transition: transform 1.1s var(--ease), filter 0.8s var(--ease);
  filter: saturate(0.82) brightness(0.82) contrast(1.04);
}

.work__card:hover .work__shot {
  transform: scale(1.045);
  filter: saturate(1) brightness(1) contrast(1);
}

/* Portrait artifact — the phone floats free, no crop.
   The image is absolutely positioned because a percentage height has nothing
   definite to resolve against inside an aspect-ratio box: it silently falls
   back to auto and the phone renders at full intrinsic size. */
.work__stage--free {
  position: relative;
  background: none;
  aspect-ratio: 16 / 10;
  overflow: visible;
}

.work__stage--free .work__shot {
  position: absolute;
  inset: 0;
  margin: auto;
  width: auto;
  max-width: none;
  height: 116%;
  aspect-ratio: auto;
  object-fit: contain;
  border-radius: 0;
  filter: saturate(0.86) brightness(0.88) drop-shadow(0 40px 70px rgba(0, 0, 0, 0.85));
}

.work__card:hover .work__stage--free .work__shot {
  transform: scale(1.03);
  filter: saturate(1) brightness(1) drop-shadow(0 46px 80px rgba(0, 0, 0, 0.88));
}

/* Hairline edge so the artifact reads as an object, not a hole */
.work__stage::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 4;
  border-radius: var(--r);
  border: 1px solid var(--rule);
  pointer-events: none;
  transition: border-color 0.6s var(--ease);
}

.work__stage--free::after { display: none; }
.work__card:hover .work__stage::after { border-color: rgba(240, 129, 19, 0.35); }

.work__visit {
  position: absolute;
  z-index: 5;
  left: var(--s-24);
  bottom: var(--s-24);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 10.5rem;
  gap: 0.9rem;
  padding: 1.1rem 1.75rem;
  border-radius: var(--r-full);
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.14);
  font-family: var(--mono);
  font-size: 0.9375rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--bone);
  opacity: 1;
  transform: translateZ(24px);
  transition: opacity 0.55s var(--ease), transform 0.55s var(--ease);
  transform-style: preserve-3d;
}

.work__visit svg {
  width: 17px;
  height: 17px;
}

.work__card:hover .work__visit {
  transform: translateZ(45px);
}

/* Meta floats above the artifact plane on tilt */
.work__meta {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--s-18);
  margin-top: var(--s-24);
  padding-top: var(--s-18);
  border-top: 1px solid var(--rule);
  transform: translateZ(30px);
  transition: border-color 0.6s var(--ease);
}

.work__card:hover .work__meta { border-color: var(--rule-strong); }

.work__name {
  font-size: var(--t-heading-xs);
  font-weight: 400;
  letter-spacing: -0.035em;
  line-height: 1.15;
}

.work__desc {
  font-size: 0.9375rem;
  font-weight: 200;
  color: var(--ash);
  margin-top: 0.35rem;
  max-width: 34ch;
}

.work__tag {
  font-family: var(--mono);
  font-size: 0.625rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ash);
  max-width: 13rem;
  text-align: right;
  transition: color 0.5s var(--ease);
}

.work__card:hover .work__tag { color: var(--ember); }

/* ---------- 13. Process timeline ---------- */

.process {
  --process-progress: 0;
  --process-rail-gap: clamp(3rem, 5vw, 4rem);
  position: relative;
  min-height: 340svh;
}

.process__sticky {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100svh;
  display: flex;
  align-items: center;
  overflow: hidden;
  padding-block: clamp(6rem, 11vh, 8rem) clamp(3rem, 7vh, 5rem);
}

.process__head {
  margin-bottom: clamp(3.5rem, 7vh, 5rem);
}

.process__timeline {
  position: relative;
  isolation: isolate;
}

.process__rail {
  position: absolute;
  z-index: 0;
  top: 0;
  left: 12.5%;
  right: 12.5%;
  height: 1px;
  overflow: visible;
  background: var(--rule-strong);
}

.process__rail-fill {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, var(--ember-hi), var(--ember), var(--ember-lo));
  box-shadow: 0 0 10px rgba(240, 129, 19, 0.65), 0 0 26px rgba(240, 129, 19, 0.25);
  transform: scaleX(var(--process-progress));
  transform-origin: left;
  will-change: transform;
}

.stats {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(2rem, 5vw, 3.5rem);
  padding-top: var(--process-rail-gap);
  list-style: none;
}

.stat {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 13rem;
  opacity: 0.24;
  transform: translateY(10px);
  transition:
    opacity 0.55s var(--ease),
    transform 0.65s var(--ease),
    filter 0.55s var(--ease);
}

.stat.is-past {
  opacity: 0.52;
  transform: translateY(0);
}

.stat.is-active {
  opacity: 1;
  transform: translateY(-6px);
  filter: drop-shadow(0 0 22px rgba(240, 129, 19, 0.08));
}

.stat__node {
  position: absolute;
  top: calc(0px - var(--process-rail-gap) - 11px);
  left: 50%;
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border: 1px solid var(--rule-strong);
  border-radius: 50%;
  background: var(--void);
  transform: translateX(-50%);
  transition:
    border-color 0.5s var(--ease),
    box-shadow 0.5s var(--ease),
    transform 0.6s var(--ease);
}

.stat__node i {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--dim);
  transition: background 0.5s var(--ease), box-shadow 0.5s var(--ease), transform 0.5s var(--ease);
}

.stat.is-past .stat__node,
.stat.is-active .stat__node {
  border-color: rgba(240, 129, 19, 0.72);
}

.stat.is-past .stat__node i,
.stat.is-active .stat__node i {
  background: var(--ember);
}

.stat.is-active .stat__node {
  border-color: rgba(255, 255, 255, 0.6);
  box-shadow: 0 0 0 6px rgba(240, 129, 19, 0.06), 0 0 26px rgba(240, 129, 19, 0.24);
  transform: translateX(-50%) scale(1.2);
}

.stat.is-active .stat__node i {
  box-shadow: 0 0 11px var(--ember), 0 0 22px rgba(240, 129, 19, 0.8);
  transform: scale(1.35);
  animation: process-pulse 1.8s var(--ease-io) infinite;
}

@keyframes process-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.45; }
}

.stat__n {
  font-size: clamp(2.75rem, 5.5vw, 4.25rem);
  font-weight: 400;
  letter-spacing: -0.05em;
  line-height: 1;
  color: var(--dim);
  font-variant-numeric: tabular-nums;
  transition: color 0.55s var(--ease), text-shadow 0.55s var(--ease);
}

.stat.is-past .stat__n { color: var(--ash); }

.stat.is-active .stat__n {
  color: var(--bone);
  text-shadow: 0 0 28px rgba(240, 129, 19, 0.2);
}

.stat__k {
  display: block;
  max-width: 30ch;
  margin-top: var(--s-12);
  font-size: 0.9375rem;
  font-weight: 200;
  line-height: 1.55;
  letter-spacing: -0.005em;
  color: var(--dim);
  transition: color 0.55s var(--ease);
}

.stat__k strong {
  font-weight: 500;
  color: inherit;
}

.stat.is-past .stat__k { color: var(--ash); }
.stat.is-active .stat__k { color: var(--silver); }

html:not(.js) .process { min-height: auto; }
html:not(.js) .process__sticky { position: relative; height: auto; }
html:not(.js) .process__rail-fill { transform: scale(1); }
html:not(.js) .stat { opacity: 1; transform: none; }

@media (max-width: 899px) {
  .process {
    --process-rail-gap: 0px;
    min-height: auto;
  }

  .process__sticky {
    position: relative;
    height: auto;
    min-height: 0;
    overflow: visible;
    padding-block: var(--section);
  }

  .process__head { margin-bottom: var(--s-60); }

  .process__timeline {
    padding-left: 2.75rem;
  }

  .process__rail {
    top: 0.75rem;
    bottom: clamp(5.5rem, 18vw, 7rem);
    left: 8px;
    right: auto;
    width: 1px;
    height: auto;
  }

  .process__rail-fill {
    transform: scaleY(var(--process-progress));
    transform-origin: top;
  }

  .stats {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
    padding-top: 0;
  }

  .stat {
    min-height: clamp(10rem, 30vw, 12rem);
    padding-bottom: var(--s-60);
  }

  .stat:last-child {
    min-height: 0;
    padding-bottom: 0;
  }

  .stat__node {
    top: 0.15rem;
    left: calc(-2.75rem + 8px);
    transform: translateX(-50%);
  }

  .stat.is-active .stat__node {
    transform: translateX(-50%) scale(1.2);
  }

  .stat.is-active { transform: translateX(6px); }
}

/* ---------- 14. Closing ---------- */

.close {
  position: relative;
  isolation: isolate;
  min-height: 92svh;
  display: flex;
  align-items: center;
  text-align: left;
  padding-block: clamp(6rem, 10vw, 8rem);
}

.close::before {
  content: '';
  position: absolute;
  z-index: 0;
  inset: 4% 2%;
  pointer-events: none;
  background: radial-gradient(ellipse 42% 68% at 76% 50%, rgba(240, 129, 19, 0.1), transparent 72%);
}

.close__grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(20rem, 1.08fr);
  align-items: center;
  gap: clamp(3rem, 8vw, 8rem);
}

.close__copy {
  position: relative;
  z-index: 2;
  min-width: 0;
}

.close__head {
  max-width: 12ch;
  margin-top: clamp(1.25rem, 2.6vw, 2rem);
  text-shadow: 0 0 14px #000, 0 0 38px #000, 0 0 76px rgba(0, 0, 0, 0.95);
}

/* Keep the closing question on the same ember treatment as the hero promise. */
.close__head .molten {
  background: var(--flame);
  background-repeat: no-repeat;
  background-size: 100% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
  filter: brightness(1.12) saturate(1.08);
}

.close__lede {
  margin-top: clamp(1.75rem, 3.5vw, 2.5rem);
  text-align: left;
  max-width: 43ch;
}

/* The closing copy stays crisp while the residual particle field fades behind
   the deterministic brand mark in the right-hand column. */
.close .label,
.close__lede {
  text-shadow: 0 0 12px #000, 0 0 34px #000, 0 0 72px #000;
}

.close__actions {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  flex-wrap: wrap;
  gap: clamp(1.25rem, 3vw, 2.5rem);
  margin-top: clamp(2.5rem, 5vw, 3.5rem);
}

.close__visual {
  position: relative;
  min-height: clamp(26rem, 48vw, 40rem);
  display: grid;
  place-items: center;
  isolation: isolate;
}

.close__visual::before {
  content: '';
  position: absolute;
  z-index: -1;
  width: 94%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle,
    rgba(240, 129, 19, 0.17) 0%,
    rgba(233, 77, 29, 0.075) 34%,
    rgba(233, 77, 29, 0.025) 55%,
    transparent 74%);
}

.close__mark-fallback {
  display: none;
  width: min(100%, clamp(19rem, 35vw, 31rem));
  height: auto;
  filter: drop-shadow(0 0 42px rgba(240, 129, 19, 0.16));
}

.no-forge .close__mark-fallback,
.no-logo-sculpture .close__mark-fallback {
  display: block;
}

@media (max-width: 899px) {
  .close {
    min-height: auto;
    padding-bottom: clamp(5rem, 14vw, 8rem);
  }

  .close__grid {
    grid-template-columns: minmax(0, 1fr);
    gap: clamp(3.5rem, 10vw, 5rem);
  }

  .close__visual {
    min-height: clamp(21rem, 86vw, 34rem);
  }

  .close__mark-fallback {
    width: min(82vw, 26rem);
  }
}

@media (max-width: 640px) {
  .hero__actions,
  .close__actions { align-items: flex-start; }
  .hero__actions .btn--ember,
  .close__actions .btn--ember {
    width: 100%;
    --btn-pad: 1rem 0.9rem;
    font-size: 0.6875rem;
  }
  .work__meta { align-items: flex-start; }
  .work__tag { max-width: 8rem; }
}

/* ---------- 15. Footer ---------- */

.footer {
  border-top: 1px solid var(--rule);
  padding-block: var(--s-60) var(--s-36);
}

.footer__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--s-36);
  flex-wrap: wrap;
}

.footer__links {
  display: flex;
  gap: clamp(1.5rem, 4vw, 3rem);
  flex-wrap: wrap;
}

.footer__col {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.footer__ck {
  font-family: var(--mono);
  font-size: 0.625rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--dim);
  margin-bottom: 0.3rem;
}

.footer__link {
  font-size: 0.9375rem;
  font-weight: 200;
  color: var(--ash);
  transition: color 0.35s var(--ease), transform 0.45s var(--ease);
  width: fit-content;
}

.footer__link:hover {
  color: var(--bone);
  transform: translateX(4px);
}

.footer__bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-18);
  flex-wrap: wrap;
  margin-top: var(--s-60);
  padding-top: var(--s-24);
  border-top: 1px solid var(--rule);
  font-family: var(--mono);
  font-size: 0.625rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--dim);
}

/* ---------- 16. Cursor ---------- */

.cursor {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 90;
  width: 26px;
  height: 26px;
  margin: -13px 0 0 -13px;
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: 50%;
  pointer-events: none;
  opacity: 0;
  transition: width 0.4s var(--ease), height 0.4s var(--ease),
              margin 0.4s var(--ease), background 0.4s var(--ease),
              border-color 0.4s var(--ease), opacity 0.3s;
  will-change: transform;
}

.cursor.is-live { opacity: 1; }

.cursor.is-hot {
  width: 58px;
  height: 58px;
  margin: -29px 0 0 -29px;
  background: rgba(240, 129, 19, 0.14);
  border-color: var(--ember);
}

.cursor__dot {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 91;
  width: 4px;
  height: 4px;
  margin: -2px 0 0 -2px;
  border-radius: 50%;
  background: var(--ember);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s;
  will-change: transform;
}

.cursor__dot.is-live { opacity: 1; }

@media (hover: none), (pointer: coarse) {
  .cursor, .cursor__dot { display: none; }
  .work__visit {
    opacity: 1;
    transform: none;
  }
}

/* ---------- 17. Reveal ---------- */

/* Initial states only apply once JS is confirmed running, so the page
   remains fully readable if the script never loads. */
.js .reveal { opacity: 0; transform: translateY(28px); }
.js .reveal-line > span { transform: translateY(105%); }

/* ---------- 18. Reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .grain { animation: none; }
  .ticker__row { animation: none; }
  .js .reveal { opacity: 1; transform: none; }
  .js .reveal-line > span { transform: none; }
  .work__item:nth-child(even) { transform: none; }
  .close__mark-fallback { display: block; }
  .process { min-height: auto; }
  .process__sticky { position: relative; height: auto; }
  .process__rail-fill { transform: scale(1) !important; }
  .process .stat { opacity: 1; transform: none; filter: none; }
}
