/* ==========================================================================
   Omnia 2.0 — site styles
   Compact, precise and quiet: Inter throughout, warm paper ground,
   hairline structure, one brick-red accent used sparingly.
   ========================================================================== */

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url("../fonts/inter-var.woff2") format("woff2");
}

:root {
  --bg: #f8f7f4;
  --bg-tint: #f2f0ea;
  --surface: #ffffff;
  --ink: #111318;
  --ink-2: #262930;
  --body: #474b53;
  --muted: #6b6f78;
  --faint: #8d9099;
  --soon: #b2b4ba;
  --line: #e7e4dd;
  --line-strong: #d8d4cb;
  --grid: #e9e6de;
  --accent: #b4432d;
  --accent-soft: #f7ebe6;
  --accent-line: #ecd2c8;
  --good: #2f6b45;
  --good-soft: #e8f0ea;

  --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial,
    "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;

  --page: 820px;
  --wide: 1120px;
  --gutter: 24px;

  --radius: 12px;
  --radius-sm: 8px;
  --shadow-sm: 0 1px 2px rgba(17, 19, 24, .04);
  --shadow-md: 0 16px 32px -18px rgba(17, 19, 24, .32);

  color-scheme: light;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--body);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 {
  margin: 0;
  color: var(--ink);
  font-weight: 600;
  line-height: 1.18;
  letter-spacing: -0.022em;
  text-wrap: balance;
}

p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }

a { color: inherit; text-decoration: none; transition: color .18s ease; }
a:hover { color: var(--ink); }

:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; border-radius: 4px; }
::selection { background: #ecd8d1; color: var(--ink); }

code, pre, kbd { font-family: var(--mono); }

.icon {
  width: 15px;
  height: 15px;
  flex: none;
  display: inline-block;
  vertical-align: -2px;
}

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

.skip-link {
  position: absolute;
  left: 12px;
  top: -60px;
  z-index: 100;
  padding: 8px 14px;
  color: #fff;
  background: var(--ink);
  border-radius: 6px;
  font-size: 13px;
}
.skip-link:focus { top: 12px; color: #fff; }

.container {
  width: 100%;
  max-width: calc(var(--page) + 2 * var(--gutter));
  margin: 0 auto;
  padding: 0 var(--gutter);
}
.container-wide {
  width: 100%;
  max-width: calc(var(--wide) + 2 * var(--gutter));
  margin: 0 auto;
  padding: 0 var(--gutter);
}

[id] { scroll-margin-top: 80px; }
@media (max-width: 820px) {
  [id] { scroll-margin-top: 112px; }
}

.kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 10px;
  color: var(--faint);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: .16em;
  text-transform: uppercase;
}
.kicker::before {
  content: "";
  width: 14px;
  height: 1px;
  background: currentColor;
  opacity: .6;
}

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(248, 247, 244, .82);
  -webkit-backdrop-filter: saturate(1.6) blur(14px);
  backdrop-filter: saturate(1.6) blur(14px);
  border-bottom: 1px solid var(--line);
}

.nav { display: flex; align-items: center; gap: 22px; height: 58px; }

.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--ink);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.02em;
  white-space: nowrap;
}
.brand:hover { color: var(--ink); }
.brand-mark { display: block; width: 22px; height: 22px; border-radius: 6px; }

.nav-links {
  display: flex;
  align-items: center;
  gap: 22px;
  margin: 0 0 0 auto;
  padding: 0;
  list-style: none;
}
.nav-links li { position: relative; }
.nav-links a,
.nav-links .soon {
  display: inline-block;
  padding: 4px 0;
  color: var(--muted);
  font-size: 13.5px;
  font-weight: 500;
  white-space: nowrap;
}
.nav-links a:hover,
.nav-links a[aria-current="page"] { color: var(--ink); }
.soon { color: var(--soon); cursor: default; }

