/* Carevo Academy — V1 design system
   Concept: workshop archive. Paper, ink, brass, technical records.
   No frameworks, no external assets except self-hosted fonts. */

@font-face {
  font-family: "Noto Sans SC";
  src: url("fonts/noto-sans-sc-subset.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: "Noto Serif SC";
  src: url("fonts/noto-serif-sc-700-subset.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
}

:root {
  /* official semantic tokens — exact names from the brand standard */
  --color-brand: #C0392B;
  --color-brand-hover: #9E2F23;
  --color-ink: #12263A;
  --color-surface: #FAF1E8;
  --color-surface-elevated: #FDF8F3;
  --color-text: #1C2430;
  --color-text-muted: #5F5E5A;
  --color-border: #E6DCCF;
  --color-success: #2F6B4F;
  --color-warning: #8A5A00;
  --color-danger: #8F2018;
  --color-gold: #E0A32E;
  /* aliases used by page components */
  --surface: var(--color-surface);
  --paper: var(--color-surface);
  --paper-2: #F1E6D7;
  --surface-2: #F1E6D7;
  --white: var(--color-surface-elevated);
  --ink: var(--color-ink);
  --ink-soft: var(--color-text);
  --text: var(--color-text);
  --muted: var(--color-text-muted);
  --line: var(--color-border);
  --line-strong: #CDBDA9;
  --border-strong: #CDBDA9;
  --on-dark: #C8C4BC;
  --on-dark-muted: #A9A39A;
  --placeholder: #6B6F72;
  --input-border: #8C8375;
  --brand: var(--color-brand);
  --brand-hover: var(--color-brand-hover);
  --brand-wash: #F7E4DF;
  --success: var(--color-success);
  --success-wash: #E4EEE8;
  --gold: var(--color-gold);
  --gold-ink: var(--color-warning);
  --gold-wash: #FBF0D8;
  --danger: var(--color-danger);
  --danger-wash: #F7E3E1;
  --alert-warning-border: #E8CF9D;
  --alert-danger-border: #E3B8B3;
  --demo-border: #D9BD84;
  --warning: var(--color-warning);
  --warning-wash: #FBF0D8;
  /* legacy aliases kept so page CSS stays readable */
  --sans: "Noto Sans SC", "Inter", "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", sans-serif;
  --serif: "Noto Serif SC", "Songti SC", "SimSun", serif;
  --mono: "IBM Plex Mono", "SFMono-Regular", "Cascadia Mono", Consolas, "Liberation Mono", monospace;
  --wrap: 1180px;
  --shadow: 0 18px 50px rgba(18, 38, 58, 0.09);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.75;
  color: var(--ink-soft);
  background-color: var(--paper);
  background-image:
    radial-gradient(rgba(20, 24, 27, 0.035) 0.6px, transparent 0.6px);
  background-size: 7px 7px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img, svg { max-width: 100%; display: block; }
a { color: var(--brand); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--brand-hover); }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }

::selection { background: var(--brand); color: var(--white); }

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

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 28px; }
.narrow { max-width: 820px; }
.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; left: 16px; top: -80px; z-index: 200;
  background: var(--ink); color: var(--paper); padding: 10px 16px;
  font-size: 14px; text-decoration: none; transition: top 0.15s ease;
}
.skip-link:focus { top: 16px; color: var(--paper); }

/* ---------- type ---------- */

h1, h2, h3, h4 {
  font-family: var(--sans);
  font-weight: 800;
  color: var(--ink);
  letter-spacing: -0.015em;
}
h1 { font-size: clamp(38px, 5.2vw, 68px); line-height: 1.14; }
h2 { font-size: clamp(28px, 3.4vw, 42px); line-height: 1.24; }
h3 { font-size: 21px; line-height: 1.4; }
h4 { font-size: 17px; line-height: 1.5; }
p { max-width: 68ch; }
strong { color: var(--ink); font-weight: 700; }

.mono {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}
.eyebrow {
  display: flex; align-items: center; gap: 12px;
  font-family: var(--mono); font-size: 11px; font-weight: 500;
  letter-spacing: 0.18em; text-transform: uppercase; color: var(--brand);
  margin-bottom: 20px;
}
.eyebrow::before {
  content: ""; width: 28px; height: 1px; background: var(--brand); flex: none;
}
.lede { font-size: 18px; line-height: 1.8; color: var(--ink-soft); }
.small { font-size: 13px; color: var(--muted); }
.dim { color: var(--muted); }

/* ---------- status bar + header ---------- */

.statusbar {
  background: var(--ink); color: var(--on-dark);
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.1em;
}
.statusbar .wrap {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; min-height: 34px; padding-top: 6px; padding-bottom: 6px;
}
.statusbar .left { display: flex; align-items: center; gap: 10px; }
.status-dot {
  width: 6px; height: 6px; border-radius: 50%; background: var(--success);
  box-shadow: 0 0 0 3px rgba(47, 107, 79, 0.22); flex: none;
}
.statusbar .right { color: var(--on-dark-muted); }

