/* ===== DESIGN TOKENS ===== */
:root {
    /* Colors — shared across themes */
    --primary: #534AB7;
    --primary-hover: #3C3489;
    --secondary: #7F77DD;
    --accent: #E8593C;
    --green: #059669;
    --orange: #F59E0B;
    --teal: #14B8A6;

    /* Spacing — 8dp system */
    --space-xs: 0.25rem;   /* 4px */
    --space-sm: 0.5rem;    /* 8px */
    --space-md: 1rem;      /* 16px */
    --space-lg: 1.5rem;    /* 24px */
    --space-xl: 2rem;      /* 32px */
    --space-2xl: 3rem;     /* 48px */
    --space-3xl: 4rem;     /* 64px */
    --space-4xl: 6rem;     /* 96px */

    /* Radii */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --radius-full: 999px;

    /* Typography — Inter confirmed by design system */
    --font: 'Inter', system-ui, -apple-system, sans-serif;

    /* Transitions — 150-300ms per UX guidelines */
    --ease: cubic-bezier(0.4, 0, 0.2, 1);
    --duration: 200ms;
    --duration-slow: 300ms;

    /* Layout */
    --max-w: 1140px;
    --nav-h: 4rem;
}

/* ===== LIGHT THEME ===== */
[data-theme="light"] {
    --primary-light: rgba(83, 74, 183, 0.08);
    --secondary-light: rgba(127, 119, 221, 0.10);
    --accent-light: rgba(232, 89, 60, 0.10);
    --green-light: rgba(5, 150, 105, 0.10);
    --orange-light: rgba(245, 158, 11, 0.10);
    --teal-light: rgba(20, 184, 166, 0.10);

    --bg: #FAFAFF;
    --bg-white: #FFFFFF;
    --text: #0F172A;
    --text-muted: #64748B;
    --border: #E8E5F5;
    --card: #FFFFFF;
    --card-hover-shadow: rgba(83, 74, 183, 0.08);
    --nav-bg: rgba(250, 250, 255, 0.85);
    --screenshot-shadow: rgba(26, 26, 46, 0.15);
}

/* ===== DARK THEME (default) ===== */
[data-theme="dark"] {
    --primary-light: rgba(83, 74, 183, 0.15);
    --secondary-light: rgba(127, 119, 221, 0.15);
    --accent-light: rgba(232, 89, 60, 0.15);
    --green-light: rgba(5, 150, 105, 0.15);
    --orange-light: rgba(245, 158, 11, 0.15);
    --teal-light: rgba(20, 184, 166, 0.15);

    --bg: #0F1117;
    --bg-white: #181A20;
    --text: #E8E6F0;
    --text-muted: #94929E;
    --border: rgba(255, 255, 255, 0.08);
    --card: #1C1E26;
    --card-hover-shadow: rgba(83, 74, 183, 0.15);
    --nav-bg: rgba(15, 17, 23, 0.85);
    --screenshot-shadow: rgba(0, 0, 0, 0.35);
}

/* ===== RESET ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html {
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--nav-h) + var(--space-lg));
}
body {
    font-family: var(--font);
    font-size: 1rem;
    line-height: 1.6;
    color: var(--text);
    background: var(--bg);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { cursor: pointer; border: none; background: none; font: inherit; }

/* ===== LAYOUT ===== */
.container {
    max-width: var(--max-w);
    margin: 0 auto;
    padding: 0 var(--space-lg);
}

/* ===== SECTION HEADER ===== */
.section-header { margin-bottom: var(--space-3xl); }
.section-label {
    display: inline-block;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--primary);
    margin-bottom: var(--space-sm);
}
.section-title {
    font-size: clamp(1.75rem, 4vw, 2.75rem);
    font-weight: 800;
    line-height: 1.12;
    color: var(--text);
    margin-bottom: var(--space-md);
}
.section-desc {
    font-size: 1.1rem;
    color: var(--text-muted);
    max-width: 540px;
    line-height: 1.65;
}

