:root { color-scheme: light; --ink: #111; --muted: #767676; --paper: #fafafa; --font-heading: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif; --red: #ee2926; --ease: cubic-bezier(.2,.65,.3,1); }
* { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: var(--paper); font: clamp(14px, 1.5vw + 0.2rem, 18px)/1.35 'Courier New', Courier, monospace; letter-spacing: .01em; -webkit-font-smoothing: antialiased; }
a { color: inherit; }
button, input, textarea { font: inherit; }
button { color: inherit; cursor: pointer; }
button:disabled { opacity: .35; cursor: default; }
button:focus, a:focus, input:focus, textarea:focus, [tabindex]:focus { outline: none; }
[hidden] { display: none !important; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }
.skip-link { position: fixed; top: -100px; left: 20px; z-index: 100; background: white; padding: 12px; }
.skip-link:focus { top: 10px; }
.stories-header { height: 96px; padding: 24px 50px; display: flex; align-items: flex-start; gap: clamp(80px,13.2vw,210px); background: var(--paper); position: relative; z-index: 10; }
.rad-logo { font-family: var(--font-heading); font-size: clamp(18px, 1.8vw, 24px); font-weight: 900; line-height: 1; letter-spacing: 0; text-decoration: none; white-space: nowrap; }
.rad-logo span { color: #b9b9b9; }
.stories-wordmark { position: absolute; left: 50%; transform: translateX(-50%); font-size: 14px; line-height: 1; letter-spacing: 0; text-transform: uppercase; padding-top: 6px; text-decoration: none; font-weight: 400; }
.story-shell { margin: 0 14.2vw 0 24vw; min-height: calc(100svh - 96px); display: flex; flex-direction: column; padding: max(65px, calc(31vh - 96px)) 0 65px; }
.story-layout { display: grid; grid-template-columns: minmax(0, 1.8fr) minmax(0,1fr); grid-template-rows: auto 1fr; column-gap: clamp(38px,5.6vw,86px); align-items: start; transition: opacity 100ms ease, transform 140ms var(--ease); }
.story-layout.is-changing { opacity: 0; transform: translateY(7px); }
.story-heading { grid-column: 2; grid-row: 1; margin-bottom: 24px; }
.story-heading h1 { font-family: var(--font-heading); font-size: clamp(18px,2.2vw,28px); line-height: 1.1; letter-spacing: 0; font-weight: 600; text-transform: uppercase; margin: -4px 0 6px; overflow-wrap: anywhere; }
.story-heading time { font-size: 14px; }
.story-gallery { grid-column: 1; grid-row: 1 / 3; min-width: 0; }
.story-stage { display: grid; place-items: center; width: 100%; aspect-ratio: 3/2; overflow: hidden; position: relative; background: transparent; }
.story-stage img, .story-stage video { width: 100%; height: 100%; object-fit: contain; object-position: left center; min-height: 0; position: absolute; inset: 0; }
.story-stage .is-portrait { object-position: center; }
.story-stage .media-error { padding: 20px; text-align: center; font-size: 12px; }
.story-thumbnails { display: grid; grid-template-columns: repeat(var(--thumbnail-columns, 8), minmax(0,1fr)); gap: 10px 8px; padding: 12px 0 5px; overflow: visible; }
.story-thumbnail { position: relative; min-width: 0; width: 100%; aspect-ratio: 3/2; padding: 0; border: 0; background: #f3f3f3; opacity: .58; transition: opacity .15s; }
.story-thumbnail:hover, .story-thumbnail[aria-pressed="true"] { opacity: 1; }
.story-thumbnail[aria-pressed="true"]::after { content: ""; position: absolute; inset: auto 0 -5px; height: 2px; background: var(--ink); }
.story-thumbnail img { display: block; width: 100%; height: 100%; object-fit: cover; }
.gallery-footer { display: flex; justify-content: space-between; align-items: center; height: 36px; min-height: 36px; flex-shrink: 0; color: var(--muted); font-size: 10px; font-variant-numeric: tabular-nums; }
.gallery-footer button { border: 0; padding: 4px 0; color: var(--muted); background: transparent; font-size: 10px; }
.story-copy { grid-column: 2; grid-row: 2; font-size: inherit; line-height: 1.35; overflow-wrap: anywhere; }
.story-copy p { margin: 0 0 1.3em; white-space: pre-line; text-align: justify; text-align-last: left; }
.timeline { position: fixed; left: 0; top: 28vh; bottom: 5vh; width: min(330px, 22vw); z-index: 15; overflow-y: auto; overflow-x: hidden; scrollbar-width: none; display: flex; flex-direction: column; padding: 8px 0; pointer-events: auto; }
.timeline::-webkit-scrollbar { display: none; }
.timeline-stop { flex: 0 0 16px; position: relative; padding: 0; height: 16px; border: 0; background: transparent; text-align: left; width: 100%; pointer-events: auto; }
.timeline-stop::before { content: ""; position: absolute; left: 0; top: 6px; height: 3px; width: 18px; background: var(--ink); transition: width 180ms var(--ease), background 150ms; }
.timeline-stop[aria-current="true"]::before { width: 36px; background: var(--red); }
.timeline-stop[data-distance="2"]::before { width: 37px; }
.timeline-stop[data-distance="1"]::before { width: 66px; }
.timeline-stop[data-distance="0"]::before { width: 94px; }
.timeline-label { position: absolute; left: 106px; top: 50%; transform: translateY(-50%) translateX(-5px); opacity: 0; white-space: nowrap; background: var(--paper); padding: 3px 6px 3px 0; font-size: 13px; transition: opacity 150ms, transform 180ms; pointer-events: none; }
.timeline-stop[data-distance="0"] .timeline-label { opacity: 1; transform: translateY(-50%); }
.timeline-stop[aria-current="true"] .timeline-label { display: none; }
.timeline-stop:focus-visible { outline: none; }
.timeline-stop:focus-visible::before { outline: none; }
.story-pagination { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-top: 42px; font-size: 10px; color: var(--muted); }
.story-pagination button { background: none; border: 0; padding: 10px 0; font-size: 11px; }
.story-message { max-width: 560px; font-size: inherit; color: var(--muted); }
.story-message h1 { font-family: var(--font-heading); font-size: clamp(28px,3.2vw,48px); color: var(--ink); font-weight: 800; letter-spacing: -.01em; line-height: .95; text-transform: uppercase; }
.story-message button { background: none; border: 0; text-decoration: underline; padding: 0; }
@media (min-width: 1700px) { .story-shell { max-width: 1100px; margin-left: auto; margin-right: auto; } }
@media (max-width: 900px) {
  .stories-header { padding: 28px 28px; height: 90px; justify-content: space-between; gap: 20px; }
  .rad-logo { font-size: clamp(18px,1.8vw,24px); }
  .stories-wordmark { font-size: 14px; position: absolute; left: 50%; }
  .story-shell { margin: 0 14.5%; padding: 18.6vh 0 60px; display: block; min-height: calc(100svh - 90px); }
  .story-layout { display: flex; flex-direction: column; gap: 0; }
  .story-heading { order: 0; margin: 0 0 13vw; padding-left: 0; }
  .story-heading h1 { font-size: clamp(18px,2.2vw,28px); }
  .story-gallery { width: 100%; order: 1; }
  .story-copy { width: 100%; order: 2; margin-top: 8.4vw; padding: 0; font-size: inherit; line-height: 1.35; }
  .story-thumbnails { gap: 6px; padding-top: 10px; }
  .story-thumbnail { min-width: 0; }
  .timeline { top: 52vh; bottom: 9vh; width: 48px; }
  .timeline-stop { flex-basis: 14px; height: 14px; }
  .timeline-stop::before { width: 12px; height: 2px; top: 6px; }
  .timeline-stop[aria-current="true"]::before { width: 25px; }
  .timeline-stop[data-distance="2"]::before { width: 20px; }
  .timeline-stop[data-distance="1"]::before { width: 30px; }
  .timeline-stop[data-distance="0"]::before { width: 42px; }
  .timeline-label { left: 52px; font-size: 12px; }
  .story-pagination { margin-top: 36px; gap: 10px; }
}
@media (max-width: 380px) { .story-shell { margin-right: 8%; margin-left: 14%; } .stories-header { padding: 24px 20px; } .stories-wordmark { margin-right: 0; } }
/* Tablet: fit the complete composition to the viewport, in either orientation.
   Only unusually long story text has its own reading area; the page never scrolls. */
@media (min-width: 600px) and (max-width: 1366px) {
  .diary-page { height: 100dvh; overflow: hidden; }
  .diary-page .stories-header { height: 90px; }
  .story-shell { height: calc(100dvh - 90px); min-height: 0; padding: clamp(20px, 5vh, 65px) 0 22px; display: flex; }
  .story-layout { flex: 1; min-height: 0; grid-template-rows: auto minmax(0,1fr); }
  .story-gallery { min-height: 0; max-height: 100%; display: flex; flex-direction: column; }
  .story-stage { min-height: 0; max-height: calc(100dvh - 260px); aspect-ratio: 3/2; flex: 0 1 auto; background: transparent; }
  .story-thumbnails, .gallery-footer { flex-shrink: 0; }
  .story-copy { max-height: 100%; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
  .story-pagination { flex: 0 0 auto; margin-top: 20px; }
  .timeline { width: min(250px, 21vw); }
}
@media (min-width: 600px) and (max-width: 900px) {
  .story-shell { margin: 0 14.5%; }
  .story-layout { display: grid; grid-template-columns: minmax(0,1fr); grid-template-rows: auto minmax(0,auto) minmax(0,auto); align-content: center; gap: clamp(16px,4vh,46px); }
  .story-heading { grid-column: 1; grid-row: 1; margin: 0; }
  .story-gallery { grid-column: 1; grid-row: 2; }
  .story-stage { max-height: calc(100dvh - 400px); }
  .story-copy { grid-column: 1; grid-row: 3; margin: 0; max-height: 20vh; }
  .story-copy p:last-child { margin-bottom: 0; }
  .timeline { width: 12vw; top: 38vh; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; } }

.touch-timeline-hint { display: none; }
.timeline-preview { position: fixed; left: 58px; z-index: 30; max-width: calc(100vw - 76px); padding: 6px 10px; background: var(--paper); font-size: 12px; pointer-events: none; }
@media (pointer: coarse) {
  .timeline { touch-action: none; user-select: none; -webkit-user-select: none; }
  .touch-timeline-hint { display: block; position: fixed; bottom: max(20px,env(safe-area-inset-bottom)); left: 56px; right: 20px; z-index: 30; width: fit-content; max-width: calc(100vw - 76px); font-size: 11px; color: var(--muted); background: var(--paper); padding: 8px 10px; margin: 0; pointer-events: none; }
  .timeline.is-scrubbing .timeline-stop::before { transition-duration: 60ms; }
}
@media (max-width: 599px) {
  .diary-page .stories-header { height: 68px; padding: 22px 24px; }
  .story-shell { margin: 0 24px 0 56px; padding: 16px 0 max(16px,env(safe-area-inset-bottom)); min-height: calc(100svh - 68px); }
  .story-heading { margin: 0 0 16px; padding: 0; }
  .story-stage { max-height: 34svh; }
  .story-thumbnails { grid-template-columns: repeat(var(--thumbnail-columns-mobile, 6),minmax(0,1fr)); gap: 9px 6px; padding-top: 9px; }
  .gallery-footer { height: 28px; min-height: 28px; }
  .story-copy { margin-top: 12px; padding: 0; }
  .story-copy p:last-child { margin-bottom: 0; }
  .story-pagination { margin-top: 16px; gap: 8px; }
  .story-pagination button { min-height: 44px; padding: 10px 0; font-size: 12px; }
  .timeline { top: 132px; bottom: 24px; width: 48px; }
}
