/* ====================================================================
   HOME — hero, pinned work, index, principles, about
   ==================================================================== */

.section { padding: clamp(5rem, 9vw, 8rem) var(--gutter); }
.section-inner { max-width: var(--maxw); margin: 0 auto; }

.section-title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(2.2rem, 5vw, 4.6rem);
  line-height: 1;
  letter-spacing: -0.015em;
  max-width: 24ch;
  margin-bottom: clamp(3rem, 6vw, 5rem);
}

/* ── HERO ───────────────────────────────────────────── */
.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  padding: 6rem var(--gutter) 5.5rem;
  overflow: hidden;
}

.hero-grid {
  position: absolute;
  inset: 0 var(--gutter);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  pointer-events: none;
  opacity: 0.6; /* drafting lines sit behind the type, not on it */
}

.hero-grid span { border-left: 1px solid var(--line); }
.hero-grid span:last-child { border-right: 1px solid var(--line); }

.hero-inner {
  position: relative;
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.hero-eyebrow {
  display: flex;
  align-items: center;
  gap: 1rem;
  color: var(--accent);
  margin-bottom: clamp(1.5rem, 3vw, 2.5rem);
}

.hero-eyebrow-rule {
  width: 48px;
  height: 1px;
  background: currentColor;
  opacity: 0.5;
}

.hero-title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(3.1rem, 9.4vw, 10.5rem);
  line-height: 0.9;
  letter-spacing: -0.025em;
}

.hero-title .line {
  display: block;
  overflow: hidden;
  /* room for descenders inside the mask */
  padding-bottom: 0.09em;
  margin-bottom: -0.09em;
}

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

.hero-foot {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 3rem;
  margin-top: clamp(2.5rem, 5vw, 4rem);
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
}

.hero-lede {
  max-width: 46ch;
  font-size: clamp(1rem, 1.25vw, 1.15rem);
  font-weight: 300;
  line-height: 1.6;
  color: var(--muted);
}

.hero-lede strong { color: var(--text); font-weight: 400; }

.hero-stats {
  display: flex;
  gap: clamp(1.5rem, 4vw, 4rem);
}

.hero-stats div {
  display: flex;
  flex-direction: column-reverse;
  justify-content: flex-end;
  gap: 0.5rem;
  min-width: 5.5rem;
  padding-left: 1rem;
  border-left: 1px solid var(--line);
}

.hero-stats dt { white-space: nowrap; }

.hero-stats dd {
  font-family: var(--serif);
  font-size: clamp(2.2rem, 4vw, 3.6rem);
  line-height: 1;
  letter-spacing: -0.02em;
}

.hero-scroll {
  position: absolute;
  left: var(--gutter);
  bottom: 1.6rem;
  display: inline-flex;
  align-items: center;
  gap: 0.9rem;
  text-decoration: none;
  color: var(--muted);
  transition: color 0.25s;
}

.hero-scroll:hover { color: var(--text); }

.hero-scroll-line {
  position: relative;
  width: 64px;
  height: 1px;
  background: var(--line-strong);
  overflow: hidden;
}

.hero-scroll-line::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--accent);
  transform: translateX(-100%);
  animation: scan 2.2s var(--ease-out) infinite;
}

@keyframes scan {
  0% { transform: translateX(-100%); }
  60%, 100% { transform: translateX(100%); }
}

/* ── WORK (pinned stage) ────────────────────────────── */
/* The stage is opaque and stacked above the hero, so if the pin engages a few
   pixels early or late (native touch scrolling on phones), the hero can never
   show through the empty parts of a frame mid-curtain. */
.work { position: relative; z-index: 2; }

.work-stage {
  position: relative;
  background: var(--bg);
  height: 100vh;
  height: 100svh;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 1.25rem;
  padding: 4.25rem var(--gutter) 1.5rem;
  overflow: hidden;
}

.work-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  max-width: var(--maxw);
  width: 100%;
  margin: 0 auto;
  padding-bottom: 0.9rem;
  border-bottom: 1px solid var(--line);
}

.work-head-title { color: var(--accent); }

.work-progress { display: flex; align-items: center; gap: 1rem; }

