:root {
    --bg-primary: #09090b;
    --bg-card: rgba(18, 18, 24, 0.72);
    --bg-elevated: rgba(255, 255, 255, 0.03);
    --border-subtle: rgba(255, 255, 255, 0.08);
    --border-active: rgba(255, 255, 255, 0.18);
    --text-primary: #fafafa;
    --text-secondary: #a1a1aa;
    --text-muted: #71717a;
    --accent-primary: #6366f1;
    --accent-secondary: #8b5cf6;
    --accent-pink: #ec4899;
    --accent-warm: #f59e0b;
    --accent-cyan: #38bdf8;
    /* Orange theme for the About / Pricing / FAQ pages + the brand "AI" */
    --orange-light: #fbbf24;
    --orange: #fb923c;
    --orange-deep: #f97316;
    --orange-burnt: #ea580c;
    --success: #10b981;
    --error: #ef4444;
    --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
    /* Display face for headings, brand, numbers — geometric grotesk pairs with Inter body */
    --font-display: 'Space Grotesk', 'Inter', system-ui, sans-serif;

    /* Type scale — keep all card text on these steps */
    --fs-2xs: 0.72rem;
    /* chips, micro labels */
    --fs-xs: 0.8rem;
    /* labels, hints, sub-detail, status */
    --fs-sm: 0.875rem;
    /* secondary body: stats, sub, file-name, guarantee, tips */
    --fs-base: 0.95rem;
    /* body: inputs, selects, paragraphs, buttons */
    --fs-md: 1.05rem;
    /* sub-headings: upload title, chapter title */
    --fs-lg: 1.2rem;
    /* section titles: book, celebrate, error */

    /* Weights */
    --fw-regular: 400;
    --fw-medium: 500;
    --fw-semibold: 600;
    --fw-bold: 700;
}

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

html {
    scroll-behavior: smooth;
    /* Stop Android Chrome from auto-inflating ("boosting") text — the cause of the
       oversized, jumbled voice-dropdown options on mobile. Keeps our sizes exact. */
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body {
    font-family: var(--font-sans);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-size: var(--fs-base);
    line-height: 1.5;
    font-weight: var(--fw-regular);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    min-height: 100dvh;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    overflow-x: hidden;
}

/* Standalone content pages (About / Pricing / FAQ) — top-aligned, scrollable,
   no orb background. The converter homepage keeps the centered layout above. */
body.subpage {
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    padding-top: 72px;
}

/* Headings — display face, consistent weight + tracking, sized by the scale below */
h1,
h2,
h3 {
    font-family: var(--font-display);
    font-weight: var(--fw-bold);
    letter-spacing: -0.02em;
    line-height: 1.22;
    color: var(--text-primary);
    text-wrap: balance;
}

p {
    line-height: 1.5;
}

/* WebGL shader background — fills the viewport behind everything */
#shader-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    opacity: 0.85;
    pointer-events: none;
}

/* Card */
.container {
    position: relative;
    z-index: 10;
    width: 100%;
    /* Lock at the laptop look — on bigger monitors the card doesn't keep growing. */
    max-width: 560px;
    padding: 16px;
    margin: 0 auto;
    /* Nudge the card down so it's optically centered below the fixed navbar. */
    transform: translateY(32px);
}

.glass-card {
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.035), transparent 120px),
        rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(20px) saturate(1.3);
    -webkit-backdrop-filter: blur(20px) saturate(1.3);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 22px;
    padding: 18px 20px;
    /* Layered depth: tight contact shadow + soft ambient + inner top highlight */
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.06),
        0 2px 8px rgba(0, 0, 0, 0.35),
        0 25px 60px -15px rgba(0, 0, 0, 0.6);
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin: 24px 0;
}

/* Site header (navbar) */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 6px 20px;
    background: rgba(9, 9, 11, 0.65);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 2px 16px rgba(0, 0, 0, 0.35);
}

.site-header .brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--text-primary);
    transition: transform .2s ease;
}

.site-header .brand:hover {
    transform: scale(1.04);
}

.site-nav {
    display: flex;
    align-items: center;
    gap: 6px;
}

.site-nav a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: var(--fs-sm);
    font-weight: var(--fw-semibold);
    padding: 8px 12px;
    border-radius: 8px;
    transition: color .2s ease, background .2s ease;
}

.site-nav a:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.06);
}

.site-nav a.active {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.06);
}

.brand-logo {
    display: block;
    width: 52px;
    height: 52px;
    object-fit: contain;
}

