/* ==========================================================================
   Northstar — code editor site template
   All values and content are placeholders. Rebrand by editing the tokens.
   ========================================================================== */

:root {
  color-scheme: dark;

  --bg: #0b0e13;
  --bg-alt: #0e1218;
  --surface: #131922;
  --surface-2: #19212c;
  --line: rgba(255, 255, 255, 0.10);
  --line-strong: rgba(255, 255, 255, 0.18);
  --ink: #eef2f7;
  --ink-2: #b6c0ce;
  --ink-3: #8591a1;
  --accent: #5aa9ff;
  --accent-2: #7ee0c0;
  --warm: #f4b860;
  --violet: #d98bff;
  --danger: #ff7b72;
  --on-accent: #06111f;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 24px 60px rgba(0, 0, 0, 0.35);
  --shadow-soft: 0 1px 2px rgba(0, 0, 0, 0.22), 0 12px 32px rgba(0, 0, 0, 0.28);
  --radius: 16px;
  --radius-sm: 10px;
  --nav-h: 68px;
  --wrap: 1200px;
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Inter, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}

html[data-theme="light"] {
  color-scheme: light;
  --bg: #f2f4f7;
  --bg-alt: #e9ecf1;
  --surface: #ffffff;
  --surface-2: #f4f6f9;
  --line: rgba(14, 22, 34, 0.12);
  --line-strong: rgba(14, 22, 34, 0.22);
  --ink: #10161f;
  --ink-2: #44505f;
  --ink-3: #66717f;
  --accent: #0b63c5;
  --accent-2: #0a7f68;
  --warm: #a96400;
  --violet: #7c3aed;
  --danger: #c22a24;
  --on-accent: #ffffff;
  --shadow: 0 1px 2px rgba(14, 22, 34, 0.08), 0 24px 60px rgba(14, 22, 34, 0.12);
  --shadow-soft: 0 1px 2px rgba(14, 22, 34, 0.06), 0 12px 32px rgba(14, 22, 34, 0.10);
}

/* --------------------------------------------------------------------------
   Base
   -------------------------------------------------------------------------- */

*,
*::before,
*::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-h) + 24px);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

body.nav-open { overflow: hidden; }

h1, h2, h3, h4, p, ul, ol, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
img { max-width: 100%; height: auto; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--ink); }
button { font: inherit; color: inherit; }
svg { display: block; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
kbd {
  font-family: var(--mono);
  font-size: 0.8em;
  padding: 2px 5px;
  border: 1px solid var(--line-strong);
  border-bottom-width: 2px;
  border-radius: 5px;
  background: var(--surface-2);
  color: var(--ink-2);
}
::selection { background: color-mix(in srgb, var(--accent) 35%, transparent); color: var(--ink); }

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

/* --------------------------------------------------------------------------
   Utilities
   -------------------------------------------------------------------------- */

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: clamp(20px, 4vw, 40px);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 200;
  padding: 10px 16px;
  border-radius: 8px;
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 650;
  transform: translateY(-160%);
  transition: transform 0.18s ease;
}
.skip-link:focus { transform: translateY(0); color: var(--on-accent); }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
}
.eyebrow::before {
  content: "";
  width: 18px;
  height: 1px;
  background: currentColor;
  opacity: 0.7;
}

.lede {
  margin-top: 18px;
  max-width: 46ch;
  font-size: clamp(17px, 1.5vw, 20px);
  line-height: 1.6;
  color: var(--ink-2);
}

