/* ══════════════════════════════════════════════════════════════════
   Khaos Studios — Landing Page
   Dark theme, purple accent (#a78bfa), studio identity
   ══════════════════════════════════════════════════════════════════ */

/* ── Reset & Base ────────────────────────────────────────────────── */

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

:root {
    --accent: #a78bfa;
    --accent-dim: rgba(167, 139, 250, 0.6);
    --accent-faint: rgba(167, 139, 250, 0.12);
    --accent-glow: rgba(167, 139, 250, 0.3);
    --pink: #f472b6;
    --cyan: #00ccff;
    --bg: #060a0f;
    --bg-card: rgba(255, 255, 255, 0.03);
    --bg-card-hover: rgba(167, 139, 250, 0.06);
    --bg-glass: rgba(6, 10, 15, 0.8);
    --border: rgba(255, 255, 255, 0.08);
    --border-accent: rgba(167, 139, 250, 0.2);
    --text: rgba(255, 255, 255, 0.88);
    --text-dim: rgba(255, 255, 255, 0.5);
    --text-faint: rgba(255, 255, 255, 0.3);
    --font: 'Inter', system-ui, -apple-system, sans-serif;
    --font-brand: 'Satoshi', 'Inter', system-ui, sans-serif;
    --radius: 12px;
    --radius-sm: 8px;
    --radius-lg: 16px;
    --radius-xl: 24px;
}

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

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    overflow-x: hidden;
}

a {
    color: var(--accent);
    text-decoration: none;
    transition: opacity 0.2s;
}
a:hover { opacity: 0.8; }

img { max-width: 100%; height: auto; }

/* ── Utility ─────────────────────────────────────────────────────── */

.container {
    max-width: 1140px;
    margin: 0 auto;
    padding: 0 24px;
}

.gradient-text {
    background: linear-gradient(135deg, var(--accent), var(--pink), var(--cyan));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ── Buttons ─────────────────────────────────────────────────────── */

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font);
    font-weight: 600;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s, background 0.2s, opacity 0.2s;
    text-decoration: none;
    white-space: nowrap;
}

.btn:hover {
    transform: translateY(-1px);
    opacity: 1;
}

.btn:active {
    transform: translateY(0);
}

.btn-primary {
    background: var(--accent);
    color: #000;
    box-shadow: 0 0 20px var(--accent-glow);
}
.btn-primary:hover {
    box-shadow: 0 0 30px var(--accent-dim);
    color: #000;
}

.btn-ghost {
    background: transparent;
    color: var(--text);
    border: 1px solid var(--border);
}
.btn-ghost:hover {
    border-color: var(--accent-dim);
    color: var(--text);
    background: var(--accent-faint);
}

.btn-sm {
    padding: 8px 16px;
    font-size: 0.85rem;
}

.btn-lg {
    padding: 14px 28px;
    font-size: 1rem;
}

/* ── Navigation ──────────────────────────────────────────────────── */

#nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    padding: 0 24px;
    transition: background 0.3s, backdrop-filter 0.3s, border-color 0.3s;
    border-bottom: 1px solid transparent;
}

#nav.scrolled {
    background: var(--bg-glass);
    -webkit-backdrop-filter: blur(20px);
    backdrop-filter: blur(20px);
    border-bottom-color: var(--border);
}

.nav-inner {
    max-width: 1140px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 72px;
}

.nav-logo-icon,
.footer-logo-icon {
    filter: invert(1);
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text);
    font-weight: 700;
    font-size: 1.05rem;
    text-decoration: none;
}
.nav-logo:hover { opacity: 1; }

.nav-logo-text {
    font-family: var(--font-brand);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    font-size: 1.05rem;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 32px;
}

.nav-links a {
    color: var(--text-dim);
    font-size: 0.9rem;
    font-weight: 500;
    transition: color 0.2s;
    text-decoration: none;
}
.nav-links a:hover {
    color: var(--text);
    opacity: 1;
}

.nav-mobile-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    z-index: 101;
}

.nav-mobile-toggle span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--text);
    border-radius: 2px;
    transition: transform 0.3s, opacity 0.3s;
}

