:root {
  --paper: #f3ead3;
  --paper-2: #efe4c8;
  --ink: #1c1914;
  --ink-soft: #3a342c;
  --rule: #c9b48a;
  --rule-heavy: #1c1914;
  --maroon: #7a1f1f;
  --maroon-deep: #541616;
  --amber: #c47a12;
  --forest: #2a4538;
  --chip: #efe6d2;
  --muted: #5c554b;
  --danger: #7a1f1f;
  --live: #7a1f1f;
  --max: 1120px;
  --display: "Abril Fatface", "Times New Roman", serif;
  --serif: "Newsreader", "Georgia", "Times New Roman", serif;
  --mono: "IBM Plex Mono", "ui-monospace", "Menlo", monospace;
  --fraunces: "Fraunces", "Newsreader", Georgia, serif;
}

*,
*::before,
*::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 18px;
  line-height: 1.55;
  font-optical-sizing: auto;
}

body {
  min-height: 100vh;
  background-image:
    linear-gradient(180deg, rgba(28, 25, 20, 0.03), transparent 180px),
    repeating-linear-gradient(
      90deg,
      transparent 0,
      transparent 31px,
      rgba(201, 180, 138, 0.18) 31px,
      rgba(201, 180, 138, 0.18) 32px
    );
  background-attachment: fixed;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--maroon); text-underline-offset: 3px; }
a:hover { color: var(--maroon-deep); }

.skip {
  position: absolute;
  left: 12px;
  top: -48px;
  background: var(--ink);
  color: var(--paper);
  padding: 8px 12px;
  z-index: 80;
  font-family: var(--mono);
  font-size: 13px;
}
.skip:focus { top: 12px; }

/* Masthead — newspaper, not a sticky app bar */
.masthead {
  max-width: var(--max);
  margin: 0 auto;
  padding: 18px 22px 0;
}

.edition-bar {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  border-top: 2px solid var(--rule-heavy);
  border-bottom: 1px solid var(--rule);
  padding: 6px 0;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.clocks {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 18px;
}

.clocks time {
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.clocks .tz {
  color: var(--muted);
  margin-right: 4px;
}

.brand-row {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
  padding: 16px 0 10px;
  border-bottom: 3px double var(--rule-heavy);
}

.brand {
  grid-column: 2;
  text-decoration: none;
  color: var(--ink);
  text-align: center;
}

.brand-mark {
  width: 36px;
  height: 36px;
  margin: 0 auto 4px;
}

.brand-name {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(42px, 8vw, 86px);
  line-height: 0.9;
  letter-spacing: 0;
}

.brand-tag {
  display: block;
  margin-top: 4px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--maroon);
}

.deck-note {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.deck-note.left { text-align: left; }
.deck-note.right { text-align: right; }

.nav-rack {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 0;
  justify-content: center;
  padding: 10px 0 14px;
  border-bottom: 1px solid var(--rule);
  font-family: var(--fraunces);
  font-size: 15px;
}

.nav-rack a,
.nav-rack summary {
  display: inline-block;
  padding: 4px 12px;
  color: var(--ink);
  text-decoration: none;
  cursor: pointer;
  list-style: none;
}
.nav-rack summary::-webkit-details-marker { display: none; }
.nav-rack a[aria-current="page"],
.nav-rack a:hover,
.nav-rack summary:hover {
  color: var(--maroon);
  text-decoration: underline;
}

.nav-drop {
  position: relative;
}
.nav-drop .menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 220px;
  background: var(--paper);
  border: 1px solid var(--ink);
  padding: 8px 0;
  z-index: 20;
  box-shadow: 4px 4px 0 rgba(28, 25, 20, 0.12);
}
.nav-drop[open] .menu { display: grid; }
.nav-drop .menu a {
  padding: 6px 14px;
  font-size: 14px;
}

.nav-toggle {
  display: none;
  margin: 8px auto 0;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  background: transparent;
  border: 1px solid var(--ink);
  padding: 6px 12px;
  cursor: pointer;
}

/* Page frame */
.frame {
  max-width: var(--max);
  margin: 0 auto;
  padding: 28px 22px 64px;
}

.crumbs {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 18px;
}
.crumbs ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.crumbs li:not(:last-child)::after { content: " /"; color: var(--rule); margin-left: 6px; }
.crumbs a { color: inherit; }

.kicker {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--maroon);
  margin: 0 0 8px;
}

