/* =========================================================
   Modern Writing Lab: Current Events
   Loads on top of site.css, terms.css and future.css (top bar,
   sheets, stop headers, buttons, stats, bars, callouts, sources).
   The landing is a timeline: a vertical spine on phones, a
   two-sided spine on iPad portrait, a horizontal rail on desktop.
   A story opens on its own (#<story> in the URL).
   ========================================================= */

.ce-quiet *, .ce-quiet *::before, .ce-quiet *::after { animation: none !important; transition: none !important; }
.events-page [hidden] { display: none !important; }

/* category colors: chips, card pictures, story pictures */
.sc-models, .c-models { --c: var(--sky); }
.sc-safety, .c-safety { --c: var(--paper-2); }
.sc-money, .c-money { --c: var(--peach); }
.sc-society, .c-society { --c: color-mix(in srgb, var(--lime) 42%, var(--card)); }
.sc-science, .c-science { --c: var(--mint); }

/* ---------- which view is showing ---------- */
.js .ce-stories .ev { display: none; }
.js .ce-stories .ev.open { display: block; }
.js body.reading .ce-home { display: none; }
.ce-stories { padding-bottom: 20px; }

/* ---------- hero ---------- */
.ce-hero { padding-bottom: 18px; }
.ce-title { margin: 0; font-size: clamp(52px, 15vw, 132px); font-weight: 800; letter-spacing: -.055em; line-height: .88; }
.ce-title em { color: var(--blue); }
.ce-hero-b { margin-top: 18px; }
.ce-hero-b .kt-lede { max-width: 56ch; margin: 0; }
.ce-hero-b .kt-lede b { color: var(--ink); }
.ce-hero .lab-meter { margin-top: 18px; }

