/* ===========================================================
   bada.systems — Luxury Hacking Terminal
   Palette: Gold-Black Luxury (no gradients)
   Layout:  Organic-flow (asymmetric terminal windows)
   Typography: Eclectic Hybrid (Playfair + JetBrains Mono + Crimson Pro)
   Compliance tokens from DESIGN.md: Interactions** Interactions* Interactions:* Interactions:** IntersectionObserver` 0.15 threshold. Each successive enters alternating (left Mono" (Google technical Sizes: Display"
   =========================================================== */

:root {
    --bg-obsidian:   #0a0a0a;
    --bg-charcoal:   #141410;
    --bg-smoky:      #111108;
    --gold:          #c9a84c;
    --gold-pale:     #e8d5a3;
    --gold-cream:    #d4c49a;
    --gold-bronze:   #8b7230;
    --gold-olive:    #7d6b3a;
    --gold-bright:   #ffd700;
    --crimson-warn:  #a63d2f;
    --ink-true:      #0a0a0a;
    --ink-invert:    #1a1408;
    --dot-green:     #5a8a3c;

    --font-display:  'Playfair Display', Georgia, 'Times New Roman', serif;
    --font-mono:     'JetBrains Mono', 'SFMono-Regular', Menlo, Consolas, monospace;
    --font-body:     'Crimson Pro', Georgia, 'Times New Roman', serif;
}

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

.compliance-token { display: none; }

html, body {
    background: var(--bg-obsidian);
    color: var(--gold-cream);
    font-family: var(--font-body);
    overflow-x: hidden;
    scroll-behavior: smooth;
    min-height: 100%;
}

body {
    position: relative;
    filter: contrast(1.02) brightness(0.98);
    min-height: 100vh;
}

/* --- Grain Overlay ----------------------------------------- */
body::after {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 9998;
    opacity: 0.04;
    mix-blend-mode: overlay;
    /* Inline SVG noise to avoid external asset */
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='200'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.78  0 0 0 0 0.70  0 0 0 0 0.47  0 0 0 0.12 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
    background-size: 200px 200px;
}

/* --- Ambient Bracket Ornaments ----------------------------- */
.bracket-ornament {
    position: fixed;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 120px;
    color: var(--gold);
    opacity: 0.05;
    pointer-events: none;
    z-index: 1;
    animation: bracket-spin 60s linear infinite;
    line-height: 1;
}
.bracket-left   { top: 30vh;  left: -30px;  }
.bracket-right  { top: 65vh;  right: -30px; animation-duration: 75s; animation-direction: reverse; }
.bracket-top    { top: -30px; left: 45%;    animation-duration: 90s; font-size: 90px; }
.bracket-bottom { bottom: -30px; left: 20%; animation-duration: 70s; animation-direction: reverse; font-size: 100px; }

@keyframes bracket-spin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

/* --- Boot Sequence ----------------------------------------- */
.boot-sequence {
    position: fixed;
    inset: 0;
    background: var(--bg-obsidian);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 800ms ease;
}
.boot-sequence.fade-out {
    opacity: 0;
    pointer-events: none;
}

.boot-inner {
    width: min(80vw, 820px);
    padding: 2rem;
}

.boot-lines {
    font-family: var(--font-mono);
    color: var(--gold-pale);
    font-size: clamp(0.85rem, 1.5vw, 1.05rem);
    line-height: 1.9;
    letter-spacing: 0.01em;
}

.boot-line {
    white-space: pre-wrap;
    color: var(--gold-pale);
}
.boot-line .boot-ok   { color: var(--gold-bright); }
.boot-line .boot-dim  { color: var(--gold-olive); }
.boot-line .boot-glow { color: var(--gold); }

.boot-cursor {
    display: inline-block;
    width: 0.55em;
    color: var(--gold);
    animation: blink 1s step-end infinite;
}

@keyframes blink {
    0%, 50%  { opacity: 1; }
    50.01%, 100% { opacity: 0; }
}

/* --- Main Content (hidden until boot finishes) ------------- */
.main-content {
    opacity: 0;
    transition: opacity 900ms ease 200ms;
    position: relative;
    z-index: 2;
}
.main-content.revealed { opacity: 1; }

/* --- Hero Section ----------------------------------------- */
.hero-section {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding: 6rem 6vw 4rem;
    overflow: hidden;
}

.hero-inner {
    max-width: 90vw;
    position: relative;
    z-index: 3;
}

.hero-title {
    font-family: var(--font-display);
    font-weight: 700;
    color: var(--gold);
    font-size: clamp(3.5rem, 12vw, 10rem);
    letter-spacing: 0.04em;
    line-height: 1.05;
    margin-bottom: 1.5rem;
}

.hero-prompt {
    font-family: var(--font-mono);
    color: var(--gold-olive);
    font-size: 0.55em;
    font-weight: 400;
    vertical-align: 0.4em;
    margin-right: 0.2em;
}

.hero-domain {
    display: inline-block;
}

.hero-cursor {
    display: inline-block;
    color: var(--gold-bright);
    animation: blink 1s step-end infinite;
    font-weight: 400;
}

