/* ============================================================
   THUNDERDOLPHIN — Design System v3
   Scroll-snap · Carousel · Enhanced animations
   ============================================================ */

@font-face {
    font-family: 'TDDisplay';
    src: url('assets/TDDisplay.otf') format('opentype');
    font-weight: 400 700;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'TDPixel';
    src: url('assets/TDPixel.otf') format('opentype');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

/* --- Variables --- */
:root {
    --font-display: 'TDDisplay', 'Sora', sans-serif;
    --font-body: 'Sora', sans-serif;
    --font-mono: 'SF Mono', 'Fira Code', 'JetBrains Mono', 'Menlo', monospace;

    --accent: #8BC34A;
    --accent-hover: #9DD45C;
    --accent-dim: rgba(139, 195, 74, 0.10);
    --accent-glow: rgba(139, 195, 74, 0.35);
    --danger: #E57373;

    --radius-sm: 8px;
    --radius: 12px;
    --radius-lg: 20px;

    --ease: cubic-bezier(0.4, 0, 0.2, 1);
    --ease-out: cubic-bezier(0, 0, 0.2, 1);
    --dur: 0.3s;
}

[data-theme="dark"] {
    --bg: #181B26;
    --bg-surface: #1F2230;
    --bg-elevated: #282C3A;
    --text: #EDEDF0;
    --text-secondary: #8889A0;
    --text-dim: #555570;
    --border: rgba(255, 255, 255, 0.08);
    --border-hover: rgba(255, 255, 255, 0.15);
    --logo-invert: invert(1);
    --neu-dark: rgba(0, 0, 0, 0.4);
    --neu-light: rgba(255, 255, 255, 0.05);
    --neu-inset: rgba(255, 255, 255, 0.08);
    --btn-primary-text: #FFFFFF;
}

[data-theme="light"] {
    --bg: #F2F2F5;
    --bg-surface: #E6E6EB;
    --bg-elevated: #FFFFFF;
    --text: #4A4A5C;
    --text-secondary: #6A6A80;
    --text-dim: #9898AC;
    --border: rgba(0, 0, 0, 0.07);
    --border-hover: rgba(0, 0, 0, 0.14);
    --logo-invert: invert(0) brightness(1.8);
    --neu-dark: rgba(0, 0, 0, 0.12);
    --neu-light: rgba(255, 255, 255, 0.8);
    --neu-inset: rgba(255, 255, 255, 0.6);
    --btn-primary-text: #0A0A0C;
}

/* --- Reset --- */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; user-select: none; -webkit-user-select: none; }

body {
    font-family: var(--font-body);
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    overflow: hidden;
    height: 100vh;
    height: 100dvh;
    transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Ambient green shading for depth */
/* Ambient green shading — homepage only */
.page::before {
    content: '';
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background:
        radial-gradient(ellipse 60% 50% at 15% 10%, rgba(139, 195, 74, 0.04) 0%, transparent 70%),
        radial-gradient(ellipse 50% 60% at 85% 90%, rgba(139, 195, 74, 0.035) 0%, transparent 70%),
        radial-gradient(ellipse 40% 40% at 50% 50%, rgba(139, 195, 74, 0.02) 0%, transparent 60%);
}

[data-theme="light"] .page::before {
    background:
        radial-gradient(ellipse 60% 50% at 15% 10%, rgba(139, 195, 74, 0.06) 0%, transparent 70%),
        radial-gradient(ellipse 50% 60% at 85% 90%, rgba(139, 195, 74, 0.05) 0%, transparent 70%),
        radial-gradient(ellipse 40% 40% at 50% 50%, rgba(139, 195, 74, 0.03) 0%, transparent 60%);
}

/* Grain overlay */
body::after {
    content: '';
    position: fixed;
    inset: 0;
    z-index: 10000;
    pointer-events: none;
    opacity: 0.018;
    background: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
    background-size: 200px;
}

img, video { display: block; max-width: 100%; }

/* Allow text selection only on content paragraphs and inputs */
p, .feature-card p, .download-desc, input, textarea { user-select: text; -webkit-user-select: text; }

/* ============================================================
   SCROLL-SNAP PAGE CONTAINER
   ============================================================ */
.page {
    height: 100vh;
    height: 100dvh;
    overflow-y: auto;
    scroll-snap-type: y mandatory;
    scrollbar-width: none;
}

.page::-webkit-scrollbar { display: none; }

.page > section {
    scroll-snap-align: start;
    min-height: 100vh;
    min-height: 100dvh;
}

/* ============================================================
   NAVIGATION
   ============================================================ */
.nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    height: 64px;
    padding: 0 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: color-mix(in srgb, var(--bg) 50%, transparent);
    backdrop-filter: blur(32px) saturate(1.5);
    -webkit-backdrop-filter: blur(32px) saturate(1.5);
    border-bottom: 1px solid var(--border);
    transition: background var(--dur), border-color var(--dur);
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 3px;
    text-decoration: none;
    color: var(--text);
}

