/* ============================================================
   EMDEX DESIGN — core stylesheet
   Brand: #104635
   Modes: [data-mode="design"] | [data-mode="mc"]
   ============================================================ */

/* ---------- 1. Tokens ---------- */
:root {
  /* ---- DARK (default) ---- */
  --bg:        #060907;
  --bg-2:      #0A100D;
  --surface:   #0E1712;
  --surface-2: #132019;

  /* brand — everything is #104635 and lighter tints of it */
  --brand:     #104635;
  --brand-lit: #1A7A5B;

  /* accent = lighter tint of the brand (shifted per mode) */
  --accent:    #2FA97E;
  --accent-dim:#1D6E51;
  --on-accent: #04150D;

  /* text */
  --fg:        #EDF2EF;
  --fg-soft:   #B6C2BC;
  --muted:     #77877F;

  /* neutral ink channel — drives hairlines, ghost type and the canvas field,
     so a single swap flips every one of them with the theme */
  --ink:       237, 242, 239;
  --field:     1;                       /* backdrop intensity multiplier */

  --line:      rgba(var(--ink), .11);
  --line-str:  rgba(var(--ink), .22);

  /* on dark, depth comes from the surfaces themselves — no shadows */
  --shadow-soft: none;
  --shadow:      none;
  --shadow-lift: none;
  --shadow-pop:  none;

  /* type */
  --f-display: "Unbounded", "Onest", system-ui, sans-serif;
  --f-body:    "Onest", system-ui, -apple-system, sans-serif;
  --f-mono:    "JetBrains Mono", ui-monospace, monospace;

  /* spacing */
  --s-1: 8px;
  --s-2: 16px;
  --s-3: 24px;
  --s-4: 40px;
  --s-5: 64px;
  --s-6: 96px;
  --gutter: clamp(20px, 4vw, 72px);
  --section-y: clamp(80px, 11vw, 180px);

  --radius: 2px;
  --nav-h: 72px;
  --ease: cubic-bezier(.22, 1, .36, 1);
}

/* mode only shifts accent + geometry, never the surfaces — that's the theme's job */
:root[data-mode="mc"] {
  --accent:    #46D3A0;
  --accent-dim:#2A8F6A;
  --on-accent: #04170F;
  --radius:    0px;
}

/* ---- LIGHT ---- */
:root[data-theme="light"] {
  --bg:        #F4F7F4;
  --bg-2:      #E9EFEA;
  --surface:   #FFFFFF;
  --surface-2: #F0F3F0;

  --accent:    #104635;
  --accent-dim:#1A7A5B;
  --on-accent: #FFFFFF;

  --fg:        #0A1410;
  --fg-soft:   #33413A;
  --muted:     #3C4A42;   /* dark enough to stay legible over the hero wash */

  --ink:       10, 20, 16;
  --field:     1.3;

  --line:      rgba(var(--ink), .14);
  --line-str:  rgba(var(--ink), .28);

  /* hairlines alone read flat on white — every raised surface gets a shadow */
  --shadow-soft: 0 1px 2px rgba(var(--ink), .05);
  --shadow:      0 1px 2px rgba(var(--ink), .05), 0 6px 18px rgba(var(--ink), .06);
  --shadow-lift: 0 2px 5px rgba(var(--ink), .06), 0 18px 36px rgba(var(--ink), .11);
  --shadow-pop:  0 24px 70px rgba(var(--ink), .2);
}
:root[data-theme="light"][data-mode="mc"] {
  --accent:    #17654B;
  --accent-dim:#22876A;
  --on-accent: #FFFFFF;
}

/* ---------- 2. Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html {
  background: var(--bg);
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}
body {
  font-family: var(--f-body);
  font-size: 16px;
  line-height: 1.55;
  color: var(--fg);
  background: var(--bg);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, svg, video { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
/* padding:0 matters — the UA default is 1px 6px, which shows up as an uneven
   inset on any button used as a card */
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
ul, ol { margin: 0; padding: 0; list-style: none; }
h1, h2, h3, h4, p { margin: 0; }

::selection { background: var(--accent); color: var(--on-accent); }

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

