/*
============================================
Prompt Engineering Tutorial — PKA-STYLE rewrite (dual-theme, default dark)
============================================
- Cinematic "study-at-night" aesthetic: neutral charcoal base lit by a restrained GOLD glow.
- SAME layout + every original selector preserved (#table-of-contents, #toc-nav, main,
  .header-title, .page-intro, details/summary, .copy-code-button, table.command-list,
  search modal, .back-to-top, .chapter-quiz-link, .btn-quiz-link, responsive, print).
- Two theming axes on <html>:
    data-theme = dark | light
    data-atmo  = full | calm   (dark-only atmosphere; light is always clean)
- Legacy token names (--text-color, --accent-color, …) are kept and remapped per theme,
  so every existing selector re-skins for free with NO HTML change.
*/

/* ============================================
   TIER 1 — theme-independent (fonts, layout, hover-glow) + DARK token defaults
   ============================================ */
:root {
    /* fonts (PKA stack) */
    --serif: "Instrument Serif", Georgia, "Times New Roman", serif;
    --mono:  "Geist Mono", ui-monospace, "SF Mono", Monaco, Consolas, monospace;
    --sans:  "Geist", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

    /* layout (unchanged from original) */
    --max-width: 1600px;
    --content-width: 820px;
    --nav-width: 260px;
    --header-height: 60px;

    /* the ONE retained warm glow — subtle card hover (both themes) */
    --hover-glow: 0 10px 30px -10px rgba(249,140,30,.40), 0 0 0 1px rgba(249,140,30,.18);

    /* ---- DARK token roster (default) ---- */
    --gold:#d4a017;
    --gold-rgb:212,160,23;
    --gold-soft:#e0b34a;
    --gold-deep:#9a7322;
    --gold-label:#cfa330;     /* small mono labels — AA on panels */
    --gold-text:#d4a017;      /* gold as small text */
    --gold-fill:#d4a017;      /* solid CTA fill */
    --on-gold:#1a1206;        /* text on a gold fill */

    --heading:#fbf3e4;
    --background-color:#0c0c0d;
    --text-color:#f4ead7;            /* cream — primary text */
    --secondary-text-color:#b2a589;  /* muted */
    --dim:#9a8d73;

    --border-color:rgba(212,160,23,.18);
    --edge:rgba(212,160,23,.22);
    --edge-soft:rgba(212,160,23,.13);
    --edge-strong:rgba(212,160,23,.40);
    --line:rgba(212,160,23,.06);

    --code-bg:rgba(18,13,8,.85);     /* deep charcoal for pre */
    --panel:rgba(28,28,32,.55);      /* glassy translucent panel */
    --panel-solid:rgba(22,22,26,.92);/* near-solid reading panel */
    --panel-edge:rgba(212,160,23,.16);
    --inset-hi:rgba(255,255,255,.03);
    --card-shadow:none;

    --header-bg:rgba(12,12,14,.72);
    --toptop-bg:rgba(28,28,32,.88);

    --accent-color:#d4a017;          /* links */
    --focus:#d4a017;                 /* GOLD focus ring */
    --lamp:#2f9c6a;                  /* status green only */
    --crimson:#fb5a3c;               /* status red only */
}

