/* Inclawbate — Core Design System */

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

:root {
    /* Background hierarchy — cool near-black */
    --bg-deepest: #06060b;
    --bg-surface: #0a0a11;
    --bg-elevated: #101018;
    --bg-card: #15151e;
    --bg-card-hover: #1b1b26;

    /* Borders */
    --border-subtle: hsl(240, 4%, 16%);
    --border-default: hsl(240, 3%, 22%);
    --border-bright: hsl(240, 2%, 30%);

    /* Primary accent — Lobster Coral */
    --lobster-200: hsl(11, 48%, 78%);
    --lobster-300: hsl(10, 46%, 66%);
    --lobster-400: hsl(9, 52%, 56%);
    --lobster-500: hsl(8, 48%, 46%);
    --accent-primary: var(--lobster-400);
    --accent-glow: hsla(9, 60%, 54%, 0.18);
    --accent-gradient: linear-gradient(135deg, var(--lobster-400), hsl(18, 60%, 62%));
    --title-gradient: linear-gradient(135deg, #f0ece6 0%, #d4a574 40%, #c75b3f 65%, #e8b4a0 100%);

    /* Secondary — Seafoam Teal */
    --seafoam-300: hsl(172, 30%, 56%);
    --seafoam-400: hsl(172, 32%, 48%);
    --seafoam-500: hsl(172, 34%, 38%);
    --accent-secondary: var(--seafoam-400);

    /* Tertiary — Sand/Gold */
    --sand-300: hsl(32, 32%, 66%);
    --sand-400: hsl(30, 30%, 54%);

    /* Info */
    --blue-400: hsl(210, 28%, 54%);

    /* Status */
    --green: var(--seafoam-400);
    --green-dim: hsla(172, 32%, 48%, 0.12);
    --red: hsl(0, 68%, 56%);
    --red-dim: hsla(0, 68%, 56%, 0.1);
    --yellow: var(--sand-300);
    --yellow-dim: hsla(32, 32%, 66%, 0.12);

    /* Text */
    --text-primary: hsl(12, 8%, 92%);
    --text-secondary: hsl(12, 4%, 58%);
    --text-dim: hsl(12, 2%, 42%);
    --text-on-accent: hsl(0, 0%, 100%);

    /* Typography */
    --font-display: 'Nunito', system-ui, -apple-system, sans-serif;
    --font-body: 'Nunito', system-ui, -apple-system, sans-serif;
    --font-mono: 'JetBrains Mono', 'Courier New', monospace;

    /* Spacing */
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 14px;
    --space-lg: 20px;
    --space-xl: 28px;
    --space-2xl: 40px;
    --space-3xl: 64px;
    --space-4xl: 88px;

    /* Radius */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-xl: 18px;
    --radius-2xl: 24px;
    --radius-full: 9999px;

    /* Shadows */
    --shadow-sm: 0 1px 3px hsla(240, 10%, 3%, 0.5);
    --shadow-md: 0 4px 16px hsla(240, 10%, 3%, 0.55);
    --shadow-lg: 0 8px 32px hsla(240, 10%, 3%, 0.6);
    --shadow-xl: 0 16px 48px hsla(240, 10%, 3%, 0.7);
    --shadow-glow: 0 0 24px hsla(9, 60%, 54%, 0.2);
    --shadow-glow-lg: 0 0 40px hsla(9, 60%, 54%, 0.25), 0 0 80px hsla(9, 60%, 54%, 0.08);
    --shadow-glow-teal: 0 0 24px hsla(172, 40%, 48%, 0.15);

    /* Transitions */
    --transition-fast: 120ms ease-out;
    --transition-base: 200ms ease-out;
    --transition-slow: 400ms ease-out;
    --ease-smooth: cubic-bezier(0.22, 1, 0.36, 1);
    --ease-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);

    /* Layout */
    --max-width: 1280px;
    --max-width-narrow: 600px;
    --nav-height: 60px;
}

html { scroll-behavior: smooth; scrollbar-gutter: stable; }

body {
    font-family: var(--font-body);
    background: var(--bg-deepest);
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    min-height: 100vh;
    opacity: 1;
    transition: opacity 0.15s ease-out;
}

a { color: var(--lobster-300); text-decoration: none; transition: color var(--transition-fast); }
a:hover { color: var(--lobster-200); }

img { max-width: 100%; display: block; }

.hidden { display: none !important; }

.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 var(--space-xl);
}

/* ── Subtle noise overlay ── */
body::before {
    content: '';
    position: fixed; top: 0; left: 0; right: 0; bottom: 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.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='256' height='256' filter='url(%23n)' opacity='0.03'/%3E%3C/svg%3E");
    background-repeat: repeat;
    pointer-events: none; z-index: 0;
    opacity: 0.4;
}

body > * { position: relative; z-index: 1; }

/* ── Spinner ── */
.spinner {
    width: 22px; height: 22px;
    border: 2px solid var(--border-subtle);
    border-top-color: var(--lobster-400);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}
.spinner-lg { width: 36px; height: 36px; border-width: 3px; }

@keyframes spin { to { transform: rotate(360deg); } }

/* ── Toast ── */
.toast {
    position: fixed; bottom: var(--space-xl); right: var(--space-xl);
    padding: var(--space-md) var(--space-xl);
    border-radius: var(--radius-md);
    font-size: 0.875rem; font-weight: 600;
    z-index: 9999; backdrop-filter: blur(12px);
    animation: toast-in 0.35s var(--ease-smooth);
}
.toast-success { background: var(--green-dim); color: var(--seafoam-300); border: 1px solid hsla(172, 32%, 48%, 0.2); }
.toast-error { background: var(--red-dim); color: var(--red); border: 1px solid hsla(0, 68%, 56%, 0.2); }

@keyframes toast-in { from { opacity: 0; transform: translateY(12px) scale(0.96); } to { opacity: 1; transform: translateY(0) scale(1); } }

/* ── Glow keyframes ── */
@keyframes pulse-glow {
    0%, 100% { box-shadow: 0 0 20px hsla(9, 60%, 54%, 0.12); }
    50% { box-shadow: 0 0 32px hsla(9, 60%, 54%, 0.22); }
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
}

@keyframes shimmer {
    0% { background-position: -200% center; }
    100% { background-position: 200% center; }
}

/* ── Selection ── */
::selection {
    background: hsla(9, 52%, 54%, 0.3);
    color: var(--text-primary);
}

/* ── Select / Dropdown ── */
select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 0.85rem;
    padding: 9px 36px 9px 12px;
    cursor: pointer;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none'%3E%3Cpath d='M1 1.5l5 5 5-5' stroke='%23888' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 12px;
    width: 100%;
}
select:hover { border-color: var(--border-bright); }
select:focus { border-color: var(--lobster-400); outline: none; box-shadow: 0 0 0 2px var(--accent-glow); }
select option {
    background: var(--bg-card);
    color: var(--text-primary);
    padding: 8px 12px;
}
select option:checked {
    background: var(--lobster-500);
    color: var(--text-on-accent);
}
select option:hover {
    background: var(--bg-card-hover);
}
select:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg-deepest); }
::-webkit-scrollbar-thumb { background: var(--border-default); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--border-bright); }
::-webkit-scrollbar-button { display: none; height: 0; }