/* ---------- 3. Layout ---------- */
/* Animated field (canvas) sits behind everything; content is lifted above it. */
.backdrop {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  display: block;
  width: 100%;
  height: 100%;
}
main, .footer { position: relative; z-index: 1; }

.shell {
  width: 100%;
  max-width: 1680px;
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.section { padding-block: var(--section-y); position: relative; }
.section--tight { padding-block: clamp(56px, 7vw, 110px); }

.rule { height: 1px; background: var(--line); border: 0; margin: 0; }

/* Section head: label + title, asymmetric grid */
.sec-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--s-3);
  margin-bottom: clamp(40px, 5vw, 80px);
}
@media (min-width: 900px) {
  .sec-head { grid-template-columns: 260px minmax(0, 1fr); gap: var(--s-5); align-items: start; }
}

.label {
  font-family: var(--f-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--muted);
}
.label--accent { color: var(--accent); }

/* ---------- 4. Typography ---------- */
/* Unbounded needs ~1.18 line-height before the breve of Й/Ё on one line
   touches a Ц/Д/Щ tail on the line above. 1.2 everywhere, with margin. */
.display {
  font-family: var(--f-display);
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -.035em;
  text-transform: uppercase;
}
.t-hero   { font-size: clamp(2.6rem, 13.5vw, 15rem); line-height: .9; }  /* single line, latin only */
.t-xl     { font-size: clamp(2rem, 5.2vw, 4.6rem); line-height: 1.2; }
.t-lg     { font-size: clamp(1.6rem, 3.4vw, 3rem); line-height: 1.2; }
.t-md     { font-size: clamp(1.15rem, 1.9vw, 1.6rem); line-height: 1.24; letter-spacing: -.02em; }

.lede {
  font-size: clamp(1rem, 1.35vw, 1.2rem);
  line-height: 1.6;
  color: var(--fg-soft);
  max-width: 62ch;
}
.small { font-size: .875rem; color: var(--muted); line-height: 1.6; }
.accent { color: var(--accent); }

/* ---------- 5. Buttons ---------- */
.btn {
  --pad: 18px 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 52px;
  padding: var(--pad);
  border-radius: 999px;
  font-family: var(--f-mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: .12em;
  text-transform: uppercase;
  position: relative;
  overflow: hidden;
  isolation: isolate;
  transition: color .25s var(--ease), border-color .25s var(--ease);
}
[data-mode="mc"] .btn { border-radius: 0; }

.btn::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  transform: translateY(101%);
  transition: transform .45s var(--ease);
}
.btn:hover::after, .btn:focus-visible::after { transform: translateY(0); }

.btn--primary { background: var(--accent); color: var(--on-accent); box-shadow: var(--shadow); }
.btn--primary::after { background: var(--fg); }
.btn--primary:hover { color: var(--bg); }

.btn--ghost { border: 1px solid var(--line-str); color: var(--fg); }
.btn--ghost::after { background: var(--accent); }
.btn--ghost:hover { color: var(--on-accent); border-color: var(--accent); }

.btn__arrow { transition: transform .4s var(--ease); }
.btn:hover .btn__arrow { transform: translateX(4px); }

/* ---------- 6. Nav ---------- */
.nav {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 80;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  background: color-mix(in srgb, var(--bg) 72%, transparent);
  border-bottom: 1px solid transparent;
  transition: border-color .3s, transform .45s var(--ease), background .3s;
}
.nav.is-stuck { border-bottom-color: var(--line); }
.nav.is-hidden { transform: translateY(-100%); }

.nav__inner {
  width: 100%;
  display: flex;
  align-items: center;
  gap: var(--s-3);
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--f-display);
  font-weight: 800;
  font-size: 15px;
  letter-spacing: .02em;
  text-transform: uppercase;
  margin-right: auto;
  padding-block: 11px; /* keeps the tap target at 44px */
}
.logo__mark { width: auto; height: 34px; flex: 0 0 auto; color: var(--fg); }
/* stacked lockup: Emdex over Design */
.logo__word { display: flex; flex-direction: column; line-height: 1.04; }

.nav__links { display: none; gap: 28px; }
@media (min-width: 1100px) { .nav__links { display: flex; } }

