/* Pragmaphilia Labs: one stylesheet, light and dark via prefers-color-scheme. */

:root {
  --bg: #fbfaf7;
  --surface: #ffffff;
  --text: #1e1d1a;
  --muted: #5f5b53;
  --rule: #e4e0d7;
  --accent: #0b6e69;
  --accent-soft: #e2f1ef;
  --badge-bg: #fff1d6;
  --badge-text: #7a4b00;
  --banner-bg: #fff6e0;
  --banner-text: #5c3d00;
  --serif: "Iowan Old Style", "Charter", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  /* The page's width: 60% of the window (20% margins each side, John), never narrower than 42rem
     (or the window), never wider than 80rem; the wide pages (the Apps page) start at 66rem. */
  --measure: clamp(42rem, 60vw, 80rem);
  --wide-measure: clamp(66rem, 60vw, 90rem);
  --wood: #9a6f45;
  --stamp: #c8261b;
  --license-bg: #e6e6e6;
  --license-text: #9a9a9a;
  --license-border: #c4c4c4;
  /* The 1987 Space Flees screen's EGA colors, sampled from its screenshot: the credit's red
     (light red) and purple (light blue, which reads as purple), and the title's light magenta. */
  --ega-red: #ff5555;
  --ega-purple: #5555ff;
  --ega-magenta: #ff55ff;
  /* Athletic Club's red and white stripes, the box's accent (worker/athletic.js). */
  --ath-red: #e2231a;
  --ath-white: #ffffff;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #15171a;
    --surface: #1d2024;
    --text: #e9e6df;
    --muted: #a9a49a;
    --rule: #33373d;
    --accent: #5fd0c6;
    --accent-soft: #1f3534;
    --badge-bg: #3d2e10;
    --badge-text: #ffcf7a;
    --banner-bg: #2d2412;
    --banner-text: #f3d9a0;
    --wood: #c9a072;
    --stamp: #ff6b5e;
    --license-bg: #2a2d31;
    --license-text: #7c8087;
    --license-border: #4a4e55;
    --ath-red: #d8443b;
    --ath-white: #e9e6df;
  }
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 1.125rem/1.6 var(--serif);
}

a { color: var(--accent); text-underline-offset: 0.15em; }
a:hover { text-decoration-thickness: 2px; }

.preview-banner {
  background: var(--banner-bg);
  color: var(--banner-text);
  font: 0.875rem/1.4 var(--sans);
  text-align: center;
  padding: 0.5rem 1rem;
}

.site-header, main, .site-footer {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 0 1rem;
}

.site-header {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem 1.5rem;
  padding-top: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--rule);
}

.wordmark {
  font-family: var(--sans);
  text-decoration: none;
  color: var(--text);
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.wm-name { font-weight: 700; font-size: 1.25rem; }
.wm-labs {
  font-weight: 400;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.25em;
  color: var(--accent);
  margin-left: 0.4em;
}

.site-header nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1rem;
  font: 0.9rem/1.4 var(--sans);
}
.site-header nav a { color: var(--muted); text-decoration: none; }
.site-header nav a:hover, .site-header nav a[aria-current="page"] { color: var(--accent); }

main { padding-top: 2rem; padding-bottom: 3rem; }

h1, h2, h3 { font-family: var(--sans); line-height: 1.25; }
h1 { font-size: 2rem; margin: 0 0 0.5rem; }
h2 { font-size: 1.35rem; margin: 2.25rem 0 0.75rem; }
h3 { font-size: 1.1rem; margin: 0 0 0.35rem; }

.hero h1 { font-size: 2.4rem; }
.hero-lines, .lede { font-size: 1.2rem; color: var(--muted); }

.badge {
  display: inline-block;
  vertical-align: middle;
  font: 600 0.7rem/1 var(--sans);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.3em 0.55em;
  border-radius: 0.3em;
  background: var(--badge-bg);
  color: var(--badge-text);
  margin-left: 0.35em;
}
.badge-unlisted { background: var(--rule); color: var(--muted); }

