/* ============================================
   Design tokens, reset, base typography
   Datacenter-dark system for unclelyh.me
   Carbon surfaces · phosphor-green power · amber activity
   ============================================ */

@font-face {
    font-family: 'Archivo';
    font-style: normal;
    font-weight: 100 900;
    font-stretch: 62% 125%;
    font-display: swap;
    src: url('../fonts/archivo-var.woff2') format('woff2');
}

:root {
    --font-sans: 'Archivo', 'Helvetica Neue', Helvetica, sans-serif;
    --font-mono: ui-monospace, 'SF Mono', SFMono-Regular, 'JetBrains Mono',
                 'Cascadia Code', Menlo, Consolas, 'Liberation Mono', monospace;
    --max-width: 1040px;
    --gutter: clamp(1.25rem, 4vw, 3rem);
    --ease: cubic-bezier(0.22, 1, 0.36, 1);
    --head-h: 3.25rem;

    /* One committed theme: the datacenter at night, phosphor green */
    --bg: #0c0f0d;
    --bg-elev: #131714;
    --bg-inset: #1b201c;
    --fg: #e9efe9;
    --fg-dim: #9fa89f;
    --fg-faint: #656e65;
    --accent: #2fdc6e;          /* phosphor green — power */
    --accent-ink: #4be584;      /* readable green for small text */
    --amber: #ffb224;           /* secondary LED — activity */
    --rule: #232823;            /* hairlines */
    --rule-strong: #39413a;     /* structural lines */
    --ring: rgba(47, 220, 110, 0.5);
    --glow: rgba(47, 220, 110, 0.16);
}

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

html {
    font-size: 16px;
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--head-h) + 1.5rem);
    color-scheme: dark;
}

body {
    font-family: var(--font-sans);
    background-color: var(--bg);
    color: var(--fg);
    line-height: 1.6;
    min-height: 100vh;
    font-size: 1rem;
    font-weight: 410;
    overflow-x: clip;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

/* Fine grain overlay */
.grain {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 2000;
    opacity: 0.05;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E");
    background-size: 140px 140px;
}

a {
    color: inherit;
    text-decoration: underline;
    text-decoration-color: var(--fg-faint);
    text-underline-offset: 0.2em;
    text-decoration-thickness: 1px;
    transition: color 0.16s var(--ease), text-decoration-color 0.16s var(--ease);
}
a:hover {
    color: var(--accent-ink);
    text-decoration-color: var(--accent-ink);
}

.mono {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

/* ---- Accessibility ---- */
.skip-link {
    position: absolute;
    top: -100%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--fg);
    color: var(--bg);
    padding: 0.75rem 1.5rem;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    z-index: 3000;
    transition: top 0.2s ease;
}
.skip-link:focus { top: 0; outline: none; }

:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}
:focus:not(:focus-visible) { outline: none; }

.visually-hidden {
    position: absolute !important;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}

::selection {
    background-color: var(--accent);
    color: #0c0f0d;
}

/* Ambient glow — quiet depth behind the page (replaces the WebGL rain) */
.glow {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    background:
        radial-gradient(55% 40% at 50% -6%, var(--glow) 0%, transparent 65%),
        radial-gradient(30% 26% at 88% 12%, rgba(255, 178, 36, 0.05) 0%, transparent 70%);
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
}
