/* =========================================================
   23AG — Helvetica Edition
   Monochrome Swiss editorial in Helvetica. One practice, two
   typographic editions: the switch flips this page in place
   between Helvetica and the System (monospace) edition.
   ========================================================= */

:root {
  --bg:    #0c0d0f;
  --text:  #e9e9ea;
  --dim:   rgba(233, 233, 234, 0.52);
  --faint: rgba(233, 233, 234, 0.30);
  --line:  rgba(233, 233, 234, 0.13);

  --font: "Helvetica Neue", Helvetica, Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "Menlo", "Consolas", monospace; /* system edition */

  --pad: clamp(1.25rem, 4vw, 3.25rem);
  --gutter: clamp(1.5rem, 4vw, 4rem);
  --frame-h: clamp(3.5rem, 5vw, 4.5rem);

  --ease: cubic-bezier(0.62, 0.05, 0.01, 0.99);

  --t-display: clamp(2.7rem, 10.5vw, 11rem);
  --t-h2:      clamp(2rem, 6.5vw, 5.75rem);
  --t-h3:      clamp(1.15rem, 1.7vw, 1.6rem);
  --t-body:    clamp(1.1rem, 1.35vw, 1.4rem);
  --t-label:   0.82rem;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
html.loading, html.loading body { overflow: hidden; height: 100%; }

body {
  background: var(--bg); color: var(--text);
  font-family: var(--font); font-weight: 400; line-height: 1.55;
  overflow-x: hidden; letter-spacing: -0.006em;
}
a { color: inherit; text-decoration: none; }
img { display: block; width: 100%; height: 100%; object-fit: cover; }
::selection { background: var(--text); color: var(--bg); }

.label { font-size: var(--t-label); text-transform: uppercase; letter-spacing: 0.1em; color: var(--dim); }
/* section header — a readable marker, no decorative hairline */
.label--section { display: block; font-size: clamp(1rem, 1.25vw, 1.3rem); letter-spacing: 0.06em; color: rgba(233, 233, 234, 0.74); }

/* scroll-reveal utility (subtle entrances on content blocks) */

/* ---------- loader (symbol "23AG" + locomotive scramble text) ---------- */
.loader {
  position: fixed; inset: 0; z-index: 1000; background: var(--bg); color: var(--text);
  display: flex; flex-direction: column; justify-content: space-between;
  padding: var(--pad); transition: transform 0.9s var(--ease);
}
.loader.is-done { transform: translateY(-101%); }
.loader__row { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; }
.loader__mark { font-size: 1.1rem; font-weight: 600; letter-spacing: -0.03em; }
.loader__ed { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.14em; color: var(--dim); }
.loader__canvas { align-self: center; width: min(920px, 84vw); aspect-ratio: 72 / 20; display: block; margin: auto 0; }
.loader__lines { display: flex; flex-direction: column; gap: 0.1rem; font-size: clamp(0.95rem, 1.5vw, 1.5rem); font-weight: 500; line-height: 1.18; letter-spacing: -0.01em; }
.loader__lines--r { text-align: right; }
.loader__lines div { white-space: nowrap; min-height: 1.18em; }
.loader__lines .is-dim { color: var(--dim); }

/* ---------- frame ---------- */
.frame {
  position: fixed; top: 0; left: 0; width: 100%; z-index: 900; height: var(--frame-h);
  display: flex; align-items: center; gap: clamp(1rem, 3vw, 2.5rem);
  padding: 0 var(--pad); mix-blend-mode: difference; color: #fff;
}
.frame__brand { font-weight: 600; font-size: 1.05rem; letter-spacing: -0.03em; }
.frame__nav { display: flex; gap: 1.75rem; margin-left: auto; }
.frame__nav a { font-size: 0.95rem; opacity: 0.6; transition: opacity 0.35s var(--ease); }
.frame__nav a.is-active, .frame__nav a:hover { opacity: 1; }

/* the switch — System (mono) ⇄ Helvetica (grotesque), flips in place */
.switch {
  display: inline-flex; align-items: stretch;
  border: 1px solid rgba(233, 233, 234, 0.34); border-radius: 100px; overflow: hidden;
  isolation: isolate; mix-blend-mode: normal; /* opt out of the frame's difference blend */
}
.switch__opt {
  padding: 0.44rem 1rem; font-size: 0.86rem; line-height: 1.1;
  display: inline-flex; align-items: center; white-space: nowrap;
  background: none; border: 0; cursor: pointer; color: var(--text); opacity: 0.55;
  transition: opacity 0.35s var(--ease), background 0.35s var(--ease), color 0.35s var(--ease);
}
.switch__opt:hover { opacity: 1; }
.switch__opt--sys { font-family: "Times New Roman", Georgia, serif; } /* OG edition's own face */
.switch__opt--helv { font-family: var(--font); font-weight: 600; letter-spacing: -0.01em; }
/* active edition fills its own option exactly (matches the OG site's switch) */
.switch__opt.is-active { opacity: 1; background: var(--text); color: var(--bg); }
@media (max-width: 880px) { .frame__nav { display: none; } .switch { margin-left: auto; } }

/* =========================================================
   1 — INTRO
   ========================================================= */
.intro {
  min-height: 100svh;
  padding: calc(var(--frame-h) + 5vh) var(--pad) var(--pad);
  display: grid; grid-template-rows: auto 1fr auto; gap: clamp(2rem, 7vh, 7rem);
}
.intro__top {
  display: flex; justify-content: space-between; gap: 1.5rem;
  font-size: var(--t-label); text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--dim); border-top: 1px solid var(--line); padding-top: 1rem;
}
.intro__head {
  align-self: center; font-size: var(--t-display); font-weight: 500;
  line-height: 0.92; letter-spacing: -0.045em;
}
.intro__head span { display: block; overflow: hidden; }
.intro__head .line-inner { display: block; }
.intro__head em { font-style: italic; font-weight: 400; }
.intro__foot { display: flex; justify-content: space-between; align-items: flex-end; gap: 2rem; border-top: 1px solid var(--line); padding-top: 1.5rem; }
.intro__lede { max-width: 44ch; font-size: var(--t-body); color: var(--dim); }
.intro__hint { font-size: 0.76rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--faint); white-space: nowrap; }
@media (max-width: 640px) { .intro__foot { flex-direction: column; align-items: flex-start; gap: 1.1rem; } }