.brand-name {
    font-family: var(--font-display);
    font-size: var(--fs-lg);
    font-weight: var(--fw-bold);
    letter-spacing: -0.02em;
    line-height: 1;
    /* "Hiraya" tinted with the orb's blue → indigo → violet → pink palette */
    background: linear-gradient(120deg, #3b82f6, #6366f1 38%, #a855f7 68%, #ec4899);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
}

.brand-name-accent {
    background: linear-gradient(135deg, var(--orange-light), var(--orange-deep));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Card header (tagline) */
.card-header {
    text-align: center;
}

.highlight {
    background: linear-gradient(135deg, var(--orange-light), var(--orange-deep));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.card-header p {
    color: var(--text-secondary);
    font-size: var(--fs-base);
    font-weight: var(--fw-medium);
}

/* Banner */
.banner {
    border-radius: 12px;
    padding: 12px 16px;
    font-size: var(--fs-sm);
    font-weight: var(--fw-medium);
    text-align: center;
}

.banner.warning {
    background: rgba(245, 158, 11, 0.12);
    color: var(--accent-warm);
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.banner.error {
    background: rgba(239, 68, 68, 0.12);
    color: var(--error);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

main {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Inputs */
.input-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

label {
    font-family: var(--font-display);
    font-size: var(--fs-xs);
    font-weight: var(--fw-bold);
    color: var(--text-primary);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.hint {
    font-size: var(--fs-xs);
    color: var(--text-muted);
    min-height: 1em;
}

/* Rights-affirmation checkbox (required before upload) */
.tos-row {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    margin: 14px 0 4px;
    font-size: 0.65rem;
    color: var(--text-muted);
    line-height: 1.4;
    cursor: pointer;
}

.tos-row input[type="checkbox"] {
    flex-shrink: 0;
    appearance: none;
    -webkit-appearance: none;
    width: 15px;
    height: 15px;
    margin-top: 1px;
    background: #fff;
    border: 1.5px solid rgba(255, 255, 255, 0.5);
    border-radius: 3px;
    cursor: pointer;
    position: relative;
    transition: border-color .2s ease;
}

.tos-row input[type="checkbox"]:checked {
    background: #fff;
    border-color: #fff;
}

.tos-row input[type="checkbox"]:checked::after {
    content: '';
    position: absolute;
    left: 3px;
    top: 0px;
    width: 5px;
    height: 9px;
    border: 2px solid #000;
    border-top: none;
    border-left: none;
    transform: rotate(45deg);
}

.tos-row a {
    color: var(--accent-warm);
    text-decoration: underline;
}

.select-wrapper {
    position: relative;
}

.select-wrapper select {
    width: 100%;
    appearance: none;
    -webkit-appearance: none;
    background: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
    color: var(--text-secondary);
    padding: 11px 14px;
    border-radius: 12px;
    font-family: inherit;
    font-size: var(--fs-xs);
    font-weight: var(--fw-medium);
    cursor: pointer;
    transition: border-color .2s ease, box-shadow .2s ease;
}

.select-wrapper select:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, .2);
}

/* ============================================================
   Custom voice dropdown — replaces the native <select> popup, which
   Android Chrome renders with an oversized, jumbled, unstyleable font.
   The native <select id="voice-select"> stays hidden in the DOM as the
   value source; this UI mirrors it. Fully styled + consistent everywhere.
   ============================================================ */
.cs-native {
    /* Visually hidden but still focusable-for-forms and readable by JS. */
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    border: 0;
    opacity: 0;
    pointer-events: none;
}

.custom-select {
    position: relative;
}

.cs-trigger {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    background: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
    color: var(--text-secondary);
    padding: 11px 14px;
    border-radius: 12px;
    font-family: inherit;
    font-size: var(--fs-sm);
    font-weight: var(--fw-medium);
    cursor: pointer;
    text-align: left;
    transition: border-color .2s ease, box-shadow .2s ease;
}

.cs-trigger:hover {
    border-color: var(--border-active);
}

.cs-trigger[aria-expanded="true"] {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, .2);
}

.cs-trigger .dropdown-icon {
    position: static;
    transform: none;
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    color: var(--text-muted);
    transition: transform .2s ease;
}

.cs-trigger[aria-expanded="true"] .dropdown-icon {
    transform: rotate(180deg);
}

.cs-value {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cs-panel {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    z-index: 40;
    max-height: 264px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    list-style: none;
    margin: 0;
    padding: 6px;
    background: #18181b;
    border: 1px solid var(--border-active);
    border-radius: 12px;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.05),
        0 18px 44px -12px rgba(0, 0, 0, 0.75);
    animation: slideUp .16s ease forwards;
}

.cs-group-label {
    padding: 9px 10px 4px;
    font-family: var(--font-display);
    font-size: var(--fs-2xs);
    font-weight: var(--fw-bold);
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--text-muted);
}

.cs-option {
    padding: 10px 10px;
    border-radius: 8px;
    font-size: var(--fs-sm);
    font-weight: var(--fw-medium);
    color: var(--text-secondary);
    cursor: pointer;
    transition: background .15s ease, color .15s ease;
}

.cs-option:hover {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-primary);
}

.cs-option[aria-selected="true"] {
    background: rgba(99, 102, 241, 0.16);
    color: var(--text-primary);
}

.dropdown-icon {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    color: var(--text-muted);
    pointer-events: none;
}

/* Voice tester */
.playground-group {
    display: flex;
    gap: 10px;
}

.playground-group input {
    flex: 1;
    /* Without this, the input keeps its intrinsic width and shoves the Play
       button out of the row on narrow screens (overlap). */
    min-width: 0;
    background: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
    color: var(--text-secondary);
    padding: 11px 14px;
    border-radius: 12px;
    font-family: inherit;
    font-size: var(--fs-xs);
    font-weight: var(--fw-regular);
    transition: border-color .2s ease, box-shadow .2s ease;
}

.playground-group input:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, .18);
}

.test-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-width: 78px;
    min-height: 42px;
    padding: 0 18px;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: #fff;
    border: none;
    box-shadow: 0 4px 14px rgba(99, 102, 241, 0.4);
    border-radius: 12px;
    font-size: var(--fs-base);
    font-weight: var(--fw-semibold);
    font-family: inherit;
    cursor: pointer;
    transition: all .2s ease;
}

.test-btn:hover:not(:disabled) {
    filter: brightness(1.12);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.55);
}

.test-btn:active {
    transform: scale(.97);
}

.test-btn:disabled {
    opacity: .6;
    cursor: not-allowed;
}