.nav-cta {
  padding: 7px 15px;
  color: #fff;
  background: var(--ink);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  transition: background-color .18s ease;
}
.nav-cta:hover { color: #fff; background: #000; }

.nav-gh { display: inline-flex; padding: 6px; margin-left: -8px; color: var(--ink-2); border-radius: 6px; }
.nav-gh .icon { width: 17px; height: 17px; }
.nav-gh:hover { color: var(--accent); }

@media (max-width: 820px) {
  .nav { flex-wrap: wrap; height: auto; padding-top: 10px; gap: 10px 12px; }
  .nav-cta { order: 1; margin-left: auto; }
  .nav-gh { order: 2; margin-left: -4px; }
  .nav-links {
    order: 3;
    width: 100%;
    margin: 0;
    gap: 18px;
    padding: 0 0 9px;
    overflow-x: auto;
    scrollbar-width: none;
  }
  .nav-links::-webkit-scrollbar { display: none; }
}

/* ---------- Buttons ---------- */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  color: var(--ink-2);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  font-family: var(--font);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.2;
  white-space: nowrap;
  cursor: pointer;
  transition: color .18s ease, background-color .18s ease, border-color .18s ease;
}
.pill:hover { color: var(--ink); border-color: #b9b4a9; }
.pill .icon { width: 14px; height: 14px; }

.pill-primary { color: #fff; background: var(--ink); border-color: var(--ink); }
.pill-primary:hover { color: #fff; background: #000; border-color: #000; }
.pill-lg { padding: 9px 18px; }

.pill.is-soon { color: var(--soon); background: transparent; border-style: dashed; cursor: default; }
.pill.is-soon:hover { color: var(--soon); border-color: var(--line-strong); }
.pill:disabled,
.pill[aria-disabled="true"] { opacity: .45; pointer-events: none; }

.soon-tag { font-size: 9.5px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; }

.actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 22px; }

.text-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--ink);
  font-size: 13.5px;
  font-weight: 500;
  white-space: nowrap;
}
.text-link .icon { width: 14px; height: 14px; transition: transform .2s ease; }
.text-link:hover { color: var(--accent); }
.text-link:hover .icon { transform: translateX(3px); }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding: 76px var(--gutter) 52px;
  text-align: center;
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(to right, var(--grid) 1px, transparent 1px),
    linear-gradient(to bottom, var(--grid) 1px, transparent 1px);
  background-size: 40px 40px;
  background-position: center -1px;
  -webkit-mask-image: radial-gradient(ellipse 52% 78% at 50% 30%, #000 25%, transparent 74%);
  mask-image: radial-gradient(ellipse 52% 78% at 50% 30%, #000 25%, transparent 74%);
}

.hero h1 {
  margin-bottom: 16px;
  font-size: clamp(44px, 6.5vw, 70px);
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.045em;
}

.slogan {
  max-width: 620px;
  margin: 0 auto 16px;
  color: var(--ink-2);
  font-size: clamp(18px, 2vw, 22px);
  font-weight: 500;
  line-height: 1.45;
  letter-spacing: -0.015em;
}

.redpen {
  white-space: nowrap;
  text-decoration: underline wavy var(--accent);
  text-decoration-thickness: 1.3px;
  text-underline-offset: 7px;
  text-decoration-skip-ink: none;
}

.hero-copy {
  max-width: 600px;
  margin: 0 auto;
  color: var(--muted);
  font-size: 15.5px;
  line-height: 1.7;
  text-wrap: pretty;
}

.hero-note {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 18px;
  color: var(--faint);
  font-size: 12.5px;
}
.hero-note .icon { width: 12px; height: 12px; }
.hero-note:hover { color: var(--accent); }

/* ---------- Generic sections ---------- */
.section { padding: 52px 0; border-top: 1px solid var(--line); }
.section-tight { padding: 40px 0; }

.section-head { max-width: 640px; margin-bottom: 26px; }
.section-head:last-child { margin-bottom: 0; }
.section-head.center { margin-left: auto; margin-right: auto; text-align: center; }
.section-head h2 { margin-bottom: 10px; font-size: clamp(25px, 2.7vw, 32px); }
.section-head .lead { margin: 0; color: var(--muted); font-size: 15px; line-height: 1.7; text-wrap: pretty; }
.section-head .lead a { color: var(--ink); text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 3px; }
.section-head .lead a:hover { color: var(--accent); }

/* ---------- Showcase ---------- */
.showcase { padding: 46px 0 36px; border-top: 1px solid var(--line); }

.showcase-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
  gap: 16px 48px;
  align-items: start;
  margin-bottom: 20px;
}
.showcase-head h2 { font-size: clamp(25px, 2.7vw, 33px); letter-spacing: -0.03em; }
.showcase-intro p { margin: 0 0 10px; color: var(--muted); font-size: 14px; line-height: 1.7; text-wrap: pretty; }

