@import url('https://fonts.bunny.net/css?family=space-grotesk:300,400,500,600&display=swap');

/* Primary display font — Departure Mono (monospaced pixel font by Helena Zhang,
   the typeface used on kaisermann.me). Single master mapped across all weights
   so the pixel glyphs never get faux-bolded. */
@font-face {
  font-family: 'Departure Mono';
  src: url('https://cdn.jsdelivr.net/gh/projectnoonnu/2409-1@1.0/DepartureMono-Regular.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

/* ============================================================
   Outliers at Play — minimal pixel design system
   White paper · black inverted bands · pixel display + mono body
   ============================================================ */

:root {
  /* paper palette */
  --paper:    #ffffff;
  --ink:      #141414;
  --ink-soft: #5e5e5e;
  --faint:    #9a9a9a;
  --line:     #e6e6e6;
  --line-mid: #d6d6d6;

  /* inverted (black band) palette */
  --night:      #0b0b0b;
  --night-ink:  #f2f2f2;
  --night-soft: #9d9d9d;
  --night-faint:#6c6c6c;
  --night-line: #262626;

  /* type */
  --pixel: 'Departure Mono', ui-monospace, 'SF Mono', Menlo, monospace;
  --mono:  'Space Grotesk', system-ui, -apple-system, sans-serif;

  /* legacy aliases (keep old embedded rules rendering in the light system) */
  --bg:        var(--paper);
  --bg-2:      #fafafa;
  --surface:   #f4f4f4;
  --surface-2: #efefef;
  --line-soft: var(--line);
  --text:      var(--ink);
  --muted:     var(--ink-soft);
  --accent:    var(--ink);
  --accent-ink:var(--paper);
  --font-display: var(--pixel);
  --font-body:    var(--mono);
  --radius:    0px;
  --radius-lg: 0px;

  --maxw: 1080px;
  --pad: clamp(20px, 5vw, 56px);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.72;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  /* clip (not hidden) so we don't kill position:sticky for descendants */
  overflow-x: clip;
}

::selection { background: var(--ink); color: var(--paper); }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }

/* ---------- layout ---------- */
.wrap { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: var(--pad); }
section { position: relative; }
section[id] { scroll-margin-top: 80px; }

/* ---------- type ---------- */
.eyebrow {
  display: inline-flex; align-items: center; gap: 9px;
  font-family: var(--mono); font-weight: 500;
  font-size: 11px; letter-spacing: 0.04em; text-transform: uppercase;
  color: var(--faint);
}
.eyebrow::before { content: ""; width: 6px; height: 6px; background: var(--ink); display: inline-block; }

h1, h2, h3, h4 { font-family: var(--pixel); font-weight: 600; line-height: 1.06; letter-spacing: 0.005em; }

.display { font-family: var(--pixel); font-weight: 600; font-size: clamp(30px, 5vw, 56px); line-height: 1.04; letter-spacing: 0.005em; }
.h2 { font-size: clamp(22px, 3vw, 34px); line-height: 1.08; }
.h3 { font-size: clamp(17px, 2vw, 23px); line-height: 1.12; }
.lead { font-family: var(--mono); font-size: clamp(13px, 1.4vw, 15px); color: var(--ink-soft); line-height: 1.7; font-weight: 400; }

.accent { color: var(--ink); }
.serify { font-style: normal; }

/* ---------- text-only links (no boxes, no color) ---------- */
.btn,
.link {
  display: inline-flex; align-items: center; gap: 8px; white-space: nowrap;
  font-family: var(--mono); font-size: 11px; font-weight: 500;
  letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--ink-soft);
  text-decoration: underline; text-underline-offset: 4px;
  text-decoration-thickness: 1px; text-decoration-color: var(--line-mid);
  padding: 0; border-radius: 0; background: none; border: none;
  transition: color .25s var(--ease), text-decoration-color .25s var(--ease);
}
.btn .arrow, .link .arrow { transition: transform .3s var(--ease); }
.btn:hover, .link:hover { color: var(--ink); text-decoration-color: var(--ink); }
.btn:hover .arrow, .link:hover .arrow { transform: translate(2px, -2px); }
.btn-primary { color: var(--ink); }
.btn-ghost { color: var(--ink-soft); }