.site-header {
  position: sticky; top: 0; z-index: 60;
  background: rgba(244, 241, 233, 0.94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(10px);
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 24px; min-height: 86px;
}
.brand { display: flex; align-items: center; gap: 9px; text-decoration: none; color: var(--ink); }
.brand-mark { width: 34px; height: 34px; flex: none; border-radius: 2px; }
.brand-word {
  font-family: var(--sans); font-size: 22px; font-weight: 700;
  letter-spacing: -0.01em; line-height: 1; color: var(--ink);
}
.brand-academy {
  font-family: var(--sans); font-size: 13px; font-weight: 500;
  color: var(--muted); line-height: 1; padding-left: 4px;
}
.site-footer .brand-mark { width: 38px; height: 38px; }
.site-footer .brand-word { font-size: 24px; }
.site-footer .brand-academy { font-size: 14px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-name { font-family: var(--serif); font-size: 20px; font-weight: 700; letter-spacing: 0.04em; }
.brand-sub { font-family: var(--mono); font-size: 9px; letter-spacing: 0.2em; color: var(--muted); margin-top: 4px; }

.nav { display: flex; align-items: center; gap: 2px; }
.nav a {
  display: inline-block; padding: 9px 13px; font-size: 14px;
  color: var(--ink-soft); text-decoration: none; border-radius: 3px;
}
.nav a:hover { background: var(--paper-2); color: var(--ink); }
.nav a[aria-current="page"] { color: var(--brand); font-weight: 700; }
.header-actions { display: flex; align-items: center; gap: 10px; }
.menu-toggle {
  display: none; width: 44px; height: 44px; border: 1px solid var(--line-strong);
  background: transparent; border-radius: 3px; position: relative;
}
.menu-toggle span, .menu-toggle span::before, .menu-toggle span::after {
  position: absolute; left: 11px; width: 18px; height: 1.5px; background: var(--ink);
  content: ""; transition: transform 0.18s ease, opacity 0.18s ease;
}
.menu-toggle span { top: 20px; }
.menu-toggle span::before { top: -6px; }
.menu-toggle span::after { top: 6px; }
.menu-toggle[aria-expanded="true"] span { background: transparent; }
.menu-toggle[aria-expanded="true"] span::before { transform: translateY(6px) rotate(45deg); }
.menu-toggle[aria-expanded="true"] span::after { transform: translateY(-6px) rotate(-45deg); }

/* ---------- buttons ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 48px; padding: 0 22px;
  border: 1px solid var(--ink); border-radius: 2px;
  background: var(--ink); color: var(--white);
  font-size: 15px; font-weight: 600; text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.btn:hover { background: var(--brand-hover); border-color: var(--brand-hover); color: var(--white); }
.btn.secondary { background: transparent; color: var(--ink); border-color: var(--line-strong); }
.btn.secondary:hover { background: var(--paper-2); border-color: var(--ink); color: var(--ink); }
.btn.small { min-height: 44px; padding: 0 15px; font-size: 13px; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--brand); padding: 0 4px; min-height: 40px; }
.btn.ghost:hover { background: transparent; color: var(--brand-hover); }
.btn .arrow { font-family: var(--mono); font-size: 15px; transition: transform 0.15s ease; }
.btn:hover .arrow { transform: translateX(3px); }
.link-arrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 14px; font-weight: 600; text-decoration: none;
  border-bottom: 1px solid var(--line-strong); padding-bottom: 3px;
}
.link-arrow:hover { border-color: var(--brand); }

/* ---------- hero ---------- */

.hero {
  position: relative; overflow: hidden;
  padding: 76px 0 72px;
  border-bottom: 1px solid var(--line);
}
.hero::before {
  content: ""; position: absolute; top: 0; right: 0; bottom: 0; width: 46%;
  background-image:
    linear-gradient(to right, rgba(20, 24, 27, 0.055) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(20, 24, 27, 0.055) 1px, transparent 1px);
  background-size: 44px 44px;
  -webkit-mask-image: linear-gradient(to left, #000 30%, transparent 100%);
  mask-image: linear-gradient(to left, #000 30%, transparent 100%);
  pointer-events: none;
}
.hero-grid {
  position: relative; display: grid; grid-template-columns: 7fr 5fr;
  gap: 58px; align-items: center;
}
.hero h1 { margin-bottom: 24px; }
.hero h1 em { font-style: normal; color: var(--brand); }
.hero .lede { max-width: 54ch; }
.category-line { font-size: 15px; color: var(--ink-soft); margin: -8px 0 18px; font-weight: 500; }
.hero-legal { font-size: 12.5px; line-height: 1.7; color: var(--muted); margin-top: 16px; max-width: 54ch; }
.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 22px; margin-top: 32px; }
.hero-facts {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0; margin-top: 46px; border-top: 1px solid var(--line);
}
.hero-facts > div { padding: 16px 18px 0 0; }
.hero-facts dt {
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--muted);
}
.hero-facts dd { font-size: 14px; color: var(--ink); font-weight: 600; margin-top: 2px; }

/* certificate specimen */
.cert-wrap { position: relative; }
.cert-demo {
  position: absolute; z-index: 3; top: -12px; left: 18px;
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.1em;
  color: var(--warning); background: var(--warning-wash);
  border: 1px solid var(--demo-border); padding: 3px 8px;
}
.cert-note { font-size: 11.5px; line-height: 1.6; color: var(--warning); margin-top: 12px; }
.cert-back {
  position: absolute; inset: 18px -12px -14px 22px;
  border: 1px solid var(--line-strong); background: var(--paper-2);
  transform: rotate(2.4deg);
}
.cert {
  position: relative; background: var(--white);
  border: 1px solid var(--line-strong);
  padding: 26px 26px 22px;
  transform: rotate(-1.6deg);
  box-shadow: var(--shadow);
}
.cert-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 18px; }
.cert-kicker { font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.18em; color: var(--gold-ink); }
.cert-title { font-family: var(--serif); font-size: 26px; line-height: 1.2; margin-top: 5px; }
.cert-seal, .cert-mark { width: 58px; height: 58px; flex: none; opacity: 1; }
.cert-name {
  font-family: var(--serif); margin-top: 28px; padding-top: 16px; border-top: 1px solid var(--line);
  font-family: var(--serif); font-size: 30px; line-height: 1.2; color: var(--ink);
}
.cert-level { font-size: 13px; color: var(--brand); font-weight: 600; margin-top: 4px; }
.cert-meta {
  display: grid; grid-template-columns: 1fr 1fr; gap: 1px;
  margin-top: 22px; border: 1px solid var(--line); background: var(--line);
}
.cert-meta div { background: var(--white); padding: 9px 11px; }
.cert-meta dt { font-family: var(--mono); font-size: 11px; letter-spacing: 0.12em; color: var(--muted); text-transform: uppercase; }
.cert-meta dd { font-family: var(--mono); font-size: 12.5px; color: var(--ink); margin-top: 3px; }
.cert-foot {
  display: flex; justify-content: space-between; align-items: flex-end;
  gap: 16px; margin-top: 20px;
}
.cert-sign { font-family: var(--serif); font-size: 15px; color: var(--ink); border-top: 1px solid var(--ink); padding-top: 6px; }
.cert-sign small { display: block; font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.1em; color: var(--muted); margin-top: 3px; }
.cert-code { font-family: var(--mono); font-size: 10.5px; color: var(--muted); letter-spacing: 0.12em; text-align: right; }

/* ---------- trust strip ---------- */

.trust-strip { border-bottom: 1px solid var(--line); }
.trust-grid { display: grid; grid-template-columns: repeat(4, 1fr); }
.trust-item { padding: 26px 26px 28px 0; border-right: 1px solid var(--line); }
.trust-item:last-child { border-right: 0; }
.trust-item .num { font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.16em; color: var(--gold-ink); }
.trust-item h3 { font-family: var(--sans); font-size: 15px; font-weight: 700; margin-top: 8px; }
.trust-item p { font-size: 13px; line-height: 1.7; margin-top: 4px; color: var(--muted); }

/* ---------- sections ---------- */

.section { padding: 84px 0; border-bottom: 1px solid var(--line); }
.section.tight { padding: 62px 0; }
.section.dark { background: var(--ink); color: var(--on-dark); border-bottom: 0; }
.section.dark h2, .section.dark h3 { color: var(--paper); }
.section.dark .eyebrow { color: var(--gold); }
.section.dark .eyebrow::before { background: var(--gold); }
.section-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 32px; margin-bottom: 42px; }
.section-head p { max-width: 46ch; font-size: 15px; color: var(--muted); }
.section-head .eyebrow { margin-bottom: 12px; }