.cards { display: grid; gap: 1rem; }
/* One column on a phone, never more than two (John: four cards in three columns were too narrow):
   each column is at least 16rem and at least half the row. */
.cards-grid { grid-template-columns: repeat(auto-fit, minmax(max(16rem, calc((100% - 1rem) / 2)), 1fr)); }

.card {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 0.6rem;
  padding: 1rem 1.1rem;
}
.card p { margin: 0.25rem 0 0; font-size: 1rem; }
.card h3 a { color: var(--text); text-decoration: none; }
.card h3 a:hover { color: var(--accent); }
.card-meta {
  font: 0.8rem/1.4 var(--sans);
  color: var(--muted);
  margin: 0 0 0.35rem !important;
}
.card-section {
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  text-decoration: none;
  margin-right: 0.4em;
}
.rss {
  float: right;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--muted);
  text-decoration: none;
  border: 1px solid var(--rule);
  border-radius: 0.25em;
  padding: 0.1em 0.4em;
}
.division h3 { color: var(--accent); }

/* A post's icon (front matter icon:), in a rounded tile like an app icon: 128 px below the post's
   date, 48 px beside it in a listing. An SVG icon (the Lab Notes No. 1 logo) is inlined and drawn
   in the accent color, so it follows light and dark mode. */
.icon-tile {
  display: inline-block;
  line-height: 0;
  border-radius: 22.5%;
  overflow: hidden;
  border: 1px solid var(--rule);
  background: var(--surface);
}
.icon-tile img, .icon-tile svg { display: block; }
.emoji-icon { display: flex; align-items: center; justify-content: center; line-height: 1; }
.icon-svg { color: var(--accent); }
.post-icon { margin: 1.25rem 0 0; }
.card.has-icon:not(.teaser), .teaser-body { display: flex; gap: 0.9rem; align-items: flex-start; }
.card-text { min-width: 0; flex: 1; overflow-wrap: break-word; }
.card-icon { flex: none; display: block; line-height: 0; margin-top: 0.15rem; text-decoration: none; }

/* A section's emoji (What's Cooking, Coffee Break) and Miss Sakamoto's on the About page: big, as
   text in the visitor's own emoji font, above the page's heading. */
.page-emoji {
  font: 3.5rem/1 "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif;
  margin: 0 0 0.75rem;
}
/* A section's picture in its emoji's place (Coffee Break's cocoa). */
.page-image { margin: 0 0 0.75rem; }
.page-image img { width: 240px; max-width: 60%; height: auto; display: block; }
.avatar { display: flex; align-items: center; gap: 0.9rem; margin: 0 0 0.75rem; }
.avatar .page-emoji { margin: 0; }
.avatar-caption { font: 0.9rem/1.4 var(--sans); color: var(--muted); }

.feed-link { font: 0.9rem/1.4 var(--sans); }

.crumbs { font: 600 0.8rem/1.4 var(--sans); text-transform: uppercase; letter-spacing: 0.08em; margin: 0 0 0.5rem; }
.crumbs a { text-decoration: none; }
.subtitle { font-size: 1.2rem; font-style: italic; color: var(--muted); margin: 0 0 0.75rem; }
.post-meta, .byline { font: 0.9rem/1.5 var(--sans); color: var(--muted); margin: 0.25rem 0; }
.draft-note {
  font: 0.85rem/1.4 var(--sans);
  background: var(--badge-bg);
  color: var(--badge-text);
  padding: 0.5rem 0.75rem;
  border-radius: 0.4rem;
}

.prose { margin-top: 1.5rem; overflow-wrap: break-word; }
.prose li { margin: 0.3rem 0; }
.prose blockquote { margin: 1rem 0; padding-left: 1rem; border-left: 3px solid var(--accent); color: var(--muted); }
.prose code { font: 0.9em var(--mono); background: var(--accent-soft); padding: 0.1em 0.3em; border-radius: 0.25em; }
.prose pre { overflow-x: auto; background: var(--surface); border: 1px solid var(--rule); padding: 0.75rem; border-radius: 0.4rem; }
.prose pre code { background: none; padding: 0; }
.prose hr { border: 0; border-top: 1px solid var(--rule); margin: 2rem 0; }