/* =========================================================
   2 — ABOUT / MANIFESTO
   ========================================================= */
.about { padding: clamp(6rem, 12vh, 11rem) var(--pad); display: flex; flex-direction: column; gap: clamp(2.5rem, 6vh, 4.5rem); }
.about__statement { max-width: none; }
.blur-text { font-size: clamp(2.2rem, 6.8vw, 6rem); font-weight: 500; line-height: 1.04; letter-spacing: -0.035em; max-width: 17ch; }
[data-blur] .char, [data-blur] .word { display: inline-block; }
[data-blur] .word { white-space: nowrap; }
.about__cols { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: var(--gutter) clamp(3rem, 7vw, 8rem); margin-top: clamp(3rem, 9vh, 8rem); }
.about__col h3 { font-size: var(--t-h3); font-weight: 500; margin-bottom: 1.2rem; }
.about__col p { font-size: var(--t-body); color: var(--dim); max-width: 46ch; line-height: 1.65; }
@media (max-width: 720px) { .about__cols { grid-template-columns: 1fr; gap: 2.6rem; } }

/* =========================================================
   3 — WORK
   ========================================================= */
.work { height: 425vh; position: relative; }
.work__sticky { position: sticky; top: 0; height: 100vh; overflow: hidden; }
.work__grid-layer { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: center; padding: calc(var(--frame-h) + 3vh) var(--pad) var(--pad); will-change: transform, opacity; }
.work__heading { display: flex; justify-content: space-between; margin-bottom: clamp(1.8rem, 4.5vh, 3.4rem); }
.work__years { font-size: var(--t-label); text-transform: uppercase; letter-spacing: 0.12em; color: var(--dim); }
.work__grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(1rem, 2.2vw, 2rem); list-style: none; will-change: transform; width: min(1180px, 100%); margin: 0 auto; }
.work__item { will-change: transform; }
.work__item-media { aspect-ratio: 4 / 5; }

.work__feature { position: absolute; inset: 0; opacity: 0; display: grid; grid-template-columns: 1.1fr 0.9fr; align-items: center; gap: clamp(1.5rem, 5vw, 5.5rem); padding: calc(var(--frame-h) + 5vh) var(--pad) var(--pad); will-change: transform, opacity; pointer-events: none; }
.work__feature-media { height: min(70vh, 660px); }
.work__feature-meta { display: flex; flex-direction: column; gap: 0.2rem; }
.work__feature-row { display: flex; justify-content: space-between; gap: 1rem; padding: 1.05rem 0; border-top: 1px solid var(--line); font-size: clamp(0.95rem, 1.3vw, 1.2rem); }
.work__feature-row span:first-child { color: var(--dim); }
.work__feature-link { margin-top: 1.6rem; font-size: 1.1rem; pointer-events: auto; border-bottom: 1px solid var(--line); padding-bottom: 0.3rem; align-self: flex-start; transition: border-color 0.35s var(--ease); }
.work__feature-link:hover { border-color: var(--text); }
@media (max-width: 760px) { .work__feature { grid-template-columns: 1fr; align-content: center; gap: 1.5rem; } .work__feature-media { height: 44vh; } }

