/* Layout: editorial magazine. Wide masthead, one lead story, a tight card grid, a dark "series" band, quiet footer.
   Tokens match coffee.rypens.eu (paper, ink, sage accent; Archivo condensed + Inter + Plex Mono) so the subdomain feels like home. */
:root {
  --paper: #eceeea; --card: #f8f9f6; --ink: #1f1a17; --muted: #67615c; --line: #d4d7d0;
  --accent: #2f6b5a; --accent-ink: #ffffff;
  --band: #1b1d1b; --band-ink: #ece8e3; --band-mute: #a39c96; --band-line: #343834; --glow: #74b8a3;
  --display: "Archivo", "Arial Narrow", system-ui, sans-serif;
  --body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, Menlo, monospace;
  --wrap: 1180px;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --paper: #141312; --card: #1e1c1b; --ink: #ece8e3; --muted: #a39c96; --line: #34302d;
  --accent: #74b8a3; --accent-ink: #0f1a16; --band: #0d0e0d; --band-ink: #ece8e3; --band-mute: #a39c96; --band-line: #2a2d2a; color-scheme: dark } }
:root[data-theme="dark"] {
  --paper: #141312; --card: #1e1c1b; --ink: #ece8e3; --muted: #a39c96; --line: #34302d;
  --accent: #74b8a3; --accent-ink: #0f1a16; --band: #0d0e0d; --band-ink: #ece8e3; --band-mute: #a39c96; --band-line: #2a2d2a; color-scheme: dark }

* { box-sizing: border-box }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 16px/1.6 var(--body); -webkit-font-smoothing: antialiased }
a { color: inherit; text-decoration-color: color-mix(in srgb, currentColor 35%, transparent); text-underline-offset: 3px }
a:hover { color: var(--accent) }
a:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px }
img { display: block; max-width: 100%; height: auto }
.wrap { max-width: var(--wrap); margin: 0 auto; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)) }
.mono { font-family: var(--mono); font-size: 12.5px; letter-spacing: .02em; color: var(--muted) }
.kicker { font-family: var(--mono); font-size: 12px; text-transform: uppercase; letter-spacing: .12em; color: var(--accent) }
h1, h2, h3 { font-family: var(--display); font-stretch: 78%; font-weight: 750; line-height: 1.02; letter-spacing: -.01em; text-wrap: balance; margin: 0 }

/* Masthead */
.top { border-bottom: 1px solid var(--line) }
.top .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding-block: 18px }
.brand { font-family: var(--display); font-stretch: 75%; font-weight: 800; font-size: 26px; letter-spacing: -.01em; text-decoration: none }
.brand span { color: var(--accent) }
nav ul { display: flex; flex-wrap: wrap; gap: 4px 22px; list-style: none; margin: 0; padding: 0; font-size: 14.5px; font-weight: 500 }
nav a { text-decoration: none }
nav a[aria-current] { color: var(--accent) }
.ext::after { content: " ↗"; font-size: .85em; color: var(--muted) }

/* Hero */
.hero .wrap { padding-block: clamp(40px, 7vw, 88px) clamp(28px, 4vw, 48px); display: grid; gap: 20px }
.hero h1 { font-size: clamp(56px, 11vw, 148px); font-stretch: 72%; font-weight: 800; line-height: .9 }
.hero h1 em { font-style: normal; color: var(--accent) }
.hero p { max-width: 58ch; font-size: clamp(17px, 2vw, 20px); color: var(--muted); margin: 0 }
.hero .mono { font-size: 13px }

/* Sections */
.sec { padding-block: clamp(32px, 5vw, 56px) }
.sec-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; border-top: 2px solid var(--ink); padding-top: 12px; margin-bottom: 28px }
.sec-head h2 { font-size: 30px }

/* Lead + cards */
.lead { display: grid; grid-template-columns: 1.15fr 1fr; gap: clamp(20px, 4vw, 48px); align-items: center; margin-bottom: 48px; text-decoration: none }
.lead img { width: 100%; aspect-ratio: 4/3; object-fit: cover; border-radius: 4px }
.lead h3 { font-size: clamp(36px, 5vw, 60px); margin: 10px 0 14px }
.lead p { color: var(--muted); max-width: 46ch; margin: 0 0 14px }
.grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 32px 24px }
.card { display: grid; gap: 10px; align-content: start; text-decoration: none; min-width: 0 }
.card img { width: 100%; aspect-ratio: 4/5; object-fit: cover; border-radius: 4px; transition: transform .4s ease }
.card:hover img, .lead:hover img { transform: scale(1.015) }
.card h3 { font-size: 23px }
.lead:hover h3, .card:hover h3 { color: var(--accent) }

