/* ─────────────────────────────────────────────
   Rosebrook AI — shared design system
   Editorial dark: EB Garamond display, Chivo body
   ───────────────────────────────────────────── */

:root {
    /* Color */
    --color-bg: #0b1233;
    --color-surface: rgba(255, 255, 255, 0.03);
    --color-text: #ffffff;
    --color-text-70: rgba(255, 255, 255, 0.7);
    --color-text-50: rgba(255, 255, 255, 0.5);
    --color-text-35: rgba(255, 255, 255, 0.35);
    --color-text-22: rgba(255, 255, 255, 0.22);
    --color-hairline: rgba(255, 255, 255, 0.08);
    --color-accent: #6ba3ff;
    --color-focus: rgba(107, 163, 255, 0.85);
    --color-danger: #ff8585;

    /* Typography */
    --font-display: 'EB Garamond', Georgia, serif;
    --font-body: 'Chivo', 'Helvetica Neue', sans-serif;

    /* Spacing */
    --space-page: 2.5rem;

    /* Motion */
    --duration-fast: 0.2s;
    --duration-base: 0.35s;
    --duration-slow: 0.6s;
    --ease-out: cubic-bezier(0.4, 0, 0.2, 1);
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
html, body { overflow-x: hidden; }
img { max-width: 100%; }
a, button { -webkit-tap-highlight-color: transparent; }

body {
    font-family: var(--font-body);
    color: var(--color-text);
    -webkit-font-smoothing: antialiased;
    /* Atmospheric depth: cool aurora glows over deep navy */
    background-color: var(--color-bg);
    background-image:
        radial-gradient(ellipse 85% 55% at 12% -12%, rgba(96, 155, 255, 0.22), transparent 62%),
        radial-gradient(ellipse 65% 45% at 92% 8%, rgba(155, 115, 255, 0.15), transparent 60%),
        radial-gradient(ellipse 70% 50% at 80% 108%, rgba(70, 125, 245, 0.18), transparent 62%),
        radial-gradient(ellipse 45% 35% at 8% 75%, rgba(120, 175, 255, 0.10), transparent 60%);
    background-attachment: fixed;
    position: relative;
}

/* Film grain over everything — kills the flat digital look */
body::after {
    content: '';
    position: fixed;
    inset: 0;
    z-index: 2000;
    pointer-events: none;
    opacity: 0.35;
    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='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='matrix' values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0.05 0'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* Faint dot grid anchors the editorial layout to a surface */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background-image: radial-gradient(rgba(255, 255, 255, 0.07) 1px, transparent 1px);
    background-size: 34px 34px;
    mask-image: linear-gradient(to bottom, rgba(0,0,0,0.8), rgba(0,0,0,0.25) 45%, rgba(0,0,0,0.6));
    -webkit-mask-image: linear-gradient(to bottom, rgba(0,0,0,0.8), rgba(0,0,0,0.25) 45%, rgba(0,0,0,0.6));
}

/* Focus visible — integrated into the aesthetic */
:focus { outline: none; }
:focus-visible {
    outline: 1px solid var(--color-focus);
    outline-offset: 4px;
    border-radius: 1px;
}

::selection { background: rgba(107, 163, 255, 0.28); }

/* ── Navbar ─────────────────────────────────── */
.navbar {
    position: fixed; top: 0; left: 0; right: 0; z-index: 100;
    display: flex; align-items: center; justify-content: space-between;
    padding: 1rem var(--space-page);
    transition: background var(--duration-base) ease, backdrop-filter var(--duration-base) ease, border-color var(--duration-base) ease;
}
.navbar--scrolled {
    background: rgba(8, 8, 8, 0.55);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border-bottom: 1px solid var(--color-hairline);
}
.navbar-brand { text-decoration: none; display: flex; align-items: center; }
.navbar-logo { height: 88px; width: auto; }
.navbar-links { display: flex; align-items: center; gap: 2.5rem; list-style: none; }
.navbar-links a {
    font-family: var(--font-body);
    font-size: 0.8rem; font-weight: 400;
    letter-spacing: 0.1em; text-transform: uppercase;
    color: rgba(255, 255, 255, 0.55);
    text-decoration: none;
    transition: color var(--duration-fast) ease;
}
.navbar-links a:hover { color: #fff; }
.navbar-links a.active { color: rgba(255, 255, 255, 0.9); }
.navbar-links .nav-cta {
    color: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 0.5rem 1.25rem; border-radius: 2px;
    transition: background var(--duration-fast) ease, border-color var(--duration-fast) ease;
}
.navbar-links .nav-cta:hover { background: rgba(255, 255, 255, 0.08); border-color: rgba(255, 255, 255, 0.6); }

/* ── Mobile menu toggle ─────────────────────── */
.navbar-toggle {
    display: none;
    position: relative;
    width: 44px; height: 44px;
    background: none; border: none;
    cursor: pointer;
    z-index: 210;
    padding: 0;
    flex-shrink: 0;
}
.navbar-toggle span {
    position: absolute; left: 11px; right: 11px;
    height: 1.5px; background: #fff;
    transition: transform var(--duration-base) var(--ease-out), opacity var(--duration-fast) ease, top var(--duration-base) var(--ease-out);
}
.navbar-toggle span:nth-child(1) { top: 16px; }
.navbar-toggle span:nth-child(2) { top: 21px; }
.navbar-toggle span:nth-child(3) { top: 26px; }
.navbar-toggle.open span:nth-child(1) { top: 21px; transform: rotate(45deg); }
.navbar-toggle.open span:nth-child(2) { opacity: 0; }
.navbar-toggle.open span:nth-child(3) { top: 21px; transform: rotate(-45deg); }

.navbar-scrim {
    position: fixed; inset: 0; z-index: 90;
    background: rgba(2, 4, 16, 0.5);
    opacity: 0; pointer-events: none;
    transition: opacity var(--duration-base) ease;
}
.navbar-scrim.open { opacity: 1; pointer-events: auto; }

/* ── Page header ────────────────────────────── */
.page-header { padding: 14rem var(--space-page) 5rem; border-bottom: 1px solid var(--color-hairline); }
.page-header-label {
    font-size: 0.68rem; letter-spacing: 0.25em; text-transform: uppercase;
    color: rgba(255, 255, 255, 0.28); margin-bottom: 1.5rem;
}
.page-header-title {
    font-family: var(--font-display);
    font-size: clamp(3rem, 7vw, 7rem);
    font-weight: 500; line-height: 1.0; letter-spacing: -0.01em;
    color: #fff; margin-bottom: 1.5rem;
}
.page-header-title em { font-style: italic; color: rgba(255, 255, 255, 0.82); }
.page-header-sub {
    font-size: clamp(0.9rem, 1.5vw, 1.1rem); font-weight: 300;
    color: rgba(255, 255, 255, 0.4);
    max-width: 480px; line-height: 1.7;
}

/* ── CTA strip ──────────────────────────────── */
.cta-strip { padding: 5rem var(--space-page) 6rem; border-top: 1px solid var(--color-hairline); text-align: center; }
.cta-strip-title {
    font-family: var(--font-display);
    font-size: clamp(1.75rem, 4vw, 3rem); font-weight: 500;
    color: rgba(255, 255, 255, 0.85); margin-bottom: 2rem;
}
.cta-btn {
    display: inline-flex; align-items: center; gap: 0.75rem;
    font-family: var(--font-body);
    font-size: 0.75rem; font-weight: 500;
    letter-spacing: 0.14em; text-transform: uppercase;
    color: #fff; background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 0.85rem 2rem; border-radius: 2px;
    cursor: pointer; text-decoration: none;
    transition: background var(--duration-fast) ease, border-color var(--duration-fast) ease;
    min-height: 44px;
}
.cta-btn:hover { background: rgba(255, 255, 255, 0.07); border-color: rgba(255, 255, 255, 0.6); }

/* ── Footer ─────────────────────────────────── */
.site-footer {
    border-top: 1px solid var(--color-hairline);
    padding: 3rem var(--space-page);
    display: flex; align-items: center; justify-content: space-between; gap: 2rem;
}
.site-footer-logo { height: 56px; width: auto; opacity: 0.75; }
.site-footer-meta { display: flex; align-items: center; gap: 2rem; }
.site-footer a {
    font-size: 0.72rem; letter-spacing: 0.12em; text-transform: uppercase;
    color: rgba(255, 255, 255, 0.4); text-decoration: none;
    transition: color var(--duration-fast) ease;
}
.site-footer a:hover { color: rgba(255, 255, 255, 0.85); }
.site-footer-copy { font-size: 0.7rem; letter-spacing: 0.1em; color: rgba(255, 255, 255, 0.22); }

/* ── Custom cursor ──────────────────────────── */
@media (pointer: fine) {
    * { cursor: none !important; }
    .cursor-dot {
        position: fixed; top: 0; left: 0;
        width: 7px; height: 7px;
        background: #fff; border-radius: 50%;
        pointer-events: none; z-index: 9999;
        will-change: transform; opacity: 0;
    }
    .cursor-ring {
        position: fixed; top: 0; left: 0;
        width: 36px; height: 36px;
        border: 1.5px solid rgba(255, 255, 255, 0.6);
        border-radius: 50%;
        pointer-events: none; z-index: 9998;
        will-change: transform; opacity: 0;
    }
}

/* ── Responsive chrome ──────────────────────── */
@media (max-width: 768px) {
    :root { --space-page: 1.25rem; }
    .navbar { padding: 1.25rem var(--space-page); }
    .navbar-logo { height: 64px; }
    .navbar-toggle { display: block; }

    .navbar-links {
        position: fixed; top: 0; right: 0; bottom: 0;
        width: min(78vw, 340px);
        flex-direction: column;
        align-items: flex-start;
        justify-content: center;
        gap: 2.25rem;
        padding: 6rem 2.5rem 3rem;
        background: rgba(6, 10, 28, 0.97);
        backdrop-filter: blur(24px);
        -webkit-backdrop-filter: blur(24px);
        border-left: 1px solid var(--color-hairline);
        transform: translateX(100%);
        transition: transform var(--duration-slow) var(--ease-out);
        z-index: 200;
        overflow-y: auto;
    }
    .navbar-links.open { transform: translateX(0); }
    .navbar-links li { width: 100%; }
    .navbar-links a {
        font-size: 1.05rem;
        display: block;
        padding: 0.5rem 0;
        min-height: 44px;
        display: flex;
        align-items: center;
    }
    .navbar-links .nav-cta {
        display: flex;
        width: 100%;
        justify-content: center;
        margin-top: 0.5rem;
    }

    .page-header { padding: 8.5rem var(--space-page) 3rem; }
    .cta-strip { padding: 3rem var(--space-page) 4rem; }
    .site-footer { flex-direction: column; align-items: flex-start; gap: 1.25rem; }
}

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