/* ===================================
   CSS Custom Properties (Theme Tokens)
   =================================== */
:root {
    /* Light theme defaults */
    --sky-top: #74c0fc;
    --sky-mid: #a9d8f5;
    --sky-bottom: #dceefb;
    --sky-horizon: #ffe8b0;
    --ground-color: #2d4a1e;
    --silhouette: #1a2e10;

    --bg: #f0f4f8;
    --bg-alt: #e2ecf4;
    --surface: #ffffff;
    --surface-border: rgba(0,0,0,0.07);
    --text: #1a2233;
    --text-muted: #556070;
    --accent: #1d7fbf;
    --accent-hover: #155d8a;
    --accent-2: #f59e0b;

    --header-bg: rgba(255,255,255,0.72);
    --footer-bg: rgba(26,34,51,0.28);
    --footer-text: #cdd8e5;

    --cloud-color: rgba(255,255,255,0.92);
    --star-display: none;
    --sun-display: block;
    --moon-display: none;

    --card-shadow: 0 4px 24px rgba(0,0,0,0.08);
    --btn-shadow: 0 2px 12px rgba(29,127,191,0.18);

    --transition: 0.55s cubic-bezier(0.4, 0, 0.2, 1);
    --sky-transition: 1.2s cubic-bezier(0.4, 0, 0.2, 1);

    --header-height: 48px;

    /* Per-element animation tokens (overridden inline by JS) */
    --dur: 3s;
    --delay: 0s;
    --n: 0;
}

[data-theme="dark"] {
    --sky-top: #1b1537;
    --sky-mid: #080824;
    --sky-bottom: #1c4880;
    --sky-horizon: #ffe8b0;
    --ground-color: #0d1a0a;
    --silhouette: #060e04;

    --bg: #0d1117;
    --bg-alt: #161b22;
    --surface: #1c2333;
    --surface-border: rgba(255,255,255,0.07);
    --text: #e6edf3;
    --text-muted: #8b949e;
    --accent: #58a6ff;
    --accent-hover: #79baff;
    --accent-2: #f59e0b;

    --header-bg: rgba(13,17,23,0.80);
    --footer-bg: rgba(1,4,9,0.28);
    --footer-text: #8b949e;

    --cloud-color: rgba(255,255,255,0);
    --star-display: block;
    --sun-display: none;
    --moon-display: block;

    --card-shadow: 0 4px 24px rgba(0,0,0,0.45);
    --btn-shadow: 0 2px 12px rgba(88,166,255,0.18);
}

/* ===================================
   Reset & Base
   =================================== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
    scroll-behavior: smooth;
    font-size: 16px;
    height: 100%;
}

body {
    font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
    color: var(--text);
    overflow-x: hidden;
    min-height: 100%;
    /* sky is fixed bg, no body background needed */
}

a {
    color: var(--accent);
    text-decoration: none;
    transition: color 0.2s;
}
a:hover { color: var(--accent-hover); }

/* ===================================
   Sky Scene — Fixed full-page background
   =================================== */
.sky-scene {
    position: fixed;
    inset: 0;
    z-index: 0;
    background: linear-gradient(
        to bottom,
        var(--sky-top) 0%,
        var(--sky-mid) 55%,
        var(--sky-bottom) 80%,
        var(--sky-horizon) 100%
    );
    transition: background var(--sky-transition);
    overflow: hidden;
}

/* --- Stars Layer --- */
.stars-layer {
    position: absolute;
    inset: 0;
    opacity: 0;
    transition: opacity var(--sky-transition);
    pointer-events: none;
}
[data-theme="dark"] .stars-layer { opacity: 1; }

.star-field {
    position: absolute;
    inset: 0;
}

.star {
    position: absolute;
    background: #fff;
    border-radius: 50%;
    animation: twinkle var(--dur, 3s) ease-in-out infinite var(--delay, 0s);
}