/* Series band */
.band { background: var(--band); color: var(--band-ink) }
.band .sec-head { border-color: var(--band-ink) }
.band .mono { color: var(--band-mute) }
.band .kicker { color: var(--glow) }
.series { display: grid; grid-template-columns: 1.6fr 1fr 1fr; gap: 24px }
.sotd { grid-row: span 2; display: grid; grid-template-columns: minmax(0, 220px) minmax(0, 1fr); gap: 24px; align-items: end; padding: 24px; border: 1px solid var(--band-line); border-radius: 6px; text-decoration: none }
.sotd img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 3px; box-shadow: 0 18px 40px rgb(0 0 0 / .45) }
.sotd h3 { font-size: clamp(34px, 4vw, 48px); margin: 8px 0 6px }
.sotd .no { font-family: var(--display); font-stretch: 72%; font-weight: 800; font-size: 72px; line-height: .8; color: var(--glow) }
.sotd p { margin: 0; color: var(--band-mute) }
.tile { padding: 22px; border: 1px solid var(--band-line); border-radius: 6px; display: grid; gap: 8px; align-content: start; text-decoration: none }
.tile h3 { font-size: 28px }
.tile p { margin: 0; color: var(--band-mute); font-size: 15px }
.band a:hover { color: var(--glow) }
.band a:hover h3 { color: var(--glow) }
.soon { justify-self: start; font-family: var(--mono); font-size: 11px; text-transform: uppercase; letter-spacing: .1em; padding: 3px 8px; border: 1px solid var(--glow); color: var(--glow); border-radius: 99px }

/* Archive by year */
.years { display: grid; grid-template-columns: repeat(14, minmax(0, 1fr)); gap: 6px; align-items: end; height: 170px }
.yr { display: grid; grid-template-rows: 1fr auto auto; gap: 6px; height: 100%; text-decoration: none; text-align: center; font-variant-numeric: tabular-nums }
.yr i { align-self: end; display: block; background: var(--accent); border-radius: 2px 2px 0 0; min-height: 3px; opacity: .85 }
.yr:hover i { opacity: 1 }
.yr b { font: 500 11.5px var(--mono); color: var(--muted) }
.yr span { font: 500 12px var(--mono) }

/* Footer */
footer { border-top: 1px solid var(--line); margin-top: 24px }
footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px 32px; padding-block: 28px 40px; font-size: 14px; color: var(--muted) }
.addr { user-select: all; font-family: var(--mono) }

/* Post page */
.crumb { padding-block: 22px 0 }
.post-hero .wrap { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 420px); gap: clamp(24px, 5vw, 64px); align-items: end; padding-block: 28px 40px }
.post-hero h1 { font-size: clamp(52px, 8vw, 104px); font-stretch: 72%; font-weight: 800; line-height: .92; margin: 14px 0 18px }
.post-hero .meta { display: flex; flex-wrap: wrap; gap: 6px 18px }
.post-hero img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 4px; box-shadow: 0 24px 60px rgb(0 0 0 / .18) }
.facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-block: 1px solid var(--line); margin-bottom: 40px }
.facts div { padding: 14px 16px 14px 0; display: grid; gap: 2px; min-width: 0 }
.facts div + div { padding-left: 16px; border-left: 1px solid var(--line) }
.facts b { font-family: var(--display); font-stretch: 80%; font-weight: 700; font-size: 20px; line-height: 1.15 }
.body { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 300px); gap: clamp(24px, 5vw, 72px); padding-bottom: 56px }
.prose { max-width: 64ch; font-size: 18px; line-height: 1.7; min-width: 0 }
.prose p { margin: 0 0 1.1em }
.prose p:first-child::first-letter { font-family: var(--display); font-stretch: 72%; font-weight: 800; float: left; font-size: 4.4em; line-height: .82; padding: 6px 10px 0 0; color: var(--accent) }
.video { display: grid; grid-template-columns: auto 1fr; gap: 16px; align-items: center; margin: 28px 0; padding: 18px; border-radius: 6px; background: var(--band); color: var(--band-ink); text-decoration: none }
.video .play { width: 56px; height: 56px; border-radius: 50%; background: var(--glow); display: grid; place-items: center }
.video .play::before { content: ""; border-left: 16px solid var(--band); border-block: 10px solid transparent; margin-left: 4px }
.video small { display: block; color: var(--band-mute); font-family: var(--mono); font-size: 12px }
.video:hover { color: var(--band-ink) }
aside h2 { font-size: 22px; margin-bottom: 10px }
.tracks { list-style: none; margin: 0; padding: 0; counter-reset: t; border-top: 1px solid var(--line) }
.tracks li { counter-increment: t; display: grid; grid-template-columns: 2.2em 1fr; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 14.5px; line-height: 1.4 }
.tracks li::before { content: counter(t, decimal-leading-zero); font: 500 12px/1.7 var(--mono); color: var(--muted) }
.tracks li.on { color: var(--accent); font-weight: 600 }
.tracks li.on::before { color: var(--accent) }
.tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 28px }
.tags a { font: 500 12px var(--mono); padding: 4px 10px; border: 1px solid var(--line); border-radius: 99px; text-decoration: none; color: var(--muted) }
.tags a:hover { border-color: var(--accent) }
.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; border-top: 2px solid var(--ink); padding-block: 18px 8px }
.pager a { text-decoration: none; display: grid; gap: 4px }
.pager a:last-child { text-align: right }
.pager b { font-family: var(--display); font-stretch: 80%; font-weight: 700; font-size: 22px; line-height: 1.1 }