.work-bar {
  position: relative;
  width: clamp(80px, 12vw, 180px);
  height: 1px;
  background: var(--line-strong);
}

.work-bar-fill {
  position: absolute;
  inset: 0;
  background: var(--text);
  transform-origin: left;
  transform: scaleX(0);
}

.work-slides {
  position: relative;
  max-width: var(--maxw);
  width: 100%;
  margin: 0 auto;
}

.work-slide {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: clamp(1.5rem, 3.5vw, 3.5rem);
}

/* info rail */
.work-info {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 0;
  padding: 0.25rem 0 0.25rem;
  visibility: hidden;
  opacity: 0;
}

.work-index {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--faint);
  letter-spacing: 0.05em;
}

.work-name {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(2.8rem, 5.6vw, 6.2rem);
  line-height: 0.92;
  letter-spacing: -0.02em;
  margin: 0.6rem 0 0.9rem;
}

.work-name a { text-decoration: none; }

.work-category { color: var(--accent); }

.work-spec {
  display: grid;
  grid-template-columns: 5.5rem minmax(0, 1fr);
  border-top: 1px solid var(--line);
}

.work-spec dt,
.work-spec dd {
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--line);
}

.work-spec dd {
  font-size: 0.9rem;
  color: var(--text);
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
}

.work-metric {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.5rem;
}

.work-metric-value {
  font-family: var(--serif);
  font-size: clamp(3rem, 6vw, 6.4rem);
  line-height: 0.85;
  letter-spacing: -0.03em;
  color: var(--accent);
}

.work-metric-label { display: block; margin-top: 0.75rem; max-width: 22ch; }

/* only the project on screen takes the pointer — the stacked frames above
   it are empty windows until their curtain rises */
.work-slide { pointer-events: none; }
.work-slide.is-active,
.work.is-static .work-slide { pointer-events: auto; }

/* media frame: a fixed rounded window; the curtain moves inside it */
.work-media {
  position: relative;
  display: block;
  border-radius: 14px;
  overflow: hidden;
  isolation: isolate;
  transform: translateZ(0); /* keeps Safari clipping transformed children to the radius */
}

.work-media-inner {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background: var(--surface);
  will-change: transform;
}

.work-cover {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  will-change: transform;
}

.work-media-inner::after {
  /* gentle vignette so the screenshot card separates from the photo */
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 45%, rgba(12, 12, 11, 0.55));
  pointer-events: none;
}

.work-dim {
  position: absolute;
  inset: 0;
  z-index: 3;
  background: var(--bg);
  opacity: 0;
  pointer-events: none;
}

/* project name rises out of a mask */
.work-name-mask {
  display: block;
  overflow: hidden;
  padding-bottom: 0.1em;
  margin-bottom: -0.1em;
}

.work-name-text { display: inline-block; will-change: transform; }

.work-count { display: inline-block; overflow: hidden; vertical-align: bottom; }
[data-work-current] { display: inline-block; }

.work-shot {
  position: absolute;
  z-index: 2;
  right: 5%;
  bottom: 0;
  width: min(58%, 560px);
  border-radius: 10px 10px 0 0;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.28), 0 0 0 1px rgba(0, 0, 0, 0.12);
  will-change: transform;
}

.work-shot-bar {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem 0.7rem;
  background: #111110;
  color: rgba(255, 255, 255, 0.55);
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.03em;
}

.work-shot-dots { display: inline-flex; gap: 4px; }
.work-shot-dots i { width: 7px; height: 7px; border-radius: 50%; background: rgba(240, 237, 232, 0.18); }

.work-shot img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; object-position: top; }

/* static fallback (reduced motion): slides become a normal list */
.work.is-static .work-stage { height: auto; overflow: visible; padding-top: 6rem; }
.work.is-static .work-progress { display: none; }
.work.is-static .work-slides { display: grid; gap: 6rem; }
.work.is-static .work-slide { position: relative; inset: auto; }
.work.is-static .work-info { visibility: visible; opacity: 1; gap: 2rem; }
.work.is-static .work-media { aspect-ratio: 4 / 3; }