.mini-loader {
    display: none;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, .4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.test-btn.loading .mini-loader {
    display: block;
}

.test-btn.loading .test-btn-label {
    display: none;
}

/* Upload zone */
.upload-zone {
    position: relative;
    border: 1.5px dashed rgba(255, 255, 255, 0.14);
    border-radius: 16px;
    padding: 20px 20px;
    text-align: center;
    cursor: pointer;
    background:
        radial-gradient(ellipse 70% 60% at 50% 0%, rgba(99, 102, 241, 0.07), transparent 70%),
        var(--bg-elevated);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition:
        border-color .25s ease,
        background .25s ease,
        transform .2s ease,
        box-shadow .25s ease;
    overflow: hidden;
}

.upload-zone:hover {
    border-color: rgba(99, 102, 241, 0.5);
    background:
        radial-gradient(ellipse 70% 60% at 50% 0%, rgba(99, 102, 241, 0.13), transparent 70%),
        var(--bg-elevated);
}

.upload-zone.dragover {
    border-style: solid;
    border-color: var(--accent-primary);
    background:
        radial-gradient(ellipse 80% 70% at 50% 50%, rgba(99, 102, 241, 0.22), transparent 80%),
        var(--bg-elevated);
    box-shadow:
        0 0 0 4px rgba(99, 102, 241, 0.16),
        0 14px 32px rgba(0, 0, 0, 0.32);
    transform: scale(1.005);
}

.upload-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    pointer-events: none;
}

.icon-pulse-wrapper {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.18), rgba(139, 92, 246, 0.18));
    border: 1px solid rgba(99, 102, 241, 0.28);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 2px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
    transition: transform .25s ease, background .25s ease, box-shadow .25s ease;
}

.upload-zone:hover .icon-pulse-wrapper {
    transform: translateY(-3px);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.08),
        0 10px 24px rgba(99, 102, 241, 0.25);
}

.upload-zone.dragover .icon-pulse-wrapper {
    animation: iconBob 1.2s ease-in-out infinite;
}

@keyframes iconBob {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-7px);
    }
}

.upload-icon {
    width: 22px;
    height: 22px;
    color: var(--accent-primary);
}

.upload-zone h3 {
    font-size: var(--fs-md);
    font-weight: var(--fw-semibold);
    letter-spacing: -0.01em;
    color: var(--text-primary);
    margin: 0;
}

.upload-zone .upload-sub {
    color: var(--text-secondary);
    font-size: var(--fs-sm);
    margin: 0;
}

.browse-link {
    color: var(--accent-primary);
    font-weight: var(--fw-semibold);
    border-bottom: 1px dashed rgba(99, 102, 241, 0.45);
    padding-bottom: 1px;
    transition: color .2s ease, border-color .2s ease;
}

.upload-zone:hover .browse-link {
    color: #fff;
    border-bottom-color: rgba(255, 255, 255, 0.55);
}

.upload-formats {
    display: flex;
    gap: 6px;
    justify-content: center;
    margin-top: 4px;
    flex-wrap: wrap;
}

.format-chip {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.09);
    color: var(--text-muted);
    font-size: var(--fs-2xs);
    font-weight: var(--fw-bold);
    letter-spacing: 0.08em;
}

/* File preview */
.file-preview {
    display: none;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.08), rgba(139, 92, 246, 0.06));
    border: 1px solid rgba(99, 102, 241, 0.35);
    border-radius: 14px;
    padding: 14px 16px;
    animation: slideUp .3s ease forwards;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.05),
        0 4px 20px rgba(99, 102, 241, 0.12);
}

.file-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.file-icon-wrap {
    flex-shrink: 0;
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.2), rgba(139, 92, 246, 0.2));
    border: 1px solid rgba(99, 102, 241, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent-primary);
}

.file-meta {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.file-name {
    font-family: var(--font-display);
    font-size: var(--fs-sm);
    font-weight: var(--fw-bold);
    letter-spacing: -0.01em;
    background: linear-gradient(120deg, #fff 30%, var(--accent-secondary));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}



.file-ready {
    font-size: var(--fs-2xs);
    font-weight: var(--fw-semibold);
    color: var(--success);
    letter-spacing: 0.02em;
}

.remove-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    padding: 4px;
    border-radius: 50%;
    transition: all .2s ease;
}

.remove-btn:hover {
    color: var(--error);
    background: rgba(239, 68, 68, .12);
}

/* Buttons */
.primary-btn {
    appearance: none;
    width: 100%;
    min-height: 46px;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: #fff;
    border: none;
    padding: 12px;
    border-radius: 14px;
    font-size: var(--fs-base);
    font-weight: var(--fw-bold);
    letter-spacing: -0.005em;
    font-family: inherit;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    /* Inner top highlight gives the gradient a glassy, lit-from-above edge */
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.22),
        0 6px 20px rgba(99, 102, 241, .4);
    transition: transform .2s ease, box-shadow .2s ease, opacity .2s ease, filter .2s ease;
}

.primary-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    filter: brightness(1.07);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.28),
        0 10px 28px rgba(99, 102, 241, .55);
}

.primary-btn:active:not(:disabled) {
    transform: translateY(0);
}

.primary-btn:disabled {
    opacity: .5;
    cursor: not-allowed;
    background: rgba(255, 255, 255, .1);
    box-shadow: none;
    color: var(--text-muted);
}

.ghost-btn {
    width: 100%;
    min-height: 44px;
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    font-family: inherit;
    font-size: var(--fs-sm);
    font-weight: var(--fw-semibold);
    cursor: pointer;
    transition: all .2s ease;
}