/* --------------------------------------------------------------------------
   Buttons and links
   -------------------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 44px;
  padding: 0 20px;
  border: 1px solid transparent;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 620;
  letter-spacing: -0.005em;
  color: var(--ink);
  background: transparent;
  cursor: pointer;
  transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease, transform 0.18s ease;
  white-space: nowrap;
}
.btn svg { width: 18px; height: 18px; }
.btn:active { transform: translateY(1px); }

.btn--primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--on-accent);
}
.btn--primary:hover {
  background: color-mix(in srgb, var(--accent) 85%, #ffffff);
  border-color: transparent;
  color: var(--on-accent);
}

.btn--ghost {
  border-color: var(--line-strong);
  background: color-mix(in srgb, var(--surface) 55%, transparent);
  color: var(--ink);
}
.btn--ghost:hover {
  border-color: var(--accent);
  background: var(--surface);
  color: var(--ink);
}

.btn--sm { min-height: 38px; padding: 0 15px; font-size: 14px; border-radius: 9px; }
.btn--sm svg { width: 16px; height: 16px; }
.btn--lg { min-height: 50px; padding: 0 24px; font-size: 16px; }

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  color: var(--ink-2);
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}
.icon-btn:hover { background: var(--surface); color: var(--ink); border-color: var(--line); }
.icon-btn svg { width: 19px; height: 19px; }

.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-top: 24px;
  font-size: 15px;
  font-weight: 600;
  color: var(--accent);
}
.link-arrow svg { width: 17px; height: 17px; transition: transform 0.18s ease; }
.link-arrow:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 4px; }
.link-arrow:hover svg { transform: translateX(3px); }

/* --------------------------------------------------------------------------
   Announcement
   -------------------------------------------------------------------------- */

.announce {
  position: relative;
  z-index: 70;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--accent) 10%, var(--bg));
  font-size: 13.5px;
  color: var(--ink-2);
}
.announce__inner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  min-height: 42px;
  padding-block: 6px;
}
.announce p { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: center; text-align: center; }
.announce a { color: var(--ink); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.announce a:hover { color: var(--accent); }
.announce__dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent-2);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent-2) 18%, transparent);
}
.announce__close {
  position: absolute;
  right: clamp(14px, 3vw, 28px);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--ink-3);
  cursor: pointer;
}
.announce__close:hover { background: var(--surface); color: var(--ink); }
.announce__close svg { width: 15px; height: 15px; }
.announce.is-hidden { display: none; }

/* --------------------------------------------------------------------------
   Header and navigation
   -------------------------------------------------------------------------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 60;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
}

.nav {
  display: flex;
  align-items: center;
  gap: 26px;
  height: var(--nav-h);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex: none;
  color: var(--ink);
  font-size: 17px;
  font-weight: 680;
  letter-spacing: -0.02em;
}
.brand:hover { color: var(--ink); }
.brand img { border-radius: 8px; }

.nav__links {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-left: 6px;
}
.nav__links > a,
.menu__trigger {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 38px;
  padding: 0 12px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--ink-2);
  font-size: 14.5px;
  font-weight: 520;
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease;
}
.nav__links > a:hover,
.menu__trigger:hover,
.menu.is-open .menu__trigger {
  background: var(--surface);
  color: var(--ink);
}
.menu__trigger .chev { width: 13px; height: 13px; transition: transform 0.18s ease; }
.menu.is-open .menu__trigger .chev { transform: rotate(180deg); }

.nav__actions {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
}
.nav__download { margin-left: 6px; }
.nav__burger { display: none; }
.nav__drawer-head { display: none; }
.nav__links > .nav__drawer-download { display: none; }

/* Dropdown menus */

.menu { position: relative; }

.menu__panel {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  z-index: 80;
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
  min-width: 310px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--shadow);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: opacity 0.16s ease, transform 0.16s ease, visibility 0.16s;
}
.menu__panel::before {
  content: "";
  position: absolute;
  top: -16px;
  left: 0;
  right: 0;
  height: 16px;
}
.menu__panel--wide { grid-template-columns: 1fr 1fr; min-width: 540px; }