.nav-icon {
    height: 24px;
    width: auto;
}

.nav-wordmark {
    font-family: 'TDPixel', var(--font-display);
    font-size: 0.8rem;
    font-weight: 400;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--text);
    transition: color var(--dur);
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 24px;
}

.nav-link {
    font-family: var(--font-body);
    font-size: 0.85rem;
    font-weight: 400;
    color: var(--text-secondary);
    text-decoration: none;
    position: relative;
    padding: 4px 0;
    transition: color var(--dur);
}

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

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 1px;
    background: var(--accent);
    transition: width var(--dur) var(--ease);
}

.nav-link:hover::after { width: 100%; }

.nav-connect {
    padding: 7px 18px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 100px;
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--text-secondary);
    text-decoration: none;
    background: color-mix(in srgb, var(--bg-elevated) 30%, transparent);
    backdrop-filter: blur(16px) saturate(1.4);
    -webkit-backdrop-filter: blur(16px) saturate(1.4);
    box-shadow: none;
    transition: all var(--dur);
}

.nav-connect:hover {
    color: var(--accent);
    border-color: rgba(255, 255, 255, 0.15);
    background: color-mix(in srgb, var(--bg-elevated) 45%, transparent);
    box-shadow: none;
}

/* Theme toggle */
.theme-toggle {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: color-mix(in srgb, var(--bg-elevated) 30%, transparent);
    backdrop-filter: blur(16px) saturate(1.4);
    -webkit-backdrop-filter: blur(16px) saturate(1.4);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--dur);
    flex-shrink: 0;
    box-shadow: none;
}

.theme-toggle:hover {
    color: var(--text);
    background: color-mix(in srgb, var(--bg-elevated) 45%, transparent);
    box-shadow: none;
}

[data-theme="dark"] .icon-sun { display: block; }
[data-theme="dark"] .icon-moon { display: none; }
[data-theme="light"] .icon-sun { display: none; }
[data-theme="light"] .icon-moon { display: block; }

/* ============================================================
   HERO
   ============================================================ */
.hero {
    position: relative;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    cursor: crosshair;
    user-select: none;
    -webkit-user-select: none;
}

/* (glow behind blob removed) */

@keyframes breathe {
    0%, 100% { opacity: 0.6; transform: translate(-50%, -50%) scale(1); }
    50% { opacity: 1; transform: translate(-50%, -50%) scale(1.2); }
}

#flubber {
    position: absolute;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 95vw;
    max-width: 1300px;
    aspect-ratio: 1 / 1;
    z-index: 1;
    pointer-events: none;
    image-rendering: auto;
    top: 50%; /* overridden by JS to track title position */
}

.hero-video { display: none; }

.hero-content {
    position: relative;
    z-index: 4;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 20px;
    padding: 0 24px;
    pointer-events: none;
    margin-top: 40px;
}

/* Letter-staggered reveal — spans injected by JS */
.hero-title {
    font-family: var(--font-display);
    font-size: clamp(4rem, 13vw, 10rem);
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 0.9;
    text-transform: uppercase;
    color: var(--text);
    perspective: 600px;
}