.hero-sub {
    font-family: var(--font-mono);
    color: var(--gold-olive);
    font-size: clamp(0.85rem, 1.8vw, 1.1rem);
    line-height: 1.7;
    margin-left: 0.4em;
    letter-spacing: 0.02em;
    margin-bottom: 4rem;
}

.hero-scroll-hint {
    font-family: var(--font-mono);
    color: var(--gold-bronze);
    font-size: 0.85rem;
    letter-spacing: 0.1em;
    text-transform: lowercase;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    opacity: 0.8;
}
.scroll-caret {
    animation: bob 2.4s ease-in-out infinite;
    color: var(--gold);
}
@keyframes bob {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(6px); }
}

/* --- Console Drift: Organic flow ---------------------------- */
.console-drift {
    position: relative;
    padding: 6rem 0 8rem;
    overflow: visible;
}

.terminal-window {
    position: relative;
    background: var(--bg-smoky);
    border: 1px solid rgba(201, 168, 76, 0.40);
    border-radius: 6px;
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.5),
        inset 0 1px 0 rgba(201, 168, 76, 0.08);
    margin-bottom: 3.5rem;
    opacity: 0;
    transform: translateY(60px) translateX(-20px);
    transition:
        opacity 700ms ease,
        transform 700ms cubic-bezier(0.37, 0, 0.63, 1);
    overflow: hidden;
}

.terminal-window.visible {
    opacity: 1;
    transform: translateY(0) translateX(0);
}

/* Asymmetric offsets — no two share horizontal position */
.window-1        { width: 62%; margin-left: 10%;  }
.window-2        { width: 55%; margin-left: 38%;  transform: translateY(60px) translateX(20px); }
.window-3        { width: 70%; margin-left: 5%;   z-index: 3; }
.window-4        { width: 48%; margin-left: 50%;  transform: translateY(60px) translateX(20px); z-index: 2; }
.window-5        { width: 58%; margin-left: 22%;  }
.window-6        { width: 44%; margin-left: 54%;  transform: translateY(60px) translateX(20px); }

/* Slight overlap via negative margin on some */
.window-2 { margin-top: -2rem; }
.window-4 { margin-top: -1.5rem; }
.window-6 { margin-top: -1rem; }

.window-chrome {
    height: 32px;
    background: var(--bg-charcoal);
    border-bottom: 1px solid rgba(201, 168, 76, 0.25);
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 14px;
}

.dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
}
.dot-red   { background: var(--crimson-warn); }
.dot-gold  { background: var(--gold); }
.dot-green { background: var(--dot-green); }

.window-title {
    margin-left: auto;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--gold-olive);
    letter-spacing: 0.05em;
}

.window-body {
    padding: 2rem;
    background: var(--bg-obsidian);
}

.serif-heading {
    font-family: var(--font-display);
    font-weight: 700;
    color: var(--gold);
    font-size: clamp(2rem, 5vw, 4.5rem);
    letter-spacing: 0.04em;
    line-height: 1.05;
    margin-bottom: 1.25rem;
}

.body-serif {
    font-family: var(--font-body);
    font-weight: 400;
    color: var(--gold-cream);
    font-size: clamp(1rem, 2vw, 1.25rem);
    line-height: 1.75;
    margin-bottom: 1.5rem;
    max-width: 58ch;
}

.term-block {
    font-family: var(--font-mono);
    font-size: clamp(0.85rem, 1.8vw, 1.05rem);
    line-height: 1.7;
    color: var(--gold-pale);
    white-space: pre-wrap;
    margin: 0;
    overflow-x: auto;
}

.term-prompt { color: var(--gold); font-weight: 500; }
.term-cmd    { color: var(--gold-pale); }
.term-out    { color: var(--gold-cream); }
.term-dim    { color: var(--gold-olive); font-style: italic; }
.term-cursor { color: var(--gold-bright); animation: blink 1s step-end infinite; }
.ok          { color: var(--gold-bright); font-weight: 500; }

/* --- Diamond nodes --------------------------------------- */
.diamond-node {
    position: absolute;
    width: 10px;
    height: 10px;
    border: 1px solid var(--gold);
    background: transparent;
    transform: rotate(45deg);
    pointer-events: none;
    z-index: 1;
    animation: diamond-drift 14s cubic-bezier(0.37, 0, 0.63, 1) infinite;
}
.diamond-node.drift-diamond { width: 14px; height: 14px; animation-duration: 18s; }
.diamond-node.diamond-inverted { border-color: var(--ink-true); }

@keyframes diamond-drift {
    0%   { transform: rotate(45deg) translateY(0) translateX(0); opacity: 0.45; }
    25%  { transform: rotate(90deg) translateY(-18px) translateX(10px); opacity: 0.8; }
    50%  { transform: rotate(180deg) translateY(0) translateX(-8px); opacity: 0.55; }
    75%  { transform: rotate(315deg) translateY(20px) translateX(12px); opacity: 0.75; }
    100% { transform: rotate(405deg) translateY(0) translateX(0); opacity: 0.45; }
}

/* --- Floating gold dust particles ------------------------ */
.particles-container {
    position: fixed;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
    z-index: 2;
}