.table-wrap { overflow-x: auto; margin: 1rem 0; }
table { border-collapse: collapse; width: 100%; font: 0.9rem/1.45 var(--sans); }
th, td { text-align: left; padding: 0.45rem 0.6rem; border-bottom: 1px solid var(--rule); vertical-align: top; }
th { font-weight: 600; }

.formula { font-family: var(--sans); font-size: 1.15rem; text-align: center; margin: 1.25rem 0; }
.formula del { color: var(--muted); text-decoration-thickness: 2px; }
.mottos { list-style: none; padding: 0; font-style: italic; color: var(--muted); }
.motto { font-size: 1.35rem; letter-spacing: 0.01em; margin-top: -0.4rem; }

.personnel { margin: 0; }
.personnel div { padding: 0.6rem 0; border-bottom: 1px solid var(--rule); }
.personnel dt { font-family: var(--sans); font-weight: 600; }
.personnel dd { margin: 0; color: var(--muted); }

.site-footer {
  border-top: 1px solid var(--rule);
  padding-top: 1.25rem;
  padding-bottom: 2rem;
  font-family: var(--sans);
  color: var(--muted);
}
.footer-line { font-style: italic; margin: 0 0 0.5rem; }
.footer-small { font-size: 0.8rem; margin: 0; }
.footer-translation { font-size: 0.8rem; color: var(--muted); max-width: 42rem; margin: 0 auto 0.6rem; }
.footer-translation a { color: var(--muted); }
.footer-small a { color: var(--muted); }

.footer-links { font-size: 0.85rem; margin: 0 0 0.35rem; }
.footer-links a { color: var(--muted); }

/* Wider pages (the Apps page, with its sidebar) */
.wide .site-header, .wide main, .wide .site-footer { max-width: var(--wide-measure); }

/* Placeholders: a little easel holding a board that says "Coming soon…" */
.placeholder { margin: 1.5rem auto; text-align: center; }
.placeholder .easel { display: block; width: 9rem; height: auto; margin: 0 auto; }
.placeholder figcaption, .ph-caption { font: italic 0.85rem/1.4 var(--sans); color: var(--muted); }
.placeholder .ph-still { font-style: normal; }  /* "Still to come: ", LANGS' still_to_come */
.easel-wood { stroke: var(--wood); stroke-width: 3.5; }
.easel-wood rect { fill: var(--wood); stroke-width: 0; }
.easel-back { opacity: 0.5; }
.easel-board { fill: var(--accent-soft); stroke: var(--accent); stroke-width: 2.5; }
.easel-clamp, .easel-peg { fill: var(--wood); }
.easel-chalk { fill: var(--accent); font: 600 11px var(--sans); }
.easel-underline { stroke: var(--accent); stroke-width: 1.5; stroke-linecap: round; opacity: 0.6; }
.placeholder-small { display: inline-flex; align-items: center; gap: 0.5rem; margin: 0; vertical-align: middle; }
.placeholder-small .easel { width: 2.4rem; margin: 0; }
.placeholder-icon { display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; margin: 0; background: var(--bg); }
.placeholder-icon .easel { width: 78%; }

