/* ==========================================================================
   CVC Words — design system
   --------------------------------------------------------------------------
   A warm, editorial look for a US/UK early-literacy audience: paper-toned
   background, deep ink text, a single confident teal brand colour, and soft
   per-vowel accents so the five short vowels read as five distinct families.

   Contents
     1.  Tokens
     2.  Reset & base type
     3.  Layout
     4.  Header
     5.  Banner / page hero
     6.  Cards & prose
     7.  Buttons
     8.  Pills, tags, word lists
     9.  Word grid & word cards
    10.  Tables
    11.  FAQ
    12.  Breadcrumb
    13.  Related word links
    14.  Word detail hero + sound boxes
    15.  Pronunciation panel
    16.  Popup
    17.  Search & filters
    18.  SEO sections
    19.  Game pages
    20.  Editorial sections (guide pages)
    21.  Footer
    22.  Back to top
    23.  Language selector
    24.  Utilities
    25.  Responsive
   ========================================================================== */

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

:root {
    /* Surfaces */
    --paper: #fbf9f4;
    --surface: #ffffff;
    --surface-sunk: #f4f1ea;
    --line: #e9e4d9;
    --line-strong: #d9d2c3;

    /* Ink */
    --ink: #182430;
    --ink-soft: #4a5a6a;
    --ink-mute: #7e8a97;

    /* Brand */
    --brand: #12584f;
    --brand-deep: #0d423b;
    --brand-tint: #e6f2ef;
    --accent: #c74a22;
    --accent-tint: #fdece5;

    /* Feedback */
    --good: #1b8057;
    --good-tint: #e7f5ee;
    --warn: #a06a12;
    --warn-tint: #fdf3df;
    --bad: #b8402f;
    --bad-tint: #fdecea;

    /* Per-vowel accents. These are deliberately darker than a pastel so the
       word itself stays readable at large display sizes on white. */
    --v-a: #b8431f;
    --v-e: #8f6108;
    --v-i: #0b6b74;
    --v-o: #33509f;
    --v-u: #6a3fb0;

    /* Type */
    --font-display: 'Nunito', 'Trebuchet MS', 'Segoe UI', system-ui, sans-serif;
    --font-body: 'Inter', 'Segoe UI', system-ui, -apple-system, 'Helvetica Neue', Arial, sans-serif;

    /* Elevation */
    --shadow-sm: 0 1px 2px rgba(24, 36, 48, 0.05);
    --shadow-md: 0 10px 24px -12px rgba(24, 36, 48, 0.22);
    --shadow-lg: 0 26px 60px -28px rgba(24, 36, 48, 0.35);

    /* Radii */
    --r-sm: 10px;
    --r-md: 14px;
    --r-lg: 20px;
    --r-xl: 28px;
    --r-pill: 999px;

    /* Rhythm */
    --gutter: clamp(1rem, 4vw, 2.5rem);
    --maxw: 1120px;
}

/* ------------------------------------------------- 2. Reset & base type -- */

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

html {
    scroll-behavior: smooth;
    /* Keeps in-page anchors clear of the sticky header (68px tall). Without
       this, a #hash jump parks the target underneath the header. */
    scroll-padding-top: 84px;
    -webkit-text-size-adjust: 100%;
}

body {
    background-color: var(--paper);
    color: var(--ink);
    font-family: var(--font-body);
    font-size: 17px;
    line-height: 1.65;
    font-feature-settings: 'kern' 1, 'liga' 1;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-display);
    font-weight: 800;
    line-height: 1.18;
    letter-spacing: -0.015em;
    color: var(--ink);
}

p {
    text-wrap: pretty;
}

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

a {
    color: var(--brand);
    text-decoration-thickness: 1px;
    text-underline-offset: 2px;
    transition: color 0.18s ease, background-color 0.18s ease,
        border-color 0.18s ease, box-shadow 0.18s ease;
}

a:hover {
    color: var(--brand-deep);
}

::selection {
    background: var(--brand);
    color: #fff;
}

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

/* ------------------------------------------------------------ 3. Layout -- */

main {
    max-width: var(--maxw);
    margin: 0 auto;
    padding: clamp(1.5rem, 3.5vw, 2.75rem) var(--gutter) 4rem;
}

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

header {
    position: sticky;
    top: 0;
    z-index: 800;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    height: 68px;
    padding: 0 var(--gutter);
    background: rgba(251, 249, 244, 0.88);
    backdrop-filter: saturate(160%) blur(10px);
    -webkit-backdrop-filter: saturate(160%) blur(10px);
    border-bottom: 1px solid var(--line);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    min-width: 0;
}

.logo {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border-radius: 12px;
    background: var(--brand-tint);
    overflow: hidden;
}

.logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.site-title,
.site-title-text {
    text-align: left;
    min-width: 0;
}

header h1,
.site-title h1,
.site-title-text a {
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 800;
    letter-spacing: -0.01em;
    line-height: 1.2;
    color: var(--ink);
    text-decoration: none;
    white-space: nowrap;
}

.site-title a,
.site-title-text a {
    color: var(--ink);
}

.header-nav {
    display: flex;
    align-items: center;
    min-width: 0;
}

.nav-links {
    display: flex;
    flex-wrap: wrap;
    list-style: none;
    gap: 0.1rem;
    align-items: center;
    justify-content: flex-end;
}

.nav-links a {
    display: inline-block;
    padding: 0.4rem 0.62rem;
    border-radius: var(--r-pill);
    color: var(--ink-soft);
    font-size: 0.855rem;
    font-weight: 500;
    text-decoration: none;
    white-space: nowrap;
}

.nav-links a:hover {
    color: var(--brand);
    background: var(--brand-tint);
    text-decoration: none;
}

.header-right {
    display: flex;
    align-items: center;
}

/* ------------------------------------------------- 5. Banner / page hero -- */

