/* ===========================================================
   KWIKO GLOBAL CSS (v17.0)
   Design tokens, base resets, layout & utilities
   =========================================================== */

/* 1. DESIGN TOKENS
   ----------------------------------------------------------- */
:root {
    /* Brand Colors */
    --k-bg: #050505;
    --k-panel: #0F1115;
    --k-panel-alt: #1A1A1C;
    --k-border: rgba(255, 255, 255, 0.08);

    --k-orange: #F37021;
    --k-orange-subtle: rgba(243, 112, 33, 0.12);
    --k-amber: #FFB020;

    --k-blue: #2E5CFF;
    --k-red: #FF4B4B;
    --k-green: #00E676;

    --k-white: #FFFFFF;

    /* Greys (used by footer/header/loader) */
    --k-grey-light: #E5E7EB;
    --k-grey-300: #D1D5DB;
    --k-grey-400: #9CA3AF;
    --k-grey-500: #8B92A0;
    /* Raised from #6B7280 for 4.5:1 contrast on dark bg */
    --k-grey-600: #5B6270;
    --k-grey-mid: #A3A3A3;
    --k-muted: #9A9A9A;
    /* Semantic alias for muted text, ~5.5:1 on #050505 */
    --k-grey-dark: #111827;

    /* Typography */
    --font-display: 'Instrument Serif', serif;
    --font-body: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono: 'Departure Mono', 'Courier New', monospace;
    --font-secondary: var(--font-body);

    /* Layout */
    --header-height: 80px;
    --container-width: 1400px;
    --nav-width: 92%;
    --container-padding: clamp(24px, 5vw, 80px);
    --gap-section: 120px;

    /* Motion / Easing */
    --duration: 0.4s;
    --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
    --ease-expo: cubic-bezier(0.16, 1, 0.3, 1);
    /* For header.css compatibility */
    --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
}

/* 2. GLOBAL RESET / BASE
   ----------------------------------------------------------- */

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

html {
    /* Critical for GSAP/Lenis to handle scrolling */
    scroll-behavior: auto !important;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    background-color: var(--k-bg);
    color: var(--k-white);
    font-family: var(--font-body);
    line-height: 1.6;
    overflow-x: hidden;
    width: 100%;
    min-height: 100vh;
    /* Ensure body establishes a stacking context but allows fixed children */
    position: relative;
}

/* Let main be the primary content area */
main,
main.site-main,
#main-content,
.site-content {
    display: block;
    position: relative;
    /* CRITICAL: Sits above curtain footer (z-index 0 or 1) */
    z-index: 2;
    background-color: var(--k-bg);
    width: 100%;
}

/* Links */
a {
    color: inherit;
    text-decoration: none;
    transition: color 0.25s ease, background-color 0.25s ease, transform 0.25s ease;
}

a:hover {
    text-decoration: none;
}

/* Lists */
ul,
ol {
    list-style: none;
}

/* Media */
img,
svg,
picture,
video {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Buttons */
button {
    font: inherit;
    border: none;
    background: none;
    cursor: pointer;
}

/* Forms basic normalization */
input,
textarea,
select {
    font: inherit;
    color: inherit;
    background-color: transparent;
    border-radius: 0;
}

/* 3. LAYOUT HELPERS
   ----------------------------------------------------------- */

.container {
    width: 100%;
    max-width: var(--container-width);
    margin-left: auto;
    margin-right: auto;
    padding-left: var(--container-padding);
    padding-right: var(--container-padding);
}

.section-pad {
    padding-top: var(--gap-section);
    padding-bottom: var(--gap-section);
}

@media (max-width: 767px) {
    .section-pad {
        padding-top: 72px;
        padding-bottom: 72px;
    }
}

/* 4. TYPOGRAPHY UTILITIES
   ----------------------------------------------------------- */

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-display);
    font-weight: 400;
    line-height: 1.1;
    color: var(--k-white);
}

.mono-label,
.k-label {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--k-orange);
    display: inline-block;
    margin-bottom: 1rem;
}

.h2-headline {
    font-family: var(--font-display);
    font-size: clamp(2.5rem, 5vw, 4rem);
    line-height: 1.1;
    font-weight: 400;
    margin-bottom: 1.5rem;
}

.h2-headline em {
    font-style: italic;
    color: var(--k-grey-mid);
}

/* Generic text helpers */
.text-mono {
    font-family: var(--font-mono);
}

.text-muted {
    color: var(--k-grey-500);
}

/* 5. SCROLL REVEAL UTILITY
   ----------------------------------------------------------- */

.reveal-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition:
        opacity 0.8s var(--ease-out),
        transform 0.8s var(--ease-out);
}

.reveal-on-scroll.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* 6. NO-JS & LOADER FALLBACKS
   (Component-specific visuals live in loader.css)
   ----------------------------------------------------------- */

/* WordPress / <html> no-js fallback (can be set via JS) */
.no-js .loader {
    display: none !important;
}

.no-js .reveal-on-scroll {
    opacity: 1 !important;
    transform: none !important;
}

/* If JS fails, we still want visible content */
.no-js .k-header,
.no-js .hero-headline,
.no-js .hero-support {
    opacity: 1 !important;
    transform: none !important;
}

/* 7. THREE.JS / BACKGROUND NOISE (Optional, used on homepage)
   ----------------------------------------------------------- */

/* Canvas container for hero 3D scenes, click-through by default.
   More specific overrides can live in page-specific CSS if needed. */
#canvas-container {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
    /* Don’t block CTAs */
}

/* Grain overlay texture */
.grain {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 1;
    opacity: 0.035;
    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.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
}

/* 8. ACCESSIBILITY UTILITIES
   ----------------------------------------------------------- */

.visually-hidden {
    position: absolute !important;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* 9. REDUCED MOTION
   ----------------------------------------------------------- */

@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;
    }

    .reveal-on-scroll {
        opacity: 1 !important;
        transform: none !important;
    }
}