@keyframes twinkle {
    0%, 100% { opacity: 0.2; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.4); }
}

/* --- Shooting Stars --- */
.shooting-stars {
    position: absolute;
    inset: 0;
    overflow: hidden;
    opacity: 0;
    transition: opacity var(--sky-transition);
    pointer-events: none;
}
[data-theme="dark"] .shooting-stars { opacity: 1; }

.shooting-star {
    position: absolute;
    width: 120px;
    height: 2px;
    background: linear-gradient(90deg, rgba(255,255,255,0), #fff 50%, rgba(255,255,255,0));
    border-radius: 2px;
    top: 20%;
    left: -140px;
    transform: rotate(-25deg);
    animation: none;
}
.shooting-star:nth-child(2) { top: 12%; animation-delay: 3s; animation-duration: 1600s; width: 90px; }
.shooting-star:nth-child(3) { top: 30%; animation-delay: 6s; animation-duration: 1200s; width: 150px; }

@keyframes shoot {
    0% { left: -160px; opacity: 0; }
    10% { opacity: 1; }
    80% { opacity: 0.8; }
    100% { left: 110%; opacity: 0; }
}

/* --- Sun --- */
.celestial-container {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.sun {
    position: absolute;
    top: 80px;
    left: 12%;
    width: 80px;
    height: 80px;
    opacity: 1;
    transition: opacity var(--sky-transition), transform var(--sky-transition);
}
[data-theme="dark"] .sun {
    opacity: 0;
    transform: translateY(30px);
}

.sun-core {
    position: absolute;
    inset: 14px;
    border-radius: 50%;
    background: radial-gradient(circle at 40% 40%, #fff9c4, #ffd700 50%, #ff8f00);
    box-shadow: 0 0 40px 20px rgba(255, 200, 0, 0.45), 0 0 80px 40px rgba(255,200,0,0.18);
}

@keyframes pulse-sun {
    0%, 100% { box-shadow: 0 0 40px 20px rgba(255,200,0,0.45), 0 0 80px 40px rgba(255,200,0,0.18); }
    50% { box-shadow: 0 0 55px 28px rgba(255,200,0,0.55), 0 0 100px 50px rgba(255,200,0,0.22); }
}
@keyframes spin-rays {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* --- Moon --- */
.moon {
    position: absolute;
    top: 75px;
    right: 14%;
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background: radial-gradient(circle at 38% 38%, #f0f4ff, #c8d8f0 60%, #9ab0cc);
    box-shadow: 0 0 30px 10px rgba(180, 210, 240, 0.2), inset -10px -6px 20px rgba(0,0,0,0.15);
    opacity: 0;
    transform: translateY(-20px);
    transition: opacity var(--sky-transition), transform var(--sky-transition);
}
[data-theme="dark"] .moon {
    opacity: 1;
    transform: translateY(0);
}

.moon-crater {
    position: absolute;
    border-radius: 50%;
    background: rgba(0,0,0,0.08);
    box-shadow: inset 1px 1px 3px rgba(0,0,0,0.15);
}
.moon-crater:nth-child(1) { width: 14px; height: 14px; top: 18px; left: 22px; }
.moon-crater:nth-child(2) { width: 9px; height: 9px; top: 36px; left: 42px; }
.moon-crater:nth-child(3) { width: 7px; height: 7px; top: 22px; left: 44px; }

/* --- Clouds --- */
.clouds-layer {
    position: absolute;
    inset: 0;
    pointer-events: none;
    transition: opacity var(--sky-transition);
}
[data-theme="dark"] .clouds-layer { opacity: 0; }

.cloud {
    position: absolute;
    display: flex;
    align-items: flex-end;
    filter: drop-shadow(0 4px 12px rgba(0,0,0,0.08));
}
.cloud span {
    display: block;
    border-radius: 50%;
    background: var(--cloud-color);
}
.cloud-1 {
    top: 80px; left: 25%;
    animation: none;
}
.cloud-1 span:nth-child(1) { width: 70px; height: 45px; }
.cloud-1 span:nth-child(2) { width: 90px; height: 60px; margin: 0 -18px; }
.cloud-1 span:nth-child(3) { width: 60px; height: 40px; }

.cloud-2 {
    top: 120px; left: -10%;
    animation: none;
}
.cloud-2 span:nth-child(1) { width: 55px; height: 36px; }
.cloud-2 span:nth-child(2) { width: 80px; height: 52px; margin: 0 -14px; }
.cloud-2 span:nth-child(3) { width: 50px; height: 34px; }

.cloud-3 {
    top: 55px; right: 5%;
    animation: none;
}
.cloud-3 span:nth-child(1) { width: 100px; height: 55px; }
.cloud-3 span:nth-child(2) { width: 70px; height: 45px; margin: 0 -16px; }

.cloud-4 {
    top: 160px; left: 55%;
    animation: none;
}
.cloud-4 span:nth-child(1) { width: 45px; height: 30px; }
.cloud-4 span:nth-child(2) { width: 65px; height: 42px; margin: 0 -12px; }
.cloud-4 span:nth-child(3) { width: 40px; height: 28px; }

@keyframes drift {
    from { transform: translateX(-20%); }
    to { transform: translateX(120vw); }
}
@keyframes drift-back {
    from { transform: translateX(0); }
    to { transform: translateX(-130vw); }
}

/* --- Horizon / Silhouette --- */
.horizon {
    position: absolute;
    bottom: 0; left: 0; right: 0;
}
.ground-silhouette svg {
    display: block;
    width: 100%;
    height: 120px;
}
.silhouette-fill {
    fill: var(--silhouette);
    transition: fill var(--sky-transition);
}

/* ===================================
   Page Scroll Layer — sits above sky
   =================================== */
.page-scroll {
    position: relative;
    z-index: 10;
    min-height: 100vh;
    padding-top: var(--header-height);
    display: flex;
    flex-direction: column;
}

.page-scroll > .site-footer {
    margin-top: auto;
}

/* ===================================
   Header
   =================================== */
.site-header {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 100;
    height: var(--header-height);
    background: var(--header-bg);
    backdrop-filter: blur(14px) saturate(160%);
    -webkit-backdrop-filter: blur(14px) saturate(160%);
    border-bottom: 1px solid var(--surface-border);
    transition: background var(--transition);
}

.header-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
    height: 100%;
    display: flex;
    align-items: center;
    gap: 2rem;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text);
    white-space: nowrap;
}
.logo-icon { font-size: 1.3rem; }

.nav-links {
    display: flex;
    gap: 1.8rem;
    flex: 1;
    justify-content: center;
}
.nav-links a {
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 500;
    transition: color 0.2s;
    position: relative;
}
.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -3px; left: 0; right: 0;
    height: 2px;
    background: var(--accent);
    transform: scaleX(0);
    transition: transform 0.2s;
    border-radius: 2px;
}
.nav-links a:hover { color: var(--text); }
.nav-links a:hover::after { transform: scaleX(1); }

.header-actions {
    margin-left: auto;
    display: flex;
    align-items: center;
}

/* ===================================
   Hero Section
   =================================== */
.hero-section {
    position: relative;
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - var(--header-height));
    text-align: center;
    padding: 3rem 1.5rem 4rem;
}

.hero-inner {
    max-width: 700px;
}

.hero-title {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    margin-bottom: 1.2rem;
}
.hero-greeting {
    font-size: 1.1rem;
    font-weight: 400;
    color: var(--text-muted);
    letter-spacing: 0.04em;
    text-shadow: 0 1px 6px rgba(0,0,0,0.12);
}
.hero-brand {
    font-size: clamp(2.8rem, 7vw, 5rem);
    font-weight: 800;
    letter-spacing: -0.03em;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: drop-shadow(0 2px 8px rgba(0,0,0,0.15));
}

.hero-subtitle {
    font-size: 1.1rem;
    color: var(--text-muted);
    line-height: 1.7;
    margin-bottom: 2rem;
    max-width: 560px;
    margin-left: auto;
    margin-right: auto;
    text-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

.hero-cta {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* ===================================
   Buttons
   =================================== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.65rem 1.6rem;
    border-radius: 50px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
    text-decoration: none;
}
.btn-primary {
    background: var(--accent);
    color: #fff;
    box-shadow: var(--btn-shadow);
}
.btn-primary:hover {
    background: var(--accent-hover);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(29,127,191,0.3);
}
.btn-ghost {
    background: rgba(255,255,255,0.18);
    color: var(--text);
    border: 1.5px solid rgba(255,255,255,0.35);
    backdrop-filter: blur(4px);
}
.btn-ghost:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: rgba(255,255,255,0.28);
    transform: translateY(-2px);
}
.btn-full { width: 100%; justify-content: center; }

/* Footer contact button */
.btn-contact-footer {
    background: var(--accent);
    color: #fff;
    border: none;
    padding: 0.5rem 1.2rem;
    border-radius: 50px;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, transform 0.2s;
    white-space: nowrap;
}
.btn-contact-footer:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
}

