/*
 * Public site of The Nine Characterz (increment 1, step 3: D31, D33, D51, D52, ADR-0033).
 * Brand palette and themes of the placeholder page; glass navigation pill with the menu inside.
 * No CSS framework: everything here is ours.
 */
@font-face {
  font-family: 'Varela Round';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/varela-round-latin.woff2') format('woff2');
}


/* Palette and navigation pill: css/pill.css (shared with the admin, D86) */

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font-family: 'Varela Round', system-ui, sans-serif;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  transition: background-color .4s ease, color .4s ease;
}
a { color: inherit; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 8px; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---------- Page: the pill, then the title, then the content (D31) ---------- */
.site-main {
  flex: 1;
  padding: calc(var(--pill-top) + var(--pill-h) + 18px) 16px 32px;
  width: min(1100px, 100%);
  margin: 0 auto;
}
.page-title {
  margin: 0 0 1rem;
  font-size: clamp(1.4rem, 5vw, 2rem);
  font-weight: 400;
}


/* ---------- Footer: on every page, above the quick bar (D33; piano 10, step 1a) ---------- */
.site-footer {
  padding: 18px 16px 20px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: .8rem;
}
.site-footer ul {
  list-style: none;
  margin: 0 auto;
  padding: 0;
  width: min(1100px, 100%);
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px 18px;
  align-items: center;
}
.site-footer a { color: var(--muted); text-decoration: none; display: inline-flex; min-height: 32px; align-items: center; }
.site-footer a:hover { color: var(--text); }



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

/* Text pages (D43): readable column, Markdown content */
.text-page {
  max-width: 42rem;
  margin: 0 auto;
  padding: 8px 0 32px;
  line-height: 1.65;
}
.text-page h1 { font-size: clamp(1.6rem, 6vw, 2.3rem); font-weight: 400; line-height: 1.2; margin: 8px 0 24px; }
.text-page h2 { font-size: 1.2rem; font-weight: 400; margin: 32px 0 8px; color: var(--menu-current); }
.text-page p, .text-page ul { margin: 0 0 14px; }
.text-page ul { padding-left: 1.2em; }
.text-page a { color: var(--text); text-decoration-color: var(--menu-current); text-underline-offset: 3px; }
.text-page code { font-size: .9em; padding: 1px 6px; border-radius: 6px; background: var(--line); white-space: nowrap; }
.text-page table { width: 100%; border-collapse: collapse; margin: 8px 0 18px; font-size: .95rem; display: block; overflow-x: auto; }
.text-page th, .text-page td { text-align: left; vertical-align: top; padding: 8px 12px 8px 0; border-bottom: 1px solid var(--line); }
.text-page th { color: var(--muted); font-weight: 400; }
.site-footer a[aria-current="page"] { color: var(--text); }

/* ---------- Colours of the sections (piano 10): each section its neon; in the light theme the unlit tubes ---------- */
:root {
  --c-discover: var(--kournikova);
  --c-works: var(--dodger);
  --c-singles: var(--pink);
  --c-characters: var(--spring);
  --c-cast: var(--heliotrope);
  --bar-h: calc(60px + env(safe-area-inset-bottom));
}
[data-theme="light"] {
  --c-discover: #5C4D0E;
  --c-works: #22307A;
  --c-singles: #6E1A4B;
  --c-characters: #0D5A3E;
  --c-cast: #3F2470;
}

/* ---------- Quick bar of the sections: fixed below, on phones and computers (piano 10, step 1a) ---------- */
body.has-quick-bar { padding-bottom: var(--bar-h); }
.quick-bar {
  position: fixed;
  z-index: 45;
  left: 0;
  right: 0;
  bottom: 0;
  height: var(--bar-h);
  padding: 0 4px env(safe-area-inset-bottom);
  background: var(--pill-bg);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  backdrop-filter: blur(14px) saturate(140%);
  border-top: 1px solid var(--line);
}
.quick-bar ul { list-style: none; margin: 0 auto; padding: 0; height: 100%; max-width: 650px; display: flex; }
.quick-bar li { flex: 1 1 0; min-width: 0; }
.quick-bar a {
  height: 100%;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 5px;
  padding: 6px 2px;
  color: var(--muted);
  font-size: .74rem;
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* The tube of each section: faint, lit on the open one */
.quick-bar a::before { content: ""; width: 24px; height: 3px; border-radius: 3px; background: var(--tube); opacity: .35; }
.quick-bar a:hover { color: var(--text); }
.quick-bar a[aria-current] { color: var(--text); }
.quick-bar a[aria-current]::before { opacity: 1; box-shadow: 0 0 6px var(--tube), 0 0 16px var(--tube); }
[data-theme="light"] .quick-bar a[aria-current]::before { box-shadow: none; }
.quick-bar a[data-pending] { cursor: default; }
.quick-discover { --tube: var(--c-discover); }
.quick-works { --tube: var(--c-works); }
.quick-singles { --tube: var(--c-singles); }
.quick-characters { --tube: var(--c-characters); }
.quick-cast { --tube: var(--c-cast); }
@media (min-width: 900px) { .quick-bar a { font-size: .85rem; } }

/* The theme switched: the tubes flicker on, or flicker off (piano 10) */
@keyframes flicker-on {
  0% { opacity: .15; }
  12% { opacity: 1; }
  18% { opacity: .2; }
  30% { opacity: 1; }
  36% { opacity: .35; }
  55%, 100% { opacity: 1; }
}
@keyframes flicker-off {
  0%, 25%, 100% { opacity: 1; }
  15% { opacity: .3; }
  40% { opacity: .2; }
  60% { opacity: .9; }
}
.turning-on .quick-bar a[aria-current]::before { animation: flicker-on .9s steps(1, end) both; }
.turning-off .quick-bar a[aria-current="page"]::before { animation: flicker-off .7s steps(1, end) both; }
/* A neon alive: now and then the tube of the open section flickers briefly (site.js) */
@keyframes alive { 0%, 24%, 100% { opacity: 1; } 8% { opacity: .35; } 12% { opacity: 1; } 20% { opacity: .5; } }
.quick-bar a.is-alive::before { animation: alive 1.4s steps(1, end); }/* Narrow phones: the long names of the sections (Einzelposter, Personnages) still whole */
@media (max-width: 400px) { .quick-bar ul { padding: 0 2px; } .quick-bar a { padding: 6px 0; font-size: .66rem; letter-spacing: -.01em; } }
/* Phones in landscape (piano 10): little height, so a lower quick bar and a thin footer; still easy to touch (24 px) */
@media (pointer: coarse) and (orientation: landscape) and (max-height: 520px) {
  :root { --bar-h: calc(42px + env(safe-area-inset-bottom)); }
  .quick-bar a { gap: 3px; padding: 4px 2px; font-size: .68rem; }
  .quick-bar a::before { height: 2px; }
  .site-footer { padding: 4px 16px 6px; font-size: .7rem; }
  .site-footer ul { gap: 0 14px; }
  .site-footer a { min-height: 24px; }
}

/* ---------- Phones (piano 10): the footer hides behind the quick bar, a tab with an arrow pulls it up ---------- */
.footer-toggle { display: none; }
@media (max-width: 899px), (pointer: coarse) and (orientation: landscape) and (max-height: 520px) {
  body.has-quick-bar { padding-bottom: calc(var(--bar-h) + 22px); }
  .site-footer { position: fixed; z-index: 44; left: 0; right: 0; bottom: var(--bar-h); padding: 0; border: 0; pointer-events: none; transform: translateY(calc(100% - 26px)); transition: transform .3s ease; }
  .site-footer > * { pointer-events: auto; }
  .footer-toggle { display: flex; align-items: center; justify-content: center; width: 56px; height: 26px; margin: 0 auto; padding: 0; border: 1px solid var(--line); border-bottom: 0; border-radius: 14px 14px 0 0; background: var(--pill-bg); color: var(--muted); -webkit-backdrop-filter: blur(14px) saturate(140%); backdrop-filter: blur(14px) saturate(140%); cursor: pointer; }
  .footer-toggle svg { transition: transform .3s ease; }
  .site-footer ul { padding: 12px 16px 14px; background: var(--pill-bg); -webkit-backdrop-filter: blur(14px) saturate(140%); backdrop-filter: blur(14px) saturate(140%); border-top: 1px solid var(--line); opacity: 0; transition: opacity .2s ease; }
  body.footer-open .site-footer { transform: none; }
  body.footer-open .site-footer ul { opacity: 1; }
  body.footer-open .footer-toggle svg { transform: rotate(180deg); }
  .footer-toggle:hover { color: var(--text); }
  /* Discover: the tunnel goes down to the bar */
  body.discover.has-quick-bar { padding-bottom: var(--bar-h); }
}
/* The name in the footer as the counter of Discover: its yellow, bold in the light theme (piano 10) */
.footer-brand { color: var(--c-discover); }
[data-theme="light"] .footer-brand { font-weight: 700; }

/* ---------- Lines that roll like on a ring (piano 10, 2026-10-24/26; site.js) ----------
   One line each, never cut: without the script or with "reduce motion" a long one wraps; with the script it stays on
   one line and rolls, stopping under the mouse or with the focus inside (WCAG 2.2.2) */
.roll-line { display: block; }
.is-rolling .roll-line { overflow: hidden; white-space: nowrap; }
.roll-line.is-long > span { display: inline-block; padding-right: 2.5em; animation: line-roll var(--roll, 8s) linear infinite; }
/* Stopped under a real mouse and with the focus of the keyboard; a tap or a click never leaves a line stopped (2026-10-28) */
@media (hover: hover) { :is(a, .tunnel-card):hover .roll-line > span { animation-play-state: paused; } }
:is(a:focus-visible, .tunnel-card:has(:focus-visible)) .roll-line > span { animation-play-state: paused; }
@keyframes line-roll { to { transform: translateX(-100%); } }
@media (prefers-reduced-motion: reduce) { .roll-line.is-long > span { animation: none; } }

/* ---------- The pages of a list (piano 10, 2026-10-27): singles and works ----------
   At the bottom of the page, in the middle, in the colour of the section (--accent) and of the theme; the current page
   lit, the ones that cannot be reached soft */
.pager { display: flex; justify-content: center; margin: 44px 0 8px; }
.pager-list { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 0; padding: 0; list-style: none; }
.pager-link { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; height: 44px; padding: 0 14px; border: 1px solid var(--line); border-radius: 999px; color: var(--text); font-size: .95rem; text-decoration: none; transition: border-color .2s ease, box-shadow .2s ease; }
a.pager-link:hover, a.pager-link:focus-visible { border-color: var(--accent, var(--text)); }
.pager-item.is-current .pager-link { border: 2px solid var(--accent, var(--text)); color: var(--accent, var(--text)); text-shadow: 0 0 8px color-mix(in srgb, var(--accent, var(--text)) 70%, transparent); box-shadow: 0 0 10px color-mix(in srgb, var(--accent, var(--text)) 55%, transparent); }
[data-theme="light"] .pager-item.is-current .pager-link { color: color-mix(in srgb, var(--accent, var(--text)) 45%, #1B1838); text-shadow: none; box-shadow: none; }
.pager-item.is-off .pager-link { color: var(--muted); opacity: .5; }
/* Phones: the numbers on one row, "Previous" and "Next" together on the row below, never one alone */
@media (max-width: 599px) {
  .pager-list { row-gap: 10px; }
  .pager-item { order: 1; }
  .pager-item.prev, .pager-item.next { order: 2; }
  .pager-item.prev { margin-left: auto; }
  .pager-item.next { margin-right: auto; }
  .pager-list::after { content: ""; order: 1; flex-basis: 100%; height: 0; }
}
@media (prefers-reduced-motion: reduce) { .pager-link { transition: none; } }

/* ---------- The search (piano 11, 2026-10-31, as the admin's, D255): the X in the field, the results in the panel of
   the pill, all of them, to scroll inside it; the same rows in the page of the search ---------- */
.pill-clear { flex: none; display: grid; place-items: center; width: 30px; height: 30px; margin-right: -6px; padding: 0; border: 0; border-radius: 50%; background: transparent; color: var(--pill-muted); cursor: pointer; }
.pill-clear:hover { background: var(--pill-hover); color: var(--pill-text); }
.pill-clear[hidden] { display: none; }
.search-results { max-height: calc(100dvh - var(--bar-h) - 120px); overflow-y: auto; overscroll-behavior: contain; padding-top: 4px; }
.search-list { margin: 4px 0; padding: 0; list-style: none; }
.search-row { display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 5px 8px; border-radius: 12px; color: var(--pill-text, var(--text)); text-decoration: none; }
.search-row:hover, .search-row[aria-selected="true"] { background: var(--pill-hover); }
.search-row[aria-selected="true"], .search-row:focus-visible { outline: 0; box-shadow: inset 0 0 0 2px var(--focus); }
.search-thumb { flex: none; width: 40px; height: 40px; border-radius: 6px; object-fit: cover; }
/* A poster and a single are taller than wide: whole, never cut */
.search-thumb.is-tall { object-fit: contain; }
.search-thumb.is-empty { visibility: hidden; }
/* One piece of information on each line (2026-10-31): the name, the kind, the work, the collection, the interpreter */
.search-line { min-width: 0; display: grid; gap: 1px; }
.search-name { font-size: 1.05rem; overflow-wrap: anywhere; }
.search-name mark { padding: 0; background: none; color: var(--c-discover); }
.search-flag { display: inline-block; width: 15px; height: 15px; margin-left: 5px; border-radius: 50%; vertical-align: -2px; }
.search-meta { color: var(--pill-muted, var(--muted)); font-size: .78rem; }
.search-kind { color: var(--pill-text, var(--text)); }
.search-sep { height: 2px; margin: 8px 8px 6px; border: 0; border-radius: 2px; background: linear-gradient(90deg, var(--c-works), var(--c-cast), var(--c-singles), var(--c-discover), var(--c-characters)); opacity: .6; }
.search-none { margin: 12px 8px; color: var(--pill-muted, var(--muted)); }
@media (max-width: 600px) { .search-name { font-size: 1rem; } .search-row { gap: 10px; } }
/* The page of the search: the same rows, in a readable column */
.search-page .search-list, .search-page .search-sep, .search-page .search-count { max-width: 760px; }
.search-count { color: var(--muted); }
.search-page .search-row { color: var(--text); }
.search-page .search-row:hover { background: color-mix(in srgb, var(--text) 7%, transparent); }
/* Searching, the pill takes the whole row (2026-10-31, the user): it grows to the right and the round pills of the
   language and of the theme fade under it; on computers the row of the pill and the two round ones, not the screen */
.pill-bar .pill { transition: flex-basis .3s ease; }
.pill-bar .round-pill { transition: width .3s ease, padding .3s ease, margin .3s ease, opacity .2s ease; }
.pill-bar.is-searching .pill { flex-basis: calc(640px + 2 * var(--pill-h) + 16px); }
.pill-bar.is-searching .round-pill { width: 0; padding: 0; margin-left: -8px; overflow: hidden; opacity: 0; pointer-events: none; }
@media (prefers-reduced-motion: reduce) { .pill-bar .pill, .pill-bar .round-pill { transition: none; } }
/* The deck of a person in a result: the card in front, two behind a bit turned, the empty ones in the colour of the
   cast; search.js turns it */
.search-deck { position: relative; display: block; }
.search-deck img, .search-deck .is-blank { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border-radius: 6px; transition: transform .5s ease, opacity .5s ease, filter .5s ease; }
.search-deck [data-place="0"] { z-index: 3; }
.search-deck [data-place="1"] { z-index: 2; transform: translate(5px, -3px) rotate(7deg) scale(.9); filter: brightness(.7); }
.search-deck [data-place="2"] { z-index: 1; transform: translate(-5px, -2px) rotate(-7deg) scale(.86); filter: brightness(.5); }
.search-deck [data-place="hide"] { z-index: 0; opacity: 0; }
.search-deck .is-blank { border: 1px dashed color-mix(in srgb, var(--c-cast) 70%, var(--pill-text, var(--text))); background: color-mix(in srgb, var(--c-cast) 30%, var(--bg)); filter: none; }
@media (prefers-reduced-motion: reduce) { .search-deck img { transition: none; } }