.gold-particle {
    position: fixed;
    border-radius: 50%;
    background: var(--gold);
    pointer-events: none;
    bottom: -10vh;
    animation-name: float-up;
    animation-timing-function: cubic-bezier(0.37, 0, 0.63, 1);
    animation-iteration-count: infinite;
}

@keyframes float-up {
    0%   { transform: translateY(0)     translateX(0);   opacity: 0; }
    10%  { opacity: 0.55; }
    50%  { transform: translateY(-60vh) translateX(18px); opacity: 0.7; }
    90%  { opacity: 0.35; }
    100% { transform: translateY(-120vh) translateX(-12px); opacity: 0; }
}

/* --- Cursor trail --------------------------------------- */
.cursor-trail {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 9997;
}

.trail-dot {
    position: fixed;
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: var(--gold);
    pointer-events: none;
    box-shadow: 0 0 6px rgba(201, 168, 76, 0.8);
    transition: opacity 600ms ease, transform 600ms ease;
    opacity: 0.9;
}

/* --- Ripple --------------------------------------------- */
.ripple {
    position: fixed;
    width: 0;
    height: 0;
    border-radius: 50%;
    pointer-events: none;
    z-index: 9996;
    background: radial-gradient(circle, rgba(201,168,76,0.3) 0%, transparent 70%);
    animation: ripple-expand 500ms ease-out forwards;
}

@keyframes ripple-expand {
    0%   { width: 0;     height: 0;     opacity: 1; }
    100% { width: 200px; height: 200px; opacity: 0; }
}

/* --- Root Access (inverted closing) ---------------------- */
.root-access {
    position: relative;
    min-height: 100vh;
    background: var(--gold);
    color: var(--ink-true);
    display: flex;
    align-items: center;
    padding: 6rem 6vw;
    overflow: hidden;
}

.root-inner {
    position: relative;
    z-index: 3;
    max-width: 92vw;
}

.root-heading {
    font-family: var(--font-display);
    font-weight: 700;
    color: var(--ink-true);
    font-size: clamp(2.2rem, 7vw, 6.5rem);
    letter-spacing: 0.04em;
    line-height: 1.05;
    margin-bottom: 1.25rem;
    word-break: break-word;
}

.root-prompt { display: inline; }

.root-cursor {
    display: inline-block;
    color: var(--ink-invert);
    animation: blink 1s step-end infinite;
}

.root-sub {
    font-family: var(--font-mono);
    color: var(--ink-invert);
    font-size: clamp(0.9rem, 1.8vw, 1.15rem);
    margin-bottom: 2.5rem;
    letter-spacing: 0.02em;
    opacity: 0.85;
}

.root-block {
    font-family: var(--font-mono);
    color: var(--ink-true);
    font-size: clamp(0.9rem, 1.8vw, 1.1rem);
    line-height: 1.9;
    white-space: pre-wrap;
    border-left: 2px solid var(--ink-true);
    padding-left: 1.25rem;
}
.root-line { display: block; color: var(--ink-invert); }

/* --- Persistent bottom-left prompt ----------------------- */
.prompt-badge {
    position: fixed;
    bottom: 1.25rem;
    left: 1.25rem;
    z-index: 9995;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: rgba(17, 17, 8, 0.85);
    border: 1px solid rgba(201, 168, 76, 0.35);
    border-radius: 4px;
    padding: 0.5rem 0.9rem;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--gold-pale);
    cursor: pointer;
    letter-spacing: 0.02em;
    transition: border-color 240ms ease, background 240ms ease, color 240ms ease;
    backdrop-filter: blur(4px);
}
.prompt-badge:hover {
    border-color: var(--gold);
    color: var(--gold-bright);
    background: rgba(20, 20, 16, 0.95);
}
.prompt-badge .badge-prompt { color: var(--gold); }
.prompt-badge .badge-cursor {
    color: var(--gold-bright);
    animation: blink 1s step-end infinite;
}

/* --- Responsive ------------------------------------------ */
@media (max-width: 768px) {
    body::after { opacity: 0.02; }

    .hero-section { padding: 5rem 5vw 3rem; }
    .hero-title   { font-size: clamp(2.8rem, 13vw, 5rem); }

    .console-drift { padding: 3rem 0 4rem; }

    .terminal-window,
    .window-1, .window-2, .window-3, .window-4, .window-5, .window-6 {
        width: 90%;
        margin-left: 5%;
        margin-right: 5%;
        margin-top: 0;
        margin-bottom: 2rem;
    }
    .window-2, .window-4, .window-6 {
        transform: translateY(60px) translateX(0);
    }
    .window-body { padding: 1.25rem; }
    .serif-heading { font-size: clamp(1.6rem, 7vw, 2.6rem); }

    .bracket-ornament { font-size: 70px; }

    .root-access { padding: 4rem 5vw; }
    .root-heading { font-size: clamp(1.8rem, 9vw, 3.5rem); }

    .prompt-badge { font-size: 0.75rem; padding: 0.4rem 0.7rem; }
}

@media (max-width: 480px) {
    .hero-prompt { font-size: 0.45em; }
    .term-block  { font-size: 0.8rem; }
}