.hero-title span {
    display: inline-block;
    opacity: 0;
    transform: translateY(50px) rotateX(50deg);
    animation: letterPop 0.6s var(--ease-out) calc(0.1s + var(--i, 0) * 0.045s) forwards;
    color: var(--text);
    backdrop-filter: blur(20px) saturate(1.6);
    -webkit-backdrop-filter: blur(20px) saturate(1.6);
    padding: 2px 1px;
    margin: -2px -1px;
}

@keyframes letterPop {
    to { opacity: 1; transform: translateY(0) rotateX(0); }
}

.hero-tagline {
    font-size: clamp(0.9rem, 2vw, 1.15rem);
    font-weight: 300;
    color: var(--text);
    letter-spacing: 0.06em;
    margin-top: -17px;
    animation: fadeUp 0.9s var(--ease-out) 0.55s both;
}

.hero-badges {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin-top: 28px;
    animation: fadeUp 0.9s var(--ease-out) 0.7s both;
}

.hero-badge {
    font-family: var(--font-mono);
    font-size: 0.68rem;
    color: var(--text);
    letter-spacing: 0.05em;
    padding: 5px 14px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 100px;
    background: color-mix(in srgb, var(--bg-elevated) 35%, transparent);
    backdrop-filter: blur(20px) saturate(1.5);
    -webkit-backdrop-filter: blur(20px) saturate(1.5);
    box-shadow: none;
    transition: border-color var(--dur), color var(--dur), background var(--dur), box-shadow var(--dur);
}

.hero-cta {
    display: flex;
    gap: 12px;
    margin-top: 4px;
    pointer-events: all;
    animation: fadeUp 0.9s var(--ease-out) 0.85s both;
}

.hero-demo-link {
    font-family: var(--font-mono);
    font-size: 0.68rem;
    color: var(--text-dim);
    text-decoration: none;
    letter-spacing: 0.04em;
    pointer-events: all;
    transition: color var(--dur);
    animation: fadeUp 0.9s var(--ease-out) 1s both;
}

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

/* Bottom fade */
.hero-fade {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 120px;
    background: linear-gradient(transparent, var(--bg));
    z-index: 3;
    pointer-events: none;
    transition: background var(--dur);
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
    font-family: var(--font-body);
    font-weight: 500;
    font-size: 0.875rem;
    padding: 12px 28px;
    border-radius: 100px;
    border: none;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all var(--dur) var(--ease);
    letter-spacing: 0.01em;
    position: relative;
    overflow: hidden;
}

.btn-primary {
    background: color-mix(in srgb, var(--bg-elevated) 40%, transparent);
    backdrop-filter: blur(24px) saturate(1.6);
    -webkit-backdrop-filter: blur(24px) saturate(1.6);
    color: var(--text);
    border: 1px solid var(--border-hover);
    box-shadow: none;
}

.btn-primary:hover {
    background: color-mix(in srgb, var(--accent) 25%, transparent);
    color: var(--btn-primary-text);
    border-color: color-mix(in srgb, var(--accent) 40%, transparent);
    transform: translateY(-2px);
    box-shadow: none;
}

.btn-primary:active {
    background: color-mix(in srgb, var(--accent) 35%, transparent);
    transform: translateY(1px);
    box-shadow: none;
}

.btn-ghost {
    background: color-mix(in srgb, var(--bg-elevated) 40%, transparent);
    backdrop-filter: blur(24px) saturate(1.6);
    -webkit-backdrop-filter: blur(24px) saturate(1.6);
    color: var(--text);
    border: 1px solid var(--border-hover);
    box-shadow: none;
}

.btn-ghost:hover {
    color: var(--text);
    background: color-mix(in srgb, var(--bg-elevated) 55%, transparent);
    transform: translateY(-2px);
    box-shadow: none;
}

.btn-ghost:active {
    transform: translateY(1px);
    box-shadow: none;
}

.btn-large {
    font-size: 1rem;
    padding: 16px 40px;
}

/* ============================================================
   SECTIONS — Shared
   ============================================================ */
.section-header {
    text-align: center;
    margin-bottom: 40px;
}

.section-label {
    display: block;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    font-weight: 500;
    color: var(--accent);
    letter-spacing: 0.15em;
    text-transform: uppercase;
    margin-bottom: 12px;
}