/* ===== BUTTONS — min 44px touch target ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    min-height: 44px;
    padding: 0.65rem 1.5rem;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.95rem;
    line-height: 1.4;
    cursor: pointer;
    transition: all var(--duration) var(--ease);
    border: 2px solid transparent;
    text-align: center;
}
.btn:focus-visible {
    outline: 3px solid var(--secondary);
    outline-offset: 2px;
}
.btn:disabled,
.btn[aria-disabled="true"] {
    cursor: not-allowed;
    opacity: 0.7;
    transform: none;
    box-shadow: none;
}
.btn svg { flex-shrink: 0; }

.btn--primary {
    background: var(--primary);
    color: #fff;
}
.btn--primary:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(83, 74, 183, 0.3);
}

.btn--outline {
    background: transparent;
    color: var(--primary);
    border-color: var(--border);
}
.btn--outline:hover {
    border-color: var(--primary);
    background: var(--primary-light);
}

.btn--white {
    background: #fff;
    color: var(--primary);
}
.btn--white:hover {
    background: #f0eeff;
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(255, 255, 255, 0.25);
}

.btn--sm { min-height: 40px; padding: 0.4rem 1rem; font-size: 0.875rem; }
.btn--lg { min-height: 48px; padding: 0.8rem 2rem; font-size: 1.05rem; }

/* ===== NAV ===== */
.nav {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 100;
    height: var(--nav-h);
    background: var(--nav-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    transition: box-shadow var(--duration) var(--ease);
}
.nav--scrolled {
    box-shadow: 0 1px 12px rgba(0, 0, 0, 0.06);
}
.nav__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
    max-width: var(--max-w);
    margin: 0 auto;
    padding: 0 var(--space-lg);
}
.nav__logo {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--text);
}
.nav__icon { flex-shrink: 0; }
.nav__links {
    display: flex;
    align-items: center;
    gap: var(--space-lg);
}
.nav__links a:not(.btn) {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-muted);
    transition: color var(--duration) var(--ease);
    padding: var(--space-xs) 0;
}
.nav__links a:not(.btn):hover { color: var(--primary); }
.nav__links a:not(.btn):focus-visible {
    outline: 2px solid var(--secondary);
    outline-offset: 4px;
    border-radius: 2px;
}

/* Mobile actions (burger + theme toggle for small screens) */
.nav__mobile-actions {
    display: none;
    align-items: center;
    gap: var(--space-xs);
}
.theme-toggle--mobile { display: none; }

.nav__burger {
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding: 8px;
    min-width: 44px;
    min-height: 44px;
    align-items: center;
    justify-content: center;
}
.nav__burger span {
    display: block;
    width: 22px;
    height: 2px;
    background: currentColor;
    border-radius: 2px;
    transition: all var(--duration-slow) var(--ease);
}
.nav__burger.active span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav__burger.active span:nth-child(2) { opacity: 0; }
.nav__burger.active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Mobile menu */
.mobile-menu {
    display: none;
    position: fixed;
    top: var(--nav-h);
    left: 0; right: 0;
    z-index: 99;
    background: var(--bg-white);
    padding: var(--space-lg);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    gap: var(--space-md);
    box-shadow: 0 8px 24px var(--screenshot-shadow);
}
.mobile-menu.open { display: flex; }
.mobile-menu a {
    font-size: 1rem;
    font-weight: 500;
    color: var(--text);
    padding: var(--space-sm) 0;
    min-height: 44px;
    display: flex;
    align-items: center;
}

/* ===== PRE-LAUNCH NOTICE ===== */
.prelaunch {
    margin-top: var(--nav-h);
    padding: var(--space-md) 0;
    background: var(--bg-white);
    border-bottom: 1px solid var(--border);
}
.prelaunch__inner {
    display: flex;
    gap: var(--space-sm);
    align-items: flex-start;
    font-size: 0.92rem;
    color: var(--text-muted);
}
.prelaunch__inner strong {
    color: var(--accent);
    font-weight: 700;
    letter-spacing: 0.01em;
    flex-shrink: 0;
}