/* on dark bands */
.band-dark .btn, .band-dark .link { color: var(--night-soft); text-decoration-color: var(--night-line); }
.band-dark .btn:hover, .band-dark .link:hover { color: var(--night-ink); text-decoration-color: var(--night-ink); }
.band-dark .btn-primary { color: var(--night-ink); }

/* ---------- nav ---------- */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 60;
  background: color-mix(in srgb, var(--paper) 86%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  transition: border-color .3s;
}
.nav-inner { display: flex; align-items: center; justify-content: space-between; height: 60px; }
.brand { display: inline-flex; align-items: center; gap: 9px; font-family: var(--mono); font-weight: 600; font-size: 15px; letter-spacing: 0.02em; color: var(--ink); text-transform: uppercase; white-space: nowrap; }
.brand .brand-arr { flex: none; width: 14px; height: 14px; }
.nav-links { display: flex; align-items: center; gap: 26px; margin-left: auto; }
.nav-links a {
  font-family: var(--mono); font-size: 11px; font-weight: 500;
  letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink); white-space: nowrap;
  padding: 0; border-radius: 0;
  text-decoration: none;
  transition: opacity .2s;
}
.nav-links a:not(.active):hover { opacity: 0.55; }
.nav-links a.active {
  text-decoration: underline; text-underline-offset: 5px;
  text-decoration-thickness: 1px; text-decoration-color: var(--ink);
}
.nav-cta { display: flex; align-items: center; gap: 18px; }
.nav-toggle { display: none; width: 38px; height: 38px; border: 1px solid var(--line-mid); border-radius: 0; align-items: center; justify-content: center; flex-direction: column; gap: 4px; }
.nav-toggle span { width: 16px; height: 2px; background: var(--ink); border-radius: 0; display: block; transition: transform .3s, opacity .3s; }

.mobile-menu {
  position: fixed; inset: 0; z-index: 55; background: var(--paper);
  display: flex; flex-direction: column; justify-content: center; gap: 12px; padding: var(--pad);
  transform: translateY(-100%); opacity: 0; pointer-events: none;
  transition: transform .5s var(--ease), opacity .4s;
}
.mobile-menu.open { transform: translateY(0); opacity: 1; pointer-events: auto; }
.mobile-menu a { font-family: var(--mono); font-weight: 600; font-size: clamp(26px, 9vw, 44px); letter-spacing: 0.01em; padding: 4px 0; color: var(--faint); transition: color .25s; }
.mobile-menu a:hover, .mobile-menu a.active { color: var(--ink); }
.mobile-menu .mm-foot { margin-top: 28px; display: flex; gap: 18px; }
.mobile-menu .mm-foot a { font-family: var(--mono); font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--faint); }

/* ---------- reveal ---------- */
/* NOTE: never transition opacity — this webview freezes CSS transitions, which
   would leave content stuck at opacity 0. app.js sets inline opacity:1 instantly. */
.reveal { opacity: 0; transform: translateY(8px); transition: transform .7s var(--ease); }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; transition: none; } }