.marquee {
  position: relative;
  overflow: hidden;
  padding: 6px 0 12px;
  -webkit-mask-image: linear-gradient(to right, transparent, #000 6%, #000 94%, transparent);
  mask-image: linear-gradient(to right, transparent, #000 6%, #000 94%, transparent);
}
.marquee-track {
  display: flex;
  width: max-content;
  animation: marquee 124s linear infinite;
}
.marquee:hover .marquee-track,
.marquee:focus-within .marquee-track { animation-play-state: paused; }
.marquee-set { display: flex; gap: 14px; padding-right: 14px; }

@keyframes marquee {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

.show-card {
  --media-h: clamp(208px, 18.4vw, 264px);
  flex: none;
  display: block;
  width: calc(var(--media-h) * .75);
  color: var(--body);
  transition: transform .35s ease;
}
.show-card--scan { width: calc(var(--media-h) * 1.25); }
.show-card:hover { color: var(--body); transform: translateY(-3px); }

.show-media {
  position: relative;
  display: block;
  height: var(--media-h);
  overflow: hidden;
  background: #f5f2ec;
  border-radius: 7px;
  box-shadow: 0 0 0 1px rgba(17, 19, 24, .07), 0 1px 2px rgba(17, 19, 24, .05);
  transition: box-shadow .35s ease;
}
.show-card:hover .show-media,
.show-card:focus-visible .show-media {
  box-shadow: 0 0 0 1px rgba(17, 19, 24, .13), 0 18px 30px -18px rgba(17, 19, 24, .42);
}
.show-media img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  transition: transform .7s cubic-bezier(.2, .6, .2, 1), opacity .45s ease;
}
.show-card--scan .show-media img { object-position: center; }
.show-card--scan:hover .show-media img { transform: scale(1.045); }

.show-marks { opacity: 0; }
.show-card:hover .show-marks,
.show-card:focus-visible .show-marks,
.show-card.is-revealed .show-marks { opacity: 1; }

.show-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  padding: 3px 7px 2px;
  color: var(--accent);
  background: rgba(255, 255, 255, .95);
  border: 1px solid var(--accent-line);
  border-radius: 4px;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  opacity: 0;
  transform: translateY(-3px);
  transition: opacity .3s ease, transform .3s ease;
  pointer-events: none;
}
.show-card:hover .show-badge,
.show-card:focus-visible .show-badge,
.show-card.is-revealed .show-badge { opacity: 1; transform: none; }

.show-cap {
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 8px 1px 0;
}
.show-domain {
  color: var(--faint);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: .13em;
  text-transform: uppercase;
}
.show-title {
  color: var(--ink);
  font-size: 12.5px;
  font-weight: 500;
  line-height: 1.35;
  letter-spacing: -0.01em;
}

.marquee-hint { margin: 10px 0 0; color: var(--faint); font-size: 11.5px; text-align: center; }
.touch-note { display: none; }

@media (hover: none) {
  .marquee-hint .hover-note { display: none; }
  .marquee-hint .touch-note { display: inline; }
  .marquee-track { animation: none; }
  .marquee {
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-padding-inline: var(--gutter);
    -webkit-mask-image: none;
    mask-image: none;
    padding-left: var(--gutter);
    padding-right: var(--gutter);
    scrollbar-width: none;
  }
  .marquee::-webkit-scrollbar { display: none; }
  .show-card { scroll-snap-align: start; }
}
@media (prefers-reduced-motion: reduce) {
  .marquee-track { animation: none; }
  .marquee { overflow-x: auto; -webkit-mask-image: none; mask-image: none; }
}

@media (max-width: 820px) {
  .showcase-head { grid-template-columns: 1fr; align-items: start; }
}

/* ---------- Lineage (home) ---------- */
.lineage-grid {
  display: grid;
  grid-template-columns: minmax(0, .82fr) minmax(0, 1.18fr);
  gap: 28px 72px;
  align-items: start;
}
.lineage-intro h2 { margin-bottom: 12px; font-size: clamp(25px, 2.7vw, 32px); letter-spacing: -0.03em; }
.lineage-intro .lead { margin: 0 0 18px; color: var(--muted); font-size: 14.5px; line-height: 1.7; text-wrap: pretty; }
.lineage-intro .pill .icon { width: 13px; height: 13px; }

.lineage-track {
  position: relative;
  display: grid;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}
/* the rail runs node to node, ending on the current one */
.lineage-step { position: relative; padding: 0 0 22px 40px; }
.lineage-step:last-child { padding-bottom: 0; }
.lineage-step::after {
  content: "";
  position: absolute;
  left: 5px;
  top: 14px;
  bottom: -29px;
  width: 1px;
  background: var(--ink);
}
.lineage-step:last-child::after { display: none; }
.lineage-step::before {
  content: "";
  position: absolute;
  left: 0;
  top: 9px;
  width: 11px;
  height: 11px;
  background: var(--bg);
  border: 1px solid var(--ink);
  border-radius: 50%;
}
.lineage-step.is-past::before { background: var(--ink); }

.lineage-step.is-current {
  margin: 2px 0 0 24px;
  padding: 18px;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.lineage-step.is-current:last-child { padding-bottom: 18px; }
/* node sits on the rail, level with the card's first line */
.lineage-step.is-current::before {
  left: -24px;
  top: 22px;
  width: 9px;
  height: 9px;
  background: var(--bg);
  border: 0;
  box-shadow: 0 0 0 3px var(--accent) inset;
}

.lineage-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 10px;
  margin: 0 0 6px;
  color: var(--faint);
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: .06em;
}
.lineage-version {
  color: var(--accent);
  font-family: var(--font);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .02em;
  font-variant-numeric: tabular-nums;
}
.lineage-badge {
  padding: 1px 7px;
  color: var(--accent);
  border: 1px solid var(--accent-line);
  border-radius: 999px;
  font-family: var(--font);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .02em;
}
.lineage-step h3 { margin-bottom: 6px; font-size: 16.5px; letter-spacing: -0.018em; }
.lineage-what { margin: 0 0 10px; color: var(--muted); font-size: 13.5px; line-height: 1.65; }
.lineage-bottleneck {
  margin: 0;
  padding-top: 9px;
  color: var(--body);
  border-top: 1px solid var(--line);
  font-size: 13px;
  line-height: 1.6;
}
.lineage-label {
  display: block;
  margin-bottom: 2px;
  color: var(--faint);
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
}
.lineage-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 10px;
  color: var(--ink);
  font-family: var(--mono);
  font-size: 11.5px;
}
.lineage-link .icon { width: 12px; height: 12px; }
.lineage-link:hover { color: var(--accent); }