.ghost-btn:hover {
    color: var(--text-primary);
    border-color: var(--border-active);
    background: var(--bg-elevated);
}

.loader {
    display: none;
    width: 22px;
    height: 22px;
    border: 3px solid rgba(255, 255, 255, .35);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.primary-btn.loading .loader {
    display: block;
}

.primary-btn.loading .btn-text {
    display: none;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Keyboard-visible focus ring on every interactive element (modern a11y default) */
.primary-btn:focus-visible,
.ghost-btn:focus-visible,
.test-btn:focus-visible,
.preview-play-btn:focus-visible,
.upload-zone:focus-visible,
.tos-row input[type="checkbox"]:focus-visible,
.select-wrapper select:focus-visible,
.playground-group input:focus-visible {
    outline: 2px solid var(--accent-primary);
    outline-offset: 2px;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(12px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.status-message {
    text-align: center;
    font-size: var(--fs-sm);
    font-weight: var(--fw-medium);
    min-height: 1em;
}

.status-message.error {
    color: var(--error);
}

.status-message.success {
    color: var(--success);
}

/* Card sections */
.card-section {
    background: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: 16px;
    padding: 22px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    animation: slideUp .35s ease forwards;
}

/* Preview / book card */
.book-card {
    text-align: center;
}

/* Post-stop notice on the preview card (refund confirmation) */
.pv-notice {
    text-align: center;
    font-size: var(--fs-sm);
    font-weight: var(--fw-medium);
    color: var(--accent-warm);
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.28);
    border-radius: 12px;
    padding: 10px 14px;
    animation: slideUp .3s ease forwards;
}

.book-title {
    font-family: var(--font-display);
    font-size: var(--fs-lg);
    font-weight: var(--fw-bold);
    letter-spacing: -0.02em;
}

.book-stats {
    color: var(--text-secondary);
    font-size: var(--fs-sm);
    margin-top: 4px;
}

.preview-play-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 50px;
    width: 100%;
    cursor: pointer;
    font-family: inherit;
    font-size: var(--fs-base);
    font-weight: var(--fw-semibold);
    color: var(--accent-pink);
    background: rgba(236, 72, 153, .1);
    border: 1px solid rgba(236, 72, 153, .4);
    border-radius: 12px;
    transition: all .2s ease;
    animation: softPulse 2.4s ease-in-out infinite;
}

.preview-play-btn:hover {
    background: rgba(236, 72, 153, .2);
}

.preview-play-btn.playing {
    animation: none;
}

.play-icon {
    width: 18px;
    height: 18px;
}

@keyframes softPulse {

    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(236, 72, 153, .0);
    }

    50% {
        box-shadow: 0 0 0 6px rgba(236, 72, 153, .12);
    }
}

.pay-block {
    display: flex;
    flex-direction: column;
    gap: 10px;
}


/* Step timeline */
.step-timeline {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 4px;
}

.step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    flex: 1;
    position: relative;
    opacity: .4;
    transition: opacity .3s ease;
}

.step:not(:last-child)::after {
    content: '';
    position: absolute;
    top: 16px;
    left: 60%;
    width: 80%;
    height: 2px;
    background: var(--border-subtle);
}

.step-dot {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    font-size: var(--fs-base);
    z-index: 1;
}

.step-label {
    font-size: var(--fs-2xs);
    font-weight: var(--fw-medium);
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.step.active {
    opacity: 1;
}

.step.active .step-dot {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, .18);
    animation: dotPulse 1.5s ease-in-out infinite;
}

.step.done {
    opacity: 1;
}

.step.done .step-dot {
    border-color: var(--success);
    background: rgba(16, 185, 129, .15);
}

@keyframes dotPulse {

    0%,
    100% {
        box-shadow: 0 0 0 3px rgba(99, 102, 241, .16);
    }

    50% {
        box-shadow: 0 0 0 7px rgba(99, 102, 241, .28);
    }
}

/* Chapter display */
.chapter-display {
    text-align: center;
    min-height: 48px;
}

.chapter-voice {
    font-size: var(--fs-sm);
    color: var(--text-secondary);
}

.chapter-title {
    font-family: var(--font-display);
    font-size: var(--fs-md);
    font-weight: var(--fw-semibold);
    letter-spacing: -0.01em;
    margin-top: 2px;
    transition: opacity .4s ease;
}

/* Progress */
.progress-track {
    height: 10px;
    background: rgba(255, 255, 255, .08);
    border-radius: 6px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    width: 0%;
    border-radius: 6px;
    background: linear-gradient(90deg, var(--accent-pink), var(--accent-primary), var(--accent-secondary));
    background-size: 200% 100%;
    animation: gradientMove 2s linear infinite;
    transition: width .4s ease;
    box-shadow: 0 0 12px rgba(99, 102, 241, .5);
}

.progress-fill.complete {
    animation: completionGlow 1.5s ease-in-out 2;
}

@keyframes gradientMove {
    0% {
        background-position: 100% 0;
    }

    100% {
        background-position: -100% 0;
    }
}

@keyframes completionGlow {
    0% {
        box-shadow: 0 0 5px var(--accent-primary);
    }

    50% {
        box-shadow: 0 0 20px var(--accent-primary), 0 0 40px var(--accent-secondary);
    }

    100% {
        box-shadow: 0 0 5px var(--accent-primary);
    }
}