.banner {
    position: relative;
    overflow: hidden;
    background: linear-gradient(168deg, #f3efe4 0%, #faf7ef 55%, #f6f2e7 100%);
    border-bottom: 1px solid var(--line);
    padding: clamp(2.4rem, 6vw, 4.25rem) var(--gutter) clamp(2.6rem, 6vw, 4.5rem);
    text-align: center;
}

/* A soft radial wash behind the heading, in the brand hue. */
.banner::before {
    content: '';
    position: absolute;
    inset: -40% -10% auto -10%;
    height: 130%;
    background: radial-gradient(
        58% 62% at 50% 0%,
        rgba(18, 88, 79, 0.085) 0%,
        rgba(18, 88, 79, 0) 68%
    );
    pointer-events: none;
}

.banner > * {
    position: relative;
}

.banner-content {
    max-width: 760px;
    margin: 0 auto;
}

.banner h1,
.banner h2 {
    font-size: clamp(1.85rem, 4.6vw, 2.9rem);
    font-weight: 800;
    letter-spacing: -0.025em;
    color: var(--ink);
    margin-bottom: 0.75rem;
    text-wrap: balance;
}

.banner p {
    font-size: clamp(1rem, 1.6vw, 1.12rem);
    color: var(--ink-soft);
    max-width: 660px;
    margin: 0 auto;
    text-wrap: pretty;
}

/* Small uppercase kicker above a hero heading. */
.banner-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    padding: 0.35rem 0.9rem;
    border-radius: var(--r-pill);
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid var(--line);
    color: var(--brand);
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.09em;
    text-transform: uppercase;
}

.banner-eyebrow::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent);
}

/* Call-to-action pair under a hero heading. */
.banner-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.65rem;
    margin-top: 1.7rem;
}

.banner-actions .btn-primary,
.banner-actions .btn-ghost {
    padding: 0.78rem 1.55rem;
    font-size: 0.96rem;
}

.btn-ghost {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    background: rgba(255, 255, 255, 0.9);
    color: var(--ink);
    border: 1px solid var(--line-strong);
    border-radius: var(--r-pill);
    font-family: var(--font-body);
    font-size: 0.95rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
}

.btn-ghost:hover {
    background: var(--surface);
    border-color: var(--ink-mute);
    color: var(--ink);
}

/* Five short-vowel shortcuts, one accent colour each. */
.vowel-chips {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 1.6rem;
}

.vowel-chip {
    display: inline-flex;
    align-items: baseline;
    gap: 0.35rem;
    padding: 0.4rem 0.9rem;
    border-radius: var(--r-pill);
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid var(--line);
    color: var(--ink-soft);
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
}

.vowel-chip b {
    font-family: var(--font-display);
    font-size: 0.95rem;
    font-weight: 800;
    color: var(--vowel-color, var(--brand));
}

.vowel-chip:hover {
    border-color: var(--vowel-color, var(--brand));
    color: var(--ink);
    background: var(--surface);
}

.banner-breadcrumb {
    display: inline-flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.35rem;
    margin-top: 1.4rem;
    padding: 0.4rem 0.95rem;
    border-radius: var(--r-pill);
    background: rgba(255, 255, 255, 0.75);
    border: 1px solid var(--line);
    font-size: 0.82rem;
    color: var(--ink-mute);
}

.banner-breadcrumb a {
    color: var(--ink-soft);
    text-decoration: none;
    font-weight: 500;
}

.banner-breadcrumb a:hover {
    color: var(--brand);
    text-decoration: underline;
}

/* ------------------------------------------------------- 6. Cards & prose -- */

.card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-sm);
    padding: clamp(1.35rem, 3vw, 2.25rem);
    margin-bottom: 1.4rem;
}

.card h2 {
    font-size: clamp(1.3rem, 2.2vw, 1.55rem);
    color: var(--ink);
    margin: 0.9rem 0;
}

.card h3 {
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--ink);
    margin: 1.4rem 0 0.55rem;
}

.card h4 {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 700;
    color: var(--ink-soft);
    margin: 1.1rem 0 0.4rem;
}

.prose p {
    margin-bottom: 1rem;
    color: var(--ink-soft);
}

.prose p strong,
.card p strong {
    color: var(--ink);
    font-weight: 600;
}

.prose ul,
.prose ol {
    margin: 0 0 1rem 1.35rem;
}

.prose li {
    margin-bottom: 0.45rem;
    color: var(--ink-soft);
}

.prose a,
.card a {
    color: var(--brand);
    font-weight: 500;
}

.prose a:hover,
.card a:hover {
    color: var(--brand-deep);
}

/* ------------------------------------------------------------ 7. Buttons -- */

button {
    font-family: inherit;
    font-size: 1rem;
}

.btn-primary,
.modal-guide-link .btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    background: var(--brand);
    color: #fff;
    border: 1px solid transparent;
    border-radius: var(--r-pill);
    padding: 0.72rem 1.45rem;
    font-family: var(--font-body);
    font-size: 0.95rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    box-shadow: 0 6px 16px -10px rgba(18, 88, 79, 0.85);
}

.btn-primary:hover,
.modal-guide-link .btn-primary:hover {
    background: var(--brand-deep);
    color: #fff;
    transform: translateY(-1px);
}

/* ------------------------------------------------------ 8b. Family blocks -- */

.fam {
    margin-bottom: 1.1rem;
}

.fam h3 {
    color: var(--ink);
    margin-bottom: 0.3rem;
    font-size: 1.05rem;
}

.fam p {
    color: var(--ink-soft);
    font-size: 0.95rem;
}

/* ---------------------------------------------- 8. Pills, tags, word lists -- */

.pill-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 1rem 0;
}

.pill {
    display: inline-flex;
    align-items: center;
    background: var(--surface);
    border: 1px solid var(--line-strong);
    color: var(--ink-soft);
    padding: 0.42rem 0.95rem;
    border-radius: var(--r-pill);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.88rem;
}

.pill:hover {
    background: var(--brand-tint);
    border-color: var(--brand);
    color: var(--brand);
}

.pill.dark {
    background: var(--ink);
    border-color: var(--ink);
    color: #fff;
}