/* ===== HERO ===== */
.hero {
    padding: var(--space-3xl) 0 var(--space-4xl);
    background:
        radial-gradient(ellipse 80% 50% at 70% 20%, var(--primary-light), transparent),
        radial-gradient(ellipse 50% 40% at 20% 80%, var(--accent-light), transparent),
        var(--bg);
}
.hero__grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-3xl);
    align-items: center;
}
.hero__badge {
    display: inline-flex;
    gap: var(--space-sm);
    padding: 0.35rem 0.9rem;
    border-radius: var(--radius-full);
    background: var(--primary-light);
    color: var(--primary);
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: var(--space-lg);
}
.hero__title {
    font-size: clamp(2.25rem, 5vw, 3.5rem);
    font-weight: 800;
    line-height: 1.08;
    color: var(--text);
    margin-bottom: var(--space-lg);
}
.hero__accent {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 50%, var(--accent) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.hero__sub {
    font-size: 1.15rem;
    color: var(--text-muted);
    line-height: 1.7;
    margin-bottom: var(--space-xl);
    max-width: 480px;
}
.hero__actions {
    display: flex;
    gap: var(--space-md);
    flex-wrap: wrap;
}

/* ===== HERO SCREENSHOT ===== */
.hero__visual { display: flex; justify-content: center; }
.hero__screenshot {
    width: 100%;
    max-width: 560px;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow:
        0 24px 64px var(--screenshot-shadow),
        0 0 0 1px rgba(255, 255, 255, 0.04) inset;
}
.hero__screenshot img {
    width: 100%;
    height: auto;
    display: block;
}

/* ===== FEATURES — BENTO BOX GRID ===== */
.features {
    padding: var(--space-4xl) 0;
    background: var(--bg-white);
}
.bento {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-lg);
}
.bento__card {
    padding: var(--space-xl);
    border-radius: var(--radius-lg);
    background: var(--bg);
    border: 1px solid var(--border);
    transition: all var(--duration) var(--ease);
}
.bento__card:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 32px var(--card-hover-shadow);
    border-color: rgba(83, 74, 183, 0.12);
}
.bento__card:focus-within {
    outline: 2px solid var(--secondary);
    outline-offset: 2px;
}

/* Bento sizes */
.bento__card--lg { grid-column: span 2; }
.bento__card--md { grid-column: span 1; }
.bento__card--sm { grid-column: span 1; }
.bento__card--wide { grid-column: span 3; }

.bento__icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: var(--space-md);
}
.bento__icon svg { width: 22px; height: 22px; }
.bento__icon--primary { background: var(--primary-light); color: var(--primary); }
.bento__icon--secondary { background: var(--secondary-light); color: var(--secondary); }
.bento__icon--accent { background: var(--accent-light); color: var(--accent); }
.bento__icon--green { background: var(--green-light); color: var(--green); }
.bento__icon--orange { background: var(--orange-light); color: var(--orange); }
.bento__icon--teal { background: var(--teal-light); color: var(--teal); }

.bento__card h3 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: var(--space-sm);
    color: var(--text);
}
.bento__card p {
    font-size: 0.92rem;
    color: var(--text-muted);
    line-height: 1.65;
}

/* ===== EINBLICKE ===== */
.einblicke {
    padding: var(--space-4xl) 0;
    background: var(--bg);
}
.tabs {
    display: flex;
    gap: var(--space-sm);
    margin-bottom: var(--space-xl);
    flex-wrap: wrap;
}
.tabs__btn {
    padding: 0.55rem 1.25rem;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-muted);
    background: transparent;
    border: 1px solid var(--border);
    transition: all var(--duration) var(--ease);
    min-height: 44px;
}
.tabs__btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}
.tabs__btn:focus-visible {
    outline: 2px solid var(--secondary);
    outline-offset: 2px;
}
.tabs__btn.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