/* ---- LIGHT token roster ---- */
:root[data-theme="light"] {
    --gold:#b8860b;
    --gold-rgb:184,134,11;
    --gold-soft:#8c6200;
    --gold-deep:#9a6d00;
    --gold-label:#8a6000;
    --gold-text:#8a6000;      /* 5.0:1 on white — AA small text */
    --gold-fill:#9a6d00;      /* active fill — white text 4.6:1 */
    --on-gold:#ffffff;

    --heading:#1d1d1f;
    --background-color:#fbfbfd;
    --text-color:#1d1d1f;
    --secondary-text-color:#636366;
    --dim:#636366;

    --border-color:rgba(0,0,0,.10);
    --edge:rgba(0,0,0,.10);
    --edge-soft:rgba(0,0,0,.10);
    --edge-strong:rgba(0,0,0,.22);
    --line:rgba(0,0,0,.06);

    --code-bg:#f5f5f7;
    --panel:#ffffff;
    --panel-solid:#ffffff;
    --panel-edge:rgba(0,0,0,.10);
    --inset-hi:transparent;
    --card-shadow:0 1px 2px rgba(0,0,0,.04), 0 4px 16px rgba(0,0,0,.05);

    --header-bg:rgba(255,255,255,.82);
    --toptop-bg:#ffffff;

    --accent-color:#8a6000;   /* link gold — AA small text on white */
    --focus:#9a6d00;          /* deeper gold — clears 3:1 on #f5f5f7 */
    --lamp:#1a7a3c;
    --crimson:#c9261b;
}

/*
============================================
ACCESSIBILITY - Skip Navigation Link
============================================
*/
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--gold-fill);
    color: var(--on-gold);
    padding: 8px 16px;
    text-decoration: none;
    font-weight: 600;
    z-index: 100;
    border-radius: 0 0 4px 0;
}

.skip-link:focus {
    top: 0;
    outline: 3px solid var(--focus);
    outline-offset: 2px;
}

/*
============================================
ICON STYLES (stroke = currentColor → inherits theme)
============================================
*/
.icon {
    display: inline-block;
    width: 20px;
    height: 20px;
    vertical-align: middle;
    stroke: currentColor;
    stroke-width: 1.5;
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.icon-sm {
    width: 16px;
    height: 16px;
}

.icon-md {
    width: 20px;
    height: 20px;
}

.icon-lg {
    width: 24px;
    height: 24px;
}

/*
============================================
RESET & CORE STYLES
============================================
*/
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    background: var(--background-color);
}

body {
    font-family: var(--sans);
    background-color: var(--background-color);
    color: var(--text-color);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    line-height: 1.6;
    overflow-x: hidden;
}

