/* Tokens, base and the season/entry components. Shared by the app and the snapshot page. */
:root {
  --bg: #f6f4ef;
  --surface: #fbfaf7;
  --surface-2: #eeebe4;
  --ink: #1c1a17;
  --ink-2: #5a554d;
  --ink-3: #6f695f;
  --rule: rgba(28, 26, 23, 0.1);
  --rule-strong: rgba(28, 26, 23, 0.22);
  --accent: #8f2f22;
  --on-ink: #f6f4ef;
  --scrim: rgba(20, 18, 15, 0.82);

  --serif: "Newsreader", Georgia, "Times New Roman", serif;
  --sans: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --r-control: 8px;
  --r-card: 12px;
  --r-panel: 16px;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #161513;
    --surface: #1c1b18;
    --surface-2: #26241f;
    --ink: #ece8e1;
    --ink-2: #aaa49a;
    --ink-3: #8f897f;
    --rule: rgba(236, 232, 225, 0.1);
    --rule-strong: rgba(236, 232, 225, 0.24);
    --accent: #d9765f;
    --on-ink: #161513;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { color-scheme: light dark; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 15px/24px var(--sans);
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.link { color: inherit; text-decoration: underline; text-decoration-color: var(--rule-strong); text-underline-offset: 3px; transition: text-decoration-color 160ms var(--ease); }
.link:hover { text-decoration-color: var(--accent); }

/* ---- Season ---- */
.season { padding: 0 0 64px; }
.season-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; padding-bottom: 24px; }
.season-head h2 { margin: 0; font: 400 44px/48px var(--serif); letter-spacing: -0.015em; }
.meta { margin: 4px 0 0; font: 400 13px/20px var(--mono); color: var(--ink-3); font-variant-numeric: tabular-nums; }

.dist { width: 200px; flex: none; }
.dist-bars { display: grid; grid-template-columns: repeat(10, 1fr); gap: 4px; height: 48px; align-items: end; }
.dist-bars i { display: block; height: max(var(--h), 4px); background: var(--rule-strong); border-radius: 2px 2px 0 0; }
.dist-bars i.is-modal { background: var(--accent); }
.dist-axis { display: flex; justify-content: space-between; margin-top: 4px; font: 400 11px/16px var(--mono); color: var(--ink-3); }

/* ---- Cover wall ---- */
.wall { list-style: none; margin: 0 0 24px; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(128px, 1fr)); gap: 12px; }
.tile { position: relative; display: block; width: 100%; padding: 0; border: 0; background: none; text-align: left; cursor: default; border-radius: var(--r-control); transition: transform 180ms var(--ease); }
button.tile { cursor: pointer; }
button.tile:hover { transform: translateY(-2px); }
.tile-frame { position: relative; display: block; aspect-ratio: 4 / 5; border-radius: var(--r-control); overflow: hidden; background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--rule); }
.tile-frame img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 240ms var(--ease); }
button.tile:hover img { transform: scale(1.03); }
.tile-text { display: flex; align-items: flex-end; height: 100%; padding: 12px; font: 400 15px/20px var(--serif); color: var(--ink-2); overflow: hidden; }
.tile-kind { position: absolute; top: 8px; right: 8px; display: flex; align-items: center; justify-content: center; width: 24px; height: 24px; border-radius: 50%; background: var(--scrim); color: #f6f4ef; }
.tile-name { position: absolute; inset: auto 0 0 0; display: flex; justify-content: space-between; gap: 8px; padding: 8px 12px; border-radius: 0 0 var(--r-control) var(--r-control); background: var(--scrim); color: #f6f4ef; font: 400 13px/16px var(--sans); opacity: 0; transition: opacity 160ms var(--ease); }
.tile-name b { font: 500 13px/16px var(--mono); font-variant-numeric: tabular-nums; }
.tile:hover .tile-name, .tile:focus-visible .tile-name, .snapshot .tile:hover .tile-name { opacity: 1; }
@media (hover: none) { .tile-name { opacity: 1; } }
.tile:has(.tile-text) .tile-name { display: none; }

/* ---- Rows ---- */
.rows { list-style: none; margin: 0; padding: 0; border-bottom: 1px solid var(--rule); }
.row { display: grid; grid-template-columns: 88px minmax(0, 1fr) 176px 56px 56px; gap: 16px; align-items: baseline; width: 100%; padding: 12px 16px; border: 0; border-top: 1px solid var(--rule); background: none; text-align: left; border-radius: 0; transition: background-color 140ms var(--ease); }
button.row { cursor: pointer; }
button.row:hover { background: var(--surface-2); }
.code, .r-date, .r-rating { font: 400 13px/24px var(--mono); font-variant-numeric: tabular-nums; color: var(--ink-3); }
.r-main { display: flex; flex-direction: column; min-width: 0; }
.r-title { font-weight: 500; overflow-wrap: anywhere; }
.r-by { color: var(--ink-2); font-size: 14px; line-height: 20px; }
.r-note { color: var(--ink-2); font-size: 14px; line-height: 20px; margin-top: 4px; font-family: var(--serif); font-size: 15px; }
.r-cat { font-size: 13px; color: var(--ink-3); }
.r-date { text-align: right; }
.r-rating { text-align: right; color: var(--ink); font-weight: 500; font-size: 15px; }
.r-rating small { color: var(--ink-3); font-size: 11px; font-weight: 400; }

/* ---- Entrance (once, on load) ---- */
@keyframes rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.season:first-of-type .season-head, .snap-head { animation: rise 420ms var(--ease) both; }

/* ---- Snapshot page ---- */
.snap-wrap { max-width: 1040px; margin: 0 auto; padding: 64px 32px 48px; }
.snap-head { padding-bottom: 48px; }
.snap-head h1 { margin: 0; font: 400 64px/68px var(--serif); letter-spacing: -0.02em; }
.snap-foot { padding-top: 24px; border-top: 1px solid var(--rule); font: 400 13px/20px var(--mono); color: var(--ink-3); }
.empty { color: var(--ink-2); }

@media (max-width: 760px) {
  .season-head { flex-direction: column; align-items: flex-start; }
  .season-head h2 { font-size: 36px; line-height: 40px; }
  .dist { width: 100%; }
  .wall { grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 8px; }
  .row { grid-template-columns: minmax(0, 1fr) auto; gap: 4px 16px; padding: 12px 8px; }
  .code, .r-cat { display: none; }
  .r-date { grid-column: 1; grid-row: 2; text-align: left; }
  .r-rating { grid-column: 2; grid-row: 1; }
  .snap-wrap { padding: 40px 16px 32px; }
  .snap-head h1 { font-size: 40px; line-height: 44px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