.pill.dark:hover {
    background: var(--brand);
    border-color: var(--brand);
    color: #fff;
}

.category-tag {
    display: inline-block;
    background: var(--surface-sunk);
    border: 1px solid var(--line);
    color: var(--ink-mute);
    padding: 0.24rem 0.7rem;
    border-radius: var(--r-pill);
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.01em;
}

.word-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    margin: 0.9rem 0 1.4rem;
}

.word-list > div {
    width: 100%;
}

.word-item {
    display: inline-block;
    background: var(--surface-sunk);
    border: 1px solid transparent;
    color: var(--ink-soft);
    border-radius: var(--r-sm);
    padding: 0.38rem 0.8rem;
    font-weight: 600;
    font-size: 0.9rem;
    text-decoration: none;
}

.word-item:hover {
    background: var(--brand-tint);
    border-color: var(--brand);
    color: var(--brand);
}

.word-item.static {
    cursor: default;
    color: var(--ink-mute);
}

/* ------------------------------------------ 9. Word grid & word cards ----- */

.word-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(232px, 1fr));
    gap: clamp(0.85rem, 1.8vw, 1.25rem);
}

.word-card {
    position: relative;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    padding: 1.35rem 1.1rem 1.2rem;
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.2rem;
    transition: transform 0.22s ease, box-shadow 0.22s ease,
        border-color 0.22s ease;
}

.word-card::after {
    /* A hairline of the vowel colour down the left edge. */
    content: '';
    position: absolute;
    left: 0;
    top: 22%;
    bottom: 22%;
    width: 3px;
    border-radius: 0 3px 3px 0;
    background: var(--vowel-color, var(--line-strong));
    opacity: 0.75;
}

.word-card:hover {
    transform: translateY(-4px);
    border-color: var(--line-strong);
    box-shadow: var(--shadow-md);
}

.word-card:focus-visible {
    outline: 3px solid var(--accent);
    outline-offset: 2px;
}

.word-card .word {
    display: block;
    font-family: var(--font-display);
    font-size: clamp(2rem, 3.2vw, 2.5rem);
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.1;
    color: var(--vowel-color, var(--brand));
    margin-bottom: 0.1rem;
}

.word-card .phonetics {
    display: block;
    font-size: 0.95rem;
    color: var(--ink-mute);
    margin-bottom: 0.45rem;
    font-variant-numeric: tabular-nums;
}

.word-card .example {
    display: block;
    color: var(--ink-soft);
    font-size: 0.86rem;
    line-height: 1.45;
    min-height: 2.5em;
}

.word-card .category-tag {
    margin-top: 0.75rem;
}

.word-card img {
    width: 108px;
    height: 108px;
    object-fit: contain;
    margin-bottom: 0.7rem;
    border-radius: var(--r-md);
    background: var(--surface-sunk);
}

.word-card .card-cta {
    margin-top: 0.8rem;
    font-size: 0.8rem;
    color: var(--ink-mute);
    font-weight: 600;
}

/* The five short vowels each get their own accent. The attribute is set on
   the card markup by the generator and on the homepage cards. */
[data-vowel='a'] { --vowel-color: var(--v-a); }
[data-vowel='e'] { --vowel-color: var(--v-e); }
[data-vowel='i'] { --vowel-color: var(--v-i); }
[data-vowel='o'] { --vowel-color: var(--v-o); }
[data-vowel='u'] { --vowel-color: var(--v-u); }

/* ------------------------------------------------------------- 10. Tables -- */

.table-wrap {
    overflow-x: auto;
    margin: 1rem 0;
    border: 1px solid var(--line);
    border-radius: var(--r-md);
}

table {
    width: 100%;
    border-collapse: collapse;
    background: var(--surface);
}

th,
td {
    padding: 0.72rem 0.95rem;
    text-align: left;
    font-size: 0.92rem;
    border-bottom: 1px solid var(--line);
}

th {
    background: var(--surface-sunk);
    color: var(--ink);
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 0.85rem;
    letter-spacing: 0.01em;
}

tbody tr:last-child td {
    border-bottom: none;
}

tr:nth-child(even) td {
    background: #fcfbf7;
}

/* ---------------------------------------------------------------- 11. FAQ -- */

.faq details {
    border-bottom: 1px solid var(--line);
    padding: 0.95rem 0;
}

.faq details:last-of-type {
    border-bottom: none;
}

.faq summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    cursor: pointer;
    list-style: none;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1rem;
    color: var(--ink);
}

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

.faq summary::after {
    content: '+';
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--surface-sunk);
    color: var(--brand);
    font-size: 1.05rem;
    font-weight: 700;
    line-height: 1;
    transition: background 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.faq details[open] summary::after {
    content: '\2212';
    background: var(--brand);
    color: #fff;
}

.faq details p {
    margin-top: 0.7rem;
    color: var(--ink-soft);
    font-size: 0.95rem;
}

/* The homepage writes its FAQ inline as <details> without the .faq wrapper. */
main > section details,
.seo-section details {
    border-bottom: 1px solid var(--line);
    padding: 0.95rem 0;
}

main > section details summary,
.seo-section details summary {
    cursor: pointer;
    font-family: var(--font-display);
    font-weight: 700;
    color: var(--ink);
}

/* --------------------------------------------------------- 12. Breadcrumb -- */

.breadcrumb {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.83rem;
    color: var(--ink-mute);
    margin-bottom: 1.1rem;
}

.breadcrumb a {
    color: var(--ink-mute);
    text-decoration: none;
    font-weight: 500;
}

.breadcrumb a:hover {
    color: var(--brand);
    text-decoration: underline;
}

/* ------------------------------------------------- 13. Related word links -- */

.related-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
    gap: 0.55rem;
    margin-top: 1rem;
}

.related-grid a {
    display: block;
    background: var(--surface-sunk);
    border: 1px solid transparent;
    color: var(--ink-soft);
    border-radius: var(--r-sm);
    padding: 0.62rem 0.7rem;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.92rem;
    text-align: center;
}