/* ── CURSOR LABEL ───────────────────────────────────── */
.cursor-label {
  position: fixed;
  top: 0; left: 0;
  z-index: 950;
  pointer-events: none;
  padding: 0.55rem 0.8rem;
  border-radius: 4px;
  background: var(--text);
  color: var(--bg);
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.6);
  transition: opacity 0.25s, transform 0.35s var(--ease-out);
  white-space: nowrap;
}

.cursor-label.is-active { opacity: 1; transform: translate(-50%, -50%) scale(1); }

/* ── INDEX ──────────────────────────────────────────── */
.index-row {
  display: grid;
  grid-template-columns: 3.5rem minmax(0, 1.3fr) minmax(0, 2fr) minmax(0, 1.5fr) 5.5rem;
  gap: 1.5rem;
  align-items: center;
  padding: 1.4rem 0;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
  color: var(--text);
  position: relative;
}

.index-row--head { padding: 0 0 0.9rem; color: var(--faint); }
.index .section-head { margin-bottom: 2rem; }

a.index-row::before {
  content: "";
  position: absolute;
  inset: 0 calc(-1 * var(--gutter) / 2);
  background: var(--surface);
  opacity: 0;
  transition: opacity 0.3s;
  z-index: -1;
}

a.index-row:hover::before { opacity: 1; }

.index-no { font-family: var(--mono); font-size: 0.75rem; color: var(--faint); }

.index-name {
  font-family: var(--serif);
  font-size: clamp(1.6rem, 2.6vw, 2.4rem);
  line-height: 1;
  transition: transform 0.45s var(--ease-out), color 0.3s;
}

a.index-row:hover .index-name { transform: translateX(0.6rem); color: var(--accent); }

.index-scope { font-size: 0.9rem; color: var(--muted); line-height: 1.5; }

.index-stack { display: flex; flex-wrap: wrap; gap: 0.35rem; }

.index-year {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--muted);
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
}

.index-year .arrow { transition: transform 0.35s var(--ease-out); }
a.index-row:hover .index-year .arrow { transform: translate(3px, -3px); color: var(--accent); }

.index-preview {
  position: fixed;
  top: 0; left: 0;
  z-index: 800;
  width: 280px;
  aspect-ratio: 4 / 3;
  border-radius: 8px;
  overflow: hidden;
  pointer-events: none;
  opacity: 0;
  transform: scale(0.85);
  transition: opacity 0.3s, transform 0.45s var(--ease-out);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.25);
}

.index-preview.is-active { opacity: 1; transform: scale(1); }
.index-preview img { width: 100%; height: 100%; object-fit: cover; }

/* ── BRANDS ─────────────────────────────────────────── */
.brand-grid {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}

.brand {
  position: relative;
  aspect-ratio: 3 / 2;
  display: grid;
  place-items: center;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  transition: background 0.4s var(--ease-out);
}

.brand img {
  /* same box for every logo; contain scales small SVGs up and wide ones down.
     Absolutely placed so a logo's intrinsic size can never stretch its cell. */
  position: absolute;
  inset: 0;
  margin: auto;
  width: 60%;
  height: 24%;
  object-fit: contain;
  /* every logo rendered in the site's ink, whatever its brand colours */
  filter: brightness(0);
  opacity: 0.68;
  transition: opacity 0.4s var(--ease-out), transform 0.5s var(--ease-out);
}

.brand--tall img { height: 42%; }

.brand-name {
  position: absolute;
  left: 0.75rem;
  bottom: 0.6rem;
  font-size: 0.62rem;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.3s, transform 0.4s var(--ease-out);
}

.brand:hover { background: var(--surface); }
.brand:hover img { opacity: 1; transform: scale(1.04); }
.brand:hover .brand-name { opacity: 1; transform: none; }

/* ── PRINCIPLES ─────────────────────────────────────── */
.principles-list {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: clamp(2rem, 5vw, 5rem);
  counter-reset: p;
}

.principle {
  display: grid;
  grid-template-columns: 3.5rem minmax(0, 1fr);
  gap: 0 1rem;
  padding: 2rem 0 2.5rem;
  border-top: 1px solid var(--line);
}

.principle-no { font-family: var(--mono); font-size: 0.75rem; color: var(--accent); padding-top: 0.6rem; }

