/* Winging AI -- Landing Page v2 (S41)
   Design: "Warm Digital Surrealism"
   Dark + Light mode, amber/gold primary, violet secondary
*/

/* ===== THEME VARIABLES ===== */
:root,
[data-theme="dark"] {
    --bg: #0D0D0F;
    --bg-secondary: #141418;
    --surface: rgba(26, 26, 46, 0.6);
    --surface-solid: #1A1A2E;
    --border: rgba(255, 255, 255, 0.06);
    --border-hover: rgba(245, 166, 35, 0.3);
    --text: #F5F5F0;
    --text-muted: #9CA3AF;
    --text-dim: rgba(245, 245, 240, 0.4);
    --accent: #F5A623;
    --accent-hover: #FFB84D;
    --accent-glow: rgba(245, 166, 35, 0.25);
    --accent-subtle: rgba(245, 166, 35, 0.08);
    --violet: #8B5CF6;
    --violet-glow: rgba(139, 92, 246, 0.2);
    --teal: #06B6D4;
    --success: #34D399;
    --error: #F87171;
    --glass-bg: rgba(26, 26, 46, 0.4);
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-blur: 20px;
    --header-bg: rgba(13, 13, 15, 0.85);
    --shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.4);
    --canvas-opacity: 0.4;
}

[data-theme="light"] {
    --bg: #FAFAF8;
    --bg-secondary: #F0F0EC;
    --surface: rgba(255, 255, 255, 0.7);
    --surface-solid: #FFFFFF;
    --border: rgba(0, 0, 0, 0.08);
    --border-hover: rgba(245, 166, 35, 0.4);
    --text: #1A1A2E;
    --text-muted: #6B7280;
    --text-dim: rgba(26, 26, 46, 0.3);
    --accent: #D4890A;
    --accent-hover: #F5A623;
    --accent-glow: rgba(245, 166, 35, 0.2);
    --accent-subtle: rgba(245, 166, 35, 0.06);
    --violet: #7C3AED;
    --violet-glow: rgba(124, 58, 237, 0.15);
    --teal: #0891B2;
    --success: #059669;
    --error: #DC2626;
    --glass-bg: rgba(255, 255, 255, 0.5);
    --glass-border: rgba(0, 0, 0, 0.06);
    --glass-blur: 20px;
    --header-bg: rgba(250, 250, 248, 0.85);
    --shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.12);
    --canvas-opacity: 0.15;
}

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

html {
    scroll-behavior: smooth;
    scroll-padding-top: 80px;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.65;
    overflow-x: hidden;
    transition: background 0.4s ease, color 0.4s ease;
}

/* ===== TYPOGRAPHY ===== */
h1, h2, h3 {
    font-family: 'Space Grotesk', sans-serif;
    letter-spacing: -0.03em;
    line-height: 1.15;
}

.mono {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85em;
    letter-spacing: 0.02em;
}

/* ===== AMBIENT CANVAS ===== */
#ambient-canvas {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    opacity: var(--canvas-opacity);
    transition: opacity 0.4s ease;
}

/* ===== GRAIN OVERLAY ===== */
.grain {
    position: fixed;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.03'/%3E%3C/svg%3E");
    pointer-events: none;
    z-index: 999;
}

/* ===== HEADER ===== */
header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    background: var(--header-bg);
    border-bottom: 1px solid var(--border);
    transition: background 0.4s ease;
}