.related-grid a:hover {
    background: var(--brand-tint);
    border-color: var(--brand);
    color: var(--brand);
}

.related-grid .word-item.static {
    display: block;
    text-align: center;
    background: var(--surface-sunk);
    color: var(--ink-mute);
    padding: 0.62rem 0.7rem;
    border-radius: var(--r-sm);
}

/* --------------------------------------- 14. Word detail hero & sound boxes -- */

.word-hero {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: clamp(1.25rem, 3vw, 2.5rem);
}

.word-hero-img {
    width: 208px;
    height: 208px;
    object-fit: contain;
    border-radius: var(--r-xl);
    background: linear-gradient(150deg, #f6f3ea, #fbf9f4);
    border: 1px solid var(--line);
    padding: 0.75rem;
    flex-shrink: 0;
}

.word-hero-text {
    flex: 1 1 320px;
    min-width: 0;
}

.word-hero-text .big-word {
    font-family: var(--font-display);
    font-size: clamp(2.6rem, 6vw, 3.6rem);
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1;
    color: var(--brand);
    margin-bottom: 0.35rem;
}

.word-hero-text .ipa {
    font-size: 1.1rem;
    color: var(--ink-soft);
    margin: 0.35rem 0 0.85rem;
    font-variant-numeric: tabular-nums;
}

.sound-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    margin: 1rem 0;
}

.sound-box {
    background: var(--surface-sunk);
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    padding: 0.7rem 1rem;
    text-align: center;
    min-width: 76px;
}

.sound-box .letter {
    display: block;
    font-family: var(--font-display);
    font-size: 1.55rem;
    font-weight: 800;
    color: var(--ink);
    line-height: 1.1;
}

.sound-box .sound {
    display: block;
    font-size: 0.82rem;
    color: var(--ink-mute);
    margin-top: 0.15rem;
}

.sentence-list {
    list-style: none;
}

.sentence-list li {
    padding: 0.62rem 0;
    border-bottom: 1px dashed var(--line);
}

.sentence-list li:last-child {
    border-bottom: none;
}

.example {
    color: var(--ink-soft);
}

.hint {
    background: var(--warn-tint);
    border-left: 3px solid #d9a13a;
    padding: 0.9rem 1.1rem;
    border-radius: 0 var(--r-sm) var(--r-sm) 0;
    margin: 1.2rem 0;
    color: #6f4d0d;
}

.hint strong {
    color: var(--warn);
}

.callout {
    background: var(--brand-tint);
    border-left: 3px solid var(--brand);
    padding: 0.95rem 1.15rem;
    border-radius: 0 var(--r-sm) var(--r-sm) 0;
    margin: 1.2rem 0;
    color: var(--ink-soft);
}

/* -------------------------------------------------- 15. Pronunciation panel -- */

.pronunciation-card {
    padding: clamp(1.25rem, 3vw, 1.9rem) clamp(1.25rem, 3vw, 2.1rem);
}

.pronunciation-panel {
    width: 100%;
}

.pronunciation-panel-head {
    margin-bottom: 1.25rem;
    padding-bottom: 0.85rem;
    border-bottom: 1px solid var(--line);
}

.pronunciation-panel-title {
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--ink);
    margin: 0 0 0.2rem;
}

.pronunciation-panel-sub {
    color: var(--ink-mute);
    font-size: 0.9rem;
    margin: 0;
}

.pronunciation-sounds {
    display: flex;
    gap: 0.65rem;
    flex-wrap: wrap;
    margin-bottom: 1.4rem;
}

.sound-card {
    width: 94px;
    padding: 0.85rem 0.5rem 0.75rem;
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    background: var(--surface-sunk);
    text-align: center;
    cursor: pointer;
    font-family: inherit;
    transition: border-color 0.18s ease, background-color 0.18s ease,
        transform 0.18s ease;
}

.sound-card:hover {
    border-color: var(--brand);
    background: var(--brand-tint);
    transform: translateY(-3px);
}

.sound-card:focus-visible {
    outline: 3px solid var(--accent);
    outline-offset: 2px;
}

.sound-card-letter {
    display: block;
    font-family: var(--font-display);
    font-size: 1.85rem;
    font-weight: 800;
    color: var(--brand);
    line-height: 1.1;
    letter-spacing: -0.02em;
}

.sound-card-sound {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.82rem;
    color: var(--ink-mute);
}

.pronunciation-actions {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.pronunciation-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
}

.pronunciation-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    background: var(--brand);
    color: #fff;
    border: 1px solid transparent;
    border-radius: var(--r-pill);
    padding: 0.58rem 1.1rem;
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.18s ease, transform 0.18s ease,
        border-color 0.18s ease;
}

.pronunciation-btn:hover {
    background: var(--brand-deep);
    transform: translateY(-1px);
}

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

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

.pronunciation-btn-icon {
    font-size: 0.95rem;
    line-height: 1;
}

.pronunciation-btn-label {
    font-size: 0.9rem;
    font-weight: 600;
    line-height: 1;
}

.pronunciation-btn.is-primary {
    background: var(--good);
}

.pronunciation-btn.is-primary:hover {
    background: #146547;
}

.pronunciation-btn.is-quiet {
    background: var(--surface);
    color: var(--ink-soft);
    border-color: var(--line-strong);
}

.pronunciation-btn.is-quiet:hover {
    background: var(--surface-sunk);
    color: var(--ink);
}

/* -------------------------------------------------------------- 16. Popup -- */

.modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(16, 26, 34, 0.55);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    padding: 20px;
    overflow-y: auto;
}

.modal-content {
    position: relative;
    width: min(520px, 100%);
    max-height: 90vh;
    overflow-y: auto;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r-xl);
    box-shadow: var(--shadow-lg);
    padding: clamp(1.4rem, 4vw, 2.1rem);
    margin: auto;
    scroll-behavior: smooth;
}

@media (min-width: 769px) {
    .modal-content {
        overflow-y: visible;
        max-height: none;
    }
}

