/* =============================================
   DESIGN SYSTEM
   ============================================= */
:root {
    /* Surfaces */
    --bg-deep: #070B14;
    --bg-surface: #0F1623;
    --bg-glass: rgba(255, 255, 255, 0.03);
    --bg-glass-hover: rgba(255, 255, 255, 0.06);

    /* Text */
    --text-primary: #F0F4F8;
    --text-secondary: #7B8FA3;
    --text-tertiary: #4A5568;

    /* Accent */
    --accent: #38BDF8;
    --accent-hover: #7DD3FC;
    --accent-glow: rgba(56, 189, 248, 0.15);
    --accent-glow-strong: rgba(56, 189, 248, 0.3);

    /* Borders */
    --border: rgba(255, 255, 255, 0.06);
    --border-hover: rgba(255, 255, 255, 0.12);

    /* Radius */
    --radius: 1.25rem;
    --radius-lg: 1.75rem;
    --radius-xl: 2.5rem;

    /* Fonts */
    --font-sans: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --font-serif: 'Playfair Display', Georgia, serif;
    --font-mono: 'JetBrains Mono', 'SF Mono', monospace;

    /* Feature themes */
    --ice-bath: #38BDF8;
    --ice-bath-glow: rgba(56, 189, 248, 0.08);
    --sauna: #FB923C;
    --sauna-glow: rgba(251, 146, 60, 0.08);
    --breathing: #4ADE80;
    --breathing-glow: rgba(74, 222, 128, 0.08);

    /* Legacy compat (auth page) */
    --primary-color: #38BDF8;
    --primary-dark: #0EA5E9;
    --error-color: #F87171;
    --success-color: #4ADE80;
    --card-bg: #0F1623;
    --border-color: rgba(255, 255, 255, 0.06);
    --muted-foreground: #7B8FA3;
    --bg-color: #070B14;
}

/* =============================================
   RESET & BASE
   ============================================= */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-sans);
    background-color: var(--bg-deep);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
}

/* =============================================
   NOISE OVERLAY
   ============================================= */
.noise-overlay {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
    opacity: 0.04;
}

/* =============================================
   NAVBAR — Floating Island
   ============================================= */
.navbar {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.navbar-inner {
    display: flex;
    align-items: center;
    gap: 32px;
    padding: 10px 24px;
    border-radius: 100px;
    background: transparent;
    border: 1px solid transparent;
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.navbar.scrolled .navbar-inner {
    background: rgba(7, 11, 20, 0.75);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-color: var(--border);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--text-primary);
    font-weight: 700;
    font-size: 15px;
    white-space: nowrap;
}

.nav-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
}

.nav-links {
    display: flex;
    gap: 24px;
}

.nav-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: color 0.2s, transform 0.2s;
}

.nav-links a:hover {
    color: var(--text-primary);
    transform: translateY(-1px);
}

/* =============================================
   LANDING CONTAINER
   ============================================= */
.landing-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* =============================================
   HERO SECTION
   ============================================= */
.hero-section {
    position: relative;
    text-align: center;
    padding: 160px 24px 0;
    max-width: 900px;
    width: 100%;
    overflow: visible;
}

/* Animated gradient glow blobs */
.hero-glow {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    pointer-events: none;
    will-change: transform;
}

.hero-glow-1 {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(56, 189, 248, 0.12) 0%, transparent 70%);
    top: -100px;
    left: -150px;
    animation: glow-drift 18s ease-in-out infinite;
}

.hero-glow-2 {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(14, 165, 233, 0.08) 0%, transparent 70%);
    top: 50px;
    right: -100px;
    animation: glow-drift 22s ease-in-out infinite reverse;
}

@keyframes glow-drift {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(30px, -20px) scale(1.05); }
    66% { transform: translate(-20px, 15px) scale(0.95); }
}

/* Hero content */
.hero-content {
    position: relative;
    z-index: 2;
}

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

.hero-section h1 {
    font-size: 58px;
    line-height: 1.08;
    margin-bottom: 28px;
    color: var(--text-primary);
}

.hero-line-sans {
    display: block;
    font-family: var(--font-sans);
    font-weight: 800;
    letter-spacing: -0.03em;
}

.hero-line-serif {
    display: block;
    font-family: var(--font-serif);
    font-weight: 700;
    font-style: italic;
    color: var(--accent);
    font-size: 1.15em;
    letter-spacing: -0.01em;
}

.hero-description {
    font-size: 17px;
    line-height: 1.7;
    color: var(--text-secondary);
    max-width: 480px;
    margin: 0 auto 36px;
}

/* Store badges */
.store-badges {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
}

.store-badge {
    position: relative;
    opacity: 0.6;
    transition: opacity 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    cursor: default;
}

.store-badge:hover {
    opacity: 0.85;
    transform: translateY(-2px);
}

.store-badge img {
    height: 48px;
    display: block;
}