.nav__link {
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--fg-soft);
  padding: 6px 0;
  position: relative;
  transition: color .25s;
}
.nav__link::after {
  content: "";
  position: absolute;
  left: 0; bottom: 0;
  width: 100%; height: 1px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform .4s var(--ease);
}
.nav__link:hover { color: var(--fg); }
.nav__link:hover::after { transform: scaleX(1); transform-origin: left; }

/* mode + lang switches */
.switch {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px;
  background: color-mix(in srgb, var(--surface) 70%, transparent);
  box-shadow: var(--shadow-soft);
}
[data-mode="mc"] .switch { border-radius: 0; }

.switch__opt {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0 14px;
  border-radius: 999px;
  font-family: var(--f-mono);
  font-size: 10.5px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
  transition: color .25s, background .25s;
}
[data-mode="mc"] .switch__opt { border-radius: 0; }
.switch__opt:hover { color: var(--fg); }
.switch__opt.is-active { background: var(--accent); color: var(--on-accent); }

/* touch devices get the full 44px target */
@media (pointer: coarse) {
  .switch__opt { min-height: 44px; padding-inline: 18px; }
}

/* theme toggle — shows the icon of the theme it switches TO */
.theme-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px; height: 40px;
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--fg-soft);
  box-shadow: var(--shadow-soft);
  transition: color .25s, border-color .25s;
}
[data-mode="mc"] .theme-btn { border-radius: 0; }
.theme-btn:hover { color: var(--accent); border-color: var(--accent); }
.theme-btn svg { display: block; }
.theme-btn .ico-moon { display: none; }
:root[data-theme="light"] .theme-btn .ico-sun { display: none; }
:root[data-theme="light"] .theme-btn .ico-moon { display: block; }
@media (pointer: coarse) { .theme-btn { width: 44px; height: 44px; } }

/* under ~380px the nav can't hold four controls — the toggle moves into the menu */
.theme-btn--menu { display: none; }
@media (max-width: 379px) {
  .theme-btn--nav { display: none; }
  .theme-btn--menu { display: inline-flex; }
}
@media (max-width: 767px) {
  .nav__inner { gap: 12px; }
  .switch__opt { padding: 0 12px; }
}

.switch--mode { display: none; }
@media (min-width: 760px) { .switch--mode { display: inline-flex; } }

.burger {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px; height: 44px;
  align-items: center;
}
@media (min-width: 1100px) { .burger { display: none; } }
.burger span {
  display: block;
  width: 20px; height: 1.5px;
  background: var(--fg);
  transition: transform .35s var(--ease), opacity .2s;
}
.burger.is-open span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.burger.is-open span:nth-child(2) { opacity: 0; }
.burger.is-open span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

/* mobile menu */
.menu {
  position: fixed;
  inset: 0;
  z-index: 70;
  background: var(--bg-2);
  padding: calc(var(--nav-h) + 32px) var(--gutter) 40px;
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
  clip-path: inset(0 0 100% 0);
  transition: clip-path .6s var(--ease);
  overflow-y: auto;
}
.menu.is-open { clip-path: inset(0 0 0 0); }
.menu__link {
  font-family: var(--f-display);
  font-weight: 700;
  font-size: clamp(2rem, 9vw, 3.4rem);
  line-height: 1.2;
  letter-spacing: -.03em;
  text-transform: uppercase;
  padding: 6px 0;
}
.menu__link:hover { color: var(--accent); }
.menu__foot { margin-top: auto; display: grid; gap: 14px; padding-top: 32px; border-top: 1px solid var(--line); }

/* ---------- 7. Preloader ---------- */
.preloader {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: var(--bg);
  display: flex;
  align-items: flex-end;
  padding: var(--gutter);
}
.preloader__inner { width: 100%; }

/* the bar sits in flow above the row, so a tall counter can never run into it */
.preloader__bar {
  height: 1px;
  background: var(--line);
  margin-bottom: clamp(20px, 3vw, 36px);
}
.preloader__bar i {
  display: block;
  height: 100%;
  width: 0%;
  background: var(--accent);
}

.preloader__row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--s-3);
}
.preloader__num {
  font-family: var(--f-display);
  font-weight: 800;
  font-size: clamp(3rem, 14vw, 10rem);
  line-height: .85;
  letter-spacing: -.05em;
}

