/* =====================================================
   BASE.CSS — Tokens, reset, typography, utilities
   -----------------------------------------------------
   Kali / hacker-terminal direction.
   Black glass + phosphor green, amber warnings. Hard
   rules read as wireframe, monospace chrome everywhere,
   one big grotesk display reserved for scale.
   ===================================================== */


/* =====================================================
   TOKENS
   ===================================================== */
:root {
    /* Color — void + phosphor, amber for caution */
    --paper: #090c09;        /* near-black terminal background */
    --paper-2: #10150f;      /* raised panel */
    --paper-3: #161d16;      /* chrome bar / hovered panel */
    --void: #030402;         /* true-black, full-bleed panels */
    --ink: #d6fbe0;          /* bright phosphor text / hard-rule borders */
    --ink-soft: #9fcfa8;     /* body copy — softer phosphor */
    --muted: #5f8468;        /* meta / dim labels */
    --accent: #39ff14;       /* neon phosphor green */
    --accent-ink: #04140a;   /* dark text placed on accent fills */
    --warn: #ffb020;         /* amber — caution / authorized-use notes */
    --rule-soft: rgba(159, 207, 168, 0.16); /* faint divider on dark bg */

    /* Type */
    --display: "Space Grotesk", "Arial Narrow", sans-serif;
    --mono: "JetBrains Mono", "Space Mono", "SFMono-Regular", ui-monospace, monospace;

    /* Fluid display scale */
    --fs-mega: clamp(3.25rem, 13vw, 12.5rem);
    --fs-xl: clamp(2.5rem, 8vw, 6rem);
    --fs-lg: clamp(1.9rem, 5vw, 4rem);
    --fs-md: clamp(1.4rem, 3vw, 2.25rem);
    --fs-body: clamp(1rem, 0.4vw + 0.95rem, 1.2rem);
    --fs-meta: 0.78rem;

    /* Layout */
    --wrap: 1440px;
    --pad: clamp(1.25rem, 4vw, 4rem);
    --rule: 2px;           /* hard border weight */

    /* Motion */
    --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
    --t-fast: 0.18s var(--ease);
    --t: 0.4s var(--ease);
}


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

html {
    scroll-behavior: smooth;
    scroll-padding-top: 6.5rem;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body {
    min-height: 100vh;
    font-family: var(--display);
    font-size: var(--fs-body);
    line-height: 1.55;
    color: var(--ink);
    background: var(--paper);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    -webkit-tap-highlight-color: transparent;
}

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

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

button { cursor: pointer; }
ul, ol { list-style: none; }
a { color: inherit; text-decoration: none; }


/* =====================================================
   TYPOGRAPHY
   ===================================================== */
h1, h2, h3, h4 {
    font-weight: 700;
    line-height: 0.95;
    letter-spacing: -0.03em;
    text-transform: uppercase;
}

p { max-width: 60ch; }

strong { font-weight: 700; }

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

/* Monospace meta / kicker labels */
.kicker {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    font-family: var(--mono);
    font-size: var(--fs-meta);
    font-weight: 400;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--muted);
}

.kicker::before {
    content: "";
    width: 1.6rem;
    height: var(--rule);
    background: var(--accent);
}

/* Terminal command line above a section title, e.g. "$ cat about.md" */
.sec-head__cmd {
    display: block;
    width: 100%;
    font-family: var(--mono);
    font-size: var(--fs-meta);
    letter-spacing: 0.06em;
    color: var(--accent);
    text-shadow: 0 0 10px rgba(57, 255, 20, 0.6);
    margin-bottom: 0.5rem;
}
.sec-head__cmd::before { content: "$ "; color: var(--muted); }

/* Blinking block cursor, dropped after names / prompts */
.cursor {
    display: inline-block;
    width: 0.52em;
    height: 0.98em;
    margin-left: 0.08em;
    background: var(--accent);
    vertical-align: -0.12em;
    box-shadow: 0 0 8px rgba(57, 255, 20, 0.6);
    animation: cursor-blink 1.1s steps(1) infinite;
}
@keyframes cursor-blink { 0%, 50% { opacity: 1; } 50.01%, 100% { opacity: 0; } }