.menu.is-open .menu__panel,
.menu:hover .menu__panel,
.menu:focus-within .menu__panel {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.menu__label {
  margin: 0 0 8px;
  padding: 0 10px;
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.menu__group a {
  display: block;
  padding: 9px 10px;
  border-radius: 9px;
  color: var(--ink);
  transition: background 0.16s ease;
}
.menu__group a:hover { background: var(--surface-2); color: var(--ink); }
.menu__group a strong {
  display: block;
  font-size: 14px;
  font-weight: 620;
  letter-spacing: -0.01em;
}
.menu__group a span {
  display: block;
  margin-top: 2px;
  font-size: 12.5px;
  color: var(--ink-3);
}

/* --------------------------------------------------------------------------
   Hero
   -------------------------------------------------------------------------- */

.hero {
  position: relative;
  padding: clamp(56px, 8vw, 104px) 0 clamp(48px, 6vw, 80px);
  overflow: clip;
}
.hero__glow {
  position: absolute;
  inset: -30% -10% auto auto;
  width: 760px;
  height: 760px;
  border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--accent) 26%, transparent), transparent 68%);
  filter: blur(20px);
  opacity: 0.55;
  pointer-events: none;
}
.hero__grid-bg {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to right, var(--line) 1px, transparent 1px),
    linear-gradient(to bottom, var(--line) 1px, transparent 1px);
  background-size: 72px 72px;
  opacity: 0.35;
  mask-image: radial-gradient(ellipse 80% 62% at 50% 0%, #000 25%, transparent 72%);
  pointer-events: none;
}
.hero__inner { position: relative; }

.hero h1 {
  font-size: clamp(54px, 9.2vw, 118px);
  line-height: 0.94;
  font-weight: 700;
  letter-spacing: -0.055em;
  background: linear-gradient(180deg, var(--ink) 20%, color-mix(in srgb, var(--ink) 62%, var(--bg)) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero__lede {
  margin-top: clamp(20px, 3vw, 30px);
  max-width: 21em;
  font-size: clamp(24px, 3.4vw, 38px);
  line-height: 1.35;
  letter-spacing: -0.02em;
  color: var(--ink);
  text-wrap: balance;
}
.kw {
  display: inline-block;
  padding: 0 0.2em;
  border-radius: 0.24em;
  color: var(--accent);
  font-weight: 680;
  background: color-mix(in srgb, var(--accent) 13%, transparent);
  box-shadow: inset 0 -1px 0 color-mix(in srgb, var(--accent) 40%, transparent);
  transition: background 0.18s ease, color 0.18s ease;
}
.kw:hover { background: color-mix(in srgb, var(--accent) 24%, transparent); color: var(--ink); }
.kw--alt { color: var(--accent-2); background: color-mix(in srgb, var(--accent-2) 13%, transparent); box-shadow: inset 0 -1px 0 color-mix(in srgb, var(--accent-2) 40%, transparent); }
.kw--alt:hover { background: color-mix(in srgb, var(--accent-2) 24%, transparent); }

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: clamp(28px, 4vw, 40px);
}

.hero__figure {
  position: relative;
  margin-top: clamp(44px, 6vw, 72px);
}
.hero__figure .shot {
  position: relative;
  z-index: 1;
  box-shadow: var(--shadow);
}
.hero__float {
  position: absolute;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 12px 15px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(10px);
  font-size: 12.5px;
  line-height: 1.35;
}
.hero__float strong { display: block; font-size: 13.5px; font-weight: 640; color: var(--ink); }
.hero__float span:last-child { color: var(--ink-3); }
.hero__float--a { left: -18px; bottom: 44px; }
.hero__float--b { right: 26px; top: -22px; }
.dot { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.dot--green { background: var(--accent-2); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent-2) 18%, transparent); }
.dot--blue { background: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 18%, transparent); }