/* ===================================
   Weather Widget
   =================================== */
.weather-widget-section {
    display: flex;
    justify-content: center;
    padding: 0 1.5rem 2.5rem;
    position: relative;
    z-index: 5;
}
.weather-widget {
    background: var(--surface);
    border: 1px solid var(--surface-border);
    border-radius: 16px;
    padding: 1rem 2rem;
    min-width: 280px;
    box-shadow: var(--card-shadow);
    transition: background var(--transition), border-color var(--transition);
}
.weather-loading {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    color: var(--text-muted);
    font-size: 0.95rem;
}
.sky-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}
.sky-info-icon { font-size: 2rem; }
.sky-info-text { display: flex; flex-direction: column; gap: 0.1rem; }
.sky-info-text strong { font-size: 1.05rem; color: var(--text); }
.sky-info-text span { font-size: 0.88rem; color: var(--text-muted); }
.sky-info-time { margin-left: auto; font-size: 0.85rem; color: var(--text-muted); font-variant-numeric: tabular-nums; }

/* ===================================
   Sections — glassmorphism panels
   =================================== */
.section {
    padding: 5rem 1.5rem;
    position: relative;
    z-index: 5;
}
.section-alt {
    background: rgba(255,255,255,0.12);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-top: 1px solid rgba(255,255,255,0.18);
    border-bottom: 1px solid rgba(255,255,255,0.18);
}
[data-theme="dark"] .section-alt {
    background: rgba(0,0,0,0.25);
    border-color: rgba(255,255,255,0.06);
}
.section-inner {
    max-width: 1100px;
    margin: 0 auto;
}
.section-title {
    font-size: clamp(1.7rem, 4vw, 2.5rem);
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--text);
}
.section-text {
    font-size: 1.05rem;
    color: var(--text-muted);
    line-height: 1.75;
    max-width: 680px;
    margin-bottom: 2.5rem;
}