/* ---------- placeholder media ---------- */
.ph {
  position: relative; overflow: hidden; border-radius: 0;
  background: repeating-linear-gradient(135deg, #f0f0f0 0 9px, #f7f7f7 9px 18px);
  border: 1px solid var(--line);
  display: grid; place-items: center;
}
.ph::after {
  content: attr(data-label);
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--faint);
  background: var(--paper); padding: 5px 11px; border: 1px solid var(--line);
}
.ph[data-label=""]::after { display: none; }
.ph.circle { border-radius: 50%; }
.ph.dark, .band-dark .ph, .cs-cover .ph {
  background: repeating-linear-gradient(135deg, #131313 0 9px, #181818 9px 18px);
  border-color: var(--night-line);
}
.ph.dark::after, .band-dark .ph::after, .cs-cover .ph::after { color: var(--night-faint); background: var(--night); border-color: var(--night-line); }

/* ---------- inverted band ---------- */
.band-dark { background: var(--night); color: var(--night-ink); }
.band-dark .eyebrow { color: var(--night-faint); }
.band-dark .eyebrow::before { background: var(--night-ink); }
.band-dark h1, .band-dark h2, .band-dark h3, .band-dark h4 { color: var(--night-ink); }

/* ---------- section common ---------- */
.section-head { display: flex; flex-direction: column; gap: 16px; }
.divider { height: 1px; background: var(--line); width: 100%; }

/* ---------- CTA (black band) ---------- */
.cta { background: var(--night); color: var(--night-ink); padding-block: clamp(64px, 10vw, 130px); }
.cta-card { border: none; border-radius: 0; padding: 0; text-align: center; background: none; }
.cta-card .eyebrow { color: var(--night-faint); }
.cta-card .eyebrow::before { background: var(--night-ink); }
.cta-card h2 { max-width: 22ch; margin-inline: auto; color: var(--night-ink); }
.cta-mail {
  display: inline-block; margin-top: 26px; font-family: var(--mono);
  font-size: clamp(14px, 1.8vw, 18px); font-weight: 500; letter-spacing: 0.02em;
  color: var(--night-ink);
  text-decoration: underline; text-underline-offset: 5px; text-decoration-thickness: 1px;
  text-decoration-color: var(--night-line); transition: text-decoration-color .3s;
}
.cta-mail:hover { text-decoration-color: var(--night-ink); }

/* ---------- footer (black band) ---------- */
.footer { background: var(--night); color: var(--night-soft); padding-top: clamp(56px, 9vw, 110px); padding-bottom: 40px; margin-top: clamp(70px, 11vw, 150px); }
.footer .brand { color: var(--night-ink); }
.footer .brand .dot { background: var(--night-ink); }
.foot-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: clamp(30px,5vw,60px); }
.foot-brand p { color: var(--night-soft); max-width: 32ch; margin-top: 16px; font-size: 12px; line-height: 1.65; }
.foot-col h4 { font-family: var(--mono); font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--night-faint); font-weight: 500; margin-bottom: 16px; }
.foot-col a, .foot-col p { display: block; color: var(--night-soft); margin-bottom: 10px; font-size: 12px; transition: color .25s; }
.foot-col a { text-underline-offset: 3px; }
.foot-col a:hover { color: var(--night-ink); text-decoration: underline; }
.foot-bottom { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: clamp(46px,8vw,84px); padding-top: 24px; border-top: 1px solid var(--night-line); color: var(--night-faint); font-family: var(--mono); font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; flex-wrap: wrap; }
.foot-socials { display: flex; gap: 18px; }
.foot-socials a { width: auto; height: auto; border: none; border-radius: 0; display: inline; font-family: var(--mono); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--night-soft); transition: color .25s; }
.foot-socials a:hover { background: none; color: var(--night-ink); text-decoration: underline; text-underline-offset: 3px; }

/* ============================================================
   CASE STUDY
   ============================================================ */
.cs-hero { padding-top: clamp(104px, 15vw, 150px); padding-bottom: clamp(34px, 5vw, 56px); }
.cs-back { display: inline-block; margin-bottom: clamp(30px, 5vw, 54px); white-space: nowrap; }
.cs-kicker { display: flex; align-items: center; gap: 0; flex-wrap: wrap; }
.cs-kicker > span:first-child, .cs-kicker .step { font-family: var(--mono); font-weight: 500; font-size: 11px; letter-spacing: 0.03em; text-transform: uppercase; color: var(--faint); white-space: nowrap; }
.cs-kicker .fund { font-family: var(--mono); font-size: 11px; font-weight: 500; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink); white-space: nowrap; padding: 0; background: none; border-radius: 0; margin-left: 20px; }
.cs-kicker .fund::before { content: "—"; color: var(--line-mid); margin-right: 14px; }
.cs-hero h1 { font-family: var(--pixel); font-weight: 600; font-size: clamp(28px, 4.6vw, 50px); line-height: 1.04; letter-spacing: 0.005em; margin: 22px 0 18px; }
.cs-hero .tagline { font-family: var(--mono); font-size: 14px; line-height: 1.65; color: var(--ink-soft); max-width: 52ch; }