/* ledger */
.ledger { display: grid; grid-template-columns: 5fr 7fr; gap: 48px; align-items: end; }
.ledger-label { font-family: var(--mono); font-size: 10px; letter-spacing: 0.18em; color: var(--gold); }
.ledger-title { font-size: 26px; color: var(--paper); margin-top: 8px; }
.ledger-num {
  font-family: var(--sans); font-weight: 800; font-size: clamp(64px, 9vw, 118px); line-height: 0.95;
  color: var(--paper); letter-spacing: -0.02em;
}
.ledger-num.pending { font-family: var(--mono); font-size: clamp(30px, 4.4vw, 46px); letter-spacing: 0.04em; line-height: 1.25; color: var(--gold); }
.ledger-meta {
  display: flex; flex-wrap: wrap; gap: 10px 24px; margin-top: 18px;
  padding-top: 14px; border-top: 1px solid rgba(255, 253, 248, 0.18);
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.1em; color: var(--on-dark-muted);
}
.ledger-note { font-size: 13px; color: var(--on-dark-muted); margin-top: 10px; max-width: 56ch; }

/* levels table */
.table-shell { border-top: 2px solid var(--ink); }
.levels { width: 100%; border-collapse: collapse; }
.levels th, .levels td { text-align: left; vertical-align: top; padding: 18px 14px; border-bottom: 1px solid var(--line); }
.levels thead th {
  font-family: var(--mono); font-size: 10px; font-weight: 500; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--muted); padding-top: 10px; padding-bottom: 10px;
}
.levels tbody tr:hover { background: rgba(255, 253, 248, 0.55); }
.levels th[scope="row"] { width: 21%; }
.lv {
  display: inline-block; font-family: var(--mono); font-size: 11px; font-weight: 600;
  letter-spacing: 0.08em; color: var(--brand); border: 1px solid var(--brand);
  padding: 1px 6px; margin-right: 8px; border-radius: 2px;
}
.lv-name { display: block; font-family: var(--sans); font-size: 15px; font-weight: 700; color: var(--ink); margin-top: 7px; }
.levels td { font-size: 14px; line-height: 1.65; color: var(--ink-soft); }
.levels .validity { font-family: var(--mono); font-size: 12px; white-space: nowrap; }

