/* ═══════════════════════════════════════════════════════════
   SHERRI CUONO CITY — interface
   Annals-style chrome, re-cast in dark glass and dusk light.
   ═══════════════════════════════════════════════════════════ */

:root {
  --ink:      #0c141c;
  --glass:    rgba(12, 20, 28, 0.86);
  --paper:    rgba(16, 26, 36, 0.94);
  --text:     #eef4f6;
  --dim:      #9db0b8;
  --hair:     rgba(157, 176, 184, 0.22);
  --cyan:     #5fd8ff;
  --pink:     #ff9de4;
  --gold:     #ffcf80;
  --display: "Big Shoulders Display", sans-serif;
  --body:    "Overpass", sans-serif;
  --mono:    "IBM Plex Mono", monospace;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; }
body {
  font-family: var(--body);
  font-weight: 300;
  background: var(--ink);
  color: var(--text);
  overflow: hidden;
}
.mono { font-family: var(--mono); }
::selection { background: var(--cyan); color: var(--ink); }
button { cursor: pointer; }
button:focus-visible, a:focus-visible, input:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 2px;
}

#city { position: fixed; inset: 0; width: 100vw; height: 100vh; display: block; }

/* ── Chips (small framed buttons) ────────────────────────── */
.chip {
  font-size: 0.62rem;
  letter-spacing: 0.16em;
  color: var(--dim);
  background: var(--glass);
  border: 1px solid var(--hair);
  padding: 0.45rem 0.8rem;
  border-radius: 3px;
  transition: color 0.15s, border-color 0.15s;
}
.chip:hover { color: var(--cyan); border-color: var(--cyan); }
.chip-on { color: var(--gold); border-color: rgba(255, 207, 128, 0.5); }

/* ── Loading veil ────────────────────────────────────────── */
#veil {
  position: fixed; inset: 0; z-index: 40;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  text-align: center; padding: 2rem;
  background: radial-gradient(ellipse at 50% 110%, rgba(95, 216, 255, 0.1), transparent 55%), var(--ink);
  transition: opacity 1.1s ease;
}
#veil.gone { opacity: 0; pointer-events: none; }
.veil-eyebrow { font-size: 0.66rem; letter-spacing: 0.34em; color: var(--gold); margin-bottom: 1.2rem; }
.veil-title {
  font-family: var(--display);
  font-weight: 900;
  font-size: clamp(3.4rem, 11vw, 7.5rem);
  line-height: 0.9;
  text-transform: uppercase;
  background: linear-gradient(to bottom, #ffffff 25%, var(--cyan) 105%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.veil-sub { margin-top: 1.4rem; color: var(--dim); }
.veil-status { margin-top: 2.4rem; font-size: 0.62rem; letter-spacing: 0.26em; color: var(--cyan); }

/* ── Top bar ─────────────────────────────────────────────── */
#topbar {
  position: fixed; top: 0.8rem; left: 0.8rem; right: 0.8rem;
  z-index: 20;
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 0.8rem;
  pointer-events: none;
}
#topbar > * { pointer-events: auto; }
.tb-left, .tb-right { display: flex; gap: 0.5rem; padding-top: 0.2rem; }
.tb-center {
  background: var(--paper);
  border: 1px solid var(--hair);
  border-radius: 4px;
  padding: 0.55rem 1.3rem 0.6rem;
  text-align: center;
  box-shadow: 0 6px 30px rgba(0, 0, 0, 0.45);
}
.tb-title {
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.35rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.tb-title::before, .tb-title::after { content: " ▮ "; color: var(--gold); font-size: 0.55em; vertical-align: middle; }
.tb-sub-row {
  display: flex; align-items: center; justify-content: center;
  flex-wrap: wrap;
  gap: 0.4rem 1.1rem;
  margin-top: 0.3rem;
  font-size: 0.62rem;
  letter-spacing: 0.12em;
}
.tb-person { color: var(--gold); }
.tb-date { color: var(--cyan); min-width: 8ch; text-align: left; }
.tb-stat { color: var(--dim); text-align: left; }
#tbYears { min-width: 10ch; }    /* "UPTIME 34Y"          */
#tbSystems { min-width: 18ch; }  /* "166 SYSTEMS ONLINE"  */
.tb-controls { display: inline-flex; gap: 0.2rem; align-items: center; }
#speedRange {
  width: 84px;
  appearance: none;
  height: 3px;
  border-radius: 2px;
  background: linear-gradient(to right, var(--dim), var(--gold));
  cursor: pointer;
  margin: 0 0.25rem;
}
#speedRange::-webkit-slider-thumb {
  appearance: none;
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--text);
  border: 2px solid var(--gold);
}
#speedRange::-moz-range-thumb {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--text);
  border: 2px solid var(--gold);
}
.tc-rate {
  font-size: 0.6rem;
  letter-spacing: 0.08em;
  color: var(--gold);
  width: 5.5ch;      /* fits "×0.25" — fixed so dragging never reflows the bar */
  flex-shrink: 0;
  text-align: left;
}
.tc {
  background: none;
  border: 1px solid transparent;
  border-radius: 3px;
  color: var(--dim);
  font-size: 0.66rem;
  padding: 0.15rem 0.45rem;
}
.tc:hover { color: var(--text); }
.tc-active { color: var(--ink); background: var(--gold); border-color: var(--gold); }

