/* ============================================================
   BASE — reset, defaults, typography, focus rings
   Loaded after tokens.css. Sets the global look & feel.
   ============================================================ */

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

html {
    scroll-behavior: smooth;
    background: var(--bg);
    /* Yellow-on-yellow scrollbar */
    scrollbar-color: var(--accent) var(--bg);
    scrollbar-width: thin;
}

body {
    font-family: var(--font-sans);
    font-size: var(--fs-base);
    line-height: var(--lh-base);
    color: var(--text);
    background: transparent;       /* particle canvas (z-index: -1) shows through */
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-feature-settings: "ss01", "cv11";
}
/* Force a stacking context isolation so transforms inside main can't
   accidentally promote html's bg above the fixed bg-canvas. */
main { position: relative; z-index: var(--z-content); }

/* Typography defaults */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: var(--lh-tight);
    letter-spacing: -0.02em;
}
h1 { font-size: var(--fs-h1); }
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); }
h4 { font-size: var(--fs-lg); }

p { line-height: var(--lh-loose); color: var(--text-muted); }

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

button {
    background: none;
    border: 0;
    color: inherit;
    font: inherit;
    cursor: pointer;
}

input, textarea, select {
    font: inherit;
    color: inherit;
}

img, svg, video {
    display: block;
    max-width: 100%;
    height: auto;
}

ul, ol { list-style: none; }

code, kbd, pre {
    font-family: var(--font-mono);
}

::selection {
    background: var(--accent);
    color: var(--bg);
}

/* Webkit scrollbar — accent gradient thumb */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--accent), var(--accent-dark));
    border-radius: 100px;
    border: 2px solid var(--bg);
    box-shadow: inset 0 0 6px rgba(172, 205, 255, 0.4);
}
::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, var(--accent-bright), var(--accent));
}
::-webkit-scrollbar-button { display: none; }

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

/* Skip link for keyboard a11y */
.skip-link {
    position: absolute;
    top: -100px;
    left: 16px;
    background: var(--accent);
    color: var(--bg);
    padding: 10px 18px;
    border-radius: var(--radius-sm);
    font-weight: 700;
    font-size: var(--fs-sm);
    z-index: var(--z-toast);
    transition: top var(--dur-base) var(--ease);
}
.skip-link:focus {
    top: 16px;
    outline: 2px solid var(--accent-bright);
    outline-offset: 2px;
}

/* Utility: container */
.container {
    max-width: var(--container);
    margin: 0 auto;
    padding-inline: var(--pad-inline);
}
.container-narrow {
    max-width: var(--container-narrow);
    margin: 0 auto;
    padding-inline: var(--pad-inline);
}

/* Utility: highlighted inline text */
.hl { color: var(--accent); font-weight: 600; }

/* Utility: gradient text — for hero / section titles */
.gradient-text {
    background: var(--grad-accent);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
}

/* Utility: monospace tag/label */
.mono { font-family: var(--font-mono); }

/* Section base — Round 4.3: scope to landing/public main only.
   Admin portal sections must NOT inherit space-2xl padding (was adding
   ~216px per <section> on wide viewports, blowing up dashboard layout). */
main:not(.portal-main) > section,
main:not(.portal-main) section.section {
    padding-block: var(--space-2xl);
    padding-inline: var(--pad-inline);
}

/* Defensive override — kill leftover section padding inside portal layout.
   Sections inside .portal-main shouldn't have any auto-padding; spacing is
   handled by per-component margins (quick-actions-section, stat-grid, etc.). */
.portal-main section {
    padding-block: 0;
    padding-inline: 0;
}

/* Reveal-on-scroll — pure CSS, triggered by .is-visible class from JS */
.reveal {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
    will-change: opacity, transform;
}
.reveal.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* Hide on mobile / show on desktop helpers */
@media (max-width: 720px) {
    .hide-mobile { display: none !important; }
}
@media (min-width: 721px) {
    .show-mobile { display: none !important; }
}
