/* ==========================================================================
   TVWEO — tvweo.com
   Retro broadcasting / print-editorial visual system.
   Flat colour, thin black outlines, pill controls, cream canvas on black.
   ========================================================================== */

/* --------------------------------------------------------------- 1. Tokens */

:root {
    --color-canvas: #fff8d6;
    --color-yellow: #fff89a;
    --color-cyan: #72dadd;
    --color-orange: #ff5a00;
    --color-lavender: #e6c6ff;
    --color-red: #ed2d2f;
    --color-black: #050505;
    --color-white: #ffffff;
    --color-muted: #686860;

    /* Sampled/derived supporting tones */
    --color-yellow-deep: #f4ea7a;
    --color-cyan-soft: #bfeef0;
    --color-lavender-soft: #f1e2ff;
    --color-ink-soft: #2a2a26;
    --color-hairline: rgba(5, 5, 5, 0.14);

    --border: 1.5px solid var(--color-black);
    --border-hair: 1px solid var(--color-hairline);

    --radius-large: 22px;
    --radius-medium: 14px;
    --radius-small: 8px;
    --radius-pill: 999px;

    --shell-max: 1400px;
    --gutter: clamp(14px, 2.2vw, 30px);
    --section-gap: clamp(18px, 2.2vw, 30px);

    --font-sans: "Barlow", "Barlow Fallback", -apple-system, BlinkMacSystemFont,
        "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

    --shadow-flat: 0 1px 0 rgba(5, 5, 5, 0.06);
}

/* Local Barlow. Drop the WOFF2 files into public/assets/fonts/ (see
   docs/INSTALL.md — bin/fetch-fonts.php downloads them from Google Fonts).
   font-display:swap keeps text visible during load, so no invisible-text FOIT. */
@font-face {
    font-family: "Barlow";
    src: url("../fonts/barlow-400.woff2") format("woff2");
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: "Barlow";
    src: url("../fonts/barlow-500.woff2") format("woff2");
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: "Barlow";
    src: url("../fonts/barlow-600.woff2") format("woff2");
    font-weight: 600;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: "Barlow";
    src: url("../fonts/barlow-700.woff2") format("woff2");
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: "Barlow";
    src: url("../fonts/barlow-800.woff2") format("woff2");
    font-weight: 800;
    font-style: normal;
    font-display: swap;
}

/* Metric-ish fallback so the swap does not shift layout much. */
@font-face {
    font-family: "Barlow Fallback";
    src: local("Arial Narrow"), local("Helvetica Neue"), local("Arial");
    size-adjust: 96%;
    ascent-override: 96%;
    descent-override: 24%;
}

/* ----------------------------------------------------------- 2. Base reset */

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

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

body {
    margin: 0;
    /* Black outer page background with the faint diagonal banding from the
       reference, drawn in CSS so it costs no extra request. */
    background-color: #0b0b0b;
    background-image: repeating-linear-gradient(
        118deg,
        #0b0b0b 0px,
        #0b0b0b 46px,
        #151515 46px,
        #151515 92px
    );
    color: var(--color-black);
    font-family: var(--font-sans);
    font-size: 16px;
    font-weight: 400;
    line-height: 1.5;
    font-synthesis-weight: none;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    color: inherit;
    text-decoration-thickness: 1.5px;
    text-underline-offset: 2px;
}

button {
    font: inherit;
    color: inherit;
}

h1, h2, h3, h4, h5, h6 {
    margin: 0;
    font-weight: 700;
    line-height: 1.06;
    letter-spacing: -0.02em;
}

p {
    margin: 0 0 1em;
}

ul, ol {
    margin: 0;
    padding: 0;
}

:focus-visible {
    outline: 3px solid var(--color-orange);
    outline-offset: 2px;
    border-radius: 4px;
}

.u-visually-hidden {
    position: absolute !important;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
}

.skip-link {
    position: absolute;
    left: -9999px;
    top: 8px;
    z-index: 999;
    background: var(--color-black);
    color: var(--color-yellow);
    padding: 12px 20px;
    border-radius: var(--radius-pill);
    font-weight: 700;
}
.skip-link:focus {
    left: 16px;
}

/* --------------------------------------------------------------- 3. Shell */

.page {
    max-width: var(--shell-max);
    margin: 0 auto;
    padding: clamp(16px, 2.4vw, 34px) clamp(10px, 1.6vw, 26px) clamp(20px, 3vw, 46px);
    position: relative;
}

/* Thin decorative vertical lines that "hang" the canvas, as in the reference. */
.page__strings {
    display: flex;
    justify-content: space-between;
    padding: 0 clamp(30px, 7vw, 110px);
    pointer-events: none;
}
.page__strings span {
    display: block;
    width: 34px;
    height: clamp(14px, 2vw, 26px);
    border-left: 1.5px solid rgba(255, 255, 255, 0.55);
    border-right: 1.5px solid rgba(255, 255, 255, 0.55);
    position: relative;
}
.page__strings span::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    border-left: 1.5px solid rgba(255, 255, 255, 0.55);
}