/* ── Scrubber ────────────────────────────────────────────── */
#scrub {
  position: fixed; left: 50%; bottom: 1rem;
  transform: translateX(-50%);
  z-index: 20;
  width: min(46rem, calc(100vw - 2rem));
  background: var(--glass);
  border: 1px solid var(--hair);
  border-radius: 4px;
  padding: 0.7rem 1rem 0.45rem;
}
#scrubRange {
  width: 100%;
  appearance: none;
  height: 3px;
  border-radius: 2px;
  background: linear-gradient(to right, var(--gold), var(--cyan));
  cursor: pointer;
}
#scrubRange::-webkit-slider-thumb {
  appearance: none;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--text);
  border: 2px solid var(--cyan);
  box-shadow: 0 0 10px rgba(95, 216, 255, 0.6);
}
#scrubRange::-moz-range-thumb {
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--text);
  border: 2px solid var(--cyan);
}
.scrub-marks {
  display: flex; justify-content: space-between;
  font-size: 0.55rem; letter-spacing: 0.14em;
  color: var(--dim);
  margin-top: 0.35rem;
}

/* ── Chronicle ───────────────────────────────────────────── */
/* The hidden attribute always wins, whatever display an element uses */
[hidden] { display: none !important; }
#chronicle {
  position: fixed; top: 5.4rem; right: 0.8rem; bottom: 4.2rem;
  z-index: 15;
  width: min(24rem, calc(100vw - 1.6rem));
  display: flex; flex-direction: column;
  background: var(--paper);
  border: 1px solid var(--hair);
  border-radius: 4px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}