/* --- About Cards --- */
.about-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
}
.about-card {
    background: var(--surface);
    border: 1px solid var(--surface-border);
    border-radius: 16px;
    padding: 1.8rem;
    box-shadow: var(--card-shadow);
    transition: background var(--transition), border-color var(--transition), transform 0.2s, box-shadow 0.2s;
}
.about-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(0,0,0,0.13);
}
.card-icon { font-size: 2rem; display: block; margin-bottom: 0.8rem; }
.about-card h3 { font-size: 1.1rem; margin-bottom: 0.5rem; color: var(--text); }
.about-card p { font-size: 0.92rem; color: var(--text-muted); line-height: 1.6; }

/* --- Features Grid --- */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}
.feature-card {
    background: var(--surface);
    border: 1px solid var(--surface-border);
    border-radius: 16px;
    padding: 1.8rem;
    box-shadow: var(--card-shadow);
    transition: background var(--transition), border-color var(--transition), transform 0.2s;
    text-align: center;
}
.feature-card:hover { transform: translateY(-4px); }
.feature-icon { font-size: 2.2rem; display: block; margin-bottom: 0.8rem; }
.feature-card h3 { font-size: 1.05rem; margin-bottom: 0.4rem; color: var(--text); }
.feature-card p { font-size: 0.9rem; color: var(--text-muted); line-height: 1.6; }
.features-loading { text-align: center; padding: 2rem; color: var(--text-muted); display: flex; align-items: center; justify-content: center; gap: 0.7rem; }