.nav-prev a {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding-left: 18px;
  border-left: 1px solid var(--line);
  color: var(--faint);
  font-family: var(--mono);
  font-size: 11.5px;
}
.nav-prev a:hover { color: var(--ink); }
.nav-prev .icon { width: 11px; height: 11px; }

@media (max-width: 820px) {
  .lineage-grid { grid-template-columns: 1fr; gap: 24px; }
}
@media (max-width: 560px) {
  .lineage-step.is-current { margin-left: 16px; }
  .lineage-step.is-current::before { left: -16px; }
}

/* ---------- Features (home) ---------- */
.features {
  display: grid;
  grid-template-columns: minmax(0, .95fr) minmax(0, 1.4fr);
  gap: 28px 60px;
  align-items: start;
}
.features h2 { margin-bottom: 20px; font-size: clamp(25px, 2.7vw, 32px); letter-spacing: -0.03em; }

.stats-inline {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0 18px;
  max-width: 400px;
  padding-top: 14px;
  border-top: 1px solid var(--line-strong);
}
.stat-num {
  display: block;
  color: var(--ink);
  font-size: 32px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.045em;
  font-variant-numeric: tabular-nums;
}
.stat-label { display: block; margin-top: 6px; color: var(--muted); font-size: 11.5px; line-height: 1.4; }

.feature-list { display: grid; grid-template-columns: 1fr 1fr; gap: 0 36px; }
.feature { padding: 13px 0 15px; border-top: 1px solid var(--line-strong); }
.feature-num {
  display: block;
  margin-bottom: 6px;
  color: var(--accent);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .06em;
}
.feature h3 { margin-bottom: 4px; font-size: 15px; letter-spacing: -0.015em; }
.feature p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.6; }