.progress-percent-label {
    text-align: center;
    font-family: var(--font-display);
    font-weight: var(--fw-bold);
    font-variant-numeric: tabular-nums;
    font-size: var(--fs-md);
    letter-spacing: -0.01em;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.sub-detail {
    text-align: center;
    font-size: var(--fs-xs);
    color: var(--text-muted);
    margin-top: 2px;
    min-height: 1em;
}

.reconnect-note {
    text-align: center;
    font-size: var(--fs-xs);
    color: var(--text-secondary);
    margin-top: 6px;
}

.tip-text {
    text-align: center;
    font-size: var(--fs-sm);
    color: var(--text-secondary);
    font-style: italic;
    transition: opacity .4s ease;
    min-height: 2.4em;
}

/* Stop-conversion link — deliberately understated: a plain, muted text link so it
   never reads as a prominent "easy out" and doesn't compete with the progress itself. */
.stop-link {
    align-self: center;
    margin-top: 2px;
    background: none;
    border: none;
    font-family: inherit;
    font-size: var(--fs-xs);
    font-weight: var(--fw-medium);
    color: var(--text-muted);
    cursor: pointer;
    padding: 8px 12px;
    text-decoration: underline;
    text-underline-offset: 3px;
    transition: color .2s ease;
}

.stop-link:hover {
    color: var(--text-secondary);
}

/* Confirmation modal (shared pattern for destructive confirms) */
.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    animation: modalFade .18s ease;
}

@keyframes modalFade {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-card {
    width: 100%;
    max-width: 420px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.04), transparent 120px), #131318;
    border: 1px solid var(--border-active);
    border-radius: 18px;
    padding: 24px;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.06),
        0 30px 70px -20px rgba(0, 0, 0, 0.8);
    animation: modalPop .2s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes modalPop {
    from { transform: translateY(8px) scale(0.98); opacity: 0; }
    to { transform: translateY(0) scale(1); opacity: 1; }
}

.modal-title {
    font-family: var(--font-display);
    font-size: var(--fs-lg);
    font-weight: var(--fw-bold);
    letter-spacing: -0.02em;
    margin-bottom: 12px;
}

.modal-body {
    font-size: var(--fs-sm);
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 12px;
}

.modal-body strong {
    color: var(--text-primary);
    font-weight: var(--fw-semibold);
}

.modal-confirm-label {
    display: block;
    font-size: var(--fs-xs);
    color: var(--text-muted);
    margin: 6px 0 6px;
}

.modal-confirm-label strong {
    color: var(--text-primary);
    letter-spacing: 0.08em;
}

.modal-input {
    width: 100%;
    padding: 11px 14px;
    background: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: 10px;
    color: var(--text-primary);
    font-family: inherit;
    font-size: var(--fs-base);
    font-weight: var(--fw-semibold);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    transition: border-color .2s ease;
}

.modal-input:focus {
    outline: none;
    border-color: var(--error);
}

.modal-actions {
    display: flex;
    gap: 10px;
    margin-top: 18px;
}

.modal-actions .ghost-btn {
    flex: 1;
}

.danger-btn {
    flex: 1;
    min-height: 44px;
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: #fff;
    border: none;
    border-radius: 12px;
    font-family: inherit;
    font-size: var(--fs-sm);
    font-weight: var(--fw-bold);
    cursor: pointer;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 6px 18px rgba(239, 68, 68, 0.35);
    transition: transform .2s ease, filter .2s ease, opacity .2s ease;
}

.danger-btn:hover:not(:disabled) {
    transform: translateY(-1px);
    filter: brightness(1.08);
}

.danger-btn:disabled {
    opacity: .45;
    cursor: not-allowed;
    box-shadow: none;
}

.tip-text.fade-out {
    opacity: 0;
}

/* Completion */
.completion-section {
    border-color: rgba(16, 185, 129, .3);
    background: rgba(16, 185, 129, .05);
}

.celebrate {
    text-align: center;
    font-family: var(--font-display);
    font-size: var(--fs-lg);
    font-weight: var(--fw-bold);
    letter-spacing: -0.02em;
}

.download-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.stat-value {
    font-family: var(--font-display);
    font-size: var(--fs-md);
    font-weight: var(--fw-bold);
    line-height: 1.2;
    font-variant-numeric: tabular-nums;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.stat-label {
    font-size: var(--fs-2xs);
    font-weight: var(--fw-semibold);
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: .06em;
}

.audio-player {
    width: 100%;
    height: 40px;
    border-radius: 10px;
}

/* Error */
.error-section {
    border-color: rgba(239, 68, 68, .3);
    background: rgba(239, 68, 68, .05);
    text-align: center;
}

.error-title {
    font-size: var(--fs-lg);
    font-weight: var(--fw-bold);
    letter-spacing: -0.01em;
}

.error-message {
    color: var(--text-secondary);
    font-size: var(--fs-sm);
}

.error-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Footer */
.card-footer {
    text-align: center;
    font-size: var(--fs-2xs);
    color: var(--text-muted);
    border-top: 1px solid var(--border-subtle);
    padding-top: 16px;
}

/* Tablet+ */
@media (min-width: 640px) {
    .glass-card {
        padding: 28px;
        border-radius: 20px;
    }

    .site-header {
        padding: 6px 32px;
    }

    .brand-logo {
        width: 64px;
        height: 64px;
    }

    .brand-name {
        font-size: 1.35rem;
    }

    .site-nav {
        gap: 10px;
    }

    .site-nav a {
        font-size: var(--fs-base);
        padding: 8px 14px;
    }

    .error-actions {
        flex-direction: row;
    }
}

/* ============================================================
   Landing sections: About / Pricing / FAQ + footer
   Reuses the glass aesthetic + type scale from the hero card.
   ============================================================ */
.page-sections {
    position: relative;
    z-index: 10;
    width: 100%;
    /* Grow to fill the viewport so the footer rests at the bottom on short pages. */
    flex: 1 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.page-section {
    width: 100%;
    max-width: 560px;
    margin: 0 auto;
    padding: 64px 16px;
    /* Offset the fixed header so a heading isn't hidden on anchor jump. */
    scroll-margin-top: 84px;
}

.section-head {
    text-align: center;
    margin-bottom: 28px;
}

.section-eyebrow {
    display: inline-block;
    font-size: var(--fs-xs);
    font-weight: var(--fw-bold);
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--accent-secondary);
    margin-bottom: 10px;
}

.section-title {
    font-size: clamp(1.5rem, 5vw, 1.9rem);
    font-weight: var(--fw-bold);
    letter-spacing: -0.02em;
    line-height: 1.18;
}

.section-intro {
    color: var(--text-secondary);
    font-size: var(--fs-base);
    margin: 12px auto 0;
    max-width: 46ch;
}

/* Glass panel shared by About + FAQ */
.panel {
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    padding: 28px;
    box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.5);
}

