/* ============================================================
   THE BRIGHT COMPANY — V5 Design System
   Premium · vanilla · offline-first · zéro framework
   ============================================================ */

@layer reset, tokens, base, layout, components, effects, utils;

/* ---------------------------------------------------------- RESET */
@layer reset {
    *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
    html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
    @media (prefers-reduced-motion: reduce) {
        html { scroll-behavior: auto; }
        *, *::before, *::after {
            animation-duration: .001ms !important;
            animation-iteration-count: 1 !important;
            transition-duration: .001ms !important;
        }
    }
    img, svg, video { display: block; max-width: 100%; }
    a { color: inherit; text-decoration: none; }
    button { font: inherit; cursor: pointer; border: none; background: none; color: inherit; }
    ul { list-style: none; }
    :focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; border-radius: 2px; }
}

/* ---------------------------------------------------------- TOKENS */
@layer tokens {
    :root {
        /* Surfaces — obsidienne */
        --bg: #0a0b0e;
        --bg-2: #0f1116;
        --bg-3: #14161d;
        --surface: #16181f;
        --surface-glass: rgba(255, 255, 255, .045);
        --surface-glass-strong: rgba(255, 255, 255, .07);
        --ink: #f4f2ec;
        --ink-soft: rgba(244, 242, 236, .72);
        --ink-faint: rgba(244, 242, 236, .48);

        /* Or — signature TBC */
        --gold: #d4af37;
        --gold-light: #f5d78a;
        --gold-deep: #a67c00;
        --grad-gold: linear-gradient(135deg, #fbedc5 0%, #f5d78a 28%, #d4af37 62%, #a67c00 100%);
        --grad-gold-soft: linear-gradient(135deg, #f5d78a 0%, #d4af37 100%);

        /* Accent froid (contraste premium) */
        --ice: #9fb4c9;

        /* Bordures */
        --line: rgba(255, 255, 255, .09);
        --line-strong: rgba(255, 255, 255, .16);
        --line-gold: rgba(212, 175, 55, .38);

        /* Typo */
        --font-display: "Cormorant Garamond", Georgia, "Times New Roman", serif;
        --font-body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
        --font-mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, monospace;

        /* Échelle fluide */
        --fs-eyebrow: .8rem;
        --fs-body: 1.0625rem;        /* 17px */
        --fs-lead: clamp(1.15rem, .95rem + .8vw, 1.4rem);
        --fs-h3: clamp(1.4rem, 1.1rem + 1.4vw, 1.9rem);
        --fs-h2: clamp(2rem, 1.4rem + 2.8vw, 3.4rem);
        --fs-h1: clamp(2.8rem, 1.8rem + 5vw, 5.6rem);

        /* Espace (base 8) */
        --sp-1: .5rem; --sp-2: 1rem; --sp-3: 1.5rem; --sp-4: 2rem;
        --sp-5: 3rem; --sp-6: 4rem; --sp-7: 6rem; --sp-8: 9rem;

        /* Rayons */
        --r-sm: 10px; --r-md: 16px; --r-lg: 24px; --r-xl: 34px; --r-pill: 999px;

        /* Ombres / lueurs */
        --shadow-soft: 0 24px 60px - 20px rgba(0, 0, 0, .65);
        --shadow-card: 0 30px 80px - 30px rgba(0, 0, 0, .8);
        --glow-gold: 0 0 0 1px rgba(212, 175, 55, .25), 0 18px 50px - 16px rgba(212, 175, 55, .35);

        /* Motion */
        --ease: cubic-bezier(.22, 1, .36, 1);
        --ease-soft: cubic-bezier(.4, 0, .2, 1);

        --container: 1200px;
        --container-wide: 1360px;
    }
}

/* ---------------------------------------------------------- BASE */
@layer base {
    body {
        background: var(--bg);
        color: var(--ink);
        font-family: var(--font-body);
        font-size: var(--fs-body);
        font-weight: 400;
        line-height: 1.7;
        letter-spacing: .003em;
        -webkit-font-smoothing: antialiased;
        text-rendering: optimizeLegibility;
        overflow-x: hidden;
    }
    h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 600; line-height: 1.05; letter-spacing: -.01em; }
    h1 { font-size: var(--fs-h1); }
    h2 { font-size: var(--fs-h2); }
    h3 { font-size: var(--fs-h3); line-height: 1.15; }
    p { color: var(--ink-soft); }
    ::selection { background: rgba(212, 175, 55, .28); color: #fff; }
    ::-webkit-scrollbar { width: 11px; }
    ::-webkit-scrollbar-track { background: var(--bg); }
    ::-webkit-scrollbar-thumb { background: linear-gradient(var(--gold-deep), var(--gold)); border-radius: 99px; border: 3px solid var(--bg); }
}

/* ---------------------------------------------------------- LAYOUT */
@layer layout {
    .container { width: min(100% - 2.5rem, var(--container)); margin-inline: auto; }
    .container--wide { width: min(100% - 2.5rem, var(--container-wide)); }
    .section { padding-block: clamp(4rem, 2rem + 9vw, 8rem); position: relative; }
    .section--tight { padding-block: clamp(3rem, 2rem + 5vw, 5rem); }
    .stack > * + * { margin-top: var(--flow, 1.25rem); }
    .grid { display: grid; gap: var(--sp-4); }
    @media (min-width: 760px) {
        .grid--2 { grid-template-columns: 1fr 1fr; }
        .grid--3 { grid-template-columns: repeat(3, 1fr); }
    }
}

/* ---------------------------------------------------------- COMPONENTS */
@layer components {
    .eyebrow {
        display: inline-flex; align-items: center; gap: .6rem;
        font-family: var(--font-body); font-size: var(--fs-eyebrow); font-weight: 600;
        text-transform: uppercase; letter-spacing: .22em; color: var(--gold-light);
    }
    .eyebrow::before { content: ""; width: 28px; height: 1px; background: var(--grad-gold-soft); }
    .eyebrow--center::after { content: ""; width: 28px; height: 1px; background: var(--grad-gold-soft); }

    .gold-text {
        background: var(--grad-gold); -webkit-background-clip: text; background-clip: text;
        -webkit-text-fill-color: transparent; color: transparent;
    }
    .lead { font-size: var(--fs-lead); color: var(--ink-soft); font-weight: 300; line-height: 1.6; }

    /* Boutons */
    .btn {
        --pad: .95rem 1.8rem;
        position: relative; display: inline-flex; align-items: center; gap: .6rem;
        padding: var(--pad); border-radius: var(--r-pill); font-weight: 600; font-size: .98rem;
        letter-spacing: .01em; transition: transform .4s var(--ease), box-shadow .4s var(--ease); overflow: hidden;
        will-change: transform;
    }
    .btn svg { width: 18px; height: 18px; }
    .btn--gold { color: #1a1405; background: var(--grad-gold); box-shadow: var(--glow-gold); }
    .btn--gold::after {
        content: ""; position: absolute; inset: 0; transform: translateX(-120%);
        background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, .55) 50%, transparent 70%);
    }
    .btn--gold:hover { transform: translateY(-3px); box-shadow: 0 0 0 1px rgba(212,175,55,.4), 0 26px 60px - 18px rgba(212,175,55,.6); }
    .btn--gold:hover::after { transition: transform .9s var(--ease); transform: translateX(120%); }
    .btn--ghost { color: var(--ink); border: 1px solid var(--line-strong); background: var(--surface-glass); backdrop-filter: blur(8px); }
    .btn--ghost:hover { border-color: var(--line-gold); color: var(--gold-light); transform: translateY(-3px); }

    /* Cartes verre */
    .card {
        position: relative; background: var(--surface-glass); border: 1px solid var(--line);
        border-radius: var(--r-lg); padding: var(--sp-4); backdrop-filter: blur(14px);
        transition: transform .5s var(--ease), border-color .5s var(--ease), background .5s var(--ease);
    }
    .card:hover { transform: translateY(-6px); border-color: var(--line-gold); background: var(--surface-glass-strong); }

    /* Bordure dégradée animée (premium) */
    .grad-border { position: relative; border-radius: var(--r-lg); }
    .grad-border::before {
        content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1px;
        background: conic-gradient(from var(--angle, 0deg), transparent 0%, var(--gold) 18%, transparent 38%, transparent 62%, var(--gold-light) 80%, transparent 100%);
        -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
        -webkit-mask-composite: xor; mask-composite: exclude; opacity: .9;
        animation: spin-border 8s linear infinite;
    }
    @property --angle { syntax: "<angle>"; initial-value: 0deg; inherits: false; }
    @keyframes spin-border { to { --angle: 360deg; } }

    /* Tag / pilule */
    .tag {
        display: inline-flex; align-items: center; gap: .45rem; padding: .4rem .9rem;
        border-radius: var(--r-pill); border: 1px solid var(--line-gold);
        font-size: .8rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--gold-light);
        background: rgba(212, 175, 55, .06);
    }

    /* Icône SVG utilitaire */
    .ico { width: 24px; height: 24px; stroke: var(--gold); fill: none; stroke-width: 1.6; }
}