.badge-overlay {
    position: absolute;
    top: -8px;
    right: -8px;
    background: var(--accent);
    color: var(--bg-deep);
    font-size: 10px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 100px;
    letter-spacing: 0.02em;
}

/* Mockup */
.mockup-wrapper {
    position: relative;
    display: flex;
    justify-content: center;
    margin: 72px auto 0;
    z-index: 2;
}

.mockup-glow {
    position: absolute;
    width: 300px;
    height: 400px;
    background: radial-gradient(ellipse, var(--accent-glow-strong) 0%, transparent 70%);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    filter: blur(80px);
    pointer-events: none;
    animation: pulse-glow 5s ease-in-out infinite;
}

@keyframes pulse-glow {
    0%, 100% { opacity: 0.5; transform: translate(-50%, -50%) scale(1); }
    50% { opacity: 0.8; transform: translate(-50%, -50%) scale(1.08); }
}

.mockup-container {
    position: relative;
    width: 280px;
}

.iphone-frame {
    width: 100%;
    z-index: 2;
    position: relative;
    pointer-events: none;
}

.app-screenshot {
    position: absolute;
    top: 3%;
    left: 4.5%;
    width: 91%;
    height: 94%;
    object-fit: cover;
    border-radius: 35px;
}

/* =============================================
   ETHOS SEPARATOR
   ============================================= */
.ethos {
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 80px 0;
    width: 100%;
    max-width: 600px;
}

.ethos p {
    font-family: var(--font-mono);
    font-size: 13px;
    font-weight: 400;
    color: var(--text-secondary);
    white-space: nowrap;
    letter-spacing: 0.04em;
    margin: 0;
}

.ethos-line {
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--border-hover), transparent);
}

/* =============================================
   FEATURES
   ============================================= */
.features {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
    padding-bottom: 96px;
    width: 100%;
}

.feature-item {
    background: var(--bg-glass);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 32px 28px;
    width: 320px;
    text-align: left;
    transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                box-shadow 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                border-color 0.4s,
                background 0.4s;
}

.feature-item:hover {
    transform: translateY(-6px);
    background: var(--bg-glass-hover);
    border-color: var(--border-hover);
}

.feature-icon-wrapper {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 24px;
    transition: box-shadow 0.4s;
}

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

/* Theme variants */
.feature-item[data-theme="ice-bath"] .feature-icon-wrapper {
    background: var(--ice-bath-glow);
    color: var(--ice-bath);
}
.feature-item[data-theme="ice-bath"]:hover {
    box-shadow: 0 16px 48px rgba(56, 189, 248, 0.08);
}

.feature-item[data-theme="sauna"] .feature-icon-wrapper {
    background: var(--sauna-glow);
    color: var(--sauna);
}
.feature-item[data-theme="sauna"]:hover {
    box-shadow: 0 16px 48px rgba(251, 146, 60, 0.08);
}

.feature-item[data-theme="breathing"] .feature-icon-wrapper {
    background: var(--breathing-glow);
    color: var(--breathing);
}
.feature-item[data-theme="breathing"]:hover {
    box-shadow: 0 16px 48px rgba(74, 222, 128, 0.08);
}

.feature-title {
    font-weight: 700;
    font-size: 18px;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.feature-item p {
    font-size: 15px;
    line-height: 1.65;
    color: var(--text-secondary);
    margin: 0;
}

/* =============================================
   FOOTER
   ============================================= */
footer {
    width: 100%;
    margin-top: auto;
    padding: 48px 0 32px;
    border-top: 1px solid var(--border);
}

.footer-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 15px;
    color: var(--text-primary);
}

.footer-icon {
    width: 28px;
    height: 28px;
    border-radius: 8px;
}

.footer-links {
    display: flex;
    gap: 28px;
    flex-wrap: wrap;
    justify-content: center;
}

.footer-links a {
    font-size: 13px;
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.2s;
}

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

.footer-bottom {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.footer-bottom p {
    font-size: 12px;
    color: var(--text-tertiary);
    margin: 0;
}

.footer-status {
    display: flex;
    align-items: center;
    gap: 6px;
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-tertiary);
}

.status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #4ADE80;
    animation: status-pulse 2s ease-in-out infinite;
}

@keyframes status-pulse {
    0%, 100% { opacity: 0.6; box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.4); }
    50% { opacity: 1; box-shadow: 0 0 0 4px rgba(74, 222, 128, 0); }
}

.status-text {
    letter-spacing: 0.04em;
}

/* =============================================
   BUTTONS
   ============================================= */
.btn {
    display: inline-block;
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, var(--accent) 0%, var(--primary-dark) 100%);
    color: white;
    padding: 14px 24px;
    border-radius: 100px;
    text-decoration: none;
    font-weight: 700;
    font-size: 16px;
    border: none;
    cursor: pointer;
    transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                box-shadow 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    box-shadow: 0 4px 16px rgba(56, 189, 248, 0.25);
    width: 100%;
    text-align: center;
}