@media (max-width: 820px) {
  .features { grid-template-columns: 1fr; gap: 28px; }
}
@media (max-width: 560px) {
  .feature-list { grid-template-columns: 1fr; }
}

/* ---------- Contribute band (home) ---------- */
.cta-band { background: var(--bg-tint); }
.cta-layout {
  display: grid;
  grid-template-columns: minmax(0, .95fr) minmax(0, 1.4fr);
  gap: 24px 60px;
  align-items: start;
}
.cta-intro h2 { margin-bottom: 10px; font-size: clamp(25px, 2.7vw, 32px); letter-spacing: -0.03em; }
.cta-intro p:not(.kicker) { margin: 0; max-width: 390px; color: var(--muted); font-size: 14px; line-height: 1.7; }

.cta-rows { border-top: 1px solid var(--line-strong); }
.cta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 17px 0;
  border-bottom: 1px solid var(--line);
}
.cta-label {
  margin: 0 0 4px;
  color: var(--faint);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
}
.cta-row h3 { margin-bottom: 3px; font-size: 16.5px; letter-spacing: -0.02em; }
.cta-row p:not(.cta-label) { max-width: 430px; margin: 0; color: var(--muted); font-size: 13px; line-height: 1.6; }

@media (max-width: 820px) {
  .cta-layout { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .cta-row { flex-direction: column; align-items: flex-start; gap: 14px; }
}

/* ---------- Generic CTA (subpages) ---------- */
.cta-section { padding: 52px 0; border-top: 1px solid var(--line); background: var(--bg-tint); }
.cta-section .actions { margin-top: 18px; }

/* ---------- Footer ---------- */
.site-footer { padding: 34px 0 22px; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; }
.footer-grid {
  display: grid;
  grid-template-columns: 1.8fr 1fr 1fr;
  gap: 28px;
  max-width: var(--wide);
  margin: 0 auto;
}
.footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--ink);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.02em;
}
.footer-brand:hover { color: var(--ink); }
.site-footer p { max-width: 320px; margin: 8px 0 0; font-size: 12.5px; line-height: 1.6; }
.site-footer h4 {
  margin-bottom: 8px;
  color: var(--ink);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: .13em;
  text-transform: uppercase;
}
.site-footer ul { display: grid; gap: 5px; margin: 0; padding: 0; list-style: none; }
.site-footer ul a { color: var(--muted); }
.site-footer ul a:hover { color: var(--ink); }
.footer-bottom {
  max-width: var(--wide);
  margin: 26px auto 0;
  padding-top: 15px;
  border-top: 1px solid var(--line);
  color: var(--faint);
  font-size: 11.5px;
}

@media (max-width: 760px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-grid > :first-child { grid-column: 1 / -1; }
}

/* ==========================================================================
   Subpages
   ========================================================================== */
.page-hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding: 60px var(--gutter) 40px;
  text-align: center;
}
.page-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(to right, var(--grid) 1px, transparent 1px),
    linear-gradient(to bottom, var(--grid) 1px, transparent 1px);
  background-size: 40px 40px;
  background-position: center -1px;
  -webkit-mask-image: radial-gradient(ellipse 50% 80% at 50% 20%, #000 20%, transparent 72%);
  mask-image: radial-gradient(ellipse 50% 80% at 50% 20%, #000 20%, transparent 72%);
}
.page-hero h1 {
  margin-bottom: 12px;
  font-size: clamp(32px, 4.4vw, 46px);
  line-height: 1.05;
  letter-spacing: -0.04em;
}
.page-hero .lead {
  max-width: 600px;
  margin: 0 auto;
  color: var(--muted);
  font-size: 15.5px;
  line-height: 1.65;
  text-wrap: pretty;
}
.page-hero .actions { margin-top: 20px; }

/* ---------- Domain index ---------- */
.domain-index { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 44px; }
.domain-card {
  display: flex;
  flex-direction: column;
  padding: 16px 16px 14px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease;
}
.domain-card:hover { color: var(--ink); border-color: var(--line-strong); box-shadow: var(--shadow-md); transform: translateY(-2px); }
.domain-card .num { color: var(--accent); font-family: var(--mono); font-size: 10.5px; letter-spacing: .06em; }
.domain-card strong { display: block; margin: 6px 0 3px; font-size: 16px; font-weight: 600; letter-spacing: -0.015em; }
.domain-card .desc { display: block; color: var(--muted); font-size: 13px; line-height: 1.5; }
.domain-card .tools { display: block; margin-top: auto; padding-top: 12px; color: var(--faint); font-family: var(--mono); font-size: 10.5px; }

/* ---------- Domain articles ---------- */
.domain + .domain { margin-top: 48px; }
.domain-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 12px; margin-bottom: 10px; }
.domain-head h3 { font-size: 22px; letter-spacing: -0.025em; }
.domain-head .sub { color: var(--faint); font-size: 14px; }