/* ---------------------------------------------------------- EFFECTS */
@layer effects {
    /* Grain global */
    .grain::after {
        content: ""; position: fixed; inset: 0; z-index: 9998; pointer-events: none; opacity: .035;
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
    }

    /* Lueur curseur (spotlight) */
    .spotlight {
        position: fixed; width: 520px; height: 520px; border-radius: 50%; z-index: 0; pointer-events: none;
        left: var(--mx, 50%); top: var(--my, 30%); transform: translate(-50%, -50%);
        background: radial-gradient(circle, rgba(212, 175, 55, .10) 0%, transparent 62%);
        transition: opacity .6s var(--ease); mix-blend-mode: screen;
    }

    /* Mesh dégradé d'ambiance */
    .ambient {
        position: absolute; inset: 0; z-index: 0; pointer-events: none; overflow: hidden;
    }
    .ambient::before, .ambient::after {
        content: ""; position: absolute; border-radius: 50%; filter: blur(80px); opacity: .5;
    }
    .ambient::before { width: 48vw; height: 48vw; top: -16vw; right: -10vw; background: radial-gradient(circle, rgba(212,175,55,.18), transparent 70%); }
    .ambient::after { width: 40vw; height: 40vw; bottom: -14vw; left: -8vw; background: radial-gradient(circle, rgba(159,180,201,.10), transparent 70%); }

    /* Révélation au scroll */
    .reveal { opacity: 0; transform: translateY(28px); transition: opacity .9s var(--ease), transform .9s var(--ease); }
    .reveal.is-in { opacity: 1; transform: none; }
    .reveal[data-delay="1"] { transition-delay: .08s; }
    .reveal[data-delay="2"] { transition-delay: .16s; }
    .reveal[data-delay="3"] { transition-delay: .24s; }
    .reveal[data-delay="4"] { transition-delay: .32s; }

    /* Barre de progression scroll */
    .scroll-progress {
        position: fixed; top: 0; left: 0; height: 3px; width: 0%; z-index: 9999;
        background: var(--grad-gold); box-shadow: 0 0 14px rgba(212, 175, 55, .6);
    }

    /* Filet décoratif */
    .hr-gold { height: 1px; border: 0; background: linear-gradient(90deg, transparent, var(--line-gold), transparent); }

    /* Formulaire de contact */
    .cform { display: grid; gap: .9rem; text-align: left; }
    .cform__row { display: grid; gap: .9rem; }
    @media (min-width: 560px) { .cform__row { grid-template-columns: 1fr 1fr; } }
    .cform input[type="text"], .cform input[type="email"], .cform input[type="tel"], .cform textarea {
        width: 100%; padding: .9rem 1.1rem; font: inherit; font-size: 1rem; color: var(--ink);
        background: var(--surface-glass); border: 1px solid var(--line); border-radius: var(--r-sm);
        transition: border-color .3s, background .3s; -webkit-appearance: none;
    }
    .cform textarea { resize: vertical; min-height: 120px; }
    .cform input::placeholder, .cform textarea::placeholder { color: var(--ink-faint); }
    .cform input:focus, .cform textarea:focus { outline: none; border-color: var(--line-gold); background: var(--surface-glass-strong); }
    .cform .honey { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
    .cform__consent { display: flex; gap: .6rem; align-items: flex-start; font-size: .88rem; color: var(--ink-soft); line-height: 1.5; }
    .cform__consent input { margin-top: .2rem; accent-color: var(--gold); flex: 0 0 auto; }
    .cform button[type="submit"] { justify-self: start; margin-top: .4rem; }
}

/* ---------------------------------------------------------- UTILS */
@layer utils {
    .center { text-align: center; }
    .mx-auto { margin-inline: auto; }
    .maxw-sm { max-width: 38rem; }
    .maxw-md { max-width: 52rem; }
    .maxw-lg { max-width: 66rem; }
    .mt-2 { margin-top: var(--sp-2); }
    .mt-3 { margin-top: var(--sp-3); }
    .mt-4 { margin-top: var(--sp-4); }
    .mt-5 { margin-top: var(--sp-5); }
    .relative { position: relative; z-index: 1; }
    .dim { color: var(--ink-faint); }
    .ice { color: var(--ice); }
}