/* The Apps page */
.apps-layout { display: grid; gap: 2rem; }
@media (min-width: 60rem) {
  .apps-layout { grid-template-columns: minmax(0, 1fr) 19rem; align-items: start; }
}
.apps-list h1 { margin-bottom: 0.25rem; }
.app {
  display: flex;
  gap: 1.1rem;
  align-items: flex-start;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 0.6rem;
  padding: 1.1rem;
  margin-top: 1rem;
  scroll-margin-top: 1rem;
}
.app-icon {
  flex: none;
  display: block;
  width: 112px;
  height: 112px;
  border-radius: 22.5%;
  overflow: hidden;
  border: 1px solid var(--rule);
}
.app-icon img { display: block; width: 100%; height: 100%; }
.app-body { min-width: 0; flex: 1; }
.app-body h2 { margin: 0.1rem 0 0.35rem; font-size: 1.3rem; }
.app-body h2 a { color: var(--text); text-decoration: none; }
.app-body h2 a:hover { color: var(--accent); }
.app-body p { margin: 0.3rem 0; font-size: 1rem; }
.app-meta { font: 0.8rem/1.4 var(--sans); margin: 0 !important; }
.app-division { font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; color: var(--accent); margin-right: 0.4em; }
.app-facts { font: 0.9rem/1.5 var(--sans); color: var(--muted); }
.status {
  display: inline-block;
  font: 600 0.7rem/1 var(--sans);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.3em 0.55em;
  border-radius: 1em;
  border: 1px solid currentColor;
  color: var(--muted);
}
.status-soon, .status-out { color: var(--accent); }
.status-beta, .status-live { color: var(--accent); background: var(--accent-soft); border-color: transparent; }
.status + .status { margin-left: 0.3em; }
/* A call to action (build.py's +[text](url) in a post, or <a class="button"> in a page). */
.button {
  display: inline-block;
  padding: 0.65em 1.2em;
  border-radius: 0.6em;
  background: var(--accent);
  color: var(--bg);
  font: 600 0.95rem/1.2 var(--sans);
  text-decoration: none;
}
.button:hover { filter: brightness(1.08); }
.button:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.prose p.cta { margin: 1.25rem 0; }
.store { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem 1.1rem; margin-top: 0.75rem; font: 0.9rem/1.4 var(--sans); }
/* Not Apple's badge: a plain label until the app is on the store and the real badge goes in. */
.store-soon {
  display: inline-block;
  padding: 0.45em 0.8em;
  border: 1.5px dashed var(--rule);
  border-radius: 0.5em;
  color: var(--muted);
  font-weight: 600;
}
.app-sold h2 { color: var(--muted); }
/* Our own button, in the App Store badge's shape (about 3:1, 40 px tall), grayed out, with a
   SOLD OUT stamp beside it, overlapping its corner. */
.license-wrap { display: inline-flex; align-items: center; padding: 0.5rem 0; }
.license-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 40px;
  min-width: 132px;
  padding: 0 14px;
  border-radius: 7px;
  border: 1px solid var(--license-border);
  background: var(--license-bg);
  color: var(--license-text);
  font: 600 0.8rem/1 var(--sans);
  letter-spacing: 0.06em;
  cursor: not-allowed;
}
.sold-out-stamp {
  position: relative;
  margin-left: -0.5rem;
  transform: rotate(-11deg);
  padding: 0.1em 0.4em;
  border: 3px solid var(--stamp);
  border-radius: 0.25em;
  color: var(--stamp);
  font: 900 1.35rem/1.1 var(--sans);
  letter-spacing: 0.08em;
  white-space: nowrap;
  background: var(--surface);
  opacity: 0.94;
  pointer-events: none;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 0.6rem;
  padding: 1rem 1.1rem;
  margin-bottom: 1rem;
}
.panel h2 { font-size: 1.05rem; margin: 0 0 0.6rem; color: var(--accent); }
.panel p { font-size: 0.98rem; margin: 0.4rem 0; }
.panel-more { font: 0.85rem/1.4 var(--sans); }
.link-list { list-style: none; padding: 0; margin: 0; font-size: 0.98rem; }
.link-list li { padding: 0.4rem 0; border-top: 1px solid var(--rule); }
.link-list li:first-child { border-top: 0; padding-top: 0; }