/* =========================================================
   4 — SELECTED CASE
   ========================================================= */
.case { padding: clamp(6rem, 12vh, 11rem) var(--pad); display: flex; flex-direction: column; gap: clamp(2.5rem, 7vh, 6rem); }
.case__head { display: flex; flex-direction: column; gap: clamp(1.4rem, 3.5vh, 2.5rem); }
.case__title { font-size: var(--t-h2); font-weight: 500; line-height: 1.0; letter-spacing: -0.035em; max-width: 18ch; }
.case__media { aspect-ratio: 4/3; }
.case__media--wide { aspect-ratio: 16/9; }
.case__body { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: var(--gutter) clamp(3rem, 7vw, 8rem); max-width: none; }
.case__block h3 { font-size: var(--t-h3); font-weight: 500; margin-bottom: 0.9rem; }
.case__block p { color: var(--dim); font-size: var(--t-body); max-width: 44ch; }
.case__pair { display: grid; grid-template-columns: 1fr 1fr; gap: var(--gutter); }
.case__result { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--gutter); border-top: 1px solid var(--line); padding-top: clamp(2.5rem, 6vh, 4.5rem); }
.case__metric { display: flex; flex-direction: column; gap: 0.6rem; }
.case__metric-num { font-size: clamp(2.6rem, 7vw, 5.75rem); font-weight: 500; letter-spacing: -0.04em; line-height: 1; }
.case__metric-label { font-size: 0.9rem; color: var(--dim); max-width: 22ch; }
@media (max-width: 720px) { .case__body, .case__pair, .case__result { grid-template-columns: 1fr; gap: 2.2rem; } }

/* =========================================================
   5 — SERVICES
   ========================================================= */
.services { padding: clamp(6rem, 12vh, 11rem) var(--pad); display: flex; flex-direction: column; }
.services__list { list-style: none; }
.service { display: grid; grid-template-columns: 0.8fr 1.4fr auto; gap: var(--gutter) clamp(2rem, 5vw, 5rem); align-items: start; padding: clamp(2.6rem, 6vh, 4.5rem) 0; border-top: 1px solid var(--line); }
.service__name { font-size: clamp(1.6rem, 4vw, 3.2rem); font-weight: 500; letter-spacing: -0.03em; }
.service__desc { font-size: var(--t-body); color: var(--dim); max-width: 46ch; }
.service__tags { list-style: none; display: flex; flex-direction: column; gap: 0.55rem; text-align: right; }
.service__tags li { font-size: clamp(0.95rem, 1vw, 1.12rem); color: var(--dim); }
@media (max-width: 760px) { .service { grid-template-columns: 1fr; gap: 1rem; } .service__tags { flex-direction: row; flex-wrap: wrap; gap: 0.5rem 1rem; text-align: left; } }

/* =========================================================
   6 — HELVETICA / COLOPHON  (the creed + specimen)
   ========================================================= */
.helv { padding: clamp(6rem, 12vh, 11rem) var(--pad); display: flex; flex-direction: column; gap: clamp(3.5rem, 9vh, 7rem); }
.helv__creed { display: flex; flex-direction: column; gap: clamp(2.5rem, 7vh, 5.5rem); }
.helv__creed p { font-size: clamp(2.4rem, 9vw, 9rem); font-weight: 600; line-height: 0.92; letter-spacing: -0.045em; max-width: 16ch; }
.helv__creed p:nth-child(2) { align-self: center; text-align: center; }
.helv__creed p:nth-child(3) { align-self: flex-end; text-align: right; }
.helv__creed em { font-style: italic; font-weight: 400; }
/* specimen letters + colophon note, one row */
.helv__colophon { display: grid; grid-template-columns: minmax(0, 1.95fr) minmax(220px, 0.8fr); gap: clamp(1.5rem, 4vw, 4rem); align-items: end; border-top: 1px solid var(--line); padding-top: clamp(1.75rem, 4vh, 3rem); }
.helv__specimen { display: flex; flex-direction: column; gap: 0.55rem; min-width: 0; }
.helv__specimen span { font-size: clamp(0.95rem, 3.4vw, 2.8rem); font-weight: 400; letter-spacing: -0.01em; color: var(--dim); white-space: nowrap; overflow: hidden; }
.helv__specimen span:first-child { color: var(--text); font-weight: 500; }
.helv__note { font-size: clamp(1.12rem, 1.3vw, 1.45rem); color: var(--dim); max-width: 40ch; line-height: 1.5; }
.helv__note a { color: var(--text); border-bottom: 1px solid var(--line); transition: border-color 0.3s; }
.helv__note a:hover { border-color: var(--text); }
@media (max-width: 820px) { .helv__colophon { grid-template-columns: 1fr; gap: 1.75rem; align-items: start; } }