nav {
    max-width: 1100px;
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo, .logo-sm {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    letter-spacing: -0.02em;
    background: linear-gradient(135deg, var(--accent), var(--violet));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.logo { font-size: 1.3rem; }
.logo-sm { font-size: 1.1rem; }

.nav-links {
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

.nav-links a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.2s;
}

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

.theme-toggle {
    background: none;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 6px 8px;
    cursor: pointer;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    transition: all 0.2s;
}

.theme-toggle:hover {
    color: var(--accent);
    border-color: var(--accent);
}

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

/* ===== HERO ===== */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    padding: 6rem 2rem 4rem;
    overflow: hidden;
}

.hero-content {
    text-align: center;
    max-width: 720px;
    position: relative;
    z-index: 2;
}

.hero-tag {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}

.hero-tag .mono {
    color: var(--accent);
}

.hero h1 {
    font-size: clamp(2.8rem, 7vw, 5.5rem);
    font-weight: 800;
    margin-bottom: 1.5rem;
    background: linear-gradient(135deg, var(--text) 60%, var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.subtitle {
    font-size: 1.2rem;
    color: var(--text-muted);
    max-width: 560px;
    margin: 0 auto 0.5rem;
    line-height: 1.6;
}

.subtitle-accent {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--accent);
    margin-bottom: 2.5rem;
}

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

.cta-button {
    display: inline-block;
    padding: 0.9rem 2.4rem;
    background: linear-gradient(135deg, var(--accent), var(--accent-hover));
    color: #0D0D0F;
    text-decoration: none;
    border-radius: 10px;
    font-weight: 700;
    font-size: 1rem;
    transition: all 0.25s ease;
    box-shadow: 0 0 24px var(--accent-glow);
    border: none;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
}

.cta-button:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 0 40px var(--accent-glow), 0 8px 24px rgba(0,0,0,0.2);
}

.cta-ghost {
    display: inline-block;
    padding: 0.9rem 2.4rem;
    background: transparent;
    color: var(--text-muted);
    text-decoration: none;
    border-radius: 10px;
    font-weight: 500;
    font-size: 1rem;
    border: 1px solid var(--border);
    transition: all 0.25s ease;
}

.cta-ghost:hover {
    color: var(--text);
    border-color: var(--text-muted);
    transform: translateY(-2px);
}

.hero-glow {
    position: absolute;
    top: 30%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 700px;
    height: 700px;
    background: radial-gradient(circle, var(--accent-glow) 0%, var(--violet-glow) 40%, transparent 70%);
    filter: blur(100px);
    pointer-events: none;
    z-index: 1;
    animation: glow-pulse 8s ease-in-out infinite;
}

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

/* ===== SECTIONS COMMON ===== */
.section-header {
    text-align: center;
    margin-bottom: 3.5rem;
}

.section-tag {
    color: var(--accent);
    font-size: 0.85rem;
    text-transform: lowercase;
    margin-bottom: 0.75rem;
}

.section-header h2 {
    font-size: clamp(1.8rem, 4vw, 2.8rem);
    font-weight: 700;
}

/* ===== PILLAR CARDS ===== */
.pillars {
    max-width: 1100px;
    margin: 0 auto;
    padding: 6rem 2rem;
}

.pillars-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.25rem;
}

.pillar-card {
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 2rem;
    transition: all 0.35s ease;
    position: relative;
    overflow: hidden;
}

.pillar-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--accent), transparent);
    opacity: 0;
    transition: opacity 0.35s ease;
}

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

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

.pillar-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: var(--accent-subtle);
    color: var(--accent);
    margin-bottom: 1.25rem;
    transition: all 0.35s ease;
}

.pillar-card:hover .pillar-icon {
    background: var(--accent);
    color: #0D0D0F;
    transform: scale(1.05);
}

.pillar-card h3 {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.pillar-pct {
    color: var(--accent);
    font-size: 0.75rem;
    margin-bottom: 0.75rem;
    opacity: 0.7;
}

.pillar-card p:last-child {
    color: var(--text-muted);
    font-size: 0.93rem;
    line-height: 1.6;
}

/* ===== PROOF / STATS ===== */
.proof {
    max-width: 1100px;
    margin: 0 auto;
    padding: 6rem 2rem;
    text-align: center;
}

.stats-row {
    display: flex;
    justify-content: center;
    gap: 3rem;
    flex-wrap: wrap;
    margin-bottom: 2.5rem;
}

.stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
}

.stat-number {
    font-family: 'Space Grotesk', sans-serif;
    font-size: clamp(2.5rem, 5vw, 3.5rem);
    font-weight: 800;
    background: linear-gradient(135deg, var(--accent), var(--violet));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.1;
}

.stat-plus {
    position: absolute;
    top: 0;
    right: -16px;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent);
}

.stat-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-top: 0.25rem;
}

.proof-note {
    color: var(--text-muted);
    font-size: 0.95rem;
    font-style: italic;
    max-width: 500px;
    margin: 0 auto;
}

