/* The Babel Tavern. Limewash and ink by day, hearth soot by night; candle amber is the one accent. */
@font-face {
  font-family: "Alegreya"; font-style: normal; font-weight: 700; font-display: swap;
  src: url("assets/fonts/alegreya-700.woff2") format("woff2");
  unicode-range: U+0000-017F, U+02BB-02DC, U+2000-206F, U+20AC, U+2122, U+2212;
}
:root {
  color-scheme: light;
  --bg: #f7f1e6; --bg-2: #efe6d6; --card: #fffaf1;
  --ink: #1d1712; --ink-2: #4d4337; --ink-3: #6b6053;
  --line: #e3d8c5; --line-strong: #8a7c67;
  --accent: #94540c; /* amber as text, links and focus on light grounds */
  --amber: #e3a857; --amber-hover: #eab96f; --on-amber: #1d1712; /* the fill of the quest's actions */
  --shadow: 0 10px 30px rgba(40, 24, 8, .14);
  --r: 14px; --r-sm: 8px;
  --font: -apple-system, BlinkMacSystemFont, "Helvetica Neue", "Segoe UI", Arial, sans-serif;
  --display: "Alegreya", Georgia, "Times New Roman", serif;
  --maxw: 1180px; --gutter: 20px;
  --pad-l: max(var(--gutter), env(safe-area-inset-left)); --pad-r: max(var(--gutter), env(safe-area-inset-right));
  /* the shared explorations footer (navigation, cookie settings) follows the page theme */
  --exploration-footer-bg: var(--bg); --exploration-footer-ink: var(--ink-2); --exploration-footer-border: var(--line);
}
[data-theme="dark"] {
  color-scheme: dark;
  --bg: #15110d; --bg-2: #1b1611; --card: #1f1914;
  --ink: #f3eadb; --ink-2: #cdbfa9; --ink-3: #a8998a;
  --line: #2e261e; --line-strong: #7d6d5b;
  --accent: #e3a857;
  --shadow: 0 10px 30px rgba(0, 0, 0, .5);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.55 var(--font); -webkit-font-smoothing: antialiased; }
:lang(ja) { font-family: -apple-system, "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic UI", Meiryo, "Noto Sans JP", sans-serif; }
:lang(zh) { font-family: -apple-system, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif; }
img, video { display: block; max-width: 100%; }
a { color: inherit; }
button, select, input { font: inherit; color: inherit; accent-color: var(--accent); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--ink); color: var(--bg); padding: 8px 12px; border-radius: var(--r-sm); z-index: 50; }
.skip:focus { left: 8px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* logos: black on light, white on dark; the full logo on wide screens, the mark on phones */
.logo--white, .logo--mark { display: none; }
[data-theme="dark"] .logo--black { display: none; }
[data-theme="dark"] .logo--white { display: block; }
[data-theme="dark"] .logo--white.logo--mark { display: none; }

/* buttons: one primary (the quest's path), one secondary, text links for the rest */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 10px 20px; border-radius: 999px; font-weight: 600; font-size: 15px; line-height: 1.2; text-decoration: none; cursor: pointer; border: 1px solid transparent; background: none; transition: transform .12s, background-color .15s, border-color .15s, color .15s; }
.btn:active { transform: scale(.97); }
.btn--primary { background: var(--amber); color: var(--on-amber); border-color: var(--amber); }
.btn--secondary { border-color: var(--line-strong); color: var(--ink); }
.btn--small { min-height: 38px; padding: 7px 16px; font-size: 14px; }
.btn[disabled], .btn--locked, .btn[aria-disabled="true"] { background: transparent; border: 1px dashed var(--line-strong); color: var(--ink-3); cursor: not-allowed; }
.btn[disabled]:active { transform: none; }
@media (hover: hover) {
  .btn--primary:not([disabled]):hover { background: var(--amber-hover); border-color: var(--amber-hover); }
  .btn--secondary:not([disabled]):not([aria-disabled="true"]):hover, .chip:hover, .icon-btn:hover, .lang select:hover, .clue:hover {
    border-color: var(--accent); background-color: color-mix(in srgb, var(--accent) 10%, transparent);
  }
  .seg button:not([aria-pressed="true"]):hover { background: var(--bg-2); }
}