.xfer .preloader { display: none; }

/* page-transition curtain */
.curtain {
  position: fixed;
  inset: 0;
  z-index: 150;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  pointer-events: none;
}
.curtain i { background: var(--bg-2); transform: scaleY(0); transform-origin: top; }
.curtain.is-active { pointer-events: all; }
/* arriving from the other mode — start covered so nothing flashes */
.xfer .curtain i { transform: scaleY(1); transform-origin: bottom; }

/* ---------- 8. Cursor (pointer devices only) ---------- */
.cursor, .cursor-ring { display: none; }
@media (hover: hover) and (pointer: fine) and (min-width: 1100px) {
  .cursor, .cursor-ring {
    display: block;
    position: fixed;
    top: 0; left: 0;
    z-index: 190;
    pointer-events: none;
    border-radius: 50%;
    will-change: transform;
  }
  [data-mode="mc"] .cursor, [data-mode="mc"] .cursor-ring { border-radius: 0; }
  .cursor { width: 6px; height: 6px; background: var(--accent); margin: -3px 0 0 -3px; }
  .cursor-ring {
    width: 34px; height: 34px;
    border: 1px solid var(--line-str);
    margin: -17px 0 0 -17px;
    transition: width .3s var(--ease), height .3s var(--ease), margin .3s var(--ease), border-color .3s;
  }
  .cursor-ring.is-hot {
    width: 62px; height: 62px; margin: -31px 0 0 -31px;
    border-color: var(--accent);
  }
}

/* ---------- 9. Hero ---------- */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding-top: calc(var(--nav-h) + 40px);
  padding-bottom: 0;
  overflow: hidden;
}
.hero__bg {
  position: absolute;
  inset: -10% -10% 0 -10%;
  z-index: 0;
  background:
    radial-gradient(58% 52% at 18% 14%, var(--brand) 0%, transparent 66%),
    radial-gradient(50% 46% at 78% 4%, color-mix(in srgb, var(--accent) 26%, transparent) 0%, transparent 70%),
    radial-gradient(80% 60% at 50% 96%, color-mix(in srgb, var(--brand) 55%, transparent) 0%, transparent 72%);
  filter: blur(18px);
  will-change: transform;
}

.hero__inner {
  position: relative;
  z-index: 2;
  width: 100%;
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* top meta strip — studio coordinates */
.hero__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 16px clamp(24px, 5vw, 80px);
  justify-content: space-between;
  padding-top: clamp(16px, 3vw, 40px);
}
.hero__meta .label { line-height: 1.7; }
.hero__status { display: inline-flex; align-items: center; gap: 9px; color: var(--fg-soft); }
.hero__status i {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 70%, transparent);
  animation: pulse 2.4s ease-out infinite;
}
[data-mode="mc"] .hero__status i { border-radius: 0; }
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 60%, transparent); }
  70%  { box-shadow: 0 0 0 9px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}

.hero__top {
  margin-top: auto;
  display: grid;
  gap: var(--s-4);
  padding-block: clamp(48px, 8vw, 110px) clamp(40px, 7vw, 100px);
}
.hero__spacer { display: none; }
@media (min-width: 1000px) {
  .hero__top { grid-template-columns: 1fr auto 1.05fr; align-items: end; gap: var(--s-5); }
  .hero__spacer { display: block; }
}
.hero__claim { max-width: 46ch; }
.hero__claim .t-md { margin-bottom: var(--s-3); }
.hero__cta { display: flex; flex-wrap: wrap; gap: 12px; }

.hero__word {
  position: relative;
  z-index: 2;
  overflow: hidden;
  padding-bottom: clamp(8px, 1.4vw, 22px);
}
.hero__word .t-hero {
  display: flex;
  justify-content: space-between;
  width: 100%;
}
.hero__word .char { display: inline-block; will-change: transform; }