.principle h3 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(1.8rem, 2.8vw, 2.6rem);
  line-height: 1.05;
  margin-bottom: 0.9rem;
}

.principle p {
  color: var(--muted);
  font-weight: 300;
  max-width: 44ch;
  margin-bottom: 1.4rem;
}

.principle-evidence {
  display: inline-flex;
  gap: 0.6rem;
  align-items: baseline;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.02em;
  color: var(--text);
  text-decoration: none;
  line-height: 1.5;
}

.principle-evidence span:first-child { color: var(--faint); text-transform: uppercase; letter-spacing: 0.05em; }
.principle-evidence:hover { color: var(--accent); }

/* ── ABOUT ──────────────────────────────────────────── */
.about-grid {
  display: grid;
  grid-template-columns: minmax(0, 4fr) minmax(0, 7fr);
  gap: clamp(2rem, 6vw, 6rem);
  align-items: start;
}

.about-portrait { position: relative; }

.about-portrait img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  border-radius: 14px;
  filter: grayscale(0.35) contrast(1.05);
  transition: filter 0.6s;
}

.about-portrait:hover img { filter: none; }

.about-portrait figcaption { margin-top: 0.8rem; }

.about-bio {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(1.9rem, 3.6vw, 3.4rem);
  line-height: 1.08;
  letter-spacing: -0.01em;
  margin-bottom: clamp(2.5rem, 5vw, 4rem);
}

.about-cols {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 2.5rem;
  margin-bottom: 3rem;
}

.about-col-label { display: block; margin-bottom: 0.9rem; }

.timeline { list-style: none; border-top: 1px solid var(--line); }

.timeline li {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  padding: 0.9rem 0;
  border-bottom: 1px solid var(--line);
}

.timeline strong { display: block; font-weight: 500; }
.timeline small { font-size: 0.88rem; color: var(--muted); }
.timeline .label { white-space: nowrap; }

/* ── RESPONSIVE ─────────────────────────────────────── */
@media (max-width: 1100px) {
  .index-row { grid-template-columns: 3rem minmax(0, 1.2fr) minmax(0, 2fr) 4.5rem; }
  .index-stack, .index-row--head > :nth-child(4) { display: none; }
}

@media (max-width: 900px) {
  /* minmax(0, …) so wide content (the stats row) can't stretch the column past the screen */
  .hero-foot { grid-template-columns: minmax(0, 1fr); gap: 2rem; }
  .hero-grid { grid-template-columns: repeat(2, 1fr); }
  .hero-grid span:nth-child(n+3) { display: none; }

  .work-stage { padding-top: 3.75rem; gap: 0.75rem; }

  .work-slide {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(0, 1fr) auto;
    gap: 1rem;
  }

  .work-media { order: -1; }
  .work-info { justify-content: flex-start; gap: 0.9rem; }
  .work-name { font-size: clamp(2.2rem, 10vw, 3.4rem); margin: 0.2rem 0 0.4rem; }
  .work-spec { display: none; }
  .work-metric-value { font-size: clamp(2.4rem, 11vw, 3.4rem); }
  .work-metric-label { margin-top: 0.4rem; }
  .work-shot { width: 64%; right: 4%; }

  .work.is-static .work-media { aspect-ratio: 4 / 5; }

  .principles-list { grid-template-columns: 1fr; }
  .brand-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .about-grid { grid-template-columns: 1fr; }
  .about-portrait { max-width: 360px; }
}

@media (max-width: 640px) {
  .hero-title { font-size: 15vw; }
  .hero-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.75rem; }
  .hero-stats div { min-width: 0; padding-left: 0.75rem; }
  .hero-stats dt { white-space: normal; }
  .index-row { grid-template-columns: 2.25rem minmax(0, 1fr) auto; gap: 1rem; }
  .index-scope, .index-row--head > :nth-child(3) { display: none; }
  .about-cols { grid-template-columns: 1fr; }
  .brand-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .brand img { width: 68%; opacity: 0.8; }
  .work-shot-bar span:last-child { display: none; }
}

@media (pointer: coarse) {
  .cursor-label, .index-preview { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .hero-scroll-line::after { animation: none; transform: none; }
}