.nav-mobile-toggle.open span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}
.nav-mobile-toggle.open span:nth-child(2) {
    opacity: 0;
}
.nav-mobile-toggle.open span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* ── Hero ─────────────────────────────────────────────────────────── */

#hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

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

.hero-content {
    position: relative;
    z-index: 1;
    text-align: center;
    max-width: 800px;
    padding: 0 24px;
}

.hero-label {
    display: inline-block;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 24px;
    padding: 6px 16px;
    border: 1px solid var(--border-accent);
    border-radius: 100px;
    background: var(--accent-faint);
}

.hero-title {
    font-family: var(--font-brand);
    font-size: clamp(2.5rem, 6vw, 4.5rem);
    line-height: 1.15;
    letter-spacing: 0.02em;
    margin-bottom: 24px;
    color: #fff;
}

.hero-subtitle {
    font-size: clamp(1rem, 1.5vw, 1.2rem);
    color: var(--text-dim);
    max-width: 600px;
    margin: 0 auto 40px;
    line-height: 1.7;
}

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

.hero-scroll-indicator {
    position: absolute;
    bottom: 32px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
}

.hero-scroll-line {
    width: 1px;
    height: 48px;
    background: linear-gradient(to bottom, var(--accent), transparent);
    animation: scrollPulse 2s ease-in-out infinite;
}

@keyframes scrollPulse {
    0%, 100% { opacity: 0.3; transform: scaleY(0.6); }
    50% { opacity: 1; transform: scaleY(1); }
}

/* ── Section Shared ──────────────────────────────────────────────── */

section {
    padding: 120px 0;
}

.section-header {
    text-align: center;
    max-width: 640px;
    margin: 0 auto 64px;
}

.section-label {
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 16px;
}

.section-header h2 {
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: -0.02em;
    color: #fff;
    margin-bottom: 20px;
}

.section-desc {
    font-size: 1.05rem;
    color: var(--text-dim);
    line-height: 1.7;
}

/* ── About / Values Grid ─────────────────────────────────────────── */

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

.value-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 40px 32px;
    transition: border-color 0.3s, background 0.3s, transform 0.3s;
}

.value-card:hover {
    border-color: var(--border-accent);
    background: var(--bg-card-hover);
    transform: translateY(-4px);
}

.value-icon {
    color: var(--accent);
    margin-bottom: 20px;
    opacity: 0.8;
}

.value-card h3 {
    font-size: 1.15rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 12px;
}

.value-card p {
    font-size: 0.95rem;
    color: var(--text-dim);
    line-height: 1.65;
}

/* ── Methodology Steps ───────────────────────────────────────────── */

.methodology-steps {
    max-width: 720px;
    margin: 0 auto;
}

.method-step {
    display: flex;
    gap: 32px;
    align-items: flex-start;
}

.method-number {
    font-size: 2.5rem;
    font-weight: 900;
    color: var(--accent);
    opacity: 0.3;
    line-height: 1;
    min-width: 64px;
    text-align: right;
    letter-spacing: -0.02em;
}

.method-content h3 {
    font-size: 1.15rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 8px;
}

.method-content p {
    font-size: 0.95rem;
    color: var(--text-dim);
    line-height: 1.65;
}

.method-divider {
    width: 1px;
    height: 40px;
    background: var(--border);
    margin: 16px 0 16px 80px;
}

/* ── Products Grid ───────────────────────────────────────────────── */

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

.product-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    overflow: hidden;
    transition: border-color 0.3s, transform 0.3s, box-shadow 0.3s;
    will-change: transform;
}

.product-card:hover {
    border-color: var(--border-accent);
    box-shadow: 0 8px 40px rgba(167, 139, 250, 0.08);
}