/* ===================================
   Spinner
   =================================== */
.spinner {
    display: inline-block;
    width: 18px; height: 18px;
    border: 2.5px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    vertical-align: middle;
}
.spinner-btn {
    display: none;
    width: 16px; height: 16px;
    border: 2px solid rgba(255,255,255,0.35);
    border-top-color: #fff;
    border-radius: 50%;
    vertical-align: middle;
}
.htmx-indicator { display: none; }
.htmx-request .htmx-indicator,
.htmx-request.htmx-indicator { display: inline-block; }

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

/* ===================================
   Footer
   =================================== */
.site-footer {
    background: var(--footer-bg);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    color: var(--footer-text);
    padding: 1.6rem 1.5rem;
    border-top: 1px solid rgba(255,255,255,0.1);
    transition: background var(--transition);
}
.footer-inner {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}
.footer-brand { display: flex; align-items: center; gap: 0.4rem; font-weight: 700; color: #fff; }
.footer-copy { font-size: 0.85rem; color: var(--footer-text); flex: 1; text-align: center; }
.footer-links { display: flex; gap: 1.5rem; }
.footer-links a { font-size: 0.85rem; color: var(--footer-text); transition: color 0.2s; }
.footer-links a:hover { color: #fff; }

/* ===================================
   Contact Modal
   =================================== */
.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 200;
    background: rgba(0,0,0,0.55);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.28s ease;
}
.modal-overlay.is-open {
    opacity: 1;
    pointer-events: auto;
}

.modal-box {
    background: var(--surface);
    border: 1px solid var(--surface-border);
    border-radius: 20px;
    width: 100%;
    max-width: 480px;
    box-shadow: 0 24px 80px rgba(0,0,0,0.3);
    position: relative;
    transform: translateY(20px) scale(0.97);
    transition: transform 0.28s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.28s ease;
    opacity: 0;
}
.modal-overlay.is-open .modal-box {
    transform: translateY(0) scale(1);
    opacity: 1;
}

.modal-close {
    position: absolute;
    top: 1rem; right: 1rem;
    background: var(--bg-alt);
    border: 1px solid var(--surface-border);
    border-radius: 50%;
    width: 32px; height: 32px;
    font-size: 1.1rem;
    line-height: 1;
    cursor: pointer;
    color: var(--text-muted);
    display: flex; align-items: center; justify-content: center;
    transition: background 0.2s, color 0.2s;
}
.modal-close:hover { background: var(--accent); color: #fff; border-color: var(--accent); }

.modal-header {
    padding: 2rem 2rem 1rem;
    text-align: center;
}
.modal-icon { font-size: 2.2rem; display: block; margin-bottom: 0.6rem; }
.modal-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 0.3rem;
}
.modal-subtitle {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.modal-body {
    padding: 0 2rem 2rem;
}

/* Contact Form inside modal */
.contact-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}
.form-group label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
}
.form-group input,
.form-group textarea {
    background: var(--bg);
    border: 1.5px solid var(--surface-border);
    border-radius: 10px;
    padding: 0.65rem 0.9rem;
    font-size: 0.95rem;
    color: var(--text);
    transition: border-color 0.2s, background var(--transition);
    resize: vertical;
    font-family: inherit;
}
.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(88,166,255,0.12);
}