.canvas {
    background: var(--color-canvas);
    border-radius: clamp(18px, 2vw, 30px);
    padding: clamp(12px, 1.5vw, 20px);
    display: flex;
    flex-direction: column;
    gap: var(--section-gap);
}

/* --------------------------------------------------------------- 4. Header */

.masthead {
    background: var(--color-white);
    border: var(--border);
    border-radius: var(--radius-pill);
    padding: 10px clamp(14px, 1.8vw, 26px);
    display: flex;
    align-items: center;
    gap: 16px;
    position: relative;
    z-index: 40;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    text-decoration: none;
    font-weight: 800;
    font-size: 20px;
    letter-spacing: -0.03em;
    flex: 0 0 auto;
}
.brand__mark {
    width: 26px;
    height: 26px;
    flex: 0 0 auto;
}
.brand__name {
    line-height: 1;
}

.nav {
    flex: 1 1 auto;
    display: flex;
    justify-content: center;
}
.nav__list {
    list-style: none;
    display: flex;
    align-items: center;
    gap: 0;
    flex-wrap: wrap;
    justify-content: center;
}
.nav__item + .nav__item::before {
    content: "/";
    color: var(--color-muted);
    margin: 0 clamp(6px, 0.9vw, 14px);
    font-weight: 400;
}
.nav__item {
    display: inline-flex;
    align-items: center;
}
.nav__link {
    text-decoration: none;
    text-transform: uppercase;
    font-weight: 600;
    font-size: 13px;
    letter-spacing: 0.04em;
    padding: 8px 2px;
    white-space: nowrap;
    border-bottom: 2px solid transparent;
}
.nav__link:hover,
.nav__link:focus-visible {
    border-bottom-color: var(--color-orange);
}
.nav__link[aria-current="page"] {
    border-bottom-color: var(--color-black);
}

.masthead__actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 0 0 auto;
}

.icon-button {
    width: 44px;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1.5px solid transparent;
    border-radius: var(--radius-pill);
    cursor: pointer;
}
.icon-button:hover,
.icon-button:focus-visible {
    border-color: var(--color-black);
    background: var(--color-yellow);
}
.icon-button svg {
    width: 19px;
    height: 19px;
}

.nav-toggle {
    display: none;
}

/* Search drawer under the masthead */
.searchbar {
    display: none;
    margin-top: 10px;
}
.searchbar.is-open {
    display: block;
}
.searchbar__form {
    display: flex;
    gap: 8px;
    background: var(--color-white);
    border: var(--border);
    border-radius: var(--radius-pill);
    padding: 6px 6px 6px 18px;
}
.searchbar__input {
    flex: 1 1 auto;
    border: 0;
    background: transparent;
    font-size: 15px;
    padding: 10px 0;
    min-width: 0;
}
.searchbar__input:focus {
    outline: none;
}

/* --------------------------------------------------------- 5. Shared atoms */

.pill {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: var(--color-white);
    border: var(--border);
    border-radius: var(--radius-pill);
    padding: 6px 14px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    line-height: 1.3;
    white-space: nowrap;
}
.pill--red {
    background: var(--color-red);
    border-color: var(--color-red);
    color: var(--color-white);
}
.pill--black {
    background: var(--color-black);
    color: var(--color-yellow);
}
.pill--ghost {
    background: transparent;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 44px;
    padding: 11px 22px;
    background: var(--color-white);
    border: var(--border);
    border-radius: var(--radius-pill);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    text-decoration: none;
    cursor: pointer;
    transition: transform 0.12s ease, background-color 0.12s ease;
}
.button:hover,
.button:focus-visible {
    background: var(--color-black);
    color: var(--color-yellow);
    transform: translateY(-1px);
}
.button--small {
    min-height: 38px;
    padding: 8px 16px;
    font-size: 11.5px;
}
.button--dark {
    background: var(--color-black);
    color: var(--color-yellow);
}
.button--dark:hover,
.button--dark:focus-visible {
    background: var(--color-orange);
    color: var(--color-white);
}
.button--orange {
    background: var(--color-orange);
    border-color: var(--color-black);
    color: var(--color-white);
}
.button__arrow {
    font-size: 15px;
    line-height: 1;
}

.section-head {
    display: flex;
    align-items: center;
    gap: clamp(14px, 2vw, 28px);
    margin-bottom: 16px;
}
.section-head__title {
    font-size: clamp(30px, 4vw, 52px);
    font-weight: 700;
    letter-spacing: -0.035em;
    flex: 0 0 auto;
}
.section-head__rule {
    flex: 1 1 auto;
    height: 0;
    border-top: var(--border);
}

.eyebrow {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--color-muted);
}