.hero__ticker {
  position: relative;
  z-index: 2;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

/* ---------- 10. Marquee ---------- */
.marquee { overflow: hidden; display: flex; user-select: none; }
.marquee__track {
  display: flex;
  flex: 0 0 auto;
  min-width: 100%;
  gap: clamp(28px, 4vw, 64px);
  padding: 14px clamp(14px, 2vw, 32px) 14px 0;
  animation: slide 34s linear infinite;
}
.marquee--rev .marquee__track { animation-direction: reverse; }
.marquee--fast .marquee__track { animation-duration: 18s; }
.marquee:hover .marquee__track { animation-play-state: paused; }
.marquee__item {
  display: inline-flex;
  align-items: center;
  gap: clamp(28px, 4vw, 64px);
  flex: 0 0 auto;
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--fg-soft);
  white-space: nowrap;
}
.marquee__item::after { content: "◆"; color: var(--accent); font-size: 7px; }
[data-mode="mc"] .marquee__item::after { content: "■"; }

.marquee--big .marquee__track { padding-block: clamp(10px, 1.6vw, 22px); }
/* NB: no -webkit-text-stroke here — it strokes the glyph's inner contours too,
   which shows up as stray lines inside Unbounded's letterforms. Ghost fill instead. */
.marquee--big .marquee__item {
  font-family: var(--f-display);
  font-weight: 800;
  font-size: clamp(2.2rem, 7vw, 6rem);
  letter-spacing: -.03em;
  color: rgba(var(--ink), .13);
}
.marquee--big .marquee__item:nth-child(even) { color: var(--fg); }
.marquee--big .marquee__item::after { font-size: .3em; color: var(--accent); }

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

/* ---------- 11. Manifesto ---------- */
.manifesto__text {
  font-family: var(--f-display);
  font-weight: 700;
  font-size: clamp(1.35rem, 3.7vw, 3.3rem);
  line-height: 1.16;
  letter-spacing: -.03em;
  text-transform: uppercase;
}
.manifesto__text .word { display: inline-block; color: rgba(var(--ink), .24); transition: color .3s; }
.manifesto__text { line-height: 1.2; }
.manifesto__text .word.is-lit { color: var(--fg); }
.manifesto__text .word--accent.is-lit { color: var(--accent); }

/* ---------- 12. Services ---------- */
.svc { border-top: 1px solid var(--line); }
.svc__row {
  display: block;
  padding: clamp(22px, 2.6vw, 38px) 0;
  border-bottom: 1px solid var(--line);
  position: relative;
  overflow: hidden;
  transition: padding-inline .5s var(--ease);
}
.svc__row::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, color-mix(in srgb, var(--brand) 60%, transparent), transparent 70%);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .6s var(--ease);
  z-index: 0;
}
@media (hover: hover) {
  .svc__row:hover { padding-inline: clamp(12px, 1.6vw, 28px); }
  .svc__row:hover::before { transform: scaleX(1); }
}
.svc__grid {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 10px 24px;
  grid-template-columns: auto 1fr;
  align-items: baseline;
}
@media (min-width: 900px) {
  .svc__grid { grid-template-columns: 64px minmax(220px, 1fr) minmax(0, 1.15fr) 44px; align-items: center; }
}
.svc__num { font-family: var(--f-mono); font-size: 11px; letter-spacing: .1em; color: var(--accent); }
.svc__name {
  font-family: var(--f-display);
  font-weight: 700;
  font-size: clamp(1.25rem, 2.5vw, 2.15rem);
  line-height: 1.2;
  letter-spacing: -.03em;
  text-transform: uppercase;
}
.svc__desc { grid-column: 1 / -1; color: var(--muted); font-size: .92rem; }
@media (min-width: 900px) { .svc__desc { grid-column: auto; } }
.svc__ico { display: none; color: var(--muted); transition: transform .45s var(--ease), color .3s; }
@media (min-width: 900px) { .svc__ico { display: block; justify-self: end; } }
.svc__row:hover .svc__ico { transform: translate(4px, -4px); color: var(--accent); }

/* ---------- 13. Works ---------- */
.works {
  display: grid;
  align-items: start; /* cards keep their own height instead of stretching to the row */
  gap: clamp(16px, 2vw, 28px);
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr));
}
.work {
  /* one value for every inset on the card, so top, sides and bottom match
     and the placeholder caption lines up with the title below it */
  --card-pad: clamp(16px, 2vw, 26px);
  position: relative;
  display: block;
  width: 100%;
  text-align: left;
  font: inherit;
  color: inherit;
  cursor: pointer;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
  box-shadow: var(--shadow);
  transition: border-color .35s var(--ease), transform .5s var(--ease), box-shadow .5s var(--ease);
}
.work:hover, .work:focus-visible {
  border-color: var(--line-str);
  transform: translateY(-4px);
  box-shadow: var(--shadow-lift);
}