@media (max-width: 900px) {
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)) }
  .series { grid-template-columns: 1fr 1fr }
  .sotd { grid-column: 1 / -1; grid-row: auto }
  .lead, .post-hero .wrap, .body { grid-template-columns: 1fr }
  .post-hero img { max-width: 420px }
}
@media (max-width: 560px) {
  .grid, .series { grid-template-columns: 1fr }
  .sotd { grid-template-columns: 1fr }
  .sotd img { max-width: 240px }
  .years { gap: 3px }
  .yr b { font-size: 9.5px }
  .yr span { font-size: 9px; writing-mode: vertical-rl; transform: rotate(180deg); justify-self: center }
  .facts { grid-template-columns: 1fr }
  .facts div + div { padding-left: 0; border-left: 0; border-top: 1px solid var(--line) }
  .pager { grid-template-columns: 1fr }
  .pager a:last-child { text-align: left }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important } }

.typecover { display: grid; align-content: end; gap: 6px; aspect-ratio: 4/5; padding: 20px; border-radius: 4px; background: var(--accent); color: var(--accent-ink); overflow: hidden }
.typecover b { font-family: var(--display); font-stretch: 72%; font-weight: 800; font-size: clamp(40px, 6vw, 72px); line-height: .9; text-wrap: balance; overflow-wrap: anywhere }
.typecover span { font: 500 12px var(--mono); text-transform: uppercase; letter-spacing: .1em; opacity: .85 }
.lead .typecover { aspect-ratio: 4/3 }
.sotd .typecover { aspect-ratio: 1; background: var(--glow); color: var(--band) }
.embed { position: relative; aspect-ratio: 16/9; margin: 24px 0; border-radius: 6px; overflow: hidden; background: var(--band); max-width: 100% }
.embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0 }
.spotify { margin: 24px 0 } .spotify iframe { width: 100%; border: 0; border-radius: 12px }
.linkcard { font: 500 13px var(--mono); padding: 6px 12px; border: 1px solid var(--line); border-radius: 99px; text-decoration: none }
.prose img { border-radius: 4px; margin: 8px 0 }
.prose a img { display: inline-block }
.prose h2, .prose h3, .prose h4 { margin: 1.6em 0 .5em; font-size: 1.5em }
.prose h4 { font-size: 1.2em }
.prose blockquote { margin: 1.2em 0; padding-left: 18px; border-left: 3px solid var(--accent); color: var(--muted) }
.prose ul, .prose ol { padding-left: 1.3em } .prose li { margin: .25em 0 }
.prose table { border-collapse: collapse; display: block; overflow-x: auto } .prose td, .prose th { border: 1px solid var(--line); padding: 6px 10px }
.prose code { font-family: var(--mono); font-size: .9em }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 2em 0 }
.single .body { grid-template-columns: minmax(0, 1fr) }
.single .prose { margin: 0 auto }
.prose p:first-child::first-letter { all: unset }
.prose > p:first-child::first-letter { font-family: var(--display); font-stretch: 72%; font-weight: 800; float: left; font-size: 4.4em; line-height: .82; padding: 6px 10px 0 0; color: var(--accent) }
.post-hero.nocover .wrap { grid-template-columns: minmax(0, 1fr) }
.page-head .wrap { padding-block: clamp(32px, 6vw, 72px) 24px; display: grid; gap: 14px }
.page-head h1 { font-size: clamp(48px, 8vw, 104px); font-stretch: 72%; font-weight: 800; line-height: .92 }
.page-head p { margin: 0; max-width: 60ch; color: var(--muted); font-size: 18px }
.rows { list-style: none; margin: 0 0 40px; padding: 0; border-top: 1px solid var(--line) }
.rows li a { display: grid; grid-template-columns: 7.5em minmax(0, 1fr) auto; gap: 16px; align-items: baseline; padding: 11px 0; border-bottom: 1px solid var(--line); text-decoration: none }
.rows li a:hover b { color: var(--accent) }
.rows b { font-weight: 600 } .rows .mono { white-space: nowrap }
.yearhead { font-size: 40px; margin: 28px 0 12px }
.bags { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 24px 16px; margin-bottom: 40px }
.bag { display: grid; gap: 6px; align-content: start; text-decoration: none; min-width: 0 }
.bag img, .bag .noimg { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 4px; background: var(--line) }
.bag b { font-family: var(--display); font-stretch: 80%; font-weight: 700; font-size: 18px; line-height: 1.1 }
.bag:hover b { color: var(--accent) }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 28px }
.chips a { font: 500 12.5px var(--mono); padding: 5px 12px; border: 1px solid var(--line); border-radius: 99px; text-decoration: none }
.chips a:hover, .chips a[aria-current] { border-color: var(--accent); color: var(--accent) }
.empty { padding: 40px 24px; border: 1px dashed var(--line); border-radius: 6px; text-align: center; color: var(--muted); margin-bottom: 48px }
.facts.wide { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)) }
.facts.wide div + div { padding-left: 0; border-left: 0 }
.facts.wide div { padding-left: 0; padding-right: 16px }
@media (max-width: 560px) { .rows li a { grid-template-columns: 1fr; gap: 2px } .rows .mono { white-space: normal } }
