/* =========================================================
   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.5rem, 5.5vw, 5rem);
  --gutter: clamp(1.5rem, 4vw, 3.75rem);
  --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(1rem, 1.2vw, 1.2rem);
  --t-label:   0.72rem;
}

*, *::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.14em; color: var(--dim); }
/* consistent section opener: a full-width hairline above the section label */
.label--section { display: block; border-top: 1px solid var(--line); padding-top: clamp(1rem, 2vh, 1.4rem); }

/* scroll-reveal utility (subtle entrances on content blocks) */
[data-fade] { will-change: transform, opacity; }

/* ---------- loader ---------- */
.loader {
  position: fixed; inset: 0; z-index: 1000; background: var(--bg);
  display: grid; grid-template-columns: 1fr auto; align-content: end; gap: 0.4rem;
  padding: var(--pad); transition: transform 0.9s var(--ease);
}
.loader.is-done { transform: translateY(-101%); }
.loader__mark { font-size: clamp(2rem, 8vw, 5rem); font-weight: 500; letter-spacing: -0.04em; }
.loader__sub { grid-column: 1; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.14em; color: var(--dim); }
.loader__count { grid-row: 1 / span 2; align-self: end; font-size: clamp(2rem, 8vw, 5rem); color: var(--dim); font-variant-numeric: tabular-nums; }

/* ---------- 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.5rem; margin-left: auto; }
.frame__nav a { font-size: 0.8rem; 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 {
  position: relative; display: inline-flex; align-items: stretch;
  border: 1px solid rgba(255,255,255,0.32); border-radius: 100px; overflow: hidden;
}
.switch__opt {
  position: relative; z-index: 1; padding: 0.42rem 0.95rem;
  font-size: 0.78rem; line-height: 1.2; display: inline-flex; align-items: center;
  background: none; border: 0; cursor: pointer; color: inherit;
  transition: color 0.4s var(--ease), opacity 0.4s var(--ease);
}
.switch__opt:hover { opacity: 1; }
.switch__opt--sys { font-family: var(--mono); opacity: 0.6; }
.switch__opt--helv { font-family: var(--font); font-weight: 600; letter-spacing: -0.01em; color: #fff; }
body.sys .switch__opt--helv { color: inherit; opacity: 0.6; }
body.sys .switch__opt--sys { opacity: 1; color: #fff; }
.switch__rail {
  position: absolute; z-index: 0; top: 0; bottom: 0; left: 50%; right: 0;
  background: rgba(255,255,255,0.16); transition: transform 0.45s var(--ease);
}
body.sys .switch__rail { transform: translateX(-100%); }
@media (max-width: 880px) { .frame__nav { display: none; } }
@media (max-width: 460px) { .frame__brand { display: none; } }

/* =========================================================
   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(9rem, 22vh, 20rem) var(--pad); display: flex; flex-direction: column; gap: clamp(4.5rem, 12vh, 10rem); }
.about__statement { max-width: none; }
.blur-text { font-size: clamp(2rem, 6.4vw, 5.4rem); font-weight: 500; line-height: 1.05; letter-spacing: -0.035em; max-width: 16ch; }
[data-blur] .char, [data-blur] .word { display: inline-block; will-change: filter; }
[data-blur] .word { white-space: nowrap; }
.about__cols { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: var(--gutter) clamp(2.5rem, 6vw, 6rem); max-width: 1000px; margin-left: auto; border-top: 1px solid var(--line); padding-top: clamp(2rem, 5vh, 3.5rem); }
.about__col h3 { font-size: var(--t-h3); font-weight: 500; margin-bottom: 1.1rem; }
.about__col p { font-size: var(--t-body); color: var(--dim); max-width: 40ch; line-height: 1.6; }
@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, 1fr); gap: clamp(0.9rem, 2vw, 1.8rem); list-style: none; will-change: transform; width: min(940px, 94%); margin: 0 auto; }
.work__item { will-change: transform; }
.work__item-media { position: relative; aspect-ratio: 4 / 5; overflow: hidden; background: #15161a; }
.work__item-cap { display: flex; justify-content: space-between; gap: 1rem; margin-top: 0.7rem; font-size: 0.78rem; color: var(--dim); }
.work__item-cap b { font-weight: 500; color: var(--text); }

.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 { position: relative; height: min(70vh, 660px); overflow: hidden; background: #15161a; }
.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(9rem, 20vh, 18rem) var(--pad); display: flex; flex-direction: column; gap: clamp(3rem, 8vh, 7rem); }
.case__head { display: flex; flex-direction: column; gap: clamp(1.6rem, 4vh, 3rem); }
.case__title { font-size: var(--t-h2); font-weight: 500; line-height: 1.0; letter-spacing: -0.035em; max-width: 18ch; }
.case__media { position: relative; overflow: hidden; background: #15161a; 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); max-width: 1080px; }
.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(9rem, 20vh, 18rem) var(--pad); display: flex; flex-direction: column; gap: clamp(3rem, 7vh, 5.5rem); }
.services__list { list-style: none; }
.service { display: grid; grid-template-columns: 0.8fr 1.4fr auto; gap: var(--gutter); align-items: start; padding: clamp(2.6rem, 6vh, 4.5rem) 0; border-top: 1px solid var(--line); }
.service:last-child { border-bottom: 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.45rem; text-align: right; }
.service__tags li { font-size: 0.85rem; 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(10rem, 22vh, 20rem) var(--pad); display: flex; flex-direction: column; gap: clamp(4.5rem, 13vh, 11rem); }
.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; }
.helv__specimen { display: flex; flex-direction: column; gap: 0.4rem; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: clamp(1.5rem, 4vh, 3rem) 0; }
.helv__specimen span { font-size: clamp(1.1rem, 4.4vw, 3.4rem); 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: 0.86rem; color: var(--faint); max-width: 60ch; line-height: 1.7; }
.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); }

/* =========================================================
   7 — CONTACT
   ========================================================= */
.contact { padding: clamp(9rem, 20vh, 18rem) var(--pad) var(--pad); display: flex; flex-direction: column; gap: clamp(3.5rem, 10vh, 8rem); }
.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(3, 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; } }

/* =========================================================
   SYSTEM EDITION — in-place toggle (no navigation)
   Same content, set in monospace. Display scale reduced
   because mono runs ~1.6× wider than Helvetica.
   ========================================================= */
main { transition: opacity 0.22s var(--ease), filter 0.22s var(--ease); }
body.is-switching main { opacity: 0; filter: blur(7px); }

body.sys {
  --font: var(--mono);
  --t-display: clamp(1.5rem, 5vw, 4.4rem);
  --t-h2:      clamp(1.4rem, 3.8vw, 3.1rem);
  letter-spacing: 0;
}
body.sys .intro__head,
body.sys .contact__big,
body.sys .case__title,
body.sys .service__name,
body.sys .blur-text,
body.sys .case__metric-num { letter-spacing: 0; font-weight: 500; }
body.sys .intro__head em,
body.sys .helv__creed em { font-style: normal; }
body.sys .helv__creed p { font-size: clamp(1.4rem, 4.6vw, 3.6rem); font-weight: 500; letter-spacing: 0; }
body.sys .helv__specimen span { font-size: clamp(0.85rem, 2.8vw, 1.9rem); }
body.sys .blur-text { max-width: 22ch; }
body.sys .case__title { max-width: 24ch; }

/* ---------- pixel canvas overlay ---------- */
.pixel-canvas-el { position: absolute; inset: 0; width: 100%; height: 100%; display: block; z-index: 2; }
[data-pixel] img { z-index: 1; }

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