/* About */
.about-copy {
    color: var(--text-secondary);
    font-size: var(--fs-base);
    line-height: 1.65;
}

.about-copy+.about-copy {
    margin-top: 14px;
}

.about-copy strong {
    color: var(--text-primary);
    font-weight: var(--fw-semibold);
}

.about-copy a {
    color: var(--accent-warm);
    text-decoration: underline;
}

/* Legal pages (terms / privacy / dmca) */
.legal-h {
    color: var(--text-primary);
    font-size: var(--fs-base);
    font-weight: var(--fw-semibold);
    margin-top: 26px;
    margin-bottom: 8px;
}

.legal-h:first-child {
    margin-top: 0;
}

.legal-list {
    color: var(--text-secondary);
    font-size: var(--fs-base);
    line-height: 1.65;
    margin: 10px 0;
    padding-left: 22px;
}

.legal-list li+li {
    margin-top: 6px;
}

.legal-list strong {
    color: var(--text-primary);
    font-weight: var(--fw-semibold);
}

.legal-updated {
    margin-top: 28px;
    font-size: var(--fs-xs);
    color: var(--text-muted);
}

.feature-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-top: 26px;
    padding-top: 26px;
    border-top: 1px solid var(--border-subtle);
}

.feature-item {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.feature-item .ft-title {
    font-size: var(--fs-sm);
    font-weight: var(--fw-bold);
    color: var(--text-primary);
}

.feature-item .ft-sub {
    font-size: var(--fs-xs);
    color: var(--text-muted);
}

/* Pricing */
.price-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    align-items: stretch;
}

.price-card {
    position: relative;
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-subtle);
    border-radius: 18px;
    padding: 28px 24px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}

.price-card:hover {
    transform: translateY(-4px);
    border-color: var(--border-active);
    box-shadow: 0 18px 40px -12px rgba(0, 0, 0, 0.55);
}

.price-card.featured {
    border-color: rgba(249, 115, 22, 0.45);
    box-shadow: 0 0 0 1px rgba(249, 115, 22, 0.15),
        0 18px 40px -14px rgba(249, 115, 22, 0.35);
}

.price-tag {
    position: absolute;
    top: 16px;
    right: 16px;
    font-size: var(--fs-2xs);
    font-weight: var(--fw-bold);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #fdba74;
    background: rgba(249, 115, 22, 0.12);
    border: 1px solid rgba(249, 115, 22, 0.32);
    padding: 4px 9px;
    border-radius: 999px;
}

.price-name {
    font-size: var(--fs-xs);
    font-weight: var(--fw-bold);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-secondary);
}

.price-amount {
    display: flex;
    align-items: baseline;
    gap: 5px;
    margin: 2px 0;
}

