@font-face {
  font-family: "Door";
  src: url("./fonts/petrona-latin-ext-800-normal.woff2") format("woff2");
  font-weight: 800;
  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: "Door";
  src: url("./fonts/petrona-latin-800-normal.woff2") format("woff2");
  font-weight: 800;
  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: "Whey";
  src: url("./fonts/spectral-latin-ext-400-normal.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: "Whey";
  src: url("./fonts/spectral-latin-400-normal.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: "Whey";
  src: url("./fonts/spectral-latin-ext-400-italic.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: "Whey";
  src: url("./fonts/spectral-latin-400-italic.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: "Whey";
  src: url("./fonts/spectral-latin-ext-600-normal.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: "Whey";
  src: url("./fonts/spectral-latin-600-normal.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: "Tally";
  src: url("./fonts/ibm-plex-mono-latin-ext-400-normal.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: "Tally";
  src: url("./fonts/ibm-plex-mono-latin-400-normal.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: #e7eef0;
  --paper-2: #d5e0e2;
  --ink: #17201e;
  --muted: #4a5854;
  --wool: #b51d1d;
  --wool-deep: #8a1515;
  --iron: #1c1916;
  --water: #7f9e9a;
  --wax: #c9a35a;
  --linen: #f4f7f6;
  --door: #3b2a22;
  --plank: #5c4033;
  --rule: color-mix(in srgb, var(--ink) 16%, transparent);
  --focus: var(--wool);
  color-scheme: light;
}

html[data-theme="dark"] {
  --paper: #121816;
  --paper-2: #1a2320;
  --ink: #e6eeea;
  --muted: #a7b6b1;
  --wool: #e24a3a;
  --wool-deep: #c43328;
  --iron: #0c0e0d;
  --water: #8fb3ae;
  --wax: #e0c27a;
  --linen: #1e2825;
  --door: #6b4e40;
  --plank: #8a6a58;
  --rule: color-mix(in srgb, var(--ink) 18%, transparent);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 3.6rem; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: Whey, "Source Serif 4", "Times New Roman", serif;
  font-size: 1.125rem;
  line-height: 1.55;
  font-optical-sizing: auto;
}

a { color: inherit; }
cite { font-style: italic; }

.skip-link {
  position: absolute;
  left: 0.75rem;
  top: -3rem;
  background: var(--ink);
  color: var(--paper);
  padding: 0.4rem 0.7rem;
  z-index: 20;
}
.skip-link:focus { top: 0.75rem; }

.wrap {
  width: min(1120px, calc(100% - 2rem));
  margin-inline: auto;
}
.col { max-width: 42rem; }

.top {
  position: sticky;
  top: 0;
  z-index: 10;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--rule);
}
.top-in {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
  min-height: 3.1rem;
  font-family: Tally, ui-monospace, monospace;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.top-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem 1rem;
  align-items: center;
}
.brand { text-decoration: none; font-weight: 400; white-space: nowrap; }
.lang { display: flex; gap: 0.6rem; }
.lang a[aria-current="page"] { color: var(--wool); }
.theme-btn {
  background: none;
  border: 0;
  color: inherit;
  font: inherit;
  text-transform: inherit;
  letter-spacing: inherit;
  cursor: pointer;
  padding: 0;
}
.theme-btn[aria-pressed="true"] { color: var(--wool); }

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(220px, 0.7fr);
  gap: 2rem 3rem;
  align-items: end;
  padding: 2.4rem 0 2.2rem;
}
.kicker {
  margin: 0 0 0.8rem;
  font-family: Tally, ui-monospace, monospace;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--wool);
}
h1 {
  margin: 0;
  font-family: Door, Petrona, serif;
  font-weight: 800;
  font-size: clamp(3.2rem, 11vw, 7.2rem);
  line-height: 0.92;
  letter-spacing: -0.03em;
  max-width: 11ch;
}
.standfirst {
  margin: 1.3rem 0 0;
  font-size: 1.28rem;
  line-height: 1.4;
  max-width: 38rem;
}
.byline {
  margin: 1rem 0 0;
  font-family: Tally, ui-monospace, monospace;
  font-size: 0.78rem;
  color: var(--muted);
  letter-spacing: 0.02em;
}
.stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.85rem 1.4rem;
  margin: 1.6rem 0 0;
  padding: 0;
}
.stat b {
  display: block;
  font-family: Door, Petrona, serif;
  font-size: 1.35rem;
  line-height: 1.1;
  font-weight: 800;
}
.stat span {
  display: block;
  margin-top: 0.15rem;
  font-family: Tally, ui-monospace, monospace;
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.hero-door {
  justify-self: end;
  width: min(100%, 280px);
}
.hero-door svg { width: 100%; height: auto; display: block; }
.hero-door .frame { fill: none; stroke: var(--door); stroke-width: 4; }
.hero-door .leaf { fill: var(--door); }
.hero-door .wool { fill: var(--wool); }
.hero-door .sill { fill: var(--plank); }
.hero-door .gap { fill: var(--paper-2); }

.page-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem 1.1rem;
  padding: 0.9rem 0 1.4rem;
  border-top: 1px solid var(--rule);
  font-family: Tally, ui-monospace, monospace;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.page-nav a { text-decoration: none; color: var(--muted); }
.page-nav a:hover { color: var(--ink); }

section { padding: 2.6rem 0; scroll-margin-top: 3.6rem; }
section + section { border-top: 1px solid var(--rule); }
.snum {
  display: block;
  font-family: Tally, ui-monospace, monospace;
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  color: var(--wool);
  margin-bottom: 0.4rem;
}
h2 {
  margin: 0 0 1rem;
  font-family: Door, Petrona, serif;
  font-size: clamp(1.8rem, 4.4vw, 2.7rem);
  line-height: 1.12;
  letter-spacing: -0.02em;
  font-weight: 800;
}
h3 {
  margin: 1.6rem 0 0.6rem;
  font-family: Door, Petrona, serif;
  font-size: 1.35rem;
  font-weight: 800;
}
.lede {
  font-size: 1.22rem;
  line-height: 1.4;
  margin: 0 0 1rem;
}
p { margin: 0 0 1rem; }
.quote {
  margin: 1.3rem 0;
  padding: 0 0 0 1rem;
  border-left: 3px solid var(--wool);
  font-size: 1.18rem;
  line-height: 1.4;
}
.quote footer {
  margin-top: 0.55rem;
  font-family: Tally, ui-monospace, monospace;
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.house-panel {
  margin-top: 1.4rem;
  padding: 1.1rem 0 0;
}
.house-grid {
  display: grid;
  grid-template-columns: minmax(220px, 0.9fr) minmax(0, 1.2fr);
  gap: 1.6rem 2rem;
  align-items: start;
}
.house-stage {
  background: var(--paper-2);
  padding: 1.2rem 1.1rem 0.9rem;
}
.house-svg { width: 100%; height: auto; display: block; }
.house-svg .wall { fill: none; stroke: var(--door); stroke-width: 3; }
.house-svg .roof { fill: none; stroke: var(--door); stroke-width: 3; }
.house-svg .sill { fill: var(--plank); }
.house-svg .inside { fill: var(--linen); }
.house-svg .leaf {
  fill: var(--door);
  transition: fill 0.35s ease, opacity 0.35s ease;
}
.house-svg.is-open .leaf { fill: var(--linen); }
.house-svg .wool { fill: var(--wool); }
.house-svg .cradle { fill: none; stroke: var(--water); stroke-width: 2; }
.house-svg .child { fill: var(--wax); }
.house-svg.is-open .child { fill: var(--wool); }

.gate-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0 0 1rem;
}
.gate-tabs button {
  font-family: Tally, ui-monospace, monospace;
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border: 1px solid var(--rule);
  background: transparent;
  color: inherit;
  padding: 0.55rem 0.7rem;
  min-height: 2.75rem;
  cursor: pointer;
}
.gate-tabs button[aria-pressed="true"] {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}
.gate-readout .when {
  font-family: Door, Petrona, serif;
  font-size: 1.7rem;
  line-height: 1.1;
  margin: 0 0 0.2rem;
}
.gate-readout .day {
  font-family: Tally, ui-monospace, monospace;
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--wool);
  margin: 0 0 0.7rem;
}
.pass-list, .keep-list {
  margin: 0.4rem 0 0.9rem;
  padding-left: 1.1rem;
}
.pass-h, .keep-h {
  font-family: Tally, ui-monospace, monospace;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0.6rem 0 0.2rem;
}
.reset {
  font-family: Tally, ui-monospace, monospace;
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border: 0;
  background: none;
  color: var(--wool);
  padding: 0;
  cursor: pointer;
}
.live {
  font-family: Tally, ui-monospace, monospace;
  font-size: 0.75rem;
  color: var(--muted);
}
.house-hint { color: var(--muted); margin-top: 0; }

.openings {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.4rem 2rem;
  margin: 1.2rem 0 1.4rem;
}
.openings b {
  display: block;
  font-family: Door, Petrona, serif;
  font-size: 1.4rem;
  margin-bottom: 0.35rem;
}
.openings span { color: var(--muted); }

.sources { padding-left: 1.1rem; }
.sources a { color: var(--wool-deep); }
html[data-theme="dark"] .sources a { color: var(--wax); }
.note { color: var(--muted); font-size: 1rem; }

.site-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem 1.2rem;
  padding: 1.6rem 0 3rem;
  border-top: 1px solid var(--rule);
  font-family: Tally, ui-monospace, monospace;
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.back-top {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  background: var(--ink);
  color: var(--paper);
  text-decoration: none;
  font-family: Tally, ui-monospace, monospace;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.45rem 0.7rem;
  opacity: 0;
  pointer-events: none;
}
.back-top.is-on { opacity: 1; pointer-events: auto; }

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

@media (max-width: 820px) {
  .hero, .house-grid, .openings { grid-template-columns: 1fr; }
  .hero { padding-top: 1.6rem; }
  .hero-door { justify-self: start; width: 148px; }
  h1 { font-size: clamp(2.6rem, 14vw, 4.4rem); }
  .standfirst { font-size: 1.12rem; }
}

@media (max-width: 500px) {
  .top-in { align-items: flex-start; padding-top: 0.55rem; padding-bottom: 0.55rem; }
  .gate-tabs button { flex: 1 1 calc(50% - 0.4rem); }
}
