/* ═══════════════════════════════════════════════════════════════════════
   Forma — Showcase Landing Page
   ═══════════════════════════════════════════════════════════════════════ */

/* ── Fonts ──────────────────────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@300;400;500;600;700&family=Space+Grotesk:wght@400;500;600;700&display=swap');

/* ── Design Tokens ──────────────────────────────────────────────────── */
:root {
    --bg-deep: #030609;
    --bg-section: #071118;
    --bg-card: rgba(7, 17, 24, 0.65);
    --accent: #4ee8ff;
    --accent-glow: rgba(78, 232, 255, 0.25);
    --accent-dim: rgba(78, 232, 255, 0.1);
    --text-primary: #eef7ff;
    --text-secondary: rgba(214, 232, 248, 0.55);
    --surface: rgba(7, 17, 24, 0.8);
    --border: rgba(78, 232, 255, 0.12);
    --border-hover: rgba(78, 232, 255, 0.4);
    --font-display: 'Space Grotesk', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
    --radius: 12px;
    --radius-lg: 18px;
    --blur: 20px;
    --ease: cubic-bezier(0.2, 0.7, 0.2, 1);

    /* Theme palette tokens for gallery */
    --lab-accent: #4ee8ff;
    --lab-bg: #071118;
    --ember-accent: #ff9f43;
    --ember-bg: #140805;
    --bio-accent: #66ffb3;
    --bio-bg: #07140f;
    --mono-accent: #f3f3f3;
    --mono-bg: #0d0d0d;
}

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

html {
    scroll-behavior: smooth;
    scrollbar-width: thin;
    scrollbar-color: var(--accent-dim) transparent;
}

body {
    background: var(--bg-deep);
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: 15px;
    line-height: 1.7;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--accent-dim); border-radius: 3px; }

img { max-width: 100%; display: block; }
a { color: var(--accent); text-decoration: none; transition: opacity 0.2s; }
a:hover { opacity: 0.8; }

/* ── Shared ─────────────────────────────────────────────────────────── */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

.section {
    padding: 120px 0;
    position: relative;
}

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

.section-title {
    font-family: var(--font-display);
    font-size: clamp(28px, 5vw, 48px);
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 16px;
    line-height: 1.15;
}

.section-desc {
    font-size: 14px;
    color: var(--text-secondary);
    max-width: 560px;
    line-height: 1.8;
}

/* ── Reveal Animations ─────────────────────────────────────────────── */
.reveal {
    opacity: 0;
    transform: translateY(32px);
    transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}

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

.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }
.reveal-delay-4 { transition-delay: 0.4s; }
.reveal-delay-5 { transition-delay: 0.5s; }

@media (prefers-reduced-motion: reduce) {
    .reveal { opacity: 1; transform: none; transition: none; }
}

/* ═══════════════════════════════════════════════════════════════════════
   SECTION 1 — HERO
   ═══════════════════════════════════════════════════════════════════════ */
.hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    overflow: hidden;
}

#hero-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    opacity: 0.45;
}

.hero-overlay {
    position: absolute;
    inset: 0;
    z-index: 1;
    background:
        radial-gradient(ellipse at 50% 30%, rgba(78, 232, 255, 0.06) 0%, transparent 60%),
        linear-gradient(180deg, rgba(3, 6, 9, 0.3) 0%, rgba(3, 6, 9, 0.7) 70%, var(--bg-deep) 100%);
}

.hero-content {
    position: relative;
    z-index: 2;
    padding: 0 24px;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 16px;
    border: 1px solid var(--border);
    border-radius: 999px;
    font-size: 11px;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--text-secondary);
    margin-bottom: 32px;
    backdrop-filter: blur(12px);
    background: rgba(7, 17, 24, 0.5);
}

.hero-badge .dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent);
    animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {
    0%, 100% { opacity: 0.4; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.4); }
}

.hero h1 {
    font-family: var(--font-display);
    font-size: clamp(48px, 10vw, 96px);
    font-weight: 700;
    letter-spacing: clamp(8px, 2vw, 24px);
    color: var(--text-primary);
    text-shadow: 0 0 80px var(--accent-glow), 0 0 160px rgba(78, 232, 255, 0.08);
    margin-bottom: 16px;
    line-height: 1;
}