/*
============================================
ATMOSPHERE — dark only, gated by data-atmo
- body background carries the lit-room gradient (lamp glow + charcoal)
- ::before = blueprint grid   (full only)
- ::after  = vignette + grain (full only)
============================================
*/
:root[data-theme="dark"] body {
    background:
        radial-gradient(1200px 720px at 50% -8%, rgba(var(--gold-rgb), .13), transparent 60%),
        linear-gradient(180deg, #101012 0%, #0d0d0f 45%, #0a0a0b 100%);
    background-attachment: fixed;
}

:root[data-theme="dark"][data-atmo="full"] body {
    background:
        radial-gradient(1200px 720px at 50% -8%, rgba(var(--gold-rgb), .14), transparent 60%),
        radial-gradient(900px 600px at 88% 18%, rgba(150,152,160,.05), transparent 55%),
        radial-gradient(1100px 900px at 10% 95%, rgba(47,156,106,.04), transparent 55%),
        linear-gradient(180deg, #101012 0%, #0d0d0f 45%, #0a0a0b 100%);
    background-attachment: fixed;
}

body::before,
body::after {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: -1;
    display: none;
}

/* blueprint grid */
:root[data-theme="dark"][data-atmo="full"] body::before {
    display: block;
    background-image:
        linear-gradient(to right, rgba(var(--gold-rgb), .05) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(var(--gold-rgb), .05) 1px, transparent 1px);
    background-size: 46px 46px;
    -webkit-mask-image: radial-gradient(1200px 1000px at 50% 18%, #000 30%, transparent 80%);
            mask-image: radial-gradient(1200px 1000px at 50% 18%, #000 30%, transparent 80%);
}

/* vignette + film grain */
:root[data-theme="dark"][data-atmo="full"] body::after {
    display: block;
    box-shadow: inset 0 0 240px 90px rgba(0,0,0,.6);
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix type='saturate' values='0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)' opacity='0.035'/></svg>");
}

/*
============================================
MAIN LAYOUT & STRUCTURE
============================================
*/
.container {
    max-width: var(--max-width);
    margin: 0 auto;
    display: flex;
}

#table-of-contents {
    width: var(--nav-width);
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    padding: calc(var(--header-height) + 40px) 20px 40px 0;
    border-right: 1px solid var(--border-color);
    flex-shrink: 0;
}

main {
    flex-grow: 1;
    max-width: var(--content-width);
    margin: 0 auto;
    padding: calc(var(--header-height) + 40px) 40px 100px 40px;
}

/*
============================================
HEADER — per-theme blurred bar
============================================
*/
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background-color: var(--header-bg);
    backdrop-filter: saturate(160%) blur(20px);
    -webkit-backdrop-filter: saturate(160%) blur(20px);
    border-bottom: 1px solid var(--border-color);
    z-index: 100;
}

.header-content {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 40px;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.header-title {
    font-family: var(--serif);
    font-size: 22px;
    font-weight: 400;
    letter-spacing: .2px;
    color: var(--heading);
}

/* header actions wrapper (theme + atmosphere toggles) */
.site-header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* shared header control look */
.search-button, .close-button, .nav-toggle,
.theme-toggle, .atmo-toggle {
    background: var(--panel);
    border: 1px solid var(--panel-edge);
    cursor: pointer;
    padding: 8px;
    height: 40px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--text-color);
    gap: 8px;
    transition: border-color .18s ease, color .18s ease, background-color .25s ease;
}

.search-button:hover, .close-button:hover, .nav-toggle:hover,
.theme-toggle:hover, .atmo-toggle:hover {
    border-color: var(--gold-label);
    color: var(--gold-text);
}

/* theme toggle — show exactly one icon per theme */
.theme-toggle { width: 40px; color: var(--gold-text); }
.theme-toggle svg { width: 20px; height: 20px; display: block; }
.theme-toggle .icon-sun  { display: none; }
.theme-toggle .icon-moon { display: block; }
:root[data-theme="dark"] .theme-toggle .icon-sun  { display: block; }
:root[data-theme="dark"] .theme-toggle .icon-moon { display: none; }

/* atmosphere toggle — temporary comparison control (label + icon) */
.atmo-toggle {
    padding: 8px 14px;
    font-family: var(--mono);
    font-size: 11px;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--gold-label);
}
.atmo-toggle .icon { color: currentColor; }
/* atmosphere control is meaningless in light — dim it so testers know it's dark-only */
:root[data-theme="light"] .atmo-toggle { opacity: .45; }

/*
============================================
TABLE OF CONTENTS
============================================
*/
#toc-nav {
    list-style: none;
}

#toc-nav h2 {
    font-family: var(--mono);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .18em;
    text-transform: uppercase;
    margin-bottom: 20px;
    color: var(--gold-label);
}

#toc-nav ul {
    list-style: none;
}

#toc-nav li a {
    color: var(--secondary-text-color);
    text-decoration: none;
    display: block;
    padding: 8px 0;
    font-size: 14px;
    transition: color 0.2s ease, border-color 0.2s ease, background-color 0.2s ease;
    border-left: 2px solid transparent;
    padding-left: 10px;
    margin-left: -12px;
    border-radius: 0 6px 6px 0;
}

#toc-nav li a:hover {
    color: var(--text-color);
    background-color: rgba(var(--gold-rgb), .05);
}

#toc-nav li a.active {
    color: var(--gold-text);
    font-weight: 600;
    border-left-color: var(--gold);
    background-color: rgba(var(--gold-rgb), .07);
}

/*
============================================
TYPOGRAPHY & CONTENT
============================================
*/
h1, h2, h3, h4 {
    font-family: var(--serif);
    font-weight: 400;
    line-height: 1.25;
    color: var(--heading);
    letter-spacing: .2px;
}