/* =========================================================
   7 — CONTACT
   ========================================================= */
.contact { padding: clamp(6rem, 12vh, 11rem) var(--pad) var(--pad); display: flex; flex-direction: column; gap: clamp(3rem, 8vh, 6.5rem); }
.contact__big { font-size: var(--t-display); font-weight: 500; line-height: 0.9; letter-spacing: -0.045em; transition: opacity 0.35s var(--ease); }
.contact__big:hover { opacity: 0.6; }
.contact__cols { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--gutter); border-top: 1px solid var(--line); padding-top: clamp(1.8rem, 4vh, 3rem); }
.contact__col { display: flex; flex-direction: column; gap: 0.5rem; font-size: var(--t-body); }
.contact__k { font-size: var(--t-label); text-transform: uppercase; letter-spacing: 0.12em; color: var(--faint); margin-bottom: 0.5rem; }
.contact__col a { width: fit-content; border-bottom: 1px solid transparent; transition: border-color 0.3s; }
.contact__col a:hover { border-color: var(--text); }
.contact__base { display: flex; justify-content: space-between; gap: 1rem; font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--faint); border-top: 1px solid var(--line); padding-top: 1.5rem; }
@media (max-width: 640px) { .contact__cols { grid-template-columns: 1fr; gap: 1.9rem; } }