.meta-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 16px; padding: 0; list-style: none; }
.meta-chips li {
  padding: 2px 8px;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 6px;
  font-family: var(--mono);
  font-size: 10.5px;
}

.setting { color: var(--body); font-size: 14.5px; line-height: 1.75; }
.setting code {
  padding: 1px 5px;
  color: var(--ink-2);
  background: var(--bg-tint);
  border-radius: 4px;
  font-size: .86em;
}

.hard { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 28px; margin: 22px 0; }
.hard > div { padding-top: 12px; border-top: 1px solid var(--line-strong); }
.hard h4 { margin-bottom: 4px; font-size: 14px; letter-spacing: -0.01em; }
.hard p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.6; }

.scoring {
  margin: 0 0 18px;
  padding: 2px 0 2px 14px;
  border-left: 2px solid var(--accent);
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.65;
}
.scoring b { color: var(--ink); font-weight: 600; }

/* ---------- Task list ---------- */
.task-list { border-bottom: 1px solid var(--line); }
.task { border-top: 1px solid var(--line); }
.task summary {
  display: grid;
  grid-template-columns: 62px minmax(0, 1fr) 14px;
  gap: 12px;
  align-items: baseline;
  padding: 12px 2px;
  cursor: pointer;
  list-style: none;
}
.task summary::-webkit-details-marker { display: none; }
.task summary::marker { content: ""; }
.task-id { color: var(--faint); font-family: var(--mono); font-size: 11px; }
.task-title { color: var(--ink); font-size: 14.5px; font-weight: 600; letter-spacing: -0.01em; transition: color .18s ease; }
.task-meta { display: block; margin-top: 1px; color: var(--faint); font-size: 12px; font-weight: 400; letter-spacing: 0; }
.task summary:hover .task-title { color: var(--accent); }
.task-chevron { align-self: center; justify-self: end; width: 13px; height: 13px; color: var(--faint); transition: transform .22s ease; }
.task[open] .task-chevron { transform: rotate(180deg); }
.task-body { padding: 0 2px 16px 76px; color: var(--muted); font-size: 14px; line-height: 1.7; }

@media (max-width: 760px) {
  .domain-index, .hard { grid-template-columns: 1fr; gap: 12px; }
  .hard { gap: 16px; }
  .domain-index { margin-bottom: 40px; }
  .task summary { grid-template-columns: 52px minmax(0, 1fr) 14px; gap: 10px; }
  .task-body { padding-left: 2px; }
}

/* ---------- Evaluation flow ---------- */
.flow { margin: 0; padding: 0; list-style: none; }
.flow li { position: relative; padding: 0 0 22px 44px; }
.flow li::before {
  content: attr(data-step);
  position: absolute;
  left: 0; top: 0;
  display: grid;
  place-items: center;
  width: 26px; height: 26px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  font-family: var(--mono);
  font-size: 11px;
}
.flow li::after {
  content: "";
  position: absolute;
  left: 13px; top: 30px; bottom: 4px;
  width: 1px;
  background: var(--line);
}
.flow li:last-child { padding-bottom: 0; }
.flow li:last-child::after { display: none; }
.flow h3 { margin: 3px 0 4px; font-size: 15px; }
.flow p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.65; }