.ce-filters { display: flex; gap: 8px; margin: 22px calc(var(--gutter) * -1) 0; padding: 4px var(--gutter) 8px; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.ce-filters::-webkit-scrollbar { display: none; }
.ce-chip {
  flex: none; min-height: 44px; padding: 0 16px; border: 2px solid var(--ink); border-radius: 999px;
  background: var(--card); font-weight: 700; font-size: 15px; white-space: nowrap;
  transition: background-color .2s, box-shadow .2s, transform .2s var(--ease-spring);
}
.ce-chip::before { content: ""; display: inline-block; width: 10px; height: 10px; margin-right: 8px; border-radius: 50%; border: 1.5px solid var(--ink); background: var(--c, var(--ink)); }
.ce-chip[aria-pressed="true"] { background: var(--ink); color: var(--paper); box-shadow: 3px 3px 0 var(--blue); }
@media (hover: hover) { .ce-chip:hover { transform: translateY(-2px); } }

/* ---------- timeline: shared ---------- */
.tl { max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }
.tl-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.tl-hint { margin: 0; font-family: var(--f-mono); font-size: 13px; color: var(--ink-2); }
.tl-hint-d, .tl-nav { display: none; }
.tl-track { display: none; }
.tl-arrow { width: 48px; height: 48px; border: 2px solid var(--ink); border-radius: 50%; background: var(--card); font-size: 20px; font-weight: 800; box-shadow: 3px 3px 0 var(--ink); }
.tl-arrow:hover { background: var(--lime); }
.tl-arrow[disabled] { opacity: .35; box-shadow: none; cursor: default; }
.tl-list { list-style: none; margin: 0; padding: 0; }
.tl-rail:focus-visible { outline-offset: -3px; }
.tl-empty { font-family: var(--f-mono); color: var(--ink-2); }

.tl-card {
  position: relative; display: flex; flex-direction: column; gap: 6px; padding: 10px 10px 14px;
  border: 2px solid var(--ink); border-radius: var(--r-m); background: var(--card); color: inherit; text-decoration: none;
  box-shadow: var(--shadow-hard); transition: transform .25s var(--ease-spring), box-shadow .25s var(--ease-out);
}
@media (hover: hover) { .tl-card:hover { transform: translate(-2px, -3px); box-shadow: 7px 8px 0 var(--ink); } }
.tl-pic { display: block; border: 2px solid var(--ink); border-radius: 12px; background: var(--c); overflow: hidden; aspect-ratio: 16 / 9; }
.tl-pic svg { display: block; width: 100%; height: 100%; }
.tl-cat { margin: 4px 4px 0; font-family: var(--f-mono); font-size: 12px; letter-spacing: .02em; text-transform: uppercase; color: var(--ink-2); }
.tl-t { margin: 0 4px; font-size: 21px; font-weight: 800; letter-spacing: -.025em; line-height: 1.08; }
.tl-d { margin: 0 4px; font-size: 15px; line-height: 1.4; color: var(--ink-2); }
.tl-go { margin: 4px 4px 0; font-weight: 700; font-size: 15px; color: var(--blue); }
.tl-read { display: none; position: absolute; top: 18px; right: 18px; padding: 3px 9px; border-radius: 999px; background: var(--ink); color: var(--paper); font-family: var(--f-mono); font-size: 12px; }
.tl-item.read .tl-read { display: block; }
.tl-item.read .tl-go { color: var(--ink-2); }
.tl-date { font-family: var(--f-mono); font-size: 13px; font-weight: 500; white-space: nowrap; }
.tl-date b { display: inline-block; padding: 3px 9px; border: 2px solid var(--ink); border-radius: 999px; background: var(--lime); font-weight: 500; }
.tl-node { width: 16px; height: 16px; border: 3px solid var(--ink); border-radius: 50%; background: var(--paper); }
.tl-item.read .tl-node { background: var(--blue); }
.tl-month, .tl-now, .tl-start { font-family: var(--f-mono); font-size: 13px; color: var(--ink-2); }
.tl-month b, .tl-now b, .tl-start b { display: inline-block; padding: 4px 12px; border-radius: 999px; background: var(--ink); color: var(--paper); font-weight: 500; }
.tl-now b { background: var(--tang); color: var(--ink); border: 2px solid var(--ink); }
.tl-item.off { display: none; }

/* scene text + motion */
.sv-t { font-family: var(--f-mono); font-size: 17px; font-weight: 500; fill: #141414; }
.sv-big { font-size: 24px; }
.sv-inv { fill: #FBF9F4; }
.sv-red { fill: #FF5A2C; font-size: 22px; font-weight: 700; }
.a-draw { stroke-dasharray: 1; }
.a-door, .a-bar, .a-ring, .a-grow, .a-hop, .a-bob, .a-fly, .a-flip, .a-orbit, .a-unplug, .a-drop { transform-box: fill-box; }
.a-door { transform-origin: 0 50%; transform: scaleX(.34); }
@media (prefers-reduced-motion: no-preference) {
  .live .a-bob { animation: ce-bob 3s ease-in-out infinite; }
  .live .a-blink { animation: ce-blink 1.6s steps(2, jump-none) infinite; }
  .live .a-stamp { animation: ce-blink 2.4s steps(2, jump-none) infinite; }
  .live .a-draw { animation: ce-draw 4s var(--ease-out) infinite; }
  .live .a-drop { transform-origin: 50% 100%; animation: ce-tilt 4s ease-in-out infinite; }
  .live .a-door { animation: ce-door 4.5s var(--ease-out) infinite; }
  .live .a-orbit { animation: ce-orbit 6s ease-in-out infinite alternate; }
  .live .a-dash { animation: ce-dash 1.2s linear infinite; }
  .live .a-glitch { animation: ce-glitch 2.2s steps(1) infinite; }
  .live .a-grow { transform-origin: 0 50%; animation: ce-grow 5s linear infinite; }
  .live .a-flip { animation: ce-flip 3s var(--ease-spring) infinite; }
  .live .a-bar { transform-origin: 50% 100%; animation: ce-bar 4s var(--ease-out) infinite; }
  .live .a-bar.b2 { animation-delay: .12s; } .live .a-bar.b3 { animation-delay: .24s; } .live .a-bar.b4 { animation-delay: .36s; }
  .live .a-ring { transform-origin: 50% 0; animation: ce-ring 2.6s ease-in-out infinite; }
  .live .a-unplug { animation: ce-unplug 3.4s var(--ease-out) infinite; }
  .live .a-hop { animation: ce-hop 2.4s var(--ease-out) infinite; }
  .live .a-hop.h2 { animation-delay: .2s; } .live .a-hop.h3 { animation-delay: .4s; } .live .a-hop.h4 { animation-delay: .6s; }
  .live .a-fly { animation: ce-fly 3.6s var(--ease-out) infinite; }
}
@keyframes ce-bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@keyframes ce-blink { 0% { opacity: 1; } 50% { opacity: .25; } }
@keyframes ce-draw { 0% { stroke-dashoffset: 1; } 45%, 100% { stroke-dashoffset: 0; } }
@keyframes ce-tilt { 0%, 55%, 100% { transform: rotate(0); } 70% { transform: rotate(-5deg); } 85% { transform: rotate(3deg); } }
@keyframes ce-door { 0%, 15% { transform: scaleX(1); } 45%, 85% { transform: scaleX(.34); } 100% { transform: scaleX(1); } }
@keyframes ce-orbit { from { transform: translateX(-46px); } to { transform: translateX(46px); } }
@keyframes ce-dash { to { stroke-dashoffset: -28; } }
@keyframes ce-glitch { 0%, 100% { transform: translateY(0); opacity: 0; } 40% { transform: translateY(6px); opacity: .7; } 46% { transform: translateY(-10px); opacity: .7; } 52% { opacity: 0; } }
@keyframes ce-grow { from { transform: scaleX(.05); } to { transform: scaleX(1.7); } }
@keyframes ce-flip { 0%, 40% { transform: translateX(0); } 55%, 90% { transform: translateX(-30px); } 100% { transform: translateX(0); } }
@keyframes ce-bar { 0% { transform: scaleY(0); } 30%, 100% { transform: scaleY(1); } }
@keyframes ce-ring { 0%, 100% { transform: rotate(-9deg); } 50% { transform: rotate(9deg); } }
@keyframes ce-unplug { 0%, 25% { transform: translateX(-22px); } 50%, 100% { transform: translateX(0); } }
@keyframes ce-hop { 0%, 30%, 100% { transform: translateY(0); } 15% { transform: translateY(-16px); } }
@keyframes ce-fly { 0%, 15% { transform: translate(0, 0) scale(1); opacity: 1; } 65% { transform: translate(64px, 50px) scale(.5); opacity: 1; } 80%, 100% { transform: translate(64px, 62px) scale(.3); opacity: 0; } }

/* ---------- timeline: phone (vertical spine on the left) ---------- */
@media (max-width: 699px) {
  .tl-list { position: relative; display: grid; gap: 22px; padding: 14px 0 10px; }
  .tl-list::before { content: ""; position: absolute; left: 7px; top: 0; bottom: 0; width: 3px; background: var(--ink); border-radius: 2px; }
  .tl-item { position: relative; display: grid; grid-template-columns: 17px 1fr; column-gap: 14px; row-gap: 8px; align-items: center; }
  .tl-node { grid-column: 1; grid-row: 1; position: relative; }
  .tl-date { grid-column: 2; grid-row: 1; }
  .tl-card { grid-column: 2; grid-row: 2; }
  .tl-month, .tl-now, .tl-start { position: relative; padding-left: 0; }
  .tl-month b, .tl-now b, .tl-start b { margin-left: -4px; }
  .tl-t { font-size: 22px; }
}

/* ---------- timeline: desktop (horizontal rail, newest on the right) ---------- */
@media (min-width: 900px) {
  .ce-hero { display: grid; grid-template-columns: auto 1fr; column-gap: 56px; align-items: end; padding-top: 20px; padding-bottom: 6px; }
  .ce-title { font-size: clamp(72px, 7vw, 104px); }
  .ce-hero-b { margin: 0 0 8px; justify-self: end; max-width: 520px; }
  .ce-hero-b .kt-lede { font-size: 18px; line-height: 1.5; }
  .ce-filters { grid-column: 1 / -1; margin: 16px 0 0; padding: 4px 0 8px; overflow: visible; flex-wrap: wrap; }

  /* the rail never pins or takes the wheel (js/events.js): arrows, drag, arrow keys or a sideways swipe move it */
  .tl { max-width: none; padding: 0; }
  .tl-bar { max-width: var(--max); margin: 6px auto 0; padding: 0 var(--gutter); }
  .tl-hint-d { display: inline; } .tl-hint-m { display: none; }
  .tl-nav { display: flex; gap: 10px; }
  .tl-arrow { width: 52px; height: 52px; font-size: 22px; }
  .tl-rail { direction: rtl; overflow-x: auto; overflow-y: hidden; overscroll-behavior-x: contain; scrollbar-width: none; cursor: grab; padding: 22px 0 26px; }
  .tl-rail::-webkit-scrollbar { display: none; }
  .tl-rail:focus-visible { outline: 3px solid var(--blue); outline-offset: -3px; }
  .tl-rail.drag { cursor: grabbing; user-select: none; }
  .tl-rail.drag .tl-card { pointer-events: none; }
  /* how far back you are: a track under the rail, filling from the right */
  .tl-stick { position: relative; }
  .tl-track { display: block; position: relative; max-width: var(--max); height: 4px; margin: 0 auto; padding: 0; }
  .tl-track::before, .tl-track::after { content: ""; position: absolute; top: 0; height: 4px; border-radius: 2px; right: var(--gutter); }
  .tl-track::before { left: var(--gutter); background: var(--hair); }
  .tl-track::after { width: calc((100% - 2 * var(--gutter)) * var(--tl-p, 0)); min-width: 22px; background: var(--ink); }
  .tl-list { --tl-line: var(--ink); --rh: 220px; display: flex; width: max-content; min-width: 100%; padding: 0 max(var(--gutter), calc((100vw - var(--max)) / 2 + var(--gutter))); }
  .tl-list > li { direction: ltr; position: relative; flex: none; display: grid; grid-template-rows: var(--rh) 76px var(--rh); justify-items: center; }
  .tl-item { width: 232px; }
  .tl-list > li::before { content: ""; grid-row: 2; grid-column: 1; align-self: center; justify-self: stretch; height: 3px; background: var(--tl-line); }
  .tl-now::before { margin-right: 50%; }
  .tl-start::before { margin-left: 50%; }
  .tl-month { width: 150px; }
  .tl-now, .tl-start { width: 210px; }
  .tl-month b, .tl-now b, .tl-start b { grid-row: 2; grid-column: 1; align-self: center; position: relative; z-index: 1; }
  .ce-hero { position: relative; }
  .ce-hero > .xm-stand { top: auto; bottom: 10px; --s: 84px; }
  .tl-start span, .tl-now span { grid-row: 2; grid-column: 1; align-self: end; margin-bottom: -6px; text-align: center; white-space: nowrap; font-size: 12px; }
  .tl-node { grid-row: 2; grid-column: 1; align-self: center; position: relative; z-index: 2; }
  .tl-date { grid-row: 2; grid-column: 1; position: relative; z-index: 1; }
  .tl-item.up .tl-date { align-self: end; margin-bottom: -4px; }
  .tl-item.down .tl-date { align-self: start; margin-top: -4px; }
  /* a card is short and wide (picture left, words right), so the whole line fits on a laptop screen */
  .tl-card { width: 430px; grid-column: 1; display: grid; grid-template-columns: 150px minmax(0, 1fr); grid-template-rows: auto auto auto 1fr; column-gap: 14px; row-gap: 5px; padding: 10px 14px 12px 10px; align-content: start; }
  .tl-card > :not(.tl-pic) { grid-column: 2; }
  .tl-card .tl-pic { position: relative; grid-row: 1 / -1; grid-column: 1; aspect-ratio: auto; min-height: 150px; }
  .tl-card .tl-pic > img, .tl-card .tl-pic > svg { position: absolute; inset: 0; width: 100%; height: 100%; }
  .tl-card .tl-pic > svg { object-fit: cover; }
  .tl-card .tl-cat { margin-top: 2px; }
  .tl-card .tl-read { grid-column: 2; }
  .tl-item.up .tl-card { grid-row: 1; align-self: end; margin-bottom: 16px; }
  .tl-item.down .tl-card { grid-row: 3; align-self: start; margin-top: 16px; }
  /* the stem from the dot to its card */
  .tl-item::after { content: ""; grid-column: 1; grid-row: 2; width: 3px; height: calc(50% + 16px); background: var(--tl-line); justify-self: center; }
  .tl-item.up::after { align-self: start; margin-top: -16px; }
  .tl-item.down::after { align-self: end; margin-bottom: -16px; }
  .tl-t { font-size: 19px; }
  .tl-d { font-size: 14px; line-height: 1.38; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
  .tl-go { font-size: 14.5px; align-self: end; }

  .ce-about { margin-top: 10px; }
}
/* laptop screens: a little shorter, so the whole line (both rows of cards) fits on screen at once */
@media (min-width: 900px) and (max-height: 820px) {
  .tl-rail { padding: 12px 0 16px; }
  .tl-list > li { grid-template-rows: var(--rh) 64px var(--rh); }
  .tl-d { -webkit-line-clamp: 2; }
  .tl-card .tl-pic { min-height: 128px; }
}
/* real photos on the timeline cards (data-photo) */
.tl-pic.tl-photo img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: 50% 25%; }
.tl-pic.tl-logo { background: #FBF9F4; }
.tl-pic.tl-logo img { object-fit: contain; padding: 8% 12%; box-sizing: border-box; }
/* a story whose main picture is a photo or logo (instead of a drawn scene) */
.ev-shot { background: var(--card); }
.ev-shot img { display: block; width: 100%; height: auto; max-height: 440px; object-fit: cover; object-position: 50% 25%; }
@media (max-width: 699px) { .ev-shot img { max-height: 300px; } }
.ev-shot.logo img { background: #FBF9F4; object-fit: contain; padding: 34px 40px; max-height: 300px; box-sizing: border-box; }
.ev-shot figcaption { padding: 9px 13px 10px; border-top: 2px solid var(--ink); font-size: 14px; line-height: 1.4; color: var(--ink-2); }
.ev-shot figcaption small { display: block; margin-top: 2px; font-family: var(--f-mono); font-size: 11px; }
.ev-shot figcaption a { color: inherit; text-underline-offset: 2px; }
/* a video: its picture until you press play */
.ev-video { margin: 26px 0 22px; }
.ev-video .yt-play, .ev-video iframe { position: relative; display: block; width: 100%; aspect-ratio: 16 / 9; padding: 0; border: 2px solid var(--ink); border-radius: var(--r-m, 18px); overflow: hidden; background: #000; box-shadow: var(--shadow-hard); cursor: pointer; }
.ev-video .yt-play[hidden] { display: none; }
.ev-video .yt-play img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .4s var(--ease-out, ease-out), filter .3s; }
.ev-video .yt-play:hover img { transform: scale(1.03); filter: brightness(.9); }
.ev-video .yt-btn { position: absolute; left: 50%; top: 50%; width: 76px; height: 54px; margin: -27px 0 0 -38px; display: grid; place-items: center; border: 2px solid #141414; border-radius: 16px; background: #E5382B; box-shadow: 3px 3px 0 #141414; transition: transform .2s var(--ease-out, ease-out); }
.ev-video .yt-btn svg { width: 30px; height: 30px; fill: #fff; }
.ev-video .yt-play:hover .yt-btn, .ev-video .yt-play:focus-visible .yt-btn { transform: scale(1.08); }
.ev-video figcaption { margin-top: 9px; font-size: 15px; line-height: 1.4; }
.ev-video .yt-k { display: block; font-family: var(--f-mono); font-size: 12px; color: var(--ink-2); }
.ev-video figcaption b { font-weight: 800; }
.ev-video figcaption a { font-family: var(--f-mono); font-size: 12.5px; color: var(--ink); text-decoration-color: var(--blue); text-underline-offset: 3px; white-space: nowrap; }
@media (prefers-reduced-motion: reduce) { .ev-video .yt-play img, .ev-video .yt-btn { transition: none; } }
/* quote of the week and where to follow AI news */
/* quote of the week: a full-width strip at the bottom of the page, hidden until revealed */
.qotw { margin: 40px auto 0; }
.qotw-in { position: relative; padding: 16px 20px; border: 2px solid var(--ink); border-radius: var(--r-l); background: #D7F64A; color: #141414; box-shadow: var(--shadow-hard); overflow: hidden; }
.qotw-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; }
.qotw-k { margin: 0; font-family: var(--f-display); font-weight: 800; font-size: 22px; letter-spacing: -.02em; }
.qotw-btn { background: #141414; color: #fff; }
.qotw.open .qotw-top { margin-bottom: 6px; }
.qotw-from { margin: 0 0 10px; font-family: var(--f-mono); font-size: 13px; }
.qotw-q { margin: 0; font-family: var(--f-display); font-weight: 800; font-size: clamp(26px, 4.4vw, 52px); line-height: 1.06; letter-spacing: -.035em; max-width: 30ch; outline: none; }
.qotw-q::before { content: "“"; } .qotw-q::after { content: "”"; }
.qotw-by { margin: 14px 0 0; font-weight: 700; } .qotw-by::before { content: "— "; }
.qotw-fine { margin: 6px 0 0; font-size: 14.5px; opacity: .8; }
@media (min-width: 900px) { .qotw-in { padding: 20px 30px; } .qotw.open .qotw-in { padding: 26px 34px 28px; } }
@media (prefers-reduced-motion: no-preference) {
  html:not(.calm) .qotw.fresh .qotw-q { animation: qotw-in .6s var(--ease-out) backwards; }
  html:not(.calm) .qotw.fresh .qotw-by, html:not(.calm) .qotw.fresh .qotw-fine { animation: qotw-in .5s .25s var(--ease-out) backwards; }
  @keyframes qotw-in { from { opacity: 0; transform: translateY(14px); } }
}
/* how to keep up with AI news: under the timeline */
.news-guide { margin-top: 56px; }
.news-guide .follow-h { font-size: clamp(30px, 4vw, 46px); max-width: 22ch; }
.news-guide .follow-h em { color: var(--blue); font-style: normal; }
html.xmas .news-guide .follow-h em { color: #1C7A3E; }
html[data-theme="dark"].xmas .news-guide .follow-h em { color: #5BC27E; }
.guide-grid { display: grid; gap: 20px; margin-top: 16px; }
.guide-h { margin: 0 0 10px; font-size: 22px; letter-spacing: -.02em; }
.guide-sub { margin: 14px 0 6px; font-family: var(--f-mono); font-size: 12.5px; color: var(--ink-2); text-transform: uppercase; letter-spacing: .04em; }
.guide-sub:first-of-type { margin-top: 0; }
.tips { margin: 0; padding: 0; list-style: none; counter-reset: tip; display: grid; gap: 12px; }
.tips li { position: relative; padding-left: 40px; font-size: 15.5px; line-height: 1.5; color: var(--ink-2); counter-increment: tip; }
.tips li::before { content: counter(tip); position: absolute; left: 0; top: 0; width: 28px; height: 28px; display: grid; place-items: center; border: 2px solid var(--ink); border-radius: 50%; background: var(--sky); color: #141414; font-family: var(--f-mono); font-size: 13px; font-weight: 500; }
.tips b { display: block; color: var(--ink); font-size: 16.5px; }
@media (min-width: 700px) { .guide-grid { grid-template-columns: 1fr 1.1fr; align-items: start; } }

/* real photos inside a story (credited in the caption) */
.ev-photo { margin: 18px 0 20px; }
.ev-photo img { display: block; width: 100%; height: auto; border: 2px solid var(--ink); border-radius: var(--r-m, 14px); box-shadow: var(--shadow-hard); background: var(--paper-2); }
.ev-photo.tall img { aspect-ratio: 4 / 3; object-fit: cover; object-position: 50% 30%; }
.ev-photo.sq img { max-width: 360px; background: #000; }
.ev-photo.logo img { padding: 28px 32px; background: #FBF9F4; object-fit: contain; max-height: 120px; }
.ev-photo figcaption { margin-top: 8px; font-size: 14.5px; line-height: 1.45; color: var(--ink-2); }
.ev-photo small { display: block; margin-top: 3px; font-family: var(--f-mono); font-size: 11.5px; }
.ev-photo small a { color: inherit; text-underline-offset: 2px; }
@media (min-width: 700px) {
  .ev-photo.tall, .ev-photo.sq { float: right; width: 38%; margin: 4px 0 14px 22px; }
  .ev-photo.tall img { aspect-ratio: auto; }
  .ev-body > :not(p):not(h3):not(.ev-photo) { clear: right; }
}
}
/* ---------- a story ---------- */
.ev { padding-top: 6px; }
.ev-nav { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin: 14px 0 22px; }
.ev-nav .btn { display: inline-flex; align-items: center; text-decoration: none; min-height: 46px; }
.ev-nav-pair { display: flex; gap: 8px; }
.ev-nav-end { align-items: stretch; margin: 44px 0 0; padding-top: 22px; border-top: 2px solid var(--ink); }
.ev-nav-end .ev-next { flex: 1; display: grid; gap: 2px; padding: 14px 18px; border: 2px solid var(--ink); border-radius: var(--r-m); background: var(--card); text-decoration: none; box-shadow: var(--shadow-hard); min-width: min(100%, 240px); }
.ev-nav-end .ev-next:hover { background: var(--lime); }
.ev-next small { font-family: var(--f-mono); font-size: 12.5px; color: var(--ink-2); }
.ev-next b { font-size: 19px; letter-spacing: -.02em; line-height: 1.15; }
.ev-next.newer { text-align: right; }

.ev-head .kicker { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; }
.ev-title { font-size: clamp(38px, 9vw, 72px); text-wrap: balance; }
.ev-head .stop-why { max-width: 60ch; }
.ev-scene { margin: 22px 0 0; border: 2px solid var(--ink); border-radius: var(--r-l); background: var(--c); overflow: hidden; box-shadow: var(--shadow-hard); }
.ev-scene svg { display: block; width: 100%; height: auto; max-height: 340px; }
.ev-body { max-width: 820px; }
.ev-body > p { font-size: 18px; line-height: 1.6; margin: 14px 0 0; }
.ev-h { margin: 34px 0 0; font-size: 26px; letter-spacing: -.025em; }
.ev-body .stats { margin-top: 24px; }
.ev-body .stats .stat-n { font-size: clamp(40px, 8vw, 54px); }
.ev-src { margin-top: 26px; padding-top: 18px; border-top: 1px solid var(--hair); columns: 1 !important; display: grid !important; }
.ev-src::before { content: "Sources"; display: block; margin-left: -26px; font-family: var(--f-mono); font-size: 13px; color: var(--ink-2); }

.pull { margin: 26px 0 0; padding: 4px 0 4px 20px; border-left: 5px solid var(--blue); font-size: clamp(22px, 4vw, 28px); font-weight: 700; letter-spacing: -.02em; line-height: 1.2; }
.pull footer { margin-top: 10px; font-family: var(--f-mono); font-size: 13px; font-weight: 400; letter-spacing: 0; color: var(--ink-2); }

/* ---------- things to try ---------- */
.try { margin-top: 28px; padding: 20px; border: 2px solid var(--ink); border-radius: var(--r-l); background: var(--card); display: grid; gap: 14px; }
.try > * { margin: 0; }
.try-k { font-family: var(--f-mono); font-size: 13px; color: var(--blue); }
.try-q { font-size: 18px; font-weight: 600; line-height: 1.4; }
.try .fu-seg { justify-self: start; max-width: 100%; }
.try .fu-seg-b[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.try .btn { justify-self: start; }
.try .src { margin: 0; }
.try-score { font-family: var(--f-mono); font-size: 14px; }
.try-score:empty { display: none; }

.q { display: grid; gap: 10px; padding-top: 14px; border-top: 1px solid var(--hair); }
.q:first-of-type { border-top: 0; padding-top: 0; }
.q-t { margin: 0; font-size: 18px; font-weight: 600; line-height: 1.4; }
.q-opts { display: flex; flex-wrap: wrap; gap: 8px; }
.q-stack { display: grid; }
.q-o { min-height: 48px; padding: 10px 16px; border: 2px solid var(--ink); border-radius: 12px; background: var(--paper); font-weight: 700; font-size: 16px; text-align: left; line-height: 1.3; }
@media (hover: hover) { .q-o:not([disabled]):hover { background: var(--lime); } }
.q-o[disabled] { cursor: default; opacity: .55; }
.q-o.pick { opacity: 1; background: color-mix(in srgb, var(--tang) 30%, var(--card)); }
.q-o.pick::after { content: " ✕"; }
.q-o.right { opacity: 1; background: var(--lime); }
.q-o.right::after { content: " ✓"; }
.q-o.mine { opacity: 1; background: var(--ink); color: var(--paper); }
.q-note { margin: 0; font-size: 16px; line-height: 1.5; }

.rng { display: grid; gap: 8px; font-weight: 600; }
.rng output { font-family: var(--f-mono); background: var(--lime); padding: 1px 8px; border-radius: 6px; border: 1.5px solid var(--ink); }
.rng small { font-weight: 400; color: var(--ink-2); font-size: 14px; }
.rng input[type="range"] { width: 100%; height: 44px; margin: 0; accent-color: var(--blue); cursor: pointer; }
.g-out { display: grid; gap: 12px; }
.g-out > p { margin: 0; }
.g-track { position: relative; height: 54px; margin: 0 9px; border-bottom: 3px solid var(--ink); }
.g-track i { position: absolute; bottom: -3px; left: var(--x); width: 3px; height: 26px; background: var(--ink); }
.g-track i::after { position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%); margin-bottom: 4px; padding: 2px 8px; border-radius: 999px; font: 500 12px var(--f-mono); white-space: nowrap; }
.g-you::after { content: "you"; background: var(--paper-2); }
.g-real { background: var(--blue) !important; height: 38px !important; }
.g-real::after { content: "real"; background: var(--blue); color: #fff; }
.try .big-n { color: var(--ink); font-size: clamp(34px, 8vw, 52px); font-weight: 800; letter-spacing: -.04em; line-height: 1; font-variant-numeric: tabular-nums; }
.big-n small { display: block; margin-top: 6px; font: 400 14px/1.4 var(--f-mono); letter-spacing: 0; color: var(--ink-2); }

.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.steps li { display: grid; grid-template-columns: 64px 1fr; gap: 12px; align-items: start; padding: 12px 14px; border: 2px solid var(--ink); border-radius: 12px; background: var(--paper); line-height: 1.4; }
.steps b { font-family: var(--f-mono); font-weight: 500; font-size: 14px; padding-top: 2px; }
.js .steps li.wait { opacity: .32; border-style: dashed; }
.js .steps li.wait span { visibility: hidden; }
.steps li.now { background: var(--lime); }
.steps-ctl { display: flex; align-items: center; gap: 10px; }
.steps-ctl span { font-family: var(--f-mono); font-size: 13px; color: var(--ink-2); }
@media (prefers-reduced-motion: no-preference) { .steps li.now { animation: popin .4s var(--ease-spring); } }

.door { margin: 0; display: grid; gap: 8px; }
.door div { display: grid; gap: 2px; padding: 12px 14px; border: 2px solid var(--ink); border-radius: 12px; background: var(--paper); }
.door dt { font-family: var(--f-mono); font-size: 12.5px; color: var(--ink-2); }
.door dd { margin: 0; font-weight: 600; line-height: 1.35; }
.door.mythos div { background: var(--ink); color: var(--paper); }
.door.mythos dt { color: var(--lime); }

.yrs { display: flex; gap: 6px; align-items: end; height: 70px; }
.yrs i { flex: 0 0 auto; width: 54px; height: 100%; border: 2px solid var(--ink); border-radius: 8px; background: var(--blue); }
.yrs i.part { background: linear-gradient(90deg, var(--blue) var(--f), var(--paper) var(--f)); }
.yrs i.base { background: var(--paper-2); }

.vol { display: grid; gap: 8px; }
.vol-row { display: grid; grid-template-columns: 64px 1fr; align-items: center; gap: 12px; font-family: var(--f-mono); font-size: 13px; }
.vol-t { height: 26px; border: 2px solid var(--ink); border-radius: 8px; background: var(--paper); overflow: hidden; }
.vol-t i { display: block; height: 100%; width: var(--w, 0%); background: var(--ink); transition: width .7s var(--ease-out); }
.vol-hot i { background: var(--tang); }
.vol-say { margin: 4px 0 0; font: 400 16px/1.5 var(--f-display); }

.pass { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.pass li { padding: 10px 14px; border: 2px dashed var(--ink); border-radius: 12px; font-weight: 700; opacity: .4; transition: opacity .3s, background-color .3s; }
.pass li span { display: block; font: 400 13px var(--f-mono); color: var(--ink-2); }
.pass li.on { opacity: 1; border-style: solid; background: var(--mint); }
.haiku { margin: 0; padding: 18px; border-radius: var(--r-m); background: var(--night); display: grid; gap: 8px; justify-items: start; }
.hk { min-height: 46px; padding: 6px 14px; border: 1.5px solid #5a5d58; border-radius: 10px; background: transparent; color: var(--paper); font-family: var(--f-serif); font-style: italic; font-size: clamp(22px, 5vw, 30px); text-align: left; line-height: 1.2; }
.hk.done { border-color: var(--lime); }
.hk.done::after { content: " · " attr(data-n); font: 500 14px var(--f-mono); color: var(--lime); font-style: normal; }
.haiku footer { font: 400 12.5px/1.4 var(--f-mono); color: #B9B6AE; }
@media (prefers-reduced-motion: no-preference) { .haiku:not([hidden]) .hk { animation: popin .5s var(--ease-out) backwards; } .haiku .hk:nth-child(2) { animation-delay: .25s; } .haiku .hk:nth-child(3) { animation-delay: .5s; } }

.sat-sw { display: flex; flex-wrap: wrap; gap: 10px; }
.sw { display: grid; justify-items: center; gap: 4px; padding: 8px 10px; border: 2px solid var(--ink); border-radius: 14px; background: var(--paper); min-width: 68px; min-height: 68px; font-family: var(--f-mono); font-size: 13px; }
.sw i { position: relative; width: 46px; height: 26px; border: 2px solid var(--ink); border-radius: 999px; background: var(--card); transition: background-color .2s; }
.sw i::after { content: ""; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%; background: var(--ink); transition: transform .25s var(--ease-spring); }
.sw[aria-pressed="true"] i { background: var(--lime); }
.sw[aria-pressed="true"] i::after { transform: translateX(20px); }
.sat-rules { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.sat-rules li { padding: 8px 12px; border: 2px solid var(--ink); border-radius: 10px; background: color-mix(in srgb, var(--tang) 22%, var(--card)); font-size: 15.5px; }
.sat-rules li::before { content: "✕ "; font-weight: 800; }
.sat-rules li.ok { background: var(--mint); }
.sat-rules li.ok::before { content: "✓ "; }
@media (min-width: 700px) { .sat-rules { grid-template-columns: 1fr 1fr; } }

.plug { display: grid; grid-template-columns: 1fr 56px 1fr; align-items: center; }
.plug-box, .plug-net { display: grid; gap: 4px; justify-items: center; text-align: center; padding: 16px 10px; border: 2px solid var(--ink); border-radius: var(--r-m); background: var(--paper); min-height: 120px; align-content: center; line-height: 1.3; }
.plug-box { border-style: dashed; }
.plug-net span { font: 400 12.5px/1.4 var(--f-mono); color: var(--ink-2); }
.plug-bot { width: 34px; height: 30px; border: 2px solid var(--ink); border-radius: 8px; background: var(--blue); }
.plug-wire i { display: block; height: 4px; background: var(--ink); transition: transform .5s var(--ease-out); transform-origin: 0 50%; }
.plug.new .plug-wire i { transform: scaleX(.3); }
.plug.new .plug-net { background: var(--mint); }
.plug:not(.new) .plug-net { background: var(--sky); }

.waffle-card { margin-top: 24px; }
.dots { display: grid; grid-template-columns: repeat(20, 1fr); gap: 5px; max-width: 520px; }
.dots i { aspect-ratio: 1; border: 1.5px solid var(--ink); border-radius: 50%; background: var(--card); }
.dots i.cut { background: var(--tang); }

.vote-out { display: grid; gap: 4px; }
.vote-out .hbar.mine .hbar-t i { background: var(--blue); }
.vote-out .hbar.mine .hbar-l::after { content: " · you"; font: 500 12px var(--f-mono); color: var(--blue); }

/* ---------- desktop story layout: the picture stays beside the text as you read ---------- */
@media (min-width: 900px) {
  .js .ce-stories .ev.open, html:not(.js) .ev { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, .75fr); column-gap: 56px; align-items: start; }
  .ev > .ev-nav { grid-column: 1 / -1; }
  .ev > .ev-head, .ev > .ev-body { grid-column: 1; }
  .ev > .ev-scene { grid-column: 2; grid-row: 2 / span 2; position: sticky; top: 104px; margin-top: 8px; }
  .ev-scene svg { max-height: none; }
  .ev-body { max-width: none; }
  .try { padding: 24px; }
  .steps { grid-template-columns: 1fr 1fr; }
  .ev-body .stats { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
}
@media (prefers-reduced-motion: reduce) {
  .vol-t i, .plug-wire i, .sw i::after, .tl-card { transition: none; }
}

/* ---------- Christmas: the dots on the line turn into lights ---------- */
html.xmas .tl-node { border-width: 2px; }
html.xmas .tl-item:nth-child(4n+1) .tl-node { background: var(--tang); }
html.xmas .tl-item:nth-child(4n+2) .tl-node { background: var(--lime); }
html.xmas .tl-item:nth-child(4n+3) .tl-node { background: var(--sky); }
html.xmas .tl-item:nth-child(4n) .tl-node { background: var(--pink); }
html.xmas .tl-item.read .tl-node { background: var(--blue); }
html.xmas .tl-node::after { content: ""; position: absolute; inset: -9px; border-radius: 50%; background: radial-gradient(circle, rgba(255, 255, 255, .9) 0, transparent 68%); z-index: -1; opacity: .7; }
html.xmas .tl-now b::before { content: "★ "; }
@media (prefers-reduced-motion: no-preference) { html.xmas .tl-node::after { animation: ce-blink 2.6s ease-in-out infinite alternate; } }

/* ---------- iPad portrait: a two-sided spine ---------- */
@media (min-width: 700px) and (max-width: 899px) {
  .ce-hero { display: grid; grid-template-columns: 1fr 1fr; column-gap: 28px; align-items: end; }
  .ce-hero > .xm-stand { top: auto; bottom: 8px; }
  .ce-title { font-size: clamp(76px, 12vw, 104px); }
  .ce-hero-b { margin: 0 0 6px; }
  .ce-filters { grid-column: 1 / -1; flex-wrap: wrap; overflow: visible; margin: 22px 0 0; padding: 4px 0 8px; }
  .tl-list { position: relative; display: grid; grid-template-columns: 1fr 40px 1fr; row-gap: 0; padding: 18px 0 8px; }
  .tl-list::before { content: ""; position: absolute; left: 50%; top: 0; bottom: 0; width: 3px; margin-left: -1.5px; background: var(--ink); border-radius: 2px; }
  .tl-item { display: contents; }
  .tl-item .tl-node { grid-column: 2; justify-self: center; align-self: start; margin-top: 34px; position: relative; }
  .tl-item .tl-card { margin-bottom: -56px; }
  .tl-item.up .tl-card { grid-column: 1; }
  .tl-item.down .tl-card { grid-column: 3; }
  .tl-item .tl-date { align-self: start; margin-top: 28px; }
  .tl-item.up .tl-date { grid-column: 3; justify-self: start; }
  .tl-item.down .tl-date { grid-column: 1; justify-self: end; }
  .tl-item .tl-node, .tl-item .tl-date, .tl-item .tl-card { grid-row: var(--r); }
  .tl-month, .tl-now, .tl-start { grid-column: 1 / -1; grid-row: var(--r); justify-self: center; position: relative; z-index: 1; padding: 10px 0; text-align: center; }
  .tl-start { margin-top: 70px; }
  .tl-month { margin-top: 64px; margin-bottom: -40px; }
  .tl-start span, .tl-now span { display: block; margin-top: 4px; background: var(--paper); }
  .js .ce-stories .ev.open, html:not(.js) .ev { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); column-gap: 26px; align-items: start; }
  .ev > .ev-nav, .ev > .ev-body { grid-column: 1 / -1; }
  .ev > .ev-head { grid-column: 1; }
  .ev > .ev-scene { grid-column: 2; margin-top: 8px; }
  .ev-title { font-size: clamp(40px, 6.4vw, 54px); }
  .ev-body { max-width: none; }
  .ev-body > p, .ev-body > .ev-h, .ev-body > .callout, .ev-body > .pull { max-width: 62ch; }
  .steps { grid-template-columns: 1fr 1fr; }
  .ev-body .stats > :last-child:nth-child(odd) { grid-column: 1 / -1; }
}

/* a tall photo shown as a wide strip inside a story */
.ev-photo-crop img { width: 100%; aspect-ratio: 16 / 7; object-fit: cover; object-position: 50% 40%; }
.follow { padding: 20px 20px 16px; border: 2px solid var(--ink); border-radius: var(--r-l); background: var(--card); box-shadow: var(--shadow-hard); }
.follow-k { margin: 0; font-family: var(--f-mono); font-size: 12.5px; color: var(--ink-2); }
.follow-h { margin: 2px 0 12px; letter-spacing: -.03em; line-height: 1.05; }
.follow-list { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.follow-list > li > a { display: block; padding: 10px 12px; border: 1.5px solid var(--hair); border-radius: 12px; color: var(--ink); text-decoration: none; transition: border-color .2s, transform .2s var(--ease-out, ease-out); }
.follow-list > li > a:hover { border-color: var(--ink); transform: translateX(3px); }
.follow-list b { display: block; font-size: 16.5px; }
.follow-list b::after { content: " ↗"; font-weight: 500; color: var(--ink-2); }
.follow-list span { display: block; font-size: 14px; line-height: 1.4; color: var(--ink-2); }
@media (min-width: 900px) { .follow { padding: 24px 26px 20px; } }
