:root {
  --bg: #1A1423;
  --surface: #2D2438;
  --surface-2: #241C30;
  --ink: #F5F5F5;
  --ink-2: #A8A8A8;
  --accent: #E37F3C;
  --dust: #DFC4B2;
  --sev-0: #FFF3C4;
  --sev-1: #FBBD4A;
  --sev-2: #F0701D;
  --sev-3: #DB2955;
  --line: rgba(223, 196, 178, .14);
  --radius: 14px;
  --display: "Big Shoulders Display", "Arial Narrow", sans-serif;
  --body: "Archivo", system-ui, sans-serif;
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--body);
  font-size: 18px;
  line-height: 1.55;
  padding: 0 16px 48px;
  max-width: 520px;
  margin: 0 auto;
  overflow-x: hidden;
}

/* atmosphere */
.glow {
  position: fixed; inset: 0; pointer-events: none; z-index: -2;
  background:
    radial-gradient(90% 40% at 50% -8%, rgba(227, 127, 60, .22), transparent 70%),
    radial-gradient(60% 30% at 85% 4%, rgba(219, 41, 85, .10), transparent 70%);
}
.grain {
  position: fixed; inset: 0; pointer-events: none; z-index: -1; opacity: .05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* header */
.site-header {
  display: flex; align-items: baseline; justify-content: space-between;
  padding: 22px 0 6px;
}
h1 {
  font-family: var(--display);
  font-weight: 800;
  font-size: 34px;
  letter-spacing: .02em;
  text-transform: uppercase;
  line-height: 1;
}
h1 span { color: var(--accent); }
.year-chip {
  display: inline-block;
  font-family: var(--display); font-weight: 700; font-size: 18px;
  color: var(--dust);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 16px;
  min-height: 36px;
}

/* direction toggle */
.dir-toggle {
  display: grid; grid-template-columns: 1fr 1fr; gap: 4px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px;
  margin: 14px 0 18px;
}
.dir-toggle button {
  font-family: var(--display); font-weight: 700; font-size: 19px;
  letter-spacing: .04em; text-transform: uppercase;
  color: var(--ink-2);
  background: transparent; border: 0; border-radius: 999px;
  min-height: 48px;
  cursor: pointer;
  transition: background .18s, color .18s;
}
.dir-toggle button[aria-selected="true"] {
  background: var(--accent);
  color: #241303;
}

/* verdict */
.verdict {
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 18px;
}
.verdict strong { color: var(--dust); }

/* day strip */
.day-strip {
  display: flex; gap: 8px;
  overflow-x: auto;
  padding: 2px 2px 10px;
  margin: 0 -2px 8px;
  scrollbar-width: none;
}
.day-strip::-webkit-scrollbar { display: none; }
.day-pill {
  flex: 0 0 auto;
  min-width: 52px; min-height: 62px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--ink-2);
  font-family: var(--body);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  padding: 7px 8px 8px;
  cursor: pointer;
  transition: transform .12s, border-color .12s;
}
.day-pill .wd { font-size: 11.5px; letter-spacing: .12em; text-transform: uppercase; }
.day-pill .dt { font-family: var(--display); font-weight: 800; font-size: 22px; line-height: 1; color: var(--ink); }
.day-pill .dot { width: 22px; height: 6px; border-radius: 3px; }
.day-pill[aria-current="true"] {
  border-color: var(--accent);
  background: var(--surface);
  transform: translateY(-2px);
}

/* day detail */
.day-detail {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 14px 14px;
}
.day-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.day-head h2 {
  font-family: var(--display); font-weight: 800; font-size: 22px;
  text-transform: uppercase; letter-spacing: .02em;
}
.day-head p { font-size: 13.5px; color: var(--ink-2); text-align: right; }
.day-head p b { color: var(--dust); font-size: 16px; }

#chart svg { display: block; width: 100%; height: auto; }
#chart text { font-family: var(--body); }

.callout {
  margin-top: 10px;
  font-size: 16px;
  color: var(--dust);
}
.provenance { margin-top: 4px; font-size: 13.5px; color: var(--ink-2); }

/* dashed-centerline divider */
.divider {
  height: 0;
  border-top: 3px dashed rgba(227, 127, 60, .35);
  margin: 30px 10% 26px;
}

/* full picture */
.section-title {
  font-family: var(--display); font-weight: 800; font-size: 22px;
  text-transform: uppercase; letter-spacing: .03em;
}
.section-sub { color: var(--ink-2); font-size: 16px; margin: 2px 0 12px; }

.cell-detail {
  background: var(--surface);
  border: 1px solid var(--accent);
  border-radius: 10px;
  padding: 9px 13px;
  margin-bottom: 10px;
  font-size: 16px;
}
.cell-detail b { color: var(--dust); }

#heatmap { width: 100%; }
#heatmap table { border-collapse: separate; border-spacing: 2px; width: 100%; }
#heatmap th {
  font-size: 11.5px; font-weight: 600; color: var(--ink-2);
  text-transform: uppercase; letter-spacing: .06em;
  padding: 0 2px 4px;
}
#heatmap td.hour-label {
  font-size: 11.5px; color: var(--ink-2); text-align: right;
  padding-right: 6px; white-space: nowrap; width: 30px;
}
#heatmap td.cell {
  height: 18px; border-radius: 3px;
  background: var(--surface-2);
  cursor: pointer;
  padding: 0;
}
#heatmap td.cell.empty { background: repeating-linear-gradient(45deg, transparent, transparent 3px, rgba(223,196,178,.06) 3px, rgba(223,196,178,.06) 5px); cursor: default; }
#heatmap td.cell.picked { outline: 2px solid var(--ink); outline-offset: 1px; }

.legend {
  display: flex; flex-wrap: wrap; gap: 12px;
  margin-top: 14px;
  font-size: 13.5px; color: var(--ink-2);
}
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 14px; height: 8px; border-radius: 2px; display: inline-block; }

/* about */
.about p { color: var(--ink-2); font-size: 16px; margin-top: 8px; }
.about a { color: var(--accent); }

@media (min-width: 480px) {
  h1 { font-size: 40px; }
  #heatmap td.cell { height: 20px; }
}