.price-amount .amount {
    font-size: 2.6rem;
    font-weight: var(--fw-bold);
    letter-spacing: -0.03em;
    line-height: 1;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.price-amount .period {
    font-size: var(--fs-sm);
    color: var(--text-muted);
    font-weight: var(--fw-medium);
}

.price-desc {
    font-size: var(--fs-sm);
    color: var(--text-secondary);
    min-height: 2.6em;
}

.price-features {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 14px;
    padding-top: 18px;
    border-top: 1px solid var(--border-subtle);
}

.price-features li {
    position: relative;
    padding-left: 26px;
    font-size: var(--fs-sm);
    color: var(--text-secondary);
    line-height: 1.45;
}

.price-features li::before {
    content: "✓";
    position: absolute;
    left: 0;
    top: 1px;
    width: 17px;
    height: 17px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 700;
    color: var(--orange-deep);
    background: rgba(249, 115, 22, 0.16);
    border-radius: 50%;
}

.price-note {
    text-align: center;
    font-size: var(--fs-sm);
    color: var(--text-muted);
    margin: 22px auto 0;
    line-height: 1.6;
    max-width: 50ch;
}

/* FAQ */
.faq-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.faq-item {
    background: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: 14px;
    overflow: hidden;
    transition: border-color .2s ease, background .2s ease;
}

.faq-item[open] {
    border-color: var(--border-active);
    background: rgba(255, 255, 255, 0.04);
}

.faq-item summary {
    list-style: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 20px;
    font-size: var(--fs-base);
    font-weight: var(--fw-semibold);
    color: var(--text-primary);
}

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

.faq-item summary::after {
    content: "";
    flex-shrink: 0;
    width: 16px;
    height: 16px;
    border-right: 2px solid var(--text-muted);
    border-bottom: 2px solid var(--text-muted);
    transform: rotate(45deg);
    transition: transform .25s ease;
    margin-top: -5px;
}

.faq-item[open] summary::after {
    transform: rotate(-135deg);
    margin-top: 3px;
}

.faq-answer {
    padding: 0 20px 18px;
    font-size: var(--fs-sm);
    color: var(--text-secondary);
    line-height: 1.6;
}

/* Footer */
.site-footer {
    position: relative;
    z-index: 10;
    width: 100%;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(9, 9, 11, 0.5);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 20px 16px 24px;
    margin-top: 24px;
}

.footer-inner {
    max-width: 560px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    text-align: center;
}

.footer-links {
    display: flex;
    gap: 18px;
}

.footer-links a {
    color: rgba(255, 255, 255, 0.42);
    text-decoration: none;
    font-size: 0.7rem;
    font-weight: var(--fw-medium);
    letter-spacing: 0.02em;
    transition: color .2s ease;
}

.footer-links a:hover {
    color: rgba(255, 255, 255, 0.65);
}

.footer-legal {
    font-size: 0.65rem;
    color: rgba(255, 255, 255, 0.35);
    line-height: 1.6;
    max-width: 52ch;
}

.footer-legal a {
    color: rgba(255, 255, 255, 0.42);
    text-decoration: none;
    border-bottom: 1px dashed rgba(255, 255, 255, 0.25);
    transition: color .2s ease;
}

.footer-legal a:hover {
    color: rgba(255, 255, 255, 0.6);
}

.footer-copy {
    font-size: 0.62rem;
    color: rgba(255, 255, 255, 0.3);
}

/* Stack pricing + features on small screens */
@media (max-width: 640px) {
    .page-section {
        padding: 48px 16px;
        scroll-margin-top: 52px;
    }

    .price-grid {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }

    .price-desc {
        min-height: 0;
    }

    .feature-grid {
        grid-template-columns: 1fr 1fr;
    }
}

/* ============================================================
   About / Pricing / FAQ — refreshed theme + scroll animations
   ============================================================ */

/* These pages use the app's plain black background — no orb, no gradient. */

/* Eyebrow as a soft orange pill */
body.subpage .section-eyebrow {
    color: #fed7aa;
    background: linear-gradient(135deg, rgba(251, 191, 36, .16), rgba(249, 115, 22, .16));
    border: 1px solid rgba(249, 115, 22, .32);
    padding: 5px 12px;
    border-radius: 999px;
    margin-bottom: 14px;
}

/* Warm orange price numbers */
.price-amount .amount {
    background: linear-gradient(120deg, var(--orange-light), var(--orange-deep) 55%, var(--orange-burnt));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Animated orange gradient ring on the featured plan */
.price-card.featured::before {
    content: "";
    position: absolute;
    inset: -1px;
    border-radius: inherit;
    padding: 1px;
    background: linear-gradient(135deg, var(--orange-light), var(--orange-deep), var(--orange-burnt));
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
            mask-composite: exclude;
    pointer-events: none;
    animation: ringGlow 4.5s ease-in-out infinite;
}

@keyframes ringGlow {
    0%, 100% { opacity: .40; }
    50%      { opacity: .95; }
}

/* Feature chips lift on hover */
.feature-item {
    transition: transform .2s ease;
}

.feature-item:hover {
    transform: translateY(-2px);
}

/* FAQ hover accent */
.faq-item summary:hover {
    color: var(--orange);
}

/* Compatible-players marquee — logos drift left → right, fading at the edges */
.marquee {
    position: relative;
    width: 100%;
    overflow: hidden;
    /* Light panel so dark logos (foobar2000, Sonos, mpv…) stay visible */
    background: #f4f4f5;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 16px;
    padding: 22px 0;
    box-shadow: 0 18px 40px -18px rgba(0, 0, 0, 0.6);
    -webkit-mask-image: linear-gradient(to right, transparent, #000 9%, #000 91%, transparent);
            mask-image: linear-gradient(to right, transparent, #000 9%, #000 91%, transparent);
}

.marquee-track {
    display: flex;
    align-items: center;
    gap: 56px;
    width: max-content;
    animation: marqueeLTR 42s linear infinite;
}

.marquee:hover .marquee-track {
    animation-play-state: paused;
}

.marquee-item {
    display: flex;
    align-items: center;
    gap: 13px;
    flex: 0 0 auto;
    opacity: .9;
    transition: opacity .25s ease, transform .25s ease;
}

.marquee-item:hover {
    opacity: 1;
    transform: translateY(-3px);
}

.marquee-item img {
    height: 46px;
    width: auto;
    flex: 0 0 auto;
}

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

/* ---- Scroll reveal (active only when JS adds .reveal-on) ---- */
.reveal-on .page-section [data-reveal] {
    opacity: 0;
}

.reveal-on .page-section.in [data-reveal] {
    opacity: 1;
    animation: revUp .8s cubic-bezier(.2, .75, .25, 1) backwards;
}

.reveal-on .page-section.in [data-reveal="pop"] {
    animation-name: revPop;
}

.reveal-on .page-section.in [data-reveal="drop"] {
    animation: revDrop .95s cubic-bezier(.18, .89, .32, 1.27) backwards;
}

@keyframes revUp {
    from { opacity: 0; transform: translateY(44px); }
    to   { opacity: 1; transform: none; }
}

@keyframes revPop {
    from { opacity: 0; transform: scale(.93); }
    to   { opacity: 1; transform: none; }
}

@keyframes revDrop {
    0%   { opacity: 0; transform: translateY(-80px); }
    60%  { opacity: 1; }
    100% { opacity: 1; transform: none; }
}

/* Stagger children within each section */
.reveal-on .price-grid .price-card:nth-child(2)      { animation-delay: .16s; }
.reveal-on .feature-grid .feature-item:nth-child(1)  { animation-delay: .05s; }
.reveal-on .feature-grid .feature-item:nth-child(2)  { animation-delay: .13s; }
.reveal-on .feature-grid .feature-item:nth-child(3)  { animation-delay: .21s; }
.reveal-on .feature-grid .feature-item:nth-child(4)  { animation-delay: .29s; }
.reveal-on .faq-list .faq-item:nth-child(1)          { animation-delay: .04s; }
.reveal-on .faq-list .faq-item:nth-child(2)          { animation-delay: .10s; }
.reveal-on .faq-list .faq-item:nth-child(3)          { animation-delay: .16s; }
.reveal-on .faq-list .faq-item:nth-child(4)          { animation-delay: .22s; }
.reveal-on .faq-list .faq-item:nth-child(5)          { animation-delay: .28s; }
.reveal-on .faq-list .faq-item:nth-child(6)          { animation-delay: .34s; }
.reveal-on .faq-list .faq-item:nth-child(7)          { animation-delay: .40s; }
.reveal-on .faq-list .faq-item:nth-child(8)          { animation-delay: .46s; }

/* Respect users who prefer less motion */
@media (prefers-reduced-motion: reduce) {
    .price-card.featured::before {
        animation: none;
    }

    .marquee {
        overflow-x: auto;
    }

    .marquee-track {
        animation: none;
    }

    .reveal-on .page-section [data-reveal],
    .reveal-on .page-section.in [data-reveal] {
        opacity: 1;
        animation: none;
        transform: none;
    }
}

/* ---------------------------------------------------------------------------
   Lemon Squeezy checkout overlay — force dark, translucent backdrop
   The overlay iframe wrapper created by lemon.js defaults to a solid white
   background. These overrides make it blend with our dark-themed app.
   --------------------------------------------------------------------------- */
.lemonsqueezy-loader {
    background: rgba(0, 0, 0, 0.80) !important;
    backdrop-filter: blur(8px) !important;
    -webkit-backdrop-filter: blur(8px) !important;
}

/* ============================================================
   Mobile (≤640px) — compact type scale, smaller header/controls,
   and a top-aligned layout so the fixed navbar never overlaps
   the card.
   ============================================================ */
@media (max-width: 640px) {


    /* Compact fixed header so brand + nav share one row without wrapping */
    .site-header {
        padding: 6px 12px;
        gap: 8px;
    }

    .brand-logo {
        width: 38px;
        height: 38px;
    }

    .brand-name {
        font-size: 1.05rem;
    }

    .site-nav {
        gap: 2px;
    }

    .site-nav a {
        font-size: var(--fs-xs);
        padding: 7px 8px;
    }

    /* Top-align the converter card below the header instead of
       viewport-centering it — a tall card scrolls naturally instead
       of sliding its top edge under the fixed navbar. */
    body {
        align-items: flex-start;
        padding-top: 58px;
    }

    body.subpage {
        padding-top: 58px;
    }

    .container {
        transform: none;
        padding: 12px;
    }

    .glass-card {
        margin: 48px 0 20px;
        padding: 16px 14px;
        border-radius: 18px;
        gap: 10px;
    }

    .select-wrapper select,
    .playground-group input,
    .modal-input {
        font-size: var(--fs-xs);
        padding: 10px 12px;
    }

    .test-btn {
        min-width: 64px;
        padding: 0 12px;
    }

    .upload-zone {
        padding: 16px 12px;
    }

    .icon-pulse-wrapper {
        width: 40px;
        height: 40px;
    }

    .card-section {
        padding: 16px 14px;
        gap: 12px;
    }

    .step-dot {
        width: 28px;
        height: 28px;
        font-size: 0.85rem;
    }

    .step:not(:last-child)::after {
        top: 13px;
    }

    .download-stats {
        gap: 6px;
    }

    .modal-card {
        padding: 20px 16px;
    }

    /* Subpages: tighter panels, FAQ rows, marquee, and a wrapping footer */
    .panel {
        padding: 20px 16px;
    }

    .faq-item summary {
        padding: 14px 16px;
        gap: 12px;
    }

    .faq-answer {
        padding: 0 16px 14px;
    }

    .price-card {
        padding: 16px 12px;
        border-radius: 14px;
        gap: 6px;
    }

    .price-amount .amount {
        font-size: 1.8rem;
    }

    .price-name {
        font-size: 0.6rem;
    }

    .price-desc {
        font-size: 0.65rem;
        min-height: 0;
    }

    .price-features {
        gap: 7px;
        margin-top: 10px;
        padding-top: 12px;
    }

    .price-features li {
        font-size: 0.65rem;
        padding-left: 18px;
    }

    .price-tag {
        font-size: 0.55rem;
        padding: 3px 6px;
        top: 10px;
        right: 10px;
    }

    .marquee-item img {
        height: 36px;
    }

    .marquee-track {
        gap: 36px;
    }

    .footer-links {
        flex-wrap: wrap;
        justify-content: center;
        gap: 10px 18px;
    }
}

/* ============================================================
   Very narrow phones (≤360px, e.g. iPhone SE at 320px) — stack
   the voice-tester input and Play button so the button is always
   reachable as a full-width tap target instead of being squeezed.
   ============================================================ */
@media (max-width: 360px) {
    .playground-group {
        flex-direction: column;
    }

    .test-btn {
        width: 100%;
    }
}