.product-card-inner {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.product-visual {
    position: relative;
    height: 200px;
    overflow: hidden;
}

.product-visual-bg {
    position: absolute;
    inset: 0;
    opacity: 0.6;
    transition: opacity 0.4s;
}

.product-card:hover .product-visual-bg {
    opacity: 0.8;
}

.product-visual-synthscape {
    background: linear-gradient(135deg, #00ccff 0%, #7b2fff 50%, #f472b6 100%);
}

.product-visual-finite {
    background: linear-gradient(135deg, #f472b6 0%, #a78bfa 50%, #60a5fa 100%);
}

.product-visual-stillhere {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
}

.product-visual-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-badge {
    position: absolute;
    top: 16px;
    right: 16px;
    padding: 4px 12px;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #000;
    background: var(--accent);
    border-radius: 100px;
}

.product-badge-soon {
    background: rgba(255, 255, 255, 0.15);
    color: var(--text-dim);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    animation: badgePulse 3s ease-in-out infinite;
}

@keyframes badgePulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(167, 139, 250, 0); }
    50% { box-shadow: 0 0 12px 2px var(--accent-glow); }
}

.product-info {
    padding: 28px 28px 32px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.product-info h3 {
    font-size: 1.3rem;
    font-weight: 800;
    color: #fff;
    margin-bottom: 4px;
    letter-spacing: -0.01em;
}

.product-tagline {
    font-size: 0.9rem;
    color: var(--accent);
    font-weight: 500;
    margin-bottom: 12px;
}

.product-desc {
    font-size: 0.9rem;
    color: var(--text-dim);
    line-height: 1.65;
    margin-bottom: 20px;
    flex: 1;
}

.product-platforms {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.platform-badge {
    padding: 3px 10px;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text-dim);
    border: 1px solid var(--border);
    border-radius: 100px;
}

.platform-badge-dim {
    opacity: 0.4;
}

.product-card-coming-soon {
    opacity: 0.7;
}
.product-card-coming-soon:hover {
    opacity: 0.85;
}

/* ── Our Promise Grid ────────────────────────────────────────────── */

.promise-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
}

.promise-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 36px 32px;
    transition: border-color 0.3s, background 0.3s, transform 0.3s;
}

.promise-card:hover {
    border-color: var(--border-accent);
    background: var(--bg-card-hover);
    transform: translateY(-4px);
}

.promise-icon {
    color: var(--pink);
    margin-bottom: 16px;
    opacity: 0.8;
}

.promise-card h3 {
    font-size: 1.1rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 10px;
}

.promise-card p {
    font-size: 0.93rem;
    color: var(--text-dim);
    line-height: 1.65;
}

/* ── Contact ─────────────────────────────────────────────────────── */

#contact {
    padding-bottom: 80px;
}

.contact-block {
    text-align: center;
    padding: 80px 40px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
}

.contact-actions {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 48px;
}

/* ── Footer ──────────────────────────────────────────────────────── */

#footer {
    padding: 64px 0 40px;
    border-top: 1px solid var(--border);
}

.footer-top {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 48px;
    padding-bottom: 48px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 32px;
}

/* ── Contact Form ────────────────────────────────────────────────── */

.contact-form {
    max-width: 520px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
    text-align: left;
}

.form-row {
    display: flex;
    gap: 16px;
}

.contact-form input,
.contact-form textarea {
    width: 100%;
    padding: 14px 18px;
    font-family: var(--font);
    font-size: 0.95rem;
    color: var(--text);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    outline: none;
    transition: border-color 0.2s, background 0.2s;
    resize: vertical;
}

.contact-form input::placeholder,
.contact-form textarea::placeholder {
    color: var(--text-faint);
}

.contact-form input:focus,
.contact-form textarea:focus {
    border-color: var(--accent-dim);
    background: rgba(167, 139, 250, 0.04);
}

.contact-form button {
    align-self: center;
}

/* ── Footer ──────────────────────────────────────────────────────── */

.footer-brand-col {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text);
}

.footer-tagline {
    font-size: 0.88rem;
    color: var(--text-dim);
    line-height: 1.6;
    max-width: 280px;
}

.footer-col {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.footer-col-heading {
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-dim);
    margin-bottom: 4px;
}

.footer-col a {
    color: var(--text-faint);
    font-size: 0.88rem;
    transition: color 0.2s;
    text-decoration: none;
}
.footer-col a:hover {
    color: var(--text);
    opacity: 1;
}

