/* Spectra Design — design tokens
   Brand gradient sourced from assets/icon-spectra-degrade.svg (#9871FF -> #8966FF -> #D988FF) */

@font-face {
    font-family: 'Sora';
    src: url('/assets/fonts/Sora-Light.woff') format('woff');
    font-weight: 300;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Sora';
    src: url('/assets/fonts/Sora-Regular.woff') format('woff');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Sora';
    src: url('/assets/fonts/Sora-SemiBold.woff') format('woff');
    font-weight: 600;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Instrument Serif';
    src: url('/assets/fonts/InstrumentSerif-Italic.woff') format('woff');
    font-weight: 400;
    font-style: italic;
    font-display: swap;
}

:root {
    /* Surfaces */
    --bg: #0a0a0f;
    --bg-elevated: #101018;
    --surface: #131320;
    --surface-2: #171726;
    --border: rgba(255, 255, 255, 0.08);
    --border-strong: rgba(255, 255, 255, 0.14);

    /* Text */
    --text: #f3f2f8;
    --text-muted: #a3a0b8;
    --text-faint: #6d6a85;

    /* Brand */
    --purple-1: #9871ff;
    --purple-2: #8966ff;
    --purple-3: #d988ff;
    --gradient-brand: linear-gradient(135deg, var(--purple-1) 0%, var(--purple-2) 45%, var(--purple-3) 100%);
    --gradient-text: linear-gradient(90deg, #b79bff 0%, #d988ff 100%);
    --accent: #9871ff;
    --accent-soft: rgba(152, 113, 255, 0.14);
    --accent-border: rgba(152, 113, 255, 0.35);

    /* Status */
    --success: #6fe0a3;
    --success-soft: rgba(111, 224, 163, 0.12);
    --warning: #f2c675;
    --warning-soft: rgba(242, 198, 117, 0.12);
    --danger: #ff7a8a;
    --danger-soft: rgba(255, 122, 138, 0.12);

    /* Type */
    --font-sans: 'Sora', system-ui, -apple-system, 'Segoe UI', sans-serif;
    --font-serif: 'Instrument Serif', Georgia, serif;

    /* Radius */
    --r-sm: 8px;
    --r-md: 14px;
    --r-lg: 20px;
    --r-xl: 28px;
    --r-pill: 999px;

    /* Shadow */
    --shadow-md: 0 8px 30px rgba(0, 0, 0, 0.35);
    --shadow-glow: 0 0 60px rgba(152, 113, 255, 0.18);

    /* Motion */
    --ease: cubic-bezier(0.16, 1, 0.3, 1);
    --dur-fast: 160ms;
    --dur-med: 380ms;
    --dur-slow: 700ms;
}

/* ---------- Animated gradient button (purple) ----------
   Two stacked radial-gradient layers (base + hover) crossfaded via opacity.
   This avoids relying on `@property`-driven custom-property transitions,
   which some environments silently apply as an instant jump instead of an
   interpolation — opacity crossfades are universally smooth. */
.gradient-btn, .btn-primary {
    position: relative;
    isolation: isolate;
    background: radial-gradient(150% 180% at 15% 130%, #0a0714 0%, #1c1033 30%, #3c1f7a 58%, #6a3fd6 82%, #9871ff 100%) !important;
    background-clip: padding-box !important;
    border: none !important;
    color: #fff !important;
    /* The breathing layer below never stops or restarts on hover — only a
       `filter` brightness boost is transitioned in/out, so both directions
       of the hover transition stay smooth instead of snapping. */
    transition: transform var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease), filter 0.45s var(--ease);
}
.gradient-btn::after, .btn-primary::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: -2;
    border-radius: inherit;
    background: radial-gradient(140% 160% at 0% 100%, #1d1140 0%, #4620a0 28%, #7c4dff 55%, #b98bff 80%, #efe0ff 100%);
    opacity: 0.18;
    animation: gbBreathe 3.2s ease-in-out infinite;
}
@keyframes gbBreathe {
    0%, 100% { opacity: 0.16; }
    50% { opacity: 0.52; }
}
.gradient-btn::before, .btn-primary::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: -1;
    border-radius: inherit;
    padding: 1px;
    background: linear-gradient(20deg, hsla(262, 75%, 65%, 0.25), hsla(272, 75%, 55%, 0.75));
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
    transition: background 0.55s var(--ease);
}
.gradient-btn:hover, .btn-primary:hover {
    transform: translateY(-2px);
    filter: brightness(1.4) saturate(1.15);
}
.gradient-btn:hover::before, .btn-primary:hover::before {
    background: linear-gradient(190deg, hsla(272, 78%, 90%, 0.2), hsla(272, 75%, 85%, 0.8));
}
@media (prefers-reduced-motion: reduce) {
    .gradient-btn, .gradient-btn:hover, .btn-primary, .btn-primary:hover { transition: none; transform: none; }
    .gradient-btn::after, .btn-primary::after { transition: none; animation: none; opacity: 0.3; }
}

* { box-sizing: border-box; }
html { color-scheme: dark; -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
html { scroll-padding-top: 24px; }
body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-sans);
    font-weight: 400;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}
img, svg { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; }

::selection { background: var(--purple-2); color: #fff; }

:focus-visible {
    outline: 2px solid var(--purple-1);
    outline-offset: 2px;
    border-radius: 4px;
}

.grad-text {
    background: var(--gradient-text);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.serif-italic {
    font-family: var(--font-serif);
    font-style: italic;
    font-weight: 400;
    font-size: 1.22em;
    background: var(--gradient-text);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

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