/* ---------- typographic cover cards ---------- */
.cover {
  position: relative; overflow: hidden; color: var(--text);
  background: #101114; border: 1px solid var(--line);
  display: flex; flex-direction: column; justify-content: space-between;
  padding: clamp(1rem, 2.3vw, 1.9rem);
  transition: background 0.4s var(--ease);
}
.cover__name { font-weight: 600; letter-spacing: -0.03em; line-height: 0.94; font-size: clamp(1.45rem, 3.3vw, 3.2rem); }
.cover__meta { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; margin-top: 1rem; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--dim); }
.cover__meta b { font-weight: 500; color: var(--text); }
.cover::after {
  content: "↗"; position: absolute; top: clamp(0.9rem, 2vw, 1.6rem); right: clamp(0.9rem, 2vw, 1.6rem);
  font-size: 1rem; opacity: 0; transform: translate(-4px, 4px);
  transition: opacity 0.4s var(--ease), transform 0.4s var(--ease);
}
.cover:hover { background: #15171c; }
.cover:hover::after { opacity: 0.75; transform: none; }
.cover--lg .cover__name { font-size: clamp(2.6rem, 6vw, 6rem); }

/* ---------- reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .blur-text .char, .blur-text .word { filter: none !important; }
}

/* ---------- detail overlay (per-project / per-service cases) ---------- */
.cover { cursor: pointer; }
.service[data-detail] { cursor: pointer; transition: opacity 0.3s var(--ease); }
.service[data-detail]:hover { opacity: 0.78; }

html.detail-lock { overflow: hidden; }
.detail {
  position: fixed; inset: 0; z-index: 1100; background: var(--bg);
  display: flex; flex-direction: column;
  transform: translateY(101%); opacity: 0; pointer-events: none;
  transition: transform 0.6s var(--ease), opacity 0.4s var(--ease);
}
.detail.is-open { transform: none; opacity: 1; pointer-events: auto; }
.detail__bar {
  flex: 0 0 auto; display: flex; justify-content: space-between; align-items: center;
  padding: clamp(0.9rem, 2.6vw, 1.4rem) var(--pad); border-bottom: 1px solid var(--line);
}
.detail__brand { font-weight: 600; font-size: 1.05rem; letter-spacing: -0.03em; }
.detail__close {
  background: none; border: 1px solid var(--line); border-radius: 100px; color: var(--text);
  font: inherit; font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.06em;
  padding: 0.5rem 1rem; cursor: pointer; transition: border-color 0.3s var(--ease);
}
.detail__close:hover { border-color: var(--text); }
.detail__inner {
  flex: 1 1 auto; overflow-y: auto;
  padding: clamp(3rem, 9vh, 7rem) var(--pad) clamp(4rem, 12vh, 9rem);
  display: flex; flex-direction: column; gap: clamp(2.5rem, 7vh, 6rem);
}
.detail__inner .case__title { max-width: 18ch; }
.detail__meta { display: flex; flex-direction: column; max-width: 560px; }
.detail__row { display: flex; justify-content: space-between; gap: 1rem; padding: 0.95rem 0; border-top: 1px solid var(--line); font-size: clamp(0.95rem, 1.2vw, 1.18rem); }
.detail__row span:first-child { color: var(--dim); }

/* =========================================================
   MOBILE — tighten the Swiss grid for phones.
   Desktop section padding (min 6rem) and display type (min ~2.7rem) are
   too large on a phone; rescale the tokens + a few components. The .work
   3-column choreography is preserved (the GSAP timeline depends on it).
   ========================================================= */
@media (min-width: 641px) and (max-width: 820px) {
  .contact__cols { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 600px) {
  :root {
    --pad: 1.15rem;
    --gutter: 1.6rem;
    --frame-h: 3.25rem;
    --t-display: clamp(2.35rem, 11.5vw, 3.6rem);
    --t-h2:      clamp(1.8rem, 8.5vw, 2.9rem);
  }

  /* shorter vertical rhythm between sections */
  .about, .case, .services, .helv {
    padding-top: clamp(3.25rem, 9vh, 4.75rem);
    padding-bottom: clamp(3.25rem, 9vh, 4.75rem);
  }
  .contact { padding-top: clamp(3.25rem, 9vh, 4.75rem); }

  /* intro fits the first screen */
  .intro { gap: clamp(1.4rem, 5vh, 2.6rem); padding-top: calc(var(--frame-h) + 3vh); }
  .intro__top { gap: 1rem; }
  .blur-text { font-size: clamp(2rem, 9vw, 3rem); max-width: 100%; }

  /* work: the pinned "grid → focus → feature" scrub is desktop-only — on a phone
     it fought Lenis + the address-bar resize (covers flashed in, vanished, then
     floated in from the top). Here it's a plain STATIC 2-up grid; main.js skips
     the GSAP sequence on mobile so nothing is transformed or pinned. */
  .work { height: auto; }
  .work__sticky { position: static; height: auto; overflow: visible; }
  .work__grid-layer { position: static; inset: auto; padding: clamp(3.25rem, 9vh, 4.75rem) var(--pad); }
  .work__feature { display: none; }
  .work__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.6rem; width: 100%; }
  .work__item-media { aspect-ratio: 1 / 1; }
  .cover { padding: 0.7rem; }
  .cover__name { font-size: clamp(0.9rem, 4vw, 1.4rem); line-height: 1.05; overflow-wrap: anywhere; }
  .cover__meta { margin-top: 0.5rem; font-size: 0.6rem; gap: 0.4rem; }

  /* loader: stack the two phrase blocks so the long lines don't run off-screen */
  .loader__row--bottom { flex-direction: column; align-items: flex-start; gap: 0.7rem; }
  .loader__row--bottom .loader__lines--r { text-align: left; }
  .loader__lines { font-size: clamp(0.82rem, 3.4vw, 1.05rem); }

  /* creed: big, but not swallowing the viewport */
  .helv__creed { gap: clamp(1.75rem, 5vh, 3rem); }
  .helv__creed p { font-size: clamp(2rem, 10vw, 3.6rem); max-width: 13ch; }

  /* overlay-case metrics + contact footer density */
  .case__metric-num { font-size: clamp(2.2rem, 11vw, 3.4rem); }
  .contact__base { flex-direction: column; align-items: flex-start; gap: 0.5rem; }
}

@media (max-width: 380px) {
  :root { --pad: 0.95rem; }
  .switch__opt { padding: 0.4rem 0.85rem; font-size: 0.8rem; }
}

/* ── header (.frame) hides on scroll-down, returns on scroll-up — toggled by main.js ── */
.frame { transition: transform 0.45s var(--ease); }
.frame.is-hidden { transform: translateY(-100%); }

/* keep the case-link arrow as a text glyph, not a colour emoji (iOS) */
.work__feature-link { font-variant-emoji: text; }