/* timeline */
.timeline { list-style: none; counter-reset: step; position: relative; margin-top: 8px; }
.timeline::before {
  content: ""; position: absolute; left: 23px; top: 8px; bottom: 8px;
  width: 1px; background: var(--line-strong);
}
.timeline li {
  position: relative; display: grid; grid-template-columns: 48px 1fr;
  gap: 22px; padding: 0 0 30px;
}
.timeline li:last-child { padding-bottom: 0; }
.timeline .step {
  position: relative; z-index: 1; width: 48px; height: 48px;
  display: flex; align-items: center; justify-content: center;
  background: var(--paper); border: 1px solid var(--line-strong); border-radius: 50%;
  font-family: var(--mono); font-size: 11px; color: var(--brand);
}
.timeline h3 { font-family: var(--sans); font-size: 16px; font-weight: 700; margin-top: 10px; }
.timeline p { font-size: 14px; color: var(--muted); margin-top: 4px; max-width: 58ch; }
.artifact {
  display: inline-block; margin-top: 9px; font-family: var(--mono);
  font-size: 10.5px; letter-spacing: 0.1em; color: var(--gold-ink);
  border: 1px solid var(--line-strong); padding: 2px 7px;
}
.timeline-cols { display: grid; grid-template-columns: 5fr 7fr; gap: 48px; align-items: start; }
.timeline-intro { position: sticky; top: 110px; }