.panel { display: none; }
.panel.active { display: block; animation: panelIn var(--duration-slow) var(--ease); }
@keyframes panelIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.panel__screenshot {
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: 0 16px 48px var(--screenshot-shadow);
}
.panel__screenshot img {
    width: 100%;
    height: auto;
    display: block;
}

/* ===== TECHNIK ===== */
.technik {
    padding: var(--space-4xl) 0;
    background: var(--bg-white);
}
.technik__grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-3xl);
    align-items: center;
}
.technik__cards {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-md);
}
.tech-card {
    padding: var(--space-lg);
    border-radius: var(--radius-md);
    background: var(--bg);
    border: 1px solid var(--border);
    transition: all var(--duration) var(--ease);
}
.tech-card:hover {
    border-color: rgba(83, 74, 183, 0.15);
    transform: translateY(-2px);
}
.tech-card__label {
    display: block;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    margin-bottom: var(--space-xs);
}
.tech-card__value {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text);
}

/* ===== CTA ===== */
.cta {
    padding: var(--space-4xl) 0;
    background: var(--bg);
}
.cta__card {
    text-align: center;
    padding: var(--space-3xl) var(--space-xl);
    border-radius: var(--radius-xl);
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 50%, var(--accent) 100%);
    color: #fff;
    position: relative;
    overflow: hidden;
}
.cta__card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at 30% 0%, rgba(255, 255, 255, 0.12), transparent 60%);
    pointer-events: none;
}
.cta__card > * { position: relative; }
.cta__title {
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    font-weight: 800;
    margin-bottom: var(--space-sm);
}
.cta__sub {
    font-size: 1.1rem;
    opacity: 0.9;
    margin-bottom: var(--space-lg);
}
.cta__meta {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
    font-size: 0.85rem;
    opacity: 0.7;
    margin-bottom: var(--space-xl);
    flex-wrap: wrap;
}
.cta__version {
    margin-top: var(--space-lg);
    font-size: 0.8rem;
    opacity: 0.55;
}

/* ===== LEGAL ===== */
.legal {
    padding: var(--space-4xl) 0;
    background: var(--bg-white);
}
.legal__grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-lg);
}
.legal__card {
    padding: var(--space-xl);
    border-radius: var(--radius-lg);
    background: var(--bg);
    border: 1px solid var(--border);
}
.legal__title {
    font-size: 1.35rem;
    font-weight: 700;
    margin-bottom: var(--space-sm);
    color: var(--text);
}
.legal__text {
    color: var(--text-muted);
    line-height: 1.7;
}

/* ===== FOOTER ===== */
.footer {
    padding: var(--space-xl) 0;
    border-top: 1px solid var(--border);
    background: var(--bg-white);
}
.footer__inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--space-md);
}
.footer__brand {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}
.footer__copy {
    font-size: 0.85rem;
    color: var(--text-muted);
}
.footer__nav {
    display: flex;
    gap: var(--space-lg);
}
.footer__nav a {
    font-size: 0.9rem;
    color: var(--text-muted);
    transition: color var(--duration) var(--ease);
    min-height: 44px;
    display: flex;
    align-items: center;
}
.footer__nav a:hover { color: var(--primary); }
.footer__nav a:focus-visible {
    outline: 2px solid var(--secondary);
    outline-offset: 4px;
    border-radius: 2px;
}

/* ===== SCROLL REVEAL ===== */
.reveal {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s var(--ease), transform 0.5s var(--ease);
}
.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Stagger bento cards */
.bento__card:nth-child(2).reveal { transition-delay: 0.08s; }
.bento__card:nth-child(3).reveal { transition-delay: 0.16s; }
.bento__card:nth-child(4).reveal { transition-delay: 0.08s; }
.bento__card:nth-child(5).reveal { transition-delay: 0.16s; }
.bento__card:nth-child(6).reveal { transition-delay: 0.24s; }

/* Stagger tech cards */
.tech-card:nth-child(2).reveal { transition-delay: 0.06s; }
.tech-card:nth-child(3).reveal { transition-delay: 0.12s; }
.tech-card:nth-child(4).reveal { transition-delay: 0.18s; }
.tech-card:nth-child(5).reveal { transition-delay: 0.24s; }
.tech-card:nth-child(6).reveal { transition-delay: 0.30s; }