.footer-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
}

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

.footer-disclaimer {
    width: 100%;
    font-size: 0.75rem;
    color: var(--text-faint);
    opacity: 0.6;
    line-height: 1.5;
    margin-top: 8px;
}

/* ── Fade-in fallback (no-JS) ────────────────────────────────────── */

.fade-in {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s, transform 0.6s;
}
.fade-in.visible {
    opacity: 1;
    transform: none;
}

/* ══════════════════════════════════════════════════════════════════
   Responsive
   ══════════════════════════════════════════════════════════════════ */

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

    .products-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .product-card:last-child {
        grid-column: 1 / -1;
        max-width: 480px;
        justify-self: center;
    }

    .footer-top {
        grid-template-columns: 1fr 1fr 1fr;
    }

    .footer-brand-col {
        grid-column: 1 / -1;
    }
}

@media (max-width: 768px) {
    section {
        padding: 80px 0;
    }

    .nav-links {
        position: fixed;
        top: 0;
        right: 0;
        bottom: 0;
        width: 280px;
        flex-direction: column;
        align-items: flex-start;
        gap: 0;
        padding: 88px 32px 32px;
        background: var(--bg-glass);
        -webkit-backdrop-filter: blur(20px);
        backdrop-filter: blur(20px);
        border-left: 1px solid var(--border);
        transform: translateX(100%);
        transition: transform 0.3s ease;
        z-index: 99;
    }

    .nav-links.open {
        transform: translateX(0);
    }

    .nav-links a {
        padding: 12px 0;
        font-size: 1.1rem;
        width: 100%;
        border-bottom: 1px solid var(--border);
    }

    .nav-mobile-toggle {
        display: flex;
    }

    .hero-title {
        font-size: clamp(2rem, 8vw, 3rem);
    }

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

    .method-step {
        gap: 20px;
    }

    .method-number {
        font-size: 2rem;
        min-width: 48px;
    }

    .method-divider {
        margin-left: 60px;
    }

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

    .product-card:last-child {
        max-width: none;
    }

    .contact-block {
        padding: 48px 24px;
    }

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

    .footer-top {
        grid-template-columns: 1fr 1fr;
        gap: 32px;
    }

    .footer-brand-col {
        grid-column: 1 / -1;
    }

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

    .form-row {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 16px;
    }

    .section-header {
        margin-bottom: 48px;
    }

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

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

    .value-card {
        padding: 28px 24px;
    }

    .product-info {
        padding: 20px 20px 24px;
    }
}

/* ══════════════════════════════════════════════════════════════════
   Accessibility: Reduced Motion
   ══════════════════════════════════════════════════════════════════ */

/* ── GSAP animation fallback ─────────────────────────────────────
   If JS hasn't marked the body as animated within 3s, force content visible.
   Prevents blank pages when GSAP animations fail to complete. */
@keyframes gsapFallbackReveal {
    to { opacity: 1; transform: none; }
}

body:not(.gsap-ready) .hero-content > *,
body:not(.gsap-ready) .section-header,
body:not(.gsap-ready) .value-card,
body:not(.gsap-ready) .method-step,
body:not(.gsap-ready) .method-divider,
body:not(.gsap-ready) .promise-card,
body:not(.gsap-ready) .product-card,
body:not(.gsap-ready) .contact-block,
body:not(.gsap-ready) .footer-top {
    animation: gsapFallbackReveal 0s forwards;
    animation-delay: 3s;
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }

    #hero-canvas {
        display: none;
    }

    .hero-scroll-indicator {
        display: none;
    }
}

/* ── Skip to content (a11y) ──────────────────────────────────────── */

.skip-link {
    position: absolute;
    top: -100%;
    left: 16px;
    padding: 8px 16px;
    background: var(--accent);
    color: #000;
    border-radius: var(--radius-sm);
    font-weight: 600;
    z-index: 200;
    transition: top 0.2s;
}
.skip-link:focus {
    top: 16px;
}