.ch-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 0.9rem 1.1rem 0.5rem;
}
.ch-head span { display: flex; gap: 0.4rem; }
.ch-title {
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.3rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.ch-tabs {
  display: flex; gap: 0.3rem;
  padding: 0.3rem 1.1rem 0.7rem;
  border-bottom: 1px solid var(--hair);
}
.ch-tab {
  background: none;
  border: 1px solid transparent;
  border-radius: 999px;
  color: var(--dim);
  font-size: 0.58rem;
  letter-spacing: 0.14em;
  padding: 0.25rem 0.7rem;
}
.ch-tab:hover { color: var(--text); }
.ch-tab-on { color: var(--ink); background: var(--cyan); }
.ch-scroll { overflow-y: auto; padding: 0.9rem 1.1rem 1.2rem; flex: 1; scrollbar-width: thin; }
.ch-year {
  font-family: var(--display);
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.18em;
  color: var(--gold);
  text-align: center;
  margin: 1.1rem 0 0.5rem;
}
.ch-year:first-child { margin-top: 0; }
.ch-entry {
  width: 100%;
  text-align: left;
  background: none; border: none;
  color: var(--text);
  font-family: var(--body);
  padding: 0.55rem 0.4rem;
  border-radius: 3px;
  cursor: pointer;
}
.ch-entry:hover { background: rgba(95, 216, 255, 0.07); }
.ch-entry.fresh { animation: chIn 0.7s ease; }
@keyframes chIn { from { opacity: 0; transform: translateY(8px); } }
.ch-date { display: block; font-family: var(--mono); font-size: 0.56rem; letter-spacing: 0.16em; margin-bottom: 0.2rem; }
.ch-text { font-size: 0.83rem; line-height: 1.55; color: var(--dim); }
.ch-text strong { color: var(--text); font-weight: 600; }
.ch-badge { color: var(--gold); font-family: var(--mono); font-size: 0.6rem; letter-spacing: 0.14em; }

/* ── Building card ───────────────────────────────────────── */
#card {
  position: fixed; left: 0.8rem; bottom: 4.2rem;
  z-index: 16;
  width: min(23rem, calc(100vw - 1.6rem));
  max-height: min(30rem, calc(100vh - 12rem));
  overflow-y: auto;
  background: var(--paper);
  border: 1px solid var(--hair);
  border-left: 3px solid var(--accent, var(--cyan));
  border-radius: 4px;
  padding: 1rem 1.2rem 1.2rem;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
  scrollbar-width: thin;
}
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 0.6rem; }
.card-kind { font-size: 0.58rem; letter-spacing: 0.26em; color: var(--accent, var(--cyan)); }
.card-badge {
  display: inline-block;
  font-size: 0.58rem; letter-spacing: 0.2em;
  color: var(--gold);
  border: 1px solid rgba(255, 207, 128, 0.45);
  padding: 0.22rem 0.55rem;
  margin-top: 0.5rem;
}
.card-title {
  font-family: var(--display);
  font-weight: 900;
  font-size: 1.7rem;
  text-transform: uppercase;
  line-height: 1;
  margin-top: 0.5rem;
}
.card-sub { font-weight: 600; margin-top: 0.35rem; }
.card-period { font-size: 0.6rem; letter-spacing: 0.16em; color: var(--dim); margin-top: 0.2rem; }
.card-tagline { color: var(--dim); font-style: italic; font-size: 0.88rem; margin: 0.6rem 0 0.9rem; }
.card-items { display: flex; flex-direction: column; gap: 0.6rem; }
.item-card {
  border: 1px solid var(--hair);
  border-left: 2px solid var(--accent, var(--cyan));
  border-radius: 3px;
  padding: 0.7rem 0.8rem;
  background: rgba(255, 255, 255, 0.02);
}
.item-card h3 {
  font-family: var(--mono);
  font-weight: 500;
  font-size: 0.6rem;
  letter-spacing: 0.18em;
  color: var(--accent, var(--cyan));
  margin-bottom: 0.3rem;
}
.item-card p { font-size: 0.82rem; color: var(--dim); line-height: 1.5; }
.item-card a { color: var(--text); text-decoration: none; border-bottom: 1px solid var(--accent, var(--cyan)); }
.item-card a:hover { color: var(--accent, var(--cyan)); }

/* ── Dossier modal ───────────────────────────────────────── */
.modal {
  position: fixed; inset: 0; z-index: 30;
  display: flex; align-items: center; justify-content: center;
  background: rgba(5, 9, 14, 0.6);
  backdrop-filter: blur(4px);
}
.modal[hidden] { display: none; }
.modal-inner {
  width: min(34rem, calc(100vw - 2rem));
  max-height: calc(100vh - 4rem);
  overflow-y: auto;
  background: var(--paper);
  border: 1px solid var(--hair);
  border-radius: 4px;
  padding: 1.4rem 1.6rem 1.6rem;
  box-shadow: 0 14px 60px rgba(0, 0, 0, 0.6);
}
.dossier-role { font-weight: 600; margin-top: 0.6rem; }
.dossier-summary { color: var(--dim); font-size: 0.92rem; line-height: 1.6; margin: 0.8rem 0 1.1rem; }
.dossier-links { margin-top: 1.2rem; font-size: 0.6rem; letter-spacing: 0.14em; color: var(--dim); }
.dossier-links a { color: var(--cyan); text-decoration: none; }
.dossier-links a:hover { border-bottom: 1px solid var(--cyan); }

/* ── Noscript ────────────────────────────────────────────── */
.noscript {
  position: fixed; inset: 0; z-index: 50;
  background: var(--ink);
  display: flex; flex-direction: column; gap: 1rem;
  align-items: center; justify-content: center;
  text-align: center; padding: 2rem;
}

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 900px) {
  #chronicle { top: auto; bottom: 4.2rem; height: 46vh; }
  .tb-title { font-size: 1.05rem; }
  .tb-sub-row { font-size: 0.56rem; gap: 0.3rem 0.7rem; }
  #card { bottom: auto; top: 5.6rem; max-height: 40vh; }
}

@media (max-width: 560px) {
  #topbar { gap: 0.35rem; }
  .chip { font-size: 0.52rem; padding: 0.35rem 0.5rem; letter-spacing: 0.1em; }
  .tb-center { padding: 0.45rem 0.7rem 0.5rem; }
  .tb-title { font-size: 0.92rem; }
  .tb-title::before, .tb-title::after { content: ""; }
}

@media (prefers-reduced-motion: reduce) {
  #veil { transition: none; }
  .ch-entry.fresh { animation: none; }
}