#modal-result { margin-bottom: 0.2rem; }
.contact-result {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    border-radius: 10px;
    padding: 0.8rem 1rem;
    font-size: 0.92rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
}
.contact-result--success {
    background: #dcfce7;
    color: #166534;
}
.contact-result--error {
    background: #fee2e2;
    color: #991b1b;
}
[data-theme="dark"] .contact-result--success { background: #14532d33; color: #4ade80; }
[data-theme="dark"] .contact-result--error { background: #7f1d1d33; color: #f87171; }
.result-icon { font-size: 1.1rem; flex-shrink: 0; }

/* Prevent body scroll when modal is open */
body.modal-open { overflow: hidden; }

/* ===================================
   Sound Mixer — Category accordion
   =================================== */
.sound-category {
    margin-bottom: 1.6rem;
    border-radius: 16px;
    overflow: hidden;
    background: rgba(255,255,255,0.10);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.18);
    transition: background var(--transition);
}
[data-theme="dark"] .sound-category {
    background: rgba(0,0,0,0.22);
    border-color: rgba(255,255,255,0.08);
}

.cat-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.9rem 1.2rem;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text);
    font-size: 1.05rem;
    font-weight: 700;
    text-align: left;
    transition: background 0.2s;
    user-select: none;
}
.cat-toggle:hover { background: rgba(255,255,255,0.1); }
[data-theme="dark"] .cat-toggle:hover { background: rgba(255,255,255,0.06); }

.cat-icon { font-size: 1.3rem; }
.cat-name { flex: 1; }
.cat-chevron {
    font-size: 1rem;
    transition: transform 0.3s cubic-bezier(0.4,0,0.2,1);
    display: inline-block;
}
.cat-chevron.collapsed { transform: rotate(-90deg); }

.cat-body {
    overflow: hidden;
    transition: max-height 0.38s cubic-bezier(0.4,0,0.2,1);
    padding: 0 1rem 1rem;
}

/* ===================================
   Sound Mixer — Group accordion
   =================================== */
.sound-group {
    margin-bottom: 1rem;
    border-radius: 12px;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.12);
}
[data-theme="dark"] .sound-group {
    background: rgba(0,0,0,0.15);
    border-color: rgba(255,255,255,0.06);
}

.grp-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.65rem 1rem;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    font-size: 0.92rem;
    font-weight: 600;
    text-align: left;
    transition: color 0.2s, background 0.2s;
    user-select: none;
    border-radius: 12px;
}
.grp-toggle:hover { color: var(--text); background: rgba(255,255,255,0.07); }

.grp-chevron {
    font-size: 0.85rem;
    transition: transform 0.3s cubic-bezier(0.4,0,0.2,1);
    display: inline-block;
}
.grp-chevron.collapsed { transform: rotate(-90deg); }

.grp-body {
    overflow: hidden;
    transition: max-height 0.35s cubic-bezier(0.4,0,0.2,1);
    padding: 0 0.75rem 0.75rem;
}

/* ===================================
   Sound Mixer — Cards row
   =================================== */
.sound-cards-row {
    gap: 0.85rem;
}

/* ===================================
   Sound Card
   =================================== */
.sound-card {
    margin: 0.45rem;
    background: var(--surface);
    border: 1.5px solid var(--surface-border);
    border-radius: 14px;
    padding: 0.9rem 0.9rem 0.8rem;
    box-shadow: var(--card-shadow);
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    transition: background var(--transition), border-color var(--transition),
                transform 0.18s, box-shadow 0.18s;
    position: relative;
}
.sound-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 32px rgba(0,0,0,0.13);
}
.sound-card.is-playing {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(88,166,255,0.18), var(--card-shadow);
}