/* real images zoom the same way the gradient placeholders do */
.work__media img {
  width: 100%; height: 100%;
  object-fit: cover;
  transform: scale(1.02);
  transition: transform .8s var(--ease);
}
.work:hover .work__media img { transform: scale(1.1); }

/* "open" affordance, injected by JS so it only exists when the lightbox works */
.work__zoom {
  position: absolute;
  top: 14px; right: 14px;
  z-index: 2;
  width: 40px; height: 40px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: rgba(6, 9, 7, .55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  color: var(--fg);
  opacity: 0;
  transform: scale(.8);
  transition: opacity .35s var(--ease), transform .4s var(--ease), background .3s;
}
[data-mode="mc"] .work__zoom { border-radius: 0; }
.work:hover .work__zoom, .work:focus-visible .work__zoom { opacity: 1; transform: none; }
.work:hover .work__zoom { background: var(--accent); color: var(--on-accent); }
.work--wide { grid-column: span 1; }
@media (min-width: 1000px) { .work--wide { grid-column: span 2; } }

.work__media {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--brand);
}
.work--wide .work__media { aspect-ratio: 16 / 9; }
.work__media::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(70% 90% at 25% 20%, color-mix(in srgb, var(--accent) 55%, transparent), transparent 62%),
    linear-gradient(150deg, var(--brand-lit), #05100C 78%);
  transform: scale(1.04);
  transition: transform .8s var(--ease);
}
/* the grid is what actually reads as "zoom" — a soft gradient alone shows nothing,
   so both layers scale together on hover */
.work__media::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.045) 1px, transparent 1px);
  background-size: 26px 26px;
  opacity: .9;
  transform: scale(1);
  transition: transform .8s var(--ease), opacity .5s var(--ease);
}
[data-mode="mc"] .work__media::after { background-size: 18px 18px; }
.work:hover .work__media::before { transform: scale(1.12) rotate(1.5deg); }
.work:hover .work__media::after { transform: scale(1.1); opacity: 1; }
/* vary the placeholder fields so the grid doesn't read as one repeated tile */
.work:nth-child(2n) .work__media::before  { background-position: 80% 70%; filter: hue-rotate(-14deg); }
.work:nth-child(3n) .work__media::before  { background-position: 20% 90%; filter: hue-rotate(12deg) brightness(.9); }
.work:nth-child(4n) .work__media::before  { filter: saturate(.6) brightness(1.1); }

.work__ph {
  position: absolute;
  inset: auto 0 0 0;
  padding: var(--card-pad);
  font-family: var(--f-mono);
  font-size: 10px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, .6);   /* always sits on the dark placeholder tile */
}
.work__body {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: var(--card-pad);
  border-top: 1px solid var(--line);
}
.work__title {
  font-family: var(--f-display);
  font-weight: 700;
  font-size: clamp(1.05rem, 1.6vw, 1.4rem);
  letter-spacing: -.025em;
  text-transform: uppercase;
  line-height: 1.22;
}
.work__tag { font-family: var(--f-mono); font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-top: 8px; display: block; }
.work__year { font-family: var(--f-mono); font-size: 11px; color: var(--accent); flex: 0 0 auto; }

/* ---------- 13b. Lightbox (native <dialog>) ---------- */
.lightbox {
  --card-pad: clamp(18px, 2.4vw, 30px);
  border: 0;
  padding: 0;
  margin: auto;
  width: min(1100px, 92vw);
  max-width: 92vw;
  max-height: 90vh;
  overflow: hidden;
  background: var(--surface);
  color: var(--fg);
  border-radius: var(--radius);
  box-shadow: var(--shadow-pop);
  opacity: 0;
  transform: scale(.96) translateY(12px);
  transition: opacity .3s var(--ease), transform .45s var(--ease);
}
.lightbox.is-open { opacity: 1; transform: none; }
.lightbox::backdrop { background: rgba(3, 6, 5, .9); }