.section-title {
    font-family: var(--font-display);
    font-size: clamp(1.6rem, 4vw, 2.4rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text);
    transition: color var(--dur);
}

/* Slide play button */
.slide-play {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;

    background: color-mix(in srgb, var(--bg) 15%, transparent);
    border: none;
    border-radius: inherit;
    cursor: pointer;
    padding: 0;
    opacity: 1;
    transition: opacity 0.4s var(--ease), background 0.3s;
}

.slide-play-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: color-mix(in srgb, var(--bg) 55%, transparent);
    backdrop-filter: blur(16px) saturate(1.4);
    -webkit-backdrop-filter: blur(16px) saturate(1.4);
    border: 1px solid var(--border-hover);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text);
    transition: all 0.3s var(--ease);
}

.slide-play:hover .slide-play-icon {
    background: color-mix(in srgb, var(--accent) 20%, transparent);
    border-color: var(--accent);
    color: var(--accent);
    transform: scale(1.1);
}

.slide-play .icon-pause { display: none; }
.slide-play .icon-play { display: block; }

/* Playing state: hide overlay, show on hover with pause icon */
.carousel-slide.is-playing .slide-play {
    opacity: 0;
    pointer-events: none;
}

.carousel-slide.is-playing:hover .slide-play {
    opacity: 1;
    pointer-events: all;
}

.carousel-slide.is-playing .slide-play .icon-play { display: none; }
.carousel-slide.is-playing .slide-play .icon-pause { display: block; }

/* ============================================================
   SHOWCASE — Carousel
   ============================================================ */
.showcase {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 80px 0 60px;
}

.carousel {
    position: relative;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
}

.carousel-stage {
    position: relative;
    width: 100%;
    height: clamp(260px, 40vw, 500px);
    perspective: 1400px;
}

.carousel-slide {
    position: absolute;
    left: 50%;
    top: 50%;
    width: min(720px, 68vw);
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid var(--border);
    background: color-mix(in srgb, var(--bg-surface) 35%, transparent);
    transition: transform 0.7s cubic-bezier(0.32, 0.72, 0, 1),
                opacity 0.7s cubic-bezier(0.32, 0.72, 0, 1),
                filter 0.7s cubic-bezier(0.32, 0.72, 0, 1);
    will-change: transform, opacity;
    cursor: pointer;
}

.carousel-slide.is-active { cursor: default; }

.carousel-slide img,
.carousel-slide video {
    width: 100%;
    height: auto;
    display: block;
}

/* Glassmorphic overlay on non-active slides */
.carousel-slide::after {
    content: '';
    position: absolute;
    inset: 0;
    background: color-mix(in srgb, var(--bg) 22%, transparent);
    backdrop-filter: blur(4px) saturate(0.7);
    -webkit-backdrop-filter: blur(4px) saturate(0.7);
    border-radius: inherit;
    opacity: 1;
    transition: opacity 0.7s cubic-bezier(0.32, 0.72, 0, 1);
    pointer-events: none;
    z-index: 1;
}

.carousel-slide.is-active::after { opacity: 0; }

/* Subtle glow under active slide */
.carousel-slide.is-active::before {
    content: '';
    position: absolute;
    bottom: -15px;
    left: 15%;
    right: 15%;
    height: 30px;
    background: radial-gradient(ellipse, var(--accent-dim) 0%, transparent 70%);
    filter: blur(12px);
    z-index: -1;
    pointer-events: none;
}

/* Nav arrows */
.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: color-mix(in srgb, var(--bg) 85%, transparent);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--dur);
    z-index: 10;
    font-size: 0;
}

.carousel-btn::before {
    content: '';
    width: 8px;
    height: 8px;
    border-right: 1.5px solid currentColor;
    border-top: 1.5px solid currentColor;
}

.carousel-prev { left: max(12px, calc(50% - 430px)); }
.carousel-next { right: max(12px, calc(50% - 430px)); }
.carousel-prev::before { transform: rotate(-135deg); margin-left: 3px; }
.carousel-next::before { transform: rotate(45deg); margin-right: 3px; }

.carousel-btn:hover {
    color: var(--text);
    border-color: var(--border-hover);
    background: var(--bg-surface);
}

/* Dots */
.carousel-dots {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-top: 28px;
}