.meta {
    font-size: 11.5px;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--color-muted);
}

.panel {
    border: var(--border);
    border-radius: var(--radius-large);
    padding: clamp(18px, 2.4vw, 34px);
}
.panel--yellow { background: var(--color-yellow); }
.panel--cyan { background: var(--color-cyan); }
.panel--lavender { background: var(--color-lavender); }
.panel--white { background: var(--color-white); }

/* ------------------------------------------------------------- 6. The hero */

.hero {
    display: grid;
    grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr);
    gap: var(--section-gap);
}

.hero__left {
    position: relative;
    background: var(--color-yellow);
    border: var(--border);
    border-radius: var(--radius-large);
    padding: clamp(20px, 2.6vw, 36px);
    display: flex;
    flex-direction: column;
    min-height: clamp(430px, 46vw, 620px);
    overflow: hidden;
    isolation: isolate;
}

/* Perspective grid, pure CSS: two skewed gradient planes plus a vanishing
   point. No image request, and it scales with the panel. */
.hero__grid {
    position: absolute;
    inset: 0;
    z-index: -1;
    overflow: hidden;
    border-radius: inherit;
}
.hero__grid::before,
.hero__grid::after {
    content: "";
    position: absolute;
    left: -20%;
    right: -20%;
    height: 62%;
    background-image:
        repeating-linear-gradient(to right, rgba(5, 5, 5, 0.28) 0 1px, transparent 1px 7.5%),
        repeating-linear-gradient(to bottom, rgba(5, 5, 5, 0.22) 0 1px, transparent 1px 12%);
}
.hero__grid::before {
    top: 0;
    transform: perspective(560px) rotateX(58deg);
    transform-origin: top center;
}
.hero__grid::after {
    bottom: 0;
    transform: perspective(560px) rotateX(-58deg);
    transform-origin: bottom center;
}
.hero__vanish {
    position: absolute;
    z-index: -1;
    left: 50%;
    top: 46%;
    width: 34%;
    aspect-ratio: 1;
    transform: translate(-50%, -50%);
    border: 1px solid rgba(5, 5, 5, 0.22);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.42), rgba(255, 255, 255, 0));
}

.hero__badges {
    display: flex;
    gap: 9px;
    flex-wrap: wrap;
    margin-bottom: auto;
}

.hero__title {
    font-size: clamp(34px, 4.4vw, 58px);
    font-weight: 700;
    letter-spacing: -0.04em;
    line-height: 1.03;
    margin: 0 0 16px;
    max-width: 15ch;
}
.hero__title span {
    display: block;
}

.hero__body {
    font-size: clamp(15px, 1.15vw, 17px);
    max-width: 46ch;
    margin-bottom: 22px;
    color: var(--color-ink-soft);
}

.hero__cta {
    margin-bottom: clamp(18px, 2.4vw, 30px);
}

/* Lower black strip with the twin rule marks from the reference. */
.hero__strip {
    margin: auto calc(clamp(20px, 2.6vw, 36px) * -1) calc(clamp(20px, 2.6vw, 36px) * -1);
    background: var(--color-black);
    border-radius: var(--radius-large);
    padding: 16px clamp(16px, 2vw, 26px);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: clamp(10px, 2vw, 22px);
}
.hero__rules {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    gap: 7px;
    min-width: 0;
}
.hero__rules span {
    display: block;
    height: 2px;
    background: var(--color-yellow);
    border-radius: 2px;
}
.hero__strip .pill {
    flex: 0 0 auto;
}

/* Right featured panel */
.hero__right {
    background: var(--color-cyan);
    border: var(--border);
    border-radius: var(--radius-large);
    padding: clamp(16px, 2vw, 24px);
    display: flex;
    flex-direction: column;
    gap: 14px;
    min-width: 0;
}

.hero__cover {
    border: var(--border);
    border-radius: var(--radius-medium);
    overflow: hidden;
    background: var(--color-cyan-soft);
    aspect-ratio: 16 / 9;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 14px;
    /* A faint version of the cover fills the stage behind it, so the panel
       still reads as a full-bleed image without cropping the artwork. */
    position: relative;
}
.hero__cover img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    border: var(--border);
    border-radius: var(--radius-small);
    position: relative;
    z-index: 1;
}
.hero__cover::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        repeating-linear-gradient(135deg, rgba(5, 5, 5, 0.05) 0 2px, transparent 2px 9px);
}

.hero__featured-title {
    font-size: clamp(22px, 2.5vw, 34px);
    letter-spacing: -0.035em;
    line-height: 1.08;
}
.hero__featured-title a {
    text-decoration: none;
}
.hero__featured-title a:hover {
    text-decoration: underline;
}

.hero__featured-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 16px;
    align-items: center;
}

/* ------------------------------------------------------------- 7. Ticker */

