/*
 * Public edition (decision P9): one HTML, two presentations.
 *   - Base: readable list of every note, with or without JavaScript, on any screen.
 *   - From 1024 px: proposal 2, "Tarjetas" (magazine dashboard, reader panel).
 *   - Below 1024 px with JavaScript: proposal 3, "Historias" (cover, one note per screen).
 * Brand colors and typefaces only (docs/MARCA.md).
 */

:root {
  --accent: oklch(0.42 0.16 25);
  --accent-hover: oklch(0.32 0.16 25);
  --page-bg: oklch(0.94 0.01 75);
  --paper-2: oklch(0.96 0.01 75);
  --paper: oklch(0.98 0.01 75);
  --text: oklch(0.2 0.01 60);
  --ink: oklch(0.15 0.01 60);
  --muted: oklch(0.5 0.02 60);
  --rule: oklch(0.25 0.01 60);
  --rule-soft: oklch(0.25 0.01 60 / 0.2);
  --rule-mid: oklch(0.25 0.01 60 / 0.35);
  --on-accent-soft: oklch(0.9 0.03 75 / 0.85);
  --on-accent-line: oklch(0.98 0.01 75 / 0.28);
  --scrim: oklch(0.15 0.01 60 / 0.55);
  --head: 'Bitter', Georgia, serif;
  --body: 'Libre Baskerville', Georgia, serif;
  --sans: 'Work Sans', system-ui, sans-serif;
  --gutter: 16px;
  --wrap: 1360px;
  --radius: 12px;
  --top-h: 60px;
  --text-scale: 1;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}
@media (min-width: 720px) { :root { --gutter: 32px; } }
@media (min-width: 1200px) { :root { --gutter: 56px; } }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--top-h) + 16px); }
body { margin: 0; background: var(--page-bg); color: var(--text); font-family: var(--body); line-height: 1.6; -webkit-font-smoothing: antialiased; }
h1, h2, h3, p, ol, ul { margin: 0; }
a { color: var(--accent); text-underline-offset: 2px; }
a:hover { color: var(--accent-hover); }
button { font: inherit; color: inherit; cursor: pointer; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.icon { width: 20px; height: 20px; flex: none; }
.wrap { width: 100%; max-width: calc(var(--wrap) + 2 * var(--gutter)); margin: 0 auto; padding-left: var(--gutter); padding-right: var(--gutter); }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 22px;
  border: 1.5px solid transparent; border-radius: 4px; font-family: var(--sans); font-weight: 600; font-size: 16px; text-decoration: none;
  transition: background-color 180ms var(--ease), color 180ms var(--ease), border-color 180ms var(--ease), transform 180ms var(--ease);
}
.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.4; cursor: default; }
.btn-primary { background: var(--accent); color: var(--paper); }
.btn-primary:hover { background: var(--accent-hover); color: var(--paper); }
.btn-secondary { background: transparent; color: var(--accent); border-color: var(--accent); }
.btn-secondary:hover { background: var(--paper-2); }
.btn-on-accent { background: var(--paper); color: var(--accent); }
.btn-on-accent:hover { background: var(--paper-2); }
.btn-ghost-light { background: transparent; color: var(--paper); border-color: var(--on-accent-line); }
.btn-ghost-light:hover { background: oklch(0.98 0.01 75 / 0.1); color: var(--paper); }
.icon-btn {
  display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 50%;
  border: 1.5px solid var(--rule-mid); background: transparent; color: var(--ink); font-family: var(--head);
  transition: background-color 180ms var(--ease), border-color 180ms var(--ease), transform 180ms var(--ease);
}
.icon-btn:hover { border-color: var(--accent); color: var(--accent); }
.icon-btn:active { transform: scale(0.92); }
.chip-btn {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 16px; border-radius: 999px;
  border: 1.5px solid var(--rule-mid); background: transparent; font-family: var(--sans); font-weight: 600; font-size: 14px; color: var(--ink);
}
.chip-btn:hover { border-color: var(--accent); }
.chip-btn[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--paper); }