.close-modal {
    position: absolute;
    top: 0.85rem;
    right: 0.85rem;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--surface-sunk);
    color: var(--ink-mute);
    font-size: 1.25rem;
    line-height: 1;
    cursor: pointer;
    z-index: 3;
    transition: background 0.18s ease, color 0.18s ease;
}

.close-modal:hover {
    background: var(--ink);
    color: #fff;
}

.word-detail {
    text-align: center;
    padding-bottom: 0.5rem;
}

.word-detail .word {
    font-family: var(--font-display);
    font-size: clamp(2.6rem, 8vw, 3.4rem);
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.05;
    color: var(--brand);
}

.word-detail .phonetics {
    font-size: 1.05rem;
    color: var(--ink-mute);
    margin-bottom: 0.7rem;
}

.word-image {
    display: block;
    width: 230px;
    height: 230px;
    object-fit: contain;
    margin: 0 auto 1rem;
    border-radius: var(--r-xl);
    background: linear-gradient(150deg, #f6f3ea, #fbf9f4);
    border: 1px solid var(--line);
    padding: 0.6rem;
}

.pronunciation-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    justify-content: center;
}

.pronunciation-info {
    margin-bottom: 1rem;
    color: var(--ink-mute);
    font-size: 0.86rem;
}

.phonics-pronunciation {
    margin-top: 1.35rem;
}

.phonics-pronunciation h3,
.examples-list h3 {
    font-family: var(--font-display);
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--ink-mute);
    margin-bottom: 0.55rem;
}

.letter-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    justify-content: center;
    margin: 0.85rem 0;
}

.letter-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--brand-tint);
    color: var(--brand);
    border: 1px solid transparent;
    font-family: var(--font-display);
    font-size: 1.15rem;
    font-weight: 800;
    cursor: pointer;
    transition: background 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.letter-btn:hover {
    background: var(--brand);
    color: #fff;
    transform: translateY(-2px);
}

.examples-list {
    margin-top: 1.35rem;
    text-align: left;
}

.examples-list ul {
    list-style: none;
}

.examples-list .example {
    display: block;
    padding: 0.5rem 0.75rem;
    background: var(--surface-sunk);
    border-radius: var(--r-sm);
    font-size: 0.9rem;
    color: var(--ink-soft);
    margin-bottom: 0.4rem;
}

.modal-guide-link {
    margin-top: 1.35rem;
}

/* The popup's own button sizing, so the pronunciation row never stretches. */
.word-detail .pronunciation-btn {
    width: auto;
    flex: 0 0 auto;
    margin-top: 0;
    padding: 0.55rem 1rem;
    font-size: 0.88rem;
}

.word-detail .pronunciation-btn.is-secondary,
.word-detail .pronunciation-buttons.is-secondary {
    margin-top: 0.5rem;
}

.nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--surface);
    border: 1px solid var(--line);
    box-shadow: var(--shadow-sm);
    color: var(--ink-soft);
    font-size: 1.05rem;
    cursor: pointer;
    z-index: 3;
}

.nav-btn:hover {
    background: var(--brand);
    border-color: var(--brand);
    color: #fff;
}

.prev-btn {
    left: -19px;
}

.next-btn {
    right: -19px;
}

/* --------------------------------------------------- 17. Search & filters -- */

.controls {
    display: flex;
    flex-wrap: wrap;
    gap: 0.7rem;
    margin-bottom: 1.35rem;
    padding: 0.9rem;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-sm);
}

.search-box {
    flex: 2 1 240px;
    min-width: 200px;
}

.filter-box {
    flex: 1 1 160px;
    min-width: 140px;
}

input,
select,
textarea {
    width: 100%;
    padding: 0.68rem 0.9rem;
    border: 1px solid var(--line-strong);
    border-radius: var(--r-pill);
    font-family: inherit;
    font-size: 0.95rem;
    color: var(--ink);
    background: var(--surface);
    transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

input::placeholder {
    color: var(--ink-mute);
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--brand);
    box-shadow: 0 0 0 4px rgba(18, 88, 79, 0.12);
}

select {
    appearance: none;
    background-image: linear-gradient(45deg, transparent 50%, var(--ink-mute) 50%),
        linear-gradient(135deg, var(--ink-mute) 50%, transparent 50%);
    background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%;
    background-size: 5px 5px, 5px 5px;
    background-repeat: no-repeat;
    padding-right: 2.2rem;
}

.controls button,
#reset-filters {
    width: auto;
    flex: 0 0 auto;
    padding: 0.68rem 1.2rem;
    border: 1px solid var(--line-strong);
    border-radius: var(--r-pill);
    background: var(--surface);
    color: var(--ink-soft);
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
}

.controls button:hover,
#reset-filters:hover {
    background: var(--surface-sunk);
    color: var(--ink);
    border-color: var(--ink-mute);
}

#filter-status {
    color: var(--ink-mute);
    font-size: 0.88rem;
    margin: 0 0 1rem;
}

/* ------------------------------------------------------- 18. SEO sections -- */

.seo-section {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-sm);
    padding: clamp(1.35rem, 3vw, 2.25rem);
    margin-top: 1.5rem;
}

.seo-section h2 {
    font-size: clamp(1.25rem, 2.2vw, 1.5rem);
    color: var(--ink);
    margin-bottom: 0.85rem;
}

.seo-section h3 {
    font-family: var(--font-display);
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--ink);
    margin: 1.25rem 0 0.5rem;
}

.seo-section p {
    color: var(--ink-soft);
    margin-bottom: 0.85rem;
}

.seo-section a {
    color: var(--brand);
    font-weight: 500;
}

/* ---------------------------------------------------------- 19. Game pages -- */

.game-container {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r-xl);
    box-shadow: var(--shadow-sm);
    padding: clamp(1.35rem, 3vw, 2.25rem);
    margin-bottom: 1.5rem;
}

.vowel-selector {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 1.75rem;
}