.carousel-dot {
    width: 6px;
    height: 6px;
    border-radius: 3px;
    background: var(--text-dim);
    border: none;
    padding: 0;
    cursor: pointer;
    transition: all 0.4s var(--ease);
}

.carousel-dot.active {
    background: var(--accent);
    width: 28px;
}

/* ============================================================
   FEATURES
   ============================================================ */
.features {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 70px 24px 60px;
    max-width: 1100px;
    margin: 0 auto;
    width: 100%;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
}

.feature-card {
    position: relative;
    overflow: hidden;
    background: color-mix(in srgb, var(--bg-surface) 40%, transparent);
    backdrop-filter: blur(24px) saturate(1.4);
    -webkit-backdrop-filter: blur(24px) saturate(1.4);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 28px 24px;
    transition: border-color var(--dur), transform 0.4s var(--ease), background var(--dur);
}

.feature-card:hover {
    border-color: color-mix(in srgb, var(--accent) 35%, transparent);
    transform: perspective(800px) rotateX(-1deg) translateY(-4px);
}

/* Watermark tag */
.feature-card[data-tag]::after {
    content: attr(data-tag);
    position: absolute;
    bottom: -12px;
    right: 4px;
    font-family: var(--font-display);
    font-size: 5.5rem;
    font-weight: 700;
    line-height: 1;
    color: var(--text);
    opacity: 0.025;
    pointer-events: none;
    user-select: none;
}

.feature-tag {
    display: inline-block;
    font-family: var(--font-mono);
    font-size: 0.66rem;
    font-weight: 600;
    color: var(--accent);
    letter-spacing: 0.08em;
    margin-bottom: 12px;
}

.feature-card h3 {
    font-family: var(--font-display);
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 8px;
    letter-spacing: -0.01em;
    transition: color var(--dur);
}

.feature-card p {
    font-size: 0.78rem;
    color: var(--text-secondary);
    line-height: 1.6;
    transition: color var(--dur);
}

/* ============================================================
   DOWNLOAD (includes footer)
   ============================================================ */
.download {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 80px 24px 0;
    text-align: center;
    position: relative;
}

.download-content {
    max-width: 600px;
    background: color-mix(in srgb, var(--bg-surface) 30%, transparent);
    backdrop-filter: blur(24px) saturate(1.4);
    -webkit-backdrop-filter: blur(24px) saturate(1.4);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 48px 40px;
    transition: background var(--dur), border-color var(--dur);
}

.download-price {
    font-family: var(--font-display);
    font-size: clamp(3rem, 8vw, 5.5rem);
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.03em;
    line-height: 1;
    margin: 16px 0 4px;
    transition: color var(--dur);
}

.download-price .price-num {
    display: inline-block;
    min-width: 1.6em;
    text-align: right;
}

.download-price .price-currency {
    font-family: 'Helvetica Neue', -apple-system, sans-serif;
    font-size: 0.38em;
    font-weight: 400;
    font-style: normal;
    color: var(--text-secondary);
    vertical-align: baseline;
    margin-left: 4px;
}

.download-desc {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 32px;
    transition: color var(--dur);
}

.download-tags {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin-top: 24px;
}

.download-tag {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    color: var(--text-dim);
    letter-spacing: 0.04em;
}

.download-tag + .download-tag::before {
    content: '\00b7';
    margin-right: 8px;
}

/* Footer pinned inside download section */
.footer {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    border-top: 1px solid var(--border);
    padding: 24px 32px;
    transition: border-color var(--dur);
}

.footer-inner {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: 10px;
}

.footer-icon {
    height: 18px;
    width: auto;
    opacity: 0.4;
    transition: opacity var(--dur);
}

.footer-copy {
    font-size: 0.75rem;
    color: var(--text-dim);
    transition: color var(--dur);
}

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

.footer-links a {
    font-size: 0.78rem;
    color: var(--text-dim);
    text-decoration: none;
    transition: color var(--dur);
}

.footer-links a:hover { color: var(--text-secondary); }

/* ============================================================
   ANIMATIONS
   ============================================================ */
