
/* The fonts are served from this site (src/static/fonts, SIL Open Font Licence), so no visitor's browser contacts Google.
   Each comes in two parts, as Google sends them: "latin" for English, and "latin-ext" for ŵ, ŷ, ẁ and the rest, fetched only when a page uses them. */
@font-face { font-family: "Figtree"; font-style: normal; font-weight: 400; font-display: swap; src: url(fonts/figtree-latin-ext-400-normal.woff2) format("woff2"); unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF }
@font-face { font-family: "Figtree"; font-style: normal; font-weight: 400; font-display: swap; src: url(fonts/figtree-latin-400-normal.woff2) format("woff2"); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD }
@font-face { font-family: "Figtree"; font-style: normal; font-weight: 500; font-display: swap; src: url(fonts/figtree-latin-ext-500-normal.woff2) format("woff2"); unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF }
@font-face { font-family: "Figtree"; font-style: normal; font-weight: 500; font-display: swap; src: url(fonts/figtree-latin-500-normal.woff2) format("woff2"); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD }
@font-face { font-family: "Figtree"; font-style: normal; font-weight: 700; font-display: swap; src: url(fonts/figtree-latin-ext-700-normal.woff2) format("woff2"); unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF }
@font-face { font-family: "Figtree"; font-style: normal; font-weight: 700; font-display: swap; src: url(fonts/figtree-latin-700-normal.woff2) format("woff2"); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD }
@font-face { font-family: "Figtree"; font-style: italic; font-weight: 400; font-display: swap; src: url(fonts/figtree-latin-ext-400-italic.woff2) format("woff2"); unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF }
@font-face { font-family: "Figtree"; font-style: italic; font-weight: 400; font-display: swap; src: url(fonts/figtree-latin-400-italic.woff2) format("woff2"); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD }
@font-face { font-family: "Gloock"; font-style: normal; font-weight: 400; font-display: swap; src: url(fonts/gloock-latin-ext-400-normal.woff2) format("woff2"); unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF }
@font-face { font-family: "Gloock"; font-style: normal; font-weight: 400; font-display: swap; src: url(fonts/gloock-latin-400-normal.woff2) format("woff2"); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD }
@font-face { font-family: "JetBrains Mono"; font-style: normal; font-weight: 500; font-display: swap; src: url(fonts/jetbrains-mono-latin-ext-500-normal.woff2) format("woff2"); unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF }
@font-face { font-family: "JetBrains Mono"; font-style: normal; font-weight: 500; font-display: swap; src: url(fonts/jetbrains-mono-latin-500-normal.woff2) format("woff2"); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD }
/* Layout: one dark world of slate and mountain night. A generative Eryri skyline opens; a sticky year-counter drives a scroll timeline; a real map of Wales anchors the places. Era colours run through everything. */
:root {
  color-scheme: dark;
  --night: #0e1118;
  --slate: #171c27;
  --slate-2: #202736;
  --line: #2e3647;
  --ink: #ece9e1;
  --muted: #9ba2b0;
  --dragon: #f26a62;
  --dragon-deep: #c02c25;
  --e-ancient: #d39a62;   /* red ochre of Paviland */
  --e-saints: #b9a0ea;    /* illuminated-manuscript violet */
  --e-kings: #e8c65a;     /* the gold of a crown */
  --e-medieval: #f26a62;  /* the dragon */
  --e-roman: #e58fb4; --e-tudor: #62c6c4; --e-today: #f59a4a;
  --e-britons: #b5c46a;   /* bronze and verdigris */
  --e-glyndwr: #d98be0;   /* the poets’ purple */
  --e-revival: #6cb6e8;   /* chapel-window blue */
  --e-industrial: #93a0e0;/* Penrhyn slate blue */
  --e-modern: #7cc495;    /* hill green */
  --f-display: "Gloock", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --f-body: "Figtree", "Segoe UI", system-ui, sans-serif;
  --f-mono: "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace;
  --wrap: 76rem;
  --gut-l: max(16px, env(safe-area-inset-left, 0px));
  --gut-r: max(16px, env(safe-area-inset-right, 0px));
}
* { box-sizing: border-box }
html { scroll-behavior: smooth; scroll-padding-top: 4.5rem }
body { background: var(--night); color: var(--ink); font-family: var(--f-body); font-size: 1.0625rem; line-height: 1.6; margin: 0; overflow-x: hidden }
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 30; background: var(--night) }
.wrap { max-width: var(--wrap); margin-inline: auto; padding-left: var(--gut-l); padding-right: var(--gut-r) }
h1, h2, h3, h4, .brand, .hero .sub p:first-child, footer .big, .words b, .part b, .place-card .cy-name, .plaque .epi, .dial .era-name { word-spacing: .1em }
h1, h2, h3, h4 { font-family: var(--f-display); font-weight: 400; line-height: 1.05; text-wrap: balance; margin: 0 }
p { margin: 0 }
a { color: inherit }
button { font: inherit; color: inherit }
:focus-visible { outline: 2px solid var(--dragon); outline-offset: 3px; border-radius: 3px }
.eyebrow { font-family: var(--f-mono); font-size: .75rem; letter-spacing: .14em; text-transform: uppercase; color: var(--muted) }
.chip { font: 500 .88rem var(--f-body); background: transparent; border: 1px solid var(--line); border-radius: 999px; padding: .38rem .95rem; cursor: pointer; color: var(--ink); display: inline-flex; gap: .45rem; align-items: center; transition: border-color .2s, background .2s }
.chip:hover { border-color: var(--muted) }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--night); border-color: var(--ink) }
.chip i { width: .55rem; height: .55rem; border-radius: 50%; background: var(--c, var(--muted)); display: inline-block }
.chips { display: flex; flex-wrap: wrap; gap: .5rem }
[data-era="ancient"] { --c: var(--e-ancient) } [data-era="saints"] { --c: var(--e-saints) } [data-era="kings"] { --c: var(--e-kings) } [data-era="medieval"] { --c: var(--e-medieval) }
[data-era="roman"] { --c: var(--e-roman) } [data-era="tudor"] { --c: var(--e-tudor) } [data-era="today"] { --c: var(--e-today) }
[data-era="britons"] { --c: var(--e-britons) } [data-era="glyndwr"] { --c: var(--e-glyndwr) } [data-era="revival"] { --c: var(--e-revival) }
[data-era="industrial"] { --c: var(--e-industrial) } [data-era="modern"] { --c: var(--e-modern) }

/* ---------- Nav ---------- */
.nav { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20; background: rgba(14,17,24,.86); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid rgba(46,54,71,.6) }
.nav .wrap { display: flex; align-items: center; gap: 1rem 1.5rem; padding-block: .7rem; flex-wrap: wrap }
.brand { font-family: var(--f-display); font-size: 1.45rem; text-decoration: none; margin-right: auto; display: flex; align-items: center; gap: .55rem }
.brand svg { width: 1.6rem; height: 1.6rem; color: #e2453d }
.nav ul { list-style: none; display: flex; flex-wrap: wrap; gap: .2rem 1.3rem; margin: 0; padding: 0 }
.nav ul a { text-decoration: none; font-size: .95rem; color: var(--muted); transition: color .2s }
.nav ul a:hover, .nav ul a.on { color: var(--ink) }
.lang { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; padding: 3px; gap: 2px }
.lang button, .lang a { border: 0; text-decoration: none; line-height: inherit; background: transparent; border-radius: 999px; padding: .2rem .7rem; font: 700 .78rem var(--f-mono); letter-spacing: .08em; cursor: pointer; color: var(--muted) }
.lang button[aria-pressed="true"], .lang a[aria-current] { background: var(--dragon-deep); color: #fff }
.lang a:hover:not([aria-current]) { color: var(--ink) }
.lang-hint { background: var(--slate); border-bottom: 1px solid var(--line); font-size: .92rem; color: var(--muted) }
.lang-hint .wrap { position: relative; display: flex; flex-wrap: wrap; align-items: center; gap: .3rem 1rem; padding-block: .5rem; padding-right: 3rem }
.lang-hint a { color: var(--ink); font-weight: 600 }
.lang-hint button { position: absolute; right: max(10px, env(safe-area-inset-right, 0px)); top: 50%; transform: translateY(-50%); border: 0; background: transparent; color: var(--muted); font-size: 1.2rem; line-height: 1; cursor: pointer; padding: .1rem .4rem }
@media print { .lang-hint { display: none } }
@media (max-width: 720px) { .nav ul { order: 3; width: 100%; justify-content: flex-start; gap: .3rem 1.1rem } }

/* ---------- Hero ---------- */
.hero { position: relative; overflow: hidden; isolation: isolate; background: var(--night) }
.hero canvas { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -1; display: block }
#land3d { opacity: 0; transition: opacity 1.6s ease; -webkit-mask-image: linear-gradient(#000 78%, transparent 99%); mask-image: linear-gradient(#000 78%, transparent 99%) }
.hero .wrap { padding-block: clamp(2.5rem, 7vw, 5.5rem) clamp(10rem, 22vw, 16rem) }
.hero h1 { font-size: clamp(4.2rem, 17vw, 13.5rem); line-height: .86; letter-spacing: -.02em; display: flex; flex-wrap: wrap; margin-left: -.035em }
.hero h1 span { font-weight: inherit; display: inline-block; animation: rise 1.1s cubic-bezier(.2,.7,.1,1) both; animation-delay: calc(var(--i) * 70ms + 150ms) }
.hero h1 .y { color: #e2453d }
/* letters fade in while they drop. "Cymru" is so big that it drops a shorter way, so it never touches the name above it */
@keyframes rise { from { transform: translateY(var(--rise, -.4em)); opacity: 0 } to { transform: none; opacity: 1 } }
.hero h1 span { --rise: -.1em }
.hero .sub { display: grid; gap: 1.1rem; margin-top: clamp(1.8rem, 4vw, 3rem); max-width: 50rem }
.hero .sub .tag span { display: block } .hero .sub .tag span + span { margin-top: .35rem }
.hero .sub p:first-child { font-family: var(--f-display); font-size: clamp(1.4rem, 3vw, 2rem); line-height: 1.2 }
.hero .sub p + p { color: var(--muted); max-width: 34rem }
.btn { display: inline-flex; align-items: center; gap: .5rem; padding: .7rem 1.25rem; border-radius: 999px; border: 1px solid var(--ink); text-decoration: none; font-weight: 700; font-size: .95rem; cursor: pointer; background: transparent; transition: background .2s, color .2s }
.btn.solid { background: var(--ink); color: var(--night) }
.btn:hover { background: var(--dragon-deep); border-color: var(--dragon-deep); color: #fff }
.ticker { position: absolute; left: 0; right: 0; bottom: 0; border-top: 1px solid rgba(236,233,225,.12); background: rgba(14,17,24,.55); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px) }
.ticker .wrap { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 1rem; padding-block: 1rem }
.ticker b { display: block; font-family: var(--f-display); font-weight: 400; font-size: clamp(1.5rem, 3.6vw, 2.4rem); line-height: 1; font-variant-numeric: tabular-nums }
.ticker span { font-family: var(--f-mono); font-size: .75rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted) }
@media (max-width: 640px) { .ticker { position: relative } .ticker .wrap { grid-template-columns: repeat(2, minmax(0,1fr)) } .hero .wrap { padding-bottom: 7rem } }

section { padding-block: clamp(4rem, 9vw, 7rem); position: relative }
.head { display: grid; gap: .9rem; margin-bottom: clamp(2rem, 5vw, 3.5rem); max-width: 46rem }
.head h2 { font-size: clamp(2.6rem, 7vw, 5rem) }
.head p { color: var(--muted); max-width: 40rem }
.num { font-family: var(--f-mono); color: var(--dragon) }

/* ---------- Chapters strip ---------- */
.chapters { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 14px; overflow: hidden }
.chap { background: var(--slate); padding: 1.5rem 1.4rem 1.4rem; display: grid; gap: .7rem; align-content: start; text-align: left; border: 0; cursor: pointer; position: relative; transition: background .25s; min-width: 0 }
.chap:hover { background: var(--slate-2) }
.chap svg { width: 3.4rem; height: 3.4rem; color: var(--c) }
.chap .span { font-family: var(--f-mono); font-size: .75rem; color: var(--c); letter-spacing: .06em }
.chap h3 { font-size: 1.65rem }
.chap p { color: var(--muted); font-size: .95rem }
.chap .go { font-weight: 700; font-size: .9rem; margin-top: .3rem }
.chap::after { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 3px; background: var(--c); transform: scaleX(.18); transform-origin: left; transition: transform .35s }
.chap:hover::after { transform: none }
@media (max-width: 900px) { .chapters { grid-template-columns: repeat(2, minmax(0,1fr)) } }
@media (max-width: 520px) { .chapters { grid-template-columns: 1fr } }

/* ---------- Timeline ---------- */
#timeline { background: linear-gradient(var(--night), var(--slate) 12%, var(--slate) 88%, var(--night)) }
.tl-tools { display: flex; flex-wrap: wrap; gap: 1rem; justify-content: space-between; align-items: center; margin-bottom: 2.5rem }
.tl-grid { display: grid; grid-template-columns: minmax(15rem, 22rem) minmax(0, 1fr); gap: clamp(1.5rem, 5vw, 4.5rem) }
.dial { position: sticky; top: 6rem; align-self: start; display: grid; gap: 1rem }
.dial .yr { font-family: var(--f-display); font-size: clamp(3.4rem, 7vw, 5.6rem); line-height: .9; font-variant-numeric: tabular-nums; white-space: nowrap }
.dial .yr small { font-size: .38em; color: var(--muted); margin-left: .1em }
.dial .era-name { font-family: var(--f-display); font-size: 1.5rem; color: var(--c, var(--ink)); transition: color .3s }
.dial .now { color: var(--muted); font-size: .95rem; min-height: 3em }
.bar { display: flex; gap: 3px; height: 6px }
.bar div { flex: var(--n) 1 0; background: var(--line); border-radius: 3px; overflow: hidden; position: relative }
.bar div i { position: absolute; inset: 0; background: var(--c); transform: scaleX(var(--p, 0)); transform-origin: left }
.bar-labels { display: flex; gap: 3px; font-family: var(--f-mono); font-size: .62rem; color: var(--muted); letter-spacing: .05em }
.bar-labels span { flex: var(--n) 1 0; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap }
.events { list-style: none; margin: 0; padding: 0; position: relative; min-width: 0 }
.events::before { content: ""; position: absolute; left: 6px; top: 0; bottom: 0; width: 1px; background: var(--line) }
.era-head { padding: 2.5rem 0 1.25rem 2.25rem; display: grid; gap: .5rem; scroll-margin-top: 5rem }
.era-head:first-child { padding-top: 0 }
.era-head h3 { font-size: clamp(2rem, 4vw, 2.8rem); color: var(--c) }
.era-head button { justify-self: start; background: none; border: 0; padding: 0; color: var(--muted); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; font-size: .92rem }
.era-head button:hover { color: var(--ink) }
.ev { position: relative; padding: .95rem 0 .95rem 2.25rem; display: grid; gap: .25rem; opacity: .78; transition: opacity .35s; scroll-margin-top: 6rem }  /* .78 keeps the paler events at AA contrast (4.5:1); .5 was 2.7:1 */
.ev.on, .ev:hover, .ev:focus-within { opacity: 1 }
.ev::before { content: ""; position: absolute; left: 0; top: 1.3rem; width: 13px; height: 13px; border-radius: 50%; background: var(--slate); border: 2px solid var(--c); transition: transform .3s, background .3s }
.ev.key::before { background: var(--c) }
.ev.on::before { transform: scale(1.35) }
.ev time { font-family: var(--f-mono); font-size: .8rem; color: var(--c); font-variant-numeric: tabular-nums; letter-spacing: .04em }
.ev h4 { font-family: var(--f-body); font-weight: 700; font-size: 1.15rem; line-height: 1.3 }
.ev p { color: var(--muted); max-width: 60ch }
.ev .maplink { justify-self: start; font-size: .85rem; color: var(--ink); background: none; border: 0; padding: 0; cursor: pointer; display: inline-flex; gap: .35rem; align-items: center; margin-top: .2rem; text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 3px }
.ev .maplink:hover { text-decoration-color: var(--c) }
.ev .maplink svg { width: .95rem; height: .95rem }
@media (max-width: 820px) {
  .tl-grid { grid-template-columns: 1fr; gap: 0 }
  /* sits flush under the top bar (--nav-h is the bar's real height, set by app.js) on a solid background, so no entry text shows above, behind or below it */
  .dial { top: calc(env(safe-area-inset-top, 0px) + var(--nav-h, 3.7rem) - 1px); z-index: 15; background: var(--slate); box-shadow: 0 6px 10px -6px rgba(0,0,0,.6); margin-inline: calc(var(--gut-l) * -1) calc(var(--gut-r) * -1); padding: .7rem var(--gut-r) .8rem var(--gut-l); border-bottom: 1px solid var(--line); grid-template-columns: auto minmax(0,1fr); gap: .2rem 1rem; align-items: center; margin-bottom: 1.5rem }
  .dial .yr { font-size: 2.2rem; grid-row: span 2 }
  .dial .era-name { font-size: 1.1rem }
  .dial .now { display: none }
  .dial .bar, .dial .bar-labels { grid-column: 1 / -1 }
  .dial .bar-labels { display: none }
  .ev, .era-head { scroll-margin-top: calc(var(--nav-h, 3.7rem) + var(--dial-h, 6rem) + .75rem) }
}

/* ---------- Map ---------- */
.map-grid { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: clamp(1.5rem, 4vw, 3.5rem); align-items: start }
.map-box { position: relative; min-width: 0 }
.map-box svg { width: 100%; height: auto; display: block; overflow: visible }
.land { fill: var(--slate-2); stroke: #4a556c; stroke-width: 1.2; stroke-linejoin: round }
.grat { stroke: var(--line); stroke-width: .6; stroke-dasharray: 2 5; fill: none }
.grat-l { fill: var(--muted); font: 500 10px var(--f-mono); letter-spacing: .05em }
.sea-l { fill: #4f5a70; font: italic 400 15px var(--f-display); letter-spacing: .2em }
.pin { cursor: pointer; outline: none }
.pin .halo { fill: var(--c); opacity: 0; transition: opacity .25s }
.pin .dot { fill: var(--c); stroke: var(--night); stroke-width: 2.5; transition: r .2s }
.pin:hover .halo, .pin:focus-visible .halo { opacity: .25 }
.pin.sel .halo { opacity: .3; animation: pulse 2.2s ease-out infinite }
.pin.sel .dot { r: 9 }
.pin.dim { opacity: .18; pointer-events: none }
.pin .lbl { fill: var(--ink); font: 600 12px var(--f-body); paint-order: stroke; stroke: var(--night); stroke-width: 4px; opacity: 0; transition: opacity .2s; pointer-events: none }
.pin:hover .lbl, .pin.sel .lbl, .pin:focus-visible .lbl { opacity: 1 }
@keyframes pulse { 0% { opacity: .45 } 100% { opacity: 0 } }
.place-card { background: var(--slate); border: 1px solid var(--line); border-radius: 16px; padding: clamp(1.25rem, 3vw, 2rem); display: grid; gap: 1rem; position: sticky; top: 6rem; min-width: 0 }
.place-card .art { height: 7.5rem; border-radius: 10px; background: radial-gradient(120% 90% at 50% 100%, color-mix(in srgb, var(--c) 22%, transparent), transparent 70%), var(--slate-2); display: grid; place-items: center; color: var(--c); border: 1px solid var(--line) }
.place-card .art svg { width: 5.5rem; height: 5.5rem }
.place-card h3 { font-size: clamp(2rem, 4vw, 2.8rem) }
.place-card .cy-name { font-family: var(--f-display); font-style: italic; color: var(--muted); font-size: 1.15rem }
.place-card .meta { display: flex; flex-wrap: wrap; gap: .4rem 1.2rem; font-family: var(--f-mono); font-size: .76rem; color: var(--muted) }
.place-card .meta b { color: var(--c); font-weight: 500 }
.place-card p.desc { color: #cfd2d8 }
.place-card .row { display: flex; flex-wrap: wrap; gap: .6rem; justify-content: space-between; align-items: center; border-top: 1px solid var(--line); padding-top: 1rem }
.place-card .row .nav-btns { display: flex; gap: .4rem }
.icon-btn { width: 2.4rem; height: 2.4rem; border-radius: 50%; border: 1px solid var(--line); background: transparent; cursor: pointer; display: grid; place-items: center }
.icon-btn:hover { border-color: var(--ink) }
.icon-btn svg { width: 1rem; height: 1rem }
.map-legend { margin-top: 1rem }
@media (max-width: 860px) { .map-grid { grid-template-columns: 1fr } .place-card { position: static } }

/* ---------- People ---------- */
#people { background: var(--slate) }
.people { display: grid; grid-template-columns: repeat(auto-fill, minmax(16.5rem, 1fr)); gap: 1rem; margin-top: 2rem }
.plaque { position: relative; background: linear-gradient(160deg, #262d3d, #1b2130 60%, #171c28); border: 1px solid #333c50; border-radius: 6px; padding: 1.35rem 1.35rem 1.25rem; display: grid; gap: .55rem; align-content: start; overflow: hidden; min-width: 0 }
.plaque::before { content: ""; position: absolute; inset: 0; background: repeating-linear-gradient(172deg, rgba(255,255,255,.018) 0 2px, transparent 2px 7px); pointer-events: none }
.plaque::after { content: ""; position: absolute; left: 1.35rem; top: 0; width: 2.2rem; height: 3px; background: var(--c) }
.plaque .dates { font-family: var(--f-mono); font-size: .75rem; color: var(--c); font-variant-numeric: tabular-nums }
.plaque h3 { font-size: 1.7rem; line-height: 1.08; text-shadow: 0 1px 0 rgba(0,0,0,.6), 0 -1px 0 rgba(255,255,255,.06) }
.plaque .epi { font-family: var(--f-display); font-style: italic; color: var(--muted); font-size: 1.02rem; line-height: 1.3 }
.plaque p { font-size: .95rem; color: #c3c7cf }
.people-count { font-family: var(--f-mono); font-size: .78rem; color: var(--muted) }

/* ---------- Language ---------- */
.lang-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(2rem, 5vw, 4rem) }
@media (max-width: 860px) { .lang-grid { grid-template-columns: 1fr } }
.panel { background: var(--slate); border: 1px solid var(--line); border-radius: 16px; padding: clamp(1.25rem, 3vw, 2rem); display: grid; gap: 1rem; align-content: start; min-width: 0 }
.panel h3 { font-size: 1.9rem }
.panel > p { color: var(--muted) }
.chart-wrap { overflow-x: auto }
.chart text { font: 500 10.5px var(--f-mono); fill: var(--muted) }
.chart .val { fill: var(--ink); font-size: 11px }
.chart .grid { stroke: var(--line); stroke-width: 1 }
.chart .area { fill: url(#gArea) }
.chart .ln { fill: none; stroke: var(--dragon); stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round }
.chart circle { fill: var(--night); stroke: var(--dragon); stroke-width: 2 }
.chart circle.end { fill: var(--dragon) }
.decoder form { display: flex; gap: .5rem; flex-wrap: wrap }
.decoder input { flex: 1 1 12rem; min-width: 0; background: var(--night); border: 1px solid var(--line); border-radius: 10px; color: var(--ink); padding: .75rem 1rem; font: 500 1.1rem var(--f-body) }
.decoder input:focus { outline: 2px solid var(--dragon); outline-offset: 1px }
.parts { display: flex; flex-wrap: wrap; gap: .5rem; min-height: 5.2rem; align-content: flex-start }
.part { background: var(--night); border: 1px solid var(--line); border-radius: 10px; padding: .5rem .8rem; display: grid; gap: .05rem; animation: pop .35s cubic-bezier(.2,.8,.2,1.2) both; animation-delay: calc(var(--i) * 60ms) }
.part b { font-family: var(--f-display); font-weight: 400; font-size: 1.45rem; color: var(--dragon); line-height: 1.1 }
.part span { font-size: .82rem; color: var(--muted) }
.part.unk b { color: var(--muted) }
.part { max-width: 100% }
.part small { font-size: .74rem; color: var(--muted); opacity: .85; font-style: italic }
.part.eng { border-style: dashed }
.part.eng b { color: var(--ink) }
.part span em { font-style: normal; font-weight: 600 }
.dec-word { display: flex; flex-wrap: wrap; gap: .35rem; max-width: 100% }
.dec-word + .dec-word { padding-left: .6rem; border-left: 2px solid var(--line) }
.dec-hit { flex-basis: 100%; margin: 0 0 .2rem }
.dec-hit a { color: var(--dragon) }
@keyframes pop { from { transform: translateY(6px) scale(.96) } to { transform: none } }
.samples { display: flex; flex-wrap: wrap; gap: .4rem }
.samples button { background: none; border: 1px dashed var(--line); border-radius: 8px; padding: .25rem .6rem; font-size: .85rem; color: var(--muted); cursor: pointer }
.samples button:hover { color: var(--ink); border-color: var(--muted) }
.words { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 12px; overflow: hidden }
.words li { background: var(--slate); padding: 1rem 1.1rem; display: grid; gap: .15rem }
.words b { font-family: var(--f-display); font-weight: 400; font-size: 1.6rem; line-height: 1.1 }
.words .say { font-family: var(--f-mono); font-size: .75rem; color: var(--dragon); letter-spacing: .04em }
.words span:last-child { font-size: .9rem; color: var(--muted) }

/* ---------- Chapter overlay ---------- */
.overlay { position: fixed; inset: 0; z-index: 40; background: rgba(8,10,15,.78); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); display: grid; place-items: center; padding: calc(env(safe-area-inset-top, 0px) + 1rem) var(--gut-r) calc(env(safe-area-inset-bottom, 0px) + 1rem) var(--gut-l); animation: fade .25s ease both }
@keyframes fade { from { opacity: 0 } to { opacity: 1 } }
.sheet { background: var(--slate); border: 1px solid var(--line); border-radius: 18px; width: min(52rem, 100%); max-height: 100%; overflow-y: auto; position: relative; animation: up .4s cubic-bezier(.2,.7,.1,1) both }
@keyframes up { from { transform: translateY(24px) } to { transform: none } }
.sheet .top { padding: clamp(1.5rem, 4vw, 2.75rem); background: radial-gradient(90% 120% at 100% 0%, color-mix(in srgb, var(--c) 26%, transparent), transparent 60%); display: grid; gap: .8rem; border-bottom: 1px solid var(--line) }
.sheet .top svg.ill { width: 4.5rem; height: 4.5rem; color: var(--c) }
.sheet h2 { font-size: clamp(2.4rem, 6vw, 4rem) }
.sheet .body { padding: clamp(1.5rem, 4vw, 2.75rem); display: grid; gap: 1.1rem }
.sheet .body p { max-width: 62ch; color: #d2d5dc }
.sheet .body > p:first-child::first-letter { font-family: var(--f-display); float: left; font-size: 3.6em; line-height: .85; padding: .05em .1em 0 0; color: var(--c) }
.sheet .keys { display: grid; gap: .6rem; border-top: 1px solid var(--line); padding-top: 1.2rem }
.sheet .keys li { display: grid; grid-template-columns: 7.5rem minmax(0,1fr); gap: 1rem; font-size: .95rem }
.sheet .keys ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem }
.sheet .keys time { font-family: var(--f-mono); color: var(--c); font-size: .8rem; padding-top: .15rem }
.sheet .close { position: absolute; top: 1rem; right: 1rem }
.sheet .foot { display: flex; justify-content: space-between; gap: .6rem; flex-wrap: wrap; padding: 0 clamp(1.5rem, 4vw, 2.75rem) clamp(1.5rem, 4vw, 2.75rem) }

footer { border-top: 1px solid var(--line); padding-block: 3rem calc(3rem + env(safe-area-inset-bottom, 0px)) }
footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1.5rem; color: var(--muted); font-size: .9rem }
footer .big { font-family: var(--f-display); font-size: clamp(2.5rem, 8vw, 5rem); color: var(--ink); line-height: 1; width: 100% }

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

/* ---------- v3 additions ---------- */
[hidden] { display: none !important }
html.cy .l-en, html:not(.cy) .l-cy { display: none !important }
.src { font-family: var(--f-mono); font-size: .75rem; color: var(--muted); text-decoration: none; letter-spacing: .03em; display: inline-flex; gap: .3rem; align-items: center; min-height: 24px }
.src:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 3px }
.ev .links { display: flex; flex-wrap: wrap; gap: .4rem 1.1rem; align-items: center; margin-top: .2rem }
.ev .links .maplink { margin-top: 0 }

/* On this day */
#today { padding-block: 0 }

/* Map modes */
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; padding: 3px; gap: 2px; margin-bottom: 1.25rem }
.seg button { border: 0; background: transparent; border-radius: 999px; padding: .4rem 1rem; font: 600 .9rem var(--f-body); cursor: pointer; color: var(--muted) }
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--night) }
.la { stroke: var(--night); stroke-width: 1; transition: fill .5s ease }
.kg-panel { display: grid; gap: 1rem }
.kg-stage { font-family: var(--f-display); font-size: clamp(1.8rem, 3.6vw, 2.6rem); line-height: 1.05 }
.kg-legend { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem }
.kg-legend li { display: flex; gap: .7rem; align-items: center; font-size: .98rem }
.kg-legend i { width: 1rem; height: 1rem; border-radius: 4px; background: var(--k); flex: none }
.kg-range { display: grid; gap: .5rem; border-bottom: 1px solid var(--line); padding-bottom: 1.2rem }
.kg-body { display: grid; gap: 1rem; align-content: start }
.kg-note { font-size: .82rem; color: var(--muted) }

/* Quiz */
#quiz { background: var(--slate) }
.quiz { max-width: 46rem; display: grid; gap: 1.25rem }
.quiz .q-top, .game-box .q-top { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; font-family: var(--f-mono); font-size: .78rem; color: var(--muted) }
.quiz .q-bar { height: 4px; background: var(--line); border-radius: 2px; overflow: hidden }
.quiz .q-bar i { display: block; height: 100%; background: var(--dragon); transition: width .4s }
.quiz h3 { font-size: clamp(1.7rem, 3.4vw, 2.4rem); line-height: 1.15 }
.quiz .q-ctx { color: var(--muted) }
.answers { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: .6rem }
@media (max-width: 520px) { .answers { grid-template-columns: 1fr } }
.answers button { text-align: left; background: var(--night); border: 1px solid var(--line); border-radius: 12px; padding: .9rem 1.1rem; cursor: pointer; font-size: 1.02rem; font-weight: 600; transition: border-color .2s, background .2s }
.answers button:hover:not(:disabled) { border-color: var(--ink) }
.answers button.right { border-color: var(--e-modern); background: color-mix(in srgb, var(--e-modern) 18%, var(--night)) }
.answers button.wrong { border-color: var(--dragon); background: color-mix(in srgb, var(--dragon) 16%, var(--night)) }
.answers button:disabled { cursor: default }
.q-fb { min-height: 1.6em; color: var(--muted) }
.q-fb b { color: var(--ink) }
.q-fb .q-learn { display: block; margin-top: .45rem; font-size: .95rem; line-height: 1.5 }
.q-fb .q-learn a { color: var(--gold); white-space: nowrap }
.q-score { font-family: var(--f-display); font-size: clamp(4rem, 12vw, 7rem); line-height: .9; color: var(--dragon) }

/* Sources */
.reading { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr)); gap: clamp(1.5rem, 4vw, 3rem) }
.reading ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 0 }
.reading li { padding: .85rem 0; border-bottom: 1px solid var(--line); display: grid; gap: .15rem }
.reading li b { font-weight: 700 }
.reading li span { color: var(--muted); font-size: .93rem }
.reading a { text-decoration-color: var(--line); text-underline-offset: 3px }
.reading a:hover { text-decoration-color: var(--dragon) }
.note-box { background: var(--slate); border: 1px solid var(--line); border-radius: 12px; padding: 1rem 1.2rem; color: var(--muted); font-size: .92rem }
footer nav { display: flex; flex-wrap: wrap; gap: .4rem 1.2rem }
footer nav a { color: var(--muted); text-decoration: none }
footer nav a:hover { color: var(--ink) }

/* Era pages */
.era-hero { background: radial-gradient(70% 120% at 85% 0%, color-mix(in srgb, var(--c) 28%, transparent), transparent 60%), var(--night); border-bottom: 1px solid var(--line) }
.era-hero .wrap { padding-block: clamp(3rem, 8vw, 6rem); display: grid; gap: 1rem }
.era-hero svg.ill { width: clamp(4rem, 9vw, 6rem); height: clamp(4rem, 9vw, 6rem); color: var(--c) }
.era-hero h1 { font-size: clamp(3.2rem, 10vw, 7rem); line-height: .92 }
.era-hero .span { font-family: var(--f-mono); color: var(--c); letter-spacing: .08em }
.crumbs { font-size: .9rem; color: var(--muted) }
.crumbs a { color: var(--muted) }
.story { display: grid; gap: 1.2rem; max-width: 64ch; font-size: 1.12rem }
.story > p:first-child::first-letter { font-family: var(--f-display); float: left; font-size: 3.8em; line-height: .85; padding: .05em .1em 0 0; color: var(--c) }
.era-events { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; border-top: 1px solid var(--line) }
.era-events li { display: grid; grid-template-columns: 9rem minmax(0,1fr); gap: 1.25rem; padding: 1.1rem 0; border-bottom: 1px solid var(--line) }
.era-events time { font-family: var(--f-mono); font-size: .82rem; color: var(--c); padding-top: .2rem }
.era-events h3 { font-family: var(--f-body); font-weight: 700; font-size: 1.15rem; line-height: 1.3 }
.era-events p { color: var(--muted); margin-top: .2rem }
@media (max-width: 560px) { .era-events li { grid-template-columns: 1fr; gap: .2rem } }
.plaque { scroll-margin-top: 6rem }
.plaque:target { outline: 2px solid var(--c); outline-offset: 4px }
.plaque .links { display: flex; flex-wrap: wrap; gap: .4rem 1rem; align-items: center; margin-top: .2rem }
.copy { background: none; border: 0; padding: 0; cursor: pointer; font-family: var(--f-mono); font-size: .75rem; color: var(--muted) }
.copy:hover { color: var(--ink) }
.plaque a.go { color: var(--ink); font-weight: 700; font-size: .9rem; text-decoration: none }
.plaque a.go:hover { text-decoration: underline }
.era-places { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 17rem), 1fr)); gap: 1rem }
.era-places a { display: grid; grid-template-columns: 3.2rem minmax(0,1fr); gap: .9rem; align-items: center; text-decoration: none; background: var(--slate); border: 1px solid var(--line); border-radius: 12px; padding: .9rem 1rem; transition: border-color .2s }
.era-places a:hover { border-color: var(--c) }
.era-places svg { width: 3.2rem; height: 3.2rem; color: var(--c) }
.era-places b { display: block; font-family: var(--f-display); font-weight: 400; font-size: 1.3rem; line-height: 1.15 }
.era-places span span { font-size: .85rem; color: var(--muted) }
.pager { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap }
.sub-h { font-size: clamp(2rem, 5vw, 3.2rem); margin-bottom: 1.5rem }

.trails-strip { margin-top: 2rem; display: grid; gap: 1rem }
.trails-strip .eyebrow a { color: var(--ink) }
.trail-card { display: grid; grid-template-columns: 3rem minmax(0,1fr); gap: .9rem; align-items: center; text-decoration: none; background: var(--slate); border: 1px solid var(--line); border-radius: 12px; padding: .9rem 1rem; transition: border-color .2s }
.trail-card:hover { border-color: var(--c) }
.trail-card svg { width: 3rem; height: 3rem; color: var(--c) }
.trail-card b { display: block; font-family: var(--f-display); font-weight: 400; font-size: 1.3rem; line-height: 1.15 }
.trail-card span span { font-size: .85rem; color: var(--muted) }

/* ---------- v5: near you, timeline challenge, word audio, search ---------- */
.near { margin-top: clamp(1.5rem, 4vw, 2.5rem); background: var(--slate); border: 1px solid var(--line); border-radius: 14px; padding: clamp(1.1rem, 3vw, 1.6rem); display: grid; gap: .9rem }
.near-head h3 { font-size: 1.7rem }
.near-form { display: flex; flex-wrap: wrap; gap: .6rem }
.near-form input { flex: 1 1 14rem; min-width: 0; background: var(--night); color: var(--ink); border: 1px solid var(--line); border-radius: 999px; padding: .7rem 1.1rem; font: inherit }
.near-form input:focus { outline: 2px solid var(--dragon); outline-offset: 2px }
.near-msg { color: var(--muted); margin: 0; min-height: 1.2em }
.near-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 13rem), 1fr)); gap: .6rem }
.near-go { width: 100%; text-align: left; display: grid; gap: .2rem; background: var(--night); color: var(--ink); border: 1px solid var(--line); border-left: 3px solid var(--c); border-radius: 10px; padding: .75rem .9rem; cursor: pointer; font: inherit }
.near-go:hover { border-color: var(--ink); border-left-color: var(--c) }
.near-go span { font-family: var(--f-mono); font-size: .75rem; color: var(--muted) }
#wales .you circle { fill: var(--ink); opacity: .25 } #wales .you circle.in { fill: var(--ink); opacity: 1 }
#wales .you text { fill: var(--ink); font: 600 13px var(--f-body) }
.game-box { background: var(--slate); border: 1px solid var(--line); border-radius: 14px; padding: clamp(1.1rem, 3vw, 1.8rem); display: grid; gap: 1rem }
.g-cards { list-style: none; margin: 0; padding: 0; display: grid; gap: .6rem }
.g-card { width: 100%; display: flex; gap: .9rem; align-items: center; text-align: left; background: var(--night); color: var(--ink); border: 1px solid var(--line); border-left: 3px solid var(--c); border-radius: 12px; padding: .8rem 1rem; cursor: pointer; font: inherit; font-size: 1.02rem }
.g-card:hover:not(:disabled) { border-color: var(--ink); border-left-color: var(--c) }
.g-card[aria-pressed="true"] { background: var(--slate-2) }
.g-card > span:last-child { display: grid; gap: .2rem }
.g-n { flex: none; width: 2rem; height: 2rem; border-radius: 50%; border: 1px dashed var(--line); display: grid; place-items: center; font-family: var(--f-mono); font-weight: 600 }
.g-card[aria-pressed="true"] .g-n { border: 0; background: var(--ink); color: var(--night) }
.g-card.right { border-color: var(--e-modern) } .g-card.wrong { border-color: var(--dragon) }
.g-card.right .g-n { background: var(--e-modern) } .g-card.wrong .g-n { background: var(--dragon) }
.g-card:disabled { cursor: default }
.g-y { font-family: var(--f-mono); font-size: .78rem; color: var(--muted) }
.game-row { display: flex; flex-wrap: wrap; gap: .8rem; align-items: center; justify-content: space-between }
.game-row .q-fb { margin: 0 }
.words .say { display: flex; align-items: center; gap: .5rem }
.words .say .g { font-size: inherit; color: inherit; flex: 0 1 auto; min-width: 0 }
.words .say .g i { font-style: normal; white-space: nowrap }
.words .play { flex: none; background: none; border: 1px solid var(--line); color: var(--ink); border-radius: 999px; width: 1.9rem; height: 1.9rem; cursor: pointer; font-size: .75rem; vertical-align: middle }
.words-credit { margin: .7rem 0 0; font-size: .8rem; color: var(--muted) }
.words-credit a { color: inherit; text-decoration: underline; text-underline-offset: 2px }
.words .play:hover { border-color: var(--dragon); color: var(--dragon) }
.photo { margin: 0 0 1.6rem; display: grid; gap: .55rem; max-width: 52rem }
.photo img { width: 100%; max-width: 100%; aspect-ratio: 16 / 10; object-fit: cover; border-radius: 14px; border: 1px solid var(--line); background: var(--slate) }
.photo.portrait { max-width: 24rem } .photo.portrait img { aspect-ratio: 4 / 5; object-position: center 25% }
.photo figcaption { font-size: .85rem; color: var(--muted) } .photo figcaption a { color: var(--muted) }
.place-card .art.has-photo { padding: 0; overflow: hidden; height: 12rem } .place-card .art.has-photo img { width: 100%; height: 100%; object-fit: cover; display: block }
.place-card .credit { font-size: .75rem; color: var(--muted); padding-block: 3px } .place-card .credit a { color: var(--muted) }
/* search button: styled up front so the nav doesn't jump on load */
.search-btn{background:none;border:1px solid var(--line);color:var(--ink);border-radius:999px;width:2.4rem;height:2.4rem;display:grid;place-items:center;cursor:pointer;flex:none;margin-right:.6rem;padding:0}.search-btn:hover{border-color:var(--ink)}.search-btn svg{width:1.05rem;height:1.05rem}
a.chip { text-decoration: none; color: inherit }
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap }

/* kingdoms map: names on the land, play controls */
.kg-label { font: 600 17px var(--f-body, sans-serif); fill: #fff; text-anchor: middle; dominant-baseline: middle; paint-order: stroke; stroke: rgba(11,14,22,.75); stroke-width: 4px; stroke-linejoin: round; pointer-events: none; letter-spacing: .01em }
.kg-btns { display: flex; gap: .5rem; align-items: center; margin-top: .4rem }
.kg-btns #kg-play { flex: 1; justify-content: center }
@media (max-width: 900px) { .kg-label { font-size: 24px } }
.kg-legend a { color: inherit; text-decoration-color: var(--line); text-underline-offset: 3px }
.kg-legend a:hover { text-decoration-color: currentColor }
.kg-kings { margin-top: .9rem; font-weight: 700 }

/* pictures inside a long read ("!! key" in the text, src/welshnot.py) */
.prose figure.lr-fig { margin: 1.8rem 0 }
.prose figure.lr-fig img { display: block; width: 100%; height: auto; max-height: 30rem; aspect-ratio: auto; object-fit: contain; background: #0d1018; border-radius: 10px }
.prose figure.lr-fig figcaption { margin-top: .55rem; line-height: 1.45 }

/* kingdoms map: the "Move through time" slider. --th is the thumb size; --f (0 to 1) is set by app.js.
   The whole strip takes the pointer (see kgShell in app.js), so the native input only draws and keeps the keyboard. */
.kg-slide { --th: 32px; --tr: 10px; --f: 0; position: relative; padding: 4px 0 0; touch-action: pan-y; cursor: pointer; user-select: none; -webkit-user-select: none; -webkit-tap-highlight-color: transparent }
.kg-slide.drag { cursor: grabbing }
.kg-slide input { -webkit-appearance: none; appearance: none; display: block; width: 100%; height: calc(var(--th) + 12px); margin: 0; background: transparent; pointer-events: none; cursor: inherit }
.kg-slide input:focus { outline: none }
.kg-slide input::-webkit-slider-runnable-track { height: var(--tr); border-radius: 99px; border: 0;
  background: linear-gradient(to right, var(--dragon) 0 calc(var(--th) / 2 + (100% - var(--th)) * var(--f)), color-mix(in srgb, var(--ink) 22%, transparent) 0) }
.kg-slide input::-moz-range-track { height: var(--tr); border-radius: 99px; border: 0; background: color-mix(in srgb, var(--ink) 22%, transparent) }
.kg-slide input::-moz-range-progress { height: var(--tr); border-radius: 99px; background: var(--dragon) }
.kg-slide input::-webkit-slider-thumb { -webkit-appearance: none; width: var(--th); height: var(--th); margin-top: calc((var(--tr) - var(--th)) / 2); border-radius: 50%;
  background: var(--dragon); border: 4px solid #fff; box-shadow: 0 2px 10px rgba(0,0,0,.45); transition: transform .15s }
.kg-slide input::-moz-range-thumb { box-sizing: border-box; width: var(--th); height: var(--th); border-radius: 50%; background: var(--dragon); border: 4px solid #fff; box-shadow: 0 2px 10px rgba(0,0,0,.45); transition: transform .15s }
.kg-slide:hover input::-webkit-slider-thumb, .kg-slide.drag input::-webkit-slider-thumb { transform: scale(1.12) }
.kg-slide:hover input::-moz-range-thumb, .kg-slide.drag input::-moz-range-thumb { transform: scale(1.12) }
.kg-slide input:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 4px var(--night, #11141c), 0 0 0 7px var(--ink) }
.kg-slide input:focus-visible::-moz-range-thumb { box-shadow: 0 0 0 4px var(--night, #11141c), 0 0 0 7px var(--ink) }
.kg-ticks { position: relative; height: 2.2rem; font: 500 .78rem var(--f-mono); color: var(--muted) }
.kg-ticks span { position: absolute; top: 0; left: calc(var(--th) / 2 + (100% - var(--th)) * var(--i) / var(--n)); transform: translateX(-50%); padding: .55rem .15rem .2rem; white-space: nowrap; transition: color .15s }
.kg-ticks span::before { content: ""; position: absolute; top: 0; left: 50%; width: 2px; height: .35rem; margin-left: -1px; border-radius: 2px; background: currentColor; opacity: .6 }
.kg-slide:hover .kg-ticks span:hover { color: var(--ink) }
.kg-ticks span.on { color: var(--ink); font-weight: 700 }
.kg-ticks span.on::before { background: var(--dragon); opacity: 1; height: .45rem }
.kg-hint { margin: 0; font-size: .8rem; color: var(--muted) }
@media (pointer: coarse) { .kg-slide { --th: 36px; --tr: 12px } }
/* not room for every year in one row on a phone: every other year drops to a second row */
@media (max-width: 560px) {
  .kg-ticks { height: 3.4rem; font-size: .75rem }
  .kg-ticks span:nth-child(even) { padding-top: 1.75rem }
  .kg-ticks span:nth-child(even)::before { height: 1.55rem; opacity: .35 }
  .kg-ticks span.on:nth-child(even)::before { height: 1.6rem }
}
/* "Did you know?": the fact links to its full page (Ifan, November 2026) */
.fact-a { color: inherit; text-decoration: none; background-image: linear-gradient(var(--dragon), var(--dragon)); background-size: 0 2px; background-position: 0 100%; background-repeat: no-repeat; transition: background-size .25s }
.fact-a:hover, .fact-a:focus-visible { background-size: 100% 2px }
.fact-actions { display: flex; flex-wrap: wrap; gap: .5rem; margin: 0 }
.fact-actions .chip.solid { background: var(--dragon); border-color: var(--dragon); color: #1a0d0c; font-weight: 600; text-decoration: none }
.fact-actions .chip.solid:hover { background: #ff8178 }

/* the ogham alphabet and the "write your name in ogham" box (standing stones long read, ogham_key() in build.py) */
.prose figure.og-fig, .prose figure.og-box { margin: 1.8rem 0; padding: 1.1rem 1.1rem .9rem; border-radius: 14px; background: var(--card); border: 1px solid rgba(255,255,255,.08) }
.og-key, .og-out { display: block; max-width: 100%; height: auto; margin: 0 auto; stroke: var(--gold); stroke-width: 2.6; stroke-linecap: round }
.og-key { width: 100%; max-width: 30rem }
.og-key .og-stem, .og-out .og-stem { stroke: currentColor; stroke-width: 1.6; opacity: .55 }
.og-key text, .og-out text { fill: currentColor; stroke: none; font: 600 15px/1 inherit; text-anchor: middle }
.og-lab { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem .9rem; margin-bottom: .9rem }
.og-in { flex: 1 1 12rem; min-height: 44px; padding: .5rem .8rem; border-radius: 10px; border: 1px solid rgba(255,255,255,.22); background: rgba(0,0,0,.25); color: inherit; font: inherit; font-size: 1.1rem }
.og-in:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px }
.og-out { overflow: visible; margin-block: .4rem .8rem }
.og-say { color: var(--gold); letter-spacing: .06em }
.og-fig figcaption, .og-box figcaption { margin-top: .6rem; line-height: 1.45; font-size: .92rem }

/* teachers.html: Welsh archives to research in (whole cards are links) */
.arch-list { list-style: none; padding: 0; margin: 1.2rem 0 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr)); gap: .8rem }
.arch-list li { border: 1px solid rgba(236,233,225,.14); border-radius: 12px; padding: 1rem 1.1rem; background: rgba(255,255,255,.03) }
.arch-list b { display: block; margin-bottom: .35rem }
.arch-list p { margin: 0; color: var(--muted); font-size: .92rem; line-height: 1.5 }

/* story-leys.html: the ley lines long read (src/leylines.py). Old OS maps with the measured line and numbered sites drawn over them */
.ley-os, .ley-wales { width: min(68rem, calc(100vw - 2rem)); margin: 2rem calc((100% - min(68rem, calc(100vw - 2rem))) / 2) }
.ley-box { position: relative; display: block; border-radius: 14px; overflow: hidden; border: 1px solid var(--line); background: #e9e3d2 }
.ley-box img { display: block; width: 100%; height: 100%; object-fit: cover }
.ley-box svg { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none }
.ley-ln { stroke: #c81e1e; stroke-opacity: .85; stroke-linecap: round }
.ley-ln2 { stroke: #c99a12; stroke-dasharray: 18 10 }
.ley-lead { stroke: #7a1212 }
.ley-dot { fill: #7a1212 }
.ley-pin circle { fill: #c81e1e; stroke: #fff }
.ley-pin text { fill: #fff; font-family: var(--f-body); font-weight: 700; text-anchor: middle }
.ley-os figcaption { margin-top: .6rem; color: var(--muted); font-size: .92rem; line-height: 1.5 }
.ley-os figcaption .cr { display: block; font-size: .8rem; opacity: .8 }
.ley-sites { margin: 1.2rem 0 2rem; padding: 1rem 1.1rem; border: 1px solid var(--line); border-radius: 14px; background: rgba(255,255,255,.03); scroll-margin-top: 6rem }
.ley-sum { margin: 0 0 .7rem; font-weight: 700; color: var(--gold) }
.ley-sites ol { margin: 0; padding-left: 1.6rem; display: grid; gap: .55rem }
.ley-sites li { line-height: 1.45 }
.ley-sites li::marker { color: #e2453d; font-weight: 700 }
.ley-sites .k { color: var(--muted); margin-left: .45rem; font-size: .92rem }
.ley-sites .g { display: block; font-size: .88rem; color: var(--muted) }
.ley-sites code { font-family: var(--f-mono); color: var(--ink); letter-spacing: .03em }
.ley-wales .ley-wl { stroke: #e2453d; stroke-width: 2.6; stroke-linecap: round }
.ley-wales .ley-wd { fill: var(--gold); stroke: var(--night); stroke-width: 1 }
.ley-os, .ley-sites, .ley-wales { scroll-margin-top: 6rem }

/* Slate, solidarity and survival (src/penrhyn_dispute.py): the documents set out as they were printed */
.pd-doc { margin: 2rem 0 }
.pd-paper { max-width: 34rem; margin: 0 auto; padding: 1.6rem 1.8rem; background: #f4ecd8; color: #1f1a14;
  border: 1px solid #d7c9a6; border-radius: 4px; box-shadow: 0 10px 28px rgba(0,0,0,.18), inset 0 0 40px rgba(120,90,40,.12);
  font-family: Georgia, "Times New Roman", serif; line-height: 1.5 }
.pd-paper p { margin: 0 0 .7rem }
.pd-h1 { text-align: center; font-weight: 700; font-size: 1.45rem; letter-spacing: .14em }
.pd-h2 { text-align: center; font-weight: 700; font-size: 1.05rem; letter-spacing: .22em; border-bottom: 1px solid #b9a77f; padding-bottom: .6rem }
.pd-body { text-align: justify; hyphens: auto; text-indent: 1.6em }
.pd-sign { text-align: right; font-weight: 700; letter-spacing: .12em; margin-top: 1.2rem !important }
.pd-place { font-size: .88rem; font-variant: small-caps; letter-spacing: .04em }
.pd-list { margin: .4rem 0 0; padding-left: 1.6rem }
.pd-list li { margin: 0 0 .45rem; padding-left: .2rem }
.pd-card .pd-paper { max-width: 22rem; text-align: center; padding: 1.8rem 1.2rem; background: #fbf7ec; border: 3px double #1f1a14 }
.pd-card-s { font-weight: 700; font-size: 1.25rem; letter-spacing: .16em; margin: .2rem 0 !important }
.pd-card-b { font-weight: 900; font-size: clamp(2.2rem, 9vw, 3.4rem); letter-spacing: .08em; line-height: 1.05; margin: .3rem 0 !important }
.pd-doc figcaption { max-width: 34rem; margin: .8rem auto 0; color: var(--muted); font-size: .92rem; line-height: 1.5 }
.pd-doc figcaption a { white-space: normal }
@media (max-width: 520px) { .pd-paper { padding: 1.2rem 1.1rem } .pd-body { text-align: left } }

/* ---------- sharp pictures (Ifan, 16 November 2026; src/sharp.py) ---------- */
/* A page-top picture too small to fill the band is shown whole, at no more than its real size, in a frame on the right,
   in front of a soft blurred copy of itself. */
.hero-art.framed img.hero-blur { filter: blur(26px) saturate(1.15) brightness(.7); transform: scale(1.15) }
.hero-art .hero-frame { position: absolute; z-index: 1; right: max(1.5rem, calc((100vw - 74rem) / 2)); top: 50%; transform: translateY(-46%);
  height: min(80%, var(--fh), calc(30vw * var(--r))); width: auto; max-width: none; border-radius: 12px; border: 1px solid rgba(255,255,255,.18);
  box-shadow: 0 18px 50px rgba(0,0,0,.55); background: #0d1018 }
@media (max-width: 700px) {
  .hero-art .hero-frame:not(.framed-phone) { display: none }
  .hero-art.framed img.hero-blur:not(.framed-phone) { filter: none; transform: none }
  .hero-art .hero-frame.framed-phone { top: .6rem; right: 1rem; transform: none; height: min(7.2rem, var(--fh), calc(40vw * var(--r))); border-radius: 8px } /* above the words that start lower down the band */
}
@media print { .hero-art .hero-frame { display: none } }
/* Long thin pictures (a line from a manuscript, a signature) are shown whole, not cut into a square and blown up. */
.photo img.pic-strip, .pq-pic img.pic-strip, .cc-img img.pic-strip, .card-ban img.pic-strip, .art img.pic-strip, .l-card img.pic-strip, .s-card img.pic-strip { object-fit: contain !important; aspect-ratio: auto; background: #0d1018 }
.photo img.pic-strip { height: auto }
.pq-pic img.pic-strip, .cc-img img.pic-strip, .card-ban img.pic-strip { height: 100% }
/* A person card whose only picture is small: shown whole, at its own size or less, on a dark ground (build.py plaque_pic). */
.pq-pic.pq-small { background: radial-gradient(circle at 50% 40%, #232a3a, #10131b) }
.pq-pic.pq-small img { object-fit: scale-down !important }
.plaque.wl-card:hover .pq-pic.pq-small img { transform: none }

/* ---------- Find first: the timeline and the long reads (November 2026) ----------
   Read after extra.css and before v6.css (build.py extra_css). The timeline gets a box to jump to a year, person or
   event, and its twelve age chips become one row to swipe on phones, like the map. The long reads get rows of chips to
   filter by subject, age and reading time (src/static/stories.js). */

/* the timeline's jump box (app.js, "Timeline: jump") */
.tl-find { display: grid; gap: .55rem; margin: 0 0 1.3rem; max-width: 52rem }
.tl-jump { align-items: center }
.tl-jump input { flex: 1 1 12rem }
.tl-jump input::-webkit-search-cancel-button { cursor: pointer }
.tl-find .near-msg { margin: 0; color: var(--muted); font-size: .9rem }
.tl-find .near-msg:empty, .tl-hits:empty { display: none }
.tl-hits { grid-template-columns: repeat(auto-fill, minmax(min(100%, 16rem), 1fr)); gap: .45rem }
.tl-hits .near-go b { font-weight: 600; line-height: 1.3 }
#timeline .tl-tools { margin-bottom: 1.6rem }
#tl-filter { min-width: 0 }
#tl-topic { flex: 1 1 100%; min-width: 0; gap: .4rem }
#tl-topic .chip { font-size: .8rem; padding: .3rem .75rem }
#tl-topic .chip[aria-pressed="true"] { background: var(--gold, #e8c65a); border-color: var(--gold, #e8c65a); color: #1a1a1a }
#tl-topic .chip[aria-pressed="true"] .c-dates { color: #1a1a1a }
/* the event you jumped to glows for a moment */
.ev.hit { opacity: 1; isolation: isolate }
.ev.hit::after { content: ""; position: absolute; inset: 0 -.6rem 0 1.2rem; z-index: -1; border-radius: 12px; background: color-mix(in srgb, var(--c, var(--gold)) 16%, transparent); animation: ev-hit 3s ease-out forwards }
@keyframes ev-hit { 0%, 45% { opacity: 1 } 100% { opacity: 0 } }
@media (prefers-reduced-motion: reduce) { .ev.hit::after { animation: none; opacity: .8 } }

/* the long reads' filters (build.py story_filters) */
.sf { display: grid; gap: .7rem; margin: 0 0 1.8rem }
.sf-group { display: grid; grid-template-columns: 9rem minmax(0, 1fr); gap: .3rem 1rem; align-items: start }
.sf-lbl { margin: .45rem 0 0; font: 500 .75rem var(--f-mono); letter-spacing: .14em; text-transform: uppercase; color: var(--gold) }
.sf-row { display: flex; flex-wrap: wrap; gap: .45rem }
.sf .chip .n { opacity: .7; font-variant-numeric: tabular-nums }
.sf .chip.zero { opacity: .45 }
.sf .chip.zero[aria-pressed="true"] { opacity: 1 }
.sf-foot { display: flex; flex-wrap: wrap; gap: .4rem 1rem; align-items: center; min-height: 2.6rem; margin-top: .2rem }
.sf-foot .people-count { margin: 0 }
.sf-foot .btn { padding: .45rem 1rem; font-size: .88rem }
.sf-none { color: var(--muted); padding: 1.5rem 0 }

@media (max-width: 860px) {
  /* one row to swipe instead of six stacked rows (the same as the map's age chips) */
  #tl-filter, #tl-topic, .sf-row { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; max-width: 100%; padding-block: 7px; margin-block: -7px; -webkit-mask-image: linear-gradient(90deg, #000 88%, transparent); mask-image: linear-gradient(90deg, #000 88%, transparent) }
  #tl-filter::-webkit-scrollbar, #tl-topic::-webkit-scrollbar, .sf-row::-webkit-scrollbar { display: none }
  #tl-filter .chip, .sf-row .chip { flex: none; font-size: .82rem; padding: .34rem .8rem }
  #tl-filter .chip:last-child, #tl-topic .chip:last-child, .sf-row .chip:last-child { margin-right: 2.5rem }
  #tl-filter { flex: 1 1 100% }
  #timeline .tl-tools { gap: .4rem; margin-bottom: 1.1rem }
  #timeline .head { margin-bottom: 1.4rem }
  .tl-find { margin-bottom: 1rem }
  .tl-jump .btn { padding: .6rem 1rem }
  .tl-jump input { flex: 1 1 9rem; padding: .65rem 1rem }
  .tl-hits .near-go { padding: .5rem .8rem; gap: .1rem }
  .tl-hits .near-go span { font-size: .7rem }
  .sf { gap: .55rem; margin-bottom: 1.3rem }
  .sf-group { grid-template-columns: minmax(0, 1fr); gap: .25rem }
  .sf-lbl { margin: 0; font-size: .7rem }
}
@media print { .tl-find, .sf { display: none } }

/* the timeline's small map (site audit, November 2026): opens over the page, so the reader keeps their place */
.tl-map { border: 1px solid rgba(236,233,225,.18); border-radius: 14px; padding: 0; background: var(--bg-2, #141925); color: var(--ink); width: min(44rem, calc(100% - 2rem)); max-height: calc(100dvh - 2rem) }
.tl-map::backdrop { background: rgba(5,7,12,.7) }
.tlm-in { display: grid; grid-template-columns: minmax(0, 15rem) 1fr; gap: 1.2rem; padding: 1.2rem; position: relative; align-items: center }
.tlm-svg { width: 100%; height: auto; display: block }
.tlm-svg .land { fill: #232b3c; stroke: #55617a; stroke-width: 1.5 }
.tlm-svg .tlm-dot { fill: var(--red, #e2453d); stroke: #fff; stroke-width: 3 }
.tlm-svg .tlm-ring { fill: none; stroke: var(--red, #e2453d); stroke-width: 3; opacity: .55 }
.tlm-txt h3 { margin: .2rem 0 .5rem }
.tlm-txt #tlm-d { color: var(--muted); line-height: 1.55 }
.tlm-go { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1rem }
.tlm-x { position: absolute; top: .5rem; right: .6rem; width: 44px; height: 44px; border: 0; background: none; color: var(--ink); font-size: 1.7rem; cursor: pointer }
@media (max-width: 560px) { .tlm-in { grid-template-columns: 1fr } .tlm-svg { max-width: 11rem; margin: 0 auto } }

/* ================= v6: the redesign =================
   Shared by every page. Adds the full-screen menu, scroll progress, reveal-on-scroll,
   page transitions, illustrated headers, article layout, games and the journey page. */
:root { --gold: #e8c65a; --red: #e2453d; --card: #151a25; --r: 22px; --ease: cubic-bezier(.2,.7,.1,1) }
::selection { background: var(--red); color: #fff }
@view-transition { navigation: auto }
::view-transition-old(root) { animation: vt-out .22s ease both }
::view-transition-new(root) { animation: vt-in .34s ease both }
@keyframes vt-out { to { opacity: 0 } }
@keyframes vt-in { from { opacity: 0; transform: translateY(10px) } }
.narrow { max-width: 47rem }
.muted { color: var(--muted) }
.more-row { margin-top: 1.75rem; display: flex; flex-wrap: wrap; gap: .75rem }
.btn.ghost { border-color: transparent; padding-inline: .6rem }
.btn.ghost:hover { background: transparent; color: var(--dragon); border-color: transparent }

/* reveal on scroll (only once the script has started; everything shows if it never does) */
html.js .rv { opacity: 0; transform: translateY(26px); transition: opacity .7s var(--ease), transform .7s var(--ease) }
html.js .rv.in, html.rv-all .rv { opacity: 1; transform: none }

/* ---------- top bar ---------- */
.progress { position: fixed; inset: env(safe-area-inset-top, 0px) 0 auto 0; height: 3px; z-index: 32; pointer-events: none }
.progress i { display: block; height: 100%; width: 100%; transform: scaleX(0); transform-origin: left; background: linear-gradient(90deg, var(--red), var(--gold)) }
.nav { z-index: 30; background: rgba(11,14,22,.72); backdrop-filter: blur(16px) saturate(1.4); -webkit-backdrop-filter: blur(16px) saturate(1.4) }
.nav .wrap { flex-wrap: nowrap; gap: .6rem; padding-block: .6rem }
.brand { white-space: nowrap; font-size: 1.35rem }
/* "History of Wales" in the logo: the same visible gap between each word (BRAND in build.py) */
.brand .b-of { margin-left: .05em } .brand .b-wales { margin-left: .2em }
.nav .nav-inline { display: flex; flex-wrap: nowrap; gap: 0 1.25rem; margin-right: .6rem; width: auto; order: 0 }
.nav .nav-inline a { position: relative; padding: .4rem 0; white-space: nowrap }
.nav .nav-inline a::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: var(--red); transform: scaleX(0); transform-origin: left; transition: transform .3s var(--ease) }
.nav .nav-inline a:hover::after, .nav .nav-inline a.on::after { transform: none }
.search-btn { margin-right: 0 }
.menu-btn { display: inline-flex; align-items: center; gap: .55rem; background: var(--ink); color: var(--night); border: 0; border-radius: 999px; padding: .55rem 1rem .55rem .85rem; font-weight: 700; font-size: .88rem; cursor: pointer; flex: none }
.menu-btn .bars { display: grid; gap: 4px; width: 16px }
.menu-btn .bars i { height: 2px; background: currentColor; border-radius: 2px; transition: transform .3s var(--ease) }
.menu-btn[aria-expanded="true"] .bars i:first-child { transform: translateY(3px) rotate(45deg) }
.menu-btn[aria-expanded="true"] .bars i:last-child { transform: translateY(-3px) rotate(-45deg) }
.journey-chip { display: inline-flex; align-items: center; gap: .4rem; flex: none; text-decoration: none; color: var(--ink); border-radius: 999px }
.journey-chip .jc-ring { position: relative; width: 2.4rem; height: 2.4rem; display: grid; place-items: center; border-radius: 50% }
.journey-chip svg { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg) }
.journey-chip circle { fill: none; stroke-width: 3 }
.journey-chip .tr { stroke: var(--line) } .journey-chip .fg { stroke: var(--gold); stroke-linecap: round; transition: stroke-dasharray .8s var(--ease) }
.journey-chip b { font: 600 .75rem var(--f-mono); color: var(--ink) }
.journey-chip .jc-l { font-size: .78rem; color: var(--muted); white-space: nowrap }
.journey-chip:hover .tr { stroke: var(--muted) } .journey-chip:hover .jc-l { color: var(--ink) }
@media (max-width: 640px) { .journey-chip .jc-l { display: none } }
@media (max-width: 1119px) { .nav .nav-inline { display: none } }
/* every topic stays in the bar on every page and at every desktop width, beside the site name: the words and gaps are kept small enough to fit the 1185 px row in both languages */
@media (min-width: 1120px) { .nav .nav-inline { gap: 0 .95rem; margin-right: .3rem } .nav .nav-inline a { font-size: .9rem } .nav a.brand { font-size: 1.15rem } .nav .wrap { gap: .5rem } }
@media (max-width: 560px) { .menu-btn .l-en, .menu-btn .l-cy { display: none !important } .menu-btn { padding: .7rem .75rem } .brand { font-size: 1.15rem } .brand svg { width: 1.3rem; height: 1.3rem } .lang button, .lang a { padding: .2rem .5rem } .nav .wrap { gap: .4rem } }
@media (max-width: 400px) { .journey-chip { display: none } }

.menu { position: fixed; inset: 0; z-index: 29; background: rgba(9,12,19,.97); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); overflow-y: auto; padding: calc(env(safe-area-inset-top, 0px) + 5.5rem) 0 3rem; animation: fade .25s ease both }
.menu .wrap { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 2rem clamp(2rem, 6vw, 6rem); align-items: start }
.menu ul { list-style: none; margin: 0; padding: 0 }
.menu-big { display: grid }
.menu-big a { display: flex; align-items: baseline; gap: 1.2rem; text-decoration: none; font-family: var(--f-display); font-size: clamp(2rem, 5.2vw, 3.7rem); line-height: 1.12; padding: .28rem 0; border-bottom: 1px solid rgba(46,54,71,.6); word-spacing: .1em; transition: color .2s, padding-left .35s var(--ease) }
.menu-big a:hover, .menu-big a:focus-visible { color: var(--dragon); padding-left: .6rem }
.menu-big a.on { color: var(--dragon) }
.menu-big .n { font: 500 .75rem var(--f-mono); color: var(--muted); letter-spacing: .1em; width: 1.6rem }
.menu-big li { animation: menu-in .5s var(--ease) both; animation-delay: calc(var(--k, 0) * 40ms) }
.menu-big li:nth-child(1) { --k: 1 } .menu-big li:nth-child(2) { --k: 2 } .menu-big li:nth-child(3) { --k: 3 } .menu-big li:nth-child(4) { --k: 4 } .menu-big li:nth-child(5) { --k: 5 } .menu-big li:nth-child(6) { --k: 6 } .menu-big li:nth-child(7) { --k: 7 } .menu-big li:nth-child(8) { --k: 8 } .menu-big li:nth-child(9) { --k: 9 }
@keyframes menu-in { from { opacity: 0; transform: translateY(18px) } }
.menu-side { display: grid; gap: 1rem; padding-top: .8rem }
.menu-more { display: grid; gap: .1rem }
.menu-groups { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.6rem 2rem }
.menu-group .eyebrow { margin-bottom: .3rem }
.menu-group .menu-more a { font-size: 1rem; padding: .4rem 0 }
@media (max-width: 420px) { .menu-groups { grid-template-columns: 1fr } }
.menu-more a { display: block; text-decoration: none; padding: .5rem 0; font-size: 1.1rem; color: #cfd2d8; border-bottom: 1px solid rgba(46,54,71,.5) }
.menu-more a:hover { color: var(--dragon) }
.menu-note { color: var(--muted); font-size: .9rem; margin-top: 1rem; max-width: 22rem }
@media (max-width: 760px) { .menu .wrap { grid-template-columns: 1fr } }
html.menu-open { overflow: hidden }

/* ---------- home hero ---------- */
.hero { min-height: min(calc(100svh - 3.6rem), 88vw); display: flex; flex-direction: column }
@media (min-width: 1100px) { .hero { min-height: min(calc(100svh - 3.6rem), 88vw, 60rem) } }
.hero > .wrap { width: 100%; flex: 1; display: flex; flex-direction: column; justify-content: center }
.hero::after { content: ""; position: absolute; inset: auto 0 0 0; height: 30%; background: linear-gradient(transparent, var(--night)); z-index: -1; pointer-events: none }
.ticker { position: relative; margin-top: auto; background: rgba(11,14,22,.5) }
@media (min-width: 641px) { .hero .wrap { padding-bottom: clamp(3rem, 6vw, 5rem) } }
@media (min-width: 641px) and (max-width: 1099px) { .hero .wrap { padding-bottom: 11rem } }
@media (max-width: 640px) {
  .hero .wrap { padding-block: 1.5rem 12.5rem }
  .hero .sub { margin-top: 1.1rem; gap: .8rem }
  .hero .sub p:first-child { font-size: 1.32rem }
  .hero .sub p + p { font-size: 1rem; line-height: 1.5 }
}
/* the room left under the words is for the mountains; the row of figures must not inherit it, or an empty gap opens above the moving words */
.hero .ticker .wrap { padding-block: 1rem 1.9rem }
/* a glint of light crossing "Cymru", letter by letter, then again every so often */
.hero h1 span { --k: #ece9e1; padding-block: .14em .2em; margin-block: -.14em -.2em; background: linear-gradient(100deg, var(--k) 38%, #ffe2a6 50%, var(--k) 62%) 100% 0 / 400% 100% no-repeat, var(--k); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
  animation: rise 1.1s cubic-bezier(.2,.7,.1,1) both, glint 9s linear infinite; animation-delay: calc(var(--i) * 70ms + 150ms), calc(var(--i) * 110ms + 1500ms) }
.hero h1 .y { --k: #e2453d }
@keyframes glint { 0% { background-position: 100% 0, 0 0 } 14%, 100% { background-position: 0% 0, 0 0 } }
@media (prefers-reduced-motion: reduce) { .hero h1 span { animation: none } }
/* the words under the title follow it in, one after the other */
.hero .sub p { animation: h-in .9s var(--ease, ease) both }
.hero .sub p:first-child { animation-delay: .9s } .hero .sub p + p { animation-delay: 1.1s }
/* the introduction sits over bright snow on some screens: near-white text with a soft dark glow behind it, so it reads on any background (Ifan, 14 Nov 2026) */
.hero .sub p + p { color: #f1eee6; font-weight: 500; font-size: 1.08rem; line-height: 1.6; max-width: 38rem; text-shadow: 0 1px 2px rgba(6,8,14,.95), 0 0 10px rgba(6,8,14,.85), 0 0 24px rgba(6,8,14,.7) }
@media (max-width: 640px) { .hero .sub p + p { font-size: 1rem; line-height: 1.55 } }
@media (min-width: 1100px) and (min-height: 620px) { .hero > .wrap { position: relative } }
/* ---------- where to begin: three ways in, beside the introduction (Ifan, 2026-11-12) ---------- */
.begin { margin-top: clamp(1.4rem, 3vw, 2.2rem); max-width: 50rem; animation: h-in .9s var(--ease, ease) 1.3s both }
@media (min-width: 1100px) { .begin { max-width: min(50rem, 56vw) } }  /* on wide screens the castle stands to the right; keep the cards clear of it */
.begin .eyebrow { margin-bottom: .6rem; color: #f0c977 }
.begin-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .65rem }
.begin-card { position: relative; display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto 1fr; gap: .25rem .7rem; align-items: start; padding: .95rem 2.1rem .95rem .95rem; border-radius: 14px;
  text-decoration: none; color: var(--ink, #ece9e1); background: rgba(11,14,22,.62); border: 1px solid rgba(236,233,225,.18); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  transition: background .25s, border-color .25s, transform .25s var(--ease, ease) }
.begin-card svg { grid-row: 1 / 3; width: 2rem; height: 2rem; color: #f0c977; margin-top: .1rem }
.begin-card .b-t { font: 600 1.06rem/1.2 var(--f-body, inherit) }
.begin-card .b-s { font-size: .86rem; line-height: 1.4; color: rgba(236,233,225,.78) }
.begin-card i { position: absolute; right: .9rem; top: .95rem; font-style: normal; font-weight: 700; transition: transform .25s var(--ease, ease) }
.begin-card:hover, .begin-card:focus-visible { border-color: rgba(240,201,119,.85); background: rgba(20,25,38,.82); transform: translateY(-2px) }
.begin-card:hover i, .begin-card:focus-visible i { transform: translateX(3px) }
@media (max-width: 760px) {
  .begin-row { grid-template-columns: 1fr; gap: .5rem }
  .begin-card { padding: .75rem 2.2rem .75rem .8rem; gap: .15rem .7rem }
  .begin-card svg { width: 1.7rem; height: 1.7rem }
  .begin-card i { top: 50%; translate: 0 -50% }
}
@media (prefers-reduced-motion: reduce) { .begin { animation: none } .begin-card, .begin-card i { transition: none } }
/* ---------- site audit, November 2026: steadier reading over the moving scene, a shorter opening on phones, and the beginner's overview beside the ways in ---------- */
/* the introduction sits on its own dark backing, so it reads the same whatever part of the mountains or sky is behind it */
.hero .sub p.intro { justify-self: start; background: rgba(10,13,21,.8); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); border: 1px solid rgba(236,233,225,.1);
  border-radius: 12px; padding: .7rem .95rem; margin-left: -.95rem; text-shadow: 0 1px 2px rgba(6,8,14,.8) }
@media (max-width: 640px) {
  .hero .intro-more { display: none }  /* phones show the first and last sentences of the introduction */
  .hero .sub p.intro { margin-left: -.6rem; margin-right: -.6rem; padding: .6rem .6rem }
}
/* the second and third ways in were see-through over the moor; now they are nearly solid */
.begin-card { background: rgba(11,14,22,.88) }
/* Ifan, 16 November 2026: the twelve ages card is dark like the others, and the "New to Welsh history?" box is the light one */
.begin-card:hover, .begin-card:focus-visible { background: rgba(22,27,40,.94) }
.begin-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .45rem 1rem; margin-bottom: .6rem }
.begin-head .eyebrow { margin: 0 }
.begin-new { display: inline-flex; align-items: center; gap: .45rem; flex-wrap: wrap; text-decoration: none; color: #10131b; font-size: .95rem;
  background: #ece9e1; border: 1px solid #ece9e1; border-radius: 999px; padding: .4rem .95rem; -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  transition: border-color .2s, background .2s }
.begin-new .bn-q { color: #3a3f4b }
.begin-new b { color: #a50d26; font-weight: 700 }
.begin-new i { font-style: normal; font-weight: 700; color: #a50d26; transition: transform .25s var(--ease, ease) }
.begin-new:hover, .begin-new:focus-visible { border-color: #fff; background: #fff }
.begin-new:hover i, .begin-new:focus-visible i { transform: translateX(3px) }
@media (max-width: 640px) { .begin-head { margin-bottom: .5rem } .begin-new { width: 100%; justify-content: space-between; border-radius: 12px; padding: .6rem .8rem; min-height: 44px } .begin-new i { margin-left: auto } .begin-new .bn-q { width: 100% } }
@media (prefers-reduced-motion: reduce) { .begin-new, .begin-new i { transition: none } }
/* the twelve ages always carry their dates, so a newcomer can tell the Age of Kings (800 – 1100) from the Age of Princes (1100 – 1485) */
.m-dates, .c-dates { font: 500 .78em var(--f-mono); letter-spacing: .02em; opacity: .72; white-space: nowrap }
.menu-group .m-dates { display: block; margin-top: .1rem; font-size: .75rem }
.pager .m-dates { opacity: .75; margin-inline: .15rem }
.foot-cols .m-dates { display: block; font-size: .75rem; margin-top: .05rem }

/* ---------- marquee: the scrolling words band (Ifan, 14 Nov 2026) ----------
   Two rows. The top row (.mq-top) scrolls: it drifts by itself and can be dragged, swiped or scrolled. The row under it
   (.mq-under) is moved by app.js the opposite way. Each top word is painted with its own picture (src/static/mq/, made by
   tools/make_marquee_pictures.py); a pale wash over the picture keeps the letters light enough to read on the dark band. */
.marquee { position: relative; border-block: 1px solid var(--line); padding-block: 1rem .9rem; background: var(--night); -webkit-user-select: none; user-select: none; -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent) }
.mq-top { overflow-x: auto; overflow-y: hidden; scrollbar-width: none; cursor: grab; overscroll-behavior-x: contain }
.mq-top::-webkit-scrollbar { display: none }
.mq-under { overflow: hidden; cursor: grab; touch-action: pan-y; margin-top: .1rem; padding-bottom: .1em }
.marquee .track { display: flex; align-items: center; gap: 1.6rem; width: max-content; padding-inline: 1.1rem; font-family: var(--f-display); font-size: clamp(2.35rem, 6vw, 4.3rem); line-height: 1; white-space: nowrap }
.marquee .track2 { display: flex; align-items: center; gap: 1.1rem; width: max-content; font-family: var(--f-display); font-size: clamp(1.3rem, 2.6vw, 1.9rem); line-height: 1.1; white-space: nowrap; will-change: transform }
.marquee.drag, .marquee.drag .mq-top, .marquee.drag .mq-under { cursor: grabbing }
.marquee a { color: var(--ink); text-decoration: none; -webkit-user-drag: none }
.marquee .track2 a { color: var(--gold); opacity: .88; letter-spacing: .02em; transition: opacity .2s, color .2s }
.marquee .track2 a:hover { opacity: 1; color: #f3d77a }
.marquee .track2 i { width: .32em; height: .32em; border-radius: 50%; background: var(--gold); opacity: .45; flex: none }
.marquee.drag a { pointer-events: none }
.marquee .track > i { display: flex; align-items: center; flex: none }
.marquee .mq-drag { height: .62em; width: auto; display: block; filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .5)) }
.marquee .mq-daff { height: .58em; width: .58em; display: block }
/* the words sit in boxes one line high, but the tails of g, y and p hang below that line. The padding makes the box (and the
   picture painted in it) reach the bottom of every tail and the top of every capital and circumflex (Ifan, 14 Nov 2026). */
.marquee .track a { transition: transform .35s var(--ease), filter .35s; padding: .1em .03em .3em }
.marquee .track a:hover, .marquee .track a:focus-visible { transform: translateY(-.04em) scale(1.04) }
@supports ((-webkit-background-clip: text) or (background-clip: text)) {
  .marquee .track a { color: transparent; -webkit-text-fill-color: transparent; -webkit-background-clip: text; background-clip: text;
    background-image: linear-gradient(rgba(250, 244, 230, .34), rgba(250, 244, 230, .34)), var(--mq); background-size: cover; background-position: center }
  .marquee .track a:hover, .marquee .track a:focus-visible { background-image: linear-gradient(rgba(250, 244, 230, .08), rgba(250, 244, 230, .08)), var(--mq) }
}
.mq-castles { --mq: url(mq/castles.webp) } .mq-kings { --mq: url(mq/kings.webp) } .mq-poets { --mq: url(mq/poets.webp) }
.mq-saints { --mq: url(mq/saints.webp) } .mq-princes { --mq: url(mq/princes.webp) } .mq-dragons { --mq: url(mq/dragons.webp) }
.mq-coal { --mq: url(mq/coal.webp) } .mq-slate { --mq: url(mq/slate.webp) } .mq-song { --mq: url(mq/song.webp) }
.mq-language { --mq: url(mq/language.webp) } .mq-rebels { --mq: url(mq/rebels.webp) } .mq-legends { --mq: url(mq/legends.webp) }
.marquee a:focus-visible { outline: 2px solid var(--gold); outline-offset: 4px; border-radius: 4px }
/* site audit, November 2026: the band of moving words under the figures is quieter: smaller words, softer colour, so the ways in above lead */
.marquee { padding-block: .55rem .5rem }
.marquee .track { font-size: clamp(1.55rem, 3.6vw, 2.35rem); gap: 1.2rem; opacity: .82 }
.marquee .track2 { font-size: clamp(1rem, 1.8vw, 1.2rem) }
.marquee .track2 a { opacity: .62 }


/* ---------- today bento ---------- */
#today { padding-block: clamp(2.5rem, 6vw, 4.5rem) 0 }
.bento-today { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr) minmax(0, 1fr); gap: 1rem }
.bento-today > * { border-radius: var(--r); border: 1px solid var(--line); padding: clamp(1.2rem, 2.5vw, 1.7rem); display: grid; gap: 1rem; align-content: start; min-width: 0; background: var(--card) }
/* Daily challenge: today's own event with its year blanked, and six tiles for the guesses (app.js renderStreak fills them) */
.b-daily { text-decoration: none; background: radial-gradient(120% 90% at 100% 0%, #e0544a 0%, transparent 55%), linear-gradient(155deg, #c9352e, #7d1915 80%); border-color: transparent; color: #fff; position: relative; overflow: hidden; align-content: start; gap: .85rem; transition: transform .35s var(--ease), box-shadow .35s; box-shadow: 0 22px 46px -28px rgba(226,69,61,.9) }
.b-daily:hover { transform: translateY(-4px); box-shadow: 0 26px 54px -20px rgba(226,69,61,.7) }
.b-daily:active { transform: scale(.985) }
.b-daily > * { position: relative }
@media (min-width: 1001px) { .b-daily::after { content: "?"; position: absolute; right: .02em; bottom: -.28em; font: 400 15rem/1 var(--f-display); color: rgba(255,255,255,.09); pointer-events: none } }
.bd-top { display: flex; align-items: center; justify-content: space-between; gap: .6rem; min-height: 1.6rem }
.b-daily .eyebrow { color: rgba(255,255,255,.8); margin: 0 }
#daily-n { color: #fff; opacity: .9 }
.b-q { display: block; font-family: var(--f-display); font-size: clamp(2.3rem, 3.4vw, 2.8rem); line-height: 1 }
.bd-ev { display: block; font: 600 1.08rem/1.4 var(--f-body); background: rgba(0,0,0,.2); border: 1px solid rgba(255,255,255,.16); border-radius: 14px; padding: .8rem .95rem; backdrop-filter: blur(2px) }
.bd-ev small { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; margin-top: .35rem; font: 400 .9rem/1.45 var(--f-body); color: rgba(255,255,255,.82) }
.bd-ev b { display: inline-block; min-width: 3.4em; text-align: center; color: var(--gold); letter-spacing: .05em; border-bottom: 2px solid var(--gold); line-height: 1.1 }
.bd-tiles { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: .4rem }
.bd-tiles i { aspect-ratio: 1; border-radius: 10px; border: 1.5px solid rgba(255,255,255,.3); background: rgba(0,0,0,.12); display: grid; place-items: center; font: 600 .75rem var(--f-mono); font-style: normal; color: #fff }
.bd-tiles i.next { border-color: #fff; background: rgba(255,255,255,.14); font: 400 1.3rem/1 var(--f-display); animation: bd-pulse 2.2s ease-in-out infinite }
.bd-tiles i.ok { background: #7cc495; border-color: #7cc495; color: #0b1a10 } .bd-tiles i.c5 { background: #e8c65a; border-color: #e8c65a; color: #2a2108 }
.bd-tiles i.c25 { background: #f0975a; border-color: #f0975a; color: #2b1406 } .bd-tiles i.c100 { background: #f6857e; border-color: #f6857e; color: #2b0d0b } .bd-tiles i.far { background: #3b4252; border-color: #59617a }
@keyframes bd-pulse { 50% { background: rgba(255,255,255,.28) } }
@media (prefers-reduced-motion: reduce) { .bd-tiles i.next { animation: none } }
.b-sub { display: block; color: rgba(255,255,255,.88); font-size: .95rem }
.b-streak { background: rgba(0,0,0,.28); border-radius: 999px; padding: .2rem .7rem; font: 600 .75rem var(--f-mono); white-space: nowrap }
.b-streak[hidden] { display: none }
.b-fact .fact { font-family: var(--f-display); font-size: clamp(1.15rem, 1.6vw, 1.4rem); line-height: 1.3; word-spacing: .06em }
.b-fact { align-content: space-between }
.b-fact .chip { justify-self: start }
@media (max-width: 1000px) { .bento-today { grid-template-columns: 1fr 1fr } .b-day { grid-column: 1 / -1 } }
@media (max-width: 600px) { .bento-today { grid-template-columns: 1fr } }

/* ---------- the ages: poster accordion ---------- */
.posters { display: flex; gap: .7rem; height: clamp(26rem, 46vw, 36rem) }
.poster { position: relative; flex: 1 1 0; min-width: 0; border-radius: var(--r); overflow: hidden; text-decoration: none; color: #fff; isolation: isolate; transition: flex-grow .6s var(--ease); border: 1px solid var(--line) }
.poster .scene, .s-card .scene, .l-card .scene, .hero-art .scene { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -2; transition: transform 1.2s var(--ease) }
.poster .shade { position: absolute; inset: 0; z-index: -1; background: linear-gradient(transparent 30%, rgba(9,12,19,.92)) }
.poster .rn { position: absolute; top: 1rem; left: 1.1rem; font: 400 2.4rem/1 var(--f-display); color: var(--c) }
.poster .txt { position: absolute; inset: auto 0 0 0; padding: 1.2rem 1.1rem 1.3rem; display: flex; flex-direction: column; gap: .45rem }
.poster .span { font: 500 .75rem var(--f-mono); letter-spacing: .06em; color: var(--c); white-space: nowrap }
.poster h3 { font-size: clamp(1.25rem, 1.9vw, 1.7rem); line-height: 1.05 }
.poster p, .poster .go { font-size: .95rem; color: rgba(255,255,255,.82); max-height: 0; opacity: 0; overflow: hidden; transition: max-height .5s var(--ease), opacity .4s; min-width: 15rem }
.poster .go { font-weight: 700; color: #fff }
.poster .q { font: italic 400 1.02rem/1.35 var(--f-display); color: #fff; max-height: 0; opacity: 0; overflow: hidden; transition: max-height .5s var(--ease), opacity .4s; min-width: 15rem }
@media (hover: hover) and (min-width: 901px) {
  .posters:not(:hover):not(:focus-within) .poster:first-child, .poster:hover, .poster:focus-visible { flex-grow: 3.4 }
  .posters:not(:hover):not(:focus-within) .poster:first-child :is(p, .go, .q), .poster:hover :is(p, .go, .q), .poster:focus-visible :is(p, .go, .q) { max-height: 8rem; opacity: 1; transition-delay: .15s }
  .poster:hover .scene { transform: scale(1.06) }
  /* twelve posters are narrow when closed, so a closed poster carries its title up the side */
  .poster h3 { writing-mode: vertical-rl; text-orientation: sideways; rotate: 180deg; white-space: nowrap; align-self: flex-start; font-size: clamp(1.2rem, 1.7vw, 1.5rem) }
  /* a closed poster keeps its dates too, running up the side beside its name */
  .poster .span { position: absolute; right: .55rem; bottom: 1.3rem; writing-mode: vertical-rl; text-orientation: sideways; rotate: 180deg; font-size: .75rem }
  .posters:not(:hover):not(:focus-within) .poster:first-child h3, .poster:hover h3, .poster:focus-visible h3 { writing-mode: horizontal-tb; rotate: none; white-space: normal; font-size: clamp(1.25rem, 1.9vw, 1.7rem) }
  .posters:not(:hover):not(:focus-within) .poster:first-child .span, .poster:hover .span, .poster:focus-visible .span { position: static; writing-mode: horizontal-tb; rotate: none; font-size: .75rem }
  .posters:not(:hover):not(:focus-within) .poster:first-child, .poster:hover, .poster:focus-visible { flex-grow: 4.2 }
  /* twelve ages: a closed poster's number is smaller so VIII and XII fit across it */
  .posters { gap: .5rem }
  .poster .rn { left: .6rem; font-size: clamp(1.25rem, 1.75vw, 1.9rem) }
  .posters:not(:hover):not(:focus-within) .poster:first-child .rn, .poster:hover .rn, .poster:focus-visible .rn { left: 1.1rem; font-size: 2.4rem }
  /* and its name and dates sit closer to its edges, so they never overlap on a narrow laptop screen */
  .poster .txt { padding-left: .55rem } .poster h3 { font-size: clamp(1rem, 1.45vw, 1.5rem) } .poster .span { right: .3rem }
  .posters:not(:hover):not(:focus-within) .poster:first-child .txt, .poster:hover .txt, .poster:focus-visible .txt { padding-left: 1.1rem }
  .posters:not(:hover):not(:focus-within) .poster:first-child, .poster:hover, .poster:focus-visible { flex-grow: 5 }
  .poster :is(p, .go, .q) { min-width: 14rem }
}
@media (hover: none), (max-width: 900px) {
  .posters { height: auto; overflow-x: auto; scroll-snap-type: x mandatory; margin-inline: calc(var(--gut-l) * -1) calc(var(--gut-r) * -1); padding-inline: var(--gut-l) var(--gut-r); scrollbar-width: none; gap: .8rem }
  .posters::-webkit-scrollbar { display: none }
  .poster { flex: 0 0 min(76vw, 20rem); height: 27rem; scroll-snap-align: center }
  .poster p, .poster .go, .poster .q { max-height: none; opacity: 1; min-width: 0 }
  .poster h3 { font-size: 1.7rem }
}
/* phones: all twelve ages in one list to choose from, each with its dates and its question */
@media (max-width: 640px) {
  .posters { display: grid; overflow: visible; margin-inline: 0; padding-inline: 0; gap: .55rem; scroll-snap-type: none }
  .poster { height: auto; min-height: 7.4rem }
  .poster .scene { opacity: .55 }
  .poster .shade { background: linear-gradient(90deg, rgba(9,12,19,.94) 25%, rgba(9,12,19,.7)) }
  .poster .rn { top: .95rem; left: .7rem; font-size: 1.45rem; width: 2.8rem; text-align: center }
  .poster .txt { position: relative; inset: auto; padding: .9rem 1rem .95rem 4rem; gap: .25rem }
  .poster h3 { font-size: 1.35rem }
  .poster .q { font-size: .98rem }
  .poster p { display: none }
  .poster .go { font-size: .85rem }
}
.tl-band { margin-top: 1.2rem; border: 1px solid var(--line); border-radius: var(--r); padding: clamp(1.2rem, 3vw, 2rem); display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 1.5rem 3rem; align-items: center; background: linear-gradient(120deg, var(--card), transparent) }
.tl-big { font-family: var(--f-display); font-size: clamp(1.9rem, 4vw, 3.2rem); line-height: 1.05; margin-block: .4rem; word-spacing: .08em }
.tl-big i { font-style: normal; color: var(--red) }
.tl-band-r { display: grid; gap: 1.1rem; justify-items: start }
@media (max-width: 860px) { .tl-band { grid-template-columns: 1fr } }

/* ---------- long reads ---------- */
.s-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem }
.s-card { position: relative; display: grid; grid-template-rows: auto 1fr; border-radius: var(--r); overflow: hidden; text-decoration: none; background: var(--card); border: 1px solid var(--line); isolation: isolate; transition: transform .4s var(--ease), border-color .3s }
.s-card:hover { transform: translateY(-5px); border-color: color-mix(in srgb, var(--c) 60%, var(--line)) }
.s-card:hover .scene, .l-card:hover .scene { transform: scale(1.06) }
.s-card .art { position: relative; aspect-ratio: 16 / 9; overflow: hidden; display: block; isolation: isolate }
.s-card .txt { padding: 1.2rem 1.3rem 1.4rem; display: grid; gap: .55rem; align-content: start }
.s-card .span, .l-card .span, .p-card .tag { font: 500 .75rem var(--f-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--c) }
.s-card h3 { font-size: 1.55rem; line-height: 1.1 }
.s-card p { color: var(--muted); font-size: .95rem; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden }
.s-card .go { font-weight: 700; font-size: .9rem; margin-top: .2rem }
.s-card.lead { grid-column: span 2; grid-row: span 2; grid-template-rows: 1fr; min-height: 30rem }
.s-card.lead .art { position: absolute; inset: 0; aspect-ratio: auto; z-index: -1 }
.s-card.lead .art::after { content: ""; position: absolute; inset: 0; background: linear-gradient(transparent 25%, rgba(9,12,19,.94) 85%) }
.s-card.lead .txt { align-self: end; padding: clamp(1.4rem, 3vw, 2.4rem); max-width: 40rem }
.s-card.lead h3 { font-size: clamp(2rem, 3.8vw, 3.3rem); line-height: 1 }
.s-card.lead p { color: #d5d7dd; font-size: 1.05rem; -webkit-line-clamp: 4 }
.s-grid.three .s-card.lead { grid-column: auto; grid-row: auto }
@media (max-width: 900px) { .s-grid { grid-template-columns: 1fr 1fr } .s-card.lead { grid-column: 1 / -1; min-height: 24rem } }
@media (max-width: 560px) { .s-grid { grid-template-columns: 1fr } }

/* ---------- legends ---------- */
#legends { background: radial-gradient(80% 60% at 80% 0%, rgba(124,196,149,.08), transparent 70%), linear-gradient(var(--night), #0d1512 30%, #0d1512 70%, var(--night)) }
.l-jump { margin-top: 1.4rem } .l-jump .chip { background: rgba(11,14,22,.55); backdrop-filter: blur(4px) }
[id$="-set"] { scroll-margin-top: 4.5rem }
.l-links { display: flex; flex-wrap: wrap; gap: .6rem; margin: 1.4rem 0 0 }
.mab-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem }
.mab-tale { background: var(--slate); border: 1px solid var(--line); border-top: 3px solid var(--c, var(--gold)); border-radius: var(--r); padding: 1.3rem 1.4rem 1.4rem; display: flex; flex-direction: column; gap: .55rem }
.mab-tale h3 { font-family: var(--f-display); font-weight: 400; font-size: 1.6rem; line-height: 1.15; margin: 0 }
.mab-tale .mab-en { font: 500 .75rem var(--f-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--c, var(--gold)); margin: 0 }
.mab-tale p { margin: 0; color: var(--muted) } .mab-tale .btn { align-self: flex-start; margin-top: auto }
@media (max-width: 760px) { .mab-grid { grid-template-columns: 1fr } }
.l-sum { color: var(--muted); max-width: 46rem; margin: -.8rem 0 1.6rem; font-size: 1.05rem }
.l-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem }
.l-card { position: relative; aspect-ratio: 3 / 4.2; border-radius: var(--r); overflow: hidden; text-decoration: none; color: #fff; isolation: isolate; display: grid; align-items: end; border: 1px solid var(--line); transition: transform .4s var(--ease) }
.l-card:hover { transform: translateY(-5px) }
.l-card .art { position: absolute; inset: 0; z-index: -1 }
.l-card .art::after { content: ""; position: absolute; inset: 0; background: linear-gradient(transparent 35%, rgba(9,12,19,.95) 88%) }
.l-card .scene { z-index: 0 }
.l-card .txt { padding: 1.2rem; display: grid; gap: .4rem }
.l-card h3 { font-size: clamp(1.35rem, 2vw, 1.75rem); line-height: 1.08 }
.l-card p { font-size: .92rem; color: rgba(255,255,255,.8) }
@media (max-width: 1000px) { .l-grid { grid-template-columns: 1fr 1fr } }
@media (max-width: 520px) { .l-grid { grid-template-columns: 1fr } .l-card { aspect-ratio: 4 / 3.6 } }

/* ---------- people: avatars ---------- */
.plaque { border-radius: 16px; transition: transform .35s var(--ease), border-color .3s }
.plaque:hover { transform: translateY(-4px); border-color: color-mix(in srgb, var(--c) 55%, #333c50) }
.plaque .top-row { display: flex; gap: .9rem; align-items: center }
.ava { flex: none; width: 3.4rem; height: 3.4rem; border-radius: 50%; display: grid; place-items: center; font: 400 1.25rem var(--f-display); color: var(--c); background: radial-gradient(circle at 30% 25%, color-mix(in srgb, var(--c) 30%, #1b2130), #141925 75%); border: 1px solid color-mix(in srgb, var(--c) 45%, transparent); overflow: hidden; position: relative; letter-spacing: .02em }
.ava img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center 22% }
.plaque::after { display: none }

/* ---------- play ---------- */
#play { background: var(--slate) }
/* Game cards: a real picture for each game (src/pictures.py), a badge, the kind of game, its name and one line. The card is one link, with no "Play" line. */
.play-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); grid-auto-rows: minmax(16rem, auto); gap: 1rem }
.p-card { position: relative; overflow: hidden; isolation: isolate; border-radius: var(--r); padding: 1.1rem 1.2rem 1.2rem; text-decoration: none; color: #fff; display: flex; flex-direction: column; justify-content: flex-end; gap: .5rem; min-height: 16rem;
  background: var(--card); border: 1px solid color-mix(in srgb, var(--c) 35%, var(--line)); transition: transform .4s var(--ease), box-shadow .4s, border-color .4s }
.p-card:hover { transform: translateY(-5px); border-color: color-mix(in srgb, var(--c) 70%, var(--line)); box-shadow: 0 26px 50px -24px color-mix(in srgb, var(--c) 70%, transparent) }
.p-card:active { transform: scale(.985) }
.p-pic { position: absolute; inset: 0; z-index: -2 }
.p-pic img { width: 100%; height: 100%; max-width: none; object-fit: cover; transition: transform 1.2s var(--ease) }
.p-card:hover .p-pic img { transform: scale(1.06) }
.p-pic::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(9,12,19,.15) 0%, rgba(9,12,19,.35) 38%, rgba(9,12,19,.94) 78%), linear-gradient(0deg, color-mix(in srgb, var(--c) 30%, transparent), transparent 60%) }
.p-ico { position: absolute; top: 1rem; right: 1rem; min-width: 3rem; height: 3rem; padding: 0 .55rem; border-radius: 999px; display: grid; place-items: center; font: 400 1.35rem/1 var(--f-display); color: #fff;
  background: color-mix(in srgb, var(--c) 45%, rgba(9,12,19,.62)); border: 1px solid rgba(255,255,255,.3); backdrop-filter: blur(6px); box-shadow: 0 8px 20px -8px rgba(0,0,0,.6) }
.p-names .p-ico { font-style: italic }
.p-card .tag { position: absolute; top: 1.15rem; left: 1.1rem; font: 600 .75rem var(--f-mono); letter-spacing: .1em; text-transform: uppercase; color: #fff; background: rgba(9,12,19,.55); border: 1px solid rgba(255,255,255,.22); border-radius: 999px; padding: .3rem .7rem; backdrop-filter: blur(6px) }
.p-txt { display: grid; gap: .35rem }
.p-card h3 { font-size: 1.6rem; line-height: 1.06; text-shadow: 0 2px 18px rgba(0,0,0,.55) }
.p-card p { color: #d9dce3; font-size: .93rem; line-height: 1.45; margin: 0 }
/* the newest game leads, bigger */
.play-grid > .p-card:first-child { grid-column: span 2; grid-row: span 2 }
.play-grid > .p-card:first-child h3 { font-size: clamp(2rem, 3.6vw, 3rem) }
.play-grid > .p-card:first-child p { font-size: 1.02rem; max-width: 30rem }
/* the last tile on the home page: all the games, with a fan of their pictures */
.p-all { background: linear-gradient(150deg, color-mix(in srgb, var(--gold) 14%, var(--card)), var(--card) 70%); border-color: rgba(232,198,90,.35); color: var(--ink); justify-content: space-between }
.p-all:hover { border-color: var(--gold); box-shadow: 0 26px 50px -24px rgba(232,198,90,.45) }
.p-faces { display: flex; padding-left: .6rem }
.p-faces span { width: 3.4rem; height: 3.4rem; border-radius: 50%; overflow: hidden; margin-left: -.6rem; border: 2px solid var(--card); box-shadow: 0 6px 14px -6px rgba(0,0,0,.6); flex: none }
.p-faces span:nth-child(2) { transform: translateY(-4px) } .p-faces span:nth-child(4) { transform: translateY(-4px) }
.p-faces img { width: 100%; height: 100%; max-width: none; object-fit: cover }
.p-all p { color: var(--muted) }
.p-all .ar { position: absolute; right: 1.2rem; bottom: 1.1rem; width: 2.6rem; height: 2.6rem; border-radius: 50%; background: var(--gold); color: var(--night); display: grid; place-items: center; font-size: 1.2rem; transition: transform .3s var(--ease) }
.p-all:hover .ar { transform: translateX(4px) }
.p-all .p-txt { padding-right: 3.2rem }
@media (max-width: 1000px) { .play-grid { grid-template-columns: 1fr 1fr } .play-grid > .p-card:first-child { grid-row: auto; min-height: 20rem } }
@media (max-width: 560px) {
  .play-grid { grid-template-columns: 1fr; grid-auto-rows: auto; gap: .8rem }
  .play-grid > .p-card:first-child { grid-column: auto; min-height: 21rem }
  .p-card { min-height: 14.5rem }
  .p-all { min-height: 0; flex-direction: row; align-items: center; gap: 1rem; padding: 1rem 1.1rem }
  .p-all .p-faces { flex: none } .p-all .p-faces span:nth-child(n+4) { display: none }
  .p-all .p-txt { padding-right: 2.6rem } .p-all h3 { font-size: 1.3rem } .p-all p { font-size: .85rem }
  .p-all .ar { top: 50%; bottom: auto; right: 1rem; margin-top: -1.3rem }
}

/* ---------- illustrated page headers ---------- */
.era-hero { position: relative; overflow: hidden; isolation: isolate }
.era-hero.has-art { background: var(--night); min-height: min(68vh, 40rem); display: grid; align-items: end }
.hero-art { position: absolute; inset: 0; z-index: -1 }
.hero-art::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(11,14,22,.9), rgba(11,14,22,.45) 55%, rgba(11,14,22,.1)), linear-gradient(transparent 55%, var(--night)) }
.hero-art:has(.photo)::after { background: linear-gradient(90deg, rgba(11,14,22,.78), rgba(11,14,22,.3) 60%, rgba(11,14,22,.12)), linear-gradient(transparent 50%, var(--night)) } /* photographs: enough veil for the words, light enough to see the picture */
.hero-art img.scene.photo, .l-card img.scene.photo, .s-card img.scene.photo, .poster img.scene.photo, .cc-img img.scene.photo { width: 100%; height: 100%; max-width: none; object-fit: cover }
.hero-credit { font-size: .75rem; line-height: 1.45; color: rgba(225,228,236,.66); margin: 1.1rem 0 0; max-width: 46rem }
.hero-credit a { color: inherit; text-decoration: underline; text-underline-offset: 2px }
.ph-credit { font-size: .8rem; color: var(--muted); margin-top: 1.2rem } .ph-credit a { color: inherit }
.hero-art:has(image)::after { background: linear-gradient(90deg, rgba(11,14,22,.5), rgba(11,14,22,.15) 55%, rgba(11,14,22,.05)), linear-gradient(transparent 55%, var(--night)) } /* lighter veil where the art holds a picture (the dragons), so the picture is not dulled */
.era-hero.has-art .wrap { width: 100%; padding-block: clamp(5rem, 12vw, 9rem) clamp(2.5rem, 6vw, 4rem) }
.era-hero.has-art h1 { font-size: clamp(2.8rem, 8vw, 6rem); max-width: 16ch; text-shadow: 0 2px 30px rgba(0,0,0,.5) }
.era-hero.has-art .lede { color: #d5d7dd; font-size: clamp(1.05rem, 1.6vw, 1.25rem); max-width: 42rem }
.era-hero h1 { animation: h-in .9s var(--ease) both }
.era-hero .lede, .era-hero .span { animation: h-in .9s .12s var(--ease) both }
@keyframes h-in { from { opacity: 0; transform: translateY(22px) } }

/* ---------- articles ---------- */
.article { padding-block: clamp(2rem, 5vw, 3.5rem) }
.byline { display: flex; flex-wrap: wrap; gap: .4rem 1.4rem; align-items: center; font: 500 .78rem var(--f-mono); color: var(--muted); margin-bottom: 2rem; letter-spacing: .03em }
.byline a { color: var(--c) }
.prose { display: grid; gap: 1.25rem; font-size: 1.15rem; line-height: 1.75; color: #dcdee4 }
.prose h2 { font-size: clamp(1.7rem, 3.4vw, 2.3rem); margin-top: 1.6rem; padding-top: 1.1rem; position: relative; color: var(--ink) }
.prose h2::before { content: ""; position: absolute; top: 0; left: 0; width: 2.6rem; height: 3px; background: var(--c) }
.prose > p:first-child::first-letter { font-family: var(--f-display); float: left; font-size: 4.2em; line-height: .82; padding: .06em .12em 0 0; color: var(--c) }
.prose.tale { font-size: 1.24rem; line-height: 1.8 }
.prose .pq { margin: .6rem 0; padding: .4rem 0 .4rem 1.4rem; border-left: 3px solid var(--c) }
.prose .pq p { font-family: var(--f-display); font-size: clamp(1.5rem, 3vw, 2.1rem); line-height: 1.25; color: var(--ink) }
.prose .pq cite { display: block; margin-top: .6rem; font-style: normal; font-size: .9rem; letter-spacing: .04em; color: #9aa0ad }
.prose table.kv { width: 100%; border-collapse: collapse; font-size: 1rem; line-height: 1.5; border-top: 1px solid rgba(255,255,255,.14) }
.prose table.kv th, .prose table.kv td { text-align: left; vertical-align: top; padding: .6rem .8rem .6rem 0; border-bottom: 1px solid rgba(255,255,255,.14) }
.prose table.kv th { width: 42%; font-weight: 600; color: #9aa0ad }
.prose table.kv td { color: var(--ink) }
.behind { margin-top: 2.5rem; background: var(--card); border: 1px solid var(--line); border-left: 4px solid var(--c); border-radius: 0 16px 16px 0; padding: 1.4rem 1.6rem; display: grid; gap: .7rem }
.behind .eyebrow { color: var(--c) }
.behind p:last-child { color: #d0d3da; line-height: 1.7 }
.behind + .byline { margin: 1.5rem 0 0 }
.story { font-size: 1.15rem; line-height: 1.75; color: #dcdee4 }

/* ---------- symbols ---------- */
.sym-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 21rem), 1fr)); gap: 1rem }
.sym { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 1.5rem; display: grid; gap: .5rem; align-content: start; position: relative; overflow: hidden; scroll-margin-top: 6rem }
.sym:target { border-color: var(--c) }
.sym-n { font: 400 3.2rem/1 var(--f-display); color: color-mix(in srgb, var(--c) 85%, transparent) }
.sym h2 { font-size: 1.8rem }
.sym-alt { font-family: var(--f-display); font-style: italic; color: var(--c) }
.sym p:last-child { color: #c9ccd4 }

/* ---------- gallery ---------- */
.g-bar { position: sticky; top: var(--nav-h, 3.6rem); z-index: 20; background: color-mix(in srgb, var(--night) 88%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line) }
.g-chips { display: flex; gap: .45rem; overflow-x: auto; padding: .7rem 0; scrollbar-width: none; -webkit-mask-image: linear-gradient(90deg, #000 92%, transparent) ; mask-image: linear-gradient(90deg, #000 92%, transparent) }
.g-chips::-webkit-scrollbar { display: none }
.g-chip { flex: none; font: 500 .85rem var(--f-body); color: var(--ink); background: var(--card); border: 1px solid var(--line); border-radius: 999px; padding: .42rem .85rem; cursor: pointer; white-space: nowrap; transition: background .2s, border-color .2s, color .2s }
.g-chip i { font: 500 .75rem var(--f-mono); font-style: normal; color: var(--muted); margin-left: .2rem }
.g-chip:hover { border-color: var(--gold) }
.g-chip.on { background: var(--gold); border-color: var(--gold); color: #14100a } .g-chip.on i { color: #14100a }
.g-secs { padding: 1rem 0 2rem }
.g-sec { padding-top: 2.2rem; scroll-margin-top: 8rem }
.g-sec[hidden] { display: none }
.g-head { display: flex; align-items: baseline; gap: .8rem; border-bottom: 1px solid var(--line); padding-bottom: .4rem }
.g-head h2 { margin: 0; font: 400 clamp(1.7rem, 3.4vw, 2.4rem) var(--f-display) }
.g-cnt { font: 500 .78rem var(--f-mono); color: var(--gold) }
.g-blurb { margin: .5rem 0 1.1rem }
.gallery { columns: 3 17rem; column-gap: 1rem }
.g-item { position: relative; display: block; break-inside: avoid; margin-bottom: 1rem; border-radius: 16px; overflow: hidden; border: 1px solid var(--line); background: var(--card); text-decoration: none; color: #fff }
.g-item img { display: block; width: 100%; height: auto; aspect-ratio: var(--ar, 4 / 3); object-fit: cover; transition: transform .8s var(--ease) }
.g-item:hover img, .g-item:focus-visible img { transform: scale(1.04) }
.g-item .cap { position: absolute; inset: auto 0 0 0; padding: 2.4rem 1rem .85rem; background: linear-gradient(transparent, rgba(9,12,19,.92)); display: grid; gap: .1rem }
.g-item .cap b { font: 400 1.22rem/1.15 var(--f-display) } .g-item .cap span span, .g-item .cap > span { font: 500 .75rem var(--f-mono); color: var(--gold) }
.g-credits summary { cursor: pointer; font-weight: 600 }
.g-credits ol { columns: 2 22rem; column-gap: 2rem; font-size: .82rem; color: var(--muted); padding-left: 1.4rem } .g-credits li { break-inside: avoid; margin-bottom: .3rem }
.g-credits a { color: var(--muted) }
.g-box { width: min(1200px, 100vw); max-width: 100vw; height: 100dvh; max-height: 100dvh; margin: 0 auto; padding: 0; border: 0; background: #07090e; color: #ece9e1; display: none; grid-template-rows: 1fr auto }
.g-box[open] { display: grid }
.g-box::backdrop { background: rgba(4,6,10,.94) }
.g-stage { position: relative; min-height: 0; overflow: hidden; touch-action: pan-y }
.g-stage img { position: absolute; inset: 0; margin: auto; max-width: 100%; max-height: 100%; object-fit: contain; display: block; transition: opacity .25s }
.g-stage img.ld { opacity: .25 }
.g-x, .g-prev, .g-next { position: absolute; border: 0; background: rgba(10,12,18,.6); color: #fff; width: 2.8rem; height: 2.8rem; border-radius: 50%; font-size: 1.7rem; line-height: 1; cursor: pointer; display: grid; place-items: center }
.g-x { top: max(.8rem, env(safe-area-inset-top)); right: .8rem } .g-prev { left: .8rem; top: 50%; translate: 0 -50% } .g-next { right: .8rem; top: 50%; translate: 0 -50% }
.g-x:hover, .g-prev:hover, .g-next:hover { background: var(--red) }
.g-info { padding: 1rem clamp(1rem, 4vw, 2rem) max(1.2rem, env(safe-area-inset-bottom)); display: grid; gap: .35rem; max-width: 70rem }
.g-info h3 { margin: 0; font: 400 1.6rem/1.1 var(--f-display) } .g-info p { margin: 0 } .g-what { color: #cfd3dc }
.g-count { font: 500 .75rem var(--f-mono); color: var(--gold) } .g-cred { font-size: .8rem; color: #9aa1ae } .g-cred a { color: inherit }
.g-go { justify-self: start; margin-top: .4rem } .g-go[hidden] { display: none }
@media (max-width: 640px) { .gallery { columns: 2 9rem; column-gap: .6rem } .g-item { margin-bottom: .6rem; border-radius: 12px } .g-item .cap { padding: 1.8rem .6rem .55rem } .g-item .cap b { font-size: 1rem } .g-item .cap > span { font-size: .62rem } .g-prev, .g-next { display: none } .g-info h3 { font-size: 1.3rem } }
.photo img { border-radius: var(--r); height: auto }

/* ---------- footer ---------- */
footer.site-foot { border-top: 1px solid var(--line); background: linear-gradient(var(--night), #090c13); padding-block: clamp(3rem, 7vw, 5rem) calc(2rem + env(safe-area-inset-bottom, 0px)) }
footer.site-foot .wrap { display: grid; grid-template-columns: minmax(0, 1fr); justify-content: stretch; gap: clamp(2rem, 5vw, 3.5rem); color: var(--muted) }
.foot-top { display: grid; gap: .8rem }
footer .big { font-size: clamp(4rem, 15vw, 11rem); line-height: .85; letter-spacing: -.02em }
footer .big span { color: var(--red) }
.foot-tag { max-width: 34rem; font-size: 1.05rem }
.foot-cols { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 2rem 1.5rem }
.foot-cols ul { list-style: none; margin: .8rem 0 0; padding: 0; display: grid; gap: .45rem }
.foot-cols a { text-decoration: none; color: #c3c7cf; font-size: .95rem }
.foot-cols a:hover { color: var(--dragon) }
.foot-base { display: flex; flex-wrap: wrap; gap: .6rem 2rem; justify-content: space-between; border-top: 1px solid var(--line); padding-top: 1.4rem; font-size: .82rem }
.foot-base span:last-child { max-width: 46rem }
.foot-copy { margin: 1rem 0 0; font-size: .78rem; opacity: .75; max-width: 60rem }
@media (max-width: 760px) { .foot-cols { grid-template-columns: 1fr 1fr } }
.to-top { position: fixed; right: max(16px, env(safe-area-inset-right, 0px)); bottom: calc(16px + env(safe-area-inset-bottom, 0px)); z-index: 25; width: 2.9rem; height: 2.9rem; border-radius: 50%; border: 1px solid var(--line); background: rgba(21,26,37,.9); backdrop-filter: blur(8px); color: var(--ink); cursor: pointer; display: grid; place-items: center; animation: fade .3s both }
.to-top:hover { border-color: var(--ink) } .to-top svg { width: 1.1rem; height: 1.1rem }

/* ---------- games ---------- */
.game-sec { padding-block: clamp(2rem, 5vw, 3.5rem) }
.g-root > * { min-width: 0 }
.g-root { grid-template-columns: minmax(0, 1fr); background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: clamp(1.2rem, 3.5vw, 2.2rem); display: grid; gap: 1.2rem; min-height: 18rem }
.g-root h2 { font-size: clamp(1.7rem, 3.6vw, 2.5rem); line-height: 1.1 }
.g-root .q-top { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; font: 500 .78rem var(--f-mono); color: var(--muted) }
.g-ctx { color: #c9ccd4; font-size: 1.08rem; line-height: 1.6 }
.g-form { display: flex; gap: .6rem; flex-wrap: wrap }
.g-in { flex: 1 1 9rem; min-width: 0; background: var(--night); border: 1px solid var(--line); border-radius: 14px; color: var(--ink); padding: .8rem 1.1rem; font: 500 1.4rem var(--f-mono); letter-spacing: .1em }
.g-in.txt { font: 500 1.1rem var(--f-body); letter-spacing: 0 }
.g-in:focus { outline: 2px solid var(--dragon); outline-offset: 1px }
.g-rows { list-style: none; margin: 0; padding: 0; display: grid; gap: .45rem }
.g-rows li { display: grid; grid-template-columns: 5.5rem 1fr auto; gap: .8rem; align-items: center; background: var(--night); border: 1px solid var(--line); border-left: 4px solid var(--k, var(--line)); border-radius: 12px; padding: .6rem .9rem; animation: pop .35s var(--ease) both }
.g-rows li b { font: 600 1.25rem var(--f-mono) } .g-rows li span { color: var(--muted); font-size: .95rem } .g-rows li i { font-style: normal; font-size: 1.3rem }
.g-rows li.empty { border-style: dashed; border-left-width: 1px; min-height: 2.9rem; animation: none; opacity: .5 }
.g-big { font: 400 clamp(3.5rem, 12vw, 6.5rem)/.9 var(--f-display); color: var(--dragon) }
.g-row { display: flex; flex-wrap: wrap; gap: .7rem; align-items: center }
.g-note { color: var(--muted); font-size: .92rem }
.g-result { display: grid; gap: .9rem; border-top: 1px solid var(--line); padding-top: 1.2rem; animation: up .5s var(--ease) both }
.g-share { font: 500 1rem/1.5 var(--f-mono); background: var(--night); border: 1px solid var(--line); border-radius: 12px; padding: .8rem 1rem; white-space: pre-wrap }
.g-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .6rem }
.g-stats div { background: var(--night); border: 1px solid var(--line); border-radius: 14px; padding: .8rem; text-align: center }
.g-stats b { display: block; font: 400 2rem/1 var(--f-display) } .g-stats span { font: 500 .75rem var(--f-mono); color: var(--muted); letter-spacing: .08em; text-transform: uppercase }
.g-map { width: 100%; max-width: 30rem; height: auto; display: block; margin-inline: auto; cursor: crosshair; touch-action: manipulation; overflow: visible }
.g-map .land { fill: #232b3c; stroke: #55617a }
.g-map .guess { fill: var(--ink); stroke: var(--night); stroke-width: 2 } .g-map .real { fill: var(--e-modern); stroke: var(--night); stroke-width: 2 }
.g-map .link { stroke: var(--ink); stroke-width: 1.5; stroke-dasharray: 4 4 } .g-map text { fill: var(--ink); font: 600 13px var(--f-body); paint-order: stroke; stroke: var(--night); stroke-width: 4px }
.g-opts { display: grid; gap: .6rem }
.g-opts button, .g-opt { text-align: left; background: var(--night); border: 1px solid var(--line); border-radius: 14px; padding: .95rem 1.1rem; cursor: pointer; font-size: 1.05rem; font-weight: 600; transition: border-color .2s, transform .2s }
.g-opts button:hover { border-color: var(--ink); transform: translateX(4px) }
.g-hero-card { display: grid; gap: .8rem; padding: 1.5rem; border-radius: 18px; background: radial-gradient(120% 120% at 100% 0%, color-mix(in srgb, var(--gold) 22%, transparent), transparent 60%), var(--night); border: 1px solid color-mix(in srgb, var(--gold) 40%, var(--line)) }
.g-hero-card h2 { font-size: clamp(2.2rem, 6vw, 3.6rem) } .g-hero-card .who { font: 400 1.3rem var(--f-display); font-style: italic; color: var(--gold) }
.pairs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .6rem; perspective: 900px }
.pair { aspect-ratio: 1; border: 0; background: none; padding: 0; cursor: pointer; position: relative; transform-style: preserve-3d; transition: transform .5s var(--ease); border-radius: 14px }
.pair.up { transform: rotateY(180deg) }
.pair span { position: absolute; inset: 0; border-radius: 14px; display: grid; place-items: center; backface-visibility: hidden; -webkit-backface-visibility: hidden; padding: .3rem; text-align: center }
.pair .bk { background: linear-gradient(150deg, #d43c34, #8e1f1a); border: 1px solid transparent; font: 400 2rem var(--f-display); color: rgba(255,255,255,.6) }
.pair .ft { transform: rotateY(180deg); background: var(--night); border: 1px solid var(--line); font: 600 clamp(.8rem, 2.6vw, 1.15rem) var(--f-body); line-height: 1.15; overflow-wrap: anywhere }
.pair .ft.cy { font: 400 clamp(1rem, 3.2vw, 1.5rem) var(--f-display); color: var(--gold) }
.pair.done .ft { border-color: var(--e-modern); background: color-mix(in srgb, var(--e-modern) 14%, var(--night)) }
.sn-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 9rem), 1fr)); gap: .4rem }
.sn-list button { background: none; border: 1px dashed var(--line); border-radius: 8px; padding: .3rem .6rem; font-size: .88rem; color: var(--muted); cursor: pointer; text-align: left }
.sn-list button:hover { color: var(--ink); border-color: var(--muted) }
.sn-out { background: var(--night); border: 1px solid var(--line); border-left: 4px solid var(--gold); border-radius: 0 14px 14px 0; padding: 1.1rem 1.3rem; display: grid; gap: .35rem; min-height: 5.5rem }
.sn-out b { font: 400 clamp(1.7rem, 5vw, 2.6rem)/1.1 var(--f-display); color: var(--gold); word-spacing: .08em } .sn-out span { color: #c9ccd4 }
.g-sub { font-size: 1.5rem; margin-top: 1rem; padding-top: 1.4rem; border-top: 1px solid var(--line) }
.seg2 { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; padding: 3px; gap: 2px }
.seg2 button { border: 0; background: transparent; border-radius: 999px; padding: .4rem 1rem; font: 600 .9rem var(--f-body); cursor: pointer; color: var(--muted) }
.seg2 button[aria-pressed="true"] { background: var(--ink); color: var(--night) }

/* ---------- journey ---------- */
.j-top { display: grid; grid-template-columns: minmax(0, 1.2fr) repeat(3, minmax(0, 1fr)); gap: 1rem }
.j-top > div { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 1.4rem; display: grid; gap: .3rem; align-content: center }
.j-top b { font: 400 clamp(2.2rem, 5vw, 3.4rem)/1 var(--f-display) } .j-top .rank b { color: var(--gold) }
.j-top span { font: 500 .75rem var(--f-mono); color: var(--muted); letter-spacing: .08em; text-transform: uppercase }
.j-top small { color: var(--muted); font-size: .88rem }
@media (max-width: 860px) { .j-top { grid-template-columns: 1fr 1fr } .j-top .rank { grid-column: 1 / -1 } }
.j-h { font-size: clamp(1.8rem, 4vw, 2.6rem); margin: 3rem 0 1.2rem }
.badges { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 13.5rem), 1fr)); gap: .8rem }
.badge { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 1.1rem; display: grid; grid-template-columns: 3rem minmax(0, 1fr); gap: .2rem .9rem; align-items: center; opacity: .88 }
.badge i { grid-row: span 2; width: 3rem; height: 3rem; border-radius: 50%; display: grid; place-items: center; font: 400 1.4rem var(--f-display); font-style: normal; border: 1px dashed var(--muted); color: var(--muted) }
.badge b { font-weight: 700 } .badge span { font-size: .85rem; color: var(--muted) }
.badge.got { opacity: 1; border-color: color-mix(in srgb, var(--gold) 50%, var(--line)) }
.badge.got i { background: radial-gradient(circle at 30% 25%, #f6dc85, #c79a2c); color: #2a1f05; border: 0; box-shadow: 0 6px 20px -6px rgba(232,198,90,.6) }
.j-group { border: 1px solid var(--line); border-radius: 16px; background: var(--card); margin-bottom: .7rem; overflow: hidden }
.j-group summary { cursor: pointer; padding: 1rem 1.2rem; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .5rem 1rem; align-items: center; list-style: none }
.j-group summary::-webkit-details-marker { display: none }
.j-group summary b { font: 400 1.4rem var(--f-display) } .j-group summary span { font: 500 .8rem var(--f-mono); color: var(--muted) }
.j-bar { grid-column: 1 / -1; height: 6px; border-radius: 3px; background: var(--line); overflow: hidden }
.j-bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--red), var(--gold)); border-radius: 3px; transition: width .8s var(--ease) }
.j-list { list-style: none; margin: 0; padding: 0 1.2rem 1.2rem; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 15rem), 1fr)); gap: .2rem 1.2rem }
.j-list a { display: flex; gap: .6rem; align-items: center; text-decoration: none; padding: .35rem 0; color: var(--muted) }
.j-list a::before { content: ""; width: 1rem; height: 1rem; border-radius: 50%; border: 1px solid var(--line); flex: none }
.j-list a.seen { color: var(--ink) } .j-list a.seen::before { background: var(--e-modern); border-color: var(--e-modern); box-shadow: inset 0 0 0 3px var(--card) }
.j-list a:hover { color: var(--dragon) }
.toast { position: fixed; left: 50%; bottom: calc(1.4rem + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); z-index: 60; background: var(--ink); color: var(--night); border-radius: 999px; padding: .7rem 1.2rem .7rem .8rem; display: flex; gap: .7rem; align-items: center; font-weight: 700; font-size: .92rem; box-shadow: 0 20px 50px rgba(0,0,0,.5); animation: toast 4.2s var(--ease) both; text-decoration: none; max-width: calc(100vw - 2rem) }
.toast i { width: 1.9rem; height: 1.9rem; border-radius: 50%; background: radial-gradient(circle at 30% 25%, #f6dc85, #c79a2c); display: grid; place-items: center; font-style: normal; flex: none }
@keyframes toast { 0% { opacity: 0; transform: translate(-50%, 20px) } 8%, 88% { opacity: 1; transform: translate(-50%, 0) } 100% { opacity: 0; transform: translate(-50%, 10px) } }

/* ---------- small refinements to existing pieces ---------- */
.head h2 { letter-spacing: -.01em }
.panel, .near, .place-card, .game-box, .lesson, .sheet-print, .note-box { border-radius: var(--r) }
.place-card .art.has-photo { height: 14rem; border-radius: 14px }
.era-places a, .trail-card { border-radius: 16px; transition: transform .3s var(--ease), border-color .2s }
.era-places a:hover, .trail-card:hover { transform: translateY(-3px) }
.chapters { border-radius: var(--r) }
.btn { transition: background .2s, color .2s, transform .2s var(--ease), border-color .2s }
.btn:hover { transform: translateY(-2px) }
.quiz { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: clamp(1.2rem, 3.5vw, 2.2rem); max-width: none }
#quiz { background: transparent }
@media (prefers-reduced-motion: reduce) {
  html.js .rv { opacity: 1; transform: none }

  ::view-transition-old(root), ::view-transition-new(root) { animation: none }
}
@media print { .progress, .menu, .to-top, .hero-art, .marquee, .journey-chip, .menu-btn { display: none !important } html.js .rv { opacity: 1; transform: none } .era-hero.has-art { min-height: 0 } }
/* Arthur's page: his line and the map of Arthur's Wales (build.py arthur_extra, src/arthur.py) */
.ar-line { list-style: none; padding: 0; margin: 0; display: flex; gap: 1.4rem; align-items: stretch }
.ar-line li { position: relative; flex: 1 1 0; display: grid; align-content: start; gap: .3rem; padding: .9rem 1rem; border: 1px solid var(--line); border-radius: 14px; background: var(--night) }
.ar-line li + li::before { content: "→"; position: absolute; left: -.7rem; top: 50%; transform: translate(-50%, -50%); color: var(--muted); font-size: 1.1rem }
.ar-line b { font: 400 1.2rem/1.15 var(--f-display); color: var(--ink) }
.ar-line span { font-size: .9rem; line-height: 1.4; color: var(--muted) }
.ar-line li.him { border-color: var(--c); background: color-mix(in srgb, var(--c) 18%, var(--night)) }
.ar-line li.him span { color: var(--c); font-weight: 600 }
@media (max-width: 759px) {
  .ar-line { flex-direction: column; gap: 1.1rem }
  .ar-line li + li::before { content: "↓"; left: 1.6rem; top: -.55rem }
}
.ar-grid { display: grid; gap: 1.6rem; align-items: start; margin-top: 1.2rem }
@media (min-width: 900px) { .ar-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr) } .ar-mapbox { position: sticky; top: 5.5rem } }
.ar-map { width: 100%; height: auto; display: block; max-width: 34rem; margin-inline: auto }
.ar-map .land { fill: #232b3c; stroke: #55617a; stroke-width: 1.2 }
.ar-pin circle { fill: #d43c34; stroke: var(--night); stroke-width: 2.5; transition: fill .2s }
.ar-pin text { fill: #fff; font: 700 14px var(--f-body); text-anchor: middle; pointer-events: none }
.ar-pin:hover circle, .ar-pin:focus-visible circle { fill: var(--gold) }
.ar-list { display: grid; gap: .5rem; padding: 0; margin: 0; list-style: none; counter-reset: ar }
.ar-list li { counter-increment: ar; display: grid; grid-template-columns: 2rem minmax(0, 1fr); column-gap: .9rem; padding: .7rem .8rem; border-radius: 12px; border: 1px solid transparent; scroll-margin-top: 6rem; transition: background .3s, border-color .3s }
.ar-list li::before { content: counter(ar); grid-row: span 2; width: 1.9rem; height: 1.9rem; border-radius: 50%; background: #d43c34; color: #fff; display: grid; place-items: center; font-weight: 700; font-size: .9rem }
.ar-list li:target { border-color: var(--c); background: color-mix(in srgb, var(--c) 12%, transparent) }
.ar-list b { font-size: 1.08rem; color: var(--ink) }
.ar-list p { margin: .25rem 0 0; color: #c9ccd4; font-size: 1rem; line-height: 1.55 }
.ar-list .src { margin-left: .3rem }
.ar-line + .realm-links { margin: 1.4rem 0 0 }
.ar-lead { stroke: #d43c34; stroke-width: 2 }
@media (min-width: 900px) { .ar-grid { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr) } .ar-map { max-width: none } }

/* ---------- phones: page tops are a band of picture, not a whole screen, so the page starts straight away ---------- */
@media (max-width: 700px) {
  .era-hero.has-art { min-height: 0 }
  .era-hero.has-art .hero-art { bottom: auto; height: 15rem }
  .era-hero.has-art .wrap { padding-block: 8.5rem 1.75rem }
  .era-hero.has-art h1 { font-size: clamp(2.4rem, 11vw, 3.4rem) }
  .era-hero.has-art .lede { font-size: 1.02rem }
}
/* the badge toast holds a link */
.toast > a { display: flex; gap: .7rem; align-items: center; color: inherit; text-decoration: none }
/* the one-time hint under the journey circle */
.chip-hint { position: fixed; z-index: 61; max-width: 15rem; background: var(--ink); color: var(--night); border-radius: 14px; padding: .7rem .9rem; font-size: .88rem; line-height: 1.4; font-weight: 500; box-shadow: 0 20px 50px rgba(0,0,0,.5); animation: h-in .5s var(--ease) both }
.chip-hint::before { content: ""; position: absolute; top: -6px; left: var(--ax, 1.5rem); width: 12px; height: 12px; background: inherit; transform: rotate(45deg) }
.chip-hint b { display: block; font-weight: 700; margin-bottom: .15rem }
/* the invitation to put the site on the home screen */
.install-bar { position: fixed; left: 50%; bottom: calc(1rem + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); z-index: 59; width: min(30rem, calc(100vw - 2rem)); background: var(--slate); border: 1px solid var(--line); border-radius: 18px; padding: .9rem 1rem; display: grid; grid-template-columns: auto 1fr; gap: .4rem .9rem; align-items: center; box-shadow: 0 24px 60px rgba(0,0,0,.55); animation: h-in .6s var(--ease) both }
.install-bar img { width: 2.8rem; height: 2.8rem; border-radius: 12px; grid-row: span 2 }
.install-bar p { margin: 0; font-size: .92rem; line-height: 1.4 }
.install-bar p b { display: block; font-family: var(--f-display); font-weight: 400; font-size: 1.15rem }
.install-bar .row { grid-column: 1 / -1; display: flex; gap: .6rem; justify-content: flex-end; margin-top: .3rem }
.install-bar button { border-radius: 999px; padding: .5rem 1rem; font-weight: 700; font-size: .88rem; cursor: pointer; border: 1px solid var(--line); background: transparent; color: var(--ink) }
.install-bar button.go { background: var(--ink); color: var(--night); border-color: var(--ink) }

/* ---------- what's new and following the site ---------- */
.news-row { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 2fr); gap: 1rem; margin-top: 1rem }
.news-row.one { grid-template-columns: 1fr }
.news-row > * { border-radius: var(--r); border: 1px solid var(--line); padding: clamp(1.2rem, 2.5vw, 1.7rem); background: var(--card); min-width: 0 }
.news-list { list-style: none; margin: .8rem 0 0; padding: 0; display: grid; gap: .2rem }
.news-item a { display: grid; grid-template-columns: 7.5rem minmax(0, 1fr); gap: .1rem 1rem; padding: .55rem 0; border-top: 1px solid var(--line); text-decoration: none; color: var(--ink) }
.news-item:first-child a { border-top: 0 }
.news-item a:hover .n-t { color: var(--dragon) }
.n-date { font-family: var(--f-mono); font-size: .76rem; color: var(--muted); letter-spacing: .04em; padding-top: .2rem }
.n-t { font-weight: 700; line-height: 1.35 }
.n-s { grid-column: 2; color: var(--muted); font-size: .95rem; line-height: 1.5 }
.news-item.is-new .n-t::after { content: "New"; margin-left: .5rem; font: 700 .75rem var(--f-body); letter-spacing: .06em; text-transform: uppercase; color: #fff; background: var(--dragon-deep); border-radius: 999px; padding: .12rem .45rem; vertical-align: .15em }
html.cy .news-item.is-new .n-t::after { content: "Newydd" }
.n-all { display: inline-block; margin-top: .8rem; font-weight: 700; color: var(--ink) }
.news-list.big .news-item a { padding: 1.1rem 0; grid-template-columns: 9rem minmax(0, 1fr) }
.news-list.big .n-t { font-family: var(--f-display); font-weight: 400; font-size: 1.45rem; line-height: 1.15 }
.news-page { display: grid; grid-template-columns: minmax(0, 1fr) minmax(16rem, 22rem); gap: 2.5rem; align-items: start }
.news-page .follow { position: sticky; top: 5.5rem; border-radius: var(--r); border: 1px solid var(--line); padding: 1.4rem; background: var(--card) }
.follow { display: grid; gap: .7rem; align-content: start }
.follow .f-h { font-family: var(--f-display); font-size: 1.6rem; line-height: 1.1 }
.follow .f-sub { color: var(--muted); font-size: .97rem; line-height: 1.5 }
.follow .f-row { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: .2rem }
.follow input { flex: 1 1 12rem; min-width: 0; font: inherit; color: var(--ink); background: var(--night); border: 1px solid var(--line); border-radius: 999px; padding: .65rem 1.1rem }
.follow input:focus-visible { outline: 2px solid var(--dragon); outline-offset: 2px }
.f-form { display: grid; gap: .5rem; margin: .2rem 0 0 }
.f-form .f-row { margin-top: 0 }
.f-field { display: flex; flex: 1 1 13rem; min-width: 0 }
.f-field input { width: 100% }
.f-trap { position: absolute !important; left: -9999px; width: 1px; height: 1px; opacity: 0 }
.f-busy button { opacity: .7; cursor: progress }
.f-msg { margin: 0; font-size: .95rem; line-height: 1.5 }
.f-msg:empty { display: none }
.f-msg.ok { color: var(--ink); background: var(--card); border: 1px solid var(--line); border-left: 4px solid var(--gold); border-radius: 12px; padding: .8rem 1rem }
.f-msg.err { color: var(--dragon) }
.f-done .f-row { display: none }
.follow .f-priv { color: var(--muted); font-size: .85rem; line-height: 1.45; margin: 0 }
.follow .f-priv a { color: var(--ink); text-underline-offset: 2px; display: inline-block; padding-block: .2rem }
.follow .f-more { font-size: .92rem; color: var(--muted); text-decoration: none; justify-self: start }
.follow .f-more:hover { color: var(--dragon) }
.follow-foot { margin-top: 1.4rem; max-width: 34rem }
.follow-foot .f-h { font-size: 1.3rem }
.menu-btn.has-news { position: relative }
.menu-btn.has-news::after { content: ""; position: absolute; top: 2px; right: 2px; width: 10px; height: 10px; border-radius: 50%; background: var(--dragon); box-shadow: 0 0 0 2px var(--night) }
.menu a.has-news::after { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--dragon); margin-left: .45rem; vertical-align: .15em }
@media (max-width: 860px) { .news-row, .news-page { grid-template-columns: 1fr } .news-page .follow { position: static } }
@media (max-width: 520px) { .news-item a, .news-list.big .news-item a { grid-template-columns: 1fr } .n-s { grid-column: 1 } }

/* ---------- the Share button at the top of each page ---------- */
.share-row { margin-top: .3rem; animation: h-in .9s .2s var(--ease) both }
.share-btn { display: inline-flex; align-items: center; gap: .5rem; border: 1px solid var(--line); background: rgba(14,17,24,.55); color: var(--ink); border-radius: 999px; padding: .45rem 1rem .45rem .85rem; font-weight: 700; font-size: .88rem; cursor: pointer; backdrop-filter: blur(6px) }
.share-btn:hover { border-color: var(--ink) }
.share-btn svg { width: 1.05rem; height: 1.05rem }
.share-pop { position: fixed; z-index: 62; background: var(--slate); border: 1px solid var(--line); border-radius: 16px; padding: .5rem; display: grid; min-width: 13rem; box-shadow: 0 24px 60px rgba(0,0,0,.55); animation: h-in .3s var(--ease) both }
.share-pop a, .share-pop button { font-family: var(--f-body); display: block; text-align: left; padding: .6rem .8rem; border-radius: 10px; color: var(--ink); text-decoration: none; background: none; border: 0; font-weight: 500; cursor: pointer; font-size: .95rem }
.share-pop a:hover, .share-pop button:hover { background: var(--slate-2) }
@media print { .share-row { display: none } }

/* home page: sections far below the opening are only laid out when they come near the screen */
@supports (content-visibility: auto) { #stories, #legends, #language, #play, #sources { content-visibility: auto; contain-intrinsic-size: auto 1200px } }

/* Phones: a shorter front page. The full lists are one tap away ("All long reads", "All legends", "All games", Learn Welsh). */
.lang-words { margin-top: clamp(2rem, 5vw, 3.5rem); display: grid; gap: 1.25rem }
@media (max-width: 700px) {
  #stories .s-grid > .s-card:nth-child(n+5), #legends .l-grid > .l-card:nth-child(n+5), #play .play-grid > .p-card:nth-child(n+5):not(.p-all), #language .lang-words { display: none }
  #people .chips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; max-width: 100%; -webkit-mask-image: linear-gradient(90deg, #000 90%, transparent); mask-image: linear-gradient(90deg, #000 90%, transparent); padding-bottom: 2px }
  #people .chips::-webkit-scrollbar { display: none }
  #people .chips .chip { flex: none }
  #people .tl-tools { display: grid; gap: .6rem }
}

/* ---------- collectable cards (src/sets.py; painted by site.js) ---------- */
.cset-lead { color: var(--muted); max-width: 46rem; margin: 0 0 1.6rem } .cset-lead b { color: var(--ink) } .cset-lead a { color: var(--gold); font-weight: 600 }
.cset { border: 1px solid var(--line); border-radius: var(--r); background: var(--card); padding: 1.2rem 1.2rem 1.3rem; margin-bottom: 1rem }
.cset + .cset { margin-top: 0 }
.cset-h { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .3rem 1rem; align-items: baseline; margin-bottom: 1rem }
.cset-h h3 { font: 400 clamp(1.3rem, 3vw, 1.6rem)/1.15 var(--f-display); margin: 0 }
.cset-h p { grid-column: 1 / -1; margin: 0; color: var(--muted); font-size: .92rem }
.cset-n { font: 500 .8rem var(--f-mono); color: var(--muted); white-space: nowrap } .cset-n b { color: var(--ink); font-weight: 700 }
.cset .j-bar { margin-top: .4rem }
.cset.full { border-color: color-mix(in srgb, var(--gold) 55%, var(--line)); background: linear-gradient(160deg, color-mix(in srgb, var(--gold) 9%, var(--card)), var(--card)) }
.cset.full .cset-n::before { content: "★ "; color: var(--gold) }
.cc-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(8.4rem, 1fr)); gap: .75rem }
.cc { position: relative; display: grid; grid-template-rows: auto 1fr; border-radius: 14px; overflow: hidden; text-decoration: none; color: var(--ink);
  background: linear-gradient(165deg, color-mix(in srgb, var(--c) 26%, var(--card)), var(--card) 70%); border: 1px solid color-mix(in srgb, var(--c) 30%, var(--line));
  transition: transform .25s var(--ease), box-shadow .25s var(--ease), opacity .25s }
.cc-img { position: relative; aspect-ratio: 1 / 1.05; display: grid; place-items: center; overflow: hidden; background: radial-gradient(circle at 50% 35%, color-mix(in srgb, var(--c) 45%, #000), #0b0d12) }
.cc-img i { font: 400 2.2rem var(--f-display); font-style: normal; color: color-mix(in srgb, var(--c) 70%, #fff) }
.cc-img img, .cc-img svg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 25% }
.cc-t { padding: .55rem .65rem .7rem; display: grid; gap: .15rem; align-content: start }
.cc-t b { font: 400 1rem/1.15 var(--f-display) }
.cc-t small { font: 500 .75rem var(--f-mono); color: var(--muted); letter-spacing: .02em }
.cc-no { position: absolute; top: .45rem; left: .45rem; font: 600 .62rem var(--f-mono); background: rgba(8,10,14,.72); color: #ece9e1; padding: .18rem .45rem; border-radius: 999px; z-index: 1 }
.cc:not(.got) { opacity: .55 }
.cc:not(.got) .cc-img img, .cc:not(.got) .cc-img svg { filter: grayscale(1) brightness(.45) }
.cc:not(.got) .cc-img::after { content: "Read to collect"; position: absolute; inset: auto 0 0; padding: .35rem; text-align: center; font: 600 .62rem var(--f-mono); letter-spacing: .04em; text-transform: uppercase; color: #ece9e1; background: rgba(8,10,14,.6) }
:root.cy .cc:not(.got) .cc-img::after { content: "Darllenwch i’w gasglu" }
.cc.got { box-shadow: 0 0 0 1px color-mix(in srgb, var(--gold) 45%, transparent), 0 10px 26px -14px color-mix(in srgb, var(--gold) 70%, transparent) }
.cc.got::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(115deg, transparent 35%, rgba(255,240,200,.16) 48%, transparent 60%); background-size: 250% 100%; background-position: 100% 0; transition: background-position .8s var(--ease) }
.cc.got .cc-no { background: linear-gradient(135deg, #f6dc85, #c79a2c); color: #2a1f05 }
.cc:hover { transform: translateY(-3px); opacity: 1 } .cc.got:hover::after { background-position: 0 0 }
.cc.here { outline: 2px solid var(--gold); outline-offset: 2px; opacity: 1 }
@media (max-width: 700px) {
  .cc-row { grid-auto-flow: column; grid-template-columns: none; grid-auto-columns: 7.6rem; overflow-x: auto; scrollbar-width: none; padding: 4px 2px 6px; margin-inline: -2px; scroll-snap-type: x proximity }
  .cc-row::-webkit-scrollbar { display: none } .cc { scroll-snap-align: start }
  .cset { padding: 1rem .9rem 1.1rem }
}
@media (prefers-reduced-motion: reduce) { .cc, .cc.got::after { transition: none } .cc:hover { transform: none } }

/* ---------- read further (person and place pages) ---------- */
.further { margin-top: 2rem; padding-top: 1.2rem; border-top: 1px solid var(--line); display: grid; gap: .6rem }
.further .eyebrow { margin: 0 }
.further p:last-child { margin: 0; display: flex; flex-wrap: wrap; gap: .5rem }
.further a { display: inline-flex; align-items: center; gap: .35rem; padding: .5rem .85rem; border: 1px solid var(--line); border-radius: 999px; color: var(--ink); text-decoration: none; font-size: .9rem; font-weight: 600; background: var(--card) }
.further a:hover { border-color: var(--gold); color: var(--gold) }

/* Newest first (src/added.py): the "New" badge and the "Just added" strip at the top of ordered lists */
.new-tag { display: inline-block; margin-left: .5rem; padding: .12rem .5rem; border-radius: 999px; background: #b8302a; color: #fff; font: 700 .75rem var(--f-mono); letter-spacing: .08em; text-transform: uppercase; vertical-align: .15em; line-height: 1.4 }
.just-added { margin: 0 0 1.8rem; padding: 1rem 1.1rem 1.1rem; border: 1px solid color-mix(in srgb, var(--gold, #e8c65a) 45%, var(--line)); border-radius: 14px; background: color-mix(in srgb, var(--gold, #e8c65a) 6%, var(--slate, transparent)) }
.just-added h2 { font: 600 .78rem var(--f-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--gold, #e8c65a); margin: 0 0 .7rem }
.just-added ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 14rem), 1fr)); gap: .6rem }
.just-added a { display: grid; grid-template-rows: 1fr auto; gap: .35rem; height: 100%; box-sizing: border-box; padding: .7rem .85rem; border-radius: 10px; border: 1px solid var(--line); background: var(--card, var(--slate)); text-decoration: none; color: var(--ink) }
.just-added a:hover, .just-added a:focus-visible { border-color: var(--gold, #e8c65a) }
.just-added b { font-weight: 600; line-height: 1.3 }
.just-added .ja-d { font: 500 .75rem var(--f-mono); color: var(--muted); letter-spacing: .04em; text-transform: uppercase }
/* Further reading and references at the end of every long read (src/refs.py, refs_block in build.py) */
.refs { margin-top: 3rem; padding: 1.6rem clamp(1.1rem, 3vw, 1.8rem); border: 1px solid var(--line); border-radius: var(--r); background: var(--card) }
.refs h2 { margin: 0 0 .5rem; font-size: clamp(1.35rem, 2.6vw, 1.7rem); color: var(--ink) }
.refs .refs-i { margin: 0 0 .4rem; color: #b4b9c4; font-size: .98rem; line-height: 1.6 }
.refs h3 { margin: 1.3rem 0 .55rem; font-size: .8rem; letter-spacing: .12em; text-transform: uppercase; color: var(--gold) }
.refs ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .8rem }
.refs li { padding-left: .95rem; border-left: 2px solid rgba(255,255,255,.12); font-size: .98rem; line-height: 1.55; color: #dcdee4 }
.refs cite { font-style: italic; color: var(--ink) }
.refs .ref-w { font-weight: 600 }
.refs .ref-d { color: #9aa0ad }
.refs .ref-n { display: block; margin-top: .15rem; font-size: .9rem; color: #b4b9c4 }
.refs a { color: inherit; text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--gold) 55%, transparent); text-underline-offset: 3px }
.refs a:hover cite { color: var(--gold) }
.w10-refs .refs { margin-top: 0 }
@media print { .refs { border-color: #999; background: none; break-inside: avoid-page } .refs li, .refs .refs-i, .refs .ref-n, .refs .ref-d, .refs cite, .refs h2 { color: #000 } }

/* ---------- home page: the map and people teasers (the full versions are map.html and people.html) ---------- */
/* ---------- home page: the Map section (#map) — a panel with the map, the town finder and three picture cards ---------- */
.mh { position: relative; isolation: isolate; overflow: hidden; display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: clamp(1.5rem, 4vw, 3.5rem); align-items: center;
  padding: clamp(1.4rem, 4vw, 3rem); border-radius: calc(var(--r) + 6px); border: 1px solid var(--line);
  background: radial-gradient(60% 70% at 22% 45%, rgba(226,69,61,.16), transparent 70%), radial-gradient(50% 60% at 95% 0%, rgba(232,198,90,.08), transparent 70%), linear-gradient(160deg, #161c29, #10141e 70%) }
.mh::before { content: ""; position: absolute; inset: 0; z-index: -1; opacity: .35; background-image: linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px); background-size: 44px 44px; -webkit-mask-image: radial-gradient(70% 80% at 30% 50%, #000, transparent); mask-image: radial-gradient(70% 80% at 30% 50%, #000, transparent) }
.mh .head { margin: 0 0 1.4rem }
.mh .head h2 { font-size: clamp(2.4rem, 5vw, 4.2rem) }
.mh-map { min-width: 0 }
.map-teaser { display: block; max-width: 30rem; width: 100%; margin-inline: auto; transition: transform .5s var(--ease); filter: drop-shadow(0 30px 40px rgba(0,0,0,.45)) }
.map-teaser svg { width: 100%; height: auto; display: block; overflow: visible }
.map-teaser .land { fill: #232a3a; stroke: rgba(255,255,255,.14); stroke-width: 1.5 }
.map-teaser .pins .halo { display: none }
.map-teaser .pins .dot { fill: var(--c); stroke: #10141e; stroke-width: 2.5; transition: r .3s }
.map-teaser .pins .pin:nth-child(7n+1) .dot { animation: mh-glow 4s ease-in-out infinite; animation-delay: calc(var(--i, 0) * 1s) }
.map-teaser .pins .pin:nth-child(14n+3) .dot { animation-delay: 1.3s } .map-teaser .pins .pin:nth-child(21n+5) .dot { animation-delay: 2.6s }
@keyframes mh-glow { 50% { r: 11px; filter: drop-shadow(0 0 6px var(--c)) } }
.map-teaser .pin.hl .dot { r: 13px; stroke: #fff; stroke-width: 3; animation: none }
.map-teaser .mlab circle { fill: none; stroke: rgba(255,255,255,.75); stroke-width: 2 }
.map-teaser .mlab text { fill: #e7e2d6; font: 600 21px var(--f-body); paint-order: stroke; stroke: #10141e; stroke-width: 5px; stroke-linejoin: round }
html:not(.cy) .map-teaser .mlab .l-cy, html.cy .map-teaser .mlab .l-en { display: none }
.map-teaser .you circle { fill: var(--gold) } .map-teaser .you circle.ring { fill: rgba(232,198,90,.22); animation: mh-ring 2s ease-out infinite; transform-origin: center; transform-box: fill-box }
.map-teaser .you circle.in { fill: #10141e } .map-teaser .you text { fill: var(--gold); font: 700 24px var(--f-body); paint-order: stroke; stroke: #10141e; stroke-width: 6px }
.map-teaser .you[hidden] { display: none }
@keyframes mh-ring { from { transform: scale(.5); opacity: 1 } to { transform: scale(1.6); opacity: 0 } }
.map-teaser:hover, .map-teaser:focus-visible { transform: scale(1.02) }
.map-teaser:hover .land { fill: #2a3244 }
@media (prefers-reduced-motion: reduce) { .map-teaser .pins .dot, .map-teaser .you circle.ring { animation: none } }
/* the town finder */
.mh-near { display: grid; gap: .55rem }
.mh-near > label { font: 600 .75rem var(--f-mono); letter-spacing: .14em; text-transform: uppercase; color: var(--gold) }
.mh-row { display: flex; gap: .45rem; padding: .35rem; border-radius: 999px; background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.14); transition: border-color .2s, box-shadow .2s }
.mh-row:focus-within { border-color: var(--gold); box-shadow: 0 0 0 4px rgba(232,198,90,.15) }
.mh-row input { flex: 1; min-width: 0; background: none; border: 0; outline: 0; color: var(--ink); font: 500 1.05rem var(--f-body); padding: .55rem .4rem .55rem .9rem }
.mh-row input::placeholder { color: var(--muted) }
.mh-row button { flex: none; width: 2.9rem; height: 2.9rem; border-radius: 50%; border: 0; display: grid; place-items: center; cursor: pointer; font-size: 1.2rem; transition: transform .2s, background .2s }
.mh-go { background: var(--gold); color: var(--night) } .mh-geo { background: rgba(255,255,255,.08); color: var(--ink) }
.mh-row button:hover { transform: scale(1.06) } .mh-geo:hover { background: rgba(255,255,255,.16) }
.mh-msg { margin: .2rem 0 0; color: var(--muted); font-size: .9rem; min-height: 0 }
.mh-msg:empty { display: none }
.mh-res { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .55rem }
.mh-res:empty { display: none }
.mh-place { border-radius: 14px; overflow: hidden; background: var(--card); border: 1px solid color-mix(in srgb, var(--c) 40%, var(--line)); display: grid; animation: mh-in .5s var(--ease) both; transition: transform .3s var(--ease), border-color .3s }
.mh-place:nth-child(2) { animation-delay: .08s } .mh-place:nth-child(3) { animation-delay: .16s }
.mh-place:hover { transform: translateY(-3px); border-color: var(--c) }
@keyframes mh-in { from { opacity: 0; transform: translateY(10px) } }
.mh-ph { aspect-ratio: 4 / 3; background: color-mix(in srgb, var(--c) 30%, var(--slate)) } .mh-ph img { width: 100%; height: 100%; object-fit: cover; display: block }
.mh-pt { display: grid; gap: .1rem; padding: .55rem .65rem .65rem } .mh-pt b { font-size: .92rem; line-height: 1.25 } .mh-pt small { color: var(--muted); font-size: .76rem }
/* three picture cards: the map, the kingdoms, the castles */
.mh-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; margin-top: 1rem }
.mh-card { position: relative; isolation: isolate; overflow: hidden; min-height: 13rem; border-radius: var(--r); padding: 1.1rem 1.2rem 1.15rem; text-decoration: none; color: #fff; display: flex; flex-direction: column; justify-content: flex-end; gap: .35rem; border: 1px solid color-mix(in srgb, var(--c) 35%, var(--line)); transition: transform .4s var(--ease), border-color .4s, box-shadow .4s }
.mh-card:hover { transform: translateY(-4px); border-color: color-mix(in srgb, var(--c) 70%, var(--line)); box-shadow: 0 24px 46px -26px color-mix(in srgb, var(--c) 70%, transparent) }
.mh-pic { position: absolute; inset: 0; z-index: -1 } .mh-pic img { width: 100%; height: 100%; max-width: none; object-fit: cover; transition: transform 1.2s var(--ease) }
.mh-card:hover .mh-pic img { transform: scale(1.06) }
.mh-pic::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(9,12,19,.1), rgba(9,12,19,.5) 45%, rgba(9,12,19,.94)) }
.mh-n { align-self: flex-start; margin-bottom: auto; font: 600 .75rem var(--f-mono); letter-spacing: .1em; text-transform: uppercase; background: rgba(9,12,19,.55); border: 1px solid rgba(255,255,255,.22); border-radius: 999px; padding: .3rem .7rem; backdrop-filter: blur(6px) }
.mh-t { display: grid; gap: .2rem; padding-right: 2.6rem } .mh-t b { font: 400 1.6rem/1.05 var(--f-display) } .mh-t small { color: #d9dce3; font-size: .9rem; line-height: 1.4 }
.mh-card .ar, .more-tile .ar { position: absolute; right: 1.1rem; bottom: 1.1rem; width: 2.4rem; height: 2.4rem; border-radius: 50%; background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.3); color: #fff; display: grid; place-items: center; font-size: 1.1rem; transition: transform .3s var(--ease), background .3s }
.mh-card:hover .ar { transform: translateX(4px); background: var(--gold); color: var(--night); border-color: var(--gold) }
@media (max-width: 900px) {
  .mh { grid-template-columns: 1fr } .mh-map { order: 2 } .mh-side { order: 1 } .map-teaser { max-width: 19rem }
  .mh .head { margin-bottom: 1.1rem }
}
@media (max-width: 700px) {
  .mh-cards { grid-template-columns: 1fr; gap: .6rem }
  .mh-card { min-height: 0; flex-direction: row; align-items: center; gap: .9rem; padding: .6rem 3.4rem .6rem .6rem; background: var(--card) }
  .mh-pic { display: block; position: relative; inset: auto; z-index: 0; width: 4.6rem; height: 4.6rem; flex: none; border-radius: 12px; overflow: hidden } .mh-pic::after { display: none }
  .mh-n { display: none } .mh-t { padding: 0 } .mh-t b { font-size: 1.25rem } .mh-t small { color: var(--muted); font-size: .84rem }
  .mh-card .ar { top: 50%; bottom: auto; margin-top: -1.2rem; right: .8rem }
  .mh-res { gap: .4rem } .mh-pt { padding: .45rem .5rem .55rem } .mh-pt b { font-size: .82rem }
}
/* the tile under the long reads (and any "all of them" tile like it) */
.more-tile { position: relative; margin-top: 1rem; display: flex; align-items: center; gap: 1.1rem; padding: .9rem 4.2rem .9rem 1.1rem; border-radius: var(--r); text-decoration: none; color: var(--ink);
  background: linear-gradient(120deg, rgba(232,198,90,.13), rgba(232,198,90,.02) 70%), var(--card); border: 1px solid rgba(232,198,90,.32); transition: border-color .3s, transform .3s var(--ease) }
.more-tile:hover { border-color: var(--gold); transform: translateY(-2px) }
.more-tile .t { display: grid; gap: .1rem; min-width: 0 } .more-tile .t b { font: 400 1.5rem/1.1 var(--f-display) } .more-tile .t small { color: var(--muted); font-size: .9rem }
.more-tile .ar { top: 50%; bottom: auto; margin-top: -1.2rem; background: var(--gold); color: var(--night); border-color: var(--gold) }
.more-tile:hover .ar { transform: translateX(4px) }
.more-tile .p-faces { flex: none }
@media (max-width: 560px) { .more-tile { padding: .8rem 3.6rem .8rem .9rem; gap: .8rem } .more-tile .p-faces span { width: 2.8rem; height: 2.8rem } .more-tile .p-faces span:nth-child(n+4) { display: none } .more-tile .t b { font-size: 1.25rem } .more-tile .t small { font-size: .82rem } .more-tile .ar { right: .8rem } }
.people-home { margin-top: 1.4rem }
@media (max-width: 700px) { .people-home > .plaque:nth-child(n+4) { display: none } }
/* map.html and people.html: the section sits straight under the page's opening */
section.page-top { padding-top: clamp(1.5rem, 4vw, 3rem) }
/* Books and authors page (books-and-authors.html, bookshelf_page in build.py, src/authors.py) */
.shelf-chips { display: flex; flex-wrap: wrap; gap: .5rem; margin: 1.2rem 0 2rem }
.author-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 1rem; margin-top: 1rem }
.author { padding: 1.1rem 1.2rem; border: 1px solid var(--line); border-radius: var(--r); background: var(--card); font-size: .95rem; line-height: 1.55; color: #dcdee4; scroll-margin-top: 5rem }
.author h3 { margin: 0; font-size: 1.15rem; color: var(--ink) }
.author h3 a { color: inherit; text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--gold) 55%, transparent); text-underline-offset: 3px }
.author .au-d { margin: .15rem 0 .5rem; font-size: .82rem; color: #9aa0ad }
.author .au-b { margin: .7rem 0 .3rem; font-size: .75rem; letter-spacing: .12em; text-transform: uppercase; color: var(--gold) }
.author ul { margin: 0; padding-left: 1.1rem; display: grid; gap: .2rem }
.author ul a { color: #dcdee4 }
.shelf { scroll-margin-top: 5rem } .shelf li { scroll-margin-top: 6rem }
.shelf li:target { border-left-color: var(--gold); background: color-mix(in srgb, var(--gold) 8%, transparent) }
.refs .ref-on { display: block; margin-top: .25rem; font-size: .82rem; color: #9aa0ad }
@media print { .author { border-color: #999; background: none; color: #000 } .shelf-chips { display: none } }
.author h3 + p:not(.au-d) { margin-top: .5rem }
.refs .refs-all { margin: 1.3rem 0 0; font-size: .92rem } .refs .refs-all a { color: var(--gold); text-decoration: none; font-weight: 600 }
/* authors sit inside each period's box on the Books and authors page */
.shelf .author-grid { margin: .4rem 0 .6rem }
.shelf .author { background: color-mix(in srgb, var(--ink) 4%, transparent) }
.shelf .author h3 { margin: 0; font-size: 1.15rem; letter-spacing: normal; text-transform: none; color: var(--ink) }
.shelf .author ul { list-style: disc; padding-left: 1.1rem; gap: .2rem }
.shelf .author li { padding-left: 0; border-left: 0; font-size: .95rem }

/* Arthur's circle (build.py arthur_circle): the people of Arthur's story, on each of their pages */
.ar-circle .sub-h { margin: 1.6rem 0 .2rem; font-size: 1.15rem }
.ar-circle .ppl { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .7rem }
.ar-circle .ppl a { display: inline-flex; align-items: center; gap: .5rem; padding: .3rem .8rem .3rem .3rem; border: 1px solid var(--line); border-radius: 999px; text-decoration: none; color: inherit; font-size: .92rem; background: var(--slate) }
.ar-circle .ppl a:hover { border-color: var(--c) }
.ar-circle .ppl a[aria-current] { border-color: var(--c); background: color-mix(in srgb, var(--c) 22%, var(--slate)); font-weight: 600 }
.ar-circle .ppl .ava { width: 2rem; height: 2rem; font-size: .8rem }
.ar-circle .ar-more { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1.8rem }
.ar-line b a { color: inherit; text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--c) 60%, transparent); text-underline-offset: 3px }

/* Mabinogi tale guides: pictures of the tale (mabinogi-*.html) */
.mb-figs { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 17rem), 1fr)); gap: 1.4rem; align-items: start }
.mb-figs figure.photo { margin: 0 }
.mb-figs figure.photo img { width: 100%; height: 18rem; object-fit: contain; background: #0d1018; border-radius: 10px; display: block }
.mb-figs figure.photo figcaption { font-size: .82rem; margin-top: .5rem }

/* ---------- whole cards are links ----------
   A card or list row with class wl-card is one link. Its link (a.wl) holds the card's name for screen readers,
   shows no words, and is stretched over the whole card. a.wl-go is a link that stays visible (a name in a heading)
   whose click area is stretched the same way. Anything else in the card that can be pressed sits above it. */
.wl-card { position: relative; cursor: pointer }
a.wl { position: absolute; inset: 0; z-index: 1; overflow: hidden; color: transparent; font-size: 0; line-height: 0; text-decoration: none; border-radius: 14px; margin: 0 }
a.wl-go::after { content: ""; position: absolute; inset: 0; z-index: 1 }
:where(.wl-card) :where(a:not(.wl):not(.wl-go), button, summary, input, select, label) { position: relative; z-index: 2 }
a.wl:focus-visible, a.wl-go:focus-visible::after { outline: 2px solid var(--gold); outline-offset: 3px; border-radius: 14px }
a.wl-go:focus-visible { outline: none }
:is(.era-events > li, li.ev).wl-card { transition: background-color .25s, box-shadow .25s }
:is(.era-events > li, li.ev).wl-card:hover { background-color: rgba(255,255,255,.035); box-shadow: -.8rem 0 0 rgba(255,255,255,.035), .8rem 0 0 rgba(255,255,255,.035) }
.ar-list > li.wl-card:hover { background: rgba(255,255,255,.045) }
:is(.behind, .mab-tale, .pk-person, .firsts-banner, .place-card).wl-card { transition: box-shadow .25s }
:is(.behind, .mab-tale, .pk-person, .firsts-banner, .place-card).wl-card:hover { box-shadow: 0 0 0 1px color-mix(in srgb, var(--c, var(--gold)) 55%, transparent) }
@media print { a.wl, a.wl-go::after { display: none } .wl-card { cursor: auto } }

/* ---------- Bigger touch targets on touch screens (November 2026) ----------
   Small controls get an invisible tap area of at least 44 x 44 px (an empty ::before centred on them), so they look the same
   but are easy to hit with a thumb. The EN/CY pair only grows outwards, so neither steals taps from the other. */
@media (pointer: coarse) {
  :is(.lang a, .menu-btn, .search-btn, .journey-chip, .chip, .hear, .wotd-nav button, #dec-samples button, .marquee a, .n-all, .wotd-more, .site-foot .fcol summary) { position: relative }
  :is(.menu-btn, .search-btn, .journey-chip, .chip, .hear, .wotd-nav button, #dec-samples button, .marquee a, .n-all, .wotd-more)::before { content: ""; position: absolute; left: 50%; top: 50%; width: max(100%, 44px); height: max(100%, 44px); transform: translate(-50%, -50%) }
  .marquee .track2 a::before { height: max(100%, 30px) }
  .lang a::before { content: ""; position: absolute; top: 50%; width: 44px; height: 44px; transform: translateY(-50%) }
  .lang a:first-child::before { right: 0 }
  .lang a:last-child::before { left: 0 }
  /* scrolling chip rows would clip the taller tap areas, so they get room above and below (taken back with a negative margin) */
  #tl-teaser, #people .chips { padding-block: 7px; margin-block: -7px }
}

/* ---------- A shorter home page on phones (November 2026) ---------- */
@media (max-width: 700px) {
  /* the timeline's twelve age chips: one row to swipe, like the people filters, instead of ten stacked rows */
  #tl-teaser { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; max-width: 100%; -webkit-mask-image: linear-gradient(90deg, #000 88%, transparent); mask-image: linear-gradient(90deg, #000 88%, transparent) }
  #tl-teaser::-webkit-scrollbar { display: none }
  #tl-teaser .chip { flex: none }
  /* further reading: the first four books and four websites, and a button for the rest (site.js adds it) */
  html.js .clip-list:not(.open) > li:nth-child(n+5) { display: none }
}
.clip-more { display: none }
@media (max-width: 700px) { html.js .clip-more { display: inline-flex; margin-top: .8rem } html.js .clip-list.open + .clip-more { display: none } }

/* the footer lists are <details>: always open on wide screens; on phones site.js closes them into four tappable headings */
.site-foot .fcol summary { list-style: none; cursor: default }
.site-foot .fcol summary::-webkit-details-marker { display: none }
@media (min-width: 701px) { .site-foot .fcol summary { pointer-events: none } }
@media (max-width: 700px) {
  .foot-cols { grid-template-columns: 1fr; gap: 0 }
  .site-foot .fcol { border-top: 1px solid var(--line) }
  .site-foot .fcol:last-child { border-bottom: 1px solid var(--line) }
  .site-foot .fcol summary { cursor: pointer; display: flex; justify-content: space-between; align-items: center; min-height: 48px; color: var(--ink) }
  .site-foot .fcol summary::after { content: "+"; font: 400 1.3rem/1 var(--f-body); color: var(--muted); transition: transform .2s }
  .site-foot .fcol[open] summary::after { transform: rotate(45deg) }
  .site-foot .fcol ul { margin: 0 0 1rem; grid-template-columns: 1fr 1fr; gap: .2rem 1rem }
  .site-foot .fcol ul a { display: block; padding-block: .45rem }
}

/* ---------- home page rhythm: the same gap between every section (Ifan, 2026-11-13, "a little less gap").
   Each section keeps half the gap above and below, so two sections meet at one --home-gap (about 56px on a phone, 112px on a wide screen).
   Change --home-gap here, not the sections one by one. ---------- */
main.home { --home-gap: clamp(1.75rem, 4vw, 3.5rem) }
main.home > :is(#chapters, #today, #stories, #map, #people, #legends, #language, #play, #sources) { padding-block: var(--home-gap) }
main.home > #chapters { padding-top: calc(var(--home-gap) * 1.4) }
main.home .head { margin-bottom: clamp(1.4rem, 3vw, 2.2rem) }
main.home .more-row { margin-top: 1.25rem }
main.home .mh .head { margin-bottom: 1.4rem }

/* the map in the Brittany long read (brittany_map() in build.py) */
.bm-map .bm-home { fill: #4a2b33; stroke: #b0606a; stroke-width: 1.2 }
.bm-map .bm-kin { fill: #3a3346; stroke: #8a7aa8; stroke-width: 1 }
.bm-map .bm-kin2 { fill: #2e3446; stroke: #6a7590; stroke-width: 1 }
.bm-map .bm-road { fill: none; stroke: #e8c26a; stroke-width: 2.2; stroke-dasharray: 7 6; opacity: .9 }
.bm-map .bm-lab { fill: #d8dbe3; font: 600 15px var(--f-body); text-anchor: middle; letter-spacing: .12em; pointer-events: none }
.bm-map .bm-big { font-size: 22px; fill: #f1e3c6 }
.bm-map .bm-sea { font-style: italic; font-weight: 400; letter-spacing: .04em; fill: #8fa3c0 }
.bm-map .bm-old { font-size: 13px; font-weight: 400; letter-spacing: .02em; fill: #c9b9a0; font-style: italic }
.bm-cr { font-size: .85rem; color: #9aa0ad; margin: .4rem 0 0; text-align: center }
.refs .ref-buy, #sources .ref-buy { display: block; margin-top: .2rem; font-size: .8rem; color: #9aa0ad } .ref-buy a { color: var(--gold); text-decoration: none } .ref-buy a:hover { text-decoration: underline }

/* ---------- the map of Yr Hen Ogledd, the Old North (north_map in build.py, src/hen_ogledd.py) ---------- */
.nm-fig { margin: 2rem 0; padding: 0 }
.nm-fig .ar-map { max-width: none; border-radius: 14px; border: 1px solid var(--line) }
.nm .nm-sea { fill: #141a26 }
.nm .land { fill: #262e40; stroke: #4f5a72; stroke-width: 1 }
.nm .nm-ire { fill: #1d2433; stroke: #3a4458; stroke-width: 1 }
.nm .nm-wales { fill: color-mix(in srgb, #d43c34 26%, #262e40); stroke: #b0544e; stroke-width: 1.2 }
.nm-reg { fill: #c9cfdb; font: 700 15px var(--f-body); letter-spacing: .14em; text-transform: uppercase; text-anchor: middle; paint-order: stroke; stroke: #141a26; stroke-width: 4px; pointer-events: none }
.nm-reg.foe { fill: #8a93a6; font-style: italic; font-weight: 600 }
.nm-route { fill: none; stroke-width: 3.5; stroke-dasharray: 9 7; stroke-linecap: round; opacity: .95 }
.nm-fig figcaption { color: var(--muted); font-size: .88rem; line-height: 1.5; margin-top: .7rem }
.nm-fig figcaption a { color: inherit }
/* the map of Merthyr in 1831 in the Merthyr Rising long read (src/merthyr.py merthyr_map) */
.mr-fig { margin: 2rem 0; padding: 0 }
.mr-fig .ar-map { max-width: none; border-radius: 14px; border: 1px solid var(--line) }
.mr-fig .ar-grid { grid-template-columns: minmax(0, 1fr) }  /* in the narrow column of a long read: the map across, the list below */
.mr-fig .ar-mapbox { position: static }
@media (min-width: 700px) { .mr-fig .ar-list { grid-template-columns: repeat(2, minmax(0, 1fr)) } }
.mr-map .mr-road { fill: none; stroke: #8a7a5c; stroke-width: 3; stroke-dasharray: 7 5; stroke-linecap: round; opacity: .8 }
.mr-map .mr-river { fill: none; stroke: #4f8fc0; stroke-width: 6; stroke-linecap: round; stroke-linejoin: round; opacity: .85 }
.mr-map .mr-lab { fill: #d9cfb8; font: 600 13px var(--f-body); text-anchor: middle; paint-order: stroke; stroke: #232b3c; stroke-width: 4 }
.mr-map .mr-rl { fill: #8fc3ea; font-style: italic; font-size: 15px }
.mr-fig figcaption { color: var(--muted); font-size: .88rem; line-height: 1.5; margin-top: .7rem }
.nm-key { display: flex; flex-wrap: wrap; gap: .4rem 1.1rem; list-style: none; padding: 0; margin: 0 0 .5rem; color: var(--ink); font-size: .9rem }
.nm-key li { display: flex; align-items: center; gap: .45rem }
.nm-key i { display: inline-block; width: 1.4rem; height: .3rem; border-radius: 2px }
.nm-key .nm-k-wales { height: .9rem; width: .9rem; background: color-mix(in srgb, #d43c34 26%, #262e40); border: 1px solid #b0544e }
.nm-key .nm-k-foe { height: auto; width: auto; background: none; border: 0; color: #8a93a6 }
.nm-key .nm-k-foe::before { content: "Aa"; font: italic 600 .8rem var(--f-body) }
@media (min-width: 900px) { .nm-list { grid-template-columns: 1fr 1fr; column-gap: 1.2rem } }

/* ---------- A picture on every card (Ifan, 13 November 2026: "add pictures to all cards on the site") ----------
   build.py card_pic() finds the picture of what a card opens; pic_img() draws it, small copies from src/thumbs.py.
   People cards: the picture across the top (down the left side on phones). A person with no picture of their own
   shows their age's picture, dimmed, behind their initials. Tiles (places, kingdoms, saints' regions): the photo in
   place of the drawing. List rows (timeline, trail stops, rulers, saints): a small square at the right. */
.plaque.has-pic { padding-top: 0 }
.pq-pic { position: relative; display: block; margin: 0 -1.35rem .35rem; aspect-ratio: 16 / 9; overflow: hidden; background: #141925 }
.pq-pic img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .6s var(--ease) }
.pq-pic::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 50%, rgba(27,33,48,.92)) }
.plaque.wl-card:hover .pq-pic img { transform: scale(1.04) }
.pq-pic.is-age img { filter: grayscale(.6) brightness(.38) }
.pq-pic.is-age b { position: absolute; inset: 0; z-index: 1; display: grid; place-items: center; font: 400 3.2rem/1 var(--f-display); color: var(--c); letter-spacing: .04em; text-shadow: 0 2px 12px rgba(0,0,0,.6) }
@media (max-width: 560px) {
  .plaque.has-pic { padding: 1.1rem 1.1rem 1.1rem 8.1rem; min-height: 9.5rem }
  .pq-pic { position: absolute; left: 0; top: 0; bottom: 0; width: 7rem; margin: 0; aspect-ratio: auto }
  .pq-pic::after { background: linear-gradient(90deg, transparent 60%, rgba(27,33,48,.7)) }
  .pq-pic.is-age b { font-size: 2.2rem }
}
@supports (content-visibility: auto) { .people > .plaque { content-visibility: auto; contain-intrinsic-size: auto 420px } }

.era-places a { grid-template-columns: 4.6rem minmax(0,1fr); padding: .6rem 1rem .6rem .6rem }
.era-places a > svg { box-sizing: border-box; width: 4.6rem; height: 4.6rem; padding: .75rem; border-radius: 10px; background: color-mix(in srgb, var(--c) 9%, #161b26) }
.tl-pic { display: block; width: 4.6rem; height: 4.6rem; border-radius: 10px; overflow: hidden; background: #141925 }
.tl-pic img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .5s var(--ease) }
.era-places a:hover .tl-pic img { transform: scale(1.06) }

.era-events li.has-pic { grid-template-columns: 9rem minmax(0,1fr) 4.5rem }
.row-pic { display: block; width: 4.5rem; height: 4.5rem; margin-top: .2rem; border-radius: 12px; overflow: hidden; background: #141925; border: 1px solid var(--line) }
.row-pic img { display: block; width: 100%; height: 100%; object-fit: cover }
.row-pic.ic { display: grid; place-items: center; color: var(--c); background: color-mix(in srgb, var(--c) 9%, #161b26) }
.row-pic.ic svg { width: 2.5rem; height: 2.5rem }
@media (max-width: 560px) {
  .era-events li.has-pic { grid-template-columns: minmax(0,1fr) 4rem; column-gap: .9rem }
  .era-events li.has-pic > time, .era-events li.has-pic > div { grid-column: 1 }
  .era-events li.has-pic > .row-pic { grid-column: 2; grid-row: 1 / span 2; width: 4rem; height: 4rem }
}
@media print { .pq-pic, .row-pic, .tl-pic { display: none !important } .plaque.has-pic { padding: 1.35rem } }
.era-places b span { font-size: inherit; color: inherit }  /* the name keeps its size when it is wrapped in a language span */
/* reference cards (battles, documents): a small picture at the top right */
.rc-pic { float: right; display: block; width: 5.2rem; height: 5.2rem; margin: .15rem 0 .6rem 1rem; border-radius: 12px; overflow: hidden; background: #141925; border: 1px solid var(--line) }
.rc-pic img { display: block; width: 100%; height: 100%; object-fit: cover }
.rc-pic.ic { display: grid; place-items: center; color: var(--c); background: color-mix(in srgb, var(--c) 9%, #161b26) }
.rc-pic.ic svg { width: 2.8rem; height: 2.8rem }
@media print { .rc-pic { display: none !important } }
/* cards with a link list layout (topic guide people, an event page's links): the picture at the top right */
.wrap .tp-people a, .wrap .ev-rel a { position: relative; padding-right: 5rem }
.tp-people .rc-pic, .ev-rel .rc-pic { position: absolute; right: .7rem; top: .7rem; width: 3.6rem; height: 3.6rem; margin: 0; float: none }
.ev-rel .rc-pic.ic svg, .tp-people .rc-pic.ic svg { width: 2rem; height: 2rem }
/* a picture across the top of a card (trails, Mabinogion tales, lesson ideas) */
.card-ban { position: relative; display: block; overflow: hidden; aspect-ratio: 16 / 9; background: #141925; margin: -1.3rem -1.4rem .3rem }
.card-ban img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .6s var(--ease) }
a:hover > .card-ban img, .wl-card:hover > .card-ban img { transform: scale(1.04) }
.chap > .card-ban { margin: -1.5rem -1.4rem .2rem }
.mab-tale { overflow: hidden }
.mab-tale > .card-ban { margin: -1.3rem -1.4rem .3rem }
.lesson { overflow: hidden }
/* the news list: a small picture beside each line */
.news-item.has-pic a { grid-template-columns: 3.2rem 7.5rem minmax(0, 1fr) }
.news-list.big .news-item.has-pic a { grid-template-columns: 4rem 9rem minmax(0, 1fr) }
.n-pic { grid-row: 1 / span 2; width: 3.2rem; height: 3.2rem; border-radius: 10px; overflow: hidden; background: #141925; align-self: start }
.news-list.big .n-pic { width: 4rem; height: 4rem }
.n-pic img { display: block; width: 100%; height: 100%; object-fit: cover }
.news-item.has-pic .n-s { grid-column: 3 }
@media (max-width: 520px) { .news-item.has-pic a, .news-list.big .news-item.has-pic a { grid-template-columns: 3.2rem minmax(0, 1fr) } .news-item.has-pic .n-s { grid-column: 2 } .news-list.big .n-pic { width: 3.2rem; height: 3.2rem } }
@media print { .card-ban, .n-pic { display: none !important } }

/* The census chart card on the home page is one link to the long read on the revival (story-welsh-revival.html).
   On phones the whole chart fits the card (no sideways scroll under the link), with larger labels. */
.lang-chart-card { transition: box-shadow .25s }
.lang-chart-card:hover { box-shadow: 0 0 0 1px color-mix(in srgb, var(--dragon) 55%, transparent) }
.lang-chart-card .chart { overflow: visible }
@media (max-width: 640px) {
  .lang-chart-card .chart-wrap { overflow: visible }
  .lang-chart-card .chart { min-width: 0 !important }
  .lang-chart-card .chart text { font-size: 15px }
  .lang-chart-card .chart .val { font-size: 17px }
}
/* The same chart, larger, in the long read (revival_chart() in build.py) */
.rv-chart-fig { margin: 2rem 0; padding: 1.25rem 1.25rem 1rem; background: var(--slate); border: 1px solid var(--line); border-radius: 14px }
.rv-chart { overflow: visible; display: block }
.rv-chart .val { paint-order: stroke; stroke: var(--slate); stroke-width: 5px; stroke-linejoin: round }
.rv-chart .rv-mark { stroke: var(--gold, #e8b33a); stroke-width: 1.5; stroke-dasharray: 4 4; opacity: .7 }
.rv-chart .rv-num { fill: var(--gold, #e8b33a); stroke: none }
.rv-chart text.rv-k { fill: var(--night); font-weight: 700; font-size: 11px }
.rv-chart-fig figcaption { color: var(--muted); font-size: .9rem; margin-top: .75rem }
.rv-key { list-style: none; padding: 0; margin: 0 0 .5rem; display: flex; flex-wrap: wrap; gap: .35rem 1.25rem; color: var(--ink) }
.rv-key b { display: inline-grid; place-items: center; width: 1.4em; height: 1.4em; border-radius: 50%; background: var(--gold, #e8b33a); color: var(--night); font-size: .8em; margin-right: .3em }
@media (max-width: 640px) {
  .rv-chart-fig { padding: 1rem .75rem .75rem }
  .rv-chart text { font-size: 18px }
  .rv-chart .val { font-size: 19px }
  .rv-chart text.rv-k { font-size: 17px }
  .rv-chart .rv-num { r: 13px }
}

/* A darkened picture behind a timeline row that has no picture of its own (build.py row_bg, src/panels.py THEMES) */
.era-events li.has-bg { position: relative; isolation: isolate; padding: 1.1rem .95rem; margin: .45rem 0; border: 1px solid rgba(255,255,255,.12); border-radius: 16px; text-shadow: 0 1px 3px rgba(0,0,0,.65) }
.row-bg { position: absolute; inset: 0; z-index: -1; border-radius: inherit; overflow: hidden; pointer-events: none; background: #141925 }
.row-bg img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: center 35% }
.row-bg::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(12,15,22,.9) 0, rgba(12,15,22,.8) 55%, rgba(12,15,22,.62) 100%) }
.era-events li.has-bg p { color: rgba(255,255,255,.86) }
.era-events li.has-bg .row-pic.ic { background: rgba(12,15,22,.42); border-color: rgba(255,255,255,.18); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px) }
@media print { .row-bg { display: none !important } .era-events li.has-bg { text-shadow: none } }

/* ---------- Map page: find first (14 November 2026). Town search and the list of places sit above the map,
   the twelve age chips are one row to swipe on phones, and pins are easier to tap (app.js picks the nearest pin). ---------- */
.map-find { margin: clamp(1rem, 3vw, 1.4rem) 0 0; gap: .6rem; padding: clamp(.9rem, 2.5vw, 1.3rem) }
.map-find .near-form { align-items: center; max-width: 46rem }
.near-lbl { flex: 1 0 100%; font-family: var(--f-mono); font-size: .75rem; letter-spacing: .14em; text-transform: uppercase; color: var(--gold) }
.map-find .near-msg:empty { display: none }
.map-find .near-list { grid-template-columns: repeat(auto-fill, minmax(min(100%, 15rem), 1fr)); gap: .45rem }
.near-go.on { border-color: var(--ink); border-left-color: var(--c); background: var(--slate-2) }
.near-go b { font-weight: 600 }
.near-more { display: flex; flex-wrap: wrap; gap: .5rem }
.near-more .btn { padding: .5rem 1rem; font-size: .88rem }
#near-geo { border-color: var(--line) }
#map .map-legend { margin: 1rem 0 .6rem }
#map-box { scroll-margin-top: 4.5rem }
/* the card is a whole-card link (.wl-card sets position: relative), which pushed it 6rem down; keep it sticky beside the map on computers, and in place under it on phones */
#map .place-card.wl-card { position: sticky }
@media (max-width: 860px) {
  .map-find .near-form .btn { padding: .6rem 1rem }
  .map-find .near-form input { flex: 1 1 9rem; padding: .65rem 1rem }
  .near-go { padding: .5rem .8rem; gap: .1rem }
  .near-go span { font-size: .7rem }
  #map .place-card.wl-card { position: relative; top: auto }
  #map .map-legend { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; max-width: 100%; padding-block: 7px; margin: .7rem 0 .2rem; -webkit-mask-image: linear-gradient(90deg, #000 88%, transparent); mask-image: linear-gradient(90deg, #000 88%, transparent) }
  #map .map-legend::-webkit-scrollbar { display: none }
  #map .map-legend .chip { flex: none; font-size: .82rem; padding: .34rem .8rem }
  #map .map-legend .chip:last-child { margin-right: 2.5rem }
}
@media (pointer: coarse) {
  #pins .pin .dot { r: 9 }
  #pins .pin.sel .dot { r: 13 }
  #pins .pin .halo { r: 26 }
  #pins .pin .lbl { font-size: 21px; stroke-width: 6px }
}

/* ---------- long reads: contents, section links, "where am I" bar (November 2026; story_toc / head_ids in build.py) ---------- */
.prose h2[id] { scroll-margin-top: 5rem }
.h-link { margin-left: .45rem; font: 500 .7em var(--f-mono); color: var(--c); text-decoration: none; opacity: 0; transition: opacity .2s; vertical-align: .12em; padding: .1em .25em; border-radius: 6px }
.prose h2:hover .h-link, .h-link:focus-visible, .h-link.done { opacity: 1 }
@media (hover: none) { .h-link { opacity: .55 } }
.h-link.done::after { content: attr(data-done); margin-left: .4rem; font: 500 .75rem var(--f-mono); letter-spacing: .03em; color: var(--muted) }
.toc { margin: 0 0 2.2rem; border: 1px solid var(--line); border-left: 4px solid var(--c); border-radius: 0 16px 16px 0; background: var(--card); scroll-margin-top: 5rem }
.toc summary { list-style: none; cursor: pointer; display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: .2rem 1rem; padding: .85rem 1.1rem; min-height: 44px }
.toc summary::-webkit-details-marker { display: none }
.toc summary b { font: 600 .8rem var(--f-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--c) }
.toc summary b::after { content: "▾"; display: inline-block; margin-left: .5rem; transition: transform .2s }
.toc details:not([open]) summary b::after { transform: rotate(-90deg) }
.toc summary small { font: 500 .75rem var(--f-mono); color: var(--muted); letter-spacing: .03em }
.toc-list { margin: 0; padding: 0 1.1rem 1rem; list-style: none; counter-reset: toc; display: grid; gap: .1rem 1.6rem }
.toc-list.two { grid-template-columns: repeat(2, minmax(0, 1fr)) }
.toc-list li { counter-increment: toc; display: grid; grid-template-columns: 1.7rem minmax(0, 1fr); align-items: baseline }
.toc-list li::before { content: counter(toc, decimal-leading-zero); font: 500 .72rem var(--f-mono); color: var(--muted) }
.toc-list a { display: block; padding: .32rem 0; font-size: .95rem; line-height: 1.35; color: var(--ink); text-decoration: none }
.toc-list a:hover, .toc-list a:focus-visible { color: var(--c); text-decoration: underline; text-underline-offset: 3px }
.toc-list a.on { color: var(--c) }
@media (max-width: 640px) { .toc-list.two { grid-template-columns: 1fr } .toc-list a { padding: .55rem 0 } }
.toc-pill { position: fixed; left: max(16px, env(safe-area-inset-left, 0px)); bottom: calc(16px + env(safe-area-inset-bottom, 0px)); z-index: 24; max-width: min(26rem, calc(100vw - 32px - 3.6rem)); min-height: 2.9rem; display: flex; align-items: center; gap: .6rem; padding: .45rem 1rem .45rem .5rem; border-radius: 999px; border: 1px solid var(--line); background: rgba(21,26,37,.92); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); color: var(--ink); text-decoration: none; font-size: .88rem; animation: fade .3s both }
.toc-pill[hidden] { display: none }
.toc-pill .n { flex: none; display: grid; place-items: center; min-width: 2.6rem; height: 1.9rem; padding: 0 .4rem; border-radius: 999px; background: var(--c); color: #0c0f16; font: 600 .72rem var(--f-mono) }
.toc-pill .t { overflow: hidden; white-space: nowrap; text-overflow: ellipsis }
.toc-pill:hover { border-color: var(--ink) }
.s-grid.four { grid-template-columns: repeat(4, minmax(0, 1fr)) }
.s-grid.four .s-card h3 { font-size: 1.3rem }
@media (max-width: 1100px) { .s-grid.four { grid-template-columns: 1fr 1fr } }
@media (max-width: 560px) { .s-grid.four { grid-template-columns: 1fr } }
@media print { .toc-pill, .h-link { display: none !important } .toc { break-inside: avoid } .toc details > * { display: block } }
/* ---------- a shorter opening screen on computers, so "Twelve ages of Wales" shows when the page loads (Ifan, 14 Nov 2026) ---------- */
@media (min-width: 1100px) {
  .hero { min-height: 0 }
  .hero .wrap { padding-block: 1.9rem 1.6rem }
  .hero h1 { font-size: clamp(4.2rem, 8.6vw, 8.2rem) }
  .hero .sub { margin-top: 1.1rem; gap: .7rem; max-width: 52rem }
  .hero .sub p:first-child { font-size: clamp(1.4rem, 2.2vw, 1.75rem) }
  .hero .sub p + p { max-width: 50rem; font-size: 1rem; line-height: 1.55 }
  .begin { margin-top: 1.1rem }
  .begin .eyebrow { margin-bottom: .45rem }
  .begin-card { padding: .7rem 2.1rem .7rem .85rem }
  .begin-card .b-s { font-size: .82rem; line-height: 1.35 }
  .hero .ticker .wrap { padding-block: .65rem .85rem }
  .hero .ticker b { font-size: 1.9rem }
  .marquee { padding-block: .45rem .4rem }
  .marquee .track { font-size: 2.2rem }
  .marquee .track2 { font-size: 1.15rem }
  main.home > #chapters { padding-top: 2rem }
}
/* ---------- the map page on phones: a short opening, so "History near you" (Find, Use my location, List the places) shows sooner (site audit, November 2026) ---------- */
@media (max-width: 640px) {
  .map-hero.has-art .hero-art { height: 9rem }
  .map-hero.has-art .wrap { padding-block: 4.6rem .9rem; gap: .45rem }
  .map-hero .crumbs, .map-hero .span, .map-hero .lede-rest { display: none }
  .map-hero.has-art h1 { font-size: 2.3rem }
  .map-hero.has-art .lede { font-size: .95rem; line-height: 1.4 }
  .map-hero .more-row { margin: .15rem 0 0 }
  .map-hero .more-row .btn { padding: .45rem .95rem; font-size: .86rem; min-height: 44px }
  .map-hero .hero-credit { margin-top: .4rem; font-size: .68rem; line-height: 1.35 }
  .map-hero + main #map.page-top { padding-top: .9rem }
  .map-hero + main #map .seg { margin-bottom: .7rem }
}
/* ---------- On this day: home panel (#today-box, drawn by build.py ssr_today and app.js renderToday) ---------- */
.otd-box { display: grid; gap: 1rem; min-width: 0 }
/* the date over the picture of its first entry, washed in dragon red */
.otd-head { position: relative; isolation: isolate; overflow: hidden; border-radius: 18px; min-height: 8.5rem; padding: 1.1rem 1.2rem; display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; color: #fff;
  background: linear-gradient(135deg, #d43c34, #8e1f1a 75%); box-shadow: 0 18px 40px -26px rgba(226,69,61,.9) }
.otd-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; opacity: .5; mix-blend-mode: luminosity; filter: contrast(1.1) }
.otd-head::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(100deg, rgba(142,31,26,.92) 15%, rgba(190,50,44,.55) 60%, rgba(142,31,26,.35)) }
.otd-date { margin: 0; display: grid; grid-template-columns: auto 1fr; align-items: end; gap: 0 .7rem }
.otd-date .d { grid-row: 1 / 3; font: 400 clamp(3.6rem, 9vw, 4.6rem)/.82 var(--f-display); letter-spacing: -.02em; text-shadow: 0 4px 24px rgba(0,0,0,.3) }
.otd-date .m { font: 600 .82rem var(--f-mono); letter-spacing: .16em; text-transform: uppercase; align-self: end }
.otd-date .lab { font-size: .85rem; opacity: .92; align-self: start; min-height: 1.6em }
.otd-back { font: 600 .76rem var(--f-body); color: #fff; background: rgba(0,0,0,.25); border: 1px solid rgba(255,255,255,.4); border-radius: 999px; padding: .2rem .7rem; cursor: pointer }
.otd-nav { display: flex; gap: .45rem; flex: none }
.otd-nav button { width: 2.6rem; height: 2.6rem; border-radius: 50%; border: 1px solid rgba(255,255,255,.45); background: rgba(0,0,0,.2); color: #fff; font: 400 1.5rem/1 var(--f-display); cursor: pointer; display: grid; place-items: center; padding: 0 0 .15rem; transition: background .2s, transform .2s; backdrop-filter: blur(4px) }
.otd-nav button:hover, .otd-back:hover { background: rgba(0,0,0,.42) }
.otd-nav button:active { transform: scale(.92) }
/* a week of days to tap; a dot for each thing that happened on that day */
.otd-week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: .3rem }
.otd-wd { display: grid; justify-items: center; gap: .1rem; padding: .45rem 0 .4rem; border-radius: 12px; border: 1px solid transparent; background: rgba(255,255,255,.03); color: var(--muted); cursor: pointer; font: inherit; transition: background .2s, color .2s, border-color .2s }
.otd-wd .w { font: 600 .62rem var(--f-mono); letter-spacing: .08em; text-transform: uppercase }
.otd-wd .n { font: 400 1.25rem/1.1 var(--f-display); color: var(--ink) }
.otd-wd i { display: flex; gap: 2px; height: 4px }
.otd-wd i b { width: 4px; height: 4px; border-radius: 50%; background: var(--gold) }
.otd-wd:not(.has) .n { opacity: .45 }
.otd-wd:hover { background: rgba(255,255,255,.07) }
.otd-wd.is-today { border-color: rgba(226,69,61,.55) }
.otd-wd.on { background: var(--ink); color: var(--night); border-color: var(--ink) }
.otd-wd.on .n { color: var(--night); opacity: 1 } .otd-wd.on i b { background: var(--dragon) }
.otd-near { color: var(--muted); font-size: .9rem; font-style: italic; margin: 0 0 .2rem }
/* each entry: picture, when, title and a line; the whole row is a link */
.otd-body { display: grid; gap: .6rem }
.otd-rows { list-style: none; margin: 0; padding: 0; display: grid; gap: .55rem }
.otd-row { display: grid; grid-template-columns: 4.4rem minmax(0, 1fr); gap: .9rem; align-items: start; padding: .6rem; border-radius: 16px; background: rgba(255,255,255,.035); border: 1px solid var(--line); transition: background .25s, border-color .25s, transform .25s var(--ease) }
.otd-row:hover { background: rgba(255,255,255,.06); border-color: color-mix(in srgb, var(--c) 55%, var(--line)) }
.otd-row:active { transform: scale(.985) }
.otd-pic { width: 4.4rem; height: 4.4rem; border-radius: 12px; overflow: hidden; background: color-mix(in srgb, var(--c) 30%, var(--slate)); box-shadow: inset 0 0 0 1px rgba(255,255,255,.08) }
.otd-pic img { width: 100%; height: 100%; object-fit: cover; display: block }
/* an entry with no picture of its own: a small drawing (born, died, feast day, tradition, or its age), never a stock photo */
.otd-ic { display: grid; place-items: center; color: color-mix(in srgb, var(--c) 75%, #fff) }
.otd-ic svg { width: 58%; height: 58% }
.otd-txt { min-width: 0; padding-top: .1rem }
.otd-meta { display: flex; flex-wrap: wrap; align-items: center; gap: .2rem .5rem; margin: 0 0 .2rem; font: 600 .75rem var(--f-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted) }
.otd-meta .y { font: 400 1.05rem/1 var(--f-display); letter-spacing: 0; color: var(--c) }
.otd-meta .dt { color: var(--ink) }
.otd-meta .k { border: 1px solid color-mix(in srgb, var(--c) 45%, transparent); color: color-mix(in srgb, var(--c) 70%, var(--ink)); border-radius: 999px; padding: .08rem .45rem }
.otd-txt h3 { font: 700 1.04rem/1.25 var(--f-body); margin: 0 0 .15rem; color: var(--ink) }
.otd-txt p:last-child { color: var(--muted); font-size: .9rem; line-height: 1.45; margin: 0 }
.otd-more { justify-self: start; font: 600 .85rem var(--f-body); color: var(--ink); background: none; border: 1px dashed var(--line); border-radius: 999px; padding: .35rem .9rem; cursor: pointer }
.otd-more:hover { border-color: var(--muted) }
/* the whole year: a wide button with the number of dates */
.otd-year { display: flex; align-items: center; gap: .9rem; padding: .7rem .9rem .7rem .7rem; border-radius: 16px; text-decoration: none; color: var(--ink); background: linear-gradient(120deg, rgba(232,198,90,.12), rgba(232,198,90,.03)); border: 1px solid rgba(232,198,90,.3); transition: border-color .25s, background .25s }
.otd-year:hover { border-color: var(--gold); background: linear-gradient(120deg, rgba(232,198,90,.2), rgba(232,198,90,.05)) }
.otd-year .ic { width: 3rem; height: 3rem; flex: none; border-radius: 10px; background: var(--gold); color: var(--night); display: grid; place-items: center; position: relative; padding-top: .5rem; font: 400 1.05rem/1 var(--f-display) }
.otd-year .ic::before { content: ""; position: absolute; inset: 0 0 auto; height: .65rem; border-radius: 10px 10px 0 0; background: var(--dragon) }
.otd-year .t { display: grid; flex: 1; min-width: 0 }
.otd-year .t b { font-size: 1rem } .otd-year .t small { color: var(--muted); font-size: .84rem }
.otd-year .ar { font-size: 1.3rem; color: var(--gold); transition: transform .25s }
.otd-year:hover .ar { transform: translateX(4px) }

/* ---------- onthisday.html ---------- */
.otd-list .when { display: grid; gap: .15rem; align-content: start; margin: 0 }
.otd-list .when .y { font-family: var(--f-display); font-size: 1.6rem; line-height: 1; color: var(--c) }
.otd-list .when .k { font: 600 .75rem var(--f-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted) }
.otd-list h4 a { color: inherit; text-decoration: none; padding-block: 3px; background: linear-gradient(currentColor, currentColor) 0 100% / 0 1px no-repeat; transition: background-size .3s }
.otd-list h4 a:hover { background-size: 100% 1px }

.otd-jump { padding-block: 1rem 0 !important }
.otd-chips { display: flex; flex-wrap: nowrap; gap: .4rem; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px }
.otd-chips::-webkit-scrollbar { display: none }
.otd-chips .chip { text-decoration: none; flex: none }
.otd-chips .chip.solid { background: var(--ink); color: var(--night); border-color: var(--ink); font-weight: 700 }
.otd-month { padding-block: clamp(1.6rem, 4vw, 2.6rem) 0 }
.otd-month:last-of-type { padding-bottom: clamp(2.5rem, 6vw, 4rem) }
.otd-month, .otd-day { scroll-margin-top: 6rem }
.otd-days { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 21rem), 1fr)); gap: 1rem; align-items: start }
.otd-day { border: 1px solid var(--line); border-radius: var(--r, 16px); background: var(--card); padding: 1.1rem 1.2rem 1.2rem }
.otd-day h3 { display: flex; align-items: baseline; gap: .55rem; font: 600 .78rem var(--f-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-bottom: .8rem }
.otd-day h3 .dn { font: 400 2.4rem/1 var(--f-display); letter-spacing: 0; color: var(--ink) }
.otd-day.is-today { border-color: var(--dragon, #e2453d); box-shadow: 0 0 0 1px var(--dragon, #e2453d), 0 20px 40px -24px rgba(226,69,61,.7) }
.otd-day.is-today h3::after { content: "Today"; margin-left: auto; font-size: .75rem; color: #fff; background: var(--dragon, #e2453d); border-radius: 999px; padding: .2rem .6rem }
html.cy .otd-day.is-today h3::after { content: "Heddiw" }
.otd-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .9rem }
.otd-list li { display: grid; grid-template-columns: 4.4rem minmax(0,1fr); gap: .8rem; align-items: baseline }
.otd-list li + li { border-top: 1px solid var(--line); padding-top: .9rem }
.otd-list h4 { font: 700 1rem/1.3 var(--f-body); margin: 0 0 .2rem }
.otd-list li p { color: var(--muted); font-size: .92rem; margin: 0 }
/* the long Llanfair… place name in "Did you know?" must wrap instead of running off the card */
.b-fact .fact { overflow-wrap: anywhere }
/* today.html: the daily picture to share */
.otd-share { margin: .9rem 0 0 } .otd-share a { color: var(--gold); font-weight: 600 }
.today-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr)); gap: 1.6rem }
.today-fig { margin: 0; display: grid; gap: 1rem; align-content: start }
.today-fig img { width: 100%; height: auto; border-radius: 14px; border: 1px solid var(--line); box-shadow: 0 24px 60px -30px rgba(0,0,0,.7) }
.today-fig figcaption { display: grid; gap: .6rem }
.today-fig .eyebrow { margin: 0 }
.today-fig textarea { width: 100%; resize: vertical; background: var(--card); color: var(--ink); border: 1px solid var(--line); border-radius: 12px; padding: .8rem .9rem; font: 400 .92rem/1.5 var(--f-body) }
.today-fig .more-row { margin: 0 }
/* 366 days on one page: only the days near the screen are laid out and painted (content-visibility); a link to #d-11-13 still lands on the day */
@supports (content-visibility: auto) { .otd-day { content-visibility: auto; contain-intrinsic-size: auto 250px } }
/* a picture on every row (Ifan, 13 November 2026): the same picture as the home page panel, small copy */
.otd-list li.has-pic { grid-template-columns: 4.4rem minmax(0,1fr) 3.6rem; align-items: start }
.otd-list .otd-rp { width: 3.6rem; height: 3.6rem; border-radius: 10px }
/* rows with a picture behind them (src/panels.py): the drawing tile sits on the picture like frosted glass */
.otd-row.pbg { border-color: rgba(255,255,255,.14) }
.otd-row.pbg .otd-ic { background: rgba(12,15,22,.42); box-shadow: inset 0 0 0 1px rgba(255,255,255,.18); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px) }
.otd-row.pbg .otd-txt p:last-child { color: rgba(255,255,255,.86) }
.otd-year.pbg, html body .otd-year { border-color: rgba(232,198,90,.45) }
/* More famous people (src/people2.py): field filter, firsts tags and badges, firsts.html */
.people-field { margin-top: .8rem }
.people-field .chip { font-size: .8rem; padding: .3rem .8rem }
.people-field .chip.star { border-color: rgba(232, 198, 90, .55); color: #e8c65a }
.people-field .chip.star[aria-pressed="true"] { background: #e8c65a; color: var(--night); border-color: #e8c65a }
.firsts-banner { display: flex; flex-wrap: wrap; gap: .4rem 1rem; align-items: baseline; margin-top: 1.4rem; padding: .9rem 1.1rem; border: 1px solid rgba(232, 198, 90, .45); border-radius: 12px; background: linear-gradient(120deg, rgba(232, 198, 90, .12), rgba(232, 198, 90, .03)) }
.firsts-banner b { font-family: var(--f-display); font-weight: 400; font-size: 1.15rem; color: #e8c65a }
.firsts-banner span { color: var(--muted); font-size: .92rem; flex: 1 1 18rem }
.firsts-banner a { color: #e8c65a; white-space: nowrap; font-weight: 600 }
.plaque .first-tag { font-size: .8rem; line-height: 1.4; color: #e8c65a }
.first-badge { display: block; max-width: 46rem; margin: 0 0 1.4rem; padding: .8rem 1rem; border: 1px solid rgba(232, 198, 90, .5); border-radius: 10px; background: rgba(232, 198, 90, .08); color: var(--ink); text-decoration: none; line-height: 1.5 }
.first-badge b { color: #e8c65a; margin-right: .35rem; font-weight: 600 }
.first-badge:hover { border-color: #e8c65a }
.firsts-count { display: flex; flex-wrap: wrap; gap: .6rem 2rem; margin: 1rem 0 }
.firsts-count span { color: var(--muted) }
.firsts-count b { font-family: var(--f-display); font-weight: 400; font-size: 2.2rem; color: #e8c65a; margin-right: .3rem; vertical-align: -.15rem }
.firsts-filter { margin-top: 1.4rem }
.firsts { display: grid; grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr)); gap: 1rem; margin-top: 1.4rem }
.first-card { position: relative; display: grid; gap: .7rem; align-content: start; padding: 1.1rem 1.15rem 1.2rem; border: 1px solid #333c50; border-radius: 8px; background: linear-gradient(160deg, #262d3d, #1b2130 60%, #171c28); color: var(--ink); text-decoration: none; min-width: 0; transition: border-color .2s, transform .2s }
.first-card:hover { border-color: #e8c65a; transform: translateY(-2px) }
.first-card[hidden] { display: none }
.first-card::after { content: ""; position: absolute; left: 1.15rem; top: 0; width: 2.2rem; height: 3px; background: var(--c, #e8c65a) }
.first-card .fy { font-family: var(--f-display); font-size: 1.9rem; line-height: 1; color: #e8c65a; font-variant-numeric: tabular-nums }
.first-card .who { display: flex; gap: .7rem; align-items: center; min-width: 0 }
.first-card .who > span:last-child { display: grid; min-width: 0 }
.first-card .who b { font-weight: 600; font-size: 1rem }
.first-card .who small { color: var(--muted); font-size: .8rem }
.first-card .what { font-size: .95rem; line-height: 1.5; color: var(--ink) }
.first-card .ava { position: relative; flex: none; width: 2.6rem; height: 2.6rem; border-radius: 50%; overflow: hidden; display: grid; place-items: center; background: #2e3647; color: #e8c65a; font: 600 .85rem var(--f-body) }
.first-card .ava img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover }
.first-card.place .ava { font-size: 1.1rem }
@media print { .first-card { break-inside: avoid; border-color: #999 } .firsts-filter { display: none } }
.first-row { display: flex; align-items: center; gap: .5rem; max-width: 46rem; margin: 0 0 1.4rem }
.first-row .first-badge { margin: 0; flex: 1 }
.first-src { flex: none }
/* 517 cards on one page: the browser lays out and paints only the ones near the screen (content-visibility).
   "auto 340px" is the space a card keeps until it is first drawn; after that the browser remembers its real height. */
@supports (content-visibility: auto) { #people-grid .plaque { content-visibility: auto; contain-intrinsic-size: auto 340px } }
/* ---------- the weekly quiz (weekly-quiz.html, src/static/weekly.js) ---------- */
.wq { min-height: 22rem }
.wq-card { background: var(--slate); border: 1px solid var(--line); border-radius: 18px; padding: clamp(1.1rem, 4vw, 2rem); margin: 0 0 1.5rem }
.wq-card h2, .wq-card h3 { font-family: var(--f-display); font-weight: 400; line-height: 1.15; margin: .2rem 0 .8rem }
.wq-card h2 { font-size: clamp(1.9rem, 5vw, 2.6rem) }
.wq-card .q-top { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; font: 500 .78rem var(--f-mono); color: var(--muted) }
.wq-card .q-bar { height: 4px; background: var(--line); border-radius: 2px; overflow: hidden; margin: .5rem 0 1.1rem }
.wq-card .q-bar i { display: block; height: 100%; background: var(--e-glyndwr); transition: width .4s }
.wq-kind { color: var(--e-glyndwr); margin: 0 0 .4rem }
.wq-h { font-size: clamp(1.35rem, 4vw, 1.75rem) }
.wq-t { font-weight: 700; font-size: 1.12rem; margin: -.3rem 0 .4rem }
.wq-c { color: var(--muted); margin: 0 0 1.1rem }
.wq-ph { margin: 0 0 1rem; border-radius: 14px; overflow: hidden; background: var(--night) }
.wq-ph img { display: block; width: 100%; aspect-ratio: 3 / 2; object-fit: cover }
.wq-ph figcaption { font-size: .78rem; color: var(--muted); padding: .45rem .8rem }
.wq-ph figcaption a { color: inherit }
.wq-ans button { min-height: 3.2rem }
.wq-fb { margin-top: 1rem }
.wq-x { display: grid; gap: .9rem; background: var(--night); border: 1px solid var(--line); border-radius: 14px; padding: .9rem 1rem }
.wq-x.has-pic { grid-template-columns: 92px 1fr; align-items: start }
.wq-x img { width: 92px; height: 92px; object-fit: cover; border-radius: 10px; display: block }
.wq-x p { margin: 0 0 .35rem }
.wq-x p:last-child { margin: 0; color: var(--muted) }
@media (max-width: 420px) { .wq-x.has-pic { grid-template-columns: 64px 1fr } .wq-x img { width: 64px; height: 64px } }
.wq-facts { list-style: none; padding: 0; margin: 0 0 1rem; display: flex; flex-wrap: wrap; gap: .6rem }
.wq-facts li { background: var(--night); border: 1px solid var(--line); border-radius: 999px; padding: .35rem .9rem .35rem .4rem; display: flex; align-items: center; gap: .55rem; font-size: .95rem }
.wq-facts b { display: inline-grid; place-items: center; min-width: 1.9rem; height: 1.9rem; border-radius: 50%; background: var(--e-glyndwr); color: var(--night); font-family: var(--f-mono) }
.wq-res { text-align: center }
.wq-res .q-score { font-family: var(--f-display); font-size: clamp(4rem, 14vw, 6.5rem); line-height: .9; color: var(--e-glyndwr); margin: .4rem 0 .2rem }
.wq-res .q-score small { font-size: .4em; color: var(--muted) }
.wq-sq { font-size: 1.3rem; letter-spacing: .1em; margin: 0 0 .6rem }
.wq-time { font-family: var(--f-mono); color: var(--muted) }
.wq-time b { color: var(--ink) }
.wq-btns { display: flex; flex-wrap: wrap; gap: .6rem; justify-content: center }
.wq-next-week { color: var(--muted); font-size: .95rem }
.wq-join { text-align: left; border-top: 1px solid var(--line); margin-top: 1.2rem; padding-top: 1.2rem }
.wq-form label { display: block; font-weight: 700; margin-bottom: .5rem }
.wq-row { display: flex; gap: .6rem; flex-wrap: wrap }
.wq-row input { flex: 1 1 12rem; min-width: 0; min-height: 48px; font: inherit; color: var(--ink); background: var(--night); border: 1px solid var(--line); border-radius: 999px; padding: .6rem 1.1rem }
.wq-row input:focus { outline: 2px solid var(--e-glyndwr); outline-offset: 2px }
.wq-note { font-size: .85rem; color: var(--muted); margin: .6rem 0 0 }
.wq-note a { color: inherit }
.wq-err { color: var(--dragon); margin: .4rem 0 0; min-height: 1.2em }
.wq-on { margin: 0; text-align: center }
.wq-msg { color: var(--muted) }
.wq-board, .wq-past, .wq-review { margin: 0 0 2rem }
.wq-sub { color: var(--muted); margin: -.4rem 0 1rem }
.wq-lb { list-style: none; padding: 0; margin: 0; border: 1px solid var(--line); border-radius: 14px; overflow: hidden }
.wq-lb li { display: grid; grid-template-columns: 2.6rem 1fr auto 3.6rem; gap: .6rem; align-items: center; padding: .65rem 1rem; border-top: 1px solid var(--line); background: var(--slate) }
.wq-lb li:first-child { border-top: 0 }
.wq-lb .r { font: 700 .95rem var(--f-mono); color: var(--muted) }
.wq-lb .n { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600 }
.wq-lb .s, .wq-lb .t { font-family: var(--f-mono); font-size: .92rem; text-align: right }
.wq-lb .t { color: var(--muted) }
.wq-lb .m1 .r { color: var(--e-kings) } .wq-lb .m2 .r { color: #c9cfd8 } .wq-lb .m3 .r { color: var(--e-ancient) }
.wq-lb li.me { background: color-mix(in srgb, var(--e-glyndwr) 18%, var(--slate)) }
.wq-lb li.gap { border-top: 2px dashed var(--line) }
.wq-last { margin-top: 1.2rem }
.wq-last ol { list-style: none; padding: 0; margin: 0; display: grid; gap: .4rem }
.wq-last li { display: flex; gap: .6rem; align-items: center }
.wq-last .s { margin-left: auto; font-family: var(--f-mono); color: var(--muted); font-size: .9rem }
.wq-review ol { list-style: none; padding: 0; margin: 0; display: grid; gap: .5rem }
.wq-review li { display: grid; grid-template-columns: 1.8rem 1fr; gap: .5rem; background: var(--slate); border: 1px solid var(--line); border-radius: 14px; padding: .75rem 1rem }
.wq-review li.wl-card:hover { border-color: var(--muted) }
.wq-review .m { font-weight: 700; font-size: 1.1rem }
.wq-review .ok .m { color: var(--e-modern) } .wq-review .no .m { color: var(--dragon) }
.wq-review p { margin: 0 } .wq-review .q { color: var(--muted); font-size: .92rem }
.wq-review s { color: var(--muted) }
.wq-weeks { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr)); gap: .6rem }
.wq-weeks button { width: 100%; text-align: left; font: inherit; color: var(--ink); background: var(--slate); border: 1px solid var(--line); border-radius: 14px; padding: .75rem 1rem; cursor: pointer; display: grid; gap: .1rem; min-height: 48px }
.wq-weeks button:hover { border-color: var(--muted) }
.wq-weeks span { color: var(--muted); font-size: .88rem }
.wq-weeks i { font-style: normal; font-family: var(--f-mono); color: var(--e-glyndwr); font-size: .85rem }
.wq-how { margin: 0 0 1.5rem; color: var(--muted) }
.wq-how summary { cursor: pointer; color: var(--ink); font-weight: 600; min-height: 44px; display: flex; align-items: center }
/* picture backgrounds for plain panels (src/panels.py) */
html body .lang-grid > .panel:not(.decoder){--pbg:url('legends/iaith-1966-s.webp')}
html body .panel.decoder{--pbg:url('photos/the-james-pringle-weavers-shop-in-llanfa-446147-s.webp')}
html body .wotd{--pbg:url('gallery/land-brecon-beacons-s.webp')}
html body .lang-words{--pbg:url('gallery/trea-black-book-s.webp')}
html body .b-fact{--pbg:url('gallery/trea-red-book-s.webp')}
html body .news-box{--pbg:url('gallery/land-three-cliffs-s.webp')}
html body .reading{--pbg:url('gallery/trea-bible-1588-s.webp')}
html body .tl-band{--pbg:url('gallery/land-yr-wyddfa-s.webp')}
html body .otd-year{--pbg:url('gallery/anci-gors-fawr-s.webp')}
html body .refs{--pbg:url('gallery/trea-red-book-s.webp')}
html body .further{--pbg:url('gallery/trea-red-book-s.webp')}
html body .note-box{--pbg:url('gallery/trea-laws-hywel-s.webp')}
html body .behind{--pbg:url('gallery/trea-red-book-s.webp')}
html body .just-added{--pbg:url('gallery/land-strumble-s.webp')}
html body .sm-card{--pbg:url('gallery/holy-st-davids-bishops-s.webp')}
html body .today-card{--pbg:url('gallery/holy-pennant-melangell-s.webp')}
html body .ll-out{--pbg:url('gallery/holy-llangelynnin-s.webp')}
html body .cm-card{--pbg:url('gallery/cast-carreg-cennen-s.webp')}
html body .near{--pbg:url('gallery/land-yr-wyddfa-s.webp')}
html body .g-root{--pbg:url('gallery/anci-llys-rhosyr-s.webp')}
html body .game-box{--pbg:url('gallery/anci-llys-rhosyr-s.webp')}
html body .quiz{--pbg:url('gallery/anci-llys-rhosyr-s.webp')}
html body .tw-dec{--pbg:url('photos/the-james-pringle-weavers-shop-in-llanfa-446147-s.webp')}
html body .sheet-print{--pbg:url('gallery/buil-old-college-s.webp')}
html body .pk-source{--pbg:url('gallery/trea-pennal-letter-s.webp')}
html body .pk-list{--pbg:url('gallery/buil-old-college-s.webp')}
html body .about-facts{--pbg:url('gallery/buil-old-college-s.webp')}
html body .fix-box{--pbg:url('gallery/trea-pennal-letter-s.webp')}
html body .cyng{--pbg:url('gallery/trea-book-taliesin-s.webp')}
html body .lw-quiz{--pbg:url('gallery/trea-laws-hywel-s.webp')}
html body .lw-words{--pbg:url('gallery/trea-laws-hywel-s.webp')}
html body .lw-worth{--pbg:url('gallery/place-hendygwyn-s.webp')}
html body .lw-dates{--pbg:url('gallery/place-hendygwyn-s.webp')}
html body .cyw-week{--pbg:url('gallery/land-llyn-tegid-s.webp')}
html body .letters{--pbg:url('gallery/trea-black-book-s.webp')}
html body .ref-big-search{--pbg:url('gallery/trea-red-book-s.webp')}
html body .phr > li:nth-child(12n+1){--pbg:url('t/gallery-land-yr-wyddfa.webp')}
html body .phr > li:nth-child(12n+2){--pbg:url('t/gallery-land-brecon-beacons.webp')}
html body .phr > li:nth-child(12n+3){--pbg:url('t/gallery-land-cadair-idris.webp')}
html body .phr > li:nth-child(12n+4){--pbg:url('t/gallery-land-llyn-y-fan.webp')}
html body .phr > li:nth-child(12n+5){--pbg:url('t/gallery-land-tryfan.webp')}
html body .phr > li:nth-child(12n+6){--pbg:url('t/gallery-land-three-cliffs.webp')}
html body .phr > li:nth-child(12n+7){--pbg:url('t/gallery-land-llyn-idwal.webp')}
html body .phr > li:nth-child(12n+8){--pbg:url('t/gallery-land-pen-y-fan.webp')}
html body .phr > li:nth-child(12n+9){--pbg:url('t/gallery-land-worms-head.webp')}
html body .phr > li:nth-child(12n+10){--pbg:url('t/gallery-land-llyn-tegid.webp')}
html body .phr > li:nth-child(12n+11){--pbg:url('t/gallery-land-strumble.webp')}
html body .phr > li:nth-child(12n+12){--pbg:url('t/gallery-land-barafundle.webp')}
html body .ms-lib:nth-child(8n+1){--pbg:url('gallery/trea-red-book-s.webp')}
html body .ms-lib:nth-child(8n+2){--pbg:url('gallery/trea-black-book-s.webp')}
html body .ms-lib:nth-child(8n+3){--pbg:url('gallery/trea-book-aneirin-s.webp')}
html body .ms-lib:nth-child(8n+4){--pbg:url('gallery/trea-book-taliesin-s.webp')}
html body .ms-lib:nth-child(8n+5){--pbg:url('gallery/trea-laws-hywel-s.webp')}
html body .ms-lib:nth-child(8n+6){--pbg:url('gallery/trea-bible-1588-s.webp')}
html body .ms-lib:nth-child(8n+7){--pbg:url('gallery/trea-pennal-letter-s.webp')}
html body .ms-lib:nth-child(8n+8){--pbg:url('gallery/trea-st-chad-s.webp')}
html body .lit-q:nth-child(8n+1){--pbg:url('gallery/trea-red-book-s.webp')}
html body .lit-q:nth-child(8n+2){--pbg:url('gallery/trea-black-book-s.webp')}
html body .lit-q:nth-child(8n+3){--pbg:url('gallery/trea-book-aneirin-s.webp')}
html body .lit-q:nth-child(8n+4){--pbg:url('gallery/trea-book-taliesin-s.webp')}
html body .lit-q:nth-child(8n+5){--pbg:url('gallery/trea-laws-hywel-s.webp')}
html body .lit-q:nth-child(8n+6){--pbg:url('gallery/trea-bible-1588-s.webp')}
html body .lit-q:nth-child(8n+7){--pbg:url('gallery/trea-pennal-letter-s.webp')}
html body .lit-q:nth-child(8n+8){--pbg:url('gallery/trea-st-chad-s.webp')}
html body .tri:nth-child(8n+1){--pbg:url('t/gallery-trea-red-book.webp')}
html body .tri:nth-child(8n+2){--pbg:url('t/gallery-trea-black-book.webp')}
html body .tri:nth-child(8n+3){--pbg:url('t/gallery-trea-book-aneirin.webp')}
html body .tri:nth-child(8n+4){--pbg:url('t/gallery-trea-book-taliesin.webp')}
html body .tri:nth-child(8n+5){--pbg:url('t/gallery-trea-laws-hywel.webp')}
html body .tri:nth-child(8n+6){--pbg:url('t/gallery-trea-bible-1588.webp')}
html body .tri:nth-child(8n+7){--pbg:url('t/gallery-trea-pennal-letter.webp')}
html body .tri:nth-child(8n+8){--pbg:url('t/gallery-trea-st-chad.webp')}
html body .cal-m:nth-child(12n+1){--pbg:url('t/gallery-holy-st-davids-bishops.webp')}
html body .cal-m:nth-child(12n+2){--pbg:url('t/gallery-holy-pennant-melangell.webp')}
html body .cal-m:nth-child(12n+3){--pbg:url('t/gallery-holy-llangelynnin.webp')}
html body .cal-m:nth-child(12n+4){--pbg:url('t/gallery-holy-penmon.webp')}
html body .cal-m:nth-child(12n+5){--pbg:url('t/gallery-holy-valle-crucis.webp')}
html body .cal-m:nth-child(12n+6){--pbg:url('t/gallery-holy-st-govans.webp')}
html body .cal-m:nth-child(12n+7){--pbg:url('t/gallery-holy-talley.webp')}
html body .cal-m:nth-child(12n+8){--pbg:url('t/gallery-holy-llanbadarn.webp')}
html body .cal-m:nth-child(12n+9){--pbg:url('t/gallery-holy-margam.webp')}
html body .cal-m:nth-child(12n+10){--pbg:url('t/gallery-holy-cwmhir.webp')}
html body .cal-m:nth-child(12n+11){--pbg:url('t/gallery-holy-basingwerk.webp')}
html body .cal-m:nth-child(12n+12){--pbg:url('t/gallery-holy-soar-y-mynydd.webp')}
html body .mut:nth-child(12n+1){--pbg:url('gallery/holy-st-davids-bishops-s.webp')}
html body .mut:nth-child(12n+2){--pbg:url('gallery/holy-pennant-melangell-s.webp')}
html body .mut:nth-child(12n+3){--pbg:url('gallery/holy-llangelynnin-s.webp')}
html body .mut:nth-child(12n+4){--pbg:url('gallery/holy-penmon-s.webp')}
html body .mut:nth-child(12n+5){--pbg:url('gallery/holy-valle-crucis-s.webp')}
html body .mut:nth-child(12n+6){--pbg:url('gallery/holy-st-govans-s.webp')}
html body .mut:nth-child(12n+7){--pbg:url('gallery/holy-talley-s.webp')}
html body .mut:nth-child(12n+8){--pbg:url('gallery/holy-llanbadarn-s.webp')}
html body .mut:nth-child(12n+9){--pbg:url('gallery/holy-margam-s.webp')}
html body .mut:nth-child(12n+10){--pbg:url('gallery/holy-cwmhir-s.webp')}
html body .mut:nth-child(12n+11){--pbg:url('gallery/holy-basingwerk-s.webp')}
html body .mut:nth-child(12n+12){--pbg:url('gallery/holy-soar-y-mynydd-s.webp')}
html body .cm-feat:nth-child(12n+1){--pbg:url('t/gallery-cast-carreg-cennen.webp')}
html body .cm-feat:nth-child(12n+2){--pbg:url('t/gallery-cast-dolwyddelan.webp')}
html body .cm-feat:nth-child(12n+3){--pbg:url('t/gallery-cast-criccieth.webp')}
html body .cm-feat:nth-child(12n+4){--pbg:url('t/gallery-cast-dinas-bran.webp')}
html body .cm-feat:nth-child(12n+5){--pbg:url('t/gallery-cast-castell-coch.webp')}
html body .cm-feat:nth-child(12n+6){--pbg:url('t/gallery-cast-kidwelly.webp')}
html body .cm-feat:nth-child(12n+7){--pbg:url('t/gallery-cast-cilgerran.webp')}
html body .cm-feat:nth-child(12n+8){--pbg:url('t/gallery-cast-llansteffan.webp')}
html body .cm-feat:nth-child(12n+9){--pbg:url('t/gallery-cast-powis.webp')}
html body .cm-feat:nth-child(12n+10){--pbg:url('t/gallery-cast-denbigh.webp')}
html body .cm-feat:nth-child(12n+11){--pbg:url('t/gallery-cast-white-castle.webp')}
html body .cm-feat:nth-child(12n+12){--pbg:url('t/gallery-cast-dryslwyn.webp')}
html body .author:nth-child(8n+1){--pbg:url('t/gallery-trea-red-book.webp')}
html body .author:nth-child(8n+2){--pbg:url('t/gallery-trea-black-book.webp')}
html body .author:nth-child(8n+3){--pbg:url('t/gallery-trea-book-aneirin.webp')}
html body .author:nth-child(8n+4){--pbg:url('t/gallery-trea-book-taliesin.webp')}
html body .author:nth-child(8n+5){--pbg:url('t/gallery-trea-laws-hywel.webp')}
html body .author:nth-child(8n+6){--pbg:url('t/gallery-trea-bible-1588.webp')}
html body .author:nth-child(8n+7){--pbg:url('t/gallery-trea-pennal-letter.webp')}
html body .author:nth-child(8n+8){--pbg:url('t/gallery-trea-st-chad.webp')}
html body .lw-off:nth-child(8n+1){--pbg:url('t/gallery-trea-red-book.webp')}
html body .lw-off:nth-child(8n+2){--pbg:url('t/gallery-trea-black-book.webp')}
html body .lw-off:nth-child(8n+3){--pbg:url('t/gallery-trea-book-aneirin.webp')}
html body .lw-off:nth-child(8n+4){--pbg:url('t/gallery-trea-book-taliesin.webp')}
html body .lw-off:nth-child(8n+5){--pbg:url('t/gallery-trea-laws-hywel.webp')}
html body .lw-off:nth-child(8n+6){--pbg:url('t/gallery-trea-bible-1588.webp')}
html body .lw-off:nth-child(8n+7){--pbg:url('t/gallery-trea-pennal-letter.webp')}
html body .lw-off:nth-child(8n+8){--pbg:url('t/gallery-trea-st-chad.webp')}
html body .pk-box:nth-child(12n+1){--pbg:url('t/gallery-land-yr-wyddfa.webp')}
html body .pk-box:nth-child(12n+2){--pbg:url('t/gallery-land-brecon-beacons.webp')}
html body .pk-box:nth-child(12n+3){--pbg:url('t/gallery-land-cadair-idris.webp')}
html body .pk-box:nth-child(12n+4){--pbg:url('t/gallery-land-llyn-y-fan.webp')}
html body .pk-box:nth-child(12n+5){--pbg:url('t/gallery-land-tryfan.webp')}
html body .pk-box:nth-child(12n+6){--pbg:url('t/gallery-land-three-cliffs.webp')}
html body .pk-box:nth-child(12n+7){--pbg:url('t/gallery-land-llyn-idwal.webp')}
html body .pk-box:nth-child(12n+8){--pbg:url('t/gallery-land-pen-y-fan.webp')}
html body .pk-box:nth-child(12n+9){--pbg:url('t/gallery-land-worms-head.webp')}
html body .pk-box:nth-child(12n+10){--pbg:url('t/gallery-land-llyn-tegid.webp')}
html body .pk-box:nth-child(12n+11){--pbg:url('t/gallery-land-strumble.webp')}
html body .pk-box:nth-child(12n+12){--pbg:url('t/gallery-land-barafundle.webp')}
html body .ref-desk > a:nth-child(12n+1){--pbg:url('t/gallery-land-yr-wyddfa.webp')}
html body .ref-desk > a:nth-child(12n+2){--pbg:url('t/gallery-land-brecon-beacons.webp')}
html body .ref-desk > a:nth-child(12n+3){--pbg:url('t/gallery-land-cadair-idris.webp')}
html body .ref-desk > a:nth-child(12n+4){--pbg:url('t/gallery-land-llyn-y-fan.webp')}
html body .ref-desk > a:nth-child(12n+5){--pbg:url('t/gallery-land-tryfan.webp')}
html body .ref-desk > a:nth-child(12n+6){--pbg:url('t/gallery-land-three-cliffs.webp')}
html body .ref-desk > a:nth-child(12n+7){--pbg:url('t/gallery-land-llyn-idwal.webp')}
html body .ref-desk > a:nth-child(12n+8){--pbg:url('t/gallery-land-pen-y-fan.webp')}
html body .ref-desk > a:nth-child(12n+9){--pbg:url('t/gallery-land-worms-head.webp')}
html body .ref-desk > a:nth-child(12n+10){--pbg:url('t/gallery-land-llyn-tegid.webp')}
html body .ref-desk > a:nth-child(12n+11){--pbg:url('t/gallery-land-strumble.webp')}
html body .ref-desk > a:nth-child(12n+12){--pbg:url('t/gallery-land-barafundle.webp')}
html body .otd-day:nth-child(12n+1){--pbg:url('t/gallery-land-yr-wyddfa.webp')}
html body .otd-day:nth-child(12n+2){--pbg:url('t/gallery-land-brecon-beacons.webp')}
html body .otd-day:nth-child(12n+3){--pbg:url('t/gallery-land-cadair-idris.webp')}
html body .otd-day:nth-child(12n+4){--pbg:url('t/gallery-land-llyn-y-fan.webp')}
html body .otd-day:nth-child(12n+5){--pbg:url('t/gallery-land-tryfan.webp')}
html body .otd-day:nth-child(12n+6){--pbg:url('t/gallery-land-three-cliffs.webp')}
html body .otd-day:nth-child(12n+7){--pbg:url('t/gallery-land-llyn-idwal.webp')}
html body .otd-day:nth-child(12n+8){--pbg:url('t/gallery-land-pen-y-fan.webp')}
html body .otd-day:nth-child(12n+9){--pbg:url('t/gallery-land-worms-head.webp')}
html body .otd-day:nth-child(12n+10){--pbg:url('t/gallery-land-llyn-tegid.webp')}
html body .otd-day:nth-child(12n+11){--pbg:url('t/gallery-land-strumble.webp')}
html body .otd-day:nth-child(12n+12){--pbg:url('t/gallery-land-barafundle.webp')}
html body :is(.pbg, .lang-grid > .panel:not(.decoder), .panel.decoder, .wotd, .lang-words, .b-fact, .news-box, .reading, .tl-band, .otd-year, .refs, .further, .note-box, .behind, .just-added, .sm-card, .today-card, .ll-out, .cm-card, .near, .g-root, .game-box, .quiz, .tw-dec, .sheet-print, .pk-source, .pk-list, .about-facts, .fix-box, .cyng, .lw-quiz, .lw-words, .lw-worth, .lw-dates, .cyw-week, .letters, .ref-big-search, .phr > li, .ms-lib, .lit-q, .tri, .cal-m, .mut, .cm-feat, .author, .lw-off, .pk-box, .ref-desk > a, .otd-day){background-image:linear-gradient(180deg, rgba(12,15,22,.50) 0, rgba(12,15,22,.78) 9rem, rgba(12,15,22,.88) 100%),var(--pbg)!important;background-size:cover!important;background-position:center 35%!important;background-repeat:no-repeat!important}
html body :is(.b-fact, .refs, .further, .note-box, .behind, .fix-box, .lw-worth, .ms-lib, .lit-q, .tri, .author, .lw-off, .otd-day){background-image:linear-gradient(180deg, rgba(12,15,22,.66) 0, rgba(12,15,22,.86) 6rem, rgba(12,15,22,.92) 100%),var(--pbg)!important}
html body :is(.pbg, .lang-grid > .panel:not(.decoder), .panel.decoder, .wotd, .lang-words, .b-fact, .news-box, .reading, .tl-band, .otd-year, .refs, .further, .note-box, .behind, .just-added, .sm-card, .today-card, .ll-out, .cm-card, .near, .g-root, .game-box, .quiz, .tw-dec, .sheet-print, .pk-source, .pk-list, .about-facts, .fix-box, .cyng, .lw-quiz, .lw-words, .lw-worth, .lw-dates, .cyw-week, .letters, .ref-big-search, .phr > li, .ms-lib, .lit-q, .tri, .cal-m, .mut, .cm-feat, .author, .lw-off, .pk-box, .ref-desk > a, .otd-day){text-shadow:0 1px 3px rgba(0,0,0,.65)}
@media print{html body :is(.pbg, .lang-grid > .panel:not(.decoder), .panel.decoder, .wotd, .lang-words, .b-fact, .news-box, .reading, .tl-band, .otd-year, .refs, .further, .note-box, .behind, .just-added, .sm-card, .today-card, .ll-out, .cm-card, .near, .g-root, .game-box, .quiz, .tw-dec, .sheet-print, .pk-source, .pk-list, .about-facts, .fix-box, .cyng, .lw-quiz, .lw-words, .lw-worth, .lw-dates, .cyw-week, .letters, .ref-big-search, .phr > li, .ms-lib, .lit-q, .tri, .cal-m, .mut, .cm-feat, .author, .lw-off, .pk-box, .ref-desk > a, .otd-day){background-image:none!important}}
@supports (content-visibility:auto){.author,.tw-card,.otd-day{content-visibility:auto;contain-intrinsic-size:auto 260px}}

.evi { display: inline-block; vertical-align: .1em; font-family: var(--f-mono); font-size: .7rem; font-weight: 400; letter-spacing: .02em; line-height: 1.3;
  padding: .08rem .45rem; border-radius: 999px; border: 1px solid currentColor; white-space: nowrap; font-style: normal; text-transform: none }
.evi[data-k="a"] { color: #8fc3a0 }
.evi[data-k="c"] { color: #e8c65a }
.evi[data-k="r"] { color: #9fb8d8 }
.evi-key { font-size: .88rem; color: var(--muted); line-height: 1.8; margin: .4rem 0 1rem }
.evi-key .evi { margin: 0 .15rem }
.evi-src { font-size: .74rem; font-weight: 400; font-style: italic; color: var(--muted); margin-left: .35rem; letter-spacing: 0; text-transform: none; line-height: 1.35 }
.pk-card .evi-src { display: block; text-align: center; margin: .25rem 0 0 }
.plaque > .evi-src { margin: -.2rem 0 0 }
h3 .evi, h4 .evi, b + .evi, a + .evi { margin-left: .45rem }
.plaque > .evi { justify-self: start }
.person-meta .evi { align-self: center; font-size: .78rem }
.pk-card .evi { display: block; margin: .4rem auto 0; width: max-content }
@media print {
  .evi { color: #000 !important; border-color: #000 !important }
  .evi[data-k="c"] { border-style: dashed !important }
  .evi[data-k="a"] { border-style: dotted !important }
  .evi-key, .evi-src { color: #000 !important }
}

.tight { padding-top: 0 }
.lede { color: var(--muted); max-width: 40rem; font-size: 1.15rem }
.person-meta { display: flex; flex-wrap: wrap; gap: .4rem 1.4rem; font-family: var(--f-mono); font-size: .8rem; color: var(--muted); margin-bottom: 1.5rem }
.person-meta a { color: var(--ink) }
.share { margin-top: 1.5rem; display: flex; flex-wrap: wrap; gap: 1rem; align-items: center }
.era-events .links { display: flex; gap: 1rem; flex-wrap: wrap; margin-top: .3rem }
.era-events h3 a { text-decoration-color: var(--line); text-underline-offset: 4px }
.era-events li[data-era] time { color: var(--c) }
a.chap { text-decoration: none; color: inherit }
.lessons { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 20rem), 1fr)); gap: 1rem }
.lesson { background: var(--slate); border: 1px solid var(--line); border-top: 3px solid var(--c); border-radius: 12px; padding: 1.3rem 1.4rem; display: grid; gap: .6rem; align-content: start }
.lesson .span { font-family: var(--f-mono); font-size: .75rem; color: var(--c) }
.lesson h3 { font-size: 1.7rem } .lesson h3 a { text-decoration: none }
.lesson ol { margin: 0; padding-left: 1.2rem; display: grid; gap: .5rem; color: #cfd2d8 }
.lesson .eq { color: var(--muted) } .lesson .eq b { color: var(--ink) }
.muted { color: var(--muted) }
.sheet-print { background: var(--slate); border: 1px solid var(--line); border-radius: 12px; padding: 1.4rem; margin-top: 1.25rem; display: grid; gap: .8rem; overflow-x: auto }
.sheet-h { font-size: 1.6rem }
.bank { font-size: .95rem; line-height: 1.9 }
.qs { width: 100%; border-collapse: collapse; min-width: 22rem }
.qs th, .qs td { text-align: left; border-bottom: 1px solid var(--line); padding: .55rem .5rem; vertical-align: top }
.qs th { font-family: var(--f-mono); font-size: .75rem; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; font-weight: 500 }
.qs td:first-child { width: 2rem; color: var(--muted) } .qs td.blank { width: 6rem; border-bottom: 1px solid var(--muted) }
.answers-key summary { cursor: pointer; color: var(--muted); font-size: .9rem }

/* ---------- Welsh word of the day (home page and welsh.html) ---------- */
.wotd { position: relative; overflow: hidden; isolation: isolate; border: 1px solid color-mix(in srgb, var(--gold) 30%, var(--line)); border-radius: var(--r, 22px); padding: clamp(1.2rem, 3.5vw, 2.2rem); display: grid; gap: 1.2rem;
  background: radial-gradient(120% 140% at 0% 0%, color-mix(in srgb, var(--gold) 12%, var(--card, #151a25)), var(--card, #151a25) 60%) }
.wotd::after { content: "’"; position: absolute; right: -.05em; top: -.32em; z-index: -1; font: 400 clamp(12rem, 30vw, 22rem)/1 var(--f-display); color: color-mix(in srgb, var(--gold) 9%, transparent); pointer-events: none }
.wotd.in .wotd-main { animation: wotd-in .55s var(--ease, ease) both }
@keyframes wotd-in { from { opacity: 0; transform: translateY(10px) } to { opacity: 1; transform: none } }
@media (prefers-reduced-motion: reduce) { .wotd.in .wotd-main { animation: none } }
.wotd-top { display: flex; justify-content: space-between; align-items: center; gap: .8rem; flex-wrap: wrap }
.wotd-top .eyebrow b { color: var(--gold); font-weight: 600 }
.wotd-nav { display: flex; gap: .4rem }
.wotd-nav button { width: 2.4rem; height: 2.4rem; border-radius: 50%; border: 1px solid var(--line); background: transparent; color: var(--ink); font-size: 1.3rem; line-height: 1; cursor: pointer }
.wotd-nav button:hover:not(:disabled) { border-color: var(--gold); color: var(--gold) }
.wotd-nav button:disabled { opacity: .3; cursor: default }
.wotd-main { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: clamp(1.2rem, 4vw, 3rem); align-items: start }
.wotd-word { display: grid; gap: .5rem; align-content: start }
.wotd-w { font: 400 clamp(3rem, 9vw, 5.6rem)/.95 var(--f-display); color: var(--ink); margin: 0; overflow-wrap: anywhere; word-spacing: .1em }
.wotd-say { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem .9rem; margin: .2rem 0 0; font: 500 1rem var(--f-mono); color: var(--gold); letter-spacing: .05em }
.wotd-mean { font-size: 1.25rem; margin: 0; color: var(--ink) }
.wotd-body { display: grid; gap: .9rem; align-content: start; color: #cfd2d8 }
.wotd-body p { margin: 0 }
.wotd-ex { margin: 0; border-left: 3px solid var(--gold); padding: .2rem 0 .2rem 1rem; display: grid; gap: .25rem }
.wotd-ex blockquote { margin: 0; font: 400 1.35rem/1.3 var(--f-display); color: var(--ink) }
.wotd-ex figcaption { color: var(--muted); font-size: .95rem; font-style: italic }
.wotd.wl-card { transition: border-color .3s, box-shadow .3s } .wotd.wl-card:hover { border-color: var(--gold); box-shadow: 0 22px 44px -28px rgba(232,198,90,.45) }
@media (max-width: 760px) { .wotd-main { grid-template-columns: 1fr } }

/* the round "hear it" button, used everywhere a Welsh word can be played */
.hear { display: inline-flex; align-items: center; gap: .45rem; border: 1px solid var(--line); background: transparent; color: var(--ink); border-radius: 999px; padding: .35rem .8rem .35rem .55rem; font: 600 .82rem var(--f-body); letter-spacing: 0; cursor: pointer; vertical-align: middle; transition: border-color .2s, color .2s, background .2s }
.hear svg { width: 1.15rem; height: 1.15rem; flex: none }
.hear:not(:has(span)) { padding: .35rem }
.hear:hover { border-color: var(--gold); color: var(--gold) }
.hear.on { background: var(--gold); border-color: var(--gold); color: var(--night) }
.hear[hidden] { display: none }

/* ---------- welsh.html ---------- */
.cyw-week { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 14rem), 1fr)); gap: .7rem }
.cyw-week li { background: var(--slate); border: 1px solid var(--line); border-radius: 14px; padding: 1rem 1.1rem; display: grid; gap: .2rem; align-content: start }
.cyw-week b { font: 400 1.7rem/1.1 var(--f-display) }
.cyw-week .say { font: 500 .75rem var(--f-mono); color: var(--gold); letter-spacing: .04em; display: flex; align-items: center; gap: .5rem }
.cyw-week .say .hear { padding: .25rem }
.cyw-week li > span:last-child { color: var(--muted); font-size: .92rem }
.cyw-jump { margin-bottom: 1.6rem }
.cyw-sec { scroll-margin-top: 6rem; margin-top: clamp(2.2rem, 5vw, 3.4rem) }
.cyw-sec:first-of-type { margin-top: 0 }
.cyw-sec h3 { font-size: clamp(1.7rem, 3.6vw, 2.3rem) }
.cyw-sec > p { color: var(--muted); margin: .4rem 0 1.1rem; max-width: 46rem }
.phr { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 17rem), 1fr)); gap: .7rem }
.phr li { background: var(--slate); border: 1px solid var(--line); border-radius: 14px; padding: .9rem 1rem; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .15rem .8rem; align-items: center }
.phr b { font: 400 1.45rem/1.15 var(--f-display); color: var(--ink); grid-column: 1 }
.phr .say { font: 500 .75rem var(--f-mono); color: var(--gold); letter-spacing: .04em; grid-column: 1 }
.phr .mean { color: var(--muted); font-size: .95rem; grid-column: 1 }
.phr .hear { grid-column: 2; grid-row: 1 / span 3; padding: .5rem }
.phr.nums { grid-template-columns: repeat(auto-fill, minmax(min(100%, 9.5rem), 1fr)) }
.letters { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 15rem), 1fr)); gap: .7rem }
.letters > div { background: var(--slate); border: 1px solid var(--line); border-radius: 14px; padding: 1rem 1.1rem; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 1rem; align-items: start }
.letters b { font: 400 2.4rem/1 var(--f-display); color: var(--gold); min-width: 2.6rem }
.letters p { margin: 0; display: grid; gap: .3rem }
.letters span { color: #cfd2d8; font-size: .95rem }
.letters em { font-style: normal; font: 500 .78rem var(--f-mono); color: var(--muted) }
.letters em i { font-style: normal; color: var(--ink) }
.cyw-note { border: 1px solid var(--line); border-left: 4px solid var(--gold); border-radius: 0 14px 14px 0; padding: 1.1rem 1.3rem; color: #cfd2d8; display: grid; gap: .5rem; max-width: 52rem }
.cyw-note p { margin: 0 }
.lang-wotd { margin-top: clamp(2rem, 5vw, 3.5rem); display: grid; gap: 1rem }
.lang-wotd .more-row { margin: 0 }
.cyw-credits summary { cursor: pointer; color: var(--ink); font-weight: 600 }
.cyw-credits p { margin: .6rem 0 0; font-size: .88rem; line-height: 1.7 } .cyw-credits a { color: inherit }
/* The Laws of Hywel Dda page (laws.html), built by laws_page() in build.py */
.lw-top .lw-fig.lead { margin: 0 0 2rem }
.lw-fig { margin: 0 0 1.6rem; display: grid; gap: .55rem }
.lw-fig img { width: 100%; height: auto; display: block; border-radius: var(--r); border: 1px solid var(--line); background: var(--slate) }
.lw-fig.lead img { max-height: 36rem; object-fit: contain; background: #1d1710 }
.lw-fig figcaption { font-size: .88rem; line-height: 1.45; color: var(--muted) }
.lw-cr, .lw-fig .lw-cr { display: block; font-size: .78rem; color: #8a909c; margin-top: .25rem } .lw-cr a { color: inherit }
.lw-figs.n2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; align-items: start } .lw-figs.n2 .lw-fig img { max-height: 26rem; object-fit: contain; background: #1d1710 }
.lw-figs.n1 .lw-fig img { max-height: 34rem; object-fit: contain; background: #1d1710 }
.lw-ch { scroll-margin-top: 4.5rem } .lw-ch + .lw-ch { border-top: 1px solid var(--line) }
.lw-n { font: 500 .8rem var(--f-mono); letter-spacing: .12em; color: var(--c, var(--gold)); margin: 0 0 .3rem }
.lw-h { font-family: var(--f-display); font-weight: 400; font-size: clamp(2rem, 4.4vw, 3rem); line-height: 1.08; margin: 0 0 1.4rem }
.lw-h3 { font-family: var(--f-display); font-weight: 400; font-size: 1.7rem; margin: 2.4rem 0 .4rem }
.lw-lede { color: var(--muted); margin: 0 0 1.2rem; max-width: 46rem }
.lw-dates { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); gap: .8rem }
.lw-dates li { background: var(--slate); border: 1px solid var(--line); border-left: 3px solid var(--c, var(--gold)); border-radius: 14px; padding: .8rem 1rem; display: grid; gap: .25rem }
.lw-dates b { font: 600 .82rem var(--f-mono); letter-spacing: .06em; text-transform: uppercase; color: var(--c, var(--gold)) }
.lw-dates span { font-size: .95rem; line-height: 1.45 }
.lw-books { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; margin: 1.4rem 0 1rem }
.lw-book { background: var(--slate); border: 1px solid var(--line); border-top: 3px solid var(--c, var(--gold)); border-radius: var(--r); padding: 1.2rem 1.3rem }
.lw-book h3 { font-family: var(--f-display); font-weight: 400; font-size: 1.6rem; margin: .2rem 0 0 } .lw-book .lw-sub { font: 500 .75rem var(--f-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--c, var(--gold)); margin: .2rem 0 .6rem }
.lw-book p { margin: 0; color: var(--muted); font-size: .95rem; line-height: 1.5 } .lw-book .eyebrow { font-size: .75rem }
.lw-officers { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .6rem; margin: 1.4rem 0 1rem }
.lw-off { background: var(--slate); border: 1px solid var(--line); border-radius: 14px; padding: .7rem .9rem; display: grid; gap: .15rem }
.lw-off b { font-family: var(--f-display); font-weight: 400; font-size: 1.25rem } .lw-off span { font-size: .9rem; color: var(--muted); line-height: 1.4 }
.lw-split, .lw-wt { width: 100%; border-collapse: collapse; margin: 1rem 0 1.6rem; font-size: .98rem }
.lw-split th, .lw-split td, .lw-wt th, .lw-wt td { text-align: left; vertical-align: top; padding: .55rem .7rem; border-bottom: 1px solid var(--line) }
.lw-split thead th, .lw-wt thead th { font: 600 .75rem var(--f-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--c, var(--gold)); border-bottom: 2px solid var(--c, var(--gold)) }
.lw-split td { width: 50% } .lw-wt tbody th { font-weight: 500 } .lw-wt td { color: var(--c, var(--gold)); font-weight: 600; width: 40% }
.lw-worth { background: var(--slate); border: 1px solid var(--line); border-radius: var(--r); padding: 1.3rem 1.3rem .6rem; margin: 1.6rem 0 }
.lw-worth h3 { font-family: var(--f-display); font-weight: 400; font-size: 1.7rem; margin: 0 0 .8rem }
.lw-wchips { display: flex; flex-wrap: wrap; gap: .45rem; margin-bottom: .4rem }
.lw-note { font-size: .82rem; color: var(--muted) }
.lw-mss { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.2rem; margin: 1.6rem 0 0 }
.lw-ms { display: flex; flex-direction: column; gap: .4rem } .lw-ms .lw-fig { margin: 0 }
.lw-ms .lw-fig img { aspect-ratio: 4 / 5; object-fit: cover; object-position: center top; background: #1d1710 }
.lw-ms-t { margin: 0; display: grid; gap: .1rem } .lw-ms-t b { font-family: var(--f-display); font-weight: 400; font-size: 1.25rem } .lw-ms-t span { font: 500 .75rem var(--f-mono); letter-spacing: .06em; text-transform: uppercase; color: var(--c, var(--gold)) }
.lw-marts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .8rem }
.lw-mart { margin: 0; display: grid; gap: .35rem } .lw-mart img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; border-radius: 14px; border: 1px solid var(--line); background: #1d1710 }
.lw-mart figcaption { font-size: .85rem; color: var(--muted) }
.lw-quiz { background: var(--slate); border: 1px solid var(--line); border-top: 3px solid var(--c, var(--gold)); border-radius: var(--r); padding: 1.4rem }
.lw-q h3 { font-family: var(--f-display); font-weight: 400; font-size: clamp(1.4rem, 3vw, 1.9rem); line-height: 1.2; margin: .3rem 0 1rem }
.lw-as { display: grid; gap: .55rem }
.lw-a { text-align: left; font: 500 1rem var(--f-body); color: var(--ink); background: transparent; border: 1px solid var(--line); border-radius: 14px; padding: .8rem 1rem; cursor: pointer; transition: border-color .2s, background .2s }
.lw-a:hover:not(:disabled) { border-color: var(--muted) } .lw-a:disabled { cursor: default }
.lw-a.right { border-color: #4fb477; background: rgba(79,180,119,.16) } .lw-a.wrong { border-color: var(--red); background: rgba(226,69,61,.14) }
.lw-why { margin: 1rem 0 .8rem; color: var(--muted) } .lw-next { margin-top: .2rem }
.lw-score { font-family: var(--f-display); font-size: 3.4rem; margin: .2rem 0 } .lw-rank { font-size: 1.1rem; margin: 0 0 1rem }
.lw-words { display: grid; grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr)); gap: .8rem; margin: 0 }
.lw-words > div { background: var(--slate); border: 1px solid var(--line); border-radius: 14px; padding: .8rem 1rem }
.lw-words dt { display: flex; align-items: center; justify-content: space-between; gap: .6rem; font-family: var(--f-display); font-size: 1.45rem }
.lw-words dd { margin: .2rem 0 0; color: var(--muted); font-size: .92rem; line-height: 1.45 } .lw-say { display: block; font: 500 .75rem var(--f-mono); letter-spacing: .06em; color: #8a909c; margin-top: .2rem }
@media (max-width: 760px) {
  .lw-books, .lw-officers, .lw-figs.n2 { grid-template-columns: 1fr }
  .lw-mss { grid-template-columns: 1fr 1fr } .lw-marts { grid-template-columns: 1fr 1fr }
  .lw-quiz { padding: 1.1rem } .lw-worth { padding: 1rem 1rem .4rem }
  .lw-wt td { width: 45% }
}
.lw-quiz-sec { border-top: 1px solid var(--line); padding-top: clamp(3rem, 7vw, 5rem) !important }
.lw-fig.lead { max-width: 30rem; margin-inline: auto }
/* Wales in 10 minutes (wales-in-10.html): the story scrolls past a map that stays in view */
.w10 { padding-bottom: 3rem }
.w10 .crumbs { padding-top: 1.1rem; font-size: .85rem; color: var(--muted) }
.w10-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: clamp(1.5rem, 4vw, 4rem); max-width: var(--wrap); margin-inline: auto; padding-left: var(--gut-l); padding-right: var(--gut-r) }
.w10-steps { grid-column: 1; grid-row: 1 }
.w10-map { grid-column: 2; grid-row: 1; position: sticky; top: 4.6rem; align-self: start; height: calc(100vh - 5.6rem); display: flex; flex-direction: column; justify-content: center; gap: .6rem; min-width: 0 }
.w10-svg { width: 100%; height: auto; max-height: calc(100vh - 10rem); display: block; border-radius: 18px; border: 1px solid rgba(156,195,224,.14); box-shadow: 0 18px 50px rgba(0,0,0,.35) }
.w10-svg .la { fill: #3d7a55; stroke: #3d7a55; stroke-width: 1.2; stroke-linejoin: round; transition: fill .8s ease, stroke .8s ease }
.w10-glow path { fill: #6fb3d9; opacity: .32 }
.w10-shore path { fill: none; stroke: #9fd0ec; stroke-opacity: .35; stroke-width: 7; stroke-linejoin: round }
.w10-coast path { fill: none; stroke: #f4ead8; stroke-opacity: .6; stroke-width: 3.2; stroke-linejoin: round }
.w10-tex { fill: #fff; opacity: .22; pointer-events: none; mix-blend-mode: soft-light }
.w10-sea-l { font: italic 500 15px var(--f-display, Georgia, serif); fill: #9cc3e0; fill-opacity: .55; letter-spacing: .12em; text-anchor: middle }
.w10-compass path { fill: rgba(244,234,216,.25) } .w10-compass .n { fill: #f4ead8; fill-opacity: .8 }
.w10-compass text { font: 600 13px var(--f-mono, monospace); fill: #f4ead8; fill-opacity: .8; text-anchor: middle }
.w10-svg .kg-label { font: 600 21px var(--f-display, Georgia, serif); letter-spacing: .03em; fill: #fbf6ec; stroke: rgba(10,14,22,.7); stroke-width: 5px }
.w10-pin circle { fill: #f2c94c; stroke: #0e1118; stroke-width: 3 }
.w10-pin { animation: w10-pop .5s ease both }
.w10-pin:hover circle, .w10-pin:focus circle { fill: #fff }
@keyframes w10-pop { from { opacity: 0; transform: translateY(-8px) } to { opacity: 1; transform: none } }
.w10-bar { height: 4px; border-radius: 4px; background: var(--line); overflow: hidden }
.w10-bar i { display: block; height: 100%; width: 0; background: var(--dragon); transition: width .5s ease }
.w10-stage { margin: 0; font-family: var(--f-mono); font-size: .78rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); text-align: center; min-height: 1.2em }
.w10-places { display: flex; flex-wrap: wrap; justify-content: center; gap: .3rem 1rem; margin: 0; min-height: 1.5em; font-size: .9rem }
.w10-places a { color: var(--ink); text-decoration: none; display: inline-flex; align-items: center; gap: .4rem }
.w10-places a:hover { text-decoration: underline }
.w10-places i { width: .6rem; height: .6rem; border-radius: 50%; background: #f2c94c; display: inline-block }
.w10-step { min-height: 88vh; display: flex; align-items: center; padding: 6vh 0 }
.w10-step:first-child { min-height: calc(100vh - 8rem); padding-top: 2vh }
.w10-card { background: var(--slate); border: 1px solid var(--line); border-radius: 18px; padding: clamp(1.25rem, 3vw, 2.1rem); opacity: 1; transform: translateY(12px); transition: opacity .5s ease, transform .5s ease; width: 100% }
.w10-step.on .w10-card, html:not(.js) .w10-card { opacity: 1; transform: none }
.w10-card h1, .w10-card h2 { font-family: var(--f-display); font-size: clamp(1.7rem, 3.4vw, 2.5rem); line-height: 1.1; margin: .35rem 0 .9rem }
.w10-step:first-child h1 { font-size: clamp(2.2rem, 5vw, 3.4rem) }
.w10-card p { line-height: 1.65; margin: 0 0 .85rem }
.w10-card .eyebrow { margin: 0; color: var(--dragon) }
.w10-n { float: right; font-family: var(--f-mono); font-size: .75rem; color: var(--muted) }
.w10-more { display: flex; flex-wrap: wrap; gap: .4rem 1.2rem; margin: 1rem 0 0 !important; font-weight: 600 }
.w10-more a { color: var(--dragon); text-decoration: none }
.w10-more a:hover { text-decoration: underline }
.w10-hint { margin-top: 1.4rem !important; color: var(--muted); font-size: .9rem; animation: w10-nudge 1.8s ease-in-out infinite }
@keyframes w10-nudge { 50% { transform: translateY(5px) } }
.w10-end { min-height: 70vh }
.w10-end .share-row { margin-top: 1.2rem }
.w10-link { margin-top: .6rem }
@media (max-width: 900px) {
  .w10-grid { grid-template-columns: minmax(0, 1fr); gap: 0 }
  .w10-map { grid-column: 1; grid-row: 1; top: 3.4rem; z-index: 3; height: auto; gap: .35rem; padding: .3rem 0 .4rem; background: var(--night); margin-inline: calc(-1 * var(--gut-l)) calc(-1 * var(--gut-r)); padding-inline: var(--gut-l) var(--gut-r) }
  .w10-svg { max-height: 25vh; max-height: 25svh; width: auto; margin-inline: auto }
  .w10-svg .kg-label { font-size: 30px; stroke-width: 7px }
  .w10-sea-l { font-size: 22px }
  .w10-svg { border-radius: 14px }
  .w10-pin circle { r: 13; stroke-width: 4 }
  .w10-places { display: none }
  .w10-stage { font-size: .7rem }
  .w10-map::after { content: ""; position: absolute; left: 0; right: 0; top: 100%; height: 1.2rem; background: linear-gradient(var(--night), rgba(14,17,24,0)); pointer-events: none }
  .w10-steps { grid-row: 2 }
  .w10-step { min-height: 75vh; min-height: 75svh; padding: 3vh 0 }
  .w10-step:first-child { min-height: 50vh; padding-top: 1rem }
}
@media (prefers-reduced-motion: reduce) {
  .w10-svg .la, .w10-card, .w10-bar i { transition: none }
  .w10-pin, .w10-hint { animation: none }
}

.w10-pic { margin: .4rem 0 1rem }
.w10-pic img { width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 12px; display: block }
.w10-pic figcaption { font-size: .75rem; line-height: 1.4; color: var(--mute, #9aa0ad); margin-top: .4rem }
.w10-pic figcaption a { color: inherit }
/* Then and now sliders (src/thennow.py, src/static/thennow.js). Without the script the two pictures sit side by side. */
.thn { margin: 0 0 1.4rem; max-width: 60rem }
.thn-stage { position: relative; display: grid; grid-template-columns: 1fr 1fr; gap: .5rem }
.thn-stage img { display: block; width: 100%; height: auto; aspect-ratio: var(--ar, 1.6); object-fit: cover; border-radius: 12px; background: var(--slate) }
.thn-then { order: -1 }
.thn-range, .thn-handle, .thn-bar { display: none }
.thn-tag { position: absolute; top: .6rem; z-index: 3; font-family: var(--f-mono); font-size: .72rem; letter-spacing: .08em; text-transform: uppercase;
  padding: .3rem .55rem; border-radius: 999px; background: rgba(11,14,22,.78); color: var(--ink); pointer-events: none; transition: opacity .25s }
.thn-tag-then { left: .6rem }
.thn-tag-now { right: .6rem }
.thn:not(.on) .thn-tag-now { right: auto; left: calc(50% + .85rem) }

/* with the script: one picture over the other */
.thn.on .thn-stage { display: block; touch-action: pan-y; cursor: ew-resize; user-select: none; -webkit-user-select: none; border-radius: 14px; overflow: hidden;
  border: 1px solid var(--line); background: var(--slate); --pos: 50% }
.thn.on .thn-stage img { border-radius: 0; pointer-events: none; -webkit-user-drag: none }
.thn.on .thn-then { position: absolute; inset: 0; z-index: 1; clip-path: inset(0 calc(100% - var(--pos)) 0 0) }
.thn.on .thn-then img { height: 100% }
.thn.on .thn-handle { display: block; position: absolute; top: 0; bottom: 0; left: var(--pos); z-index: 2; width: 0; pointer-events: none }
.thn.on .thn-handle::before { content: ""; position: absolute; top: 0; bottom: 0; left: -1.5px; width: 3px; background: #fff; box-shadow: 0 0 10px rgba(0,0,0,.55) }
.thn.on .thn-handle::after { content: "‹ ›"; position: absolute; top: 50%; left: 0; transform: translate(-50%, -50%); width: 3rem; height: 3rem; border-radius: 50%;
  background: #fff; color: #11141c; font: 700 1.15rem/3rem var(--f-body); text-align: center; letter-spacing: .2em; text-indent: .2em; box-shadow: 0 4px 16px rgba(0,0,0,.5) }
.thn.on .thn-stage.glide .thn-then { transition: clip-path .45s cubic-bezier(.3,.7,.3,1) }
.thn.on .thn-stage.glide .thn-handle { transition: left .45s cubic-bezier(.3,.7,.3,1) }
.thn.on .thn-range { display: block; position: absolute; inset: 0; z-index: 4; width: 100%; height: 100%; margin: 0; opacity: 0; pointer-events: none }
.thn.on .thn-stage:has(.thn-range:focus-visible) { outline: 3px solid var(--dragon); outline-offset: 3px }
.thn.at-now .thn-tag-then, .thn.at-then .thn-tag-now { opacity: 0 }

.thn-bar { gap: .5rem; align-items: center; margin-top: .6rem; flex-wrap: wrap }
.thn.on .thn-bar { display: flex }
.thn-bar button { font: 600 .85rem var(--f-body); color: var(--ink); background: var(--slate-2); border: 1px solid var(--line); border-radius: 999px; padding: .5rem .95rem; cursor: pointer; min-height: 44px }
.thn-bar button:hover { border-color: var(--muted) }
.thn-bar .thn-hint { color: var(--muted); font-size: .85rem; margin-left: .3rem }
.thn figcaption { margin-top: .7rem; font-size: .9rem; color: var(--muted); line-height: 1.55 }
.thn figcaption b { color: var(--ink); font-weight: 600 }
.thn figcaption .thn-cr { display: block; font-size: .8rem; margin-top: .35rem }
.thn-what { color: var(--ink); font-size: 1rem; line-height: 1.6; margin: .2rem 0 0 }

/* the gallery page */
.thn-chips { display: flex; gap: .5rem; flex-wrap: wrap; margin: 0 0 1.6rem }
.thn-chip { font: 600 .9rem var(--f-body); color: var(--ink); background: var(--slate); border: 1px solid var(--line); border-radius: 999px; padding: .55rem 1rem; cursor: pointer; min-height: 44px }
.thn-chip.on { background: var(--dragon-deep); border-color: var(--dragon-deep) }
.thn-chip i { font-style: normal; color: var(--muted); margin-left: .25rem }
.thn-chip.on i { color: #fff }
.thn-list { display: grid; gap: 3rem }
.thn-card h2 { font: 400 clamp(1.5rem, 3.4vw, 2.1rem)/1.15 var(--f-display); word-spacing: .1em; margin: 0 0 .25rem }
.thn-card h2 a { color: inherit; text-decoration: none }
.thn-card h2 a:hover { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .2em }
.thn-card .thn-when { font-family: var(--f-mono); font-size: .75rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 0 0 .8rem }
.thn-card .thn-go { display: inline-block; margin-top: .6rem; font-weight: 600 }
@media (max-width: 640px) {
  .thn.on .thn-handle::after { width: 2.6rem; height: 2.6rem; line-height: 2.6rem; font-size: 1rem }
  .thn-list { gap: 2.4rem }
}

.royal-h { margin-top: 2.6rem }
.era-events.royal li.gap { padding: .7rem 0 }
.era-events.royal li:target { scroll-margin-top: 6rem; background: color-mix(in srgb, var(--gold, #e8c65a) 12%, transparent); border-radius: 10px; outline: 1px solid color-mix(in srgb, var(--gold, #e8c65a) 45%, transparent); outline-offset: 4px }
.era-events.royal li.gap p { font-style: italic; color: var(--muted) }
.era-events.royal li.gap time { color: var(--muted) }
.era-events .links .chip { font-family: var(--f-mono); font-size: .75rem; color: var(--muted); border: 1px solid var(--line); border-radius: 99px; padding: .1rem .6rem; text-decoration: none }
.era-events .links .chip:hover { color: var(--ink); border-color: var(--c) }
.one-king { margin-top: 0 }
.one-king h2 { font-family: var(--f-display); font-weight: 400; font-size: clamp(1.8rem, 4vw, 2.6rem); line-height: 1.1 }
.one-king .go { font-weight: 700 }
.realm-links { display: flex; flex-wrap: wrap; gap: .5rem 1.2rem; margin: -.8rem 0 1.5rem; font-size: .95rem }

.ft-jump { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1.4rem }
.ft-jump a { font: 500 .8rem var(--f-mono); color: var(--ink); text-decoration: none; border: 1px solid var(--line); border-radius: 99px; padding: .35rem .85rem; background: var(--card) }
.ft-jump a:hover { border-color: var(--gold); color: var(--gold) }
.ft-how { display: flex; flex-wrap: wrap; gap: .4rem 1.4rem; margin-top: 1.2rem; font-size: .9rem; color: var(--muted) }
.ft-how svg { width: 1em; height: 1em; vertical-align: -.12em; fill: var(--gold); color: var(--gold) }
.ft-sec .lede { max-width: 46rem }
.ft-tog { background: transparent; color: var(--ink); border: 1px solid var(--line); border-radius: 99px; padding: .2rem .8rem; font: inherit; font-size: .85rem; cursor: pointer }
.ft-tog[aria-pressed="true"] { border-color: var(--gold); color: var(--gold) }
.ft-compact .ft-note, .ft-compact .ft-role { display: none }
.ft-sec .realm-links { margin: .2rem 0 1.6rem }
.ft-tree { --ind: .3rem; --arm: .75rem; margin-top: 1.4rem }
.ft, .ft-kids { list-style: none; margin: 0; padding: 0 }
.ft-kids { padding-left: var(--ind) }
.ft-kids > li { position: relative; padding: .55rem 0 0 var(--arm) }
.ft-kids > li::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; border-left: 2px solid color-mix(in srgb, var(--c) 45%, var(--line)) }
.ft-kids > li:last-child::before { bottom: auto; height: 1.75rem }
.ft-kids > li::after { content: ""; position: absolute; left: 0; top: 1.75rem; width: var(--arm); border-top: 2px solid color-mix(in srgb, var(--c) 45%, var(--line)) }
.ft-kids.one { padding-left: 0 }
.ft-kids.one > li { padding: 1.1rem 0 0 }
.ft-kids.one > li::before { left: calc(var(--ind) + var(--arm) / 2); height: 1.1rem; bottom: auto }
.ft-kids.one > li::after { display: none }
.ft-card { position: relative; max-width: 36rem; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: .65rem .9rem .7rem; cursor: pointer;
  transition: opacity .3s, border-color .3s, box-shadow .3s; scroll-margin-top: 6rem }
.ft-card.crown { border-left: 3px solid var(--c) }
.ft-card.gap { background: transparent; border-style: dashed }
.ft-card.gap .ft-nm { font-style: italic; color: var(--muted) }
.ft-d { display: block; font: 500 .75rem var(--f-mono); letter-spacing: .05em; color: var(--muted) }
.ft-nm { all: unset; display: inline; cursor: pointer; font-family: var(--f-display); font-size: 1.22rem; line-height: 1.2; color: var(--ink); word-spacing: .04em }
.ft-nm:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; border-radius: 4px }
.ft-crown { width: .9em; height: .9em; margin-right: .3em; vertical-align: -.08em; color: var(--gold); fill: var(--gold) }
.ft-role { display: block; font-size: .85rem; color: var(--c); margin-top: .1rem }
.ft-note { margin: .35rem 0 0; font-size: .9rem; line-height: 1.55; color: #c9ccd4 }
.ft-links { display: flex; flex-wrap: wrap; gap: .2rem 1rem; margin-top: .4rem; font-size: .85rem }
.ft-links a { font-weight: 600 }
.ft-tree.tracing .ft-card:not(.lit) { opacity: .4 }
.ft-card.lit { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold), 0 6px 26px rgba(232,198,90,.18) }
.ft-card.me { box-shadow: 0 0 0 2px var(--gold), 0 8px 34px rgba(232,198,90,.3) }
.ft-card:target { animation: ftpulse 2.2s var(--ease) 1 }
@keyframes ftpulse { 0%, 60% { box-shadow: 0 0 0 3px var(--gold) } 100% { box-shadow: none } }
.ft-bar { position: fixed; left: 50%; bottom: max(1rem, env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 40; width: min(34rem, calc(100% - 2rem));
  display: flex; gap: .8rem; align-items: center; background: #1d2333; border: 1px solid var(--gold); border-radius: 16px; padding: .7rem .8rem .7rem 1rem; box-shadow: 0 10px 40px rgba(0,0,0,.5); font-size: .92rem }
.ft-bar[hidden] { display: none }
.ft-bar p { margin: 0; flex: 1; line-height: 1.4 }
.ft-bar button { flex: none; background: transparent; color: var(--ink); border: 1px solid var(--line); border-radius: 99px; padding: .3rem .8rem; font: inherit; cursor: pointer }
.ft-wed { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 16rem), 1fr)); gap: .9rem; margin-top: 1.2rem }
.ft-wed a { display: grid; gap: .45rem; align-content: start; text-decoration: none; color: var(--ink); background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 1rem 1.1rem; transition: transform .3s var(--ease), border-color .2s }
.ft-wed a:hover { transform: translateY(-3px); border-color: var(--gold) }
.ft-wed .hs { display: flex; align-items: center; gap: .45rem; font: 600 .75rem var(--f-mono); letter-spacing: .06em; text-transform: uppercase; color: var(--gold) }
.ft-wed .hs i { font-style: normal; color: var(--muted) }
.ft-wed p { margin: 0; font-size: .92rem; line-height: 1.55; color: #c9ccd4 }
.road { display: grid; gap: 0 1.2rem; margin-top: 1.6rem; grid-template-columns: 1fr;
  grid-template-areas: "t" "r" "j1" "m" "l" "j2" "e" }
.rd-col h3 { font: 600 .75rem var(--f-mono); letter-spacing: .06em; text-transform: uppercase; color: var(--gold); margin: 1.4rem 0 .6rem; text-align: center }
.rd-chain { list-style: none; margin: 0 auto; padding: 0; max-width: 21rem; display: grid; gap: 1.2rem }
.rd-chain li { position: relative; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: .5rem .8rem; text-align: center }
.rd-chain li + li::before { content: ""; position: absolute; left: 50%; top: -1.25rem; height: 1.2rem; border-left: 2px solid var(--gold); opacity: .7 }
.rd-chain li.gap { background: transparent; border-style: dashed; font-style: italic; color: var(--muted); font-size: .88rem }
.rd-chain b { display: block; font-family: var(--f-display); font-weight: 400; font-size: 1.1rem; line-height: 1.2 }
.rd-chain b a { color: var(--ink); text-decoration: none; border-bottom: 1px solid color-mix(in srgb, var(--gold) 55%, transparent) }
.rd-chain .dt { display: block; font: 500 .75rem var(--f-mono); color: var(--muted) }
.rd-chain small { display: block; font-size: .8rem; color: #c9ccd4; margin-top: .1rem }
.rd-join { position: relative; text-align: center; padding: 1.4rem 0 1.2rem; color: var(--gold); font-size: .9rem; font-style: italic }
.rd-join::before { content: "↓"; display: block; font-style: normal; font-size: 1.2rem; line-height: 1; margin-bottom: .3rem }
.rd-end { text-align: center; margin-top: .4rem; background: radial-gradient(ellipse at 50% 0, rgba(232,198,90,.14), transparent 70%), var(--card); border: 1px solid var(--gold); border-radius: 20px; padding: 1.4rem 1.2rem }
.rd-end h3 { font-family: var(--f-display); font-weight: 400; font-size: clamp(1.5rem, 3.4vw, 2.2rem); line-height: 1.15; margin: 0 0 .5rem }
.rd-end p { max-width: 40rem; margin: .4rem auto 0; color: #d0d3da; line-height: 1.65 }
.rd-kids { display: flex; flex-wrap: wrap; justify-content: center; gap: .6rem; margin-top: 1rem }
.rd-kids > span { border: 1px solid var(--line); border-radius: 99px; padding: .3rem .9rem; font-size: .88rem; background: var(--slate) }
@media (min-width: 860px) {
  .ft-tree { --ind: 1.1rem; --arm: 1.3rem }
  .road { grid-template-columns: 1fr 1fr 1fr 1fr; grid-template-areas: "t r l l" "j1 j1 l l" "m m l l" "j2 j2 j2 j2" "e e e e" }
  .rd-join { padding-top: 2.6rem }
  .rd-join::before { content: ""; position: absolute; top: 0; left: 25%; right: 25%; height: 1.1rem; margin: 0; border: 2px solid var(--gold); border-top: 0; border-radius: 0 0 14px 14px; opacity: .8 }
  .rd-join::after { content: ""; position: absolute; top: 1.1rem; left: 50%; height: 1.3rem; border-left: 2px solid var(--gold); opacity: .8 }
  .rd-join.j2 { padding-top: 3rem }
  .rd-join.j2::after { height: 1.7rem }
  .rd-col.l .rd-chain { gap: 1.2rem }
}
@media print { .ft-bar { display: none !important } .ft-tree.tracing .ft-card { opacity: 1 } }

.ll-chips { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .6rem }
.chip.ll { font: 500 .8rem var(--f-body); padding: .22rem .7rem; cursor: default; color: var(--ink); border-color: color-mix(in srgb, var(--c) 45%, var(--line)) }
.chip.ll small { color: var(--muted); font-size: .75rem }
a.chip.ll { cursor: pointer } a.chip.ll:hover { border-color: var(--c) }
.chip.ll.away { border-style: dashed }
.era-events .feast { font: 500 .78rem var(--f-mono); color: var(--c); letter-spacing: .04em; margin-top: .15rem }
.sm-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 2rem; align-items: start }
.sm-map { width: 100%; height: auto; display: block; overflow: visible }
.sm-map .sea-l { font-size: 15px }
.sm-dot { cursor: pointer; outline: none }
.sm-dot .d { fill: var(--c); stroke: var(--night); stroke-width: 2; transition: r .2s, opacity .2s }
.sm-dot .h { fill: var(--c); opacity: 0; transition: opacity .2s }
.sm-dot:hover .h, .sm-dot:focus-visible .h { opacity: .3 }
.sm-dot.sel .h { opacity: .35; animation: pulse 2.2s ease-out infinite }
.sm-dot.sel .d { r: 8 }
.sm-dot.dim { opacity: .2 }
.sm-dot.hit .d { r: 7.5 }
.sm-side { display: grid; gap: 1.2rem }
.sm-pick { display: grid; gap: .4rem; font: 500 .8rem var(--f-mono); color: var(--muted); text-transform: uppercase; letter-spacing: .08em }
.sm-pick select { font: 500 1rem var(--f-body); color: var(--ink); background: var(--slate); border: 1px solid var(--line); border-radius: 12px; padding: .7rem .9rem; text-transform: none; letter-spacing: 0; width: 100% }
.sm-card { background: var(--slate); border: 1px solid var(--line); border-left: 4px solid var(--c, var(--e-saints)); border-radius: 0 16px 16px 0; padding: 1.1rem 1.3rem; min-height: 6rem; display: grid; gap: .5rem; align-content: start }
.sm-card h3 { font-family: var(--f-display); font-weight: 400; font-size: 1.7rem; line-height: 1.1 }
.sm-card .en { color: var(--muted); font-size: .9rem }
.sm-card ul { list-style: none; padding: 0; margin: 0; display: grid; gap: .35rem }
.sm-card .go { font-weight: 700 }
.sm-legend { display: flex; flex-wrap: wrap; gap: .45rem }
.sm-legend .chip { font-size: .82rem; padding: .3rem .8rem }
.mut-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(46%, 12.5rem), 1fr)); gap: .7rem; margin: 1.6rem 0 }
.mut { display: grid; grid-template-columns: auto 1fr; gap: .1rem .8rem; align-items: baseline; background: var(--slate); border: 1px solid var(--line); border-radius: 14px; padding: .8rem 1rem }
.mut b { font: 500 .85rem var(--f-mono); color: var(--muted) } .mut b::before { content: "Llan + " }
.mut span { grid-column: 1 / -1; font: 400 clamp(1.25rem, 4.2vw, 1.6rem)/1.1 var(--f-display); color: var(--ink) }
.mut i { grid-column: 1 / -1; font: 500 .75rem var(--f-mono); font-style: normal; color: var(--c) }
.ll-dec { display: grid; gap: .6rem; margin-top: 1rem }
.ll-dec > label { font: 500 .8rem var(--f-mono); color: var(--muted); text-transform: uppercase; letter-spacing: .08em }
.ll-out:empty { display: none }
.ll-out { background: var(--slate); border: 1px solid var(--line); border-left: 4px solid var(--c); border-radius: 0 16px 16px 0; padding: 1.1rem 1.3rem; display: grid; gap: .4rem; animation: up .4s var(--ease) both }
.ll-out .eq { font: 400 clamp(1.5rem, 4vw, 2.2rem)/1.15 var(--f-display) } .ll-out .eq em { color: var(--c); font-style: normal }
.today-card { margin-top: 2rem; display: grid; gap: .4rem; background: radial-gradient(120% 140% at 100% 0%, color-mix(in srgb, var(--e-saints) 22%, transparent), transparent 60%), var(--slate); border: 1px solid color-mix(in srgb, var(--e-saints) 40%, var(--line)); border-radius: 18px; padding: 1.3rem 1.5rem }
.today-card .eyebrow { color: var(--e-saints) }
.today-card h3, .today-card h2 { margin: 0; font: 400 clamp(1.8rem, 4.5vw, 2.6rem)/1.05 var(--f-display) }
.today-card p { color: var(--muted) }
.cal { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 15rem), 1fr)); gap: 1rem }
.cal-m { background: var(--slate); border: 1px solid var(--line); border-radius: 14px; padding: 1rem 1.1rem }
.cal-m h3 { font: 500 .8rem var(--f-mono); text-transform: uppercase; letter-spacing: .1em; color: var(--e-saints); margin-bottom: .5rem }
.cal-m ol { list-style: none; margin: 0; padding: 0; display: grid; gap: .3rem }
.cal-m li { display: grid; grid-template-columns: 1.8rem 1fr; gap: .5rem; align-items: baseline }
.cal-m li b { font: 500 .85rem var(--f-mono); color: var(--muted) }
.cal-m li a { color: var(--ink); text-decoration: none } .cal-m li a:hover { text-decoration: underline }
.cal-m li.today { background: color-mix(in srgb, var(--e-saints) 18%, transparent); border-radius: 8px; margin: 0 -.4rem; padding: .1rem .4rem }
.cal-m li.today b { color: var(--e-saints) }
.saints-h { margin-top: 2.8rem; display: flex; flex-wrap: wrap; align-items: baseline; gap: .4rem 1rem; font-size: clamp(1.8rem, 4.5vw, 2.4rem) }
.saints-h a { font: 600 .85rem var(--f-body); color: var(--c); text-decoration: none } .saints-h a:hover { text-decoration: underline }
@media (max-width: 820px) { .sm-grid { grid-template-columns: 1fr; gap: 1.2rem } .sm-side { display: contents } .sm-pick { order: -1 } }

.tn-name{background:var(--slate);border:1px solid var(--line);border-radius:16px;padding:1.1rem 1.2rem;margin:0 0 1.4rem;max-width:50rem}
.tn-name .eyebrow{margin:0 0 .35rem}
.tn-mean{font-size:1.08rem;margin:0 0 .6rem}
.tn-mean b{font-family:var(--f-display);font-weight:600}
.tn-parts:empty{display:none}
.tn-n{font:600 .82rem var(--f-ui,inherit);letter-spacing:.06em;text-transform:uppercase;color:var(--muted);margin:.7rem 0 .3rem}
.tn-more{margin:.7rem 0 0;font-size:.92rem}
.tn-list{list-style:none;padding:0;margin:0;display:grid;gap:.5rem;grid-template-columns:repeat(auto-fill,minmax(min(100%,240px),1fr))}
.tn-list a{display:grid;gap:.15rem;padding:.75rem 1rem;border:1px solid var(--line);border-radius:14px;background:var(--card);color:inherit;text-decoration:none;height:100%;box-sizing:border-box;min-height:44px}
.tn-list a:hover,.tn-list a:focus-visible{border-color:color-mix(in srgb,var(--gold) 55%,var(--line))}
.tn-list small{color:var(--muted);font-size:.88rem}
.tn-map{display:flex;align-items:center;gap:1rem;max-width:22rem;margin:1.4rem 0 0;color:inherit;text-decoration:none}
.tn-map svg{width:7.5rem;height:auto;flex:none}
.tn-map .land{fill:color-mix(in srgb,var(--gold) 14%,var(--slate));stroke:color-mix(in srgb,var(--gold) 45%,var(--line));stroke-width:2}
.tn-map .h{fill:color-mix(in srgb,var(--red,#c8102e) 30%,transparent)}
.tn-map .d{fill:var(--red,#c8102e);stroke:#fff;stroke-width:3}
.tn-map span{font-weight:600}
.tn-map:hover span,.tn-map:focus-visible span{text-decoration:underline}

.ev-rel { list-style: none; padding: 0; margin: 0; display: grid; gap: .6rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)) }
.ev-rel a { display: grid; gap: .25rem; padding: 1rem 1.1rem; border: 1px solid var(--line); border-radius: 16px; background: var(--card); color: inherit; text-decoration: none; height: 100% }
.ev-rel a:hover, .ev-rel a:focus-visible { border-color: color-mix(in srgb, var(--gold) 55%, var(--line)) }
.ev-rel small { color: var(--muted); font-size: .9rem; line-height: 1.45 }
.era-events .links .src.full { font-weight: 600 }

/* poems and cynghanedd on the page (src/poembox.py) */
.prose figure.pb { margin: 2rem 0; padding: 1.2rem 1.3rem 1rem; border: 1px solid var(--line); border-left: 3px solid var(--gold); border-radius: 14px; background: color-mix(in srgb, var(--card, #151a25) 70%, transparent) }
.prose .pb-h { margin: 0 0 .2rem; font: 600 1.05rem/1.35 var(--f-body); color: var(--ink) }
.prose .pb-key { margin: 0 0 .9rem; font: 500 .72rem var(--f-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted) }
.pb-lines { display: grid; gap: .55rem }
.pb-l { display: grid; grid-template-columns: 1fr 1fr; gap: .2rem 1.4rem; align-items: baseline }
.pb-o { font-family: var(--f-display); font-size: 1.12rem; line-height: 1.35; color: var(--ink) }
.pb-t { font-size: .95rem; line-height: 1.4; color: var(--muted) }
.pb-gap { display: block; height: .1rem; border-top: 1px dashed var(--line); margin: .3rem 0; width: 3rem }
.prose .pb-src, .prose .cg-src { margin-top: .9rem; font-size: .85rem; color: var(--muted) }
.prose .pb-src a { color: inherit }
@media (max-width: 640px) { .pb-l { grid-template-columns: 1fr } .pb-t { padding-left: .9rem; border-left: 2px solid var(--line) } }
.prose figure.cg { margin: 1.6rem 0; padding: 1.1rem 1.3rem 1rem; border: 1px solid var(--line); border-radius: 14px; background: color-mix(in srgb, var(--card, #151a25) 70%, transparent) }
.prose .cg-k { margin: 0 0 .5rem; font: 500 .75rem var(--f-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--gold) }
.prose .cg-line { margin: 0; font-family: var(--f-display); font-size: clamp(1.35rem, 3.6vw, 1.85rem); line-height: 1.35; color: var(--ink); overflow-wrap: anywhere }
.cg-line b, .cg-pats b { font-weight: 700; border-bottom: 3px solid currentColor; padding-bottom: 1px }
.cg-line u.cg-r { text-decoration: none; background: color-mix(in srgb, var(--gold) 26%, transparent); border-radius: 4px; padding: 0 .1em }
.cg-bar { color: var(--muted); font-weight: 400 }
.prose .cg-pats { display: flex; flex-wrap: wrap; gap: .4rem 1.6rem; margin: .7rem 0 .2rem; font: 600 .95rem var(--f-mono); letter-spacing: .08em }
.cg-p { display: inline-flex; gap: .55rem }
.prose .cg-tr { margin: .6rem 0 0; font-style: italic; color: var(--ink) }
.prose .cg-how { margin: .45rem 0 0; font-size: .95rem; line-height: 1.5; color: var(--muted) }
.cg-c1 { color: #e8c65a } .cg-c2 { color: #6fd0c0 } .cg-c3 { color: #ff8f6b } .cg-c4 { color: #a9b8ff } .cg-c5 { color: #c79bff } .cg-c6 { color: #9fd36b } .cg-c7 { color: #ff7fae }
.prose figure.pb-sig img { width: 100%; height: auto; background: #efe4c8; padding: .9rem 1.2rem; border-radius: 10px; object-fit: contain }
.pb-links { display: grid; gap: .7rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); margin: 1.6rem 0 }
.pb-link { display: grid; gap: .3rem; padding: 1rem 1.1rem; border: 1px solid var(--line); border-radius: 14px; background: var(--card, #151a25); color: inherit; text-decoration: none }
.pb-link:hover, .pb-link:focus-visible { border-color: color-mix(in srgb, var(--gold) 55%, var(--line)) }
.pb-link b { font-weight: 600; color: var(--ink) } .pb-link small { color: var(--muted); font-size: .9rem; line-height: 1.45 }
@media print { .prose figure.pb, .prose figure.cg { break-inside: avoid; background: none } .cg-c1, .cg-c2, .cg-c3, .cg-c4, .cg-c5, .cg-c6, .cg-c7 { color: #111 } }

.fh-chain{margin:2rem 0 0;padding:1.3rem 1.3rem 1rem;background:var(--slate);border:1px solid var(--line);border-radius:14px}
.fh-chain figcaption{font-family:var(--f-display);font-size:1.15rem;line-height:1.45;margin:0 0 1rem;font-style:italic}
.fh-chain ol{list-style:none;margin:0;padding:0;display:grid;gap:.95rem}
.fh-chain li{display:grid;grid-template-columns:2rem 1fr;align-items:center;gap:.6rem;position:relative}
.fh-chain li + li::before{content:"ap";position:absolute;left:0;width:2rem;text-align:center;top:-.95rem;font-family:var(--f-mono);font-size:.7rem;line-height:.95rem;color:var(--muted)}
.fh-chain .fh-n{width:2rem;height:2rem;border-radius:50%;display:grid;place-items:center;background:var(--c,var(--gold));color:#111;font-weight:700;font-size:.85rem}
.fh-chain a,.fh-chain li>span:last-child{display:flex;flex-wrap:wrap;align-items:baseline;gap:.2rem .7rem;padding:.55rem .9rem;border:1px solid var(--line);border-radius:10px;color:inherit;text-decoration:none;background:var(--card,transparent)}
.fh-chain a:hover{border-color:var(--c,var(--gold))}
.fh-chain small{font-family:var(--f-mono);font-size:.75rem;color:var(--muted)}
.fh-cap{color:var(--muted);font-size:.9rem;margin:.8rem 0 0}
.fh-two{display:grid;gap:1.4rem;margin-top:1.6rem}
@media (min-width:44rem){.fh-two{grid-template-columns:1fr 1fr}}
.fh-two h3{font-family:var(--f-display);font-weight:400;font-size:1.3rem;margin:0 0 .7rem}
.fh-pairs{list-style:none;margin:0;padding:0;display:grid;gap:.4rem}
.fh-pairs li{display:grid;grid-template-columns:minmax(7rem,40%) 1fr;gap:.8rem;padding:.5rem .8rem;border-left:3px solid var(--c,var(--gold));background:var(--slate);border-radius:0 8px 8px 0}
.fh-pairs b{font-weight:700}
.fh-pairs span{color:var(--muted)}
.fh-top{list-style:none;margin:0;padding:0;display:grid;gap:.5rem}
.fh-top li{display:grid;grid-template-columns:1.8rem 6.5rem 1fr;grid-template-areas:"r n b" ". o o";gap:.15rem .7rem;align-items:center}
.fh-r{grid-area:r;font-family:var(--f-mono);font-size:.8rem;color:var(--muted);text-align:right}
.fh-top b{grid-area:n;font-family:var(--f-display);font-weight:400;font-size:1.2rem}
.fh-bar{grid-area:b;display:flex;align-items:center;gap:.5rem;min-width:0}
.fh-bar i{display:block;height:.75rem;width:var(--w);background:var(--c,var(--gold));border-radius:0 4px 4px 0;flex:none;max-width:calc(100% - 3.5rem)}
.fh-bar em{font-style:normal;font-family:var(--f-mono);font-size:.75rem;color:var(--muted)}
.fh-o{grid-area:o;color:var(--muted);font-size:.9rem}
.fh-steps{list-style:none;counter-reset:fh;margin:0;padding:0;display:grid;gap:1rem}
.fh-steps li{counter-increment:fh;position:relative;padding:1.1rem 1.2rem 1.1rem 3.6rem;background:var(--slate);border:1px solid var(--line);border-radius:14px}
.fh-steps li::before{content:counter(fh);position:absolute;left:1rem;top:1rem;width:1.9rem;height:1.9rem;border-radius:50%;display:grid;place-items:center;background:var(--c,var(--gold));color:#111;font-weight:700}
.fh-steps h3{font-family:var(--f-display);font-weight:400;font-size:1.35rem;margin:0 0 .4rem}
.fh-steps p{margin:0;line-height:1.6}
.fh-go{display:flex;flex-wrap:wrap;gap:.5rem;margin-top:.8rem!important}
.fh-go .btn{font-size:.9rem}
.fh-find{background:var(--slate);border:1px solid var(--line);border-radius:14px;padding:1.2rem 1.2rem 1rem}
.fh-q{display:block;font-family:var(--f-display);font-size:1.3rem;margin-bottom:.6rem}
.fh-slide{display:flex;align-items:center;gap:1rem}
.fh-slide input{flex:1;min-width:0;accent-color:var(--c,var(--gold));height:2.75rem}
.fh-slide output{font-family:var(--f-mono);font-size:1.4rem;min-width:3.5rem;text-align:right;color:var(--c,var(--gold))}
.fh-count{color:var(--muted);margin:.4rem 0 .8rem}
.fh-recs{list-style:none;margin:0;padding:0;display:grid;gap:.45rem}
.fh-recs li{display:grid;grid-template-columns:6.5rem 1fr;gap:.8rem;align-items:start}
.fh-yrs{font-family:var(--f-mono);font-size:.8rem;color:var(--c,var(--gold));padding-top:.7rem}
.fh-recs a{display:grid;gap:.15rem;padding:.6rem .85rem;border:1px solid var(--line);border-radius:10px;color:inherit;text-decoration:none;background:var(--card,transparent)}
.fh-recs a:hover{border-color:var(--c,var(--gold))}
.fh-recs a b{color:var(--ink)}
.fh-recs a span{color:var(--muted);font-size:.92rem}
.fh-tips{display:grid;grid-template-columns:repeat(auto-fill,minmax(min(100%,19rem),1fr));gap:1rem}
.fh-tips>div{background:var(--slate);border:1px solid var(--line);border-top:3px solid var(--c,var(--gold));border-radius:14px;padding:1rem 1.2rem}
.fh-tips h3{font-family:var(--f-display);font-weight:400;font-size:1.3rem;margin:0 0 .4rem}
.fh-tips p{margin:0;line-height:1.55}
.fh-wh{font-family:var(--f-display);font-weight:400;font-size:1.45rem;margin:2.2rem 0 .8rem}
.fh-words{display:grid;grid-template-columns:repeat(auto-fill,minmax(min(100%,14rem),1fr));gap:.5rem;margin:0}
.fh-words div{border-left:3px solid var(--c,var(--gold));padding:.3rem 0 .3rem .8rem}
.fh-words dt{font-weight:700}
.fh-words dd{margin:.1rem 0 0;color:var(--muted)}
@media (max-width:30rem){.fh-top li{grid-template-columns:1.5rem 5.5rem 1fr}.fh-recs li{grid-template-columns:1fr}.fh-yrs{padding-top:0}.fh-pairs li{grid-template-columns:1fr;gap:.1rem}}

.ct .ll-bar { right: 11rem }
.ct .ll-panel { max-height: calc(100% - 9.6rem) }
@media (pointer: coarse) and (min-width: 701px) { .ct .ll-panel { top: 8.8rem; max-height: calc(100% - 9.6rem) } .ct .ll-tab { top: 8.8rem } }
@media (max-width: 700px) { .ct .ll-bar { right: .7rem; flex-wrap: nowrap; gap: .35rem } .ct .ll-bar .btn { padding: .38rem .62rem; font-size: .8rem; white-space: nowrap } .ct .ll-panel { top: 3.3rem } }
.ct-known { display: grid; gap: .7rem; padding-left: 1.2rem; max-width: 52rem }
.ct-known li { line-height: 1.6 }
.ct-srcs { display: grid; gap: .8rem; padding-left: 1.4rem; max-width: 56rem; font-size: .95rem; line-height: 1.55 }
.ll-src { font-size: .8rem; color: var(--muted, #b9b2a3); margin: .2rem 0 0 }
.ll-gos { display: flex; flex-wrap: wrap; gap: .6rem; margin: 0 }
.ll-pics { font-size: 1rem; padding: .85rem 1.2rem; backdrop-filter: blur(6px) }
.ll-stage.slow .ll-pics { order: -1 }
.ll-stage.pics .ll-poster, .ll-stage.pics .ll-start, .ll-stage.pics .ll-fail-msg { display: none }
.ll-still { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover }
.ll-stills .ll-panel { pointer-events: auto }
@media (max-width: 700px) { .ll-stage.pics { aspect-ratio: auto; display: grid } .ll-stage.pics .ll-stills { position: static; display: grid } .ll-stage.pics .ll-still { position: static; aspect-ratio: 16 / 9; height: auto }
  .ll-stage.pics .ll-panel { position: static; width: auto; max-height: none; border-radius: 0; border: 0 } }

.ll-stage { position: relative; aspect-ratio: 16 / 9; border-radius: var(--r); overflow: hidden; border: 1px solid var(--line); background: #10141d; isolation: isolate }
@media (max-width: 700px) { .ll-stage { aspect-ratio: 3 / 4 } }
.ll-stage:fullscreen { aspect-ratio: auto; border-radius: 0 }
.ll-poster { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; filter: brightness(.55) saturate(.9) }
.ll-start { position: absolute; inset: auto 0 0 0; padding: 1.5rem; display: grid; gap: .8rem; justify-items: start; background: linear-gradient(transparent, rgba(8,10,16,.85)) }
.ll-start p { margin: 0; color: #e6dcc8; max-width: 34rem }
.ll-go { font-size: 1.15rem; padding: .9rem 1.4rem }
.ll-stage.ready .ll-poster, .ll-stage.ready .ll-start { display: none }
.ll-fail-msg { display: none; position: absolute; inset: auto 0 0 0; margin: 0; padding: 1.2rem 1.5rem; background: rgba(8,10,16,.9) }
.ll-stage.fail .ll-fail-msg { display: block } .ll-stage.fail .ll-start { display: none }
.ll-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; outline: none }
.ll-ui { position: absolute; inset: 0; pointer-events: none; z-index: 2 }
.ll-ui > * { pointer-events: auto }
.ll-bar { position: absolute; top: .7rem; left: .7rem; right: .7rem; display: flex; flex-wrap: wrap; gap: .5rem; align-items: center }
.ll-bar .btn { padding: .45rem .9rem; font-size: .9rem; backdrop-filter: blur(6px) }
.ll-bar .btn:not(.solid) { background: rgba(12, 14, 20, .66); color: #f6f1e6; border-color: rgba(255, 255, 255, .4); box-shadow: 0 1px 6px rgba(0, 0, 0, .25) }
.ll-bar .btn:not(.solid):hover { background: rgba(12, 14, 20, .82) }
.ll-help { font-size: .82rem; color: #e6dcc8; background: rgba(8,10,16,.6); padding: .3rem .6rem; border-radius: 8px }
.ll-panel { position: absolute; right: .7rem; bottom: .7rem; width: min(25rem, calc(100% - 1.4rem)); max-height: calc(100% - 5rem); overflow: auto;
  background: rgba(12,15,22,.9); border: 1px solid color-mix(in srgb, var(--gold) 40%, var(--line)); border-radius: 16px; padding: 1rem 1.1rem; backdrop-filter: blur(8px) }
.ll-panel h2 { margin: 0 0 .5rem; font-size: 1.45rem }
.ll-panel h2:focus { outline: none }
.ll-panel p { font-size: .95rem; line-height: 1.55; margin: 0 0 .6rem }
.ll-n { font: 500 .75rem var(--f-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--gold) }
.ll-btns { display: flex; gap: .5rem; align-items: center; margin-top: .6rem }
.ll-btns .btn { padding: .4rem .8rem; font-size: .88rem }
.ll-x { position: absolute; top: .4rem; right: .5rem; background: none; border: 0; color: inherit; font-size: 1.6rem; line-height: 1; cursor: pointer; padding: .2rem .5rem }
.ll-ui .ll-panel { padding-top: 1.35rem }
.ll-hide { position: absolute; top: .55rem; right: .6rem; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.35); color: #f6f1e6; border-radius: 999px; font: 600 .78rem var(--f-sans, inherit); padding: .28rem .75rem; cursor: pointer }
.ll-hide:hover, .ll-hide:focus-visible { background: rgba(255,255,255,.18) }
.ll-grip { position: absolute; top: 0; left: 50%; transform: translateX(-50%); width: 4.5rem; height: 1.15rem; cursor: grab; touch-action: none }
.ll-grip::before { content: ""; position: absolute; left: 1rem; right: 1rem; top: .45rem; height: 4px; border-radius: 4px; background: rgba(255,255,255,.38) }
.ll-ui .ll-n { cursor: grab; touch-action: none; user-select: none; padding-right: 5.5rem }
.ll-panel.dragging, .ll-panel.dragging .ll-grip, .ll-panel.dragging .ll-n { cursor: grabbing }
.ll-tab { position: absolute; bottom: .7rem; left: 50%; transform: translateX(-50%); background: rgba(12,15,22,.88); color: #f6f1e6; border: 1px solid color-mix(in srgb, var(--gold) 55%, transparent); border-radius: 999px; padding: .45rem 1rem; font: 600 .85rem var(--f-sans, inherit); cursor: pointer; white-space: nowrap; backdrop-filter: blur(6px) }
.ll-tab:hover, .ll-tab:focus-visible { background: rgba(12,15,22,.97) }
@media (pointer: coarse) { .ll-tab { bottom: auto; top: 3.3rem } }   /* on touch screens the stick and the plan have the bottom corners */
.ll-stick { display: none; position: absolute; left: 1rem; bottom: 1rem; width: 110px; height: 110px; border-radius: 50%; border: 2px solid rgba(255,255,255,.45); background: rgba(8,10,16,.35); touch-action: none }
.ll-stick i { position: absolute; left: 50%; top: 50%; width: 46px; height: 46px; margin: -23px; border-radius: 50%; background: rgba(242,193,78,.85) }
@media (pointer: coarse) { .ll-stick { display: block } .ll-panel { bottom: auto; top: 3.6rem; max-height: 40% } .ll-help { display: none } }
.ll-rh .ll-bar { right: 11rem }
@media (max-width: 700px) { .ll-rh .ll-bar { right: .7rem; flex-wrap: nowrap; gap: .35rem } .ll-rh .ll-bar .btn { padding: .38rem .62rem; font-size: .8rem; white-space: nowrap } .ll-rh .ll-panel { top: 3.3rem } }
.ll-note { font-size: .88rem; margin-top: .7rem }
.ll-go-row { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center }
.ll-slow-msg { display: none } .ll-stage.slow .ll-slow-msg { display: block }
.ll-stage.slow .ll-go { background: transparent; color: inherit; border-color: currentColor } .ll-stage.slow .ll-pics { background: var(--gold); color: #14100a; border-color: var(--gold) }
.ll-rh .ll-still { position: absolute; inset: 0; z-index: 3 }
.ll-rh .ll-still img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover }
@media (max-width: 700px) { .ll-rh.pics { aspect-ratio: auto; display: block } .ll-rh.pics .ll-still { position: static } .ll-rh.pics .ll-still img { position: static; display: block; width: 100%; height: auto; aspect-ratio: 16 / 9 }
  .ll-rh.pics .ll-still .ll-panel { position: static; width: auto; max-height: none; border-radius: 0; border: 0 } }
.ll-stage.pics .ll-start, .ll-stage.pics .ll-poster { display: none }
.ll-stage.no3d .ll-start { display: none }
.ll-src { font-size: .8rem !important; color: color-mix(in srgb, currentColor 70%, transparent); margin-top: .2rem !important }
.ll-src a { color: inherit }
.ll-plan { position: absolute; top: .7rem; right: .7rem; width: 150px; height: 120px; border-radius: 10px; cursor: pointer; border: 1px solid rgba(255,255,255,.18) }
@media (max-width: 700px) { .ll-plan { width: 110px; height: 88px; top: auto; bottom: 1rem; right: 1rem } }
.ll-fade { position: absolute; inset: 0; background: #07080c; opacity: 0; pointer-events: none; transition: none; z-index: 1 }
.ll-stops { list-style: none; counter-reset: st; padding: 0; margin: 0; display: grid; gap: 1.2rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 330px), 1fr)) }
.ll-stops li { counter-increment: st; border: 1px solid var(--line); border-radius: 16px; background: var(--card); padding: 1.1rem 1.2rem }
.ll-stops h3::before { content: counter(st) ". "; color: var(--gold) }
.ll-stops p { font-size: .97rem; line-height: 1.6 }

.vp-intro { max-width: 46rem; margin-bottom: 1.4rem }
.vp-small { font-size: .85rem; max-width: 46rem; margin-top: 1rem }
.vp-form { display: grid; gap: 1.1rem; background: var(--slate); border: 1px solid var(--line); border-radius: 14px; padding: 1.3rem 1.4rem }
.vp-form fieldset { border: 0; padding: 0; margin: 0; min-width: 0 }
.vp-form legend, .vp-from > label { font-family: var(--f-mono); font-size: .75rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: .5rem; display: block }
.vp-in { display: flex; gap: .6rem; flex-wrap: wrap }
.vp-in input { flex: 1 1 16rem; min-width: 0; font: inherit; font-size: 1.05rem; padding: .7rem .9rem; border-radius: 10px; border: 1px solid var(--line); background: var(--night); color: var(--ink) }
.vp-in input:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px }
.vp-err { color: #f2a19b; margin: .5rem 0 0 }
.vp-chips { display: flex; flex-wrap: wrap; gap: .5rem }
.vp-chip { position: relative; cursor: pointer }
.vp-chip input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer }
.vp-chip > span { display: inline-flex; align-items: center; gap: .45rem; min-height: 44px; padding: .45rem .95rem; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); font-size: .95rem; transition: background-color .2s, color .2s, border-color .2s }
.vp-chip > span > svg { width: 1.1rem; height: 1.1rem; flex: none }
.vp-chip input:checked + span { background: color-mix(in srgb, var(--gold) 18%, transparent); border-color: var(--gold); color: var(--ink) }
.vp-chip input:focus-visible + span { outline: 2px solid var(--gold); outline-offset: 2px }
.vp-opts { display: flex; flex-wrap: wrap; gap: .7rem 1.6rem; color: var(--muted); font-size: .95rem }
.vp-opts label { display: inline-flex; align-items: center; gap: .45rem; min-height: 44px }
.vp-opts input[type=checkbox] { width: 1.15rem; height: 1.15rem; accent-color: var(--gold) }
.vp-opts select { font: inherit; padding: .35rem .5rem; border-radius: 8px; background: var(--night); color: var(--ink); border: 1px solid var(--line) }
.vp-go { margin: 0 }
.vp-out:empty { display: none }
.vp-out { margin-top: 1.6rem; scroll-margin-top: 5rem }
.vp-day { display: grid; gap: 1rem }
.vp-sum { display: flex; flex-wrap: wrap; gap: .3rem 1.4rem; align-items: baseline; margin: 0; font-size: 1.02rem }
.vp-sum b { font-family: var(--f-display, inherit); font-size: 1.5rem; color: var(--gold) }
.vp-sum span { color: var(--muted) }
.vp-cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 1.6rem; align-items: start }
.vp-map { margin: 0; position: sticky; top: 5rem }
.vp-svg { display: block; width: 100%; aspect-ratio: 4 / 3; border-radius: 14px; border: 1px solid var(--line); background: #121a2a }
.vp-map figcaption { font-size: .8rem; color: var(--muted); margin-top: .45rem }
.vp-line { fill: none; stroke: #f0c75e; stroke-linecap: round; stroke-linejoin: round; opacity: .9 }
.vp-pin circle { fill: #e2453d; stroke: #fff }
.vp-pin text { fill: #fff; text-anchor: middle; font-family: var(--f-mono, monospace); font-weight: 700 }
.vp-lead { stroke: #fff; opacity: .8 } .vp-dot { fill: #fff }
.vp-home rect { fill: #10141d; stroke: #f0c75e }
.vp-home path { fill: none; stroke: #f0c75e; stroke-linecap: round; stroke-linejoin: round }
.vp-town circle { fill: rgba(236,233,225,.75) }
.vp-town text { fill: rgba(236,233,225,.85); paint-order: stroke; stroke: rgba(10,13,20,.85); stroke-width: .35px; font-family: var(--f-body, sans-serif) }
html.cy .vp-town .l-en, html:not(.cy) .vp-town .l-cy { display: none }
.vp-plan { list-style: none; margin: 0; padding: 0; display: grid; gap: .35rem }
.vp-mark { display: flex; gap: .8rem; align-items: baseline; padding: .55rem .2rem; font-weight: 600 }
.vp-mark time, .vp-time time { font-family: var(--f-mono, monospace); color: var(--gold) }
.vp-lunch { color: var(--muted); font-weight: 400 }
.vp-drive { font-size: .85rem; color: var(--muted); padding: .1rem 0 .1rem 2.6rem; position: relative }
.vp-drive::before { content: ""; position: absolute; left: 1.05rem; top: -.35rem; bottom: -.35rem; border-left: 2px dashed color-mix(in srgb, var(--gold) 55%, transparent) }
.vp-stop { display: grid; grid-template-columns: 2.2rem minmax(0, 1fr) auto; gap: .8rem; align-items: start; background: var(--slate); border: 1px solid var(--line); border-radius: 14px; padding: .95rem 1rem; transition: box-shadow .25s }
.vp-stop.wl-card:hover { box-shadow: 0 0 0 1px color-mix(in srgb, var(--gold) 55%, transparent) }
.vp-n { width: 2.2rem; height: 2.2rem; border-radius: 50%; background: #e2453d; color: #fff; display: grid; place-items: center; font-family: var(--f-mono, monospace); font-weight: 700 }
.vp-b > * { margin: 0 } .vp-b { display: grid; gap: .3rem }
.vp-b h3 { font-size: 1.35rem; line-height: 1.2 }
.vp-time { font-size: .85rem; color: var(--muted) }
.vp-d { color: #cfd2d8; font-size: .95rem }
.vp-meta { font-size: .85rem; color: var(--muted) } .vp-meta b { color: var(--ink); font-family: var(--f-mono, monospace); font-weight: 500 }
.vp-note { font-size: .85rem; color: #f0c75e }
.vp-links { display: flex; flex-wrap: wrap; gap: .2rem 1.1rem; font-size: .9rem }
.vp-links a, .vp-links button { color: var(--ink); min-height: 44px; display: inline-flex; align-items: center }
.vp-links button { background: none; border: 0; padding: 0; font: inherit; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; color: var(--muted) }
.vp-pic { width: 76px; height: 76px; border-radius: 10px; overflow: hidden; flex: none; background: var(--slate-2) }
.vp-pic img { width: 100%; height: 100%; object-fit: cover; display: block }
.vp-pic.ic { display: grid; place-items: center } .vp-pic.ic svg { width: 2.2rem; height: 2.2rem; color: var(--muted) }
.vp-acts { display: flex; flex-wrap: wrap; gap: .6rem; margin: 1.4rem 0 0 }
.vp-add { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; margin-top: 1rem }
.vp-add input { flex: 1 1 14rem; min-width: 0; font: inherit; padding: .6rem .8rem; border-radius: 10px; border: 1px solid var(--line); background: var(--night); color: var(--ink) }
.vp-nears { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 16rem), 1fr)); gap: .6rem }
.vp-near { background: var(--slate); border: 1px solid var(--line); border-radius: 12px; padding: .75rem .9rem; display: grid; gap: .15rem }
.vp-near span { font-size: .85rem; color: var(--muted) }
.vp-near.wl-card:hover { box-shadow: 0 0 0 1px color-mix(in srgb, var(--gold) 55%, transparent) }
.vp-areas .card-ban { aspect-ratio: 16 / 8 }
@media (max-width: 860px) {
  .vp-cols { grid-template-columns: 1fr }
  .vp-map { position: static }
  .vp-stop { grid-template-columns: 2rem minmax(0, 1fr); padding: .85rem .85rem }
  .vp-n { width: 2rem; height: 2rem }
  .vp-pic { display: none }
  .vp-form { padding: 1.05rem 1rem }
  .vp-chips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-inline: -1rem; padding-inline: 1rem; scroll-padding-inline: 1rem }
  .vp-chips::-webkit-scrollbar { display: none }
  .vp-chip { flex: none }
}
@media print {
  .vp-form, .vp-acts, .vp-add, .vp-links button, .vp-areas, .vp-nears, .share-row, .vp-intro, section:has(.vp-areas), section:has(.vp-nears) { display: none !important }
  section:has(.vp-day), section:has(.vp-form) { break-inside: auto }
  .vp-cols { grid-template-columns: 1fr }
  .vp-map { position: static; break-inside: avoid }
  .vp-svg { aspect-ratio: 4 / 3; max-height: 12cm; border-color: #999 }
  .vp-stop { break-inside: avoid; border-color: #bbb; background: #fff }
  .vp-pic img { print-color-adjust: exact; -webkit-print-color-adjust: exact }
  .vp-n, .vp-pin circle { print-color-adjust: exact; -webkit-print-color-adjust: exact }
  .vp-links a { text-decoration: none }
  .vp-links a::after { content: none }
  .vp-sum b, .vp-mark time, .vp-time time { color: #111 }
  .vp-d, .vp-note { color: #333 }
  .vp-drive::before { border-color: #999 }
  .era-hero { padding-block: 0 !important; min-height: 0 !important }
  .era-hero .hero-art { display: none }
}

.rd-grid { display: grid; gap: 1.5rem; align-items: start }
@media (min-width: 900px) { .rd-grid { grid-template-columns: minmax(0, 1.25fr) minmax(0, .75fr) } .rd-side { position: sticky; top: 5.5rem; order: 2 } .rd-story { order: 1 } }
.rd-mapbox { border: 1px solid var(--line); border-radius: var(--r); background: var(--card); padding: .6rem }
.rd-map { width: 100%; height: auto; display: block; max-height: 46vh }
.rd-map .land { fill: #232b3c; stroke: #55617a; stroke-width: 1.2 }
.rd-dot { fill: #55617a }
.rd-path { fill: none; stroke: var(--gold); stroke-width: 4; stroke-dasharray: 10 8; stroke-linecap: round; stroke-linejoin: round }
.rd-here circle { fill: #d43c34; stroke: #fff; stroke-width: 2.5 }
.rd-here .rd-ring { fill: none; stroke: #d43c34; stroke-width: 3; animation: rd-pulse 2s infinite }
.rd-here { transition: transform .9s var(--ease) }
@keyframes rd-pulse { from { opacity: .9; r: 9 } to { opacity: 0; r: 26 } }
@media (prefers-reduced-motion: reduce) { .rd-here { transition: none } .rd-here .rd-ring { animation: none } }
@media (max-width: 899px) { .rd-map { max-height: 34vh } .rd-log-box { display: none } }
.rd-bar { display: flex; align-items: center; gap: .6rem; margin: .8rem 0; font: 500 .8rem var(--f-mono); color: var(--muted) }
.rd-bar i { flex: 1; height: 6px; border-radius: 6px; background: var(--line); overflow: hidden }
.rd-bar b { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--gold), #d43c34); transition: width .8s var(--ease) }
.rd-log { list-style: none; margin: .4rem 0 0; padding: 0; display: grid; gap: .35rem; font-size: .92rem; color: var(--muted) }
.rd-log li { display: grid; grid-template-columns: 1.4rem 1fr; gap: .4rem }
.rd-log li::before { content: "✦"; color: var(--gold) }
.rd-log b { color: var(--ink, #ece9e1); font-weight: 600 }
.rd-card { border: 1px solid color-mix(in srgb, var(--gold) 30%, var(--line)); border-radius: var(--r); background: linear-gradient(170deg, color-mix(in srgb, var(--gold) 8%, var(--card)), var(--card) 60%); padding: clamp(1.2rem, 3vw, 2rem) }
.rd-card.in { animation: rd-in .6s var(--ease) }
@keyframes rd-in { from { opacity: 0; transform: translateY(12px) } to { opacity: 1; transform: none } }
@media (prefers-reduced-motion: reduce) { .rd-card.in { animation: none } }
.rd-when { font: 500 .8rem var(--f-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--gold); margin: 0 0 .3rem }
.rd-card h2 { margin: 0 0 1rem; font-size: clamp(1.6rem, 4vw, 2.3rem); line-height: 1.1 }
.rd-card h2:focus { outline: none }
.rd-say { border-left: 3px solid var(--gold); padding: .2rem 0 .2rem .9rem; font-style: italic; color: #e6dcc8 }
.rd-card p { font-size: 1.08rem; line-height: 1.65; margin: 0 0 .9rem }
.rd-role { display: flex; gap: .7rem; align-items: baseline; color: #e6dcc8 }
.rd-role i { font-style: normal; color: var(--gold); font-size: 1.2rem }
.rd-fact { margin: 1.2rem 0; border: 1px solid var(--line); border-radius: 14px; padding: .8rem 1rem; background: color-mix(in srgb, var(--card) 70%, #000) }
.rd-fact summary { cursor: pointer; font-weight: 700 }
.rd-fact p { font-size: .98rem; margin: .6rem 0 }
.rd-fact a { margin-right: .8rem; display: inline-block }
.rd-choices { list-style: none; padding: 0; margin: 1.4rem 0 0; display: grid; gap: .7rem }
.rd-choices button { width: 100%; text-align: left; font: inherit; font-size: 1.05rem; font-weight: 600; color: inherit; cursor: pointer; padding: 1rem 1.2rem; border-radius: 14px;
  border: 1px solid color-mix(in srgb, var(--gold) 45%, var(--line)); background: color-mix(in srgb, var(--gold) 10%, var(--card)); display: flex; gap: .8rem; align-items: center; transition: transform .2s, border-color .2s }
.rd-choices button:hover, .rd-choices button:focus-visible { border-color: var(--gold); transform: translateX(4px) }
.rd-choices button i { font-style: normal; color: var(--gold); font-size: 1.3rem; width: 1.5rem; text-align: center }
.rd-end { text-align: center }
.rd-rank { font: 400 clamp(1.4rem, 3.4vw, 2rem)/1.15 var(--f-display); color: var(--gold); margin: .3rem 0 1rem }
.rd-score { font: 500 .85rem var(--f-mono); color: var(--muted) }
.rd-again { display: flex; flex-wrap: wrap; gap: .6rem; justify-content: center; margin-top: 1.2rem }
.rd-resume { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: 1rem }

.pk-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 19rem), 1fr)); gap: 1rem; margin-top: 1.4rem }
.pk-box { background: var(--slate); border: 1px solid var(--line); border-top: 3px solid var(--c, var(--gold)); border-radius: 14px; padding: 1.2rem 1.3rem }
.pk-box h2, .pk-box h3 { font-family: var(--f-display); font-weight: 400; font-size: 1.35rem; margin: 0 0 .6rem }
.pk-box ol, .pk-box ul { margin: 0; padding-left: 1.2rem; display: grid; gap: .5rem; line-height: 1.5 }
.pk-print { margin-top: 1.4rem; display: flex; flex-wrap: wrap; gap: .8rem }
.pk-tl { list-style: none; padding: 0; margin: 0; display: grid; gap: .1rem }
.pk-tl li { display: grid; grid-template-columns: 7.5rem 1fr; gap: 1rem; padding: .7rem 0; border-bottom: 1px solid var(--line) }
.pk-tl time { font-family: var(--f-mono); font-size: .85rem; color: var(--c, var(--gold)) }
.pk-tl p { margin: .2rem 0 0; color: var(--muted) }
.pk-tl a { color: inherit }
.pk-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(12rem, 1fr)); gap: .6rem }
.pk-card { border: 2px dashed var(--line); border-radius: 10px; padding: 1rem; min-height: 4.5rem; display: grid; place-items: center; text-align: center; font-weight: 600 }
.pk-people { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 17rem), 1fr)); gap: 1rem }
.pk-person { border: 1px solid var(--line); border-radius: 14px; padding: 1rem 1.1rem; background: var(--card) }
.pk-person h3 { font-family: var(--f-display); font-weight: 400; font-size: 1.4rem; margin: .1rem 0 }
.pk-person h3 a { color: inherit; text-decoration: none }
.pk-d { font-family: var(--f-mono); font-size: .78rem; color: var(--c, var(--gold)); margin: 0 }
.pk-epi { font-style: italic; color: var(--muted); margin: 0 0 .4rem }
.pk-words { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 18rem), 1fr)); gap: .8rem; margin: 0 }
.pk-words div { border-left: 3px solid var(--c, var(--gold)); padding: .2rem 0 .2rem .9rem }
.pk-words dt { font-weight: 700 } .pk-words dd { margin: .2rem 0 0; color: var(--muted) }
.pk-places { padding-left: 1.1rem; display: grid; gap: .5rem; line-height: 1.5 }
.pk-source blockquote { margin: 0; padding: 1rem 1.3rem; border-left: 4px solid var(--c, var(--gold)); background: var(--slate); border-radius: 0 12px 12px 0; font-family: var(--f-display); font-size: 1.25rem; line-height: 1.45 }
.pk-source figcaption { color: var(--muted); font-size: .9rem; margin-top: .6rem }
.pk-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 15rem), 1fr)); gap: .7rem }
.pk-list a { display: grid; gap: .2rem; padding: 1rem 1.1rem; border: 1px solid var(--line); border-top: 3px solid var(--c); border-radius: 14px; background: var(--slate); color: inherit; text-decoration: none }
.pk-list a span { font-family: var(--f-mono); font-size: .75rem; color: var(--c) }
.pk-list a b { font-family: var(--f-display); font-weight: 400; font-size: 1.35rem }
.pk-list a small { color: var(--muted) }
@media print {
  .pk-box, .pk-person, .pk-list a { background: #fff !important; break-inside: avoid }
  .pk-card { border-color: #888; break-inside: avoid }
  .pk-tl li { break-inside: avoid }
}

.pinfo { padding-block: 2.2rem 2.6rem !important; border-top: 1px solid var(--line) }
.pinfo .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .8rem 2rem }
.pinfo p { margin: 0; font: 500 .8rem/1.6 var(--f-mono); letter-spacing: .03em; color: var(--muted) }
.pinfo .pi-who b { color: var(--ink); font-weight: 600 }
.pinfo .pi-sep { opacity: .5; margin-inline: .2rem }
.pinfo .pi-links { display: flex; flex-wrap: wrap; gap: .5rem 1.2rem }
.pinfo a { color: var(--ink); text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--red) 70%, transparent); text-underline-offset: 3px }
.pinfo a:hover { color: var(--gold) }
.about-sec h2 { margin-top: 0 }
.ab-text p { margin: 0; font-size: 1.06rem; line-height: 1.7 } .ab-text p + p { margin-top: 1rem }
.about-facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(9.5rem, 1fr)); gap: .8rem; margin: 1.6rem 0 0; padding: 0; list-style: none }
.about-facts li { background: var(--slate); border: 1px solid var(--line); border-radius: 14px; padding: .9rem 1rem }
.about-facts b { display: block; font-size: 1.5rem; color: var(--gold); line-height: 1.1 }
.about-facts span { font-size: .85rem; color: var(--muted) }
.about-how { margin: 1.2rem 0 0; padding-left: 1.2rem }
.about-how li { margin: .55rem 0 }
.fix-box { background: var(--slate); border: 1px solid var(--line); border-left: 4px solid var(--red); border-radius: 14px; padding: 1.3rem 1.4rem; margin-top: 1.4rem }
.fix-box ol { margin: .6rem 0 0; padding-left: 1.2rem } .fix-box li { margin: .35rem 0 }
.fix-box .btn { margin-top: 1rem }
.fix-log { list-style: none; padding: 0; margin: 1rem 0 0 } .fix-log li { padding: .7rem 0; border-top: 1px solid var(--line) }
.fix-log time { display: block; font: 500 .78rem var(--f-mono); color: var(--muted) }
@media print { .pinfo .pi-links { display: none } }

/* ---------- long reads read aloud (src/listen.py, src/static/listen.js) ---------- */
.listen { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: .4rem 1rem; margin: 0 0 1.6rem; padding: .8rem 1rem .8rem .8rem; border: 1px solid var(--line); border-radius: 18px; background: var(--card) }
.listen .ls-go { width: 3.4rem; height: 3.4rem; border-radius: 50%; border: 0; display: grid; place-items: center; background: var(--c, var(--gold)); color: #0c0f16; cursor: pointer; transition: transform .15s var(--ease) }
.listen .ls-go:hover { transform: scale(1.06) }
.listen .ls-go svg { width: 1.5rem; height: 1.5rem; fill: currentColor }
.listen .i-pause, .listen.playing .i-play { display: none }
.listen.playing .i-pause { display: inline }
.listen .ls-txt { min-width: 0 }
.listen .ls-txt b { display: block; font: 600 1.02rem var(--f-body); color: var(--ink) }
.listen .ls-txt small { display: block; font: 500 .74rem var(--f-mono); color: var(--muted); letter-spacing: .02em; margin-top: .15rem }
.listen .ls-resume { font: 600 .78rem var(--f-mono); color: var(--c, var(--gold)); background: none; border: 1px solid var(--line); border-radius: 999px; padding: .5rem .9rem; min-height: 44px; cursor: pointer }
.listen .ls-resume:hover { border-color: var(--c, var(--gold)) }
.listen .ls-more { grid-column: 1 / -1; display: grid; gap: .5rem; padding-top: .3rem }
.listen .ls-more[hidden], .listen .ls-resume[hidden] { display: none }
.listen .ls-bar { position: relative; height: 28px }
.listen .ls-seek { position: absolute; inset: 0; width: 100%; margin: 0; accent-color: var(--c, var(--gold)); cursor: pointer; background: transparent }
.listen .ls-ticks { position: absolute; left: 0; right: 0; top: 50%; height: 0; pointer-events: none }
.listen .ls-ticks i { position: absolute; top: -7px; width: 2px; height: 14px; border-radius: 1px; background: var(--muted); opacity: .55 }
.listen .ls-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .4rem 1rem; font: 500 .78rem var(--f-mono); color: var(--muted) }
.listen .ls-sec { color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100% }
.listen .ls-ctl { justify-content: flex-start; gap: .4rem }
.listen .ls-ctl button, .listen .ls-ctl a { min-width: 44px; min-height: 40px; padding: 0 .75rem; border-radius: 999px; border: 1px solid var(--line); background: none; color: var(--ink); font: 600 .8rem var(--f-mono); cursor: pointer; display: inline-grid; place-items: center; text-decoration: none }
.listen .ls-ctl svg { width: 1rem; height: 1rem; fill: currentColor }
.listen .ls-ctl button:hover, .listen .ls-ctl a:hover { border-color: var(--c, var(--gold)) }
.listen .ls-ctl .ls-dl { margin-left: auto; color: var(--muted) }
.listen.ls-flat .ls-prev, .listen.ls-flat .ls-next, .listen.ls-flat .ls-sec { display: none }
/* the Listen button beside Share at the top of the page (made by listen.js) */
.share-row .ls-top { margin-right: .5rem }
.share-row .ls-top svg { fill: currentColor }
.ls-top .i-pause, .ls-top.playing .i-play { display: none }
.ls-top.playing .i-pause { display: inline }
.listen.err .ls-txt small::after { content: " · " attr(data-err) }
/* a small bar at the foot of the screen while the sound plays and the box is out of sight */
.ls-mini { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(16px + env(safe-area-inset-bottom, 0px)); z-index: 25; width: min(34rem, calc(100vw - 32px)); display: flex; align-items: center; gap: .6rem; padding: .4rem .5rem .4rem .4rem; border-radius: 999px; border: 1px solid var(--line); background: rgba(21,26,37,.95); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); color: var(--ink); font-size: .86rem; animation: fade .3s both }
.ls-mini[hidden] { display: none }
.ls-mini button { flex: none; width: 2.6rem; height: 2.6rem; border-radius: 50%; border: 0; display: grid; place-items: center; background: var(--c, var(--gold)); color: #0c0f16; cursor: pointer }
.ls-mini button svg { width: 1.1rem; height: 1.1rem; fill: currentColor }
.ls-mini .i-pause, .ls-mini.playing .i-play { display: none }
.ls-mini.playing .i-pause { display: inline }
.ls-mini a { flex: 1; min-width: 0; color: inherit; text-decoration: none; display: flex; flex-direction: column }
.ls-mini a b { font-weight: 600; overflow: hidden; white-space: nowrap; text-overflow: ellipsis }
.ls-mini a small { font: 500 .72rem var(--f-mono); color: var(--muted) }
.ls-mini .ls-mbar { position: absolute; left: 1.4rem; right: 1.4rem; bottom: 0; height: 2px; background: var(--line); border-radius: 2px; overflow: hidden }
.ls-mini .ls-mbar i { display: block; height: 100%; width: 0; background: var(--c, var(--gold)) }
body.ls-on .toc-pill { bottom: calc(80px + env(safe-area-inset-bottom, 0px)) }
/* "Listen from here" beside each heading, once the reader has started listening */
.prose h2 .ls-here { margin-left: .5rem; vertical-align: middle; width: 2rem; height: 2rem; border-radius: 50%; border: 1px solid var(--line); background: none; color: var(--c, var(--gold)); cursor: pointer; display: inline-grid; place-items: center; padding: 0 }
.prose h2 .ls-here svg { width: .85rem; height: .85rem; fill: currentColor }
.prose h2 .ls-here:hover { border-color: var(--c, var(--gold)) }
@media (max-width: 560px) {
  .listen { grid-template-columns: auto minmax(0, 1fr) }
  .listen .ls-resume { grid-column: 1 / -1; justify-self: start }
  .listen .ls-ctl .ls-dl { margin-left: 0 }
}
@media (prefers-reduced-motion: reduce) { .listen .ls-go, .ls-mini { transition: none; animation: none } }
@media print { .listen, .ls-mini, .ls-here { display: none !important } }

.cite-w { position: relative; display: inline; white-space: nowrap }
.cite { display: inline-block; margin-left: .3em; padding: .05em .5em .1em; border: 1px solid var(--line); border-radius: 999px;
  font-family: var(--f-mono); font-size: .62rem; font-weight: 500; line-height: 1.5; letter-spacing: .02em; vertical-align: .2em;
  color: var(--muted); background: rgba(255,255,255,.03); text-decoration: none; white-space: nowrap; cursor: pointer; -webkit-appearance: none; appearance: none; font-style: normal; text-transform: none }
.cite::before { content: "§"; margin-right: .3em; color: var(--dragon) }
.cite:hover, .cite[aria-expanded="true"] { color: var(--ink); border-color: var(--dragon) }
.cite:focus-visible { outline: 2px solid var(--dragon); outline-offset: 2px }
.cite-pop { position: absolute; z-index: 60; left: 0; top: calc(100% + .45rem); width: min(22rem, calc(100vw - 2rem)); white-space: normal;
  display: grid; gap: .7rem; padding: .9rem 2.2rem .95rem 1rem; text-align: left;
  background: var(--slate-2); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 14px 40px rgba(0,0,0,.45);
  font-family: var(--f-body); font-size: .86rem; line-height: 1.45; font-weight: 400; letter-spacing: 0; word-spacing: 0; color: var(--ink) }
.cite-pop[hidden] { display: none }
.cite-h { font-family: var(--f-mono); font-size: .75rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted) }
.cite-i { display: grid; gap: .2rem }
.cite-i + .cite-i { padding-top: .7rem; border-top: 1px solid var(--line) }
.cite-t { font-weight: 600 }
.cite-t a { color: var(--ink); text-decoration: underline; text-decoration-color: var(--dragon); text-underline-offset: 3px }
.cite-by { color: var(--muted); font-size: .8rem }
.cite-n { font-size: .84rem }
.cite-x { position: absolute; top: .35rem; right: .4rem; width: 2rem; height: 2rem; border: 0; border-radius: 8px; background: none;
  color: var(--muted); font-size: 1.25rem; line-height: 1; cursor: pointer }
.cite-x:hover { color: var(--ink); background: rgba(255,255,255,.06) }
@media (max-width: 640px) {
  .cite { font-size: .75rem; padding: .28em .7em .32em; vertical-align: .1em }
  .cite-pop { position: fixed; left: .75rem; right: .75rem; top: auto; bottom: .75rem; width: auto; max-height: 70vh; overflow: auto }
}
@media print { .cite-pop { display: none !important } .cite { border: 0; padding: 0 } }

.visit-box{margin:2rem 0 0;padding:1.2rem 1.3rem 1rem;border:1px solid var(--line);border-left:4px solid var(--gold);border-radius:14px;background:var(--card)}
.visit-box h2{margin:0 0 .7rem;font-size:1.2rem}
.visit-box dl{margin:0;display:grid;gap:.55rem}
.visit-box dl>div{display:grid;grid-template-columns:9.5rem 1fr;gap:.2rem 1rem}
.visit-box dt{font-weight:700;color:var(--muted);font-size:.9rem}
.visit-box dd{margin:0}
.visit-box a{color:var(--gold)}
.visit-box b{letter-spacing:.03em}
.visit-note{margin:.8rem 0 0}
.visit-small{margin:.6rem 0 0;font-size:.85rem;color:var(--muted)}
@media(max-width:560px){.visit-box dl>div{grid-template-columns:1fr}}
.pl-links{margin-top:1.6rem;display:grid;gap:.5rem}
.pl-links .eyebrow{margin:0}
.pl-people{display:flex;flex-wrap:wrap;gap:.5rem;margin:0}
.pl-people a{display:inline-flex;padding:.45rem .8rem;border:1px solid var(--line);border-radius:999px;color:var(--ink);text-decoration:none;font-size:.9rem;font-weight:600;background:var(--card)}
.pl-people a:hover{border-color:var(--gold);color:var(--gold)}
.pc-visit{font-size:.88rem;margin:.2rem 0 .6rem;color:var(--muted)}
.pc-visit a{color:var(--gold)}

.ref-tools{display:flex;flex-wrap:wrap;gap:.8rem;align-items:center;margin:0 0 1.4rem}
.ref-filter{flex:1 1 16rem;min-width:0;background:var(--slate);border:1px solid var(--line);border-radius:12px;color:var(--ink);font:inherit;font-size:1.05rem;padding:.75rem 1rem}
.ref-filter:focus{outline:2px solid var(--gold,#e8c65a);outline-offset:2px}
.ref-letters{display:flex;flex-wrap:wrap;gap:.3rem;margin:0 0 1.6rem;padding:0;list-style:none}
.ref-letters a{display:inline-grid;place-items:center;min-width:2.2rem;height:2.2rem;border:1px solid var(--line);border-radius:8px;text-decoration:none;color:var(--ink);font:600 .9rem var(--f-mono)}
.ref-letters a:hover{border-color:var(--gold,#e8c65a);color:var(--gold,#e8c65a)}
.ref-group{margin:0 0 2.2rem;scroll-margin-top:5rem}
.ref-group>h2{font:600 2.2rem var(--f-display);color:var(--gold,#e8c65a);margin:0 0 .6rem;border-bottom:1px solid var(--line);padding-bottom:.3rem}
.ref-list{display:grid;gap:.2rem;margin:0}
.ref-item{padding:1rem 0 1.1rem;border-bottom:1px solid var(--line);scroll-margin-top:5.5rem}
.ref-item:target{background:color-mix(in srgb,var(--gold,#e8c65a) 9%,transparent);border-radius:10px;padding-left:.8rem;padding-right:.8rem}
.ref-item dt{font:600 1.25rem/1.25 var(--f-display);margin:0 0 .35rem}
.ref-item dt small{font:500 .78rem var(--f-mono);color:var(--muted);letter-spacing:.03em;margin-left:.5rem}
.ref-item dd{margin:0;color:var(--ink);line-height:1.6;max-width:46rem}
.ref-see{display:flex;flex-wrap:wrap;gap:.4rem;margin:.6rem 0 0}
.ref-see a{font:500 .8rem var(--f-body);border:1px solid var(--line);border-radius:999px;padding:.25rem .75rem;text-decoration:none;color:var(--muted)}
.ref-see a:hover{border-color:var(--gold,#e8c65a);color:var(--ink)}
.ref-none{color:var(--muted);padding:1rem 0}
.ref-desk{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,16rem),1fr));gap:1rem}
.ref-desk a{display:grid;gap:.4rem;align-content:start;background:var(--slate);border:1px solid var(--line);border-left:3px solid var(--c,var(--gold,#e8c65a));border-radius:12px;padding:1.1rem 1.2rem 1.2rem;text-decoration:none;color:var(--ink);transition:border-color .2s,transform .2s}
.ref-desk a:hover{transform:translateY(-2px);border-color:var(--gold,#e8c65a)}
.ref-desk b{font:600 1.3rem/1.2 var(--f-display)}
.ref-desk span.n{font:500 .75rem var(--f-mono);color:var(--muted);letter-spacing:.05em;text-transform:uppercase}
.ref-desk span.d{color:var(--muted);font-size:.95rem;line-height:1.5}
.ref-jump{display:flex;flex-wrap:wrap;gap:.4rem;list-style:none;margin:0 0 2rem;padding:0}
.ref-jump a{display:inline-block;font:500 .85rem var(--f-body);border:1px solid var(--line);border-radius:999px;padding:.35rem .9rem;text-decoration:none;color:var(--ink)}
.ref-jump a:hover{border-color:var(--gold,#e8c65a)}
.ref-gh{font:600 1.7rem var(--f-display);margin:0 0 .5rem;border-bottom:1px solid var(--line);padding-bottom:.4rem}
.ref-q{border-bottom:1px solid var(--line);scroll-margin-top:5.5rem}
.ref-q summary{cursor:pointer;list-style:none;padding:1rem 2.2rem 1rem 0;font:600 1.12rem/1.35 var(--f-body);position:relative}
.ref-q summary::-webkit-details-marker{display:none}
.ref-q summary::after{content:"+";position:absolute;right:.3rem;top:.85rem;font:400 1.5rem var(--f-mono);color:var(--gold,#e8c65a)}
.ref-q[open] summary::after{content:"−"}
.ref-q summary:hover{color:var(--gold,#e8c65a)}
.ref-a{padding:0 0 1.2rem;max-width:46rem;line-height:1.65}
.ref-a p{margin:0}
.ref-q:target{background:color-mix(in srgb,var(--gold,#e8c65a) 8%,transparent);border-radius:10px;padding:0 .8rem}
.ref-big-search{display:flex;gap:.6rem;align-items:center;width:100%;max-width:40rem;background:var(--slate);border:1px solid var(--line);border-radius:14px;padding:.95rem 1.1rem;color:var(--muted);font:inherit;font-size:1.1rem;cursor:text;text-align:left;margin-top:1.2rem}
.ref-big-search svg{width:1.2rem;height:1.2rem;flex:none}

.tw-dec{background:var(--slate);border:1px solid var(--line);border-radius:16px;padding:1.3rem 1.3rem 1.1rem;max-width:50rem}
.tw-lab{display:block;font:600 1.2rem var(--f-display);margin:0 0 .7rem}
.tw-dec .ref-filter{width:100%;box-sizing:border-box;background:var(--night)}
.tw-try{display:flex;flex-wrap:wrap;gap:.35rem;align-items:center;margin:.8rem 0 0;color:var(--muted);font-size:.9rem}
.tw-parts{list-style:none;padding:0;margin:1rem 0 0;display:flex;flex-wrap:wrap;gap:.5rem}
.tw-parts li{display:grid;gap:.1rem;background:var(--night);border:1px solid var(--line);border-top:3px solid var(--gold,#e8c65a);border-radius:10px;padding:.5rem .8rem}
.tw-parts li b{font:600 1.1rem var(--f-display)}.tw-parts li span{font-size:.85rem;color:var(--muted)}
.tw-parts li.un{border-top-color:var(--line)}
.tw-parts li.en{border-top-style:dashed}.tw-parts li em{font-style:normal;font-weight:600}
.tw-parts li small{font-size:.76rem;color:var(--muted);font-style:italic}
.tw-words-out{display:flex;flex-wrap:wrap;gap:.6rem 1.1rem;align-items:flex-start}.tw-words-out .tw-parts{margin:0}
#tw-out .tw-hit+.tw-words-out,#tw-out>.tw-words-out:first-child{margin-top:1rem}
.tw-hit{margin:1rem 0 0}.tw-hit a{color:var(--gold,#e8c65a)}
.tw-top{display:grid;grid-template-columns:minmax(0,1fr);gap:1.4rem;margin:0 0 2rem}
@media(min-width:800px){.tw-top{grid-template-columns:minmax(0,22rem) minmax(0,1fr);align-items:start}}
.tw-mapbox{max-width:24rem}
.tw-map{width:100%;height:auto;display:block}.tw-map .land{fill:var(--slate);stroke:var(--line);stroke-width:1.2}
.tw-dot .d{fill:var(--gold,#e8c65a)}.tw-dot .h{fill:transparent}.tw-dot:hover .d,.tw-dot:focus .d{fill:var(--red,#e2453d)}
.tw-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(min(100%,19rem),1fr));gap:1rem;margin-bottom:1rem}
.tw-card{background:var(--slate);border:1px solid var(--line);border-radius:12px;padding:1rem 1.1rem 1.1rem;scroll-margin-top:5.5rem}
.tw-card:target{border-color:var(--gold,#e8c65a);box-shadow:0 0 0 2px color-mix(in srgb,var(--gold,#e8c65a) 35%,transparent)}
.tw-card h3{margin:0 0 .4rem;display:flex;flex-wrap:wrap;gap:.2rem .6rem;align-items:baseline}
.tw-cy{font:600 1.35rem/1.2 var(--f-display)}.tw-en{font:500 .8rem var(--f-mono);color:var(--muted)}
.tw-card p{margin:.35rem 0 0;line-height:1.55;font-size:.95rem}.tw-m{color:var(--gold,#e8c65a)}.tw-m b{color:var(--muted);font-weight:500}
.tw-words{display:grid;grid-template-columns:repeat(auto-fill,minmax(min(100%,13rem),1fr));gap:.3rem 1rem;margin:0}
.tw-words div{display:flex;gap:.6rem;align-items:baseline;padding:.35rem 0;border-bottom:1px solid var(--line)}
.tw-words dt{font:600 1.05rem var(--f-display);min-width:5rem}.tw-words dd{margin:0;color:var(--muted);font-size:.9rem}

.bt-map .bt-dot .d{stroke:var(--gold,#e8c65a);stroke-width:3.2;stroke-linecap:round;fill:none}.bt-map .bt-dot .h{fill:transparent}
.bt-map .bt-dot.bt-l .d{stroke:#e9d9c6}.bt-map .bt-dot.bt-o .d{stroke:#93a0e0}.bt-map .bt-dot:hover .d,.bt-map .bt-dot:focus .d{stroke:var(--red,#e2453d)}
.bt-legend{list-style:none;padding:0;margin:.6rem 0 0;display:flex;flex-wrap:wrap;gap:.4rem 1rem;font-size:.82rem;color:var(--muted)}
.bt-legend li::before{content:"✕";font-weight:700;margin-right:.35rem;color:var(--gold,#e8c65a)}.bt-legend li.bt-l::before{color:#e9d9c6}.bt-legend li.bt-o::before{color:#93a0e0}
.bt-list{display:grid;gap:1rem;max-width:52rem}
.bt-card{background:var(--slate);border:1px solid var(--line);border-left:4px solid var(--c);border-radius:12px;padding:1rem 1.2rem 1.15rem;scroll-margin-top:5.5rem}
.bt-card:target{border-color:var(--gold,#e8c65a);box-shadow:0 0 0 2px color-mix(in srgb,var(--gold,#e8c65a) 35%,transparent)}
.bt-card h3{font:600 1.4rem/1.2 var(--f-display);margin:.2rem 0 .3rem}
.bt-card p{margin:.35rem 0 0;line-height:1.6}
.bt-date{font:500 .78rem var(--f-mono);color:var(--muted);letter-spacing:.03em;text-transform:uppercase;margin:0!important}
.bt-k{color:var(--gold,#e8c65a)}.bt-l .bt-k{color:#e9d9c6}.bt-o .bt-k{color:#93a0e0}
.bt-nomap{opacity:1}
.tw-top .ref-filter{width:100%;box-sizing:border-box;margin-top:.6rem}
.bt-side{font-weight:600;color:var(--ink)}
.bt-h{font:600 1.5rem var(--f-display);margin:2rem 0 .6rem}
.bt-chips{display:flex;flex-wrap:wrap;gap:.45rem;margin:0 0 1.3rem;max-width:52rem}
.bt-chips button{font:500 .88rem var(--f-body);background:var(--slate);color:var(--ink);border:1px solid var(--line);border-radius:999px;padding:.4rem .85rem;cursor:pointer}
.bt-chips button small{color:var(--muted);font:500 .75rem var(--f-mono);margin-left:.2rem}
.bt-chips button:hover{border-color:var(--gold,#e8c65a)}
.bt-chips button[aria-pressed="true"]{background:var(--gold,#e8c65a);border-color:var(--gold,#e8c65a);color:#1a1a1a}.bt-chips button[aria-pressed="true"] small{color:#1a1a1a}
.bt-vs{font-size:.85rem;color:var(--muted);margin:.25rem 0 0!important}
.bt-off{display:none!important}.bt-map .bt-dot.bt-dim{opacity:.12;pointer-events:none}

.dc-card{background:var(--slate);border:1px solid var(--line);border-left:4px solid var(--c);border-radius:12px;padding:1rem 1.2rem 1.15rem;scroll-margin-top:5.5rem}
.dc-card:target{border-color:var(--gold,#e8c65a)}
.dc-card h3{font:600 1.4rem/1.2 var(--f-display);margin:.2rem 0 .3rem}.dc-card p{margin:.45rem 0 0;line-height:1.6}
.dc-words{margin:.8rem 0 .2rem;padding:.8rem 1rem;border-radius:10px;background:color-mix(in srgb,var(--c) 10%,transparent)}
.dc-lab{font:500 .75rem var(--f-mono);letter-spacing:.06em;text-transform:uppercase;color:var(--muted);margin:0!important}
.dc-words blockquote{margin:.4rem 0 0;padding:0;border:0;font:italic 1.08rem/1.6 var(--f-display)}
.dc-words blockquote::before{content:"“"}.dc-words blockquote::after{content:"”"}
.dc-tr{color:var(--muted);font-size:.95rem}.dc-short{font-size:1.02rem}
.dc-kept{font-size:.88rem;color:var(--muted)}
.dc-jump{display:flex;flex-wrap:wrap;gap:.35rem;margin:1rem 0 1.4rem;max-width:52rem}
.dc-jump a{font-size:.8rem;padding:.25rem .6rem;border:1px solid var(--line);border-radius:99px;color:var(--ink);text-decoration:none}
.dc-jump a:hover{border-color:var(--gold,#e8c65a)}
.ref-intro{max-width:52rem;color:var(--muted)}
.dc-filter{width:100%;max-width:52rem;box-sizing:border-box;margin-top:.8rem}

.tp-intro{max-width:46rem;font-size:1.12rem;line-height:1.7}.tp-intro p{margin:0 0 1rem}
.tp-reads{margin-top:1.4rem}
.tp-people{display:grid;grid-template-columns:repeat(auto-fill,minmax(min(100%,14rem),1fr));gap:.7rem}
.tp-people a{display:grid;gap:.15rem;align-content:start;background:var(--slate);border:1px solid var(--line);border-radius:10px;padding:.75rem .9rem;text-decoration:none;color:var(--ink)}
.tp-people a:hover{border-color:var(--gold,#e8c65a)}
.tp-people b{font:600 1.05rem/1.25 var(--f-display)}.tp-people .dt{font:500 .75rem var(--f-mono);color:var(--muted)}.tp-people .d{font:400 .85rem/1.4 var(--f-body);color:var(--muted)}
.tp-ev{list-style:none;margin:0 0 1.2rem;padding:0;max-width:52rem;border-left:2px solid var(--line)}
.tp-ev li{display:grid;grid-template-columns:7.5rem 1fr;gap:.2rem 1rem;padding:.7rem 0 .7rem 1rem;position:relative}
.tp-ev li::before{content:"";position:absolute;left:-6px;top:1.05rem;width:10px;height:10px;border-radius:50%;background:var(--gold,#e8c65a)}
.tp-ev time{font:500 .8rem var(--f-mono);color:var(--muted);padding-top:.2rem}.tp-ev b{font:600 1.08rem var(--f-display)}.tp-ev p{margin:.2rem 0 0;line-height:1.55}
@media (max-width:560px){.tp-ev li{grid-template-columns:1fr}}
.tp-two{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,22rem),1fr));gap:2rem;align-items:start}
.tp-h{font:600 1.35rem var(--f-display);margin:0 0 .6rem}
.tp-az dt{font-weight:600;margin:.8rem 0 .15rem}.tp-az dt a{color:var(--ink)}.tp-az dd{margin:0;color:var(--muted);line-height:1.55}
.tp-others{display:flex;flex-wrap:wrap;gap:.5rem}
.tp-others a{border:1px solid var(--line);border-left:3px solid var(--c);border-radius:10px;padding:.5rem .9rem;text-decoration:none;color:var(--ink)}
.tp-others a:hover{border-color:var(--gold,#e8c65a)}

.mp-list{display:grid;gap:2.2rem;margin-top:1.6rem}
.mp-stage{display:grid;grid-template-columns:minmax(0,22rem) minmax(0,1fr);gap:1.6rem 2.4rem;align-items:center;padding-top:1.6rem;border-top:1px solid var(--line);scroll-margin-top:5rem}
.mp-stage h2{font:600 clamp(1.5rem,3vw,2.1rem)/1.15 var(--f-display);margin:.2rem 0 .6rem}
.mp-text>p{line-height:1.65;max-width:38rem}
.mp-map{width:100%;height:auto;display:block}
.mp-la use{stroke-width:1.2;stroke-opacity:.9;fill-opacity:.85;stroke-linejoin:round}
.mp-map .kg-label{font-size:22px}
.mp-legend{margin:1rem 0 .4rem;grid-template-columns:repeat(auto-fill,minmax(12rem,1fr))}
.mp-nav{display:flex;gap:1.2rem;font-size:.9rem;margin-top:.8rem}.mp-nav a{color:var(--muted)}
@media (max-width:760px){.mp-stage{grid-template-columns:1fr}.mp-map{max-width:22rem;margin:0 auto}}

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap }
.skip { position: absolute; left: -9999px; top: 0; z-index: 50; background: var(--ink); color: var(--night); padding: .6rem 1rem; border-radius: 0 0 8px 0 }
.skip:focus { left: 0 }
@media print {
  :root { --night: #fff; --slate: #fff; --slate-2: #f2f2f2; --ink: #111; --muted: #444; --line: #bbb; color-scheme: light }
  body { background: #fff; color: #111; font-size: 11pt }
  .nav, footer, .no-print, .pager, .era-hero svg.ill, .toast { display: none !important }
  section { padding-block: 12pt !important; break-inside: avoid-page }
  .sheet-print { break-before: page }
  a { color: #111; text-decoration: none }
}