/* ---------- Placeholder ---------- */
.placeholder {
  position: relative;
  overflow: hidden;
  background: var(--surface);
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
}
.skeleton { width: 100%; border-collapse: collapse; table-layout: fixed; color: var(--faint); font-size: 11px; }
.skeleton th {
  padding: 12px 16px;
  text-align: left;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--line);
}
.skeleton td { padding: 14px 16px; border-bottom: 1px solid var(--line); }
.skeleton tr:last-child td { border-bottom: 0; }
.skeleton th:first-child, .skeleton td:first-child { width: 48px; }
.skeleton th:nth-child(2) { width: 30%; }
.skeleton i { display: block; height: 7px; background: #efece5; border-radius: 4px; }
.placeholder-msg {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  gap: 3px;
  text-align: center;
  background: linear-gradient(rgba(255, 255, 255, .55), rgba(255, 255, 255, .9));
}
.placeholder-msg strong { color: var(--ink); font-size: 18px; font-weight: 600; letter-spacing: -0.02em; }
.placeholder-msg span { color: var(--muted); font-size: 13px; }

/* ==========================================================================
   Contribute page
   ========================================================================== */
.process {
  counter-reset: step;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0 28px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.process li { counter-increment: step; padding-top: 13px; border-top: 1px solid var(--ink); }
.process li::before {
  content: "0" counter(step);
  display: block;
  margin-bottom: 7px;
  color: var(--accent);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .06em;
}
.process h3 { margin-bottom: 4px; font-size: 15px; letter-spacing: -0.015em; }
.process p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.6; }

.why {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 8px 28px;
  margin-top: 30px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}
.why-title {
  margin: 2px 0 0;
  color: var(--faint);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
}
.why-list,
.rule-list { display: grid; gap: 9px; margin: 0; padding: 0; list-style: none; }
.why-list li,
.rule-list li { color: var(--muted); font-size: 13.5px; line-height: 1.6; }
.why-list strong,
.rule-list strong { color: var(--ink); font-weight: 600; }

.guide {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, .92fr);
  gap: 24px 40px;
  align-items: start;
}
.rule-list { gap: 0; border-top: 1px solid var(--line-strong); }
.rule-list li { padding: 11px 0; border-bottom: 1px solid var(--line); }

.format { min-width: 0; margin: 0; }
.format figcaption {
  margin-bottom: 8px;
  color: var(--faint);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
}
.tree {
  margin: 0;
  padding: 14px 16px;
  overflow-x: auto;
  color: var(--ink-2);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.75;
  white-space: pre;
}
.tree .c { color: var(--faint); }
.private {
  padding: 1px 5px;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid var(--accent-line);
  border-radius: 4px;
  font-size: 10px;
}
.format > p { margin: 10px 0 0; color: var(--faint); font-size: 12.5px; line-height: 1.6; }