.cs-meta { display: grid; grid-template-columns: repeat(4, 1fr); gap: clamp(16px, 2.4vw, 30px); margin-top: clamp(34px, 5vw, 56px); padding-top: clamp(22px, 3vw, 30px); border-top: 1px solid var(--line); }
.cs-meta .k { font-family: var(--mono); font-weight: 500; font-size: 10px; letter-spacing: 0.03em; text-transform: uppercase; color: var(--faint); margin-bottom: 9px; }
.cs-meta .v { font-family: var(--mono); font-size: 12px; color: var(--ink); }

.cs-cover { background: var(--night); padding-block: clamp(40px, 6vw, 80px); }
.cs-cover .ph { aspect-ratio: 16 / 8; }

.cs-body { padding-block: clamp(10px, 2vw, 24px); }
.cs-block { display: grid; grid-template-columns: 0.5fr 1.5fr; gap: clamp(22px, 5vw, 64px); padding-block: clamp(30px, 4.5vw, 56px); border-top: 1px solid var(--line); align-items: start; }
.cs-block .lbl { font-family: var(--mono); font-weight: 600; font-size: clamp(15px, 1.6vw, 18px); line-height: 1.3; color: var(--ink); }
.cs-block .lbl .n { display: block; font-family: var(--mono); font-size: 11px; font-weight: 500; letter-spacing: 0.14em; color: var(--faint); margin-bottom: 12px; }
.cs-rich p { color: var(--ink-soft); font-size: 13px; line-height: 1.75; max-width: 64ch; margin-bottom: 16px; }
.cs-rich p:last-child { margin-bottom: 0; }
.cs-rich .big { font-family: var(--mono); font-weight: 500; color: var(--ink); font-size: clamp(15px, 1.8vw, 18px); line-height: 1.5; letter-spacing: -0.01em; max-width: 30ch; margin-bottom: 0; }
.cs-rich strong { color: var(--ink); font-weight: 600; }
.cs-list { list-style: none; display: flex; flex-direction: column; gap: 14px; }
.cs-list li { display: grid; grid-template-columns: 18px 1fr; gap: 12px; color: var(--ink-soft); font-size: 13px; line-height: 1.6; }
.cs-list li::before { content: "—"; color: var(--ink); }

.cs-gallery { padding-block: clamp(14px, 2.5vw, 26px); display: grid; gap: clamp(14px, 2vw, 20px); }
.cs-gallery.two { grid-template-columns: 1fr 1fr; }
.cs-gallery .ph { aspect-ratio: 4/3; }
.cs-gallery.full .ph { aspect-ratio: 16/7; }
.cs-gallery.full { padding-block: clamp(34px, 5vw, 64px); }

.cs-quote { padding-block: clamp(44px, 7vw, 90px); }
.cs-quote blockquote { font-family: var(--mono); font-weight: 500; font-size: clamp(16px, 2.2vw, 24px); letter-spacing: -0.01em; line-height: 1.45; max-width: 30ch; color: var(--ink); }
.cs-quote .who { display: flex; align-items: center; gap: 14px; margin-top: clamp(24px,3vw,38px); }
.cs-quote .who .av { width: 44px; height: 44px; flex: none; }
.cs-quote .who .nm { font-family: var(--mono); font-weight: 500; font-size: 13px; color: var(--ink); }
.cs-quote .who .rl { font-family: var(--mono); color: var(--faint); font-size: 11px; letter-spacing: 0.04em; }