.ticker {
    background: var(--color-red);
    border: 1.5px solid var(--color-black);
    border-radius: var(--radius-medium);
    color: var(--color-white);
    overflow: hidden;
    padding: 14px 0;
}
.ticker__track {
    display: flex;
    align-items: center;
    gap: 0;
    width: max-content;
    animation: ticker-scroll 42s linear infinite;
}
.ticker:hover .ticker__track,
.ticker:focus-within .ticker__track {
    animation-play-state: paused;
}
.ticker__item {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
    font-size: 12.5px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    padding: 0 clamp(14px, 1.6vw, 26px);
    white-space: nowrap;
}
.ticker__item:hover {
    text-decoration: underline;
}
.ticker__dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--color-yellow);
    flex: 0 0 auto;
}

@keyframes ticker-scroll {
    from { transform: translateX(0); }
    to { transform: translateX(-50%); }
}

/* --------------------------------------------------------- 8. Book cards */

.card-row {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: clamp(10px, 1.2vw, 18px);
}

.book-card {
    background: var(--color-white);
    border: var(--border);
    border-radius: var(--radius-medium);
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 9px;
    min-width: 0;
}

.book-card__cover {
    border: var(--border);
    border-radius: var(--radius-small);
    overflow: hidden;
    aspect-ratio: 1;
    background: var(--color-lavender-soft);
}
.book-card__cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.book-card__title {
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.01em;
    line-height: 1.22;
    /* Two-line clamp keeps every card in the row the same height. */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.book-card__title a {
    text-decoration: none;
}
.book-card__title a:hover,
.book-card__title a:focus-visible {
    text-decoration: underline;
}

.book-card__byline {
    font-size: 10.5px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--color-muted);
    margin-top: -4px;
}

.book-card__rules {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: auto;
    padding-top: 6px;
}
.book-card__rules span {
    display: block;
    height: 1.5px;
    background: var(--color-orange);
    opacity: 0.55;
    border-radius: 2px;
}
.book-card__rules span:last-child {
    width: 62%;
}

.book-card__action {
    display: flex;
    justify-content: center;
    padding-top: 2px;
}

/* -------------------------------------------------- 9. Popular (lavender) */

.popular {
    background: var(--color-lavender);
    border: var(--border);
    border-radius: var(--radius-large);
    padding: clamp(18px, 2.4vw, 32px);
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 0.86fr) minmax(0, 0.94fr);
    gap: clamp(16px, 2vw, 28px);
    align-items: start;
}

.popular__intro {
    display: flex;
    flex-direction: column;
    gap: 18px;
    align-self: center;
}
.popular__heading {
    font-size: clamp(24px, 2.6vw, 38px);
    letter-spacing: -0.035em;
    line-height: 1.1;
    max-width: 18ch;
}

.popular__spotlight {
    border: var(--border);
    border-radius: var(--radius-medium);
    overflow: hidden;
    background: var(--color-white);
    aspect-ratio: 1;
    position: relative;
}
.popular__spotlight img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.popular__spotlight-label {
    position: absolute;
    left: 10px;
    bottom: 10px;
}

.popular__list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    list-style: none;
}

/* Compact chapter/book row used in the lavender panel and elsewhere. */
.mini {
    background: var(--color-white);
    border: var(--border);
    border-radius: var(--radius-medium);
    padding: 8px;
    display: grid;
    grid-template-columns: 62px minmax(0, 1fr) auto;
    gap: 11px;
    align-items: center;
}
.mini__cover {
    width: 62px;
    height: 62px;
    border: var(--border);
    border-radius: var(--radius-small);
    overflow: hidden;
    background: var(--color-lavender-soft);
}
.mini__cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.mini__body {
    min-width: 0;
}
.mini__title {
    font-size: 12.5px;
    font-weight: 700;
    text-transform: uppercase;
    line-height: 1.2;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.mini__title a {
    text-decoration: none;
}
.mini__title a:hover {
    text-decoration: underline;
}
.mini__byline {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--color-muted);
    margin-top: 2px;
}
.mini__aside {
    display: flex;
    align-items: center;
    gap: 8px;
}
.mini__duration {
    font-size: 10.5px;
    font-weight: 600;
    border: var(--border);
    border-radius: var(--radius-pill);
    padding: 4px 10px;
    white-space: nowrap;
}

/* ------------------------------------------------- 10. Discovery (cyan) */

.discovery {
    display: grid;
    grid-template-columns: minmax(0, 0.62fr) minmax(0, 1.38fr);
    border: var(--border);
    border-radius: var(--radius-large);
    overflow: hidden;
}