.hero-sub {
    font-family: var(--font-display);
    font-size: clamp(14px, 2.5vw, 20px);
    font-weight: 400;
    color: var(--text-secondary);
    letter-spacing: 2px;
    margin-bottom: 48px;
}

.hero-ctas {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
}

.btn-primary, .btn-ghost {
    font-family: var(--font-display);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 1.5px;
    padding: 14px 32px;
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.25s var(--ease);
    text-transform: uppercase;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

.btn-primary {
    background: var(--accent);
    color: var(--bg-deep);
    border: 1px solid var(--accent);
    box-shadow: 0 0 24px var(--accent-glow), 0 4px 16px rgba(0,0,0,0.3);
}

.btn-primary:hover {
    opacity: 1;
    transform: translateY(-2px);
    box-shadow: 0 0 40px var(--accent-glow), 0 8px 24px rgba(0,0,0,0.4);
}

.btn-ghost {
    background: transparent;
    color: var(--text-primary);
    border: 1px solid var(--border);
    backdrop-filter: blur(12px);
}

.btn-ghost:hover {
    opacity: 1;
    border-color: var(--accent);
    color: var(--accent);
    transform: translateY(-2px);
    background: var(--accent-dim);
}

.scroll-hint {
    position: absolute;
    bottom: 32px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
    font-size: 10px;
    letter-spacing: 3px;
    text-transform: uppercase;
    animation: float-hint 2.5s ease-in-out infinite;
}

.scroll-hint svg {
    width: 20px;
    height: 20px;
    stroke: var(--accent);
    opacity: 0.6;
}

@keyframes float-hint {
    0%, 100% { transform: translateX(-50%) translateY(0); }
    50% { transform: translateX(-50%) translateY(8px); }
}

/* ═══════════════════════════════════════════════════════════════════════
   SECTION 2 — FEATURES
   ═══════════════════════════════════════════════════════════════════════ */
.features-section {
    background: var(--bg-section);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

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

.feature-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 32px 28px;
    backdrop-filter: blur(var(--blur));
    transition: all 0.35s var(--ease);
    position: relative;
    overflow: hidden;
}

.feature-card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: var(--radius-lg);
    background: radial-gradient(circle at 30% 20%, var(--accent-dim), transparent 60%);
    opacity: 0;
    transition: opacity 0.35s var(--ease);
}

.feature-card:hover {
    border-color: var(--border-hover);
    transform: translateY(-4px);
    box-shadow: 0 16px 48px rgba(0,0,0,0.3), 0 0 24px var(--accent-glow);
}

.feature-card:hover::before { opacity: 1; }

.feature-icon {
    position: relative;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    color: var(--accent);
}

.feature-icon svg {
    width: 28px;
    height: 28px;
    stroke: var(--accent);
    fill: none;
    stroke-width: 1.5;
}

.feature-card h3 {
    font-family: var(--font-display);
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
    position: relative;
}

.feature-card p {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.7;
    position: relative;
}

/* ═══════════════════════════════════════════════════════════════════════
   SECTION 3 — THEME GALLERY
   ═══════════════════════════════════════════════════════════════════════ */
.themes-section {
    background: var(--bg-deep);
}

.theme-tabs {
    display: flex;
    gap: 4px;
    margin-top: 40px;
    margin-bottom: 32px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    max-width: 480px;
}

.theme-tab {
    flex: 1;
    padding: 12px 16px;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-family: var(--font-display);
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.25s var(--ease);
    position: relative;
}

.theme-tab:hover { color: var(--text-primary); background: var(--accent-dim); }

.theme-tab.active {
    background: var(--accent);
    color: var(--bg-deep);
    font-weight: 600;
}

.theme-display {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
    align-items: center;
}

.theme-preview {
    aspect-ratio: 16 / 10;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    overflow: hidden;
    position: relative;
    background: var(--bg-section);
}

.theme-preview-inner {
    position: absolute;
    inset: 0;
    transition: opacity 0.5s var(--ease);
}

.theme-preview-inner.hidden { opacity: 0; }