.logo-strip {
  display: flex;
  align-items: center;
  gap: clamp(20px, 4vw, 48px);
  margin-top: clamp(48px, 7vw, 88px);
  padding-top: 26px;
  border-top: 1px solid var(--line);
}
.logo-strip p {
  flex: none;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.logo-strip ul {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: clamp(20px, 4vw, 46px);
}
.logo-strip li {
  font-size: clamp(16px, 1.7vw, 20px);
  font-weight: 640;
  letter-spacing: -0.02em;
  color: var(--ink-3);
  opacity: 0.75;
}

/* --------------------------------------------------------------------------
   Sections and spreads
   -------------------------------------------------------------------------- */

.section {
  position: relative;
  padding: clamp(64px, 9vw, 118px) 0;
}
.section--alt {
  background: var(--bg-alt);
  border-block: 1px solid var(--line);
}

.section__head { max-width: 760px; }
.section__head h2,
.spread h2,
.chapter h3,
.open h2,
.cta h2 {
  font-size: clamp(32px, 4.2vw, 56px);
  line-height: 1.04;
  font-weight: 680;
  letter-spacing: -0.04em;
  text-wrap: balance;
}
.section__head--split {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 32px;
  max-width: none;
  margin-bottom: clamp(36px, 5vw, 56px);
}
.section__head--split .lede { margin-top: 0; max-width: 40ch; }
.section__head--split .link-arrow { margin-top: 0; flex: none; }

.spread {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  align-items: center;
  gap: clamp(32px, 6vw, 76px);
}
.spread--reverse .spread__copy { order: 2; }
.spread--reverse .spread__media { order: 1; }
.spread__copy .lede { max-width: 34ch; }

.checklist {
  display: grid;
  gap: 12px;
  margin-top: 26px;
  font-size: 15.5px;
  color: var(--ink-2);
}
.checklist li {
  display: grid;
  grid-template-columns: 20px 1fr;
  gap: 10px;
  align-items: start;
}
.checklist li::before {
  content: "";
  width: 7px;
  height: 7px;
  margin-top: 8px;
  border-radius: 2px;
  background: var(--accent);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 12%, transparent);
}

/* Screenshot frames */

.shot {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}
.shot img { display: block; width: 100%; height: auto; }
.shot__badge {
  position: absolute;
  right: 12px;
  bottom: 12px;
  padding: 5px 10px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  color: var(--ink-3);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  backdrop-filter: blur(8px);
}
.spread__media .shot { transform: perspective(1400px) rotateY(-1.4deg); }
.spread--reverse .spread__media .shot { transform: perspective(1400px) rotateY(1.4deg); }

/* Cards */

.cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin-top: clamp(34px, 5vw, 52px);
}
.card {
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  transition: transform 0.2s ease, border-color 0.2s ease;
}
.card:hover { transform: translateY(-3px); border-color: var(--line-strong); }
.card__kicker {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--accent);
}
.card h3 { margin-top: 18px; font-size: 20px; font-weight: 650; letter-spacing: -0.02em; }
.card p:last-child { margin-top: 8px; font-size: 15px; color: var(--ink-2); }

/* --------------------------------------------------------------------------
   Workflow tabs
   -------------------------------------------------------------------------- */

.workflow {
  margin-top: clamp(20px, 3vw, 32px);
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) + 4px);
  background: var(--surface);
  overflow: hidden;
}
.tablist {
  display: flex;
  gap: 4px;
  padding: 12px;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface-2) 60%, transparent);
}
.tab {
  padding: 9px 16px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--ink-3);
  font-size: 14px;
  font-weight: 560;
  cursor: pointer;
  transition: background 0.16s ease, color 0.16s ease, border-color 0.16s ease;
}
.tab:hover { color: var(--ink); background: var(--surface); }
.tab[aria-selected="true"] {
  color: var(--ink);
  background: var(--surface);
  border-color: var(--line-strong);
  box-shadow: var(--shadow-soft);
}

.tabpanel {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  align-items: center;
  gap: clamp(28px, 5vw, 56px);
  padding: clamp(24px, 4vw, 44px);
}
.tabpanel[hidden] { display: none; }
.tabpanel__copy h3 { font-size: clamp(22px, 2.4vw, 30px); font-weight: 660; letter-spacing: -0.03em; }
.tabpanel__copy p { margin-top: 12px; font-size: 15.5px; color: var(--ink-2); }
.facts { display: grid; gap: 10px; margin-top: 24px; }
.facts li {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  font-size: 13.5px;
}
.facts span { color: var(--ink-3); }
.facts strong { font-weight: 580; color: var(--ink); text-align: right; }
.tabpanel .shot { box-shadow: none; }

/* --------------------------------------------------------------------------
   Component wall
   -------------------------------------------------------------------------- */