/* proof / verification */
.proof-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; align-items: start; }
.record-card {
  background: var(--white); border: 1px solid var(--line-strong);
  padding: 26px; box-shadow: var(--shadow);
}
.record-card .record-head {
  display: flex; justify-content: space-between; align-items: center;
  padding-bottom: 12px; border-bottom: 1px solid var(--line);
}
.record-card .record-id { font-family: var(--mono); font-size: 15px; letter-spacing: 0.06em; color: var(--ink); }
.record-rows { display: grid; grid-template-columns: 122px 1fr; gap: 0; margin-top: 4px; }
.record-rows dt, .record-rows dd { padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.record-rows dt { color: var(--muted); }
.record-rows dd { color: var(--ink); font-weight: 600; }
.record-foot { display: flex; justify-content: space-between; gap: 12px; margin-top: 14px; font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.08em; color: var(--muted); }

/* callout */
.callout {
  border-left: 3px solid var(--brand); background: var(--brand-wash);
  padding: 20px 22px; margin: 26px 0; font-size: 14px; color: var(--ink-soft);
}
.callout strong { display: block; color: var(--ink); margin-bottom: 4px; }
.callout.warn { border-color: var(--warning); background: var(--warning-wash); }

/* checklist */
.checklist { list-style: none; display: grid; gap: 10px; margin-top: 16px; }
.checklist li { position: relative; padding-left: 26px; font-size: 14px; }
.checklist li::before {
  content: ""; position: absolute; left: 0; top: 0.52em;
  width: 10px; height: 5px; border-left: 2px solid var(--success); border-bottom: 2px solid var(--success);
  transform: rotate(-45deg);
}

/* FAQ */
.faq { border-top: 1px solid var(--line-strong); }
.faq-item { border-bottom: 1px solid var(--line); }
.faq-item summary {
  list-style: none; cursor: pointer; display: flex; justify-content: space-between;
  align-items: center; gap: 20px; padding: 22px 0;
  font-family: var(--sans); font-size: 16px; font-weight: 600; color: var(--ink);
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary .plus { font-family: var(--mono); font-size: 20px; color: var(--brand); transition: transform 0.18s ease; }
.faq-item[open] summary .plus { transform: rotate(45deg); }
.faq-item .faq-body { padding: 0 40px 24px 0; font-size: 14px; color: var(--ink-soft); }
.faq-item .faq-body p { max-width: 66ch; }

/* ---------- verify page ---------- */

.page-head { padding: 60px 0 46px; border-bottom: 1px solid var(--line); }
.page-head h1 { font-size: clamp(34px, 4.4vw, 54px); }
.page-head .lede { margin-top: 16px; max-width: 60ch; }
.verify-layout { display: grid; grid-template-columns: 5fr 7fr; gap: 56px; padding: 54px 0 84px; align-items: start; }
.verify-aside { position: sticky; top: 108px; }
.verify-aside h2 { font-size: 24px; margin-bottom: 12px; }
.verify-aside p { font-size: 14px; color: var(--muted); }
.sample-list { list-style: none; margin-top: 24px; border-top: 1px solid var(--line); }
.sample-list li { border-bottom: 1px solid var(--line); }
.sample-list button {
  width: 100%; display: flex; justify-content: space-between; gap: 16px;
  padding: 12px 0; background: none; border: 0; text-align: left;
  font-family: var(--mono); font-size: 12px; color: var(--brand); letter-spacing: 0.04em;
}
.sample-list button span { font-family: var(--sans); font-size: 11px; color: var(--muted); letter-spacing: 0; }

.verify-panel {
  background: var(--white); border: 1px solid var(--line-strong);
  padding: 30px; box-shadow: var(--shadow);
}
.verify-panel .panel-label { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; }
.verify-form { display: flex; gap: 10px; }
.verify-form input {
  flex: 1; min-width: 0; height: 54px; padding: 0 16px;
  border: 1px solid var(--input-border); border-radius: 2px;
  background: var(--white); color: var(--ink);
  font-family: var(--mono); font-size: 15px; letter-spacing: 0.06em;
}
.verify-form input::placeholder { color: var(--placeholder); letter-spacing: 0.04em; }
.verify-form input:focus { outline: 2px solid var(--brand); outline-offset: 1px; border-color: var(--brand); }
.verify-form .btn { flex: none; }
.hint { font-size: 12px; color: var(--muted); margin-top: 10px; }
.hint code { font-family: var(--mono); font-size: 11px; color: var(--ink); background: var(--paper-2); padding: 1px 5px; white-space: nowrap; }

.result { margin-top: 26px; }
.result:empty { display: none; }
.result-card { border: 1px solid var(--line-strong); background: var(--paper); }
.result-head {
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  padding: 14px 18px; border-bottom: 1px solid var(--line);
  background: var(--white);
}
.result-head .mono { color: var(--muted); }
.status {
  display: inline-flex; align-items: center; gap: 7px;
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.08em;
  padding: 4px 9px; border: 1px solid currentColor; border-radius: 999px;
}
.status.valid { color: var(--success); background: var(--success-wash); }
.status.demo { color: var(--warning); background: var(--warning-wash); }
.status.bad { color: var(--danger); background: var(--danger-wash); }
.status::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.result-id { font-family: var(--mono); font-size: 21px; letter-spacing: 0.05em; color: var(--ink); padding: 18px 18px 0; word-break: break-all; }
.result-body { padding: 6px 18px 18px; }
.result-body dl { display: grid; grid-template-columns: 118px 1fr; margin-top: 8px; }
.result-body dt, .result-body dd { padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.result-body dt { color: var(--muted); }
.result-body dd { color: var(--ink); font-weight: 600; }
.result-alert {
  margin: 16px 18px 0; padding: 12px 14px; font-size: 12.5px; line-height: 1.7;
  border: 1px solid var(--alert-warning-border); background: var(--warning-wash); color: var(--warning);
}
.result-alert.bad { border-color: var(--alert-danger-border); background: var(--danger-wash); color: var(--danger); }
.result-actions { display: flex; flex-wrap: wrap; gap: 12px; padding: 16px 18px; border-top: 1px solid var(--line); background: var(--white); }
.result-actions .btn.small { min-height: 44px; }
.result-note { padding: 12px 18px; font-size: 11px; color: var(--muted); border-top: 1px solid var(--line); }

.loading { display: flex; align-items: center; gap: 10px; font-family: var(--mono); font-size: 11px; letter-spacing: 0.1em; color: var(--muted); padding: 18px 0; }
.loading::before {
  content: ""; width: 12px; height: 12px; border: 1.5px solid var(--line-strong);
  border-top-color: var(--brand); border-radius: 50%; animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- shops ---------- */

.filter-bar {
  display: flex; flex-wrap: wrap; gap: 12px; align-items: center;
  padding: 16px 0; border-top: 1px solid var(--line-strong); border-bottom: 1px solid var(--line);
}
.filter-bar label { font-family: var(--mono); font-size: 10px; letter-spacing: 0.1em; color: var(--muted); text-transform: uppercase; }
.filter-bar select {
  height: 44px; padding: 0 34px 0 12px; border: 1px solid var(--line-strong);
  border-radius: 2px; background: var(--white); font-size: 13px; color: var(--ink);
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--ink) 50%), linear-gradient(135deg, var(--ink) 50%, transparent 50%);
  background-position: calc(100% - 16px) 17px, calc(100% - 11px) 17px;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}
.filter-count { margin-left: auto; font-family: var(--mono); font-size: 10px; letter-spacing: 0.08em; color: var(--muted); }
.shop-table { width: 100%; border-collapse: collapse; margin-top: 4px; }
.shop-table th, .shop-table td { text-align: left; padding: 15px 12px; border-bottom: 1px solid var(--line); font-size: 14px; }
.shop-table thead th { font-family: var(--mono); font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); font-weight: 500; }
.shop-table td { color: var(--ink-soft); }
.shop-table td:first-child { color: var(--ink); font-weight: 600; }
.demo-tag {
  display: inline-block; margin-left: 7px; font-family: var(--mono); font-size: 10px;
  letter-spacing: 0.08em; color: var(--warning); border: 1px solid var(--demo-border);
  padding: 1px 5px; vertical-align: 1px;
}
.empty-state { padding: 40px 0; border-bottom: 1px solid var(--line); font-size: 14px; color: var(--muted); }
.empty-state strong { display: block; color: var(--ink); font-size: 16px; margin-bottom: 4px; }

/* ---------- prose / about ---------- */

.prose { max-width: 760px; }
.prose h2 { font-size: 28px; margin: 38px 0 12px; }
.prose h3 { font-family: var(--sans); font-size: 17px; margin: 26px 0 8px; }
.prose p, .prose li { font-size: 15px; color: var(--ink-soft); }
.prose p { margin-bottom: 12px; }
.prose ul, .prose ol { margin: 0 0 16px 20px; }
.prose li { margin-bottom: 6px; }
.prose .meta { font-family: var(--mono); font-size: 10px; letter-spacing: 0.1em; color: var(--muted); text-transform: uppercase; }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 32px 0; }

.about-grid { display: grid; grid-template-columns: 5fr 7fr; gap: 56px; }
.boundary {
  border: 1px solid var(--line-strong); background: var(--white); padding: 24px;
}
.boundary .mono { color: var(--gold-ink); }
.boundary p { font-size: 14px; margin-top: 8px; }