/* top row: emoji + playing bars */
.sc-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 28px;
}
.sc-emoji { font-size: 1.5rem; line-height: 1; }

/* Playing animation bars — hidden by default, shown when .is-playing */
.sc-playing-icon {
    display: flex;
    align-items: flex-end;
    gap: 2px;
    height: 20px;
    opacity: 0;
    transition: opacity 0.2s;
}
.sound-card.is-playing .sc-playing-icon { opacity: 1; }

.sc-playing-icon .bar {
    display: block;
    width: 3px;
    border-radius: 2px;
    background: var(--accent);
    height: 100%;
    transform-origin: bottom;
    animation: sc-bar-bounce 1s ease-in-out infinite;
}
.sc-playing-icon .bar:nth-child(1) { animation-delay: 0.0s; }
.sc-playing-icon .bar:nth-child(2) { animation-delay: 0.2s; }
.sc-playing-icon .bar:nth-child(3) { animation-delay: 0.4s; }
.sc-playing-icon .bar:nth-child(4) { animation-delay: 0.1s; }
.sc-playing-icon .bar:nth-child(5) { animation-delay: 0.3s; }

@keyframes sc-bar-bounce {
    0%, 100% { transform: scaleY(0.15); }
    40%       { transform: scaleY(1);    }
    60%       { transform: scaleY(0.6);  }
}

.sc-name {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Controls row: play btn + volume */
.sc-controls {
    display: flex;
    align-items: center;
    gap: 0.55rem;
}

/* Play/Pause button */
.sc-play-btn {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, transform 0.15s;
    box-shadow: 0 2px 8px rgba(29,127,191,0.25);
}
.sc-play-btn:hover { background: var(--accent-hover); transform: scale(1.08); }
.sc-play-btn svg   { width: 16px; height: 16px; pointer-events: none; }
.sc-play-btn .icon-pause { display: none; }

/* Volume control row */
.sc-vol-wrap {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 0.3rem;
    min-width: 0;
}
.vol-icon {
    flex-shrink: 0;
    width: 26px;
    height: 26px;
    color: var(--text-muted);
    opacity: 0.7;
}

/* Track — visual bar is 3px tall; padding keeps hit area 15px tall */
.sc-vol-track {
    flex: 1;
    height: 3px;
    background: var(--bg-alt);
    border-radius: 99px;
    position: relative;
    cursor: pointer;
    border: none;
    min-width: 0;
    touch-action: none;
    /* expand clickable / touchable area without growing the visual bar */
    padding: 6px 0;
    margin: -6px 0;
    box-sizing: content-box;
}
.sc-vol-track:focus {
    outline: 2px solid var(--accent);
    outline-offset: 4px;
}

.sc-vol-fill {
    position: absolute;
    /* vertically centred inside the padded track */
    top: 50%;
    left: 0;
    transform: translateY(-50%);
    height: 3px;
    background: var(--accent);
    border-radius: 99px;
    pointer-events: none;
    transition: background 0.2s;
}

.sc-vol-thumb {
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 9px;
    height: 9px;
    background: rgba(255, 255, 255, 100);
    border: 2px solid var(--accent);
    border-radius: 50%;
    pointer-events: none;
    box-shadow: 0 1px 4px rgba(0,0,0,0.18);
    transition: transform 0.15s;
}
.sc-vol-track:active .sc-vol-thumb,
.sc-vol-track:focus  .sc-vol-thumb {
    transform: translate(-50%, -50%) scale(1.4);
}

.sc-vol-pct {
    font-size: 0.7rem;
    color: var(--text-muted);
    min-width: 2.6ch;
    text-align: right;
    font-variant-numeric: tabular-nums;
    flex-shrink: 0;
}

/* ===================================
   Responsive
   =================================== */
@media (max-width: 768px) {
    .nav-links {
        display: none;
    }

    .footer-inner {
        flex-direction: column;
        text-align: center;
    }
}