h1 {
    font-size: 40px;
    margin-bottom: 8px;
}

.page-intro {
    font-family: var(--serif);
    font-size: 22px;
    line-height: 1.4;
    color: var(--secondary-text-color);
    margin-bottom: 40px;
}

.chapter-title {
    font-family: var(--serif);
    font-size: 26px;
    color: var(--heading);
}

.chapter-content h3 {
    font-size: 24px;
    margin-top: 30px;
    margin-bottom: 15px;
    padding-bottom: 8px;
    border-bottom: 1px solid transparent;
    border-image: linear-gradient(90deg, var(--gold-deep), rgba(var(--gold-rgb), .05) 70%, transparent) 1;
}

.chapter-content h4 {
    font-family: var(--mono);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--gold-label);
    margin-top: 25px;
    margin-bottom: 10px;
}

p, li {
    font-size: 16px;
    margin-bottom: 1em;
}

ul, ol {
    padding-left: 20px;
    margin-bottom: 1em;
}

ul li, ol li {
    margin-bottom: 0.5em;
}

/* Remove bullet points from list items that start with SVG icons */
li:has(> svg.icon:first-child) {
    list-style: none;
}

strong, b {
    font-weight: 600;
    color: var(--heading);
}

kbd {
    background-color: var(--code-bg);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 2px 6px;
    font-family: var(--mono);
    font-size: 0.85em;
    color: var(--gold-soft);
}

a {
    color: var(--accent-color);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

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

hr {
    border: none;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--gold-deep), transparent);
    margin: 40px 0;
}

/*
============================================
COLLAPSIBLE SECTIONS (<details>)
============================================
*/
.chapter {
    margin-bottom: 20px;
}

details {
    border-bottom: 1px solid var(--border-color);
}

summary {
    list-style: none;
    cursor: pointer;
    padding: 20px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

summary::-webkit-details-marker {
    display: none;
}

summary:focus-visible {
    outline: 3px solid var(--focus);
    outline-offset: 2px;
}

summary::after {
    content: '';
    display: inline-block;
    width: 24px;
    height: 24px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23d4a017' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='9 18 15 12 9 6'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    transition: transform 0.2s ease-in-out;
    flex-shrink: 0;
}

details[open] > summary::after {
    transform: rotate(90deg);
}

.chapter-content {
    padding-bottom: 30px;
}

/*
============================================
CODE BLOCKS
============================================
*/
.code-wrapper {
    position: relative;
    margin-bottom: 1em;
}

pre {
    background-color: var(--code-bg);
    border: 1px solid var(--panel-edge);
    border-radius: 8px;
    padding: 16px;
    overflow-x: auto;
    margin-bottom: 0;
    font-size: 14px;
    line-height: 1.6;
    box-shadow: inset 0 1px 0 var(--inset-hi);
}

code {
    font-family: var(--mono);
    color: var(--text-color);
}

p > code, li > code {
    background-color: rgba(var(--gold-rgb), .08);
    color: var(--gold-soft);
    border: 1px solid rgba(var(--gold-rgb), .14);
    border-radius: 4px;
    padding: 1px 6px;
    font-size: 0.86em;
}

pre code {
    white-space: pre-wrap;
    word-wrap: break-word;
    background: none;
    border: none;
    padding: 0;
    color: var(--text-color);
}

/* Copy button — gold pill */
.copy-code-button {
    position: absolute;
    top: 8px;
    right: 8px;
    padding: 6px 12px;
    background-color: var(--gold-fill);
    color: var(--on-gold);
    border: none;
    border-radius: 6px;
    font-family: var(--mono);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .06em;
    cursor: pointer;
    opacity: 0.85;
    transition: opacity 0.2s ease;
    z-index: 10;
}

.copy-code-button:hover {
    opacity: 1;
}

.copy-code-button:focus-visible {
    outline: 3px solid var(--focus);
    outline-offset: 2px;
}

.copy-code-button.copied {
    background-color: var(--lamp);
    color: #fff;
}

.code-platform-label {
    font-family: var(--mono);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--gold-label);
    margin: 20px 0 10px 0;
}