.reveal {
    opacity: 0;
    transform: translateY(28px);
    transition: opacity 0.7s var(--ease-out), transform 0.7s var(--ease-out);
    transition-delay: calc(var(--d, 0) * 0.07s);
}

.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Scale variant for feature cards */
.reveal-scale {
    opacity: 0;
    transform: translateY(24px) scale(0.96);
    transition: opacity 0.6s var(--ease-out), transform 0.6s var(--ease-out);
    transition-delay: calc(var(--d, 0) * 0.06s);
}

.reveal-scale.visible {
    opacity: 1;
    transform: translateY(0) scale(1);
}

@keyframes fadeUp {
    from { opacity: 0; transform: translateY(24px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ============================================================
   MOBILE
   ============================================================ */
@media (max-width: 768px) {

    .nav { padding: 0 16px; height: 56px; }
    .nav-wordmark { display: none; }
    .nav-right { gap: 14px; }
    .nav-link { display: none; }

    /* Hero — center everything vertically */
    .hero {
        cursor: default;
        flex-direction: column;
        justify-content: center;
        padding: 56px 0 0;
        gap: 0;
    }
    .hero::before { width: 300px; height: 200px; top: 35%; }

    #flubber { display: none; }

    .hero-video {
        display: block;
        position: relative;
        top: auto;
        left: auto;
        transform: none;
        width: 85%;
        max-height: 36vh;
        object-fit: contain;
        z-index: 1;
        pointer-events: none;
        border-radius: var(--radius);
        border: 1px solid var(--border);
        margin: 0 auto 20px;
    }

    .hero-content {
        position: relative;
        margin-top: 0;
        gap: 10px;
    }
    .hero-fade { height: 40px; }
    .hero-title { font-size: clamp(2.5rem, 13vw, 4rem); }
    .hero-tagline { font-size: 0.85rem; margin-top: -10px; }
    .hero-badges { gap: 6px; margin-top: 16px; }
    .hero-badge { font-size: 0.6rem; padding: 4px 10px; }
    .hero-cta { margin-top: 0; }

    /* Showcase — centered, compact */
    .showcase {
        padding: 40px 0 20px;
    }
    .showcase .section-header { margin-bottom: 20px; }

    .carousel-stage { height: clamp(180px, 50vw, 300px); perspective: 1000px; }
    .carousel-slide { width: 78vw; }
    .carousel-btn { width: 36px; height: 36px; }
    .carousel-prev { left: 6px; }
    .carousel-next { right: 6px; }
    .carousel-dots { margin-top: 16px; }

    /* Features — 2 columns to fit in viewport */
    .features {
        padding: 40px 16px 20px;
    }
    .features-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .feature-card { padding: 16px 14px; }
    .feature-card h3 { font-size: 0.82rem; margin-bottom: 4px; }
    .feature-card p { font-size: 0.7rem; line-height: 1.45; }
    .feature-tag { font-size: 0.6rem; margin-bottom: 8px; }
    .feature-card[data-tag]::after { font-size: 3.5rem; }
    .section-header { margin-bottom: 20px; }

    /* Download — center content, footer at bottom */
    .download {
        padding: 40px 16px 0;
    }
    .download-content { padding: 32px 24px; }
    .download-price { font-size: clamp(2.5rem, 10vw, 4rem); }
    .download-desc { font-size: 0.82rem; margin-bottom: 24px; }
    .footer { position: absolute; bottom: 0; left: 0; right: 0; padding: 20px 16px; }
    .footer-inner { flex-direction: column; gap: 10px; }
}

@media (min-width: 769px) and (max-width: 1024px) {
    .features-grid { grid-template-columns: repeat(2, 1fr); }
}

/* Short viewports — compact features */
@media (max-height: 700px) and (min-width: 769px) {
    .features { padding: 50px 24px 40px; }
    .section-header { margin-bottom: 24px; }
    .feature-card { padding: 20px 20px; }
    .feature-card p { font-size: 0.72rem; }
    .hero-badges { display: none; }
}

/* --- Reduced motion --- */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
    .page { scroll-snap-type: none; }
    .reveal, .reveal-scale { opacity: 1; transform: none; }
    .hero-title span { opacity: 1; transform: none; }
}