.vowel-btn {
    padding: 0.55rem 1.1rem;
    background: var(--surface);
    color: var(--ink-soft);
    border: 1px solid var(--line-strong);
    border-radius: var(--r-pill);
    font-family: var(--font-display);
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}

.vowel-btn:hover {
    background: var(--brand-tint);
    border-color: var(--brand);
    color: var(--brand);
}

.vowel-btn.active {
    background: var(--brand);
    border-color: var(--brand);
    color: #fff;
}

.game-area {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.timer-container {
    display: flex;
    justify-content: center;
    width: 100%;
    margin-bottom: 1rem;
}

.timer-display {
    font-family: var(--font-display);
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--ink);
    background: var(--surface-sunk);
    border: 1px solid var(--line);
    border-radius: var(--r-pill);
    padding: 0.35rem 1.35rem;
    font-variant-numeric: tabular-nums;
}

.flash-card {
    width: min(400px, 100%);
    aspect-ratio: 1;
    background: linear-gradient(150deg, #f7f4ec, #fdfbf6);
    border: 1px solid var(--line);
    border-radius: var(--r-xl);
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
    overflow: hidden;
}

.card-image {
    width: 92%;
    height: 92%;
    object-fit: contain;
}

.word-input {
    display: flex;
    justify-content: center;
    gap: 0.55rem;
    margin-top: 0.5rem;
}

.letter-box {
    width: 74px;
    height: 74px;
    border: 1px solid var(--line-strong);
    border-radius: var(--r-md);
    background: var(--surface);
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 800;
    text-align: center;
    text-transform: uppercase;
    color: var(--ink);
    padding: 0;
}

.letter-box:focus {
    outline: none;
    border-color: var(--brand);
    box-shadow: 0 0 0 4px rgba(18, 88, 79, 0.12);
}

.choices-container {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    margin-top: 1.35rem;
    width: 100%;
    max-width: 420px;
}

.choice-btn {
    padding: 0.9rem 1rem;
    background: var(--surface);
    border: 1px solid var(--line-strong);
    border-radius: var(--r-md);
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--ink);
    text-align: center;
    cursor: pointer;
    transition: background 0.18s ease, border-color 0.18s ease,
        transform 0.18s ease;
}

.choice-btn:hover {
    background: var(--brand-tint);
    border-color: var(--brand);
    transform: translateY(-2px);
}

.choice-btn.active {
    border-color: var(--brand);
    background: var(--brand-tint);
}

.choice-btn.correct {
    background: var(--good-tint);
    border-color: var(--good);
    color: #145c3f;
}

.choice-btn.incorrect {
    background: var(--bad-tint);
    border-color: var(--bad);
    color: var(--bad);
}

.game-controls {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.6rem;
    margin-top: 1.35rem;
}

.control-btn {
    min-width: 170px;
    padding: 0.75rem 1.5rem;
    background: var(--brand);
    color: #fff;
    border: 1px solid transparent;
    border-radius: var(--r-pill);
    font-family: var(--font-display);
    font-size: 1.02rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.18s ease, transform 0.18s ease, opacity 0.18s ease;
}

.control-btn:hover {
    transform: translateY(-2px);
}

.control-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    transform: none;
}

.control-btn.check {
    background: var(--good);
}

.control-btn.check:hover {
    background: #146547;
}

.control-btn.next {
    background: var(--accent);
}

.control-btn.next:hover {
    background: #a83d1c;
}

.control-btn.start {
    background: var(--ink);
}

.control-btn.start:hover {
    background: var(--brand);
}

.feedback-message {
    display: none;
    margin-top: 1rem;
    padding: 0.7rem 1rem;
    border-radius: var(--r-pill);
    text-align: center;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 0.95rem;
}

.feedback-message.correct {
    background: var(--good-tint);
    color: #14654a;
}

.feedback-message.incorrect {
    background: var(--bad-tint);
    color: var(--bad);
}

.game-stats {
    background: var(--surface-sunk);
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    padding: 1.35rem;
    margin-top: 1.75rem;
    text-align: center;
}

.game-stats h3 {
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--ink-mute);
}

.stats-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: clamp(1.5rem, 5vw, 3rem);
    margin-top: 0.85rem;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.stat-value {
    font-family: var(--font-display);
    font-size: 1.7rem;
    font-weight: 800;
    color: var(--ink);
    font-variant-numeric: tabular-nums;
}

.stat-label {
    font-size: 0.78rem;
    color: var(--ink-mute);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.instructions {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    padding: clamp(1.25rem, 3vw, 1.75rem);
    margin-top: 1.5rem;
}

.instructions h3 {
    font-size: 1.1rem;
    margin-bottom: 0.85rem;
}

.instructions ol {
    padding-left: 1.4rem;
    color: var(--ink-soft);
}

.instructions li {
    margin-bottom: 0.45rem;
}

.result-modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(16, 26, 34, 0.55);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.result-modal .modal-content {
    text-align: center;
}

.result-title {
    font-size: 1.6rem;
    color: var(--ink);
    margin-bottom: 0.7rem;
}

.result-message {
    font-size: 1.05rem;
    color: var(--ink-soft);
    margin-bottom: 1.35rem;
}

.result-stats {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-around;
    gap: 1rem;
    margin-bottom: 1.35rem;
}

.share-buttons {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.6rem;
    margin-top: 1.35rem;
}

.share-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.55rem 1.05rem;
    border: none;
    border-radius: var(--r-pill);
    font-family: inherit;
    font-size: 0.86rem;
    font-weight: 600;
    cursor: pointer;
    color: #fff;
}