h1, h2, h3 {
  font-family: var(--fraunces);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin: 0 0 12px;
}

h1 {
  font-size: clamp(32px, 5vw, 52px);
  max-width: 22ch;
}

.lede {
  font-size: 1.15rem;
  max-width: 62ch;
  color: var(--ink-soft);
  margin: 0 0 28px;
}

.prose { max-width: 68ch; }
.prose p { margin: 0 0 1em; }
.prose h2 { margin: 1.6em 0 0.5em; font-size: 1.45rem; }
.prose h3 { margin: 1.2em 0 0.4em; font-size: 1.15rem; }
.prose ul, .prose ol { margin: 0 0 1em; padding-left: 1.2em; }
.prose li { margin: 0 0 0.4em; }

.split {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 36px;
  align-items: start;
}

.folio {
  border: 1px solid var(--ink);
  background: var(--paper-2);
  padding: 16px 18px;
}
.folio h2 { font-size: 1.15rem; }
.folio p, .folio li { font-size: 0.95rem; }
.folio ol { margin: 0; padding-left: 1.15em; }

/* Daypart timetable */
.timetable {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
  margin: 12px 0 28px;
}
.timetable th,
.timetable td {
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--rule);
  padding: 10px 8px;
}
.timetable th {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 500;
  border-bottom: 2px solid var(--ink);
}
.timetable .when {
  font-family: var(--mono);
  font-size: 12px;
  white-space: nowrap;
  color: var(--ink-soft);
}
.timetable a { font-family: var(--fraunces); font-weight: 600; text-decoration: none; }
.timetable a:hover { text-decoration: underline; }
.timetable tr.is-now td { background: rgba(196, 122, 18, 0.16); }

/* Link chips / related */
.chip-row, .card-row {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
  margin: 0 0 32px;
}
.chip, .story-card {
  display: block;
  background: var(--chip);
  border: 1px solid var(--rule);
  padding: 14px 16px;
  text-decoration: none;
  color: var(--ink);
}
.story-card:hover, .chip:hover { border-color: var(--ink); }
.story-card h3 { font-size: 1.15rem; margin-bottom: 6px; }
.story-card p, .chip p { margin: 0; color: var(--ink-soft); font-size: 0.95rem; }
.chip strong { display: block; font-family: var(--fraunces); font-size: 1.05rem; margin-bottom: 4px; }

/* Live rack — listings, not neon cards */
.rack-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: baseline;
  border-top: 2px solid var(--ink);
  border-bottom: 1px solid var(--rule);
  padding: 10px 0;
  margin: 28px 0 12px;
}
.rack-head h2 { margin: 0; font-size: 1.4rem; }
.rack-status {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.live-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--live);
  margin-right: 6px;
  box-shadow: 0 0 0 0 rgba(122, 31, 31, 0.6);
  animation: pulse 1.8s ease-out infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(122, 31, 31, 0.5); }
  100% { box-shadow: 0 0 0 8px rgba(122, 31, 31, 0); }
}

.view-toggle {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: transparent;
  border: 1px solid var(--rule);
  padding: 4px 8px;
  cursor: pointer;
  color: var(--ink);
}
.view-toggle[aria-pressed="true"] { border-color: var(--ink); background: var(--paper-2); }

.rack {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px 16px;
}