/* "Apps we love" and "News we read" on the home page: side by side when wide, stacked on a phone */
.home-panels { display: grid; gap: 0 1rem; margin-top: 2rem; }
@media (min-width: 40rem) {
  .home-panels { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
}

/* "Space Flees" over "Anniversary Rendition" (John, 2026-10-06), on a black plate like the 1987 EGA screen */
.ar-title { margin: 0.2rem 0 0.6rem !important; }
.ega-plate {
  display: inline-block;
  background: #000;
  border-radius: 0.35rem;
  padding: 0.35rem 0.6rem;
  font: 700 1.05rem/1.35 var(--sans);
}
.ar-space { color: var(--ega-magenta); }
.ar-red { color: var(--ega-red); }
.ar-purple { color: var(--ega-purple); }

/* An app's own page */
.app-hero { display: flex; gap: 1.25rem; align-items: center; flex-wrap: wrap; margin-top: 0.5rem; }
.app-hero > div { flex: 1 1 18rem; min-width: 0; }
.app-hero-icon { flex: none; width: 160px; height: 160px; border-radius: 22.5%; border: 1px solid var(--rule); }
.app-hero h1 { margin-bottom: 0.25rem; }
.app-hero .subtitle { margin-bottom: 0.4rem; }
.dict-entry {
  font-size: 1.15rem;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-left: 4px solid var(--accent);
  border-radius: 0.4rem;
  padding: 0.75rem 1rem;
}
.dict-emoji { font-size: 1.3rem; }

.apps-callout { font: 0.95rem/1.4 var(--sans); margin-top: 1.5rem; }
.policy h2, .support h2 { margin-top: 2rem; }
.support h3 { margin-top: 1.4rem; }

@media (max-width: 480px) {
  .app { flex-direction: column; }
  .app-icon { width: 88px; height: 88px; }
  .app-hero-icon { width: 112px; height: 112px; }
  body { font-size: 1.0625rem; }
  h1, .hero h1 { font-size: 1.7rem; }
  .hero-lines, .lede { font-size: 1.08rem; }
}

/* An image in a post, on a line of its own (build.py: ![alt](src)). */
.post-figure { margin: 1.5rem 0; }
.post-figure img { display: block; max-width: 100%; height: auto; border-radius: 6px; }
.post-figure img.pixels { image-rendering: pixelated; }

/* The image carousel (build.py's :::carousel, static/carousel.js). One image at a time: a row of
   full-width slides that snaps. With JavaScript off it stays a scrollable row; the script reveals
   the buttons and dots. The track takes the keyboard's arrow keys when focused. */
.carousel { margin: 1.5rem 0; }
.carousel-track {
  display: flex;
  margin: 0;
  padding: 0;
  list-style: none;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  overscroll-behavior-x: contain;
  border-radius: 6px;
  background: #000;
}
.carousel-track:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.carousel-track { align-items: center; }
.carousel-slide { flex: 0 0 100%; scroll-snap-align: start; scroll-snap-stop: always; margin: 0; display: flex; justify-content: center; }
.carousel-slide img { display: block; width: 100%; height: auto; max-height: min(75vh, 40rem); object-fit: contain; }
/* A phone's screen in portrait: a capped height, as wide as that makes it, centered on black. */
.carousel-slide img.tall { width: auto; max-width: 100%; height: min(75vh, 36rem); }
.carousel-controls { display: flex; align-items: center; justify-content: center; gap: 0.5rem; margin-top: 0.6rem; }
.carousel-controls[hidden] { display: none; }
.carousel-dots { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; }
.carousel-btn, .carousel-dot {
  appearance: none;
  background: none;
  border: 0;
  padding: 0;
  margin: 0;
  color: var(--accent);
  cursor: pointer;
}
.carousel-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
}
.carousel-btn:disabled { color: var(--muted); opacity: 0.4; cursor: default; }
.carousel-btn:hover:not(:disabled) { background: var(--accent-soft); }
/* A dot is 12 px across inside a 28 px target. */
.carousel-dot { width: 28px; height: 28px; display: inline-flex; align-items: center; justify-content: center; }
.carousel-dot::before {
  content: "";
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid var(--accent);
  box-sizing: border-box;
}
.carousel-dot[aria-current="true"]::before { background: var(--accent); }
.carousel-btn:focus-visible, .carousel-dot:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 50%; }
@media (prefers-reduced-motion: reduce) { .carousel-track { scroll-behavior: auto; } }