.lightbox__stage { position: relative; background: var(--bg); }
.lightbox__stage .work__media { aspect-ratio: 16 / 9; }

.lightbox__close {
  position: absolute;
  top: 14px; right: 14px;
  z-index: 3;
  width: 44px; height: 44px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: rgba(6, 9, 7, .6);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  color: var(--fg);
  transition: background .3s, color .3s;
}
[data-mode="mc"] .lightbox__close { border-radius: 0; }
.lightbox__close:hover { background: var(--accent); color: var(--on-accent); }

.lightbox__bar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: var(--card-pad);
  border-top: 1px solid var(--line);
}
.lightbox__title {
  font-family: var(--f-display);
  font-weight: 700;
  font-size: clamp(1.05rem, 1.7vw, 1.5rem);
  line-height: 1.22;
  letter-spacing: -.025em;
  text-transform: uppercase;
}
.lightbox__tag {
  display: block;
  margin-top: 8px;
  font-family: var(--f-mono);
  font-size: 10.5px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
}
.lightbox__year { font-family: var(--f-mono); font-size: 11px; color: var(--accent); flex: 0 0 auto; }

/* ---------- 14. Process ---------- */
.steps {
  display: grid;
  gap: clamp(16px, 2vw, 24px);
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr));
}
.step {
  padding: clamp(24px, 2.6vw, 36px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, var(--surface), transparent 90%);
  box-shadow: var(--shadow);
  transition: border-color .35s, transform .5s var(--ease), background .35s, box-shadow .5s var(--ease);
}
.step:hover { border-color: var(--accent); transform: translateY(-6px); box-shadow: var(--shadow-lift); }
.step__num {
  font-family: var(--f-display);
  font-weight: 800;
  font-size: 2.4rem;
  line-height: 1;
  letter-spacing: -.05em;
  color: rgba(var(--ink), .16);
  margin-bottom: 20px;
  transition: color .35s;
}
.step:hover .step__num { color: var(--accent); }
.step__title { font-weight: 700; font-size: 1.05rem; letter-spacing: -.01em; margin-bottom: 8px; }

/* ---------- 15. Stats ---------- */
.stats {
  display: grid;
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr));
}
.stat { background: var(--bg); padding: clamp(24px, 3vw, 44px); }
.stat__val {
  font-family: var(--f-display);
  font-weight: 800;
  font-size: clamp(2.2rem, 4.4vw, 4rem);
  line-height: 1;
  letter-spacing: -.04em;
  color: var(--accent);
  margin-bottom: 10px;
}

/* ---------- 16. Solo / about ---------- */
.solo {
  display: grid;
  gap: clamp(24px, 3vw, 56px);
}
@media (min-width: 900px) {
  .solo { grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); align-items: start; }
}

.solo__ph {
  position: relative;
  aspect-ratio: 4 / 5;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: linear-gradient(165deg, var(--brand-lit), #060B08 82%);
  box-shadow: var(--shadow);
}
.solo__ph::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(55% 45% at 50% 28%, color-mix(in srgb, var(--accent) 34%, transparent), transparent 72%),
    linear-gradient(rgba(255,255,255,.045) 1px, transparent 1px) 0 0 / 100% 26px,
    linear-gradient(90deg, rgba(255,255,255,.045) 1px, transparent 1px) 0 0 / 26px 100%;
  transition: transform .9s var(--ease);
}
.solo__ph:hover::after { transform: scale(1.06); }
/* layer order: radial glow, horizontal lines, vertical lines */
[data-mode="mc"] .solo__ph::after { background-size: auto, 100% 18px, 18px 100%; }

.solo__name {
  font-family: var(--f-display);
  font-weight: 800;
  font-size: clamp(1.7rem, 3.6vw, 3rem);
  line-height: 1.2;
  letter-spacing: -.04em;
  text-transform: uppercase;
  margin: 14px 0 20px;
}