.listing {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  border-bottom: 1px solid var(--rule);
  padding-bottom: 10px;
}
.listing:hover { color: inherit; }
.listing-still {
  position: relative;
  aspect-ratio: 4 / 3;
  background: #ddd3b8;
  overflow: hidden;
  border: 1px solid var(--rule);
  margin-bottom: 8px;
}
.listing-still img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: sepia(0.18) contrast(1.05);
}
.flags {
  position: absolute;
  left: 6px;
  top: 6px;
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}
.flag {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  background: var(--paper);
  color: var(--ink);
  border: 1px solid var(--ink);
  padding: 2px 5px;
}
.flag-live { background: var(--maroon); color: var(--paper); border-color: var(--maroon); }
.flag-private { background: var(--amber); border-color: var(--amber); color: #1c1914; }

.listing-name {
  font-family: var(--fraunces);
  font-weight: 600;
  font-size: 1.02rem;
}
.listing-sub {
  font-size: 0.88rem;
  color: var(--ink-soft);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.listing-viewers {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 4px;
}

/* Listings (text) mode */
.rack.is-text {
  display: block;
  border-top: 1px solid var(--rule);
}
.rack.is-text .listing {
  display: grid;
  grid-template-columns: 120px 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--rule);
}
.rack.is-text .listing-still {
  width: 120px;
  margin: 0;
  aspect-ratio: 16 / 10;
}
.rack.is-text .flags { position: static; }

.rooms-loading, .rooms-empty, .rooms-error {
  font-family: var(--serif);
  color: var(--ink-soft);
  grid-column: 1 / -1;
}

/* Glossary */
.glossary dt {
  font-family: var(--fraunces);
  font-weight: 600;
  font-size: 1.15rem;
  margin-top: 1.2em;
}
.glossary dd { margin: 0.3em 0 0; max-width: 68ch; }

/* FAQ */
.faq details {
  border-bottom: 1px solid var(--rule);
  padding: 10px 0;
}
.faq summary {
  font-family: var(--fraunces);
  font-weight: 600;
  cursor: pointer;
}
.faq .ans { margin: 8px 0 4px; max-width: 68ch; }

/* Code / embed */
pre, code {
  font-family: var(--mono);
  font-size: 0.82rem;
}
pre {
  background: #1c1914;
  color: #f3ead3;
  padding: 14px 16px;
  overflow: auto;
  border: 1px solid var(--ink);
}

/* Colophon */
.colophon {
  background: #1c1914;
  color: #efe4c8;
  padding: 36px 22px 48px;
  font-size: 0.92rem;
}
.colophon a { color: #f0c36a; }
.colophon-inner {
  max-width: var(--max);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.4fr repeat(3, 1fr);
  gap: 24px;
}
.colophon h2 {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #c9b48a;
  margin: 0 0 10px;
}
.colophon ul { list-style: none; margin: 0; padding: 0; }
.colophon li { margin: 0 0 6px; }
.colophon .notes { grid-column: 1 / -1; border-top: 1px solid #3a342c; padding-top: 16px; color: #cfc3a6; font-size: 0.85rem; }
.colophon .notes p { margin: 0 0 0.6em; }
.wordmark-small {
  font-family: var(--display);
  font-size: 36px;
  color: #f3ead3;
  line-height: 1;
  margin-bottom: 8px;
}

/* Age cover — a front page, not a dark modal */
.age-cover {
  display: none;
  position: fixed;
  inset: 0;
  background: var(--paper);
  z-index: 100;
  overflow: auto;
}
.age-cover.is-open { display: block; }
.age-inner {
  max-width: 640px;
  margin: 8vh auto;
  padding: 24px;
  text-align: center;
  border-top: 3px double var(--ink);
  border-bottom: 3px double var(--ink);
}
.age-inner .brand-name { font-size: 64px; }
.age-inner h2 { font-size: 2rem; margin: 16px 0 10px; }
.age-actions { display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; margin-top: 20px; }
.age-actions button, .btn {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 10px 14px;
  border: 1px solid var(--ink);
  background: var(--maroon);
  color: var(--paper);
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
}
.age-actions .leave, .btn-ghost {
  background: transparent;
  color: var(--ink);
}

/* 404 */
.gone { text-align: left; padding: 8vh 0; }

@media (max-width: 900px) {
  .brand-row { grid-template-columns: 1fr; text-align: center; padding: 10px 0; }
  .deck-note { display: none; }
  .split, .colophon-inner { grid-template-columns: 1fr; }
  .nav-toggle { display: block; }
  .nav-rack { display: none; }
  .masthead.is-open .nav-rack {
    display: flex;
    flex-direction: column;
    align-items: stretch;
  }
  .nav-drop .menu { position: static; border: none; box-shadow: none; padding-left: 8px; }
  .rack.is-text .listing { grid-template-columns: 88px 1fr; }
  .rack.is-text .listing-viewers { grid-column: 2; }
}

@media (prefers-reduced-motion: reduce) {
  .live-dot { animation: none; }
  html { scroll-behavior: auto; }
}
