:root {
    --paper: #f2f8fc;
    --paper-raised: #ffffff;
    --ink: #12283c;
    --ink-soft: #4d6b82;
    --ink-faint: #7f9ab0;
    --line: #d7e7f2;
    --line-strong: #b9d7ea;
    --accent-deep: #1f6fc4;
    --accent-mid: #4fa3e0;
    --accent-light: #bfe3fb;
    --accent-wash: #e4f2fb;
    --gold: #c98f2e;
    --blush: #d9698a;
    --shadow: rgba(31, 111, 196, 0.14);
  }

  @media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
      --paper: #0b1520;
      --paper-raised: #101f2e;
      --ink: #e8f4fb;
      --ink-soft: #93b0c4;
      --ink-faint: #6d8ba3;
      --line: #1e3648;
      --line-strong: #2c4d64;
      --accent-deep: #7ec2f6;
      --accent-mid: #5aabe6;
      --accent-light: #234b6b;
      --accent-wash: #142838;
      --gold: #e8bc6e;
      --blush: #ef9fbb;
      --shadow: rgba(0, 0, 0, 0.35);
    }
  }

  :root[data-theme="dark"] {
    --paper: #0b1520;
    --paper-raised: #101f2e;
    --ink: #e8f4fb;
    --ink-soft: #93b0c4;
    --ink-faint: #6d8ba3;
    --line: #1e3648;
    --line-strong: #2c4d64;
    --accent-deep: #7ec2f6;
    --accent-mid: #5aabe6;
    --accent-light: #234b6b;
    --accent-wash: #142838;
    --gold: #e8bc6e;
    --blush: #ef9fbb;
    --shadow: rgba(0, 0, 0, 0.35);
  }

  :root[data-theme="light"] {
    --paper: #f2f8fc;
    --paper-raised: #ffffff;
    --ink: #12283c;
    --ink-soft: #4d6b82;
    --ink-faint: #7f9ab0;
    --line: #d7e7f2;
    --line-strong: #b9d7ea;
    --accent-deep: #1f6fc4;
    --accent-mid: #4fa3e0;
    --accent-light: #bfe3fb;
    --accent-wash: #e4f2fb;
    --gold: #c98f2e;
    --blush: #d9698a;
    --shadow: rgba(31, 111, 196, 0.14);
  }

  * { box-sizing: border-box; }

  body {
    margin: 0;
    background: var(--paper);
    color: var(--ink);
    font-family: -apple-system, "Segoe UI", system-ui, sans-serif;
    -webkit-font-smoothing: antialiased;
  }

  .page {
    max-width: 920px;
    margin: 0 auto;
    padding: 64px 24px 96px;
  }

  .eyebrow {
    font-family: ui-monospace, "SF Mono", "Cascadia Code", Consolas, monospace;
    font-size: 0.72rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--accent-deep);
    font-weight: 600;
  }

  h1, h2, h3 {
    font-family: ui-rounded, "SF Pro Rounded", "Segoe UI Rounded", system-ui, sans-serif;
    text-wrap: balance;
    margin: 0;
  }

  /* ---------- root node ---------- */
  .root {
    display: flex;
    align-items: center;
    gap: 16px;
    margin: 0 0 8px;
  }

  .root-glyph {
    flex-shrink: 0;
    width: 56px;
    height: 56px;
    border-radius: 20px;
    background: linear-gradient(150deg, var(--accent-light), var(--accent-mid) 60%, var(--accent-deep));
    box-shadow: 0 10px 24px -8px var(--shadow), inset 0 1px 0 rgba(255,255,255,0.4);
    display: grid;
    place-items: center;
  }

  .root-glyph svg { width: 30px; height: 30px; color: #fff; }

  .root h1 {
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.25;
  }

  .root p {
    margin: 4px 0 0;
    color: var(--ink-soft);
    font-size: 0.92rem;
    max-width: 60ch;
  }

  .root-meta {
    display: flex;
    gap: 14px;
    margin: 20px 0 0;
    flex-wrap: wrap;
  }

  .root-meta span {
    font-family: ui-monospace, "SF Mono", monospace;
    font-size: 0.72rem;
    color: var(--ink-faint);
    background: var(--paper-raised);
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 4px 10px;
  }

  /* ---------- spine layout ---------- */
  .spine-wrap {
    position: relative;
    margin-top: 44px;
    padding-left: 34px;
  }

  .spine-wrap::before {
    content: '';
    position: absolute;
    left: 7px;
    top: 6px;
    bottom: 46px;
    width: 2px;
    background: linear-gradient(var(--line-strong), var(--line-strong) 92%, transparent);
  }

  .module {
    position: relative;
    margin-bottom: 40px;
  }

  .module::before {
    /* node dot on the spine */
    content: '';
    position: absolute;
    left: -33px;
    top: 6px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--paper);
    border: 3px solid var(--accent-mid);
  }

  .module-head {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 6px;
  }

  .module-icon {
    width: 22px;
    height: 22px;
    color: var(--accent-deep);
    flex-shrink: 0;
  }

  .module-icon svg { width: 100%; height: 100%; }

  .module h2 {
    font-size: 1.08rem;
    font-weight: 700;
  }

  .module-tag {
    font-family: ui-monospace, "SF Mono", monospace;
    font-size: 0.68rem;
    letter-spacing: 0.06em;
    color: var(--ink-faint);
  }

  .card {
    background: var(--paper-raised);
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 18px 20px;
    box-shadow: 0 1px 0 rgba(255,255,255,0.5) inset;
  }

  .bullets {
    margin: 0;
    padding: 0;
    list-style: none;
    display: grid;
    gap: 9px;
  }

  /* Absolute-positioned dot rather than a flex row: in a flex list item each text
     node becomes its own flex item, so a long <b> label (fine in Chinese, long in
     English and French) collapses into a narrow column beside the rest of the
     sentence. Normal inline flow lets the label and the text wrap together. */
  .bullets li {
    position: relative;
    padding-left: 14px;
    font-size: 0.88rem;
    line-height: 1.55;
    color: var(--ink);
  }

  .bullets li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.6em;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--accent-mid);
  }

  .bullets b { font-weight: 600; }
  .bullets .soft { color: var(--ink-soft); }

  .stat {
    font-family: ui-monospace, "SF Mono", monospace;
    font-variant-numeric: tabular-nums;
    color: var(--accent-deep);
    font-weight: 600;
  }

  /* ---------- motion module: sub-grid ---------- */
  .sub-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
  }

  .sub-card {
    background: var(--accent-wash);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 13px 15px;
  }

  .sub-card h3 {
    font-size: 0.82rem;
    font-weight: 700;
    margin-bottom: 7px;
    color: var(--accent-deep);
  }

  .sub-card p {
    margin: 0;
    font-size: 0.82rem;
    line-height: 1.5;
    color: var(--ink);
  }

  .sub-card .dances {
    margin: 8px 0 0;
    padding: 0;
    list-style: none;
    display: grid;
    gap: 5px;
  }

  .sub-card .dances li {
    font-size: 0.78rem;
    color: var(--ink-soft);
  }

  .sub-card .dances b { color: var(--ink); font-weight: 600; }

  /* ---------- value banner ---------- */
  .value {
    position: relative;
    margin-top: 8px;
    padding: 28px 28px 30px 60px;
    border-radius: 20px;
    background: linear-gradient(135deg, var(--accent-deep), var(--accent-mid) 85%);
    color: #f4fbff;
    box-shadow: 0 18px 34px -16px var(--shadow);
  }

  .value::before {
    content: '';
    position: absolute;
    left: -27px;
    top: -22px;
    width: 2px;
    height: 32px;
    background: var(--line-strong);
  }

  .value .eyebrow { color: #d8ecfb; }

  .value h2 {
    font-size: 1.15rem;
    font-weight: 700;
    margin: 6px 0 10px;
    color: #ffffff;
  }

  .value p {
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.7;
    color: #eaf5fd;
    max-width: 68ch;
  }

  .value strong {
    color: #fff;
    background: rgba(255,255,255,0.16);
    padding: 0 4px;
    border-radius: 4px;
  }

  /* ---------- footer link to the deep-dive doc ---------- */
  .deeper {
    margin-top: 30px;
    padding-top: 18px;
    border-top: 1px solid var(--line);
    font-size: 0.85rem;
    line-height: 1.6;
    color: var(--ink-soft);
  }

  .deeper a {
    color: var(--accent-deep);
    font-weight: 600;
    text-decoration: none;
    border-bottom: 1px solid var(--accent-light);
  }

  .deeper a:hover { border-bottom-color: var(--accent-deep); }

  @media (max-width: 640px) {
    .page { padding: 44px 16px 72px; }
    .sub-grid { grid-template-columns: 1fr; }
    .value { padding: 24px 20px 26px 44px; }
  }

  @media (prefers-reduced-motion: no-preference) {
    .module { animation: rise 0.5s ease backwards; }
    .module:nth-of-type(1) { animation-delay: 0.02s; }
    .module:nth-of-type(2) { animation-delay: 0.08s; }
    .module:nth-of-type(3) { animation-delay: 0.14s; }
    .module:nth-of-type(4) { animation-delay: 0.2s; }
    .module:nth-of-type(5) { animation-delay: 0.26s; }
    .module:nth-of-type(6) { animation-delay: 0.32s; }
    .module:nth-of-type(7) { animation-delay: 0.38s; }
  }

  @keyframes rise {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
  }

/* ---------- language switcher ---------- */
.langbar {
  display: flex;
  gap: 6px;
  margin-bottom: 26px;
  font-family: ui-monospace, "SF Mono", monospace;
  font-size: 0.7rem;
}

.langbar a,
.langbar span {
  padding: 3px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  text-decoration: none;
  color: var(--ink-faint);
}

.langbar a:hover { border-color: var(--accent-mid); color: var(--accent-deep); }

.langbar span[aria-current] {
  border-color: var(--accent-mid);
  background: var(--accent-wash);
  color: var(--accent-deep);
  font-weight: 600;
}