.cs-results { background: var(--night); color: var(--night-ink); padding-block: clamp(54px, 8vw, 96px); margin-top: 0; }
.cs-results .eyebrow { color: var(--night-faint); }
.cs-results .eyebrow::before { background: var(--night-ink); }
.cs-results .rg { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(26px, 4vw, 48px); margin-top: clamp(28px, 4vw, 44px); }
.cs-results .rc { border-top: 1px solid var(--night-line); padding-top: 20px; }
.cs-results .rc .n { font-family: var(--pixel); font-weight: 600; font-size: clamp(26px, 3.4vw, 40px); line-height: 1; color: var(--night-ink); letter-spacing: 0.01em; }
.cs-results .rc .n .accent { color: var(--night-ink); }
.cs-results .rc .l { font-family: var(--mono); color: var(--night-soft); font-size: 12px; line-height: 1.6; margin-top: 16px; max-width: 24ch; }

.cs-next { border-top: 1px solid var(--line); }
.cs-next a { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding-block: clamp(40px, 6vw, 74px); }
.cs-next .k { font-family: var(--mono); font-weight: 500; font-size: 10px; letter-spacing: 0.03em; text-transform: uppercase; color: var(--faint); margin-bottom: 16px; }
.cs-next .t { font-family: var(--mono); font-weight: 600; font-size: clamp(24px, 4vw, 42px); line-height: 1; color: var(--ink); letter-spacing: 0.01em; transition: opacity .25s; }
.cs-next .arrow { font-family: var(--mono); font-size: clamp(22px, 3vw, 34px); color: var(--ink-soft); transition: transform .4s var(--ease); }
.cs-next a:hover .t { opacity: 0.55; }
.cs-next a:hover .arrow { transform: translateX(10px); }

/* case-study footer reset (simple one-line variant) */
.footer .foot-bottom:only-child,
.cs-footer .foot-bottom { margin-top: 0; padding-top: 0; border-top: none; }

@media (max-width: 860px) {
  .cs-meta { grid-template-columns: 1fr 1fr; gap: 22px; }
  .cs-block { grid-template-columns: 1fr; gap: 14px; }
  .cs-results .rg { grid-template-columns: 1fr; gap: 0; }
  .cs-results .rc { padding-block: 22px; }
}
@media (max-width: 560px) { .cs-gallery.two { grid-template-columns: 1fr; } }

/* ---------- responsive nav ---------- */
@media (max-width: 880px) {
  .nav-links, .nav-cta .btn { display: none; }
  .nav-toggle { display: flex; }
  .foot-grid { grid-template-columns: 1fr 1fr; }
  .foot-brand { grid-column: 1 / -1; }
}

/* ---------- tweaks panel ---------- */
.tweaks {
  position: fixed; right: 20px; bottom: 20px; z-index: 200; width: 260px;
  background: var(--paper);
  border: 1px solid var(--ink); border-radius: 0;
  padding: 16px; box-shadow: 6px 6px 0 rgba(0,0,0,.12);
  display: none; font-family: var(--mono);
}
.tweaks.open { display: block; }
.tweaks-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.tweaks-head .ttl { font-family: var(--mono); font-weight: 600; font-size: 14px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--ink); }
.tweaks-close { width: 26px; height: 26px; border-radius: 0; border: 1px solid var(--line-mid); display: grid; place-items: center; color: var(--ink-soft); font-size: 13px; }
.tweaks-close:hover { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.tw-group { margin-bottom: 14px; }
.tw-group:last-child { margin-bottom: 0; }
.tw-label { font-family: var(--mono); font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--faint); font-weight: 500; margin-bottom: 9px; }
.tw-seg { display: flex; flex-direction: column; gap: 0; border: 1px solid var(--line); }
.tw-seg button { text-align: left; padding: 10px 12px; font-family: var(--mono); font-size: 12px; font-weight: 500; color: var(--ink-soft); border-bottom: 1px solid var(--line); transition: background .2s, color .2s; }
.tw-seg button:last-child { border-bottom: none; }
.tw-seg button.on { background: var(--ink); color: var(--paper); }
.tw-seg button .px { font-family: var(--pixel); }