/* CTA band */
.cta-band { padding: 64px 0; border-bottom: 1px solid var(--line); }
.cta-inner {
  display: flex; justify-content: space-between; align-items: center; gap: 32px;
  border-top: 2px solid var(--ink); border-bottom: 1px solid var(--line); padding: 34px 0;
}
.cta-inner h2 { font-size: clamp(24px, 3vw, 34px); flex: 1; max-width: none; }
.cta-actions { display: flex; flex-wrap: wrap; gap: 12px; flex: none; }

/* ---------- footer ---------- */

.site-footer { padding: 56px 0 36px; }
.footer-top { display: grid; grid-template-columns: 5fr 7fr; gap: 56px; padding-bottom: 36px; border-bottom: 1px solid var(--line); }
.footer-brand .brand { margin-bottom: 18px; }
.footer-statement { font-size: 12.5px; line-height: 1.8; color: var(--muted); max-width: 52ch; }
.footer-cols { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.footer-cols .footer-heading { font-family: var(--mono); font-size: 11px; font-weight: 500; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); margin-bottom: 10px; }
.footer-cols ul { list-style: none; display: grid; gap: 6px; }
.footer-cols a { font-size: 13px; color: var(--ink-soft); text-decoration: none; }
.footer-cols a:hover { color: var(--brand); text-decoration: underline; }
.footer-bottom {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px;
  padding-top: 20px; font-family: var(--mono); font-size: 11px;
  letter-spacing: 0.08em; color: var(--muted);
}

/* ---------- misc ---------- */

.divider { border: 0; border-top: 1px solid var(--line); }
.kicker-row { display: flex; flex-wrap: wrap; gap: 8px 18px; align-items: center; }
.dot { width: 3px; height: 3px; background: var(--line-strong); border-radius: 50%; }


/* ---------- utilities ---------- */
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mt-32 { margin-top: 32px; }

/* ---------- process ---------- */
.process {
  list-style: none; display: grid; grid-template-columns: repeat(4, 1fr);
  border-top: 2px solid var(--ink); border-bottom: 1px solid var(--line);
}
.process li { padding: 20px 22px 24px 0; border-right: 1px solid var(--line); }
.process li:last-child { border-right: 0; padding-right: 0; }
.process .pnum { font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.12em; color: var(--gold-ink); }
.process h3 { font-family: var(--sans); font-size: 16px; margin-top: 8px; }
.process p { font-size: 13px; line-height: 1.7; color: var(--muted); margin-top: 6px; }

/* ---------- assessment ---------- */
.score-grid { display: grid; grid-template-columns: 6fr 6fr; gap: 48px; align-items: start; }
.rule-title {
  font-family: var(--mono); font-size: 10px; font-weight: 500; letter-spacing: 0.14em;
  color: var(--brand); text-transform: uppercase; padding-bottom: 8px;
  border-bottom: 1px solid var(--line-strong);
}
.diagram { border: 1px solid var(--line-strong); background: var(--white); padding: 16px; }
.diagram img { width: 100%; height: auto; }
.diagram figcaption { font-size: 11.5px; line-height: 1.7; color: var(--muted); margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); }

/* ---------- certificate fields ---------- */
.field-list { list-style: none; border-top: 1px solid var(--line-strong); }
.field-list li { display: grid; grid-template-columns: 36px 1fr; gap: 14px; padding: 13px 0; border-bottom: 1px solid var(--line); }
.field-list .fnum { font-family: var(--mono); font-size: 10.5px; color: var(--gold-ink); padding-top: 3px; }
.field-list strong { font-size: 14px; color: var(--ink); }
.field-list p { font-size: 13px; color: var(--muted); margin-top: 2px; }

/* ---------- rules ---------- */
.rule-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; border-top: 1px solid var(--line-strong); border-bottom: 1px solid var(--line); }
.rule-grid.two { grid-template-columns: 1fr 1fr; }
.rule-grid.two .rule-block { border-right: 1px solid var(--line); padding-right: 24px; }
.rule-grid.two .rule-block:nth-child(2n) { border-right: 0; padding-right: 0; }
.rule-grid.two .rule-block:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
.rule-block { padding: 22px 24px 26px 0; border-right: 1px solid var(--line); }
.rule-block:nth-child(3n) { border-right: 0; padding-right: 0; }
.rule-block h3 { font-family: var(--sans); font-size: 16px; margin-top: 6px; }
.rule-block p { font-size: 13.5px; line-height: 1.75; color: var(--muted); margin-top: 6px; }

/* ---------- 404 ---------- */
.notfound { padding: 100px 0 120px; }
.notfound .code { font-family: var(--mono); font-size: 12px; letter-spacing: 0.2em; color: var(--gold-ink); }
.notfound h1 { margin-top: 12px; }
.notfound p { margin-top: 16px; }
.notfound .actions { margin-top: 28px; display: flex; flex-wrap: wrap; gap: 12px; }


/* ---------- standard band / stats ---------- */
.standard-band { background: var(--white); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 70px 0; }
.standard-head { display: grid; grid-template-columns: 6fr 6fr; gap: 48px; align-items: end; margin-bottom: 34px; }
.standard-head h2 { max-width: none; }
.standard-head p { color: var(--muted); font-size: 15px; }
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); border-top: 2px solid var(--ink); border-bottom: 1px solid var(--line); }
.stat { padding: 18px 20px 20px 0; border-right: 1px solid var(--line); }
.stat:last-child { border-right: 0; padding-right: 0; }
.stat-num { font-family: var(--mono); font-size: clamp(26px, 2.8vw, 38px); line-height: 1.1; letter-spacing: -0.02em; color: var(--brand); font-weight: 500; }
.stat-label { font-size: 12.5px; color: var(--muted); margin-top: 6px; }
.stat-source { font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.08em; color: var(--muted); margin-top: 14px; line-height: 1.7; }
.stat-note { font-size: 13px; line-height: 1.7; color: var(--muted); margin-top: 14px; }
.stat-note strong { color: var(--ink); }