.discovery__aside {
    background: var(--color-black);
    color: var(--color-canvas);
    padding: clamp(20px, 2.4vw, 30px);
    display: flex;
    flex-direction: column;
    gap: 18px;
}
.discovery__aside h2 {
    font-size: clamp(20px, 2.1vw, 28px);
    color: var(--color-white);
    letter-spacing: -0.03em;
}
.discovery__chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    list-style: none;
}
.discovery__chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: 1.5px solid rgba(255, 248, 214, 0.5);
    border-radius: var(--radius-pill);
    padding: 7px 13px;
    font-size: 11.5px;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    text-decoration: none;
    color: var(--color-canvas);
}
.discovery__chip:hover,
.discovery__chip:focus-visible {
    background: var(--color-yellow);
    border-color: var(--color-yellow);
    color: var(--color-black);
}
.discovery__chip-count {
    color: var(--color-orange);
    font-weight: 700;
}
.discovery__brand {
    margin-top: auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding-top: 14px;
    border-top: 1.5px solid rgba(255, 248, 214, 0.28);
}

.discovery__main {
    background: var(--color-cyan);
    padding: clamp(20px, 2.4vw, 30px);
    display: flex;
    flex-direction: column;
    gap: clamp(16px, 2vw, 24px);
}

.timeline {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: clamp(16px, 2vw, 24px);
    position: relative;
}
.timeline__item {
    display: grid;
    grid-template-columns: 66px minmax(0, 1fr);
    gap: 16px;
    align-items: start;
    position: relative;
}
/* Connecting rule between the timeline markers. */
.timeline__item:not(:last-child)::before {
    content: "";
    position: absolute;
    left: 33px;
    top: 72px;
    bottom: calc(clamp(16px, 2vw, 24px) * -1);
    border-left: 1.5px solid rgba(5, 5, 5, 0.35);
}
.timeline__marker {
    width: 66px;
    height: 66px;
    border: var(--border);
    border-radius: 50%;
    overflow: hidden;
    background: var(--color-white);
    position: relative;
    z-index: 1;
}
.timeline__marker img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.timeline__title {
    font-size: clamp(16px, 1.5vw, 21px);
    letter-spacing: -0.02em;
    margin-bottom: 4px;
}
.timeline__title a {
    text-decoration: none;
}
.timeline__title a:hover {
    text-decoration: underline;
}
.timeline__body {
    font-size: 13.5px;
    color: var(--color-ink-soft);
    margin-bottom: 9px;
    max-width: 68ch;
}
.timeline__tags {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}
.timeline__tag {
    background: var(--color-white);
    border: var(--border);
    border-radius: var(--radius-pill);
    padding: 4px 11px;
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

/* ---------------------------------------------------- 11. Promo (yellow) */

.promo {
    background: var(--color-yellow);
    border: var(--border);
    border-radius: var(--radius-large);
    padding: clamp(20px, 2.6vw, 36px);
    display: grid;
    grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
    gap: clamp(18px, 2.4vw, 32px);
    align-items: center;
}
.promo__heading {
    font-size: clamp(26px, 3.2vw, 44px);
    letter-spacing: -0.04em;
    line-height: 1.06;
    margin-bottom: 14px;
    max-width: 16ch;
}
.promo__body {
    max-width: 44ch;
    margin-bottom: 20px;
    color: var(--color-ink-soft);
}
.promo__art {
    background: var(--color-lavender);
    border: var(--border);
    border-radius: var(--radius-medium);
    padding: clamp(14px, 1.8vw, 24px);
    position: relative;
    min-height: 240px;
}
.promo__badge {
    position: absolute;
    left: 14px;
    top: 14px;
    z-index: 2;
}
.promo__collage {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: clamp(8px, 1vw, 14px);
    align-items: center;
    height: 100%;
}
.promo__collage figure {
    margin: 0;
    border: var(--border);
    border-radius: var(--radius-small);
    overflow: hidden;
    aspect-ratio: 1;
    background: var(--color-white);
}
.promo__collage figure img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.promo__collage figure:nth-child(2) {
    transform: translateY(-10px) rotate(-2deg);
}
.promo__collage figure:nth-child(3) {
    transform: translateY(8px) rotate(2deg);
}

/* -------------------------------------------- 12. Latest list (lavender) */

.latest {
    background: var(--color-lavender);
    border: var(--border);
    border-radius: var(--radius-large);
    padding: clamp(18px, 2.4vw, 32px);
}
.latest__grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: clamp(16px, 2vw, 26px);
}
.latest__item {
    display: grid;
    grid-template-columns: clamp(110px, 12vw, 150px) minmax(0, 1fr);
    gap: 16px;
    align-items: start;
}
.latest__cover {
    border: var(--border);
    border-radius: var(--radius-small);
    overflow: hidden;
    aspect-ratio: 1;
    background: var(--color-white);
}
.latest__cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.latest__title {
    font-size: clamp(16px, 1.6vw, 21px);
    letter-spacing: -0.025em;
    line-height: 1.14;
    margin-bottom: 6px;
}
.latest__title a {
    text-decoration: none;
}
.latest__title a:hover {
    text-decoration: underline;
}
.latest__excerpt {
    font-size: 13.5px;
    color: var(--color-ink-soft);
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.latest__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 14px;
    margin-bottom: 10px;
}