/* One-shot glitch-in, applied on load via JS (not a constant loop) */
.glitch-in {
    animation: glitch-in 0.5s steps(2, end) 1;
}
@keyframes glitch-in {
    0%   { transform: translate(0, 0); opacity: 0.3; text-shadow: -2px 0 var(--warn), 2px 0 #00e5ff; }
    20%  { transform: translate(-2px, 1px); text-shadow: 2px 0 var(--warn), -2px 0 #00e5ff; }
    40%  { transform: translate(2px, -1px); text-shadow: -1px 0 var(--warn), 1px 0 #00e5ff; }
    60%  { transform: translate(-1px, 0); text-shadow: 1px 0 var(--warn), -1px 0 #00e5ff; opacity: 1; }
    80%  { transform: translate(1px, 0); text-shadow: none; }
    100% { transform: translate(0, 0); text-shadow: none; opacity: 1; }
}

/* Fixed matrix-rain canvas — sits behind a translucent dark scrim */
.matrix-bg {
    position: fixed;
    inset: 0;
    z-index: -2;
    width: 100%;
    height: 100%;
    pointer-events: none;
}
.bg-scrim {
    position: fixed;
    inset: 0;
    z-index: -1;
    background: var(--paper);
    opacity: 0.85;
    pointer-events: none;
}

/* CRT scanlines + vignette + flicker, drawn above everything, never intercepts clicks */
.scanlines {
    position: fixed;
    inset: 0;
    z-index: 149;
    pointer-events: none;
    background:
        repeating-linear-gradient(
            to bottom,
            rgba(214, 251, 224, 0.06) 0px,
            rgba(214, 251, 224, 0.06) 1px,
            transparent 1px,
            transparent 3px
        ),
        radial-gradient(ellipse at center, transparent 50%, rgba(0, 0, 0, 0.55) 140%);
    mix-blend-mode: normal;
    animation: crt-flicker 7s infinite;
}
@keyframes crt-flicker {
    0%, 100% { opacity: 1; }
    91% { opacity: 1; }
    91.5% { opacity: 0.78; }
    92% { opacity: 1; }
    92.7% { opacity: 0.85; }
    93.2% { opacity: 1; }
    97% { opacity: 1; }
    97.3% { opacity: 0.7; }
    97.6% { opacity: 1; }
}

/* ASCII corner-bracket framing — top-left / bottom-right terminal-window marks */
.ascii-frame { position: relative; }
.ascii-frame::before,
.ascii-frame::after {
    content: "";
    position: absolute;
    width: 18px;
    height: 18px;
    border: 2px solid var(--accent);
    opacity: 0.8;
    filter: drop-shadow(0 0 4px rgba(57, 255, 20, 0.5));
    pointer-events: none;
}
.ascii-frame::before { top: -2px; left: -2px; border-right: none; border-bottom: none; }
.ascii-frame::after { bottom: -2px; right: -2px; border-left: none; border-top: none; }

/* "ACCESS GRANTED" stamp — flashed on the loader just before it clears */
.stamp {
    display: inline-block;
    color: var(--accent);
    text-shadow: 0 0 14px rgba(57, 255, 20, 0.85), 0 0 2px rgba(57, 255, 20, 0.9);
    animation: stamp-in 0.4s var(--ease) 1;
}
@keyframes stamp-in {
    0%   { transform: scale(1.3); opacity: 0; letter-spacing: 0.4em; }
    60%  { transform: scale(0.97); opacity: 1; }
    100% { transform: scale(1); opacity: 1; letter-spacing: 0.04em; }
}

@media (prefers-reduced-motion: reduce) {
    .glitch-in { animation: none; }
    .cursor { animation: none; opacity: 1; }
    .scanlines { animation: none; }
    .stamp { animation: none; }
}


/* =====================================================
   UTILITIES
   ===================================================== */
.wrap {
    width: 100%;
    max-width: var(--wrap);
    margin-inline: auto;
    padding-inline: var(--pad);
}

.section {
    position: relative;
    padding-block: clamp(3.5rem, 9vw, 8rem);
    border-top: var(--rule) solid var(--ink);
}

/* Section header block (number + kicker + title) */
.sec-head {
    display: flex;
    align-items: baseline;
    gap: clamp(1rem, 3vw, 2.5rem);
    margin-bottom: clamp(2rem, 5vw, 4rem);
    flex-wrap: wrap;
}

.sec-head__no {
    font-family: var(--mono);
    font-size: var(--fs-meta);
    color: var(--accent);
    letter-spacing: 0.1em;
    text-shadow: 0 0 10px rgba(57, 255, 20, 0.6);
}
.sec-head__no::before { content: "["; }
.sec-head__no::after { content: "]"; }

.sec-head__title {
    font-size: var(--fs-xl);
}

/* Accent inline mark */
.mark { color: var(--accent); }

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

/* Skip link — hidden until focused, then a solid block at top-left */
.skip-link {
    position: absolute;
    top: 0.75rem;
    left: 0.75rem;
    z-index: 300;
    transform: translateY(calc(-100% - 1rem));
    font-family: var(--mono);
    font-size: var(--fs-meta);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 0.75rem 1.15rem;
    background: var(--ink);
    color: var(--paper);
    border: var(--rule) solid var(--ink);
    transition: transform var(--t);
}

.skip-link:focus {
    transform: none;
}

/* Visible keyboard focus */
:focus-visible {
    outline: 3px solid var(--accent);
    outline-offset: 2px;
}

[tabindex="-1"]:focus { outline: none; }


/* =====================================================
   SCROLL REVEAL (subtle — applied by JS)
   ===================================================== */
.reveal {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}

.reveal.in {
    opacity: 1;
    transform: none;
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    .reveal { opacity: 1; transform: none; transition: none; }
    * { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; }
}
