@font-face {
  font-family: "Vat";
  src: url("./fonts/fraunces-latin-ext-900.woff2") format("woff2");
  font-weight: 900;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF, U+0218-021B;
}
@font-face {
  font-family: "Vat";
  src: url("./fonts/fraunces-latin-900.woff2") format("woff2");
  font-weight: 900;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Woad";
  src: url("./fonts/newsreader-normal-400-latin-ext.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF, U+0218-021B;
}
@font-face {
  font-family: "Woad";
  src: url("./fonts/newsreader-normal-400-latin.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Woad";
  src: url("./fonts/newsreader-italic-400-latin-ext.woff2") format("woff2");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
  unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF, U+0218-021B;
}
@font-face {
  font-family: "Woad";
  src: url("./fonts/newsreader-italic-400-latin.woff2") format("woff2");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Woad";
  src: url("./fonts/newsreader-normal-600-latin-ext.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF, U+0218-021B;
}
@font-face {
  font-family: "Woad";
  src: url("./fonts/newsreader-normal-600-latin.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Pot";
  src: url("./fonts/red-hat-mono-normal-400-latin-ext.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF, U+0218-021B;
}
@font-face {
  font-family: "Pot";
  src: url("./fonts/red-hat-mono-normal-400-latin.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --paper: #f3ead4;
  --paper-2: #e7d9b8;
  --ink: #1c1410;
  --muted: #5c4a3a;
  --galban: #c9a227;
  --galban-deep: #9a7a14;
  --rosu: #8c2a28;
  --rosu-hot: #b43a32;
  --sovarf: #7a3d42;
  --woad: #3a5368;
  --arin: #2a211c;
  --copper: #a36a3a;
  --vat: #231c18;
  --line: color-mix(in srgb, var(--ink) 18%, var(--paper));
  --focus: var(--copper);
  color-scheme: light;
}

html[data-theme="dark"] {
  --paper: #1a1512;
  --paper-2: #241c18;
  --ink: #f0e4cc;
  --muted: #cbb79a;
  --galban: #e0b83a;
  --galban-deep: #c9a227;
  --rosu: #d45a52;
  --rosu-hot: #e07066;
  --sovarf: #c4897c;
  --woad: #8eabc0;
  --arin: #0e0b09;
  --copper: #d4a06a;
  --vat: #100d0b;
  --line: color-mix(in srgb, var(--ink) 16%, var(--paper));
  color-scheme: dark;
}

*,
*::before,
*::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: Woad, "Source Serif 4", Georgia, serif;
  font-size: 1.125rem;
  line-height: 1.55;
}
img, svg { max-width: 100%; display: block; }
a { color: var(--rosu); text-underline-offset: 0.18em; }
a:hover { color: var(--copper); }
:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
}
.skip-link {
  position: absolute;
  left: 1rem;
  top: -4rem;
  background: var(--ink);
  color: var(--paper);
  padding: 0.4rem 0.7rem;
  z-index: 20;
}
.skip-link:focus { top: 1rem; }
.wrap {
  width: min(44rem, calc(100% - 2rem));
  margin-inline: auto;
}
.wrap.wide { width: min(68rem, calc(100% - 2rem)); }
.col { display: grid; gap: 1rem; }
.top {
  position: sticky;
  top: 0;
  z-index: 8;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.top-in {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 0.7rem 0;
  font-family: Pot, ui-monospace, monospace;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.top-tools { display: flex; gap: 0.8rem; align-items: center; flex-wrap: wrap; }
.brand { color: var(--ink); text-decoration: none; font-weight: 500; }
.lang { display: flex; gap: 0.5rem; }
.lang a[aria-current="page"] { color: var(--ink); text-decoration: none; font-weight: 500; }
.theme-btn {
  font: inherit;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: transparent;
  color: var(--muted);
  border: 0;
  padding: 0.2rem 0;
  cursor: pointer;
}
.theme-btn[aria-pressed="true"] { color: var(--ink); }

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 1.6rem 2.2rem;
  align-items: start;
  padding: 1.8rem 0 1.4rem;
}
.kicker {
  margin: 0 0 0.8rem;
  font-family: Pot, ui-monospace, monospace;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--copper);
}
h1 {
  margin: 0;
  font-family: Vat, Fraunces, serif;
  font-weight: 900;
  font-size: clamp(3.2rem, 9vw, 6.4rem);
  line-height: 0.92;
  letter-spacing: -0.03em;
}
.standfirst {
  margin: 1.2rem 0 0;
  font-size: 1.28rem;
  max-width: 38rem;
}
.byline {
  margin: 1rem 0 0;
  font-family: Pot, ui-monospace, monospace;
  font-size: 0.78rem;
  color: var(--muted);
}
.stats {
  display: grid;
  gap: 0.85rem 1.5rem;
  grid-template-columns: 1fr 1fr;
  margin-top: 2rem;
  padding-top: 1.2rem;
  border-top: 1px solid var(--line);
  font-size: 0.95rem;
}
.stat b {
  display: block;
  font-family: Vat, Fraunces, serif;
  font-size: 1.35rem;
  font-weight: 900;
  color: var(--rosu);
}
.stat span { color: var(--muted); }

.skein-hero {
  width: 7.2rem;
  height: 21rem;
  margin-top: 1.6rem;
}
.skein {
  width: 100%;
  height: 100%;
}
.skein .strand {
  fill: none;
  stroke-linecap: round;
  stroke-width: 7;
  stroke: #efe6d4;
  transition: stroke 160ms linear;
}
.skein .wet { stroke: var(--copper); stroke-width: 2; opacity: 0.7; }
.skein[data-tone="white"] .strand { stroke: #efe6d4; }
.skein[data-tone="late"] .strand { stroke: #6a5344; }
.skein[data-tone="hemp"] .strand { stroke: #d7c7a4; }
.skein[data-tone="yellow-bright"] .strand { stroke: var(--galban); }
.skein[data-tone="yellow-stained"] .strand { stroke: #b0892a; }
.skein[data-tone="yellow-hemp"] .strand { stroke: #c47a3a; }
.skein[data-tone="blue-light"] .strand { stroke: #6d8aa0; }
.skein[data-tone="blue-dark"] .strand { stroke: var(--woad); }
.skein[data-tone="red-light"] .strand { stroke: #c45c4a; }
.skein[data-tone="red-bright"] .strand { stroke: var(--rosu-hot); }
.skein[data-tone="red-fail"] .strand { stroke: #c9a090; }
.skein[data-tone="hemp-red"] .strand { stroke: #a84a3a; }
.skein[data-tone="green-light"] .strand { stroke: #7a9a5a; }
.skein[data-tone="green-dark"] .strand { stroke: #3f5c38; }
.skein[data-tone="green-from-yellow"] .strand { stroke: #6e8f4e; }
.skein[data-tone="black"] .strand,
.skein[data-tone="black-late"] .strand { stroke: #2a211c; }
html[data-theme="dark"] .skein[data-tone="black"] .strand,
html[data-theme="dark"] .skein[data-tone="black-late"] .strand { stroke: #6a5c52; }
.skein[data-tone="stuck"] .strand { stroke: #8a7a68; }
.skein-hero .lo { stroke: var(--galban); }
.skein-hero .hi { stroke: var(--rosu); }

.page-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem 1.1rem;
  padding: 0.4rem 0 2.4rem;
  font-family: Pot, ui-monospace, monospace;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.page-nav a { color: var(--muted); text-decoration: none; }
.page-nav a:hover { color: var(--ink); }

section { padding: 3.2rem 0; }
section + section { border-top: 1px solid var(--line); }
.snum {
  font-family: Pot, ui-monospace, monospace;
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--copper);
}
h2 {
  margin: 0.25rem 0 0.6rem;
  font-family: Vat, Fraunces, serif;
  font-weight: 900;
  font-size: clamp(1.8rem, 4vw, 2.7rem);
  line-height: 1.05;
  letter-spacing: -0.02em;
}
h3 {
  margin: 1.4rem 0 0.5rem;
  font-size: 1.1rem;
}
.lede {
  font-size: 1.2rem;
  margin: 0;
}
p { margin: 0; }
.quote {
  margin: 0.4rem 0;
  padding: 0 0 0 1rem;
  border-left: 3px solid var(--galban);
  font-style: italic;
}
.quote footer {
  margin-top: 0.5rem;
  font-style: normal;
  font-family: Pot, ui-monospace, monospace;
  font-size: 0.78rem;
  color: var(--muted);
}

.vat-scene {
  background: var(--vat);
  color: #f0e4cc;
  border-top: 0;
  border-bottom: 0;
}
.vat-scene a { color: var(--galban); }
.vat-scene .snum,
.vat-scene .quote footer,
.vat-scene .bath-matter,
.vat-scene .live { color: #d4b48a; }
.vat-scene h2 { color: #f7edd8; }
.vat-scene .quote { border-left-color: var(--rosu-hot); }

.bath {
  margin-top: 1.6rem;
  display: grid;
  grid-template-columns: 8.5rem 1fr;
  gap: 1.6rem;
  align-items: start;
}
.bath-stage {
  display: grid;
  justify-items: center;
  gap: 0.7rem;
}
.bath-stage .skein { height: 16rem; width: 5.5rem; }
.tone-name {
  font-family: Pot, ui-monospace, monospace;
  font-size: 0.75rem;
  text-align: center;
  color: var(--galban);
}
.controls { display: grid; gap: 1rem; }
.row { display: flex; flex-wrap: wrap; gap: 0.45rem; }
legend, .lab {
  font-family: Pot, ui-monospace, monospace;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 0.35rem;
}
fieldset {
  border: 0;
  margin: 0;
  padding: 0;
}
.chip, .dip, .ghost, .preset {
  font-family: Pot, ui-monospace, monospace;
  font-size: 0.82rem;
  letter-spacing: 0.03em;
  border: 1px solid color-mix(in srgb, currentColor 35%, transparent);
  background: transparent;
  color: inherit;
  padding: 0.45rem 0.7rem;
  cursor: pointer;
}
.chip[aria-pressed="true"],
.preset[aria-pressed="true"] {
  background: var(--galban);
  color: #1c1410;
  border-color: var(--galban);
}
.dip {
  background: var(--rosu);
  color: #f7edd8;
  border-color: var(--rosu);
}
.ghost { color: var(--muted); }
.bath-matter {
  margin: 0;
  font-size: 0.95rem;
  color: var(--muted);
}
.path {
  margin: 0;
  font-family: Pot, ui-monospace, monospace;
  font-size: 0.82rem;
}
.live {
  margin: 0;
  min-height: 3.2em;
}
.names {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.8rem;
  margin: 1.2rem 0 0;
  padding: 0;
  list-style: none;
  font-family: Pot, ui-monospace, monospace;
  font-size: 0.86rem;
}
.names li { color: var(--sovarf); }
.caption {
  margin-top: 0.8rem;
  font-size: 0.95rem;
  color: var(--muted);
}
.sources { padding-left: 1.1rem; display: grid; gap: 0.5rem; }
.note { color: var(--muted); font-size: 0.98rem; }
.site-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem 1.2rem;
  padding: 2rem 0 3rem;
  font-family: Pot, ui-monospace, monospace;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}
.back-top {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  opacity: 0;
  pointer-events: none;
  background: var(--ink);
  color: var(--paper);
  text-decoration: none;
  font-family: Pot, ui-monospace, monospace;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.45rem 0.65rem;
}
.back-top.is-on { opacity: 1; pointer-events: auto; }

@media (max-width: 720px) {
  .hero {
    grid-template-columns: minmax(0, 1fr) 4.6rem;
    padding-top: 1.2rem;
  }
  .skein-hero {
    width: 4.6rem;
    height: 13rem;
    margin-top: 1.1rem;
  }
  .bath { grid-template-columns: 1fr; }
  .bath-stage { justify-items: start; grid-template-columns: auto 1fr; align-items: center; }
  .bath-stage .skein { height: 11rem; }
  .stats { grid-template-columns: 1fr; }
  h1 { font-size: clamp(2.5rem, 13vw, 3.5rem); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .skein .strand { transition: none; }
}