/* ===== NEWSLETTER ===== */
.newsletter {
    padding: 6rem 2rem;
    position: relative;
}

.newsletter::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent, var(--accent-subtle), transparent);
    pointer-events: none;
}

.newsletter-inner {
    max-width: 560px;
    margin: 0 auto;
    text-align: center;
    position: relative;
    z-index: 2;
}

.newsletter h2 {
    font-size: clamp(1.8rem, 4vw, 2.5rem);
    font-weight: 700;
    margin-bottom: 0.75rem;
}

.newsletter-desc {
    color: var(--text-muted);
    margin-bottom: 2rem;
    font-size: 1.05rem;
}

.subscribe-form {
    margin-bottom: 2rem;
}

.form-row {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.subscribe-form input {
    flex: 1;
    padding: 0.85rem 1rem;
    background: var(--surface-solid);
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--text);
    font-size: 1rem;
    font-family: 'Inter', sans-serif;
    transition: all 0.2s;
}

.subscribe-form input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 12px var(--accent-glow);
}

.subscribe-form input::placeholder {
    color: var(--text-muted);
}

.name-input {
    width: 100%;
}

.subscribe-form button {
    padding: 0.85rem 2rem;
    background: linear-gradient(135deg, var(--accent), var(--accent-hover));
    color: #0D0D0F;
    border: none;
    border-radius: 10px;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    transition: all 0.25s;
    box-shadow: 0 0 16px var(--accent-glow);
    white-space: nowrap;
}

.subscribe-form button:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 28px var(--accent-glow);
}

.what-you-get {
    list-style: none;
    text-align: left;
    max-width: 360px;
    margin: 0 auto;
}

.what-you-get li {
    color: var(--text-muted);
    font-size: 0.88rem;
    padding: 0.35rem 0;
    padding-left: 1.4rem;
    position: relative;
}

.what-you-get li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.7rem;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent);
    opacity: 0.6;
}

/* Message styles */
.msg {
    padding: 0.75rem 1.5rem;
    border-radius: 10px;
    margin-bottom: 1.5rem;
    font-weight: 500;
    font-size: 0.95rem;
}

.msg-success {
    background: rgba(52, 211, 153, 0.1);
    border: 1px solid var(--success);
    color: var(--success);
}

.msg-info {
    background: var(--accent-subtle);
    border: 1px solid var(--accent);
    color: var(--accent);
}

.msg-error {
    background: rgba(248, 113, 113, 0.1);
    border: 1px solid var(--error);
    color: var(--error);
}

/* ===== FOOTER ===== */
footer {
    border-top: 1px solid var(--border);
    padding: 3rem 2rem;
    transition: border-color 0.4s ease;
}

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

.footer-brand {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.footer-tagline {
    color: var(--text-dim);
    font-size: 0.8rem;
}

.footer-links {
    display: flex;
    gap: 1.5rem;
}

.footer-links a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.88rem;
    transition: color 0.2s;
}

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

.footer-copy {
    color: var(--text-dim);
    font-size: 0.8rem;
    width: 100%;
    text-align: center;
    margin-top: 1rem;
}

/* ===== SCROLL REVEAL ===== */
.reveal {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.7s ease, transform 0.7s ease;
    transition-delay: var(--delay, 0s);
}

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

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    nav { padding: 0.75rem 1.25rem; }
    .nav-links { gap: 0.75rem; }
    .nav-links a { font-size: 0.82rem; }

    .hero { padding: 5rem 1.5rem 3rem; }
    .hero h1 { font-size: clamp(2.2rem, 8vw, 3.5rem); }
    .subtitle { font-size: 1.05rem; }
    .hero-glow { width: 400px; height: 400px; }

    .pillars { padding: 4rem 1.5rem; }
    .pillars-grid { grid-template-columns: 1fr; }

    .proof { padding: 4rem 1.5rem; }
    .stats-row { gap: 1.5rem; }
    .stat-number { font-size: 2.5rem; }

    .newsletter { padding: 4rem 1.5rem; }
    .form-row { flex-direction: column; }

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

    .footer-brand { justify-content: center; }
}

@media (max-width: 480px) {
    .hero-cta { flex-direction: column; align-items: center; }
    .cta-button, .cta-ghost { width: 100%; text-align: center; }
}