.btn:hover {
    transform: scale(1.03) translateY(-1px);
    box-shadow: 0 8px 28px rgba(56, 189, 248, 0.35);
}

.btn:active {
    transform: scale(0.98);
}

/* =============================================
   SCROLL REVEAL
   ============================================= */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                transform 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    transition-delay: var(--delay, 0s);
}

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

/* =============================================
   AUTH PAGE
   ============================================= */
.container {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 48px 32px;
    max-width: 400px;
    width: 100%;
    text-align: center;
    box-shadow: 0 4px 24px -4px rgba(0, 0, 0, 0.3);
    animation: fadeInUp 0.4s ease-out;
    margin: auto;
}

.branding {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 24px;
}

.app-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.app-name {
    font-size: 24px;
    font-weight: 700;
    background: linear-gradient(90deg, var(--accent), var(--accent-hover));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.branding-text {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
}

.app-subtitle {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    letter-spacing: 0.02em;
}

h1 {
    font-size: 28px;
    margin-bottom: 16px;
    font-weight: 800;
    line-height: 1.2;
    color: var(--text-primary);
}

h2 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 32px;
    color: var(--text-secondary);
}

p {
    color: var(--text-secondary);
    margin-bottom: 24px;
    line-height: 1.6;
    font-size: 16px;
}

.hidden {
    display: none;
}

.status-badge {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 24px;
}

.status-badge.success {
    background: linear-gradient(135deg, var(--accent) 0%, var(--primary-dark) 100%);
    color: white;
    box-shadow: 0 8px 24px rgba(56, 189, 248, 0.3);
}

.status-badge.error {
    background: linear-gradient(135deg, #F87171 0%, #EF4444 100%);
    color: white;
    box-shadow: 0 8px 24px rgba(248, 113, 113, 0.3);
}

.status-svg {
    width: 28px;
    height: 28px;
}

.loader {
    width: 48px;
    height: 48px;
    border: 3px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s cubic-bezier(0.5, 0.1, 0.5, 0.9) infinite;
    margin: 0 auto 24px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

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

#success,
#error {
    animation: fadeInUp 0.4s ease-out;
}

/* =============================================
   LEGAL PAGES
   ============================================= */
.legal-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 24px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.legal-container .branding {
    justify-content: flex-start;
    padding-top: 16px;
}

.branding-link {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
}

.legal-content {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 48px 40px;
    box-shadow: 0 4px 24px -4px rgba(0, 0, 0, 0.3);
    flex: 1;
}

.legal-content h1 {
    font-size: 32px;
    margin-bottom: 8px;
}

.legal-date {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 32px;
}

.legal-content h2 {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    margin-top: 32px;
    margin-bottom: 12px;
}

.legal-content h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-top: 20px;
    margin-bottom: 8px;
}

.legal-content p {
    font-size: 15px;
    line-height: 1.7;
    margin-bottom: 16px;
}

.legal-content ul {
    padding-left: 24px;
    margin-bottom: 16px;
}

.legal-content li {
    font-size: 15px;
    line-height: 1.7;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.legal-content a {
    color: var(--accent);
    text-decoration: none;
    font-weight: 600;
}

.legal-content a:hover {
    text-decoration: underline;
}

.deletion-cta {
    max-width: 320px;
    margin: 32px 0;
}

.deletion-cta .btn {
    color: white;
    font-weight: 700;
    text-decoration: none;
}

.deletion-cta .btn:hover {
    text-decoration: none;
}

.legal-container footer {
    text-align: center;
    padding: 24px 0;
    border-top: 1px solid var(--border);
    margin-top: 32px;
}

.legal-container footer p {
    font-size: 12px;
    color: var(--text-tertiary);
    margin: 0;
}

.legal-container .footer-links {
    display: flex;
    gap: 24px;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.legal-container .footer-links a {
    font-size: 13px;
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.2s;
}

.legal-container .footer-links a:hover {
    color: var(--accent);
}

/* =============================================
   RESPONSIVE
   ============================================= */
@media (max-width: 768px) {
    .navbar-inner {
        padding: 8px 16px;
    }

    .nav-links {
        display: none;
    }

    .hero-section {
        padding: 120px 16px 0;
    }

    .hero-section h1 {
        font-size: 40px;
    }

    .hero-description {
        font-size: 15px;
    }

    .features {
        flex-direction: column;
        align-items: center;
    }

    .feature-item {
        width: 100%;
        max-width: 400px;
    }

    .ethos {
        padding: 48px 0;
    }

    .hero-glow-1 {
        width: 300px;
        height: 300px;
        left: -100px;
    }

    .hero-glow-2 {
        width: 250px;
        height: 250px;
    }
}

@media (max-width: 480px) {
    .hero-section h1 {
        font-size: 34px;
    }

    .mockup-container {
        width: 240px;
    }

    .legal-content {
        padding: 32px 20px;
    }

    .legal-content h1 {
        font-size: 26px;
    }
}