.wall {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  grid-auto-rows: 66px;
  gap: 14px;
  margin-top: clamp(34px, 5vw, 52px);
}
.tile {
  position: relative;
  grid-column: span 3;
  grid-row: span 4;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  cursor: zoom-in;
  transition: border-color 0.2s ease, transform 0.2s ease;
}
.tile--w6 { grid-column: span 6; }
.tile--w3 { grid-column: span 3; }
.tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.45s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.tile::after {
  content: "";
  position: absolute;
  inset: 40% 0 0;
  background: linear-gradient(to bottom, transparent, rgba(4, 8, 14, 0.82));
  pointer-events: none;
}
.tile__caption {
  position: absolute;
  left: 16px;
  bottom: 14px;
  z-index: 1;
  font-size: 13px;
  font-weight: 580;
  color: #eef2f7;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
}
.tile:hover,
.tile:focus-visible { border-color: var(--accent); transform: translateY(-3px); }
.tile:hover img,
.tile:focus-visible img { transform: scale(1.035); }

/* --------------------------------------------------------------------------
   Chapters
   -------------------------------------------------------------------------- */

.chapter {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  align-items: center;
  gap: clamp(28px, 6vw, 72px);
  margin-top: clamp(44px, 6vw, 72px);
  padding-top: clamp(44px, 6vw, 72px);
  border-top: 1px solid var(--line);
}
.chapter:first-of-type { margin-top: clamp(8px, 2vw, 16px); border-top: 0; padding-top: 0; }
.chapter--reverse .chapter__copy { order: 2; }
.chapter--reverse .shot { order: 1; }
.chapter__copy p { margin-top: 14px; max-width: 38ch; font-size: 16px; color: var(--ink-2); }
.chapter h3 { font-size: clamp(26px, 3vw, 38px); }
.chapter .link-arrow { margin-top: 20px; }

/* --------------------------------------------------------------------------
   Open source / timeline
   -------------------------------------------------------------------------- */

.open {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
  gap: clamp(36px, 6vw, 80px);
  align-items: start;
}
.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin: 32px 0 34px;
  padding: 24px 0;
  border-block: 1px solid var(--line);
}
.stats strong {
  display: block;
  font-size: clamp(22px, 2.6vw, 30px);
  font-weight: 680;
  letter-spacing: -0.03em;
}
.stats span { font-size: 12.5px; color: var(--ink-3); }

.timeline { position: relative; padding-left: 4px; }
.timeline ol { position: relative; display: grid; gap: 4px; }
.timeline ol::before {
  content: "";
  position: absolute;
  left: 21px;
  top: 18px;
  bottom: 18px;
  width: 1px;
  background: linear-gradient(to bottom, var(--line-strong), var(--line));
}
.timeline li {
  position: relative;
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 14px;
  align-items: center;
  padding: 12px 14px 12px 0;
  border-radius: 12px;
  transition: background 0.18s ease;
}
.timeline li:hover { background: color-mix(in srgb, var(--surface) 70%, transparent); }
.timeline__avatar {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: var(--surface-2);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-2);
}
.timeline__avatar--you {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 16%, var(--surface));
  color: var(--accent);
}
.timeline p { font-size: 13.5px; color: var(--ink-3); }
.timeline p strong { color: var(--ink); font-weight: 600; }
.timeline li > div > p:last-child { margin-top: 1px; color: var(--ink-2); font-size: 14px; }
.timeline__time { color: var(--ink-3); font-weight: 400; }
.timeline__you > div > p:last-child { color: var(--accent); }

/* --------------------------------------------------------------------------
   Blog
   -------------------------------------------------------------------------- */

.posts {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(20px, 3vw, 30px);
}
.post__media {
  display: block;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
}
.post__media img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; transition: transform 0.4s ease; }
.post__media:hover img { transform: scale(1.03); }
.post__meta {
  margin-top: 14px;
  font-size: 12.5px;
  color: var(--ink-3);
  letter-spacing: 0.01em;
}
.post h3 {
  margin-top: 7px;
  font-size: 19px;
  line-height: 1.32;
  font-weight: 620;
  letter-spacing: -0.02em;
}
.post h3 a { color: var(--ink); }
.post h3 a:hover { color: var(--accent); }
.post__excerpt { margin-top: 9px; font-size: 14.5px; color: var(--ink-2); }