.share-btn.facebook { background: #3b5998; }
.share-btn.twitter { background: #1da1f2; }
.share-btn.whatsapp { background: #25d366; }

/* -------------------------------------------- 20. Editorial guide sections -- */

.content-section {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-sm);
    padding: clamp(1.35rem, 3vw, 2.25rem);
    margin-bottom: 1.4rem;
}

.content-section h2 {
    font-size: clamp(1.3rem, 2.4vw, 1.6rem);
    color: var(--ink);
    margin-bottom: 0.9rem;
}

.content-section h3 {
    font-family: var(--font-display);
    font-size: 1.12rem;
    font-weight: 700;
    color: var(--ink);
    margin: 1.4rem 0 0.55rem;
}

.content-section p {
    color: var(--ink-soft);
    margin-bottom: 0.9rem;
}

.content-section ul,
.content-section ol {
    margin: 0 0 1rem 1.35rem;
}

.content-section li {
    margin-bottom: 0.45rem;
    color: var(--ink-soft);
}

.content-section a {
    color: var(--brand);
    font-weight: 500;
}

.teaching-tips {
    background: var(--brand-tint);
    border-left: 3px solid var(--brand);
    border-radius: 0 var(--r-sm) var(--r-sm) 0;
    padding: 1rem 1.15rem;
    margin: 1.35rem 0;
}

.teaching-tips h4 {
    color: var(--brand);
    margin-bottom: 0.45rem;
}

.teaching-tips p,
.teaching-tips li {
    color: var(--ink-soft);
    font-size: 0.95rem;
}

/* Editorial byline used at the top of the guide pages. */
.byline {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    padding: 0.85rem 1.15rem;
    margin-bottom: 1.4rem;
    font-size: 0.88rem;
    color: var(--ink-mute);
}

.byline strong {
    color: var(--ink-soft);
}

.byline a {
    color: var(--brand);
    font-weight: 500;
}

/* Sentence examples on the CVC sentences page. */
.sen {
    background: var(--surface-sunk);
    border-left: 3px solid var(--brand);
    padding: 0.6rem 1rem;
    margin-bottom: 0.5rem;
    border-radius: 0 var(--r-sm) var(--r-sm) 0;
    color: var(--ink-soft);
}

/* Worksheet routine blocks. */
.ws {
    background: var(--surface-sunk);
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    padding: 0.95rem 1.15rem;
    margin-bottom: 0.7rem;
    color: var(--ink-soft);
}

.ws strong {
    color: var(--ink);
}

/* ------------------------------------------------------------- 21. Footer -- */

footer {
    background: #14202b;
    color: #cdd6de;
    padding: clamp(2.4rem, 5vw, 3.5rem) var(--gutter) 1.75rem;
    margin-top: 3.5rem;
}

.footer-content {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    max-width: var(--maxw);
    margin: 0 auto;
}

.footer-section {
    flex: 1 1 200px;
    min-width: 180px;
    margin-bottom: 1.25rem;
}

.footer-section h3 {
    font-family: var(--font-display);
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #8fa1b1;
    margin-bottom: 0.85rem;
    text-align: left;
}

.footer-section p {
    color: #a9b6c2;
    font-size: 0.9rem;
    line-height: 1.6;
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 0.45rem;
    text-align: left;
}

.footer-section a {
    color: #cdd6de;
    text-decoration: none;
    font-size: 0.92rem;
}

.footer-section a:hover {
    color: #fff;
    text-decoration: underline;
}

.copyright {
    max-width: var(--maxw);
    margin: 1.75rem auto 0;
    padding-top: 1.35rem;
    border-top: 1px solid rgba(255, 255, 255, 0.09);
    text-align: center;
    color: #8fa1b1;
    font-size: 0.85rem;
}

.copyright p + p {
    margin-top: 0.3rem;
    opacity: 0.85;
}

/* ---------------------------------------------------------- 22. Back to top -- */

#back-to-top {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: var(--brand);
    color: #fff;
    border: none;
    font-size: 1.05rem;
    cursor: pointer;
    display: none;
    z-index: 900;
    box-shadow: var(--shadow-md);
    transition: transform 0.18s ease, background 0.18s ease;
}

#back-to-top.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

#back-to-top:hover {
    background: var(--brand-deep);
    transform: translateY(-2px);
}

/* -------------------------------------------------- 23. Language selector -- */

.language-selector {
    position: relative;
}

.language-btn {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    background: var(--surface);
    color: var(--ink-soft);
    border: 1px solid var(--line-strong);
    border-radius: var(--r-pill);
    padding: 0.4rem 0.9rem;
    font-size: 0.88rem;
    cursor: pointer;
}

.language-btn:hover {
    border-color: var(--brand);
    color: var(--brand);
}

.language-flag {
    width: 18px;
    height: 13px;
    object-fit: cover;
    border-radius: 2px;
}

.language-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    min-width: 150px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    box-shadow: var(--shadow-md);
    z-index: 1000;
    overflow: hidden;
}

.language-dropdown.show {
    display: block;
}

.language-option {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.65rem 0.95rem;
    color: var(--ink-soft);
    cursor: pointer;
    font-size: 0.9rem;
}

.language-option:hover {
    background: var(--surface-sunk);
    color: var(--ink);
}

/* Small print at the foot of a section. */
.meta-note {
    margin-top: 0.8rem;
    font-size: 0.9rem;
    color: var(--ink-mute);
}

/* A button that is styled as a text link (the "clear the filters" reset). */
.link-button {
    background: none;
    border: none;
    padding: 0;
    font: inherit;
    color: var(--brand);
    font-weight: 700;
    text-decoration: underline;
    cursor: pointer;
}

.link-button:hover {
    color: var(--brand-deep);
}

/* The live filter count under the search controls. */
.filter-status {
    margin: 0 0 1rem;
    color: var(--ink-mute);
    font-size: 0.9rem;
}

/* Heading for each short-vowel block in the homepage guide index. */
.guide-vowel-title {
    font-family: var(--font-display);
    font-size: 1.02rem;
    font-weight: 800;
    color: var(--ink);
    margin: 1.6rem 0 0.4rem;
}

.guide-vowel-title:first-child {
    margin-top: 0.5rem;
}

/* Small note next to a heading, e.g. "/æ/ as in cat". */
.heading-note {
    font-family: var(--font-body);
    font-size: 0.84rem;
    font-weight: 500;
    color: var(--ink-mute);
    letter-spacing: 0;
}