/* Theme color previews via CSS gradients */
.theme-preview-inner[data-theme="lab"] {
    background: radial-gradient(circle at 30% 40%, rgba(78, 232, 255, 0.3), transparent 50%),
                radial-gradient(circle at 70% 60%, rgba(56, 154, 255, 0.2), transparent 40%),
                repeating-linear-gradient(0deg, transparent, transparent 3px, rgba(78, 232, 255, 0.04) 3px, rgba(78, 232, 255, 0.04) 4px),
                var(--lab-bg);
}

.theme-preview-inner[data-theme="ember"] {
    background: radial-gradient(circle at 40% 50%, rgba(255, 144, 61, 0.35), transparent 50%),
                radial-gradient(circle at 80% 30%, rgba(255, 80, 20, 0.2), transparent 40%),
                repeating-linear-gradient(135deg, transparent, transparent 10px, rgba(255, 164, 77, 0.05) 10px, rgba(255, 164, 77, 0.05) 12px),
                var(--ember-bg);
}

.theme-preview-inner[data-theme="bio"] {
    background: radial-gradient(circle at 35% 45%, rgba(102, 255, 179, 0.3), transparent 50%),
                radial-gradient(circle at 75% 55%, rgba(158, 255, 102, 0.2), transparent 40%),
                radial-gradient(circle at 12px 12px, rgba(104, 255, 171, 0.08) 1px, transparent 1.2px),
                var(--bio-bg);
    background-size: 100% 100%, 100% 100%, 24px 24px, 100% 100%;
}

.theme-preview-inner[data-theme="mono"] {
    background: radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.08), transparent 60%),
                repeating-linear-gradient(0deg, transparent, transparent 15px, rgba(255, 255, 255, 0.025) 15px, rgba(255, 255, 255, 0.025) 16px),
                var(--mono-bg);
}

/* Simulated cells overlay */
.theme-preview-inner::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        radial-gradient(circle 2px, currentColor 0.8px, transparent 1px);
    background-size: 8px 8px;
    background-position: 2px 2px;
    opacity: 0.25;
    mask-image: radial-gradient(ellipse at 50% 50%, black 20%, transparent 70%);
    -webkit-mask-image: radial-gradient(ellipse at 50% 50%, black 20%, transparent 70%);
}

.theme-info h3 {
    font-family: var(--font-display);
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 8px;
    transition: color 0.4s var(--ease);
}

.theme-info .theme-tagline {
    font-size: 14px;
    font-style: italic;
    color: var(--text-secondary);
    margin-bottom: 20px;
    transition: color 0.4s var(--ease);
}

.theme-info p {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.8;
}

.theme-palette {
    display: flex;
    gap: 8px;
    margin-top: 20px;
}

.theme-swatch {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    border: 1px solid rgba(255,255,255,0.1);
}

/* ═══════════════════════════════════════════════════════════════════════
   SECTION 4 — PRESETS
   ═══════════════════════════════════════════════════════════════════════ */
.presets-section {
    background: var(--bg-section);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    overflow: hidden;
}

.presets-scroll {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    padding: 40px 24px 20px;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.presets-scroll::-webkit-scrollbar { display: none; }

.preset-card {
    flex: 0 0 200px;
    scroll-snap-align: start;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px 20px;
    backdrop-filter: blur(var(--blur));
    transition: all 0.3s var(--ease);
    text-decoration: none;
    color: inherit;
    display: block;
}

.preset-card:hover {
    border-color: var(--border-hover);
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(0,0,0,0.3);
    opacity: 1;
}

.preset-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 9px;
    font-weight: 600;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    margin-bottom: 14px;
    border: 1px solid;
}

.preset-badge.conway {
    color: var(--lab-accent);
    border-color: rgba(78, 232, 255, 0.3);
    background: rgba(78, 232, 255, 0.08);
}

.preset-badge.generations {
    color: var(--ember-accent);
    border-color: rgba(255, 159, 67, 0.3);
    background: rgba(255, 159, 67, 0.08);
}

.preset-card h4 {
    font-family: var(--font-display);
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 6px;
}

.preset-card .preset-rule {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-secondary);
    letter-spacing: 0.5px;
}