/* ===== THEME TOGGLE ===== */
.theme-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    transition: color var(--duration) var(--ease), background var(--duration) var(--ease);
}
.theme-toggle:hover {
    color: var(--primary);
    background: var(--primary-light);
}
.theme-toggle:focus-visible {
    outline: 2px solid var(--secondary);
    outline-offset: 2px;
}

/* Show sun in dark mode, moon in light mode */
[data-theme="dark"] .theme-toggle__sun { display: block; }
[data-theme="dark"] .theme-toggle__moon { display: none; }
[data-theme="light"] .theme-toggle__sun { display: none; }
[data-theme="light"] .theme-toggle__moon { display: block; }

/* Dark mode CTA gradient adjustment */
[data-theme="dark"] .cta__card {
    background: linear-gradient(135deg, var(--primary) 0%, #3C3489 50%, var(--accent) 100%);
}

/* Dark mode outline button */
[data-theme="dark"] .btn--outline {
    color: var(--secondary);
    border-color: rgba(255, 255, 255, 0.12);
}
[data-theme="dark"] .btn--outline:hover {
    border-color: var(--secondary);
    background: var(--secondary-light);
}

/* Dark mode nav scroll shadow */
[data-theme="dark"] .nav--scrolled {
    box-shadow: 0 1px 12px rgba(0, 0, 0, 0.2);
}

/* Dark mode hero gradient text stays visible */
[data-theme="dark"] .hero__accent {
    background: linear-gradient(135deg, var(--secondary) 0%, #A9A3F0 50%, var(--accent) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ===== REDUCED MOTION ===== */
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    .reveal {
        opacity: 1;
        transform: none;
        transition: none;
    }
    .panel.active { animation: none; }
    .btn:hover { transform: none; }
    .bento__card:hover, .tech-card:hover { transform: none; }
}

/* ===== RESPONSIVE ===== */

/* Tablet */
@media (max-width: 1024px) {
    .hero__grid {
        grid-template-columns: 1fr;
        text-align: center;
    }
    .hero__sub { max-width: 100%; margin-left: auto; margin-right: auto; }
    .hero__actions { justify-content: center; }
    .hero__visual { margin-top: var(--space-xl); }
    .mockup { max-width: 420px; }

    .bento {
        grid-template-columns: repeat(2, 1fr);
    }
    .bento__card--lg { grid-column: span 2; }
    .bento__card--wide { grid-column: span 2; }

    .technik__grid { grid-template-columns: 1fr; }
    .technik__text { text-align: center; }
    .technik__text .section-desc { margin-left: auto; margin-right: auto; }
}

/* Mobile */
@media (max-width: 640px) {
    :root {
        --space-lg: 1.25rem;
        --space-4xl: 4rem;
    }

    .nav__links { display: none; }
    .nav__mobile-actions { display: flex; }
    .theme-toggle--mobile { display: flex; }

    .hero__title { font-size: 2rem; }
    .mockup { max-width: 300px; }

    .bento { grid-template-columns: 1fr; }
    .bento__card--lg,
    .bento__card--md,
    .bento__card--sm,
    .bento__card--wide { grid-column: span 1; }

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

    .tabs { justify-content: center; }
    .tabs__btn { padding: 0.5rem 1rem; font-size: 0.85rem; }

    .prelaunch__inner {
        flex-direction: column;
        gap: var(--space-xs);
    }

    .cta__card { padding: var(--space-2xl) var(--space-lg); }
    .legal__grid { grid-template-columns: 1fr; }

    .footer__inner { flex-direction: column; text-align: center; }
    .footer__brand { align-items: center; }
    .footer__nav { justify-content: center; }
}

/* Small phone */
@media (max-width: 375px) {
    .hero__actions { flex-direction: column; align-items: stretch; }
    .hero__badge { font-size: 0.7rem; }
}