/* --------------------------------------------------------- 13. The footer */

.site-footer {
    background: var(--color-black);
    color: var(--color-canvas);
    border-radius: var(--radius-large);
    padding: clamp(24px, 3vw, 42px);
    display: flex;
    flex-direction: column;
    gap: clamp(20px, 2.4vw, 32px);
}
.site-footer a {
    color: var(--color-canvas);
    text-decoration: none;
}
.site-footer a:hover,
.site-footer a:focus-visible {
    color: var(--color-yellow);
    text-decoration: underline;
}
.footer__top {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) repeat(3, minmax(0, 1fr));
    gap: clamp(18px, 2.4vw, 34px);
}
.footer__brand .brand {
    color: var(--color-white);
    font-size: 24px;
}
.footer__blurb {
    margin-top: 12px;
    max-width: 42ch;
    font-size: 14px;
    color: rgba(255, 248, 214, 0.78);
}
.footer__col h2 {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--color-orange);
    margin-bottom: 12px;
}
.footer__col ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 14px;
}
.footer__bottom {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding-top: 18px;
    border-top: 1.5px solid rgba(255, 248, 214, 0.24);
    font-size: 12.5px;
    color: rgba(255, 248, 214, 0.72);
}
.footer__legal {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    list-style: none;
}
.footer__legal a {
    border: 1.5px solid rgba(255, 248, 214, 0.4);
    border-radius: var(--radius-pill);
    padding: 6px 14px;
    font-size: 11.5px;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

/* ------------------------------------------------ 14. Interior page shell */

.sheet {
    background: var(--color-white);
    border: var(--border);
    border-radius: var(--radius-large);
    padding: clamp(20px, 2.6vw, 40px);
}

.breadcrumbs {
    font-size: 11.5px;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--color-muted);
    margin-bottom: 14px;
}
.breadcrumbs ol {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.breadcrumbs li + li::before {
    content: "/";
    margin-right: 6px;
    color: var(--color-hairline);
}
.breadcrumbs a {
    text-decoration: none;
}
.breadcrumbs a:hover {
    text-decoration: underline;
}

.page-title {
    font-size: clamp(30px, 4vw, 52px);
    letter-spacing: -0.04em;
    margin-bottom: 10px;
}
.page-intro {
    font-size: 16px;
    color: var(--color-ink-soft);
    max-width: 62ch;
}

/* ----------------------------------------------------------- 15. Filters */

.filters {
    background: var(--color-yellow);
    border: var(--border);
    border-radius: var(--radius-medium);
    padding: 14px clamp(14px, 1.8vw, 22px);
    margin: 20px 0;
}
.filters__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 12px;
    align-items: end;
}
.field {
    display: flex;
    flex-direction: column;
    gap: 5px;
    min-width: 0;
}
.field label {
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}
.field input,
.field select,
.field textarea {
    font: inherit;
    font-size: 14px;
    padding: 10px 12px;
    min-height: 44px;
    border: var(--border);
    border-radius: var(--radius-small);
    background: var(--color-white);
    width: 100%;
    color: var(--color-black);
}
.field textarea {
    min-height: 140px;
    resize: vertical;
    line-height: 1.55;
}
.filters__actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.result-count {
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--color-muted);
    margin-bottom: 14px;
}

.grid-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: clamp(12px, 1.4vw, 20px);
}

.empty-state {
    border: 1.5px dashed var(--color-black);
    border-radius: var(--radius-medium);
    padding: clamp(24px, 3vw, 44px);
    text-align: center;
    background: var(--color-canvas);
}
.empty-state h2 {
    font-size: 22px;
    margin-bottom: 8px;
}
.empty-state p {
    max-width: 52ch;
    margin: 0 auto 16px;
    color: var(--color-ink-soft);
}

.notice {
    border: var(--border);
    border-radius: var(--radius-medium);
    padding: 14px 18px;
    background: var(--color-yellow);
    font-size: 14px;
    margin-bottom: 18px;
}
.notice--error {
    background: #ffdcd6;
}
.notice--ok {
    background: #d7f5d9;
}
.notice strong {
    display: block;
    margin-bottom: 3px;
}

.pagination {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    align-items: center;
    justify-content: center;
    margin-top: 26px;
    list-style: none;
}
.pagination a,
.pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    min-height: 44px;
    padding: 8px 14px;
    border: var(--border);
    border-radius: var(--radius-pill);
    background: var(--color-white);
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
}
.pagination a:hover {
    background: var(--color-yellow);
}
.pagination [aria-current="page"] {
    background: var(--color-black);
    color: var(--color-yellow);
}
.pagination .is-disabled {
    opacity: 0.45;
}

/* -------------------------------------------------- 16. Audiobook detail */

