:root {
  --bg: #fbfaf7;
  --fg: #1d1d1b;
  --muted: #6b6a66;
  --line: #e6e3dc;
  --card: #ffffff;
  --accent: #d6336c;
  --accent-fg: #ffffff;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #141413;
    --fg: #eceae4;
    --muted: #9c9a93;
    --line: #2b2a27;
    --card: #1b1b19;
    --accent: #f06595;
    --accent-fg: #141413;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 17px/1.6 ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
main { max-width: 42rem; margin: 0 auto; padding: 4.5rem 1.5rem 3rem; }

a { color: inherit; text-decoration-color: var(--line); text-underline-offset: 3px; }
a:hover { text-decoration-color: var(--accent); }
a:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

.hello { margin: 0; color: var(--muted); }
h1 { margin: .1rem 0 1rem; font-size: clamp(2.2rem, 6vw, 3rem); line-height: 1.1; letter-spacing: -0.02em; }
.lede { margin: 0; font-size: 1.12rem; max-width: 36rem; }
.links { display: flex; flex-wrap: wrap; gap: 1.25rem; margin-top: 1.25rem; }
.links a { color: var(--muted); }
.links a:hover { color: var(--fg); }

section { margin-top: 3.5rem; }
h2 {
  margin: 0 0 1rem;
  font-size: .8rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase;
  color: var(--muted);
}

.projects { list-style: none; margin: 0; padding: 0; display: grid; gap: .75rem; }
.projects li {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 1rem 1.15rem;
}
.projects li.featured { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.projects p { margin: .35rem 0 0; color: var(--muted); }
.row { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; }
.name { font-weight: 600; text-decoration: none; }
.name:hover { text-decoration: underline; text-decoration-color: var(--accent); }
.tag { font: 12px/1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; color: var(--muted); }

.button {
  display: inline-block;
  margin-top: .9rem;
  padding: .5rem .9rem;
  border-radius: 8px;
  background: var(--accent);
  color: var(--accent-fg);
  font-weight: 600;
  font-size: .95rem;
  text-decoration: none;
}
.button:hover { filter: brightness(1.08); }

footer {
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: .5rem;
  margin-top: 4rem; padding-top: 1.25rem;
  border-top: 1px solid var(--line);
  color: var(--muted); font-size: .9rem;
}

[hidden] { display: none !important; }

/* Today's paper */
.paper-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.paper-head h2 { margin: 0; }
.paper-updated { color: var(--muted); font-size: .85rem; }

.weather { list-style: none; margin: 0 0 1.25rem; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; }
.weather li {
  display: grid; grid-template-columns: auto 1fr auto; align-items: baseline; column-gap: .45rem;
  padding: .6rem .75rem; background: var(--card); border: 1px solid var(--line); border-radius: 10px;
}
.wx-icon { grid-row: span 2; font-size: 1.3rem; align-self: center; }
.wx-city { font-weight: 600; font-size: .92rem; }
.wx-temp { font-weight: 600; font-variant-numeric: tabular-nums; }
.wx-range { grid-column: 2 / 4; color: var(--muted); font-size: .8rem; font-variant-numeric: tabular-nums; }

.paper-controls { display: flex; flex-wrap: wrap; gap: .6rem 1rem; align-items: center; margin-bottom: .5rem; }
.paper-controls button {
  font: inherit; font-size: .85rem; cursor: pointer; color: var(--muted);
  background: transparent; border: 1px solid var(--line); border-radius: 999px; padding: .3rem .75rem;
}
.paper-controls button:hover { color: var(--fg); }
.paper-controls button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; padding: 2px; }
.seg button { border: 0; padding: .25rem .8rem; }
.seg button[aria-selected="true"] { background: var(--fg); color: var(--bg); }
.chips { display: flex; flex-wrap: wrap; gap: .4rem; }
.chips button[aria-pressed="true"] { color: var(--fg); border-color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, transparent); }

.stories { list-style: none; margin: 0; padding: 0; }
.stories li { padding: .95rem 0; border-bottom: 1px solid var(--line); }
.stories li:last-child { border-bottom: 0; }
.stories .empty { color: var(--muted); }
.kicker { display: block; margin-bottom: .2rem; font-size: .72rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--accent); }
.kicker.t-weather { color: #1c7ed6; }
.kicker.t-storm { color: #7048e8; }
.kicker.t-quake { color: #e8590c; }
.kicker.t-war { color: #c92a2a; }
.kicker.t-tech { color: #0c8599; }
@media (prefers-color-scheme: dark) {
  .kicker.t-weather { color: #74c0fc; }
  .kicker.t-storm { color: #b197fc; }
  .kicker.t-quake { color: #ffa94d; }
  .kicker.t-war { color: #ff8787; }
  .kicker.t-tech { color: #66d9e8; }
}
.headline {
  font-family: ui-serif, Georgia, "Times New Roman", serif; font-size: 1.12rem; font-weight: 700; line-height: 1.35;
  text-decoration: none;
}
.headline:hover { text-decoration: underline; text-decoration-color: var(--accent); }
.summary {
  margin: .3rem 0 .25rem; color: var(--muted); font-size: .95rem;
  display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.meta { font-size: .8rem; color: var(--muted); }
.paper-note { margin: .75rem 0 0; font-size: .8rem; color: var(--muted); }

@media (max-width: 520px) {
  .weather { grid-template-columns: 1fr; }
}
