/* ==========================================================================
   Base Styles
   Universal reset, root typography scale, shared primitives (container,
   section header, buttons, icons, reveal-on-scroll), focus + selection
   states. Every other stylesheet builds on this foundation.
   ========================================================================== */

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

html
{
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--header-h) + 16px);
}

body
{
    min-height: 100vh;
    font-family: var(--font-body);
    font-size: var(--fs-body);
    line-height: 1.7;
    color: var(--color-text-primary);
    background-color: var(--color-bg-deep);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    overflow-x: hidden;
}

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

a { color: inherit; text-decoration: none; }

button, input, select, textarea
{
    font: inherit;
    color: inherit;
    background: none;
    border: none;
    outline: none;
}
button { cursor: pointer; }

ul, ol { list-style: none; }

h1, h2, h3, h4
{
    font-family: var(--font-display);
    font-weight: 600;
    line-height: 1.15;
    letter-spacing: 0.01em;
}

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

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

/* --- Scrollbar --- */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--color-bg-deep); }
::-webkit-scrollbar-thumb
{
    background: var(--color-border);
    border-radius: 999px;
    border: 2px solid var(--color-bg-deep);
}
::-webkit-scrollbar-thumb:hover { background: var(--color-accent-dim); }
html { scrollbar-width: thin; scrollbar-color: var(--color-border) var(--color-bg-deep); }

/* --- Layout primitives --- */
.container
{
    width: 100%;
    max-width: var(--max-width);
    margin-inline: auto;
    padding-inline: clamp(20px, 5vw, 32px);
}

.section { padding-block: var(--section-padding); position: relative; z-index: 2; }
.section-alt { background: var(--color-bg-primary); }

/* --- Section header trio --- */
.section-header { max-width: 720px; margin-inline: auto; text-align: center; }
.section-header--tight { margin-bottom: 28px; }

.section-label
{
    font-family: var(--font-body);
    font-size: var(--fs-xs);
    font-weight: 600;
    letter-spacing: 0.32em;
    text-transform: uppercase;
    color: var(--color-accent);
    margin-bottom: 14px;
}

.section-title
{
    font-size: clamp(2rem, 4.4vw, 3.1rem);
    color: var(--color-text-primary);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}
.section-title--sm { font-size: clamp(1.5rem, 3vw, 2rem); }

.section-desc
{
    margin-top: 18px;
    color: var(--color-text-secondary);
    font-size: clamp(1rem, 1.6vw, 1.12rem);
}

/* --- Icons --- */
.icon
{
    width: 1em;
    height: 1em;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
    flex: none;
}
.icon-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

/* --- Buttons --- */
.btn
{
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 26px;
    border-radius: 999px;
    font-size: var(--fs-sm);
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    transition: var(--transition);
    border: 1px solid transparent;
    white-space: nowrap;
}
.btn .icon { width: 14px; height: 14px; }

.btn-primary
{
    background: linear-gradient(135deg, var(--color-accent), var(--color-accent-bright));
    color: var(--color-bg-deep);
    box-shadow: 0 10px 30px -12px var(--color-accent-glow);
}
.btn-primary:hover
{
    transform: translateY(-3px);
    box-shadow: 0 18px 40px -14px var(--color-accent-glow);
}

.btn-ghost
{
    border-color: var(--color-border-strong);
    color: var(--color-text-primary);
    background: var(--color-surface-glass);
    backdrop-filter: blur(8px);
}
.btn-ghost:hover
{
    border-color: var(--color-accent);
    color: var(--color-accent);
    transform: translateY(-3px);
}

/* --- Field labels --- */
.field-label
{
    display: block;
    font-size: var(--fs-xs);
    font-weight: 600;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--color-text-muted);
    margin-bottom: 8px;
}

/* --- Reveal on scroll (only hidden once JS is confirmed) --- */
.js .reveal
{
    opacity: 0;
    transform: translateY(26px);
    transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.22, 0.61, 0.36, 1);
}
.js .reveal.is-visible { opacity: 1; transform: none; }

/* --- 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;
    }
    .js .reveal { opacity: 1 !important; transform: none !important; }
}