.detail {
    display: grid;
    grid-template-columns: minmax(0, 0.78fr) minmax(0, 1.22fr);
    gap: clamp(18px, 2.4vw, 34px);
    align-items: start;
}
.detail__cover {
    border: var(--border);
    border-radius: var(--radius-medium);
    overflow: hidden;
    aspect-ratio: 1;
    background: var(--color-lavender-soft);
    position: sticky;
    top: 18px;
}
.detail__cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.detail__title {
    font-size: clamp(28px, 3.4vw, 46px);
    letter-spacing: -0.04em;
    line-height: 1.05;
    margin-bottom: 10px;
}
.detail__byline {
    font-size: clamp(15px, 1.4vw, 19px);
    font-weight: 600;
    margin-bottom: 14px;
}
.detail__facts {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 18px;
    list-style: none;
}
.detail__description {
    font-size: 15.5px;
    line-height: 1.62;
    max-width: 66ch;
    margin-bottom: 20px;
    white-space: pre-line;
}

/* Player area */
.player {
    background: var(--color-cyan);
    border: var(--border);
    border-radius: var(--radius-medium);
    padding: clamp(12px, 1.6vw, 18px);
    margin-bottom: 20px;
}
.player__head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 12px;
}
.player__now {
    font-size: 13px;
    font-weight: 700;
    min-width: 0;
}
.player__frame {
    border: var(--border);
    border-radius: var(--radius-small);
    overflow: hidden;
    background: var(--color-white);
    /* Reserve the height the official player will occupy, so loading a chapter
       never shifts the page (protects CLS). */
    min-height: 200px;
}
.player__frame iframe {
    display: block;
    width: 100%;
    border: 0;
}
.player__attribution {
    font-size: 11.5px;
    color: var(--color-ink-soft);
    margin: 10px 0 0;
}

/* Click-to-load placeholder shown before an iframe is requested. */
.player__placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 200px;
    padding: 20px;
    text-align: center;
    background: var(--color-white);
}
.player__placeholder p {
    margin: 0;
    font-size: 13px;
    color: var(--color-ink-soft);
    max-width: 40ch;
}

/* External platform buttons */
.platforms {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
    margin-bottom: 22px;
}
.platform-link {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    min-height: 44px;
    padding: 10px 18px;
    border: var(--border);
    border-radius: var(--radius-pill);
    background: var(--color-white);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-decoration: none;
}
.platform-link:hover,
.platform-link:focus-visible {
    background: var(--color-yellow);
}
.platform-link svg {
    width: 18px;
    height: 18px;
    flex: 0 0 auto;
}
.platform-link--spotify svg { color: #1db954; }
.platform-link--apple svg { color: #9933cc; }
.platform-link--spreaker svg { color: var(--color-orange); }
.platform-link__ext {
    font-size: 11px;
    color: var(--color-muted);
}

/* Chapter list */
.chapters {
    margin-top: 8px;
}
.chapters__list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
    counter-reset: chapter;
}
.chapter {
    background: var(--color-white);
    border: var(--border);
    border-radius: var(--radius-medium);
    padding: 10px 12px;
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr) auto;
    gap: 12px;
    align-items: center;
}
.chapter.is-active {
    background: var(--color-yellow);
}
.chapter__number {
    width: 42px;
    height: 42px;
    border: var(--border);
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    background: var(--color-canvas);
}
.chapter.is-active .chapter__number {
    background: var(--color-orange);
    color: var(--color-white);
}
.chapter__title {
    font-size: 14.5px;
    font-weight: 600;
    line-height: 1.3;
}
.chapter__meta {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--color-muted);
    margin-top: 3px;
}
.chapter__actions {
    display: flex;
    align-items: center;
    gap: 8px;
}
.chapter__play {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 40px;
    padding: 8px 15px;
    border: var(--border);
    border-radius: var(--radius-pill);
    background: var(--color-cyan);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    cursor: pointer;
    text-decoration: none;
}
.chapter__play:hover,
.chapter__play:focus-visible {
    background: var(--color-black);
    color: var(--color-yellow);
}

/* ---------------------------------------------------------- 17. Prose */

.prose {
    max-width: 68ch;
    font-size: 16.5px;
    line-height: 1.68;
}
.prose p {
    margin-bottom: 1.15em;
}
.prose h2 {
    font-size: 26px;
    margin: 1.6em 0 0.5em;
}
.prose h3 {
    font-size: 20px;
    margin: 1.4em 0 0.4em;
}
.prose ul, .prose ol {
    padding-left: 1.3em;
    margin-bottom: 1.15em;
}
.prose li {
    margin-bottom: 0.35em;
}

/* ------------------------------------------------------- 18. Taxonomy list */