/* The language menu, after the nav's sections (build.py's language_switch): a <details>, so it
   needs no JavaScript. Its summary names the current language; the list opens under the header's
   right edge (anchored to the header, so it stays on screen wherever the nav wraps), and across the
   header's width on a phone. */
.site-header { position: relative; }
.lang-menu summary {
  display: inline-flex;
  align-items: center;
  gap: 0.3em;
  list-style: none;
  cursor: pointer;
  color: var(--muted);
  border: 1px solid var(--rule);
  border-radius: 0.3em;
  padding: 0 0.4em;
}
.lang-menu summary::-webkit-details-marker { display: none; }
.lang-menu summary::after { content: "▾"; font-size: 0.75em; }
.lang-menu summary:hover, .lang-menu[open] summary { color: var(--accent); }
.lang-menu summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.lang-menu .globe { flex: none; }
.lang-menu ul {
  position: absolute;
  z-index: 10;
  top: calc(100% - 0.4rem);
  right: 1rem;
  margin: 0;
  padding: 0.35rem 0;
  list-style: none;
  min-width: 10rem;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 0.5rem;
  box-shadow: 0 0.5rem 1.5rem rgb(0 0 0 / 0.14);
}
.lang-menu li > * { display: block; padding: 0.3rem 1rem; white-space: nowrap; }
.site-header nav .lang-menu li a { color: var(--text); }
.site-header nav .lang-menu li a:hover { color: var(--accent); background: var(--accent-soft); }
.lang-menu li [aria-current] { color: var(--accent); font-weight: 600; }
.lang-menu li [aria-current]::before { content: "✓ "; }
@media (max-width: 480px) {
  .lang-menu ul { left: 1rem; display: grid; grid-template-columns: repeat(auto-fill, minmax(7.5rem, 1fr)); }
}
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* A personal note from John near the top of one language's landing page (pages/eu/index.html: the
   Basque one, with his eguzkilore drawing; pages/mt/index.html: the Maltese one, with a Malta
   flag). */
.home-note {
  display: flex;
  align-items: center;
  gap: 1.1rem;
  margin: 1.75rem 0 0.5rem;
  padding: 1rem 1.2rem;
  background: var(--accent-soft);
  border-radius: 0.6rem;
}
.home-note h2 { margin: 0 0 0.3rem; font-size: 1.1rem; color: var(--accent); }
.home-note p { margin: 0; }
.home-note-text { min-width: 0; flex: 1; }
.home-note .eguzkilore { flex: none; width: 6.5rem; height: auto; }
.home-note .malta-flag { flex: none; width: 7.5rem; height: auto; }
@media (max-width: 480px) {
  .home-note { flex-direction: column; align-items: flex-start; }
}

/* The eguzkilore (Carlina acaulis), drawn for the Basque note (tools/eguzkilore.py): silvery rays
   around a golden disc, over dry, spiny leaves, in light and dark mode. */
.eguzkilore {
  --eg-leaf: #ead9bf;
  --eg-leaf-line: var(--wood);
  --eg-ray: #fffdf8;
  --eg-ray-line: #8f887a;
  --eg-disc: #f0c065;
  --eg-disc-line: #9a6a1f;
  --eg-floret: #7a4b00;
}
@media (prefers-color-scheme: dark) {
  .eguzkilore {
    --eg-leaf: #4a3b2a;
    --eg-ray: #e6e1d5;
    --eg-ray-line: #77715f;
    --eg-disc: #c08c2e;
    --eg-disc-line: #ffcf7a;
    --eg-floret: #3d2706;
  }
}
.eguzkilore .eg-bract { fill: var(--eg-leaf); stroke: var(--eg-leaf-line); }
.eguzkilore .eg-spine { fill: none; stroke: var(--eg-leaf-line); }
.eguzkilore .eg-ray { fill: var(--eg-ray); stroke: var(--eg-ray-line); }
.eguzkilore .eg-disc { fill: var(--eg-disc); stroke: var(--eg-disc-line); }
.eguzkilore .eg-floret { fill: var(--eg-floret); }

