  :root {
    --paper: #faf8f4;
    --ink: #1c1a17;
    --muted: #6b6359;
    --line: #e0dace;
    --thread: #a8443a;
    --thread-soft: #c97b6f;
    --accent-bg: #f2ede4;
    --zone: #3c6e63;
    --zone-soft: #a9c4bc;
  }

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

  html { scroll-behavior: smooth; }

  body {
    background: var(--paper);
    color: var(--ink);
    font-family: 'Iowan Old Style', 'Palatino Linotype', Palatino, Georgia, serif;
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
  }

  .tnum { font-variant-numeric: tabular-nums; }

  /* ─── PASSWORD GATE ─────────────────────────── */
  #gate {
    position: fixed;
    inset: 0;
    background: var(--paper);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    padding: 2rem;
    transition: opacity 0.6s ease;
  }
  #gate.hidden { opacity: 0; pointer-events: none; }

  .gate-inner { max-width: 360px; width: 100%; text-align: center; }
  .gate-mark {
    width: 44px; height: 44px;
    margin: 0 auto 2rem;
    position: relative;
  }
  .gate-mark::before {
    content: '';
    position: absolute;
    inset: 0;
    border: 1.5px solid var(--thread);
    border-radius: 50%;
  }
  .gate-mark::after {
    content: '';
    position: absolute;
    left: 50%; top: 50%;
    width: 1.5px; height: 60%;
    background: var(--thread);
    transform: translate(-50%, -50%) rotate(28deg);
  }
  #gate h1 {
    font-size: 1.05rem;
    font-weight: 400;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 2rem;
  }
  #gate input {
    width: 100%;
    padding: 0.85rem 1rem;
    border: 1px solid var(--line);
    background: #fff;
    font-family: inherit;
    font-size: 1rem;
    color: var(--ink);
    text-align: center;
    letter-spacing: 0.05em;
    outline: none;
    transition: border-color 0.25s;
  }
  #gate input:focus { border-color: var(--thread); }
  #gate button {
    margin-top: 1rem;
    width: 100%;
    padding: 0.85rem;
    border: none;
    background: var(--ink);
    color: var(--paper);
    font-family: inherit;
    font-size: 0.9rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    cursor: pointer;
    transition: background 0.25s;
  }
  #gate button:hover { background: var(--thread); }
  #gate .err {
    margin-top: 1rem;
    color: var(--thread);
    font-size: 0.85rem;
    min-height: 1.2em;
    opacity: 0;
    transition: opacity 0.2s;
  }
  #gate .err.show { opacity: 1; }

  /* ─── CONTENT ───────────────────────────────── */
  #content { opacity: 0; transition: opacity 0.8s ease 0.2s; }
  #content.visible { opacity: 1; }

  .wrap { max-width: 920px; margin: 0 auto; padding: 0 2rem; }

  nav.tabs {
    position: sticky; top: 0; z-index: 50;
    background: var(--paper);
    border-bottom: 1px solid var(--line);
    padding: 1.1rem 0;
  }
  nav.tabs .wrap { display: flex; gap: 1.8rem; align-items: center; flex-wrap: wrap; }
  nav.tabs .site-name { font-size: 0.85rem; letter-spacing: 0.08em; color: var(--muted); margin-right: auto; }
  nav.tabs a { font-size: 0.82rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); text-decoration: none; padding-bottom: 2px; border-bottom: 1px solid transparent; }
  nav.tabs a:hover, nav.tabs a.active { color: var(--ink); border-bottom-color: var(--thread); }

  /* Hero */
  header.hero {
    padding: 12vh 0 9vh;
    border-bottom: 1px solid var(--line);
  }
  .eyebrow {
    font-size: 0.78rem;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--thread);
    margin-bottom: 1.5rem;
  }
  .hero h1 {
    font-size: clamp(2.6rem, 6.4vw, 4.4rem);
    font-weight: 400;
    line-height: 1.05;
    letter-spacing: -0.02em;
    margin-bottom: 1.5rem;
  }
  .hero .lead {
    font-size: clamp(1.05rem, 2vw, 1.3rem);
    color: var(--muted);
    max-width: 34em;
    font-style: italic;
  }
  .hero-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1px;
    background: var(--line);
    border: 1px solid var(--line);
    margin-top: 4rem;
  }
  .hero-stat { background: var(--paper); padding: 1.4rem 1.2rem; }
  .hero-stat .n { font-size: 1.5rem; color: var(--zone); }
  .hero-stat .l { font-size: 0.72rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); margin-top: 0.3rem; }

  /* Section heads */
  .section { padding: 9vh 0; border-bottom: 1px solid var(--line); }
  .section-label {
    font-size: 0.78rem;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 3rem;
    display: flex;
    align-items: center;
    gap: 1rem;
  }
  .section-label::before {
    content: '';
    width: 28px; height: 1px;
    background: var(--thread);
  }

  /* Thread / philosophy statement */
  .thread-statement {
    font-size: clamp(1.4rem, 3.2vw, 2rem);
    line-height: 1.4;
    font-weight: 400;
    max-width: 26em;
  }
  .thread-statement em { color: var(--thread); font-style: italic; }
  .thread-statement + .sub { margin-top: 2rem; max-width: 34em; color: var(--muted); font-size: 1rem; }

  .principle-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1px;
    background: var(--line);
    border: 1px solid var(--line);
    margin-top: 3rem;
  }
  .principle { background: var(--paper); padding: 1.8rem; }
  .principle h4 { font-size: 1rem; font-weight: 400; color: var(--zone); margin-bottom: 0.5rem; }
  .principle p { font-size: 0.92rem; color: var(--muted); }

  /* Zones */
  .zone-item {
    border-top: 1px solid var(--line);
    padding: 2rem 0;
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 2rem;
  }
  .zone-item:first-child { border-top: none; }
  .zone-head h4 { font-size: 1.25rem; font-weight: 400; }
  .zone-head .range { font-size: 0.88rem; color: var(--muted); margin-top: 0.2rem; }
  .zone-head .bar { height: 6px; background: var(--accent-bg); margin-top: 1rem; position: relative; }
  .zone-head .bar i { position: absolute; left: 0; top: 0; bottom: 0; background: var(--zone-fill, var(--zone)); border-radius: 2px; }
  .zone-cols { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.4rem; }
  .zone-cols div h5 { font-size: 0.72rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); margin-bottom: 0.4rem; font-weight: 400; }
  .zone-cols div p { font-size: 0.9rem; }

  /* Week list */
  .week-list { }
  .week-item {
    display: grid;
    grid-template-columns: 110px 1fr;
    gap: 1.8rem;
    padding: 1.6rem 0;
    border-top: 1px solid var(--line);
  }
  .week-item:first-child { border-top: none; }
  .week-item.rest { opacity: 0.6; }
  .week-day { font-size: 0.95rem; color: var(--thread); padding-top: 0.15rem; }
  .week-day .flex { display: block; font-size: 0.72rem; color: var(--muted); font-style: italic; margin-top: 0.2rem; }
  .week-body h4 { font-size: 1.1rem; font-weight: 400; margin-bottom: 0.15rem; }
  .week-body .tag { font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--zone); display: block; margin-bottom: 0.7rem; }
  .week-body .fx { display: grid; grid-template-columns: 1fr 1fr; gap: 1.4rem; margin-top: 0.6rem; }
  .week-body .fx div h5 { font-size: 0.72rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); margin-bottom: 0.3rem; font-weight: 400; }
  .week-body .fx div p { font-size: 0.9rem; }

  /* Reference session cards */
  .ref-card { border-top: 1px solid var(--line); padding: 3rem 0; }
  .ref-card:first-child { border-top: none; padding-top: 0; }
  .ref-head { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 1rem; }
  .ref-head h3 { font-size: 1.5rem; font-weight: 400; }
  .ref-head .tag { font-size: 0.75rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--thread); }
  .ref-desc { color: var(--muted); max-width: 40em; margin-bottom: 2rem; font-size: 0.97rem; }

  .ref-body { display: grid; grid-template-columns: 1fr 1.4fr; gap: 2.5rem; }
  .ref-now { }
  .ref-now .big { font-size: 2.4rem; color: var(--ink); }
  .ref-now .big small { font-size: 1rem; color: var(--muted); font-weight: 400; }
  .ref-now .meta { font-size: 0.85rem; color: var(--muted); margin-top: 0.4rem; }

  .trend { }
  .trend-row {
    display: grid;
    grid-template-columns: 128px 1fr 70px 60px;
    gap: 0.8rem;
    align-items: center;
    padding: 0.5rem 0;
    border-top: 1px solid var(--line);
    font-size: 0.86rem;
  }
  .trend-row:first-child { border-top: none; }
  .trend-row .date { color: var(--muted); }
  .trend-row .bar-track { height: 5px; background: var(--accent-bg); position: relative; }
  .trend-row .bar-fill { position: absolute; left: 0; top: 0; bottom: 0; background: var(--zone-soft); }
  .trend-row .pace { text-align: right; }
  .trend-row .hr { text-align: right; color: var(--muted); }
  .trend-note { margin-top: 1rem; font-size: 0.82rem; color: var(--muted); font-style: italic; }

  /* Race timeline */
  .race-timeline { position: relative; }
  .race-item {
    display: grid;
    grid-template-columns: 70px 1fr auto;
    gap: 1.5rem;
    padding: 1.3rem 0;
    border-top: 1px solid var(--line);
    align-items: baseline;
  }
  .race-item:first-child { border-top: none; }
  .race-item .year { font-size: 0.95rem; color: var(--thread); }
  .race-item .name { font-size: 1.02rem; }
  .race-item .name .sub { display: block; font-size: 0.82rem; color: var(--muted); margin-top: 0.15rem; }
  .race-item .time { font-size: 1.15rem; text-align: right; white-space: nowrap; }
  .race-item.goal .time { color: var(--zone); }
  .race-item.goal .name { color: var(--muted); font-style: italic; }

  /* Status now */
  .status-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1px;
    background: var(--line);
    border: 1px solid var(--line);
  }
  .status-item { background: var(--paper); padding: 1.8rem; }
  .status-item .n { font-size: 1.7rem; }
  .status-item .l { font-size: 0.72rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); margin-top: 0.4rem; }
  .status-item .d { font-size: 0.85rem; color: var(--muted); margin-top: 0.6rem; }

  /* Update note */
  .update-note {
    background: var(--accent-bg);
    border: 1px solid var(--line);
    padding: 1.6rem 1.8rem;
    font-size: 0.9rem;
    color: var(--muted);
  }
  .update-note strong { color: var(--ink); font-weight: 400; }
  .update-note .stamp { display: block; margin-top: 0.8rem; font-size: 0.78rem; letter-spacing: 0.05em; }

  footer {
    padding: 8vh 0;
    text-align: center;
    color: var(--muted);
    font-size: 0.85rem;
  }
  footer .mark {
    width: 30px; height: 30px;
    margin: 0 auto 1.5rem;
    position: relative;
  }
  footer .mark::before {
    content: '';
    position: absolute; inset: 0;
    border: 1px solid var(--thread);
    border-radius: 50%;
  }
  footer .mark::after {
    content: '';
    position: absolute; left: 50%; top: 50%;
    width: 1px; height: 60%;
    background: var(--thread);
    transform: translate(-50%, -50%) rotate(28deg);
  }
  footer a { color: var(--muted); }

  /* Reveal on scroll */
  .reveal { opacity: 0; transform: translateY(20px); transition: opacity 0.7s ease, transform 0.7s ease; }
  .reveal.in { opacity: 1; transform: none; }

  @media (max-width: 720px) {
    .ref-body { grid-template-columns: 1fr; }
    .hero-stats, .status-grid, .principle-grid { grid-template-columns: 1fr 1fr; }
    .trend-row { grid-template-columns: 96px 1fr 56px; }
    .trend-row .hr { display: none; }
    .race-item { grid-template-columns: 50px 1fr; }
    .race-item .time { grid-column: 2; text-align: left; }
    .week-item { grid-template-columns: 1fr; gap: 0.6rem; }
    .week-body .fx { grid-template-columns: 1fr; gap: 0.9rem; }
    .zone-item { grid-template-columns: 1fr; gap: 1rem; }
    .zone-cols { grid-template-columns: 1fr; gap: 0.9rem; }
  }

  @media (max-width: 480px) {
    .hero-stats, .status-grid, .principle-grid { grid-template-columns: 1fr; }
    .wrap { padding: 0 1.4rem; }
  }

  @media (prefers-reduced-motion: reduce) {
    * { transition: none !important; scroll-behavior: auto; }
    .reveal { opacity: 1; transform: none; }
  }