.preset-card .preset-states {
    font-size: 10px;
    color: var(--accent);
    margin-top: 6px;
    letter-spacing: 1px;
}

/* ═══════════════════════════════════════════════════════════════════════
   SECTION 5 — DESKTOP APP
   ═══════════════════════════════════════════════════════════════════════ */
.desktop-section { background: var(--bg-deep); }

.desktop-grid {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 56px;
    align-items: center;
    margin-top: 48px;
}

.desktop-mockup {
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid var(--border);
    box-shadow: 0 24px 64px rgba(0,0,0,0.4), 0 0 32px var(--accent-glow);
}

.desktop-mockup img {
    width: 100%;
    height: auto;
    display: block;
}

.desktop-info h3 {
    font-family: var(--font-display);
    font-size: 28px;
    font-weight: 600;
    margin-bottom: 16px;
}

.desktop-features {
    list-style: none;
    margin: 24px 0;
}

.desktop-features li {
    font-size: 13px;
    color: var(--text-secondary);
    padding: 8px 0;
    padding-left: 24px;
    position: relative;
    line-height: 1.6;
}

.desktop-features li::before {
    content: '→';
    position: absolute;
    left: 0;
    color: var(--accent);
    font-weight: 600;
}

.download-meta {
    font-size: 11px;
    color: var(--text-secondary);
    margin-top: 12px;
    letter-spacing: 0.5px;
}

/* ═══════════════════════════════════════════════════════════════════════
   SECTION 6 — TECH STACK
   ═══════════════════════════════════════════════════════════════════════ */
.tech-section {
    background: var(--bg-section);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    text-align: center;
}

.tech-flow {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-top: 48px;
    flex-wrap: wrap;
}

.tech-node {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 24px 28px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    backdrop-filter: blur(var(--blur));
    transition: all 0.3s var(--ease);
    min-width: 110px;
}

.tech-node:hover {
    border-color: var(--border-hover);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.3);
}

.tech-node span:first-child {
    font-size: 24px;
}

.tech-node span:last-child {
    font-family: var(--font-display);
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 1px;
    color: var(--text-secondary);
}

.tech-arrow {
    font-size: 18px;
    color: var(--accent);
    opacity: 0.5;
}

/* ═══════════════════════════════════════════════════════════════════════
   SECTION 7 — FOOTER
   ═══════════════════════════════════════════════════════════════════════ */
.footer {
    padding: 64px 0 40px;
    text-align: center;
    background: var(--bg-deep);
    border-top: 1px solid var(--border);
}

.footer-logo {
    font-family: var(--font-display);
    font-size: 24px;
    font-weight: 700;
    letter-spacing: 8px;
    color: var(--accent);
    margin-bottom: 8px;
}

.footer-tagline {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 32px;
}

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

.footer-links a {
    font-family: var(--font-display);
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--text-secondary);
    transition: color 0.2s;
}

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

.footer-credit {
    font-size: 12px;
    color: rgba(214, 232, 248, 0.3);
    letter-spacing: 0.5px;
}

/* ═══════════════════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════════════════════ */
@media (max-width: 1024px) {
    .features-grid { grid-template-columns: repeat(2, 1fr); }
    .desktop-grid { grid-template-columns: 1fr; gap: 32px; }
    .theme-display { grid-template-columns: 1fr; gap: 24px; }
}

@media (max-width: 768px) {
    .section { padding: 80px 0; }
    .features-grid { grid-template-columns: 1fr; }
    .hero h1 { letter-spacing: 6px; }
    .hero-ctas { flex-direction: column; align-items: center; }
    .btn-primary, .btn-ghost { width: 100%; max-width: 280px; justify-content: center; }
    .theme-tabs { flex-direction: column; max-width: 100%; }
    .tech-flow { flex-direction: column; }
    .tech-arrow { transform: rotate(90deg); }
    .preset-card { flex: 0 0 170px; }
    .desktop-grid { gap: 24px; }
    .desktop-info h3 { font-size: 22px; }
}

@media (max-width: 480px) {
    .container { padding: 0 16px; }
    .section { padding: 60px 0; }
    .feature-card { padding: 24px 20px; }
    .preset-card { flex: 0 0 160px; padding: 20px 16px; }
}