.post--featured {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  align-items: center;
  gap: clamp(24px, 4vw, 44px);
  padding-bottom: clamp(24px, 4vw, 36px);
  border-bottom: 1px solid var(--line);
}
.post--featured .post__media { grid-row: 1 / span 4; margin: 0; }
.post--featured h3 { font-size: clamp(22px, 2.4vw, 30px); max-width: 18em; }
.post--featured .post__excerpt { max-width: 46ch; }
.post--featured .post__meta { margin-top: 0; }

/* --------------------------------------------------------------------------
   Download CTA
   -------------------------------------------------------------------------- */

.cta {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 28px 64px;
  padding: clamp(32px, 5vw, 56px);
  border: 1px solid var(--line-strong);
  border-radius: calc(var(--radius) + 6px);
  background:
    radial-gradient(ellipse 60% 120% at 100% 0%, color-mix(in srgb, var(--accent) 20%, transparent), transparent 60%),
    radial-gradient(ellipse 50% 100% at 0% 100%, color-mix(in srgb, var(--accent-2) 12%, transparent), transparent 60%),
    var(--surface);
  overflow: hidden;
}
.cta__copy h2 { font-size: clamp(34px, 4.4vw, 58px); }
.cta__copy .lede { max-width: 34ch; }
.cta__actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 10px; }
.cta__actions .link-arrow { margin: 0 0 0 8px; }
.cta__note {
  grid-column: 1 / -1;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  font-size: 12.5px;
  color: var(--ink-3);
}

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */

.footer {
  padding: clamp(48px, 7vw, 80px) 0 32px;
  border-top: 1px solid var(--line);
  background: var(--bg-alt);
}
.footer__top {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1.6fr);
  gap: clamp(36px, 6vw, 80px);
}
.footer__brand p {
  margin-top: 16px;
  max-width: 34ch;
  font-size: 14px;
  color: var(--ink-3);
}
.footer__social { display: flex; flex-wrap: wrap; gap: 18px; margin-top: 20px; }
.footer__social a { font-size: 13px; font-weight: 560; color: var(--ink-2); }
.footer__social a:hover { color: var(--accent); }

.footer__cols {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}
.footer__cols h2 {
  margin-bottom: 14px;
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink);
}
.footer__cols ul { display: grid; gap: 9px; }
.footer__cols a { font-size: 14px; color: var(--ink-3); }
.footer__cols a:hover { color: var(--ink); }

.footer__bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: clamp(36px, 5vw, 56px);
  padding-top: 24px;
  border-top: 1px solid var(--line);
  font-size: 12.5px;
  color: var(--ink-3);
}
.footer__bottom-actions { display: flex; align-items: center; gap: 18px; }
.footer__disclaimer {
  padding: 4px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* --------------------------------------------------------------------------
   Theme toggle
   -------------------------------------------------------------------------- */

.theme-toggle .icon-moon { display: none; }
html[data-theme="light"] .theme-toggle .icon-sun { display: none; }
html[data-theme="light"] .theme-toggle .icon-moon { display: block; }

.theme-toggle--footer {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 34px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: transparent;
  color: var(--ink-2);
  font-size: 12.5px;
  cursor: pointer;
}
.theme-toggle--footer:hover { background: var(--surface); color: var(--ink); }
.theme-toggle--footer svg { width: 16px; height: 16px; }

/* --------------------------------------------------------------------------
   Dialogs
   -------------------------------------------------------------------------- */

dialog {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
}
dialog::backdrop {
  background: rgba(4, 7, 12, 0.62);
  backdrop-filter: blur(6px);
}

.search-dialog { width: min(680px, calc(100vw - 32px)); margin: 12vh auto auto; }
.search-dialog__box {
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: var(--shadow);
}
.search-dialog__head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 14px 14px 18px;
  border-bottom: 1px solid var(--line);
}
.search-dialog__head > svg { width: 20px; height: 20px; flex: none; color: var(--ink-3); }
.search-dialog__head input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 16px;
  outline: none;
}
.search-dialog__head input::placeholder { color: var(--ink-3); }
.search-dialog__head input::-webkit-search-cancel-button { -webkit-appearance: none; }
.search-results { max-height: min(52vh, 420px); overflow-y: auto; padding: 8px; }
.search-results a {
  display: block;
  padding: 11px 13px;
  border-radius: 9px;
  color: var(--ink);
}
.search-results a:hover,
.search-results a.is-active { background: var(--surface-2); color: var(--ink); }
.search-results strong { display: block; font-size: 14px; font-weight: 620; }
.search-results span { display: block; margin-top: 2px; font-size: 12.5px; color: var(--ink-3); }
.search-results .is-empty { padding: 20px 13px; font-size: 14px; color: var(--ink-3); }
.search-hint {
  padding: 11px 18px;
  border-top: 1px solid var(--line);
  font-size: 12px;
  color: var(--ink-3);
  background: color-mix(in srgb, var(--surface-2) 50%, transparent);
}

