:root {
  --paper: #f3eee4;
  --paper-2: #e6dfd2;
  --sheet: #fffdf8;
  --ink: #1a3a4a;
  --mute: #5c6a72;
  --blue: #4a6fa5;
  --blue-2: #2a4568;
  --crimson: #c43c2c;
  --stitch: #c4a35a;
  --ok: #2f6b4a;
  --line: rgba(26, 58, 74, 0.14);
  --sans: "Noto Sans SC", "PingFang SC", sans-serif;
  --serif: "Noto Serif SC", "Songti SC", serif;
  --mono: "IBM Plex Mono", ui-monospace, Menlo, monospace;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
section[id] { scroll-margin-top: 88px; }

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper-2);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.72;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
.app-link { color: var(--crimson); text-decoration: underline; text-underline-offset: 3px; }
button { font-family: inherit; cursor: pointer; }

.grid-overlay {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 4;
  opacity: 0.18;
  background-image:
    url("images/texture.webp"),
    linear-gradient(rgba(42, 69, 104, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(42, 69, 104, 0.08) 1px, transparent 1px);
  background-size: 420px auto, 24px 24px, 24px 24px;
  mix-blend-mode: multiply;
}

.gutter {
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  width: 18px;
  z-index: 8;
  background:
    repeating-linear-gradient(180deg, var(--blue-2) 0 10px, transparent 10px 28px),
    var(--crimson);
}

.skip { position: absolute; left: -999px; }
.skip:focus { left: 28px; top: 12px; z-index: 70; background: var(--sheet); padding: 8px 12px; }

.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 28px 12px 40px;
  background: rgba(243, 238, 228, 0.94);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}

.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; }
.brand small { display: block; font-family: var(--mono); font-weight: 400; font-size: 10px; letter-spacing: 0.16em; color: var(--mute); }
.seal {
  width: 34px; height: 34px;
  display: grid; place-items: center;
  border: 1px solid var(--crimson);
  color: var(--crimson);
  background: var(--sheet);
  font-size: 13px;
}

.nav-toggle { display: none; background: transparent; border: 1px solid var(--ink); padding: 6px 12px; }
.nav-links { display: flex; gap: 14px; font-size: 13px; }
.nav-links a { color: var(--mute); border-bottom: 2px solid transparent; }
.nav-links a.is-active, .nav-links a:hover { color: var(--ink); border-bottom-color: var(--crimson); }
.nav-links a.live { color: #fff; background: var(--ink); border: 0; padding: 6px 12px; }

.hero {
  padding: 8vh 8vw 6vh 8vw;
  max-width: 980px;
}
.kicker, .vlabel {
  font-family: var(--mono);
  letter-spacing: 0.18em;
  font-size: 11px;
  color: var(--crimson);
  margin: 0 0 12px;
}
h1, h2, h3 { font-family: var(--serif); font-weight: 700; line-height: 1.12; margin: 0 0 14px; }
h1 { font-size: clamp(34px, 5.4vw, 64px); }
h2 { font-size: clamp(24px, 3.2vw, 38px); }
h3 { font-size: 20px; }
.lead, .lede { color: var(--mute); max-width: 46em; }

.meta-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0; }
.chip { border: 1px solid var(--line); padding: 4px 10px; font-size: 12px; font-family: var(--mono); background: var(--sheet); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 28px; }
.btn { display: inline-flex; align-items: center; justify-content: center; padding: 10px 18px; border: 1px solid currentColor; font-size: 14px; }
.btn-fill { background: var(--crimson); color: #fff; border-color: var(--crimson); }
.btn-ghost { background: var(--sheet); }

.hero-fig { margin: 0; border: 1px solid var(--line); background: var(--sheet); }
.hero-fig img { width: 100%; height: auto; max-height: 420px; object-fit: cover; }
.hero-fig figcaption { padding: 10px 14px; font-size: 13px; color: var(--mute); }

.wrap { width: min(1100px, calc(100% - 64px)); margin: 0 auto; padding: 72px 0; }

.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.card {
  background: var(--sheet);
  border: 1px solid var(--line);
  border-left: 3px solid var(--blue);
  padding: 20px;
}
.stamp { font-family: var(--mono); font-size: 11px; color: var(--crimson); letter-spacing: 0.12em; }

.row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
  align-items: center;
  width: min(1100px, calc(100% - 64px));
  margin: 0 auto 40px;
}
.row.flip { direction: rtl; }
.row.flip > * { direction: ltr; }
.row img { width: 100%; height: 240px; object-fit: cover; border: 1px solid var(--line); }
.idx { font-family: var(--mono); color: var(--blue-2); font-size: 12px; letter-spacing: 0.12em; }

.reqs { display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0 10px; }
.req {
  background: var(--sheet);
  border: 1px solid var(--line);
  padding: 8px 12px;
  font-size: 13px;
}
.req.is-on { border-color: var(--crimson); color: var(--crimson); outline: 1px solid var(--crimson); }
.hint { font-family: var(--mono); font-size: 13px; color: var(--blue-2); }

.kpi { padding-left: 18px; }
.kpi li { margin-bottom: 6px; }
.rules { padding-left: 20px; }
.rules li { margin-bottom: 10px; }

.role-table { display: grid; gap: 0; border: 1px solid var(--line); background: var(--sheet); }
.role-table > div { display: grid; grid-template-columns: 1.2fr 1fr 1fr 1.2fr; gap: 8px; padding: 10px 14px; border-top: 1px solid var(--line); font-size: 14px; }
.role-head { font-family: var(--mono); font-size: 12px; color: var(--mute); border-top: 0 !important; background: rgba(74, 111, 165, 0.08); }

footer { border-top: 1px solid var(--line); background: var(--sheet); }
.footer-inner { display: flex; justify-content: space-between; gap: 16px; align-items: center; padding: 28px 0 48px; }
.brand-foot { font-family: var(--serif); font-weight: 700; margin: 0 0 6px; }

@media (max-width: 900px) {
  .gutter { display: none; }
  .nav { padding: 12px 16px; flex-wrap: wrap; }
  .nav-toggle { display: inline-flex; margin-left: auto; background: var(--sheet); position: relative; z-index: 60; }
  .nav-links { display: none; flex-direction: column; width: 100%; padding: 8px 0 12px; }
  .nav-links.open { display: flex; }
  .hero { padding: 40px 20px 32px; }
  .wrap, .row, .row.flip, .grid-3, .grid-2, .role-table > div, .footer-inner {
    width: min(1100px, calc(100% - 28px));
    grid-template-columns: 1fr;
    direction: ltr;
  }
  .wrap { padding: 52px 0; }
}