/* ----- Header ----- */
.top { position: sticky; top: 0; z-index: 25; background: var(--accent); color: var(--paper); }
.top-inner { display: flex; align-items: center; gap: 14px; min-height: var(--top-h); }
.brand { font-family: var(--head); font-weight: 800; font-size: 21px; color: inherit; text-decoration: none; white-space: nowrap; }
.brand:hover { color: inherit; }
.top-date { flex: 1; min-width: 0; font-family: var(--sans); font-weight: 600; font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--on-accent-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top-tools { display: flex; align-items: center; gap: 8px; }
.top .icon-btn { color: var(--paper); border-color: var(--on-accent-line); }
.top .icon-btn:hover { background: oklch(0.98 0.01 75 / 0.12); color: var(--paper); }
.ring { display: inline-flex; align-items: center; gap: 8px; font-family: var(--sans); font-weight: 600; font-size: 14px; }
.ring svg { width: 36px; height: 36px; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 4; }
.ring .track { stroke: oklch(0.98 0.01 75 / 0.25); }
.ring .value { stroke: var(--paper); stroke-linecap: round; transition: stroke-dashoffset 500ms var(--ease); }

/* ----- Base layout (every screen, with or without JavaScript) ----- */
.hero { display: grid; gap: 28px; padding-top: 28px; padding-bottom: 28px; }
.kicker { display: none; justify-content: space-between; gap: 12px; font-family: var(--sans); font-weight: 600; font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--on-accent-soft); }
.hero-by { font-family: var(--sans); font-weight: 600; font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.hero h1 { margin-top: 6px; font-family: var(--head); font-weight: 800; font-size: clamp(36px, 5vw, 68px); line-height: 1; color: var(--ink); }
.hero-date { margin-top: 8px; font-family: var(--head); font-weight: 700; font-size: clamp(20px, 2vw, 26px); color: var(--accent); }
.stats { list-style: none; padding: 0; margin-top: 22px; display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--rule-mid); border-bottom: 1px solid var(--rule-mid); }
.stats li { padding: 14px 0; font-family: var(--sans); font-size: 13px; color: var(--muted); }
.stats li + li { padding-left: 16px; border-left: 1px solid var(--rule-soft); }
.stats strong { display: block; font-family: var(--head); font-weight: 800; font-size: 34px; line-height: 1; color: var(--ink); }
.dist { margin-top: 22px; }
.dist-label { font-family: var(--sans); font-weight: 600; font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); margin-bottom: 10px; }
.dist-bar { display: flex; height: 40px; border-radius: 8px; overflow: hidden; gap: 2px; }
.dist-bar a {
  min-width: 28px; display: grid; place-items: center; text-decoration: none;
  background: oklch(0.42 0.16 25 / var(--a)); color: var(--paper); font-family: var(--sans); font-weight: 700; font-size: 13px;
  transition: filter 200ms var(--ease);
}
.dist-bar a[style*="--a: 0.42"], .dist-bar a[style*="--a: 0.28"], .dist-bar a[style*="--a: 0.18"] { color: var(--ink); }
.dist-bar a:hover, .dist-bar a[aria-current="true"] { filter: brightness(0.85); }
.legend { list-style: none; padding: 0; margin-top: 12px; display: flex; flex-wrap: wrap; gap: 6px 16px; }
.legend a { display: inline-flex; align-items: center; gap: 8px; min-height: 32px; font-family: var(--sans); font-size: 13.5px; color: var(--text); text-decoration: none; }
.legend a:hover { color: var(--accent); }
.legend i { width: 12px; height: 12px; border-radius: 3px; background: oklch(0.42 0.16 25 / var(--a)); }
.legend .count { color: var(--muted); }
.cover-actions { display: none; }