/* Tables */
table.command-list {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1em;
    font-size: 14px;
}
table.command-list th, table.command-list td {
    text-align: left;
    padding: 10px 8px;
    border-bottom: 1px solid var(--border-color);
}
table.command-list th {
    font-family: var(--mono);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--gold-label);
}
table.command-list td:first-child {
    font-family: var(--mono);
    color: var(--gold-soft);
}

/*
============================================
SEARCH MODAL
============================================
*/
.search-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--header-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 200;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 10vh;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.search-modal.is-active {
    opacity: 1;
    visibility: visible;
}

.search-content {
    width: 90%;
    max-width: 700px;
}

.search-modal .close-button {
    position: absolute;
    top: 20px;
    right: 20px;
}

#search-input {
    width: 100%;
    border: none;
    border-bottom: 2px solid var(--gold);
    background: transparent;
    font-family: var(--serif);
    font-size: 32px;
    padding: 10px 0;
    font-weight: 400;
    outline: none;
    color: var(--text-color);
    margin-bottom: 30px;
}

#search-results {
    max-height: 60vh;
    overflow-y: auto;
}

.search-result-item {
    padding: 15px;
    border-bottom: 1px solid var(--border-color);
    display: block;
    text-decoration: none;
    color: var(--text-color);
    border-radius: 8px;
    margin-bottom: 5px;
}

.search-result-item:hover {
    background-color: rgba(var(--gold-rgb), .07);
}

.search-result-title {
    font-size: 18px;
    font-weight: 500;
    margin-bottom: 5px;
    color: var(--heading);
}

.search-result-context {
    font-size: 14px;
    color: var(--secondary-text-color);
    line-height: 1.5;
}

mark {
    background-color: rgba(var(--gold-rgb), .28);
    color: var(--heading);
    border-radius: 3px;
    padding: 1px 3px;
}

/* Back to top button — pka pill */
.back-to-top {
    position: fixed;
    bottom: 40px;
    right: 40px;
    width: 48px;
    height: 48px;
    background-color: var(--toptop-bg);
    color: var(--gold-text);
    border: 1px solid var(--panel-edge);
    border-radius: 50%;
    font-size: 22px;
    cursor: pointer;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s, transform 0.2s, border-color 0.2s;
    box-shadow: 0 12px 30px -12px rgba(0,0,0,.8);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 90;
    display: flex;
    align-items: center;
    justify-content: center;
}

.back-to-top.visible {
    opacity: 1;
    pointer-events: all;
}

.back-to-top:hover {
    transform: translateY(-4px);
    border-color: var(--gold-label);
}

.back-to-top:focus-visible {
    outline: 3px solid var(--focus);
    outline-offset: 2px;
}

/* FOOTER */
.site-footer {
    text-align: center;
    padding: 40px 20px;
    font-family: var(--mono);
    font-size: 11.5px;
    letter-spacing: .08em;
    color: var(--secondary-text-color);
    border-top: 1px solid var(--border-color);
}
.site-footer p {
    font-size: 11.5px;
}

/*
============================================
FOCUS MANAGEMENT — GOLD, opaque, both themes
============================================
*/
:focus-visible {
    outline: 3px solid var(--focus);
    outline-offset: 2px;
}

/*
============================================
RESPONSIVE DESIGN (MOBILE-FIRST)
============================================
*/
.nav-toggle {
    display: none;
}