.lightbox { width: min(1080px, calc(100vw - 32px)); margin: auto; }
.lightbox__box {
  position: relative;
  padding: 14px;
  border: 1px solid var(--line-strong);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: var(--shadow);
}
.lightbox__box img {
  display: block;
  width: 100%;
  max-height: 76vh;
  object-fit: contain;
  border-radius: 10px;
  background: var(--bg);
}
.lightbox__box p { margin-top: 10px; padding: 0 4px 2px; font-size: 13px; color: var(--ink-2); }
.lightbox__close {
  position: absolute;
  top: -14px;
  right: -14px;
  z-index: 1;
  border-color: var(--line-strong);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

/* --------------------------------------------------------------------------
   Reveal on scroll
   -------------------------------------------------------------------------- */

html.js [data-reveal] {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.6s ease, transform 0.6s cubic-bezier(0.2, 0.7, 0.2, 1);
  will-change: opacity, transform;
}
html.js [data-reveal].is-in {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  html.js [data-reveal] { opacity: 1; transform: none; transition: none; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */

@media (max-width: 1080px) {
  .nav { gap: 14px; }
  .nav__links > a, .menu__trigger { padding: 0 9px; font-size: 14px; }
  .hero__float--a { left: 8px; }
}

@media (max-width: 940px) {
  /* A backdrop-filter on the header would make fixed children size to the
     header instead of the viewport, so keep the mobile header opaque. */
  .site-header {
    background: var(--bg);
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }

  .nav__links {
    position: fixed;
    inset: 0 0 0 auto;
    z-index: 65;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    width: min(360px, 88vw);
    height: 100vh;
    height: 100dvh;
    margin: 0;
    padding: 14px 20px 32px;
    overflow-y: auto;
    border-left: 1px solid var(--line);
    background: var(--bg);
    box-shadow: -24px 0 60px rgba(0, 0, 0, 0.35);
    visibility: hidden;
    transform: translateX(102%);
    transition: transform 0.24s cubic-bezier(0.2, 0.7, 0.2, 1), visibility 0s linear 0.24s;
  }
  body.nav-open::after {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 75;
    background: rgba(4, 7, 12, 0.5);
    backdrop-filter: blur(2px);
  }
  body.nav-open .site-header { z-index: 80; }
  body.nav-open .nav__links {
    visibility: visible;
    transform: translateX(0);
    transition: transform 0.24s cubic-bezier(0.2, 0.7, 0.2, 1), visibility 0s;
  }

  .nav__drawer-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
    padding: 0 2px 12px;
    border-bottom: 1px solid var(--line);
    font-size: 12px;
    font-weight: 650;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--ink-3);
  }

  .nav__links > a,
  .menu__trigger {
    height: 44px;
    padding: 0 12px;
    font-size: 16px;
  }
  .menu { position: static; }
  .menu__panel {
    position: static;
    display: none;
    min-width: 0;
    padding: 6px 0 10px 12px;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    opacity: 1;
    visibility: visible;
    transform: none;
  }
  .menu__panel--wide { grid-template-columns: 1fr; }
  .menu.is-open .menu__panel { display: grid; }
  .menu:hover .menu__panel:not(.is-open) { display: none; }
  .menu__group a { background: var(--surface); margin-bottom: 6px; }

  .nav__burger { display: inline-flex; }

  .nav__links > .nav__drawer-download {
    display: inline-flex;
    width: 100%;
    height: 46px;
    margin-top: 14px;
    padding: 0 20px;
    border-color: var(--accent);
    background: var(--accent);
    color: var(--on-accent);
    font-size: 15px;
  }
  .nav__links > .nav__drawer-download:hover {
    background: color-mix(in srgb, var(--accent) 85%, #ffffff);
    color: var(--on-accent);
  }

  .hero__float { display: none; }
  .spread,
  .chapter,
  .open,
  .tabpanel { grid-template-columns: 1fr; }
  .spread--reverse .spread__copy,
  .chapter--reverse .chapter__copy { order: 0; }
  .spread--reverse .spread__media,
  .chapter--reverse .shot { order: 0; }
  .spread__media .shot,
  .spread--reverse .spread__media .shot { transform: none; }
  .chapter--reverse .chapter__copy { order: 0; }
  .section__head--split { align-items: flex-start; flex-direction: column; gap: 18px; }
  .section__head--split .lede { margin-top: 0; }

  .wall { grid-auto-rows: 74px; }
  .tile, .tile--w6, .tile--w3 { grid-column: span 6; }

  .post--featured { grid-template-columns: 1fr; }
  .post--featured .post__media { grid-row: auto; }
  .posts { grid-template-columns: repeat(2, 1fr); }
  .post:last-child { grid-column: auto; }

  .cta { grid-template-columns: 1fr; align-items: start; }
  .cta__actions { justify-content: flex-start; }
  .footer__top { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .announce { font-size: 12.5px; }
  .announce__inner { padding-right: 42px; padding-left: 42px; }
  .announce__dot { display: none; }

  .nav__download { display: none; }

  .hero { padding-top: 44px; }
  .hero h1 { font-size: clamp(48px, 15vw, 76px); }
  .hero__lede { font-size: clamp(22px, 6.2vw, 30px); }
  .hero__actions .btn { flex: 1 1 auto; }

  .logo-strip { flex-direction: column; align-items: flex-start; gap: 16px; }
  .logo-strip ul { gap: 22px; }

  .cards { grid-template-columns: 1fr; }
  .workflow { border-radius: var(--radius); }
  .tablist { overflow-x: auto; }
  .tab { flex: none; }
  .tabpanel { padding: 20px; }

  .wall { display: flex; flex-direction: column; }
  .tile { aspect-ratio: 16 / 10; }
  .tile img { height: 100%; }

  .stats { grid-template-columns: 1fr 1fr; }
  .stats li:last-child { grid-column: 1 / -1; }

  .posts { grid-template-columns: 1fr; }
  .post--featured { gap: 18px; }
  .post--featured .post__meta { margin-top: 14px; }

  .footer__cols { grid-template-columns: repeat(2, 1fr); gap: 28px 20px; }
  .footer__bottom { flex-direction: column; align-items: flex-start; }
  .footer__bottom-actions { flex-wrap: wrap; }

  .search-dialog { margin-top: 8vh; }
  .lightbox__close { top: 8px; right: 8px; }
}

@media (max-width: 440px) {
  .announce__inner { justify-content: flex-start; text-align: left; }
  .announce p { justify-content: flex-start; }
  .hero__actions { flex-direction: column; align-items: stretch; }
  .hero__actions .btn { width: 100%; }
  .cta__actions { flex-direction: column; align-items: stretch; }
  .cta__actions .btn { width: 100%; }
  .cta__actions .link-arrow { margin: 6px 0 0; }
}

/* --------------------------------------------------------------------------
   Print
   -------------------------------------------------------------------------- */

@media print {
  .announce, .site-header, .hero__glow, .hero__grid-bg, .hero__float,
  .theme-toggle, .search-dialog, .lightbox, .footer__social { display: none !important; }
  body { background: #fff; color: #000; }
  .section, .hero, .footer { padding-block: 24px; }
  html.js [data-reveal] { opacity: 1; transform: none; }
}