/* trace chain */
.trace { list-style: none; display: grid; grid-template-columns: repeat(5, 1fr); gap: 0; margin-top: 26px; border-top: 1px solid var(--line-strong); border-bottom: 1px solid var(--line); }
.trace li { position: relative; padding: 18px 22px 20px 0; border-right: 1px solid var(--line); }
.trace li:last-child { border-right: 0; padding-right: 0; }
.trace .tnum { font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.12em; color: var(--gold-ink); }
.trace h3 { font-family: var(--sans); font-size: 14px; font-weight: 700; margin-top: 8px; }
.trace p { font-size: 12px; color: var(--muted); margin-top: 4px; line-height: 1.6; }
.trace .back { display: inline-block; margin-top: 8px; font-family: var(--mono); font-size: 8.5px; letter-spacing: 0.08em; color: var(--brand-hover); border: 1px solid var(--line-strong); padding: 1px 5px; }

/* capability list */
.capability-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0; border-top: 1px solid var(--line-strong); border-bottom: 1px solid var(--line); }
.capability { padding: 20px 24px 22px 0; border-right: 1px solid var(--line); }
.capability:nth-child(2n) { border-right: 0; padding-right: 0; }
.capability h3 { font-family: var(--sans); font-size: 15px; margin-top: 5px; }
.capability p { font-size: 13px; color: var(--muted); margin-top: 4px; }

@media (max-width: 1020px) {
  .standard-head { grid-template-columns: 1fr; gap: 16px; }
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .stat:nth-child(2n) { border-right: 0; }
  .stat:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .trace { grid-template-columns: 1fr 1fr; }
  .trace li:nth-child(2n) { border-right: 0; }
  .trace li { border-bottom: 1px solid var(--line); }
}
@media (max-width: 560px) {
  .stat-grid { grid-template-columns: 1fr; }
  .stat, .stat:nth-child(2n) { border-right: 0; border-bottom: 1px solid var(--line); padding: 14px 0; }
  .stat:last-child { border-bottom: 0; }
  .trace { grid-template-columns: 1fr; }
  .trace li, .trace li:nth-child(2n) { border-right: 0; padding: 14px 0; }
  .capability-grid { grid-template-columns: 1fr; }
  .capability, .capability:nth-child(2n) { border-right: 0; padding: 16px 0; border-bottom: 1px solid var(--line); }
  .capability:last-child { border-bottom: 0; }
}

/* ---------- responsive ---------- */

@media (max-width: 1020px) {
  .hero-grid { gap: 34px; }
  .hero { padding-top: 58px; }
  .footer-top { grid-template-columns: 1fr; gap: 34px; }
  .ledger { grid-template-columns: 1fr; gap: 22px; }
  .timeline-cols { grid-template-columns: 1fr; gap: 28px; }
  .timeline-intro { position: static; }
  .verify-layout { grid-template-columns: 1fr; gap: 32px; }
  .verify-aside { position: static; }
  .proof-grid { grid-template-columns: 1fr; gap: 34px; }
  .about-grid { grid-template-columns: 1fr; gap: 32px; }
}

@media (max-width: 860px) {
  .nav {
    position: absolute; top: 100%; left: 0; right: 0;
    display: none; flex-direction: column; align-items: stretch; gap: 0;
    background: var(--paper); border-bottom: 1px solid var(--line);
    padding: 10px 28px 18px;
  }
  .nav.open { display: flex; }
  .nav a { padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 15px; }
  .header-actions .btn { display: inline-flex; min-height: 44px; padding: 0 10px; font-size: 12px; }
  .menu-toggle { display: block; }
  .site-header { position: relative; }
  .hero-grid { grid-template-columns: 1fr; gap: 46px; }
  .hero::before { width: 100%; opacity: 0.6; }
  .hero h1 { max-width: 16ch; }
  .hero-facts { grid-template-columns: 1fr 1fr; }
  .trust-grid { grid-template-columns: 1fr 1fr; }
  .trust-item { border-right: 0; border-bottom: 1px solid var(--line); padding: 22px 18px 22px 0; }
  .trust-item:nth-child(2n) { padding-left: 18px; border-left: 1px solid var(--line); }
  .trust-item:nth-last-child(-n+2) { border-bottom: 0; }
  .section { padding: 62px 0; }
  .section-head { display: block; }
  .section-head p { margin-top: 12px; }
  .cta-inner { display: block; }
  .cta-actions { margin-top: 22px; }
  .footer-cols { grid-template-columns: 1fr 1fr; }
  .levels thead { display: none; }
  .levels, .levels tbody, .levels tr, .levels th, .levels td { display: block; width: 100%; }
  .levels tr { padding: 18px 0; border-bottom: 1px solid var(--line); }
  .levels th[scope="row"] { border: 0; padding: 0 0 8px; }
  .levels td { border: 0; padding: 5px 0 5px 92px; position: relative; }
  .levels td::before {
    content: attr(data-label); position: absolute; left: 0; top: 5px;
    font-family: var(--mono); font-size: 9px; letter-spacing: 0.1em;
    color: var(--muted); text-transform: uppercase;
  }
  .levels .lv-name { display: inline; margin-left: 2px; }
  .shop-table thead { display: none; }
  .shop-table, .shop-table tbody, .shop-table tr, .shop-table td { display: block; width: 100%; }
  .shop-table tr { padding: 14px 0; border-bottom: 1px solid var(--line); }
  .shop-table td { border: 0; padding: 3px 0 3px 96px; position: relative; }
  .shop-table td::before {
    content: attr(data-label); position: absolute; left: 0; top: 3px;
    font-family: var(--mono); font-size: 9px; letter-spacing: 0.1em; color: var(--muted);
  }
}