/* The Malta flag, drawn for the Maltese note (tools/malta_flag.py): white and red bands with the
   Maltese cross counterchanged across them; a softer white and a deeper red in dark mode, and a
   faint edge so the white band shows on the light note. */
.malta-flag { --mf-white: #ffffff; --mf-red: #cf142b; --mf-edge: #b8b2a6; }
@media (prefers-color-scheme: dark) {
  .malta-flag { --mf-white: #f2ede4; --mf-red: #a3192b; --mf-edge: transparent; }
}
.malta-flag .mf-white { fill: var(--mf-white); }
.malta-flag .mf-red { fill: var(--mf-red); }
.malta-flag .mf-edge { fill: none; stroke: var(--mf-edge); stroke-width: 0.6; }

/* The Athletic Club box (build.py's athletic_box, filled in by worker/athletic.js): a small card at
   the top of the footer on every page, larger after the Basque landing page's note. A band of the
   club's red and white stripes along its top; results on the left and the next match on the right
   when there's room, stacked on a phone. Before the Worker fills it, it holds only the club's name,
   linked. */
.athletic {
  position: relative;
  margin: 0 0 1.25rem;
  padding: 0.95rem 1rem 0.75rem;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 0.6rem;
  overflow: hidden;
  font: 0.85rem/1.45 var(--sans);
  color: var(--text);
  overflow-wrap: break-word;
}
.athletic::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 5px;
  background: repeating-linear-gradient(90deg, var(--ath-red) 0 12px, var(--ath-white) 12px 24px);
  border-bottom: 1px solid var(--rule);
}
.athletic .athletic-heading { font-size: 0.95rem; margin: 0; }
.athletic .athletic-heading a { color: var(--text); text-decoration: none; }
.athletic .athletic-heading a:hover { color: var(--ath-red); }
.athletic-body {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(15rem, 100%), 1fr));
  gap: 0.6rem 1.5rem;
  margin-top: 0.5rem;
}
.athletic h3 {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin: 0 0 0.2rem;
}
.athletic ul { list-style: none; margin: 0; padding: 0; }
.athletic li, .athletic p { margin: 0 0 0.35rem; }
.athletic-match, .athletic-meta { display: block; }
.athletic-score { font-weight: 700; font-variant-numeric: tabular-nums; }
.athletic-meta, .athletic-source, .athletic-pens { color: var(--muted); font-size: 0.78rem; }
.athletic-off { color: var(--muted); }
.athletic-news { grid-column: 1 / -1; }
.athletic .athletic-credit { font-size: 0.72rem; color: var(--muted); margin: 0.25rem 0 0; }
.athletic-credit a, .athletic-source { color: var(--muted); }
/* On the Basque landing page, after John's note. */
.athletic-feature { margin: 1rem 0 0.5rem; font-size: 0.95rem; }
.athletic-feature .athletic-heading { font-size: 1.1rem; }
/* Each team's mark: a small disc in its kit's two main colors (CLUB_COLORS in worker/athletic.js,
   which sets --c1 and --c2), about the cap height of the name, centered on its capitals, with a
   hairline edge so a white half shows on the light card and a dark one on the dark card. Our own
   drawing, never a crest (John, 2026-10-13). A club without colors gets a plain gray disc. */
