/* ──────────────────────────────────────────
   SchematicVault — Base Styles v2
   ────────────────────────────────────────── */

/* Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&family=JetBrains+Mono:wght@400;600&display=swap');

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

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    background-color: var(--bg);
    color: var(--text);
    font-family: var(--font-sans);
    font-size: 16px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Body noise texture for depth */
body::before {
    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.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='1'/%3E%3C/svg%3E");
    opacity: 0.018;
    pointer-events: none;
    z-index: 0;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    letter-spacing: -0.025em;
    line-height: 1.2;
    color: var(--text);
}
h1 { font-size: clamp(1.75rem, 4vw, 3rem); }
h2 { font-size: clamp(1.25rem, 3vw, 2rem); }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.05rem; }

p { color: var(--text-2); }

a {
    color: inherit;
    text-decoration: none;
    transition: color var(--dur-fast) ease;
}
a:hover { color: var(--accent); }

code, pre {
    font-family: var(--font-mono);
    font-size: 0.875em;
}

strong { color: var(--text); }

/* Form Elements */
input, select, textarea, button {
    font-family: inherit;
    font-size: inherit;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="url"],
input[type="number"],
input[type="search"],
select,
textarea {
    background: var(--bg3);
    border: 1px solid var(--border);
    border-radius: var(--r);
    padding: 10px 14px;
    color: var(--text);
    transition: border-color var(--dur-fast) ease, box-shadow var(--dur-fast) ease, background var(--dur-fast) ease;
    width: 100%;
    outline: none;
}

input[type="text"]:hover,
input[type="password"]:hover,
input[type="url"]:hover,
select:hover,
textarea:hover {
    border-color: var(--border-hover);
    background: var(--bg4);
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="url"]:focus,
input[type="number"]:focus,
input[type="search"]:focus,
select:focus,
textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-light);
    background: var(--bg3);
}

input::placeholder, textarea::placeholder { color: var(--text-muted); }

select { appearance: none; cursor: pointer; }

/* Scrollbar */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb {
    background: var(--bg5);
    border-radius: var(--r-pill);
    border: 2px solid var(--bg);
}
::-webkit-scrollbar-thumb:hover { background: var(--border-hover); }

/* Text selection */
::selection {
    background: var(--accent-mid);
    color: var(--text);
}

/* Focus visible */
:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
    border-radius: 4px;
}

/* Utility */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    white-space: nowrap;
}

.hide-scrollbar { -ms-overflow-style: none; scrollbar-width: none; }
.hide-scrollbar::-webkit-scrollbar { display: none; }

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeDown {
    from { opacity: 0; transform: translateY(-16px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes scaleIn {
    from { opacity: 0; transform: scale(0.94); }
    to   { opacity: 1; transform: scale(1); }
}
@keyframes slideInRight {
    from { opacity: 0; transform: translateX(24px); }
    to   { opacity: 1; transform: translateX(0); }
}
@keyframes slideInLeft {
    from { opacity: 0; transform: translateX(-24px); }
    to   { opacity: 1; transform: translateX(0); }
}
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.5; }
}
@keyframes shimmer {
    from { background-position: -200% center; }
    to   { background-position:  200% center; }
}
@keyframes spin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}
@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50%       { transform: translateY(-8px); }
}
@keyframes glowPulse {
    0%, 100% { box-shadow: 0 0 20px var(--accent-glow); }
    50%       { box-shadow: 0 0 40px var(--accent-glow), 0 0 80px var(--accent-glow); }
}

.animate-fadeUp   { animation: fadeUp   var(--dur-slow) var(--ease-out) both; }
.animate-fadeDown { animation: fadeDown var(--dur-slow) var(--ease-out) both; }
.animate-scaleIn  { animation: scaleIn  var(--dur-slow) var(--ease-out) both; }
.animate-float    { animation: float 4s ease-in-out infinite; }

/* Gradient text helper */
.gradient-text {
    background: linear-gradient(135deg, var(--text) 0%, var(--accent-2) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