@media (max-width: 1024px) {
    .container {
        flex-direction: column;
    }

    #table-of-contents {
        position: fixed;
        left: -300px;
        top: var(--header-height);
        height: calc(100vh - var(--header-height));
        background-color: var(--background-color);
        z-index: 99;
        transition: left 0.3s ease;
        box-shadow: 2px 0 18px rgba(0,0,0,0.4);
        padding-left: 20px;
    }
    :root[data-theme="dark"] #table-of-contents { background-color: #0c0c0d; }

    #table-of-contents.mobile-open {
        left: 0;
    }

    .nav-toggle {
        display: flex;
    }

    main {
        width: 100%;
        padding: calc(var(--header-height) + 20px) 20px 50px 20px;
    }

    .header-content {
        padding: 0 20px;
    }

    #search-input {
        font-size: 24px;
    }
}

@media (max-width: 768px) {
    /* keep the atmosphere comparison control compact */
    .atmo-toggle { padding: 8px 10px; }

    /* Header stays a compact single row on phones — toggles never go full-width. */
    .header-content { padding: 0 16px; }
    .header-title { font-size: 17px; }
    .site-header-actions { gap: 8px; }
    .site-header-actions .theme-toggle,
    .site-header-actions .atmo-toggle { width: auto; }
    #atmo-toggle-label { display: none; }   /* atmosphere control -> icon-only when cramped */
}

/*
============================================
REDUCED MOTION
============================================
*/
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
        scroll-behavior: auto !important;
    }
    html { scroll-behavior: auto; }
}

/*
============================================
PRINT — force light ink, atmosphere off, sidebar hidden
============================================
*/
@media print {
    :root, :root[data-theme="dark"], :root[data-theme="light"] {
        --background-color: #ffffff;
        --text-color: #000000;
        --secondary-text-color: #333333;
        --heading: #000000;
        --accent-color: #000000;
        --panel: #ffffff;
        --panel-solid: #ffffff;
        --code-bg: #f4f4f4;
        --border-color: #cccccc;
        --panel-edge: #cccccc;
    }

    html, body { background: #ffffff !important; color: #000 !important; }
    body::before, body::after { display: none !important; }

    .site-header,
    .nav-toggle,
    .back-to-top,
    .search-button,
    .theme-toggle,
    .atmo-toggle {
        display: none !important;
    }

    #table-of-contents {
        display: none;
    }

    main {
        margin-left: 0;
        max-width: 100%;
    }

    .chapter {
        page-break-inside: avoid;
    }

    a {
        color: #000;
        text-decoration: underline;
    }
}

/*
============================================
CHAPTER QUIZ LINKS - Bidirectional Navigation
============================================
*/
.chapter-quiz-link {
    margin-top: 32px;
    padding: 24px;
    background: var(--panel-solid);
    border-radius: 16px;
    text-align: center;
    border: 1px solid var(--panel-edge);
    box-shadow: inset 0 1px 0 var(--inset-hi), var(--card-shadow);
    transition: transform .18s ease, box-shadow .25s ease, border-color .18s ease;
}

.chapter-quiz-link:hover {
    transform: translateY(-2px);
    border-color: var(--edge-strong);
    box-shadow: var(--hover-glow);
}

.chapter-quiz-link p {
    margin-bottom: 12px;
    color: var(--secondary-text-color);
    font-size: 1rem;
}

.btn-quiz-link {
    display: inline-block;
    padding: 12px 24px;
    background: var(--gold-fill);
    color: var(--on-gold);
    text-decoration: none;
    border-radius: 999px;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.25s ease;
    border: 1px solid var(--gold-fill);
}

.btn-quiz-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 26px -10px rgba(var(--gold-rgb), .7);
    text-decoration: none;
}

.btn-quiz-link:active {
    transform: translateY(0);
}

.btn-quiz-link:focus-visible {
    outline: 3px solid var(--focus);
    outline-offset: 2px;
}

@media (max-width: 768px) {
    .chapter-quiz-link {
        padding: 20px;
    }

    .btn-quiz-link {
        display: block;
        width: 100%;
        padding: 14px 20px;
    }
}