/* The UK/US alternates beside the main IPA transcription. */
.ipa-alt {
    font-size: 0.88rem;
    color: var(--ink-mute);
}

/* The one-line summary under a word's heading. */
.word-summary {
    color: var(--ink-soft);
}

/* A family entry heading in the master word list. */
.family-item-head {
    margin-top: 0;
}

/* FAQ items written as <details> without a .faq wrapper. */
.faq-item {
    border-bottom: 1px solid var(--line);
    padding: 0.85rem 0;
}

.faq-q {
    cursor: pointer;
    font-family: var(--font-display);
    font-weight: 700;
    color: var(--ink);
}

.faq-a {
    margin-top: 0.6rem;
    color: var(--ink-soft);
    font-size: 0.95rem;
}

/* Hidden until JS reveals it. */
.is-hidden {
    display: none !important;
}

/* Analytics fallback pixel must never show. */
.statcounter {
    display: none !important;
}

/* Indented list on the policy pages. */
.indent-list {
    margin-left: 1.4rem;
}

/* Vowel-switch confirmation dialog on the quiz page. */
.confirm-dialog {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1000;
    justify-content: center;
    align-items: center;
    padding: 20px;
    background: rgba(16, 26, 34, 0.55);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.confirm-dialog-box {
    width: min(460px, 100%);
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-lg);
    padding: 1.9rem;
    text-align: center;
}

.confirm-title {
    font-size: 1.25rem;
    color: var(--ink);
    margin-bottom: 0.7rem;
}

.confirm-message {
    color: var(--ink-soft);
    margin-bottom: 1.4rem;
}

.confirm-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.65rem;
}

.btn-confirm {
    padding: 0.65rem 1.4rem;
    border: 1px solid transparent;
    border-radius: var(--r-pill);
    font-family: inherit;
    font-size: 0.92rem;
    font-weight: 600;
    color: #fff;
    cursor: pointer;
}

.btn-confirm-yes {
    background: var(--good);
}

.btn-confirm-yes:hover {
    background: #146547;
}

.btn-confirm-no {
    background: var(--surface-sunk);
    border-color: var(--line-strong);
    color: var(--ink-soft);
}

.btn-confirm-no:hover {
    background: var(--line);
    color: var(--ink);
}

/* ------------------------------------------------------------ 24. Utilities -- */

.subtitle {
    color: var(--ink-mute);
    font-size: 0.95rem;
    margin-top: 0.2rem;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ------------------------------------------------------- 25. Responsive -- */

@media (max-width: 1024px) {
    .nav-links a {
        padding: 0.38rem 0.5rem;
        font-size: 0.82rem;
    }
}

@media (max-width: 900px) {
    /* The header wraps onto two lines at this width, so it is taller. */
    html {
        scroll-padding-top: 116px;
    }

    header {
        height: auto;
        flex-wrap: wrap;
        padding: 0.7rem var(--gutter) 0;
        gap: 0.4rem;
    }

    .header-nav {
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    .header-nav::-webkit-scrollbar {
        display: none;
    }

    .nav-links {
        flex-wrap: nowrap;
        justify-content: flex-start;
        gap: 0.1rem;
        padding-bottom: 0.5rem;
    }

    .nav-links a {
        white-space: nowrap;
    }
}

@media (max-width: 768px) {
    body {
        font-size: 16px;
    }

    .word-container {
        grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    }

    .word-hero-img {
        width: 160px;
        height: 160px;
    }

    .word-card .example {
        min-height: 0;
    }

    .controls {
        flex-direction: column;
    }

    .search-box,
    .filter-box {
        flex: 1 1 auto;
        width: 100%;
    }

    .controls button,
    #reset-filters {
        width: 100%;
    }

    .word-image {
        width: 190px;
        height: 190px;
    }

    .nav-btn {
        top: auto;
        bottom: 0.6rem;
        transform: none;
        width: 36px;
        height: 36px;
    }

    .prev-btn {
        left: 0.6rem;
    }

    .next-btn {
        right: 0.6rem;
    }

    .modal {
        align-items: flex-start;
    }

    .pronunciation-sounds,
    .letter-buttons,
    .pronunciation-buttons,
    .pronunciation-controls {
        justify-content: center;
    }

    .game-controls {
        flex-direction: column;
        align-items: stretch;
    }

    .control-btn {
        min-width: 0;
        width: 100%;
    }

    .flash-card {
        width: min(320px, 100%);
    }

    .letter-box {
        width: 62px;
        height: 62px;
        font-size: 1.6rem;
    }
}

@media (max-width: 480px) {
    .banner-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .banner-actions .btn-primary,
    .banner-actions .btn-ghost {
        width: 100%;
    }

    .vowel-chips {
        gap: 0.4rem;
    }

    .vowel-chip {
        font-size: 0.8rem;
        padding: 0.35rem 0.75rem;
    }

    .word-container {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    }

    .word-card {
        padding: 1.1rem 0.8rem 1rem;
    }

    .word-card .word {
        font-size: 1.85rem;
    }

    .word-card img {
        width: 88px;
        height: 88px;
    }

    .word-image {
        width: 170px;
        height: 170px;
    }

    .letter-btn {
        width: 38px;
        height: 38px;
        font-size: 1rem;
    }

    .sound-card {
        width: 100%;
        max-width: 92px;
    }

    .stats-row {
        gap: 1.2rem;
    }

    .letter-box {
        width: 52px;
        height: 52px;
        font-size: 1.35rem;
    }

    .language-btn span {
        display: none;
    }
}

@media (hover: none) {
    .word-card:hover,
    .sound-card:hover,
    .pronunciation-btn:hover,
    .letter-btn:hover,
    .control-btn:hover,
    .choice-btn:hover,
    .related-grid a:hover {
        transform: none;
    }

    .word-card:active,
    .sound-card:active,
    .letter-btn:active {
        transform: scale(0.97);
    }

    .word-card,
    .letter-btn,
    .close-modal,
    .sound-card {
        -webkit-tap-highlight-color: transparent;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}