/* header */
.top { position: sticky; top: 0; z-index: 20; background: var(--bg); border-bottom: 1px solid var(--line); }
.top__inner { max-width: var(--maxw); margin: 0 auto; padding: 8px var(--pad-r) 8px var(--pad-l); display: flex; align-items: center; gap: 18px; min-height: 56px; }
.brand { display: flex; align-items: center; flex: none; padding: 10px; margin: -10px; }
.brand .logo { height: 24px; width: auto; }
.crumbs { display: flex; align-items: center; gap: 8px; color: var(--ink-3); font-size: 14px; min-width: 0; }
.crumbs strong { color: var(--ink); font-weight: 600; white-space: nowrap; }
.crumbs__back { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; text-decoration: none; color: var(--ink-2); white-space: nowrap; }
.crumbs__back:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
.crumbs__arrow { display: none; }
.top__tools { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.top__create { white-space: nowrap; border-color: var(--accent); color: var(--accent); }
.lang select { appearance: none; background: var(--card) url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'><path d='M1 1l5 5 5-5' fill='none' stroke='%238a7c67' stroke-width='1.6'/></svg>") no-repeat right 11px center / 11px; border: 1px solid var(--line-strong); border-radius: 999px; min-height: 38px; padding: 6px 28px 6px 13px; font-size: 14px; font-weight: 600; letter-spacing: .04em; cursor: pointer; }
.icon-btn { position: relative; width: 38px; height: 38px; display: grid; place-items: center; border-radius: 999px; border: 1px solid var(--line-strong); background: var(--card); cursor: pointer; }
.icon-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.i-moon { display: block; } .i-sun { display: none; }
[data-theme="dark"] .i-moon { display: none; } [data-theme="dark"] .i-sun { display: block; }

/* code chips: EN FR ES…, the native name hidden until the chip is pressed on a wide screen */
.chip__name { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
@media (min-width: 1024px) {
  [aria-pressed="true"] > .chip__name { position: static; width: auto; height: auto; overflow: visible; clip: auto; font-weight: 600; letter-spacing: 0; }
}

/* hero */
.hero { position: relative; min-height: min(78vh, 720px); display: grid; align-items: end; overflow: hidden; background: #0b0908; color: #fff; }
.hero__still, .hero__bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hero__bg { opacity: 0; transition: opacity .6s; }
.hero__bg.is-playing { opacity: 1; }
.hero__shade { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(21,17,13,.2) 0%, rgba(21,17,13,.45) 45%, rgba(21,17,13,.86) 100%); }
.hero__content { position: relative; max-width: var(--maxw); width: 100%; margin: 0 auto; padding: 48px var(--pad-r) 44px var(--pad-l); display: grid; gap: 24px; }
.hero__main { display: flex; flex-direction: column; align-items: flex-start; min-width: 0; }
.kicker { font-size: 13px; font-weight: 600; color: var(--ink-3); margin: 0 0 6px; }
.hero .kicker { text-transform: uppercase; letter-spacing: .12em; font-size: 12px; color: rgba(255,255,255,.8); text-shadow: 0 1px 10px rgba(0,0,0,.7); margin-bottom: 8px; text-wrap: balance; }
.hero :focus-visible { outline-color: var(--amber); } /* the hero is always dark: amber reads in both themes */
h1 { font-family: var(--display); font-size: clamp(44px, min(7vw, 9vh), 84px); line-height: 1; letter-spacing: -.01em; margin: 0 0 8px; font-weight: 700; }
.tagline { font-size: clamp(18px, 2.4vw, 24px); margin: 0 0 20px; color: rgba(255,255,255,.92); }
.sign { margin: 0 0 22px; }
.sign__lang { margin: 0; font-size: 12px; font-weight: 600; color: var(--amber); }
.sign__text { margin: 0 0 12px; font-family: var(--display); font-weight: 700; font-size: clamp(30px, min(4.4vw, 5.6vh), 56px); line-height: 1.08; color: #f6e3bf; text-shadow: 0 2px 18px rgba(0,0,0,.5); }
.sign__text:lang(ja) { font-family: "Hiragino Mincho ProN", "Yu Mincho", "Noto Serif JP", serif; }
.sign__text:lang(zh) { font-family: "Songti SC", "Noto Serif SC", serif; }
.sign__langs { display: flex; flex-wrap: nowrap; gap: 6px; max-width: 780px; min-height: 36px; } /* reserved before script adds the chips */
.lang-chip { position: relative; min-height: 36px; min-width: 46px; padding: 6px 12px; border-radius: 999px; border: 1px solid rgba(255,255,255,.4); background: rgba(21,17,13,.45); color: #fff; font-size: 14px; font-weight: 600; letter-spacing: .04em; cursor: pointer; transition: background-color .15s, border-color .15s; }
.lang-chip::after { content: ""; position: absolute; inset: -4px 0; } /* a 44 px tall hit area around a 36 px chip */
.lang-chip[aria-pressed="true"] { background: #f6e3bf; border-color: #f6e3bf; color: #1d1712; font-weight: 600; } /* amber is kept for actions */
@media (hover: hover) { .lang-chip:not([aria-pressed="true"]):hover { border-color: var(--amber); background: rgba(21,17,13,.7); } }
.lede { max-width: 560px; color: rgba(255,255,255,.9); margin: 0 0 22px; font-size: 17px; }
.hero__cta { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.hero .btn--secondary { border-color: rgba(255,255,255,.6); color: #fff; }
@media (hover: hover) { .hero .btn--secondary:hover { background: rgba(255,255,255,.12); border-color: #fff; } }
.hero__motion { width: 44px; height: 44px; border-color: rgba(255,255,255,.5); background: rgba(21,17,13,.4); color: #fff; }
.hero__motion .i-play { display: none; }
.hero__motion[aria-pressed="true"] .i-play { display: block; }
.hero__motion[aria-pressed="true"] .i-pause { display: none; }
@media (prefers-reduced-motion: reduce) { .hero__motion { display: none; } }
.hero__credit { margin: 14px 0 0; font-size: 12px; color: rgba(255,255,255,.78); text-shadow: 0 1px 8px rgba(0,0,0,.7); max-width: 560px; }
@media (min-width: 1024px) {
  .hero { align-items: center; }
  .hero__content { grid-template-columns: minmax(0, 1fr) 320px; column-gap: 48px; align-items: center; padding-top: 40px; padding-bottom: 40px; }
}

/* take-home downloads: the agent skill and the making-of, a quiet pair beside the main action */
.takeaway--hero { display: grid; gap: 10px; align-content: center; align-self: center; padding: 16px; border-radius: var(--r); background: var(--bg); color: var(--ink); box-shadow: 0 14px 40px rgba(0,0,0,.4); }
.takeaway--hero :focus-visible { outline-color: var(--accent); } /* the panel is the page's own surface, not the dark hero */
.takeaway__head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.takeaway__kicker { margin: 0; font-size: 13px; font-weight: 600; color: var(--ink-3); }
.takeaway__help { font-size: 13px; color: var(--accent); font-weight: 600; text-underline-offset: 3px; min-height: 32px; display: inline-flex; align-items: center; }
.dl { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: var(--r); text-decoration: none; border: 1px solid var(--line-strong); background: var(--card); color: var(--ink); transition: border-color .15s, background-color .15s; }
.dl__icon svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.dl__icon { flex: none; color: var(--accent); padding-top: 2px; }
.dl__text { display: grid; gap: 2px; min-width: 0; }
.dl__kind { font-size: 12px; font-weight: 600; color: var(--accent); }
.dl__title { font-size: 16px; font-weight: 650; line-height: 1.25; }
.dl__line { font-size: 13px; line-height: 1.4; color: var(--ink-2); }
@media (hover: hover) {
  .dl:hover { border-color: var(--accent); background-color: color-mix(in srgb, var(--accent) 7%, var(--card)); }
}
@media (min-width: 721px) and (max-width: 1023px) {
  .takeaway--hero { grid-template-columns: 1fr 1fr; max-width: 720px; }
  .takeaway--hero .takeaway__head { grid-column: 1 / -1; }
}
.takeaway--band { margin-top: 28px; padding-top: 24px; border-top: 1px solid var(--line); }
.takeaway__title { font-family: var(--display); font-size: 28px; line-height: 1.15; margin: 0 0 14px; }
.takeaway__cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; max-width: 760px; }
.quickstart { max-width: 760px; margin-top: 18px; font-size: 14px; color: var(--ink-2); }
.quickstart h4 { margin: 0 0 6px; font-size: 14px; font-weight: 650; color: var(--ink); }
.quickstart ol { margin: 0 0 10px; padding-left: 20px; }
.quickstart li { margin-bottom: 4px; }
.quickstart code { font-size: 13px; background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 1px 5px; }
.quickstart__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 0 4px; }
.quickstart__head .quickstart__label { margin: 0; }
.quickstart__label { margin: 0 0 4px; font-size: 12px; font-weight: 600; color: var(--ink-3); }
.quickstart__copy { min-height: 36px; padding: 0 2px; border: 0; background: none; color: var(--accent); font-size: 13px; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.quickstart__prompt { margin: 0 0 10px; padding: 12px 14px; border: 1px solid var(--line-strong); border-radius: var(--r-sm); background: var(--bg-2); color: var(--ink); font-size: 14px; user-select: all; }
.sheet--quickstart { max-width: 640px; }
.sheet--quickstart .quickstart { margin-top: 4px; }

.proto-note { max-width: var(--maxw); margin: 18px auto 0; padding: 10px var(--pad-r) 10px var(--pad-l); font-size: 14px; color: var(--ink-2); }
.proto-note > span { display: block; max-width: 72ch; }
.proto-note strong { color: var(--ink); }
.proto-note--inline { padding: 12px 0 0; margin: 0; max-width: 72ch; }
.proto-note--warn { font-weight: 600; color: var(--ink); }

/* on this page */
.chapters { max-width: var(--maxw); margin: 4px auto 0; padding: 0 var(--pad-r) 0 var(--pad-l); display: flex; gap: 6px 18px; flex-wrap: wrap; font-size: 14px; }
.chapters a { display: inline-flex; align-items: center; min-height: 40px; color: var(--ink-2); text-decoration: none; border-bottom: 1px solid transparent; }
.chapters a:hover { color: var(--ink); border-bottom-color: var(--accent); }
.chapters a:last-child { color: var(--accent); font-weight: 600; }

/* sections */
section { scroll-margin-top: 64px; }
#take-home, #skill-quickstart { scroll-margin-top: 76px; }
.tavern, .band { max-width: var(--maxw); margin: 0 auto; padding: 44px var(--pad-r) 44px var(--pad-l); }
.band { background: linear-gradient(var(--line), var(--line)) var(--pad-l) 0 / calc(100% - var(--pad-l) - var(--pad-r)) 1px no-repeat; }
.section-head { margin-bottom: 20px; max-width: 760px; }
.section-head h2 { font-family: var(--display); font-size: clamp(30px, 3.6vw, 40px); line-height: 1.1; margin: 0 0 8px; }
.section-head p { margin: 0 0 6px; color: var(--ink-2); }

/* quest */
.quest { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 0 0 16px; }
.quest__clues { list-style: none; display: flex; gap: 8px; flex-wrap: wrap; margin: 0; padding: 0; }
.clue { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 6px 14px; border: 1px dashed var(--line-strong); border-radius: 999px; font-size: 14px; color: var(--ink-2); background: transparent; cursor: pointer; }
.clue__dot { width: 10px; height: 10px; border-radius: 50%; border: 2px solid currentColor; flex: none; }
.clue__short { display: none; }
.clue--found { border-style: solid; border-color: var(--accent); color: var(--ink); background: color-mix(in srgb, var(--amber) 16%, transparent); }
.clue--found .clue__dot { background: var(--accent); border-color: var(--accent); }
.quest__actions { display: flex; align-items: center; gap: 10px 14px; flex-wrap: wrap; margin: 0 0 16px; }
@media (min-width: 721px) {
  /* the clues and the chest's action share one row above the room */
  .tavern { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 16px; }
  .tavern > .section-head, .tavern > .pano, .tavern > .pano__credit { grid-column: 1 / -1; }
  .quest__actions { justify-content: flex-end; }
  .tavern.is-solved > .quest, .tavern.is-solved > .quest__actions { grid-column: 1 / -1; }
  .tavern.is-solved > .quest__actions { justify-content: flex-start; }
}
.quest__done { margin: 0; font-weight: 600; }
.quest__chest { scroll-margin: 16px 0 max(16px, env(safe-area-inset-bottom)); } /* brought into view with room around it */
.quest__chest.is-ready { animation: ready 1s ease-out 2; }
@keyframes ready { 0% { box-shadow: 0 0 0 0 rgba(227,168,87,.75); } 70% { box-shadow: 0 0 0 16px rgba(227,168,87,0); } 100% { box-shadow: 0 0 0 0 rgba(227,168,87,0); } }
.quest__actions a { font-size: 14px; text-underline-offset: 3px; }

/* panorama */
/* edge to edge: out of the text column to the window's edges (--sbw is a classic scrollbar's width, set by the script) */
.pano { position: relative; overflow: hidden; background: #0b0908; margin-left: calc(50% - 50vw + var(--sbw, 0px) / 2); margin-right: calc(50% - 50vw + var(--sbw, 0px) / 2); }
.pano__credit { margin: 10px 0 0; }
.pano__track { position: relative; width: 100%; }
.pano__img { width: 100%; height: auto; }
.pano__pins { position: absolute; inset: 0; }
.pin { position: absolute; transform: translate(-50%, -50%); display: flex; flex-direction: column; align-items: center; gap: 6px; background: none; border: 0; padding: 0; cursor: pointer; color: #fff; border-radius: 14px; }
.pin[data-char="chest"] { flex-direction: row-reverse; } /* the label sits beside the ring, clear of the panorama's edge */
.pin__ring { width: 44px; height: 44px; border-radius: 50%; border: 2px solid rgba(255,255,255,.95); background: rgba(0,0,0,.25); display: grid; place-items: center; }
.pin:not(.pin--done) .pin__ring { animation: pulse 2.6s ease-out 3; }
.pin:nth-child(2) .pin__ring { animation-delay: .3s; } .pin:nth-child(3) .pin__ring { animation-delay: .6s; }
.pin:nth-child(4) .pin__ring { animation-delay: .9s; } .pin:nth-child(5) .pin__ring { animation-delay: 1.2s; }
.pin:nth-child(6) .pin__ring { animation-delay: 1.5s; }
.pin.pin--ping .pin__ring { animation: pulse 1s ease-out 2; }
.pin__ring::after { content: ""; width: 12px; height: 12px; border-radius: 50%; background: #fff; }
.pin__label { font-size: 13px; font-weight: 600; background: rgba(0,0,0,.7); padding: 3px 9px; border-radius: 999px; white-space: nowrap; }
.pin--done .pin__ring { border-color: var(--amber); } .pin--done .pin__ring::after { background: var(--amber); }
.pin:hover .pin__ring, .pin:focus-visible .pin__ring { background: rgba(255,255,255,.22); }
.pin:focus-visible { outline: 3px solid #fff; outline-offset: 4px; box-shadow: 0 0 0 7px rgba(0,0,0,.55); }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(227,168,87,.6); } 70% { box-shadow: 0 0 0 14px rgba(227,168,87,0); } 100% { box-shadow: 0 0 0 0 rgba(227,168,87,0); } }
.pano__pan { display: none; }

/* split players */
.split { display: grid; grid-template-columns: minmax(0, 360px) 1fr; gap: 28px; align-items: start; }
.player { position: relative; background: #000; border-radius: var(--r); overflow: hidden; box-shadow: var(--shadow); }
.player video { width: 100%; height: 100%; object-fit: cover; }
.media-error { position: absolute; left: 0; right: 0; top: 0; z-index: 3; margin: 0; padding: 10px 12px; background: rgba(0, 0, 0, .8); color: #fff; font-size: 13px; }
.player video { cursor: pointer; }
.pctl { position: absolute; left: 0; right: 0; bottom: 0; z-index: 2; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; padding: 24px 10px 10px; background: linear-gradient(rgba(0,0,0,0), rgba(0,0,0,.65)); pointer-events: none; }
.pctl__btn { pointer-events: auto; flex: none; width: 44px; height: 44px; display: grid; place-items: center; border-radius: 999px; border: 1px solid rgba(255,255,255,.7); background: rgba(21,17,13,.55); color: #fff; cursor: pointer; transition: background-color .15s, border-color .15s; }
.pctl__btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.pctl__play .i-play { fill: currentColor; stroke: none; }
.pctl__play .i-pause, .pctl__full .i-exit, .pctl__mute .i-muted { display: none; }
.pctl__mute[aria-pressed="true"] .i-sound { display: none; }
.pctl__mute[aria-pressed="true"] .i-muted { display: block; }
.player.is-playing .pctl__play { background: var(--amber); border-color: var(--amber); color: var(--on-amber); }
.player.is-playing .pctl__play .i-play { display: none; }
.player.is-playing .pctl__play .i-pause { display: block; }
/* the position slider: a thin line (amber as far as the clip has played) with a 44 px hit area */
.pctl__seek { --p: 0%; pointer-events: auto; flex: 1 1 60px; min-width: 60px; height: 44px; margin: 0; padding: 0; background: transparent; cursor: pointer; appearance: none; -webkit-appearance: none; border-radius: 999px; }
.pctl__seek::-webkit-slider-runnable-track { height: 4px; border-radius: 999px; background: linear-gradient(90deg, var(--amber) var(--p), rgba(255,255,255,.35) var(--p)); }
.pctl__seek::-moz-range-track { height: 4px; border-radius: 999px; background: linear-gradient(90deg, var(--amber) var(--p), rgba(255,255,255,.35) var(--p)); }
.pctl__seek::-webkit-slider-thumb { -webkit-appearance: none; width: 14px; height: 14px; margin-top: -5px; border: 0; border-radius: 50%; background: #fff; }
.pctl__seek::-moz-range-thumb { width: 14px; height: 14px; border: 0; border-radius: 50%; background: #fff; }
/* narrow players: the slider takes its own row above the buttons */
.player.pctl-narrow .pctl__seek { order: -1; flex-basis: 100%; height: 28px; }
.player.pctl-narrow .pctl__play { margin-right: auto; }
.pctl :focus-visible { outline: 3px solid #fff; outline-offset: 2px; box-shadow: 0 0 0 6px rgba(0,0,0,.55); }
@media (hover: hover) { .pctl__btn:hover { border-color: #fff; background: rgba(21,17,13,.8); } .player.is-playing .pctl__play:hover { background: var(--amber-hover); } }
.player:fullscreen { border-radius: 0; background: #000; }
.player:fullscreen video { object-fit: contain; object-position: 50% 50%; }
.player:-webkit-full-screen { border-radius: 0; background: #000; }
.player:-webkit-full-screen video { object-fit: contain; object-position: 50% 50%; }
.player:fullscreen .pctl__full .i-full, .player:-webkit-full-screen .pctl__full .i-full { display: none; }
.player:fullscreen .pctl__full .i-exit, .player:-webkit-full-screen .pctl__full .i-exit { display: block; }
.media-error a { color: var(--amber); }
.player--portrait { aspect-ratio: 3 / 4; }
.chips { display: flex; flex-wrap: nowrap; gap: 8px; margin-bottom: 16px; }
.chip { min-height: 38px; min-width: 42px; padding: 7px 10px; border-radius: 999px; border: 1px solid var(--line-strong); background: var(--card); cursor: pointer; font-size: 14px; font-weight: 600; letter-spacing: .04em; white-space: nowrap; }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.chips--small { gap: 6px; }
.chips--small .chip { min-height: 34px; min-width: 42px; padding: 5px 10px; font-size: 13px; }
.said { font-size: 20px; line-height: 1.45; margin: 0 0 10px; }
.meaning { color: var(--ink-2); margin: 0 0 12px; font-style: italic; }
.meta { color: var(--ink-3); font-size: 13px; margin: 8px 0 0; }
.lyrics { margin: 0; padding-left: 22px; font-size: 18px; line-height: 1.7; }
.lyrics li:last-child { font-weight: 700; }

/* joke */
.joke__en { font-size: 20px; margin: 0 0 16px; }
.seg { display: inline-flex; border: 1px solid var(--line-strong); border-radius: 999px; padding: 3px; background: var(--card); margin-bottom: 18px; }
.seg button { border: 0; background: none; min-height: 36px; padding: 6px 16px; border-radius: 999px; cursor: pointer; font-weight: 600; font-size: 14px; }
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--bg); }
.joke__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.jcard { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; transition: border-color .15s; }
.jcard__media { aspect-ratio: 4 / 3; margin: -16px -16px 14px; border-radius: var(--r) var(--r) 0 0; box-shadow: none; }
.jcard__media video { object-position: 50% 18%; } /* the goblin's face, from a 3:4 portrait */
.jcard:has(.is-playing) { border-color: var(--accent); }
.jcard__credit { margin: 10px 0 0; padding-top: 10px; border-top: 1px solid var(--line); }
.jcard h3 { margin: 0 0 8px; font-size: 14px; font-weight: 650; color: var(--ink-3); }
.jcard p { margin: 0 0 8px; }
.jcard .gloss { color: var(--ink-2); font-size: 14px; font-style: italic; }
.jcard .pun { font-size: 14px; color: var(--accent); }
.jcard--literal .pun { color: var(--ink-3); }
.jcard--mine { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.jcard--mine h3 { color: var(--accent); }
@media (min-width: 1024px) { .jcard--mine { grid-column: span 2; } .jcard--mine p[lang] { font-size: 20px; line-height: 1.45; } .jcard--mine .jcard__media { aspect-ratio: 16 / 9; } }

/* chain */
.chain { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 10px; }
.step { position: relative; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 12px 12px; min-height: 180px; display: flex; flex-direction: column; overflow: hidden; }
.step__n { font-size: 12px; font-weight: 650; color: var(--ink-3); }
.step__model { font-weight: 700; font-size: 14px; margin: 6px 0 4px; line-height: 1.3; }
.step__what { font-size: 13px; color: var(--ink-2); flex: 1; }
.step__num { font-family: var(--display); font-size: 24px; font-weight: 700; }
.step__cu { font-size: 12px; color: var(--ink-3); font-weight: 600; }
.step__bar { position: absolute; left: 0; bottom: 0; height: 4px; width: 0; background: var(--amber); }
.step--run { border-color: var(--accent); }
.step--done .step__bar { width: 100%; }
.chain__foot { display: flex; align-items: center; gap: 16px; margin-top: 16px; flex-wrap: wrap; }

/* made with */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r); }
.table-wrap:focus-visible { outline-offset: 3px; }
.models { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 620px; }
.models th, .models td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
.models th { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-3); background: var(--bg-2); }
.models tr:last-child td { border-bottom: 0; }
.models td.num { white-space: nowrap; font-variant-numeric: tabular-nums; }
.models .unit { display: none; }
/* the last three rows sum the build: the full-cast session, the pilot, both */
#models tbody tr:nth-last-child(-n+3) td { font-weight: 600; background: var(--bg-2); }
#models tbody tr:nth-last-child(3) td { border-top: 2px solid var(--line-strong); }
.models--both { min-width: 560px; }
.models--both td:first-child { font-weight: 600; }
.models__sub { font-family: var(--display); font-size: 24px; line-height: 1.2; margin: 26px 0 4px; }
.models__note { margin: 0 0 10px; font-size: 13px; color: var(--ink-3); max-width: 72ch; }
.notes { color: var(--ink-2); font-size: 14px; padding-left: 20px; margin: 18px 0 0; max-width: 72ch; }
.notes li { margin-bottom: 6px; }
.made__foot { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 22px; }

.foot { border-top: 1px solid var(--line); color: var(--ink-3); font-size: 13px; }
.foot__inner { max-width: var(--maxw); margin: 0 auto; padding: 30px var(--pad-r) 30px var(--pad-l); display: flex; gap: 18px; align-items: center; }
.foot p { margin: 0; max-width: 80ch; }
.foot__bar { min-height: 44px; padding-bottom: env(safe-area-inset-bottom); }
.foot__downloads { display: inline-flex; flex-wrap: wrap; gap: 0 16px; }
.foot__dl { display: inline-flex; align-items: center; min-height: 44px; color: inherit; text-underline-offset: 3px; }

/* dialogs */
.sheet { border: 0; padding: 0; background: var(--card); color: var(--ink); border-radius: var(--r); max-width: 1280px; width: min(90vw, 1280px); max-height: calc(100vh - 32px); box-shadow: var(--shadow); overscroll-behavior: contain; }
.sheet::backdrop { background: rgba(10, 7, 4, .62); backdrop-filter: blur(2px); }
/* the portrait as tall as the window allows, beside the lines */
.sheet__inner { position: relative; display: grid; grid-template-columns: minmax(0, min(46%, calc((100vh - 84px) * .75))) minmax(0, 1fr); gap: 32px; padding: 24px; }
@media (min-width: 1024px) {
  #sheet h3 { font-size: 44px; }
  #sheet .said { font-size: 24px; }
  #sheet .meaning { font-size: 18px; }
}
.sheet__inner--single { grid-template-columns: 1fr; }
/* Close stays in view in every dialog, however far it scrolls: a sticky first row of no height */
.sheet__inner { row-gap: 0; }
.sheet__close { position: sticky; top: 12px; z-index: 3; grid-column: 1 / -1; grid-row: 1; justify-self: end; margin: -12px -12px -32px 0; }
.sheet h3 { font-family: var(--display); font-size: 32px; line-height: 1.1; margin: 0 0 12px; }
.sheet__body { padding-top: 8px; min-width: 0; }
.sheet__extra:empty { display: none; }
.sheet__extra { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.sheet__extra h4 { margin: 0 0 8px; font-size: 14px; font-weight: 650; color: var(--ink); }
.sheet__extra .is-new { animation: glow 2s ease-out; border-radius: var(--r-sm); }
@keyframes glow { 0% { background: color-mix(in srgb, var(--amber) 40%, transparent); } 100% { background: transparent; } }
.clue-toast { position: absolute; left: 10px; right: 10px; top: 10px; z-index: 2; margin: 0; padding: 8px 12px; border-radius: var(--r-sm); background: rgba(21,17,13,.82); color: #fff; font-size: 14px; font-weight: 600; }
.clue-toast[hidden] { display: none; }
.sheet--riddle { max-width: 640px; }
.sheet--made { max-width: 980px; }
.made-dlg__intro { color: var(--ink-2); margin: 0 0 16px; max-width: 72ch; }
.made-dlg__stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin: 0 0 22px; }
.made-dlg__stats div { background: var(--bg-2); border-radius: var(--r-sm); padding: 12px 14px; }
.made-dlg__stats dt { font-size: 12px; font-weight: 600; color: var(--ink-3); }
.made-dlg__stats dd { margin: 2px 0 0; font-family: var(--display); font-size: clamp(20px, 5.4vw, 26px); font-weight: 700; line-height: 1.15; white-space: nowrap; }
.sheet--made h4 { margin: 18px 0 10px; font-size: 15px; font-weight: 650; }
.made-dlg__steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.made-dlg__steps li { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; gap: 10px; align-items: baseline; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.made-dlg__n { font-family: var(--display); font-weight: 700; font-size: 18px; color: var(--accent); }
.made-dlg__step small { display: block; color: var(--ink-3); font-size: 13px; }
.made-dlg__num { font-variant-numeric: tabular-nums; white-space: nowrap; color: var(--ink-2); }
.made-dlg__cards { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 22px; }
.made-dlg__links { justify-content: flex-start; margin-top: 14px; }
.q { border: 1px solid var(--line); border-radius: var(--r); padding: 14px; margin: 0 0 12px; }
.q legend { font-weight: 700; padding: 0 6px; }
.q label { display: flex; gap: 10px; align-items: center; min-height: 40px; padding: 4px; cursor: pointer; }
.q input { width: 18px; height: 18px; }
.q small { color: var(--ink-3); display: block; margin: 0 6px 6px; font-size: 13px; }
.riddle-msg { font-weight: 600; margin: 8px 0 0; min-height: 1.5em; }
.payoff { margin-top: 6px; display: grid; justify-items: center; gap: 14px; text-align: center; }
.payoff[hidden] { display: none; }
.payoff .player { width: min(100%, 420px); aspect-ratio: 4 / 5; }
.payoff__text { min-width: 0; width: 100%; max-width: 520px; display: grid; gap: 10px; justify-items: center; }
.payoff__text .said { margin: 0; }
.payoff__text .meta { margin: 0; }
.payoff__cards { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; width: 100%; text-align: left; }
.payoff__links { display: flex; flex-wrap: wrap; gap: 8px 18px; justify-content: center; font-size: 14px; }
.payoff__links a, .payoff__links button { color: var(--accent); background: none; border: 0; padding: 0; min-height: 40px; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; font-weight: 600; }
.sheet--riddle.is-solved #riddle-form { display: none; }
.sheet--riddle.is-solved #riddle-title { font-size: 36px; }

/* tablets and phones: the dialog's eight languages share its width */
@media (max-width: 1023px) {
  .chips--small .chip { flex: 1 1 0; min-width: 0; padding-left: 0; padding-right: 0; }
}
/* tablet */
@media (max-width: 980px) {
  .chain { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
/* header on narrow screens and short landscape phones: the breadcrumb keeps only the gallery link */
@media (max-width: 900px) {
  .crumbs__sep, .crumbs__here { display: none; }
  .crumbs__arrow { display: inline; }
}
/* phone */
@media (max-width: 720px) {
  :root { --gutter: 16px; }
  body { font-size: 15px; }
  .top__inner { gap: 10px; }
  .brand .logo--full { display: none !important; }
  .brand .logo--mark.logo--black { display: block; }
  [data-theme="dark"] .brand .logo--mark.logo--black { display: none; }
  [data-theme="dark"] .brand .logo--mark.logo--white { display: block; }
  .brand .logo { height: 22px; }
  .crumbs { font-size: 13px; }
  .top__create { display: none; }
  .top__tools { gap: 8px; }
  .lang select { padding: 6px 24px 6px 11px; max-width: 124px; text-overflow: ellipsis; }
  .hero { min-height: auto; }
  .hero__still, .hero__bg { object-position: 86% 50%; }
  .hero__shade { background: linear-gradient(180deg, rgba(21,17,13,.6) 0%, rgba(21,17,13,.45) 45%, rgba(21,17,13,.9) 100%); }
  .hero__content { padding-top: 16px; padding-bottom: 24px; gap: 14px; }
  .hero .kicker { letter-spacing: .05em; margin-bottom: 6px; }
  h1 { font-size: 44px; margin-bottom: 4px; }
  .tagline { font-size: 18px; margin-bottom: 10px; }
  .sign { margin-bottom: 14px; }
  .sign__text { font-size: 32px; margin-bottom: 8px; }
  .sign__langs { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 4px; width: 100%; min-height: 36px; }
  .lang-chip { min-width: 0; padding: 6px 0; font-size: 13px; }
  .hero__cta { order: 4; margin-bottom: 0; flex-wrap: nowrap; }
  .hero__cta .btn { padding: 10px 14px; }
  /* the pause moves to the hero's top corner so both buttons share one row */
  .hero__motion { position: absolute; top: 12px; right: var(--pad-r); z-index: 1; }
  .hero .kicker { padding-right: 52px; }
  /* phones: greeting, the main action, the take-home pair, then the one-line summary */
  .hero__main { display: contents; }
  .hero__content { display: flex; flex-direction: column; align-items: stretch; }
  .hero__main > * { align-self: flex-start; }
  .hero__main > .sign { align-self: stretch; }
  .hero__content { gap: 0; }
  /* then a plain tray across the hero's foot: the take-home pair (still on the first screen), the one-line summary and the loop's credit */
  .hero__content { padding-bottom: 0; }
  .hero__main > .lede, .takeaway--hero, .hero__main > .hero__credit { align-self: stretch; margin: 0 calc(-1 * var(--pad-r)) 0 calc(-1 * var(--pad-l)); max-width: none; background: var(--bg); text-shadow: none; }
  .takeaway--hero { order: 5; margin-top: 18px; padding: 12px var(--pad-r) 0 var(--pad-l); border-radius: 0; box-shadow: none; }
  .hero__main > .lede { order: 6; padding: 14px var(--pad-r) 0 var(--pad-l); font-size: 15px; color: var(--ink-2); }
  .hero__main > .hero__credit { order: 7; padding: 8px var(--pad-r) 16px var(--pad-l); color: var(--ink-3); }
  .takeaway--hero { grid-template-columns: 1fr 1fr; gap: 8px; }
  .takeaway--hero .takeaway__head { grid-column: 1 / -1; }
  .dl { padding: 10px 11px; gap: 8px; }
  .takeaway--hero .dl__icon { display: none; }
  .dl__title { font-size: 15px; }
  .dl__line { font-size: 12px; }
  .takeaway__cards, .payoff__cards { grid-template-columns: 1fr; }
  .chapters { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; font-size: 13px; }
  .chapters::-webkit-scrollbar { display: none; }
  .chapters a { flex: none; }
  .tavern, .band { padding-top: 32px; padding-bottom: 32px; }
  .tavern { display: flex; flex-direction: column; }
  .tavern .pano { order: 1; }
  .quest__actions { order: 2; margin: 14px 0 0; }
  .quest { margin-bottom: 12px; }
  .quest__clues { flex-wrap: nowrap; gap: 6px; width: 100%; }
  .clue { flex: 1 1 0; justify-content: center; padding: 6px 8px; font-size: 13px; min-width: 0; }
  .clue__long { display: none; }
  .clue__short { display: inline; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  /* the phone view pans: the panorama keeps its height and scrolls sideways */
  .pano__credit { order: 3; }
  .pano__track { width: auto; height: 56vh; overflow-x: auto; overflow-y: hidden; scroll-snap-type: x proximity; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
  .pano__track::-webkit-scrollbar { display: none; }
  .pano__img { width: auto; height: 100%; max-width: none; }
  .pano__pins { right: auto; width: calc(56vh * 3); }
  .pano__pan { display: inline-flex; position: absolute; left: max(12px, env(safe-area-inset-left)); top: 12px; background: var(--card); }
  .split { grid-template-columns: 1fr; gap: 18px; }
  .split .player { max-width: 300px; }
  .joke__grid { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: 84%; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 6px; }
  .jcard { scroll-snap-align: start; }
  .chain { grid-template-columns: 1fr 1fr; }
  .step { min-height: 150px; }
  /* the build table stacks, so every figure is visible without a sideways swipe */
  .models { min-width: 0; }
  .models thead { display: none; }
  .models tr { display: flex; flex-wrap: wrap; gap: 2px 12px; padding: 10px 14px; border-bottom: 1px solid var(--line); }
  .models tbody tr:nth-last-child(-n+3) { background: var(--bg-2); }
  .models td, .models tbody tr:nth-last-child(-n+3) td { padding: 0; border: 0; background: none; }
  .models td:nth-child(1), .models td:nth-child(2) { flex-basis: 100%; }
  .models td:nth-child(2) { color: var(--ink-2); }
  .models .unit { display: inline; }
  .foot__inner { flex-direction: column; align-items: flex-start; }
  /* dialogs fill the phone's screen */
  .sheet { width: 100%; max-width: none; height: 100%; max-height: none; margin: 0; border-radius: 0; }
  .made-dlg__stats { grid-template-columns: 1fr 1fr; }
  .made-dlg__cards { grid-template-columns: 1fr; }
  .made-dlg__steps li { grid-template-columns: 22px minmax(0, 1fr); }
  .made-dlg__num { grid-column: 2; }
  .sheet__inner { grid-template-columns: 1fr; padding: 16px 16px max(16px, env(safe-area-inset-bottom)); gap: 12px; }
  .sheet__close { top: 8px; margin: 0 0 -46px; }
  .sheet__media { max-width: none; width: auto; height: min(44vh, 340px); aspect-ratio: 3 / 4; margin: 0 auto; }
  .sheet h3 { font-size: 26px; }
  .said { font-size: 18px; }
  .sheet--riddle.is-solved #riddle-title { font-size: 30px; }
}
@media (max-width: 360px) {
  .icon-btn { width: 36px; height: 36px; }
  .hero__cta .btn { padding: 9px 11px; font-size: 14px; }
  .clue { font-size: 12px; padding: 6px; }
}
/* short desktop windows (laptops at 125 %, browser bars): the button row above the greeting, content from the top */
@media (min-width: 1024px) and (max-height: 780px) {
  .hero { align-items: start; }
  .hero__content { align-items: start; padding-top: 28px; padding-bottom: 28px; }
  .hero__cta { margin: 2px 0 18px; } /* moved above the greeting by the script, so Tab follows the screen */
  .hero__main > .lede { margin-bottom: 0; }
  .takeaway--hero { align-content: start; align-self: start; }
}
/* short landscape screens: a static, compact header; the sheet's video fits the height */
@media (max-height: 500px) {
  .top { position: static; }
  section, #take-home, #skill-quickstart { scroll-margin-top: 8px; } /* the header does not stick here */
  .tavern { padding-top: 16px; }
  .hero { min-height: auto; }
  .hero__content { padding-top: 20px; padding-bottom: 22px; }
}
/* short landscape: the main action beside the title, in the first screen and clear of the consent banner */
@media (min-width: 721px) and (max-height: 500px) {
  .hero__main { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 24px; align-items: start; }
  .hero__main > * { grid-column: 1 / -1; }
  .hero__main > .kicker, .hero__main > h1, .hero__main > .tagline { grid-column: 1; }
  .hero__cta { grid-column: 2; grid-row: 1 / 4; align-self: center; flex-wrap: nowrap; }
}
/* short phones: the main action right after the tagline, above where the consent sheet opens */
@media (max-width: 720px) and (max-height: 600px) {
  .hero__cta, .hero__main > .sign { order: 4; } /* same order: the page order (buttons first, moved by the script) shows */
  .hero__cta { margin-bottom: 14px; }
}
@media (min-width: 721px) and (max-height: 560px) {
  .sheet { max-height: calc(100vh - 16px); }
  .sheet__inner { column-gap: 20px; padding: 14px; }
  .sheet__close { top: 8px; margin: -6px -6px -38px 0; }
  .sheet__inner:not(.sheet__inner--single) { grid-template-columns: calc((100vh - 60px) * .75) 1fr; }
  .sheet h3 { font-size: 24px; margin-bottom: 8px; }
  .said { font-size: 17px; }
  .payoff .player { width: auto; height: calc(100vh - 140px); }
}
/* touch screens: every control at least 44 px */
@media (pointer: coarse) {
  .chip, .chips--small .chip, .seg button, .lang select, .clue, .btn--small, .crumbs__back, .chapters a,
  .q label, .payoff__links a, .payoff__links button, .quickstart__copy { min-height: 44px; }
  .brand { padding: 11px; margin: -11px; }
  .icon-btn { width: 44px; height: 44px; }
  .takeaway__help { min-height: 44px; }
  .icon-btn::after { content: ""; position: absolute; inset: -4px; }
}
@media (max-width: 360px) and (pointer: coarse) { .icon-btn { width: 40px; height: 40px; } }
@media (prefers-reduced-motion: reduce) {
  .pin__ring, .pin:not(.pin--done) .pin__ring, .pin.pin--ping .pin__ring, .sheet__extra .is-new, .quest__chest.is-ready { animation: none; }
  html { scroll-behavior: auto; }
  .btn, .hero__bg, .lang-chip { transition: none; }
}

/* Emmanuel review 2 (light pass): a wider, evenly padded take-home panel and a skill dialog sized to its content */
@media (min-width: 1024px) {
  .hero__content { grid-template-columns: minmax(0, 1fr) 384px; }
  .takeaway--hero { padding: 20px; gap: 12px; }
  .takeaway--hero .dl { padding: 14px 16px; }
}
.sheet.sheet--quickstart { width: min(92vw, 720px); max-width: 720px; }
.sheet--quickstart .quickstart { max-width: none; }
.sheet--quickstart .sheet__inner { padding: 28px 32px 32px; }
