:root {
  --sans: 'IBM Plex Sans', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

@font-face {
  font-family: 'IBM Plex Sans';
  font-style: normal;
  font-weight: 100 700;
  font-display: swap;
  src: url('/public/fonts/ibm-plex-sans-roman-variable.woff2') format('woff2');
}

@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 100 700;
  font-display: swap;
  src: url('/public/fonts/ibm-plex-mono-roman-variable.woff2') format('woff2');
}

:root {
  --ink: #111;
  --muted: #666;
  --rule: #d8d8d8;
  --paper: #FFFFFF;
  --panel: #f1efe8;
  --max: 1180px;
}

* { box-sizing: border-box; }
html { background: var(--paper); color: var(--ink); }
body { margin: 0; background: var(--paper); font-family: var(--sans); }
main { background: var(--paper); }
a { color: inherit; }
.shell { width: min(calc(100% - 40px), var(--max)); margin: 0 auto; }

.site-header { padding: 26px 0 20px; border-bottom: 1px solid var(--ink); }
.topline { display: flex; justify-content: space-between; gap: 24px; align-items: center; font-family: var(--sans); font-size: 12px; text-transform: uppercase; letter-spacing: .05em; }
.topline nav { display: flex; gap: 22px; flex-wrap: wrap; }
.topline a { text-decoration: none; }
.topline a:hover { text-decoration: underline; text-underline-offset: 3px; }
.masthead { display: block; text-align: center; margin-top: 23px; font-family: var(--sans); font-size: clamp(48px, 6.2vw, 76px); line-height: .94; font-weight: 700; letter-spacing: -.025em; text-decoration: none; }
.tagline { margin: 11px 0 0; text-align: center; font-family: var(--sans); font-size: 13px; color: var(--muted); }

.page-grid { display: grid; grid-template-columns: minmax(0, 1fr) 326px; gap: 36px; padding-top: 26px; }
.news-column { min-width: 0; }
.story { display: grid; grid-template-columns: 48px minmax(0, 1fr); column-gap: 18px; row-gap: 4px; padding: 13px 0; border-top: 1px solid var(--rule); align-items: start; }
.story:first-child { border-top: 0; padding-top: 0; }
.rank { font-family: var(--mono); font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--muted); padding-top: 3px; }
.story-title { margin: 0; font-size: clamp(23px, 2vw, 24px); line-height: 1.1; font-weight: 425; letter-spacing: -.018em; }
.story-title a { text-decoration: none; }
.story-title a:hover { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 4px; }
.sources { grid-column: 2; font-family: var(--sans); font-size: 12px; font-weight: 400; line-height: 1.4; text-align: left; }
.sources-label { display: inline; margin-right: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; font-size: 10px; }
.sources a { display: inline; text-decoration: none; }
.source-separator { display: inline; margin: 0 7px; color: var(--muted); }
.sources a:hover { text-decoration: underline; text-underline-offset: 2px; }

.story.lead { grid-template-columns: 48px minmax(0, 1fr); padding-bottom: 21px; }
.story.lead .story-body { min-width: 0; }
.story.lead .story-title { max-width: 820px; font-size: clamp(32px, 3vw, 35px); line-height: 1.08; font-weight: 625; }
.story.lead .sources { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: baseline; text-align: left; margin-top: 9px; }
.story.lead .sources-label { margin-right: 0; }
.story.lead .sources a { display: inline; }
.story.lead .source-separator { margin: 0; }

.sidebar { border-left: 1px solid var(--rule); padding-left: 26px; }
.rail-stack { width: 300px; position: sticky; top: 20px; }
.rail-card { width: 300px; height: 300px; background: var(--panel); border: 1px solid #d7d3c8; padding: 22px; display: flex; flex-direction: column; text-align: center; overflow: hidden; }
.rail-label { font-family: var(--sans); color: #888; font-size: 9px; letter-spacing: .12em; }
.rail-logo { width: 100%; max-width: 220px; height: 70px; max-height: 70px; margin: 12px auto 0; align-self: center; border: 1px dashed #d7d3c8; }
.rail-logo img { display: block; max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; margin: 0 auto; }
.rail-copy { margin-top: 12px; font-size: 19px; line-height: 1.2; }
.rail-subcopy { margin-top: 8px; font-family: var(--sans); font-size: 12px; line-height: 1.4; color: #666; }
.rail-cta { margin-top: auto; padding-top: 10px; border-top: 1px solid var(--rule); font-family: var(--sans); font-size: 12px; text-decoration: none; }
.rail-cta:hover { text-decoration: underline; text-underline-offset: 3px; }
.rail-follow { margin-top: 24px; padding-top: 17px; border-top: 1px solid var(--rule); font-family: var(--sans); }
.rail-follow-label { display: block; color: var(--muted); font-size: 11px; letter-spacing: .02em; text-align: center; }
.rail-follow-links { display: flex; justify-content: center; gap: 14px; margin-top: 11px; }
.rail-follow-links a { display: inline-flex; width: 24px; height: 24px; align-items: center; justify-content: center; color: var(--ink); }
.rail-follow-links svg { width: 16px; height: 16px; fill: currentColor; }
.rail-follow-links a:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }

.site-footer { margin-top: 55px; padding: 22px 0 36px; border-top: 1px solid var(--ink); display: flex; justify-content: space-between; gap: 20px; font-family: var(--sans); font-size: 11px; color: var(--muted); }

.content-page { max-width: 760px; margin: 50px auto 80px; font-size: 18px; line-height: 1.6; }
.content-page h1 { font-size: 48px; line-height: 1; margin: 0 0 26px; }
.content-page h2 { margin-top: 40px; font-size: 26px; }
.content-page a { text-underline-offset: 3px; }
.edition-list { list-style: none; padding: 0; margin: 30px 0; border-top: 1px solid var(--rule); }
.edition-list li { padding: 16px 0; border-bottom: 1px solid var(--rule); }
.edition-list a, time { font-family: var(--mono); font-weight: 400; font-variant-numeric: tabular-nums; }

@media (max-width: 820px) {
  .page-grid { grid-template-columns: 1fr; }
  .sidebar { border-left: 0; border-top: 1px solid var(--rule); padding: 25px 0 0; }
  .rail-stack { width: 100%; position: static; }
  .rail-card { width: 100%; height: auto; min-height: 240px; }
  .story { grid-template-columns: 34px minmax(0, 1fr); }
  .story.lead { grid-template-columns: 34px minmax(0, 1fr); }

}

@media (max-width: 600px) {
  .shell { width: min(calc(100% - 24px), var(--max)); }
  .topline { align-items: flex-start; }
  .topline nav { gap: 10px 14px; justify-content: flex-end; }
  .masthead { font-size: clamp(28px, 8.5vw, 38px); white-space: nowrap; }
  .story { padding: 12px 0; }
  .story-title { font-size: clamp(20px, 5.5vw, 22px); line-height: 1.12; }
  .story.lead .story-title { font-size: clamp(30px, 8.2vw, 34px); line-height: 1.08; }
  .site-footer { flex-direction: column; }
}