@media (max-width: 560px) {
  .wrap { padding: 0 20px; }
  .statusbar .right { display: none; }
  .header-inner { min-height: 68px; }
  .brand-word { font-size: 19px; }
  .brand-academy { font-size: 11.5px; padding-left: 2px; }
  .header-inner { gap: 10px; }
  .brand-mark { width: 30px; height: 30px; }
  .hero { padding: 32px 0 44px; }
  .hero-grid { gap: 30px; }
  .hero h1 { margin-bottom: 16px; }
  .hero .lede { font-size: 16px; }
  .hero-actions { margin-top: 22px; }
  .hero-facts { margin-top: 24px; }
  .hero-legal { margin-top: 10px; }
  .hero-facts { display: flex; flex-wrap: wrap; gap: 6px 18px; padding-top: 14px; }
  .hero-facts > div { display: flex; align-items: baseline; gap: 6px; padding: 0; border: 0; }
  .hero-facts dt { font-size: 9px; }
  .hero-facts dd { font-size: 12px; margin: 0; }
  .cert { padding: 20px 18px; }
  .cert-title { font-size: 22px; }
  .cert-name { font-size: 25px; }
  .cert-meta { grid-template-columns: 1fr; }
  .trust-grid { grid-template-columns: 1fr; }
  .trust-item, .trust-item:nth-child(2n) { padding: 20px 0; border-left: 0; border-bottom: 1px solid var(--line); }
  .trust-item:last-child { border-bottom: 0; }
  .footer-cols { grid-template-columns: 1fr 1fr; }
  .footer-cols a { min-height: 44px; display: flex; align-items: center; font-size: 14px; padding: 2px 0; }
  .footer-statement { font-size: 13px; }
  .verify-panel { padding: 20px; }
  .result-head { flex-wrap: wrap; gap: 8px; }
  .result-head .mono { font-size: 9px; }
  .status { font-size: 9px; padding: 3px 7px; }
  .verify-form { flex-direction: column; }
  .verify-form .btn { width: 100%; }
  .result-body dl { grid-template-columns: 100px 1fr; }
  .record-rows { grid-template-columns: 104px 1fr; }
  .sample-list button { font-size: 11px; }
  .filter-bar { gap: 8px; }
  .filter-bar label { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
  .filter-bar select { flex: 1 1 calc(50% - 4px); }
  .filter-count { flex: 1 1 100%; margin-left: 0; }
  .score-grid .diagram { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}


@media (max-width: 1020px) {
  .score-grid { grid-template-columns: 1fr; gap: 30px; }
  .process { grid-template-columns: 1fr 1fr; }
  .process li:nth-child(2n) { border-right: 0; }
  .process li:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .rule-grid { grid-template-columns: 1fr 1fr; }
  .rule-block:nth-child(3n) { border-right: 1px solid var(--line); padding-right: 24px; }
  .rule-block:nth-child(2n) { border-right: 0; padding-right: 0; }
}
@media (max-width: 560px) {
  .process { grid-template-columns: 1fr; }
  .process li { border-right: 0; border-bottom: 1px solid var(--line); padding: 18px 0; }
  .process li:last-child { border-bottom: 0; }
  .rule-grid, .rule-grid.two { grid-template-columns: 1fr; }
  .rule-block, .rule-block:nth-child(3n), .rule-block:nth-child(2n), .rule-grid.two .rule-block { border-right: 0; padding: 18px 0; border-bottom: 1px solid var(--line); }
  .rule-block:last-child { border-bottom: 0; }
  .page-head h1 { font-size: 32px; line-height: 1.22; }
  .stat-source { font-size: 10.5px; line-height: 1.7; }
  .notfound { padding: 60px 0 80px; }
}

/* ---------- print ---------- */

.print-only { display: none; }


@page { margin: 16mm; }
@media print {
  .statusbar, .site-header, .site-footer, .hero-actions, .cta-band,
  .verify-aside, .result-actions, .page-head, .verify-form, .hint,
  .panel-label, .section.tight { display: none !important; }
  body { background: #fff; color: #000; }
  .print-only { display: block; }
  .print-head { border-bottom: 2px solid #000; padding-bottom: 8mm; margin-bottom: 8mm; }
  .print-head .print-title { font-family: var(--serif); font-size: 24pt; font-weight: 700; line-height: 1.2; margin: 0 0 4mm; }
  .print-head p { font-size: 9pt; color: #333; max-width: 140mm; }
  .verify-layout { display: block; padding: 0; }
  .verify-panel { border: 0; padding: 0; box-shadow: none; background: #fff; }
  .result-card, .result-head, .result-body, .result-note { background: #fff; }
  .result-card { border: 1px solid #000; }
  .result-alert { border: 1px solid #000; background: #fff; color: #000; }
  a { color: #000; }
}
