/* ============================================
   DESIGN FORGE — Design System CSS
   Bertrand Bonnet — bertrand-bonnet.com
   ============================================ */

/* === DESIGN TOKENS === */
:root {
    --bg-deep:     #0b090e;
    --bg-surface:  #14111a;
    --bg-elevated: #1d1926;
    --border:      #2a2533;
    --border-hover:#3d3548;
    --gold:        #d4a843;
    --gold-bright: #e8c45a;
    --gold-dim:    #a07d2e;
    --gold-glow:   rgba(212,168,67,0.15);
    --text:        #ede9e0;
    --text-muted:  #9b95a3;
    --text-dim:    #6b6573;
    --font-display: 'Syne', sans-serif;
    --font-body:    'Plus Jakarta Sans', sans-serif;
    --font-mono:    'JetBrains Mono', monospace;
}

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

body {
    font-family: var(--font-body);
    background: var(--bg-deep);
    color: var(--text);
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
}

/* === SELECTION === */
::selection {
    background: var(--gold);
    color: var(--bg-deep);
}

/* === SCROLLBAR === */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg-deep); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--gold); }

/* === SKIP TO CONTENT === */
.skip-link {
    position: absolute;
    top: -100%;
    left: 16px;
    z-index: 9999;
    padding: 12px 24px;
    background: var(--gold);
    color: var(--bg-deep);
    font-weight: 700;
    border-radius: 0 0 8px 8px;
    text-decoration: none;
    transition: top 0.2s;
}
.skip-link:focus { top: 0; }

/* === GRAIN OVERLAY === */
body::after {
    content: '';
    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='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.03'/%3E%3C/svg%3E");
    pointer-events: none;
    z-index: 9998;
    opacity: 0.5;
}

/* === TYPOGRAPHY === */
h1, h2, h3, h4 { font-family: var(--font-display); }

/* === SCROLL REVEAL === */
[data-reveal="up"] {
    opacity: 0;
    transform: translateY(28px);
    transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1), transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}
[data-reveal="left"] {
    opacity: 0;
    transform: translateX(-40px);
    transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1), transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}
[data-reveal="right"] {
    opacity: 0;
    transform: translateX(40px);
    transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1), transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}
[data-reveal="scale"] {
    opacity: 0;
    transform: scale(0.92);
    transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1), transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}
[data-reveal].revealed {
    opacity: 1;
    transform: none;
}

/* === GOLD LINE === */
.gold-line {
    width: 60px;
    height: 3px;
    background: var(--gold);
    border-radius: 2px;
}

/* === CARD HOVER === */
.card-hover {
    border: 1px solid var(--border);
    transition: border-color 0.4s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.4s cubic-bezier(0.16, 1, 0.3, 1), transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
.card-hover:hover {
    border-color: var(--gold);
    box-shadow: 0 0 0 1px var(--gold-glow), 0 8px 32px rgba(212,168,67,0.08);
    transform: translateY(-4px);
}

/* === BUTTONS === */
.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 16px 32px;
    background: var(--gold);
    color: var(--bg-deep);
    font-family: var(--font-body);
    font-weight: 700;
    font-size: 1.05rem;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}
.btn-primary:hover {
    background: var(--gold-bright);
    box-shadow: 0 4px 24px var(--gold-glow);
    transform: translateY(-2px);
}
.btn-primary:focus-visible { outline: 2px solid var(--gold-bright); outline-offset: 3px; }

.btn-outline {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: transparent;
    color: var(--gold);
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 0.9rem;
    border: 1px solid var(--gold);
    border-radius: 6px;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}
.btn-outline:hover { background: var(--gold-glow); border-color: var(--gold-bright); }
.btn-outline:focus-visible { outline: 2px solid var(--gold-bright); outline-offset: 3px; }

/* === LINK ANIMATED === */
.link-animated {
    position: relative;
    text-decoration: none;
    color: var(--gold);
    font-weight: 600;
}
.link-animated::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -2px;
    width: 0;
    height: 2px;
    background: var(--gold);
    transition: width 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
.link-animated:hover::after { width: 100%; }
.link-animated:focus-visible { outline: 2px solid var(--gold-bright); outline-offset: 3px; border-radius: 2px; }

/* === TAG === */
.tag {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    letter-spacing: 0.03em;
    padding: 4px 10px;
    border: 1px solid var(--border);
    border-radius: 4px;
    color: var(--text-muted);
    transition: border-color 0.3s;
}

/* === NAV === */
.site-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 50;
    background: rgba(11, 9, 14, 0.8);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(42, 37, 51, 0.5);
}

/* === FOCUS VISIBLE GLOBAL === */
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible {
    outline: 2px solid var(--gold-bright);
    outline-offset: 2px;
}

/* === 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;
    }
    [data-reveal] {
        opacity: 1 !important;
        transform: none !important;
    }
}