/* ---------- What counts as a problem ---------- */
.defects { margin: 26px 0 30px; padding-top: 18px; border-top: 1px solid var(--ink); }
.defects-lead { max-width: 780px; margin: 0; color: var(--muted); font-size: 14px; line-height: 1.7; }
.defects-lead strong { color: var(--ink); font-weight: 600; }
.examples-title {
  margin: 22px 0 10px;
  color: var(--faint);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
}
.examples { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.example {
  margin: 0;
  padding: 14px 16px 15px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}
.example-field { margin: 0 0 3px; color: var(--accent); font-family: var(--mono); font-size: 10px; letter-spacing: .08em; text-transform: uppercase; }
.example h3 { margin: 0 0 6px; font-size: 14px; letter-spacing: -0.01em; }
.example dl { margin: 0; }
.example dt { margin: 9px 0 1px; color: var(--faint); font-size: 10.5px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; }
.example dd { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.55; }
@media (max-width: 820px) { .examples { grid-template-columns: minmax(0, 1fr); } }

.aside-note { max-width: 640px; margin: 18px 0 0; color: var(--faint); font-size: 13px; }
.aside-note a { color: var(--ink); text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 3px; }
.aside-note a:hover { color: var(--accent); }

@media (max-width: 820px) {
  .guide { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 680px) {
  .process { grid-template-columns: 1fr; gap: 18px; }
  .why { grid-template-columns: 1fr; }
}
@media (max-width: 420px) {
  .tree { padding: 12px; font-size: 10.5px; }
}

/* ---------- Proposal form ---------- */
.proposal {
  padding: 4px 28px 24px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.form-section { min-width: 0; margin: 0; padding: 22px 0 2px; border: 0; }
.form-section + .form-section { border-top: 1px solid var(--line); }
.form-section > legend {
  float: left;
  width: 100%;
  margin-bottom: 12px;
  padding: 0;
  color: var(--ink);
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.015em;
}
.form-section > legend + * { clear: both; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 18px; }
.proposal ::placeholder { color: #a9abb1; opacity: 1; }
.field-consent { margin: 4px 0 0; padding-top: 14px; border-top: 1px solid var(--line); }

.field { min-width: 0; margin: 0 0 16px; }
.field > label:not(.choice) {
  display: block;
  margin-bottom: 4px;
  color: var(--ink-2);
  font-size: 13px;
  font-weight: 600;
}

.req { margin-left: 2px; color: var(--accent); }
.hint { display: block; margin: 0 0 6px; color: var(--faint); font-size: 12px; line-height: 1.5; }

.proposal input[type="text"],
.proposal input[type="email"],
.proposal select,
.proposal textarea {
  display: block;
  width: 100%;
  padding: 8px 11px;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  font: 400 14px/1.5 var(--font);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.proposal textarea { min-height: 96px; resize: vertical; }
.proposal select {
  -webkit-appearance: none;
  appearance: none;
  padding-right: 34px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236b6f78' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
}
.proposal input:focus,
.proposal select:focus,
.proposal textarea:focus {
  outline: none;
  border-color: var(--ink);
  box-shadow: 0 0 0 3px rgba(17, 19, 24, .07);
}

.choice {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  color: var(--ink-2);
  font-size: 13.5px;
  font-weight: 400;
  line-height: 1.5;
  cursor: pointer;
}
.choice input { flex: none; width: 15px; height: 15px; margin: 2px 0 0; accent-color: var(--ink); cursor: pointer; }
.consent { color: var(--ink); }

.callout {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 10px;
  margin: 0 0 18px;
  padding: 12px 14px;
  color: #5b2419;
  background: var(--accent-soft);
  border: 1px solid var(--accent-line);
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  line-height: 1.6;
}
.callout p { margin: 0; }
.callout .icon { width: 14px; height: 14px; margin-top: 3px; color: var(--accent); }
.callout a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.callout-simple { grid-template-columns: 1fr; }

.field.has-error input[type="text"],
.field.has-error select,
.field.has-error textarea { border-color: var(--accent); }
.field-error { margin: 5px 0 0; color: var(--accent); font-size: 12px; }
.choice + .field-error { margin: -2px 0 4px 24px; }

.form-errors {
  margin: 4px 0 0;
  padding: 10px 14px;
  color: #5b2419;
  background: var(--accent-soft);
  border: 1px solid var(--accent-line);
  border-radius: var(--radius-sm);
  font-size: 13.5px;
}

.draft-note {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  margin: 18px 0 0;
  padding: 7px 10px;
  color: var(--muted);
  background: var(--bg-tint);
  border-radius: var(--radius-sm);
  font-size: 12.5px;
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}
.autosave { margin-left: auto; color: var(--faint); font-size: 12px; }

.preview {
  margin-top: 20px;
  padding: 22px 28px 24px;
  background: var(--surface);
  border: 1px solid var(--ink);
  border-radius: var(--radius);
}
.preview h3 { margin-bottom: 6px; font-size: 18px; }
.preview h3:focus { outline: none; }
.preview > p { color: var(--muted); font-size: 14px; }
.preview .actions { justify-content: flex-start; margin: 14px 0 6px; }
.preview .public-record { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 6px 0 0; }
.public-tag {
  padding: 1px 6px;
  color: var(--good);
  border: 1px solid currentColor;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.public-record code { padding: 2px 7px; color: var(--ink); background: var(--bg-tint); border-radius: 4px; font-family: var(--mono); font-size: 12.5px; }
#closed-note { margin-bottom: 18px; }
.long-note { padding: 9px 12px; color: #5b2419 !important; background: var(--accent-soft); border-radius: var(--radius-sm); }
.action-status { min-height: 1.6em; margin: 0 0 8px; color: var(--good); font-size: 13px; }
.preview.is-stale .md-preview { opacity: .4; }
.preview.is-stale .action-status { color: var(--accent); }

.md-preview {
  max-height: 440px;
  margin: 0;
  padding: 14px 16px;
  overflow: auto;
  color: var(--ink-2);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font-size: 12px;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
  transition: opacity .15s ease;
}

@media (max-width: 760px) {
  .proposal { padding: 2px 18px 20px; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .preview { padding: 20px 18px; }
  .autosave { margin-left: 0; width: 100%; }
}