/* chips, not a grid — a short last row can never leave empty cells */
.solo__skills {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: clamp(28px, 3vw, 40px);
}
.solo__skills li {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 16px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--fg-soft);
  box-shadow: var(--shadow-soft);
  transition: border-color .3s, color .3s, box-shadow .3s;
}
.solo__skills li:hover { border-color: var(--accent); color: var(--fg); box-shadow: var(--shadow); }
.solo__skills li::before {
  content: "";
  width: 6px; height: 6px;
  flex: 0 0 6px;
  border-radius: 50%;
  background: var(--accent);
}
[data-mode="mc"] .solo__skills li::before { border-radius: 0; }

/* ---------- 17. Contact ---------- */
.contact__big {
  display: block;
  font-family: var(--f-display);
  font-weight: 800;
  /* sized so the longest string (the e-mail) never wraps mid-word */
  font-size: clamp(1.05rem, 4.2vw, 4rem);
  line-height: 1.05;
  letter-spacing: -.05em;
  text-transform: uppercase;
  overflow-wrap: anywhere;
  transition: color .3s;
}
.contact__big:hover { color: var(--accent); }

.links {
  display: grid;
  gap: 1px;
  background: var(--line);
  border-block: 1px solid var(--line);
  box-shadow: var(--shadow);
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
}
.link-card {
  background: var(--bg);
  padding: clamp(22px, 2.6vw, 34px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 96px;
  transition: background .35s, color .35s;
}
/* --brand is dark in both themes, so the hovered card always goes light-on-dark */
.link-card:hover { background: var(--brand); color: #fff; }
.link-card:hover .link-card__k { color: rgba(255, 255, 255, .72); }
.link-card:hover .link-card__ico { color: #fff; }
.link-card__k { font-family: var(--f-mono); font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; }
.link-card__v { font-weight: 600; font-size: 1.02rem; letter-spacing: -.01em; word-break: break-word; }
.link-card__ico { flex: 0 0 auto; color: var(--accent); transition: transform .45s var(--ease); }
.link-card:hover .link-card__ico { transform: translate(4px, -4px); }

/* ---------- 18. Footer ---------- */
.footer { padding-block: clamp(48px, 6vw, 80px) 32px; border-top: 1px solid var(--line); }
.footer__grid { display: grid; gap: var(--s-4); }
@media (min-width: 900px) { .footer__grid { grid-template-columns: 1.4fr 1fr 1fr; gap: var(--s-5); } }
.footer__col h4 { font-family: var(--f-mono); font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin-bottom: 18px; font-weight: 500; }
.footer__col li + li { margin-top: 10px; }
.footer__col a { color: var(--fg-soft); font-size: .93rem; transition: color .25s; }
.footer__col a:hover { color: var(--accent); }
.footer__bottom {
  margin-top: clamp(40px, 5vw, 72px);
  padding-top: 24px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  gap: 12px 24px;
  justify-content: space-between;
}

/* ---------- 18b. Light-theme corrections ---------- */
/* Anything built as "a dark wash" needs dialling back once the page is white. */
/* On light the glow has to be a LIGHT green tint, not a dark one — that way it can
   be far more present without dropping the luminance under the hero labels. */
:root[data-theme="light"] .hero__bg {
  opacity: 1;
  background:
    radial-gradient(58% 52% at 18% 14%, color-mix(in srgb, var(--brand-lit) 42%, transparent) 0%, transparent 66%),
    radial-gradient(50% 46% at 78% 4%, color-mix(in srgb, var(--brand-lit) 24%, transparent) 0%, transparent 70%),
    radial-gradient(80% 60% at 50% 96%, color-mix(in srgb, var(--brand-lit) 28%, transparent) 0%, transparent 72%);
}
:root[data-theme="light"] .svc__row::before {
  background: linear-gradient(90deg, color-mix(in srgb, var(--brand) 13%, transparent), transparent 72%);
}
.nav.is-stuck { box-shadow: var(--shadow-soft); }

/* ---------- 19. Reveal (JS-gated) ---------- */
.js [data-reveal] { opacity: 0; transform: translateY(38px); }
.js [data-reveal-x] { opacity: 0; transform: translateX(-28px); }

/* ---------- 20. Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
  .js [data-reveal], .js [data-reveal-x] { opacity: 1; transform: none; }
  .marquee__track { animation: none; }
  .manifesto__text .word { color: var(--fg); }
}