.label { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; font-family: var(--head); font-weight: 800; font-size: 13px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent); }
.label::after { content: ''; flex: 1; height: 1px; background: var(--rule-mid); }
.bento { list-style: none; padding: 0; display: grid; gap: 12px; grid-template-columns: minmax(0, 1fr); }
.bento li { display: grid; }
.tile {
  position: relative; display: flex; flex-direction: column; gap: 8px; padding: 18px; text-decoration: none;
  border: 1.5px solid var(--rule-soft); border-radius: var(--radius); background: var(--paper); color: var(--ink);
  transition: border-color 220ms var(--ease), transform 220ms var(--ease);
}
.tile:hover { border-color: var(--accent); transform: translateY(-3px); color: var(--ink); }
.tile-num { font-family: var(--head); font-weight: 800; font-size: 30px; line-height: 1; color: var(--accent); }
.tile-section { font-family: var(--sans); font-weight: 600; font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.tile-title { font-family: var(--head); font-weight: 700; font-size: calc(17px * var(--text-scale)); line-height: 1.3; }
.tile-text { font-size: calc(15px * var(--text-scale)); line-height: 1.6; }
.tile-cta { margin-top: auto; padding-top: 6px; font-family: var(--sans); font-weight: 600; font-size: 14px; }
.tile.is-lead { background: var(--accent); border-color: var(--accent); color: var(--paper); padding: 24px; }
.tile.is-lead:hover { color: var(--paper); }
.tile.is-lead .tile-num { color: var(--paper); font-size: 48px; }
.tile.is-lead .tile-section { color: var(--on-accent-soft); }
.tile.is-lead .tile-title { font-size: calc(clamp(22px, 2.4vw, 34px) * var(--text-scale)); font-weight: 800; line-height: 1.15; }

.toolbar { background: var(--page-bg); border-top: 1px solid var(--rule-soft); border-bottom: 1px solid var(--rule-soft); }
.toolbar-inner { display: flex; align-items: center; gap: 12px; min-height: 60px; }
.tabs { flex: 1; min-width: 0; display: flex; gap: 8px; overflow-x: auto; padding: 10px 40px 10px 0; scrollbar-width: none; -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 48px), transparent); mask-image: linear-gradient(to right, #000 calc(100% - 48px), transparent); }
.tabs::-webkit-scrollbar { display: none; }
.tab {
  flex: none; display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 16px; border: 1.5px solid var(--rule-mid); border-radius: 999px;
  background: var(--paper); font-family: var(--sans); font-weight: 600; font-size: 14px; color: var(--ink); text-decoration: none;
  transition: background-color 200ms var(--ease), color 200ms var(--ease), border-color 200ms var(--ease);
}
.tab:hover { border-color: var(--accent); color: var(--ink); }
.tab .count { min-width: 22px; padding: 1px 6px; border-radius: 999px; background: var(--paper-2); font-size: 12px; color: var(--muted); text-align: center; }
.js .tab[aria-current="true"] { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.js .tab[aria-current="true"] .count { background: oklch(0.98 0.01 75 / 0.15); color: var(--paper); }
.switch { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; font-family: var(--sans); font-weight: 600; font-size: 14px; color: var(--ink); cursor: pointer; white-space: nowrap; }
.switch input { appearance: none; width: 44px; height: 26px; border-radius: 999px; background: var(--rule-mid); position: relative; cursor: pointer; margin: 0; transition: background-color 200ms var(--ease); }
.switch input::after { content: ''; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: var(--paper); transition: transform 220ms var(--ease); }
.switch input:checked { background: var(--accent); }
.switch input:checked::after { transform: translateX(18px); }
.views { display: inline-flex; border: 1.5px solid var(--rule-mid); border-radius: 999px; overflow: hidden; }
.views button { min-height: 40px; padding: 0 14px; border: 0; background: var(--paper); font-family: var(--sans); font-weight: 600; font-size: 13.5px; color: var(--ink); }
.views button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }

.feed { padding-top: 8px; padding-bottom: 56px; }
.group { padding-top: 28px; }
.group-title { display: flex; align-items: baseline; gap: 12px; margin-bottom: 16px; font-family: var(--head); font-weight: 800; font-size: clamp(22px, 2.4vw, 30px); color: var(--ink); }
.group-title span { font-family: var(--sans); font-weight: 600; font-size: 13px; color: var(--muted); }
.group-empty { font-family: var(--sans); font-size: 15px; color: var(--muted); padding: 18px; border: 1.5px dashed var(--rule-mid); border-radius: var(--radius); }
.grid { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); }
.note {
  position: relative; display: flex; flex-direction: column; gap: 10px; padding: 20px; scroll-margin-top: calc(var(--top-h) + 16px);
  background: var(--paper); border: 1.5px solid var(--rule-soft); border-radius: var(--radius);
  transition: border-color 220ms var(--ease), transform 220ms var(--ease);
}
.note-top { display: flex; align-items: center; gap: 10px; font-family: var(--sans); font-weight: 600; font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.note-num { font-family: var(--head); font-weight: 800; font-size: 20px; letter-spacing: 0; color: var(--accent); }
.note-read { display: none; margin-left: auto; padding: 1px 10px; border-radius: 999px; background: var(--accent); color: var(--paper); text-transform: none; letter-spacing: 0; font-size: 12px; }
.note.is-read .note-read { display: inline-flex; }
.note.is-read { border-style: dashed; }
.note-title { font-family: var(--head); font-weight: 700; font-size: calc(20px * var(--text-scale)); line-height: 1.3; color: var(--ink); text-wrap: balance; }
.note-title a { color: inherit; text-decoration: none; }
.note-source { font-family: var(--sans); font-weight: 600; font-size: 11.5px; letter-spacing: 0.06em; text-transform: uppercase; }
.note-body p { font-size: calc(16px * var(--text-scale)); line-height: 1.7; }
.note-body p + p { margin-top: 12px; }
.note-more { display: none; }

/* ----- Footer and plain pages ----- */
.site-footer { background: var(--paper-2); border-top: 1px solid var(--rule-soft); }
.footer-inner { padding-top: 32px; padding-bottom: 32px; display: grid; gap: 10px; }
.footer-label { font-family: var(--sans); font-weight: 600; font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent); }
.footer-text { font-size: 14px; color: oklch(0.35 0.01 60); max-width: 72ch; }
.footer-link { font-family: var(--sans); font-weight: 600; font-size: 13px; letter-spacing: 0.06em; text-transform: uppercase; }
.signoff { background: var(--accent); color: var(--paper); padding: 32px var(--gutter) 44px; font-family: var(--sans); }
.signoff p { max-width: var(--wrap); margin: 0 auto; font-weight: 600; font-size: 16px; line-height: 1.5; }
.signoff a { color: inherit; }
.page-simple { padding-top: 32px; padding-bottom: 56px; display: grid; gap: 20px; }
.page-title { font-family: var(--head); font-weight: 800; font-size: clamp(30px, 4vw, 48px); color: var(--ink); }
.message { font-size: 16px; }
.archive { display: grid; gap: 24px; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.archive-month h2 { padding-bottom: 6px; margin-bottom: 8px; border-bottom: 2px solid var(--accent); font-family: var(--head); font-weight: 800; font-size: 15px; letter-spacing: 0.05em; text-transform: uppercase; color: var(--accent); }
.archive-month ul { list-style: none; padding: 0; display: grid; gap: 6px; }
.archive-month a { font-family: var(--sans); font-size: 15px; color: var(--ink); text-decoration: none; }
.archive-month a:hover { color: var(--accent); text-decoration: underline; }

/* ----- Toast ----- */
.toast {
  position: fixed; left: 50%; top: calc(12px + env(safe-area-inset-top)); z-index: 60; transform: translate(-50%, -16px); opacity: 0; pointer-events: none;
  width: max-content; max-width: min(380px, calc(100vw - 32px)); padding: 12px 18px; border-radius: 6px; text-align: center;
  background: var(--ink); color: var(--paper); font-family: var(--sans); font-size: 15px; transition: opacity 200ms var(--ease), transform 200ms var(--ease);
}
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

/* ===== Cards, from 1024 px (proposal 2) ===== */
@media (min-width: 640px) {
  .bento { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bento li:first-child { grid-column: 1 / -1; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 1024px) {
  .hero { grid-template-columns: minmax(300px, 4fr) minmax(0, 8fr); gap: 48px; padding-top: 40px; padding-bottom: 40px; align-items: start; }
  .bento { grid-template-columns: repeat(4, minmax(0, 1fr)); grid-auto-rows: minmax(150px, auto); }
  .bento li:first-child { grid-column: span 2; grid-row: span 2; }
  .bento li:first-child .tile { padding: 32px; }
  .tile:not(.is-lead) .tile-text, .tile:not(.is-lead) .tile-cta { display: none; }
  .toolbar { position: sticky; top: var(--top-h); z-index: 20; }
  .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
  .note:hover { border-color: var(--accent); transform: translateY(-3px); }
  .note.is-featured { grid-column: span 2; background: var(--paper-2); }
  .note.is-featured .note-title { font-size: calc(clamp(22px, 2vw, 28px) * var(--text-scale)); font-weight: 800; }
  /* With JavaScript, cards show an excerpt and open the full note in the reader panel. */
  .js .note-title a::after { content: ''; position: absolute; inset: 0; border-radius: var(--radius); }
  .js .note-source { position: relative; z-index: 1; }
  .js .note-body p:not(:first-child) { display: none; }
  .js .note-body p { display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; font-size: calc(15px * var(--text-scale)); }
  .js .note-more { display: block; margin-top: auto; font-family: var(--sans); font-weight: 600; font-size: 14px; color: var(--accent); }
  .js .feed.is-list .grid { grid-template-columns: minmax(0, 1fr); gap: 0; border-top: 1px solid var(--rule-soft); }
  .js .feed.is-list .note { flex-direction: row; align-items: center; gap: 16px; padding: 14px 8px; border: 0; border-bottom: 1px solid var(--rule-soft); border-radius: 0; background: transparent; transform: none; }
  .js .feed.is-list .note:hover { background: var(--paper); }
  .js .feed.is-list .note-top { flex: none; width: 36px; }
  .js .feed.is-list .note-top > span:not(.note-num) { display: none; }
  .js .feed.is-list .note-title { flex: 1; font-size: calc(17px * var(--text-scale)); font-weight: 700; }
  .js .feed.is-list .note-body, .js .feed.is-list .note-more { display: none; }
  .js .feed.is-list .note-source { flex: none; width: 210px; }
  .js .feed.is-list .note.is-featured { grid-column: auto; }
}
@media (min-width: 1500px) { .grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

/* Reader panel (cards) */
.panel-reader { width: 100%; max-width: 100%; height: 100%; max-height: 100%; margin: 0 0 0 auto; padding: 0; border: 0; background: var(--paper); color: var(--text); }
.panel-reader[open] { display: flex; flex-direction: column; animation: slide-in 300ms var(--ease); }
.panel-reader::backdrop { background: var(--scrim); }
@keyframes slide-in { from { transform: translateX(40px); opacity: 0; } to { transform: none; opacity: 1; } }
@media (min-width: 1024px) { .panel-reader { width: min(720px, 52vw); border-left: 1px solid var(--rule-soft); } }
.reader-bar { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-bottom: 1px solid var(--rule-soft); font-family: var(--sans); font-weight: 600; font-size: 14px; color: var(--muted); }
.reader-bar .pos { flex: 1; text-align: center; }
.reader-progress { height: 3px; background: var(--rule-soft); }
.reader-progress span { display: block; height: 100%; background: var(--accent); transition: width 300ms var(--ease); }
.reader-scroll { flex: 1; overflow-y: auto; overscroll-behavior: contain; }
.reader-body { max-width: 680px; margin: 0 auto; padding: 28px 24px 36px; }
.reader-body.is-next { animation: from-right 260ms var(--ease); }
.reader-body.is-prev { animation: from-left 260ms var(--ease); }
@keyframes from-right { from { opacity: 0; transform: translateX(24px); } to { opacity: 1; transform: none; } }
@keyframes from-left { from { opacity: 0; transform: translateX(-24px); } to { opacity: 1; transform: none; } }
.reader-kicker { font-family: var(--sans); font-weight: 600; font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent); }
.reader-body h2 { margin-top: 8px; font-family: var(--head); font-weight: 800; font-size: calc(clamp(26px, 2.6vw, 34px) * var(--text-scale)); line-height: 1.18; color: var(--ink); text-wrap: balance; }
.reader-source { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; margin: 8px 0 12px; font-family: var(--sans); font-weight: 600; font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase; }
.reader-source .icon { width: 14px; height: 14px; }
.reader-body .par { font-size: calc(17.5px * var(--text-scale)); line-height: 1.75; }
.reader-body .par + .par { margin-top: 16px; }
.reader-tools { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 26px; }
.reader-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 12px; padding-bottom: calc(12px + env(safe-area-inset-bottom)); border-top: 1px solid var(--rule-soft); }
.reader-nav .btn { min-height: 52px; }

/* ===== Stories, below 1024 px with JavaScript (proposal 3) ===== */
@media (max-width: 1023px) {
  .js .page-edition .top, .js .page-edition .toolbar, .js .page-edition .feed { display: none; }
  .js .page-edition .hero { gap: 0; padding: 0; max-width: none; }
  .js .page-edition .hero-intro {
    background: var(--accent); color: var(--paper); padding: 28px var(--gutter) 28px;
    display: flex; flex-direction: column; gap: 14px; min-height: 78vh; min-height: 78svh;
  }
  .js .page-edition .kicker { display: flex; }
  .js .page-edition .hero-by { order: 3; color: var(--on-accent-soft); }
  .js .page-edition .by-label { display: none; }
  .js .page-edition .hero-by::before { content: 'Por '; }
  .js .page-edition .hero h1 { margin-top: auto; color: var(--paper); font-size: clamp(44px, 12vw, 80px); line-height: 0.98; }
  .js .page-edition .hero-date { color: var(--paper); font-size: clamp(22px, 5.5vw, 30px); order: 2; }
  .js .page-edition .hero h1 { order: 1; }
  .js .page-edition .stats { order: 4; margin-top: 4px; border-color: var(--on-accent-line); }
  .js .page-edition .stats li { color: var(--on-accent-soft); }
  .js .page-edition .stats li + li { border-color: var(--on-accent-line); }
  .js .page-edition .stats strong { color: var(--paper); }
  .js .page-edition .dist { display: none; }
  .js .page-edition .cover-actions { order: 5; display: grid; gap: 10px; margin-top: 6px; }
  .js .page-edition .cover-actions .btn { min-height: 56px; font-size: 17px; }
  .js .page-edition .kicker { order: 0; }
  .js .page-edition .hero-essentials { background: var(--paper); padding: 28px var(--gutter) 32px; }
  .js .page-edition .bento { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .js .page-edition .bento li:first-child { grid-column: auto; }
  .js .page-edition .tile, .js .page-edition .tile.is-lead {
    display: grid; grid-template-columns: 48px 1fr 20px; gap: 4px 12px; align-items: center; padding: 16px 4px; border: 0; border-top: 1px solid var(--rule-soft);
    border-radius: 0; background: transparent; color: var(--ink); transform: none;
  }
  .js .page-edition .tile .tile-num, .js .page-edition .tile.is-lead .tile-num { grid-row: span 2; font-size: 38px; color: var(--accent); }
  .js .page-edition .tile .tile-section, .js .page-edition .tile.is-lead .tile-section { color: var(--muted); }
  .js .page-edition .tile .tile-title, .js .page-edition .tile.is-lead .tile-title { font-size: calc(17px * var(--text-scale)); font-weight: 700; line-height: 1.3; }
  .js .page-edition .tile-text { display: none; }
  .js .page-edition .tile-cta { grid-row: 1 / span 2; grid-column: 3; padding: 0; font-size: 0; }
  .js .page-edition .tile-cta::after { content: '→'; font-size: 18px; color: var(--accent); }
  .js .page-edition .section-chips { display: flex; }
}
.section-chips { display: none; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.section-chips button { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 16px; border-radius: 999px; border: 1.5px solid var(--rule-mid); background: var(--paper); font-family: var(--sans); font-weight: 600; font-size: 14px; color: var(--ink); }
.section-chips button span { color: var(--muted); font-weight: 500; }

/* Story reader */
body.is-reading { overflow: hidden; }
.story { position: fixed; inset: 0; z-index: 40; display: flex; flex-direction: column; background: var(--paper); }
.story-head { border-bottom: 1px solid var(--rule-soft); padding: 10px var(--gutter) 8px; padding-top: calc(10px + env(safe-area-inset-top)); background: var(--paper); }
.segments { display: flex; gap: 4px; margin-bottom: 8px; }
.segments button { flex: 1; height: 14px; padding: 5px 0; border: 0; background: none; }
.segments button::before { content: ''; display: block; height: 4px; border-radius: 999px; background: var(--rule-soft); }
.segments button::after { content: ''; display: block; height: 4px; margin-top: -4px; width: 0; border-radius: 999px; background: var(--accent); transition: width 300ms var(--ease); }
.segments button.is-done::after, .segments button.is-current::after { width: 100%; }
.story-row { display: flex; align-items: center; gap: 8px; }
.story-chapter { flex: 1; min-width: 0; text-align: center; font-family: var(--sans); font-weight: 700; font-size: 13px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.story-chapter small { font-weight: 500; letter-spacing: 0; text-transform: none; color: var(--muted); font-size: 13px; }
.story-stage { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; transition: background-color 400ms var(--ease), color 400ms var(--ease); }
.story-content { max-width: 760px; margin: 0 auto; min-height: 100%; display: flex; flex-direction: column; gap: 14px; padding: 28px var(--gutter) 32px; }
.story-content.is-next { animation: from-right 300ms var(--ease); }
.story-content.is-prev { animation: from-left 300ms var(--ease); }
.story-kicker { font-family: var(--sans); font-weight: 700; font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent); }
.story-num { font-family: var(--head); font-weight: 800; font-size: 64px; line-height: 0.85; color: var(--accent); }
.story-content h2 { font-family: var(--head); font-weight: 800; font-size: calc(clamp(26px, 6vw, 40px) * var(--text-scale)); line-height: 1.15; color: var(--ink); text-wrap: balance; }
.story-content .par { font-size: calc(17.5px * var(--text-scale)); line-height: 1.75; }
.story-source { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; font-family: var(--sans); font-weight: 600; font-size: 12.5px; letter-spacing: 0.06em; text-transform: uppercase; }
.story-source .icon { width: 14px; height: 14px; }
.story-tools { display: flex; flex-wrap: wrap; gap: 8px; margin-top: auto; padding-top: 16px; }
.story-stage.is-essential { background: var(--accent); color: var(--paper); }
.story-stage.is-essential .story-kicker, .story-stage.is-essential .story-num { color: var(--on-accent-soft); }
.story-stage.is-essential h2 { color: var(--paper); }
.story-stage.is-essential .story-content { justify-content: center; }
.story-stage.is-essential .chip-btn { color: var(--paper); border-color: var(--on-accent-line); }
.story-stage.is-section { background: var(--paper-2); }
.story-stage.is-section .story-content { justify-content: center; }
.story-stage.is-section h2 { font-size: calc(clamp(40px, 11vw, 72px) * var(--text-scale)); line-height: 1; color: var(--accent); }
.story-stage.is-end .story-content { justify-content: center; align-items: center; text-align: center; }
.story-list { list-style: none; padding: 0; display: grid; }
.story-list button {
  width: 100%; display: grid; grid-template-columns: 34px 1fr 20px; gap: 10px; align-items: start; text-align: left; padding: 12px 0;
  border: 0; border-top: 1px solid var(--rule-soft); background: none; font-family: var(--sans); font-size: calc(16px * var(--text-scale)); line-height: 1.4; color: var(--text);
}
.story-list .n { font-weight: 700; color: var(--accent); }
.story-list .icon { width: 18px; height: 18px; color: var(--accent); visibility: hidden; }
.story-list button.is-read .icon { visibility: visible; }
.story-list button[aria-current="true"] { color: var(--accent); font-weight: 700; }
.end-actions { display: grid; gap: 10px; width: 100%; max-width: 380px; margin-top: 8px; }
.story-controls { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 10px var(--gutter) calc(10px + env(safe-area-inset-bottom)); border-top: 1px solid var(--rule-soft); background: var(--paper); }
.story-controls .btn { min-height: 56px; }

/* Index sheet (stories) */
.index-sheet { width: min(100%, 640px); max-width: 100%; max-height: min(88vh, 820px); margin: auto auto 0; padding: 0; border: 0; border-radius: 16px 16px 0 0; background: var(--paper); color: var(--text); }
.index-sheet[open] { display: flex; flex-direction: column; animation: sheet-up 280ms var(--ease); }
.index-sheet::backdrop { background: var(--scrim); }
@keyframes sheet-up { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
.index-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px 12px 24px; border-bottom: 1px solid var(--rule-soft); }
.index-head p { font-family: var(--head); font-weight: 800; font-size: 20px; color: var(--accent); }
.index-body { overflow-y: auto; padding: 8px 24px 28px; }
.index-body h3 { font-family: var(--head); font-weight: 800; font-size: 13px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--accent); margin: 18px 0 2px; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* Subscriptions: pitch, plans, sign-in and account (phase 2) */
.site-messages { padding-top: 16px; display: grid; gap: 8px; }
.site-message { padding: 12px 16px; border-left: 4px solid var(--ink); background: var(--paper); font-family: var(--sans); font-weight: 600; font-size: 15px; color: var(--ink); }
.site-message-error { border-left-color: var(--accent); color: var(--accent); }
.footer-account { font-family: var(--sans); font-size: 14px; color: var(--muted); }
.footer-account a { color: var(--ink); }
.narrow { max-width: 720px; }
.pitch { padding-top: 32px; padding-bottom: 56px; display: grid; gap: 40px; }
.pitch-intro { display: grid; gap: 18px; max-width: 760px; }
.pitch-kicker { font-family: var(--sans); font-weight: 600; font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent); }
.pitch-lead { font-size: 18px; line-height: 1.6; color: var(--text); }
.pitch-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.plan-list { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 10px; font-family: var(--sans); }
.plan-list li { display: grid; padding: 12px 16px; border: 1.5px solid var(--rule-mid); border-radius: 6px; background: var(--paper); }
.plans { border: 0; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.plans legend { margin-bottom: 8px; font-family: var(--sans); font-weight: 700; font-size: 14px; color: var(--ink); }
.plan-card { position: relative; display: grid; padding: 14px 16px; border: 1.5px solid var(--rule-mid); border-radius: 6px; background: var(--paper); font-family: var(--sans); cursor: pointer; }
.plan-card:has(input:checked) { border-color: var(--accent); box-shadow: inset 0 0 0 1.5px var(--accent); }
.plan-card input { position: absolute; top: 14px; right: 14px; accent-color: var(--accent); }
.plan-name { font-weight: 700; font-size: 14px; color: var(--ink); }
.plan-price { font-family: var(--head); font-weight: 800; font-size: 26px; color: var(--accent); }
.plan-period { font-size: 13px; color: var(--muted); }
.subscribe-form { display: grid; gap: 16px; }
.form-field { display: grid; gap: 6px; font-family: var(--sans); }
.form-field label { font-weight: 700; font-size: 14px; color: var(--ink); }
.form-field input { min-height: 48px; padding: 10px 12px; border: 1.5px solid var(--rule-mid); border-radius: 4px; background: var(--paper); font: inherit; font-size: 16px; color: var(--ink); }
.form-field input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px oklch(0.42 0.16 25 / 0.15); }
.form-hint { font-family: var(--sans); font-size: 14px; color: var(--muted); }
.form-optional { font-weight: 400; color: var(--muted); }
.consent { display: flex; gap: 10px; align-items: start; font-family: var(--sans); font-size: 14px; color: var(--text); }
.consent input { width: 20px; height: 20px; margin-top: 2px; flex: none; accent-color: var(--accent); }
.subscribe-form .btn { justify-self: start; min-height: 50px; }
.headlines { display: grid; gap: 10px; max-width: 900px; }
.headlines-title { font-family: var(--head); font-weight: 800; font-size: 24px; color: var(--ink); }
.headlines-note { font-family: var(--sans); font-size: 14px; color: var(--muted); }
.headlines-section { margin-top: 12px; padding-bottom: 6px; border-bottom: 2px solid var(--accent); font-family: var(--head); font-weight: 800; font-size: 15px; letter-spacing: 0.05em; text-transform: uppercase; color: var(--accent); }
.headlines-list { list-style: none; padding: 0; display: grid; gap: 8px; }
.headlines-list li { font-family: var(--head); font-weight: 700; font-size: 17px; line-height: 1.35; color: var(--ink); }
.headlines-source { display: block; margin-top: 2px; font-family: var(--sans); font-weight: 600; font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.account { display: grid; grid-template-columns: max-content 1fr; gap: 8px 16px; font-family: var(--sans); }
.account dt { font-weight: 700; color: var(--ink); }
.account-title { margin-top: 12px; font-family: var(--head); font-weight: 800; font-size: 20px; color: var(--ink); }
.payment-list { list-style: none; padding: 0; display: grid; gap: 4px; font-family: var(--sans); font-size: 15px; }
.link-button { background: none; border: 0; padding: 0; min-height: 44px; font-family: var(--sans); font-weight: 600; color: var(--accent); text-decoration: underline; cursor: pointer; }
.legal h2 { margin-top: 8px; font-family: var(--head); font-weight: 800; font-size: 20px; color: var(--ink); }
.legal ul { padding-left: 20px; display: grid; gap: 6px; }
.legal-draft { padding: 10px 14px; border-left: 4px solid var(--accent); background: var(--paper); font-family: var(--sans); font-weight: 600; font-size: 14px; color: var(--accent); }