.chip-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    gap: 10px;
    list-style: none;
}
.chip-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    min-height: 60px;
    padding: 14px 18px;
    border: var(--border);
    border-radius: var(--radius-medium);
    background: var(--color-yellow);
    text-decoration: none;
    font-weight: 700;
}
.chip-card:hover,
.chip-card:focus-visible {
    background: var(--color-cyan);
}
.chip-card__count {
    font-size: 11px;
    font-weight: 700;
    background: var(--color-white);
    border: var(--border);
    border-radius: var(--radius-pill);
    padding: 3px 10px;
}

/* -------------------------------------------------------- 19. Responsive */

@media (max-width: 1180px) {
    .card-row {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
    .card-row .book-card:nth-child(n + 4) {
        display: none;
    }
    .popular {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    }
    .popular__spotlight {
        order: 3;
    }
    .popular__list {
        grid-column: 1 / -1;
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    }
    .footer__top {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 1024px) {
    .hero {
        grid-template-columns: 1fr;
    }
    .hero__left {
        min-height: 380px;
    }
    .discovery {
        grid-template-columns: 1fr;
    }
    .detail {
        grid-template-columns: minmax(0, 0.6fr) minmax(0, 1.4fr);
    }
    .promo {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 860px) {
    .nav {
        display: none;
    }
    .nav.is-open {
        display: block;
        position: absolute;
        left: 0;
        right: 0;
        top: calc(100% + 8px);
        background: var(--color-white);
        border: var(--border);
        border-radius: var(--radius-large);
        padding: 12px;
        z-index: 50;
    }
    .nav.is-open .nav__list {
        flex-direction: column;
        align-items: stretch;
        gap: 2px;
    }
    .nav.is-open .nav__item + .nav__item::before {
        content: none;
    }
    .nav.is-open .nav__link {
        display: block;
        padding: 13px 14px;
        border-radius: var(--radius-small);
        border-bottom: 0;
        font-size: 15px;
    }
    .nav.is-open .nav__link:hover,
    .nav.is-open .nav__link[aria-current="page"] {
        background: var(--color-yellow);
    }
    .nav-toggle {
        display: inline-flex;
    }
    .card-row {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .card-row .book-card:nth-child(n + 5) {
        display: none;
    }
    .latest__grid {
        grid-template-columns: 1fr;
    }
    .detail {
        grid-template-columns: 1fr;
    }
    .detail__cover {
        position: static;
        max-width: 300px;
    }
    .popular {
        grid-template-columns: 1fr;
    }
    .popular__spotlight {
        max-width: 340px;
    }
}

@media (max-width: 620px) {
    .page {
        padding-left: 6px;
        padding-right: 6px;
    }
    .canvas {
        padding: 8px;
        border-radius: 18px;
    }
    .masthead {
        border-radius: var(--radius-large);
        padding: 10px 14px;
    }
    .hero__strip {
        flex-wrap: wrap;
        justify-content: center;
    }
    .hero__rules {
        display: none;
    }
    .card-row {
        grid-template-columns: 1fr;
    }
    .card-row .book-card:nth-child(n + 4) {
        display: none;
    }
    .book-card {
        display: grid;
        grid-template-columns: 92px minmax(0, 1fr);
        gap: 12px;
        align-items: center;
    }
    .book-card__cover {
        width: 92px;
    }
    .book-card__rules {
        display: none;
    }
    .book-card__action {
        justify-content: flex-start;
    }
    .mini {
        grid-template-columns: 54px minmax(0, 1fr);
    }
    .mini__aside {
        grid-column: 1 / -1;
        justify-content: space-between;
    }
    .latest__item {
        grid-template-columns: 92px minmax(0, 1fr);
    }
    .timeline__item {
        grid-template-columns: 48px minmax(0, 1fr);
        gap: 12px;
    }
    .timeline__marker {
        width: 48px;
        height: 48px;
    }
    .timeline__item:not(:last-child)::before {
        left: 24px;
        top: 54px;
    }
    .chapter {
        grid-template-columns: 38px minmax(0, 1fr);
    }
    .chapter__actions {
        grid-column: 1 / -1;
        justify-content: flex-start;
    }
    .chapter__number {
        width: 38px;
        height: 38px;
    }
    .footer__top {
        grid-template-columns: 1fr;
    }
    .promo__collage {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
    .section-head {
        flex-wrap: wrap;
        gap: 12px;
    }
    .section-head__rule {
        display: none;
    }
}

/* --------------------------------------------------- 20. Reduced motion */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
        scroll-behavior: auto !important;
    }
    /* The ticker stops entirely and simply shows its first items. */
    .ticker__track {
        animation: none;
        width: 100%;
        flex-wrap: wrap;
        justify-content: center;
        row-gap: 6px;
    }
}

/* ------------------------------------------------------------ 21. Print */

@media print {
    body {
        background: #fff;
    }
    .masthead__actions,
    .ticker,
    .player,
    .site-footer,
    .page__strings {
        display: none !important;
    }
    .canvas, .sheet, .panel {
        border: 0;
        background: #fff;
    }
}