.club { white-space: nowrap; }
.club-mark {
  --club-edge: #a39d91;
  display: inline-block;
  width: 0.8em;
  height: 0.8em;
  margin-right: 0.3em;
  vertical-align: -0.06em;
  border: 1px solid var(--club-edge);
  border-radius: 50%;
  background: var(--c1);
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}
.club-mark-stripes { background: linear-gradient(90deg, var(--c1) 0 20%, var(--c2) 20% 40%, var(--c1) 40% 60%, var(--c2) 60% 80%, var(--c1) 80%); }
.club-mark-hoops { background: linear-gradient(180deg, var(--c1) 0 20%, var(--c2) 20% 40%, var(--c1) 40% 60%, var(--c2) 60% 80%, var(--c1) 80%); }
.club-mark-halves { background: linear-gradient(90deg, var(--c1) 50%, var(--c2) 50%); }
.club-mark-sash { background: linear-gradient(45deg, var(--c1) 0 36%, var(--c2) 36% 64%, var(--c1) 64%); }
.club-mark-band { background: linear-gradient(180deg, var(--c1) 0 36%, var(--c2) 36% 64%, var(--c1) 64%); }
.club-mark-unknown { background: #c9c4ba; }
@media (prefers-color-scheme: dark) {
  /* A little dimmer, like the band's softer red and white. */
  .club-mark { --club-edge: #6f737a; filter: brightness(0.9); }
  .club-mark-unknown { background: #5a5e65; }
}
@media (forced-colors: active) {
  .club-mark { display: none; }
}

/* German: long compounds break at a hyphen rather than overflow a phone's width. (The other
   Latin-script translations need nothing of their own.) */
:lang(de) :is(h1, h2, h3, p, li, dd, td) { hyphens: auto; }

/* Japanese (build.py's LANGS["ja"]): system Japanese fonts first, Mincho where the English uses a
   serif, roomier lines, phrase-aware line breaks in headings and short lines (auto-phrase, where
   supported), and upright text where the English slants it (oblique kana and kanji look wrong). */
:root:lang(ja) {
  --serif: "Hiragino Mincho ProN", "Noto Serif JP", "Yu Mincho", YuMincho, serif;
  --sans: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Yu Gothic", YuGothic, Meiryo, sans-serif;
}
body:lang(ja) { line-height: 1.85; }
:lang(ja) :is(h1, h2, h3) { line-height: 1.45; }
:lang(ja) :is(p, li, dd, td) { line-break: strict; }
@supports (word-break: auto-phrase) {
  :lang(ja) :is(h1, h2, h3, .lede, .hero-lines, .subtitle, .footer-line, .card p) { word-break: auto-phrase; }
}
:lang(ja) :is(em, .subtitle, .mottos, .footer-line, .placeholder figcaption, .ph-caption) { font-style: normal; }
:lang(ja) em { font-weight: 600; }
:lang(ja) :is(.crumbs, .card-section, .app-division, .badge, .status, .athletic h3) { letter-spacing: 0.04em; }

/* Traditional Chinese (build.py's LANGS["zh-tw"], <html lang="zh-Hant-TW">; :lang(zh-Hant) also
   matches the region): system Traditional Chinese fonts first (PingFang TC and Songti TC on Apple
   devices, Noto Sans/Serif TC, then Microsoft JhengHei and PMingLiU on Windows), the same roomier
   lines and upright emphasis as the Japanese. auto-phrase is Japanese only, so not here. */
:root:lang(zh-Hant) {
  --serif: "Songti TC", "Noto Serif TC", "Source Han Serif TC", PMingLiU, serif;
  --sans: "PingFang TC", "Noto Sans TC", "Source Han Sans TC", "Microsoft JhengHei", sans-serif;
}
body:lang(zh-Hant) { line-height: 1.85; }
:lang(zh-Hant) :is(h1, h2, h3) { line-height: 1.45; }
:lang(zh-Hant) :is(p, li, dd, td) { line-break: strict; }
:lang(zh-Hant) :is(em, .subtitle, .mottos, .footer-line, .placeholder figcaption, .ph-caption) { font-style: normal; }
:lang(zh-Hant) em { font-weight: 600; }
:lang(zh-Hant) :is(.crumbs, .card-section, .app-division, .badge, .status, .athletic h3) { letter-spacing: 0.04em; }

/* The note beside a store button: which devices, and what's still coming. */
.store-note { color: var(--muted); font-size: 0.85rem; }
