/* ═══════════════════════════════════════════════════════════════
   AETHER SENTINEL — Design System v2.0
   A Tactical Intelligence Command Center aesthetic.
   ═══════════════════════════════════════════════════════════════ */

/* ─── THEME TOKENS ─────────────────────────────────────────── */
:root {
    /* Surface Hierarchy (5 tiers of obsidian) */
    --bg-deepest: #0a0e1a;
    --bg: #0f131f;
    --bg-elevated: #171b28;
    --bg-card: #1b1f2c;
    --bg-panel: #262a37;
    --bg-bright: #313442;

    /* Border & Outline */
    --border: rgba(70, 70, 76, 0.25);
    --border-hover: rgba(0, 219, 233, 0.4);
    --border-gradient: linear-gradient(135deg, #00dbe9, #dcb8ff);

    /* Text */
    --text: #f1f3fb;
    --text-secondary: #b8bdd0;
    --text-muted: #8e93a8;
    --text-dim: #5a5f72;

    /* Accent — Cyan (Primary) */
    --accent: #00dbe9;
    --accent-glow: rgba(0, 219, 233, 0.25);
    --accent-dim: rgba(0, 219, 233, 0.08);
    --accent-bloom: 0 0 30px rgba(0, 219, 233, 0.12);

    /* Accent — Purple (Secondary) */
    --accent2: #dcb8ff;
    --accent2-glow: rgba(220, 184, 255, 0.2);
    --accent2-dim: rgba(220, 184, 255, 0.08);

    /* Shadows */
    --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.3);
    --shadow-hover: 0 8px 40px rgba(0, 219, 233, 0.1), 0 0 60px rgba(0, 0, 0, 0.4);

    /* Fonts */
    --font-sans: 'Inter', sans-serif;
    --font-mono: 'Fira Code', monospace;
    --font-label: 'Space Grotesk', sans-serif;

    --cursor-glow: rgba(0, 219, 233, 0.1);
}

/* Root Access / Hacker Mode Override */
body.root-access {
    --bg-deepest: #020204;
    --bg: #050508;
    --bg-elevated: #0a0a0e;
    --bg-card: #0d0d12;
    --bg-panel: #141418;
    --bg-bright: #1a1a20;

    --border: rgba(0, 255, 0, 0.12);
    --border-hover: rgba(0, 255, 0, 0.4);
    --border-gradient: linear-gradient(135deg, #00ff00, #ff003c);

    --text: #edf0f7;
    --text-secondary: #a8b5c8;
    --text-muted: #6b7a8d;
    --text-dim: #4a566a;

    --accent: #00ff00;
    --accent-glow: rgba(0, 255, 0, 0.2);
    --accent-dim: rgba(0, 255, 0, 0.06);
    --accent-bloom: 0 0 30px rgba(0, 255, 0, 0.08);

    --accent2: #ff003c;
    --accent2-glow: rgba(255, 0, 60, 0.15);
    --accent2-dim: rgba(255, 0, 60, 0.06);

    --shadow-card: 0 4px 24px rgba(0, 255, 0, 0.03);
    --shadow-hover: 0 16px 48px rgba(0, 255, 0, 0.08);

    --cursor-glow: rgba(0, 255, 0, 0.05);
    font-family: var(--font-mono) !important;
}
body.root-access * { font-family: var(--font-mono) !important; }

/* ─── RESET & BASE ─────────────────────────────────────────── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; font-size: 16px; }

body {
    font-family: var(--font-sans);
    background: var(--bg-deepest);
    color: var(--text);
    line-height: 1.6;
    overflow-x: hidden;
    transition: background-color 0.5s ease, color 0.4s ease;
    position: relative;
    min-height: 100vh;
}

/* ─── NOISE / GRAIN TEXTURE OVERLAY ────────────────────────── */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    z-index: 9990;
    pointer-events: none;
    opacity: 0.035;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='1'/%3E%3C/svg%3E");
    background-repeat: repeat;
    background-size: 256px 256px;
}

/* ─── BACKGROUND GRID PATTERN ──────────────────────────────── */
body::after {
    content: '';
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(70, 70, 76, 0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(70, 70, 76, 0.04) 1px, transparent 1px);
    background-size: 40px 40px;
}

/* Ambient glow orbs */
.ambient-orb {
    position: fixed;
    border-radius: 50%;
    pointer-events: none;
    filter: blur(120px);
    z-index: -1;
    animation: orbFloat 20s ease-in-out infinite alternate;
}
.ambient-orb--cyan {
    top: 10%;
    left: -5%;
    width: 40vw;
    height: 40vw;
    background: radial-gradient(circle, rgba(0, 219, 233, 0.08), transparent 70%);
}
.ambient-orb--purple {
    bottom: 5%;
    right: -10%;
    width: 50vw;
    height: 50vw;
    background: radial-gradient(circle, rgba(220, 184, 255, 0.05), transparent 70%);
}
body.root-access .ambient-orb--cyan {
    background: radial-gradient(circle, rgba(0, 255, 0, 0.06), transparent 70%);
}
body.root-access .ambient-orb--purple { display: none; }

@keyframes orbFloat {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(20px, -30px) scale(1.05); }
}

/* ─── SCROLLBAR ────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-deepest); }
::-webkit-scrollbar-thumb { background: var(--bg-bright); border-radius: 0; }
::-webkit-scrollbar-thumb:hover { background: var(--accent); }

/* ─── SELECTION ────────────────────────────────────────────── */
::selection { background: var(--accent); color: var(--bg-deepest); }
body.root-access ::selection { color: #000; }

/* ─── UTILITY ──────────────────────────────────────────────── */
body.loading { overflow: hidden; }
a { color: inherit; text-decoration: none; }
.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }

/* ─── SCROLL PROGRESS HUD ─────────────────────────────────── */
.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 2px;
    background: linear-gradient(90deg, var(--accent), var(--accent2));
    z-index: 9999;
    transition: width 0.1s ease-out;
}

/* ─── GRADIENT TEXT ────────────────────────────────────────── */
.gradient-text {
    background: linear-gradient(135deg, var(--accent), var(--accent2));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
body.root-access .gradient-text {
    background: linear-gradient(135deg, var(--accent), var(--accent2));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ─── LOADER ───────────────────────────────────────────────── */
.loader {
    position: fixed; inset: 0; z-index: 99999;
    background: var(--bg-deepest);
    display: flex; align-items: center; justify-content: center;
    transition: opacity 0.8s ease, visibility 0.8s;
}
.loader.done { opacity: 0; visibility: hidden; pointer-events: none; }
.loader-content { text-align: center; }
.loader-bar {
    width: 240px; height: 2px;
    background: var(--border);
    margin: 0 auto 16px; position: relative; overflow: hidden;
}
.loader-bar::after {
    content: ''; position: absolute; left: 0; top: 0; height: 100%; width: 0;
    background: linear-gradient(90deg, var(--accent), var(--accent2));
    animation: loaderFill 1.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
.loader-text {
    font-family: var(--font-label); font-size: 0.75rem; color: var(--accent);
    letter-spacing: 0.15em; text-transform: uppercase;
}
@keyframes loaderFill { to { width: 100%; } }

/* ─── CURSOR GLOW ──────────────────────────────────────────── */
.cursor-glow {
    position: fixed; width: 500px; height: 500px;
    border-radius: 50%; pointer-events: none; z-index: 0;
    background: radial-gradient(circle, var(--cursor-glow) 0%, transparent 60%);
    transform: translate(-50%, -50%);
    opacity: 0; transition: opacity 0.4s;
    will-change: left, top;
}
.cursor-glow.active { opacity: 1; }

/* ─── SCROLL REVEAL — Cinematic Entry ─────────────────────── */
.scroll-reveal {
    opacity: 0;
    transform: translateY(50px);
    transition: opacity 1s cubic-bezier(0.16, 1, 0.3, 1),
                transform 1s cubic-bezier(0.16, 1, 0.3, 1);
    will-change: opacity, transform;
}
.scroll-reveal.visible { opacity: 1; transform: translateY(0); }

/* Staggered card reveals */
.reveal { opacity: 0; transform: translateY(40px); transition: all 0.8s cubic-bezier(0.16, 1, 0.3, 1); }
.reveal.visible { opacity: 1; transform: translateY(0); }


/* ═══════════════════════════════════════════════════════════════
   NAVIGATION
   ═══════════════════════════════════════════════════════════════ */

.navbar {
    position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
    padding: 20px 0;
    transition: all 0.4s ease;
}
.navbar.scrolled {
    background: rgba(10, 14, 26, 0.85);
    backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
}
.nav-content {
    max-width: 1200px; margin: 0 auto; padding: 0 24px;
    display: flex; justify-content: space-between; align-items: center;
}

/* Brand Logo */
.brand {
    font-size: 1.8rem; font-weight: 900; letter-spacing: -2px;
    display: flex; align-items: center; cursor: pointer;
    position: relative; user-select: none;
}
.logo-n, .logo-s {
    display: inline-block;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    background-clip: text; -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 0 12px var(--accent-glow));
}
.logo-n { background-image: linear-gradient(to bottom, #00f0ff, #00dbe9); margin-right: 2px; }
.logo-s { background-image: linear-gradient(to bottom, #dcb8ff, #a855f7); margin-left: -4px; }

body.root-access .logo-n {
    background-image: linear-gradient(to bottom, #00ff00, #22c55e);
    filter: drop-shadow(0 0 12px rgba(0, 255, 0, 0.3));
}
body.root-access .logo-s {
    background-image: linear-gradient(to bottom, #ff003c, #ff6b6b);
    filter: drop-shadow(0 0 12px rgba(255, 0, 60, 0.3));
}

/* Ghost hex trails on hover */
.logo-n::before, .logo-s::before {
    content: attr(data-content);
    position: absolute; top: 0; left: 0;
    opacity: 0; filter: blur(4px);
    transition: all 0.3s ease;
}
.brand:hover .logo-n::before { content: '0x4E'; font-size: 0.55rem; top: -16px; opacity: 0.6; font-family: var(--font-label); }
.brand:hover .logo-s::before { content: '0x53'; font-size: 0.55rem; top: 18px; opacity: 0.6; font-family: var(--font-label); }
.brand:hover .logo-n, .brand:hover .logo-s { transform: scale(1.08); }

/* Scanline on brand */
.brand::before {
    content: '';
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background: linear-gradient(to bottom, transparent, var(--accent-dim), transparent);
    opacity: 0.06; z-index: 3; pointer-events: none;
}

.nav-controls { display: flex; align-items: center; gap: 16px; }

/* Mode Toggle */
.toggle-container {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: 0; padding: 3px; display: inline-block;
}
.toggle-label {
    display: flex; position: relative; cursor: pointer;
    align-items: center; justify-content: space-between;
    width: 260px; height: 36px;
}
.toggle-checkbox { display: none; }
.toggle-slider {
    position: absolute; top: 0; left: 0; height: 100%; width: 50%;
    background: linear-gradient(135deg, var(--accent), var(--accent2));
    border-radius: 0;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1); z-index: 1;
}
.toggle-checkbox:checked + .toggle-label .toggle-slider { transform: translateX(100%); }
.toggle-text {
    flex: 1; text-align: center; z-index: 2;
    font-size: 0.8rem; font-weight: 700; letter-spacing: 0.05em;
    text-transform: uppercase;
    font-family: var(--font-label);
    transition: color 0.3s ease;
}
.exec-text { color: var(--bg-deepest); }
.root-text { color: var(--text-muted); }
.toggle-checkbox:checked + .toggle-label .exec-text { color: var(--text-muted); }
.toggle-checkbox:checked + .toggle-label .root-text { color: var(--bg-deepest); }

body.root-access .toggle-container { background: #000; border-color: rgba(0, 255, 0, 0.2); }

/* Terminal Button */
.root-only-btn {
    display: none; background: var(--bg-card); color: var(--accent);
    border: 1px solid var(--border); width: 44px; height: 44px;
    border-radius: 0; align-items: center; justify-content: center;
    cursor: pointer; transition: all 0.3s ease;
}
body.root-access .root-only-btn { display: flex; }
.root-only-btn:hover { background: var(--accent-dim); box-shadow: var(--accent-bloom); }


/* ═══════════════════════════════════════════════════════════════
   SECTIONS
   ═══════════════════════════════════════════════════════════════ */

.section { padding: 72px 0; position: relative; z-index: 1; }

.section-label {
    display: inline-flex; align-items: center; gap: 8px;
    font-family: var(--font-label);
    font-size: 0.7rem; font-weight: 600;
    color: var(--accent); text-transform: uppercase; letter-spacing: 0.2em;
    margin-bottom: 20px; padding: 8px 16px;
    background: var(--accent-dim);
    border: 1px solid rgba(0, 219, 233, 0.15);
    border-radius: 0;
}
body.root-access .section-label {
    background: var(--accent-dim);
    border-color: rgba(0, 255, 0, 0.15);
}

.section-title {
    font-size: 2.8rem; font-weight: 900; margin-bottom: 32px;
    letter-spacing: -0.03em; color: var(--text);
    line-height: 1.1;
}
.section-desc {
    font-size: 1.1rem; color: var(--text-secondary); max-width: 650px;
    margin-bottom: 36px; line-height: 1.8; font-weight: 400;
}

/* HUD Corner Labels */
.hud-label {
    font-family: var(--font-label);
    font-size: 0.6rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--text-dim);
    position: absolute;
}
.hud-label--tl { top: 24px; left: 24px; }
.hud-label--tr { top: 24px; right: 24px; }
.hud-label--br { bottom: 24px; right: 24px; }

/* ─── DUAL MODE LOGIC ──────────────────────────────────────── */
.view-root { display: none; }
body.root-access .view-executive { display: none; }
body.root-access .view-root { display: block; animation: glitchReveal 0.4s ease forwards; }

@keyframes glitchReveal {
    0% { opacity: 0; filter: contrast(200%) hue-rotate(90deg); transform: translate(-2px, 2px); }
    50% { opacity: 0.8; filter: contrast(150%) hue-rotate(0deg); transform: translate(2px, -2px); }
    100% { opacity: 1; filter: none; transform: translate(0); }
}

/* ─── SECTION DIVIDER (SVG Wave) ──────────────────────────── */
.section-divider {
    width: 100%;
    height: 80px;
    position: relative;
    overflow: hidden;
    z-index: 1;
}
.section-divider svg {
    position: absolute;
    bottom: 0;
    width: 100%;
    height: 100%;
}


/* ═══════════════════════════════════════════════════════════════
   HERO
   ═══════════════════════════════════════════════════════════════ */

.hero {
    min-height: 90vh;
    display: flex; align-items: center;
    justify-content: space-between;
    gap: 60px; position: relative;
    padding-top: 80px;
}
.hero-content { flex: 1; min-width: 0; }
.hero-visual { flex: 0 0 400px; display: flex; justify-content: center; align-items: center; }

@media (max-width: 1024px) {
    .hero { flex-direction: column-reverse; text-align: center; justify-content: center; margin-top: 20px; }
    .hero-content { display: flex; flex-direction: column; align-items: center; }
    .hero-actions { justify-content: center; }
    .hero-quote { margin: 0 auto 36px auto; }
    .hero-visual { flex: 0 0 auto; display: flex; justify-content: center; margin-bottom: 24px; }
}

/* Cyber Portrait — Container with animated ring */
.cyber-portrait {
    position: relative; width: 360px; height: 360px;
    border-radius: 50%; overflow: visible;
    perspective: 1000px;
    transition: transform 0.3s ease-out, width 0.3s, height 0.3s;
    transform: rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
    transform-style: preserve-3d;
}

/* Animated rotating ring border */
.cyber-portrait::before {
    content: '';
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    background: conic-gradient(
        from 0deg,
        var(--accent),
        var(--accent2),
        transparent 40%,
        transparent 60%,
        var(--accent2),
        var(--accent)
    );
    animation: portraitRingSpin 6s linear infinite;
    z-index: -1;
}

/* Ambient bloom behind portrait */
.cyber-portrait::after {
    content: '';
    position: absolute;
    inset: -30px;
    border-radius: 50%;
    background: radial-gradient(circle, var(--accent-glow) 0%, transparent 70%);
    z-index: -2;
    animation: portraitBloom 4s ease-in-out infinite alternate;
}

@keyframes portraitRingSpin {
    to { transform: rotate(360deg); }
}
@keyframes portraitBloom {
    0% { opacity: 0.4; transform: scale(1); }
    100% { opacity: 0.7; transform: scale(1.05); }
}

/* Inner circle that clips the image */
.portrait-inner {
    width: 100%; height: 100%;
    border-radius: 50%;
    overflow: hidden;
    position: relative;
    background: var(--bg-deepest);
    box-shadow: inset 0 0 40px rgba(0, 0, 0, 0.5);
}

.portrait-base {
    width: 100%; height: 100%;
    object-fit: cover;
    object-position: center top;
    filter: contrast(110%) brightness(90%);
    transition: filter 0.4s ease, transform 0.3s ease-out;
    transform: translateZ(50px) scale(1.05);
}
.cyber-portrait:hover .portrait-base {
    filter: contrast(115%) brightness(95%) saturate(110%);
    transform: translateZ(50px) scale(1.08);
}

/* Duotone gradient overlay */
.portrait-overlay {
    position: absolute; inset: 0;
    border-radius: 50%;
    background: linear-gradient(160deg, rgba(0, 219, 233, 0.15) 0%, rgba(220, 184, 255, 0.12) 100%);
    mix-blend-mode: color;
    pointer-events: none;
    z-index: 2;
}

/* Subtle scanlines */
.scanlines {
    position: absolute; inset: 0;
    border-radius: 50%;
    background: repeating-linear-gradient(
        to bottom,
        transparent 0, transparent 3px,
        rgba(0, 0, 0, 0.12) 3px, rgba(0, 0, 0, 0.12) 4px
    );
    pointer-events: none; z-index: 3;
    opacity: 0.3;
}

/* Hero Text */
.hero-greeting {
    font-family: var(--font-label);
    color: var(--accent);
    margin-bottom: 12px;
    font-size: 0.85rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
}
.hero-title {
    font-size: 4.5rem; font-weight: 900;
    line-height: 1.05; margin-bottom: 24px;
    letter-spacing: -0.04em;
}
.hero-subtitle {
    font-size: 1.2rem; color: var(--text-secondary);
    max-width: 600px; margin-bottom: 20px; line-height: 1.7;
    font-weight: 500;
}
.hero-intro {
    font-size: 1rem; color: var(--text-muted);
    max-width: 580px; margin-bottom: 48px; line-height: 1.7;
}

/* Buttons */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 14px 28px; border-radius: 0; font-weight: 700; font-size: 0.85rem;
    letter-spacing: 0.05em; text-transform: uppercase;
    font-family: var(--font-label);
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    cursor: pointer; border: 1px solid transparent;
}
.btn i { font-size: 0.95rem; }

.btn-primary {
    background: linear-gradient(135deg, var(--accent), var(--accent2));
    color: var(--bg-deepest);
    border: none;
}
.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 30px var(--accent-glow), 0 8px 30px var(--accent2-glow);
}
.btn-ghost {
    background: transparent;
    border-color: var(--border);
    color: var(--text);
}
.btn-ghost:hover {
    border-color: var(--accent);
    background: var(--accent-dim);
    transform: translateY(-3px);
    box-shadow: var(--accent-bloom);
}

.hero-actions { display: flex; gap: 16px; margin-bottom: 36px; flex-wrap: wrap; }

/* Hero Quote */
.hero-quote {
    position: relative; padding: 24px 32px; margin-top: 32px; max-width: 600px;
    font-size: 1rem; font-style: italic; color: var(--text-secondary);
    background: var(--bg-card); border-left: 3px solid var(--accent);
    border-radius: 0;
    backdrop-filter: blur(16px);
    line-height: 1.7;
}
.hero-quote::before {
    content: '"'; position: absolute; top: -8px; left: 16px;
    font-size: 3.5rem; font-family: serif; color: var(--accent-dim);
    line-height: 1; pointer-events: none;
}


/* ═══════════════════════════════════════════════════════════════
   FLOATING HEXAGONS (Background Decoration)
   ═══════════════════════════════════════════════════════════════ */

.hex-scanner {
    position: fixed;
    pointer-events: none;
    z-index: 0;
    opacity: 0.03;
}
.hex-scanner svg { fill: var(--text); }

.hex-scanner--1 {
    top: 15%; right: 8%;
    width: 120px; height: 120px;
    animation: hexDrift 25s ease-in-out infinite alternate;
}
.hex-scanner--2 {
    top: 55%; left: 3%;
    width: 80px; height: 80px;
    animation: hexDrift 30s ease-in-out infinite alternate-reverse;
}
.hex-scanner--3 {
    bottom: 20%; right: 15%;
    width: 60px; height: 60px;
    animation: hexDrift 20s ease-in-out infinite alternate;
}

@keyframes hexDrift {
    0% { transform: translate(0, 0) rotate(0deg); }
    50% { transform: translate(15px, -20px) rotate(30deg); }
    100% { transform: translate(-10px, 15px) rotate(-15deg); }
}


/* ═══════════════════════════════════════════════════════════════
   STATUS PILL
   ═══════════════════════════════════════════════════════════════ */

.status-pill {
    display: inline-flex; align-items: center; gap: 12px;
    background: var(--bg-card); border: 1px solid var(--border);
    padding: 14px 24px; border-radius: 0; margin-bottom: 32px;
    font-size: 0.9rem; color: var(--text-secondary);
    backdrop-filter: blur(8px);
}
.status-pill-glow {
    border-color: rgba(0, 219, 233, 0.15);
    box-shadow: var(--accent-bloom);
}
.status-pulse {
    width: 8px; height: 8px; background: #22c55e;
    border-radius: 0; flex-shrink: 0;
    position: relative;
    box-shadow: 0 0 12px #22c55e;
}
.status-pulse::after {
    content: ''; position: absolute; inset: -4px;
    border: 1px solid #22c55e; border-radius: 0;
    animation: statusPulse 2s infinite cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes statusPulse {
    0% { transform: scale(1); opacity: 1; }
    100% { transform: scale(3); opacity: 0; }
}
.status-text strong { color: var(--text); }


/* ═══════════════════════════════════════════════════════════════
   TERMINAL BLOCKS (Static in-section)
   ═══════════════════════════════════════════════════════════════ */

.terminal-block {
    background: var(--bg-card); border: 1px solid var(--border); border-radius: 0;
    overflow: hidden; font-family: var(--font-mono); font-size: 0.85rem;
}
.term-header {
    background: var(--bg-elevated); border-bottom: 1px solid var(--border);
    padding: 12px 16px; display: flex; align-items: center; gap: 8px;
}
.dot { width: 10px; height: 10px; border-radius: 50%; }
.dot.red { background: #ff5f56; }
.dot.yellow { background: #ffbd2e; }
.dot.green { background: #27c93f; }
.term-title {
    margin-left: auto; margin-right: auto; color: var(--text-dim);
    font-size: 0.7rem; font-family: var(--font-label); letter-spacing: 0.1em;
    text-transform: uppercase;
}
.term-body { padding: 24px; color: var(--text); white-space: pre-wrap; line-height: 1.6; display: inline; }
.typewriter-cursor { color: var(--accent); animation: blink 1s step-end infinite; }
.typewriter-cursor.done { opacity: 0; }
@keyframes blink { 50% { opacity: 0; } }


/* ═══════════════════════════════════════════════════════════════
   CARDS & BENTO GRID
   ═══════════════════════════════════════════════════════════════ */

.grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}
/* Bento variations */
.grid--bento { grid-template-columns: repeat(4, 1fr); grid-auto-rows: minmax(200px, auto); }
.card-wide { grid-column: span 2; }
.card-tall { grid-row: span 2; }

@media (max-width: 900px) {
    .grid { grid-template-columns: 1fr; }
    .grid--bento { grid-template-columns: 1fr; }
    .card-wide, .card-tall { grid-column: span 1; grid-row: span 1; }
    .card { padding: 24px; }
}

.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 0;
    padding: 32px;
    transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    overflow: hidden;
    display: block;
    backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
}

/* Gradient border glow on hover (pseudo-element) */
.card::before {
    content: ''; position: absolute; inset: -1px;
    background: var(--border-gradient); border-radius: 0;
    z-index: -1;
    opacity: 0; transition: opacity 0.5s ease;
}
.card::after {
    content: ''; position: absolute; inset: 0;
    background: var(--bg-card); border-radius: 0;
    z-index: -1;
}
.card:hover::before { opacity: 1; }
.card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
}

.card > * { position: relative; z-index: 1; }
.card p { color: var(--text-secondary); margin-bottom: 24px; font-size: 0.92rem; line-height: 1.75; }

/* PROJECT CARDS */
.project-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }
.project-tag {
    font-family: var(--font-label);
    font-size: 0.7rem; font-weight: 700; letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 4px 10px;
    background: var(--accent-dim);
    color: var(--accent);
    border: 1px solid rgba(0, 219, 233, 0.12);
    border-radius: 0;
    display: inline-flex; align-items: center; gap: 5px;
}
.project-tag i { font-size: 0.75rem; }
.project-title {
    font-size: 1.35rem; font-weight: 800; margin-bottom: 12px;
    letter-spacing: -0.01em; color: var(--text);
}
.project-description {
    color: var(--text-secondary); font-size: 0.95rem;
    line-height: 1.7;
}
.project-actions {
    display: flex; gap: 12px; margin-top: 20px; flex-wrap: wrap;
}
.project-link {
    font-family: var(--font-label);
    font-size: 0.75rem; letter-spacing: 0.08em; text-transform: uppercase;
    padding: 8px 16px; font-weight: 600;
    border: 1px solid var(--border); border-radius: 0;
    color: var(--text-secondary);
    display: inline-flex; align-items: center; gap: 6px;
    transition: all 0.3s ease;
}
.project-link:hover {
    border-color: var(--accent); color: var(--accent);
    box-shadow: var(--accent-bloom);
}

/* DEEP DIVE PANEL */
.deep-dive-content {
    max-height: 0; overflow: hidden;
    transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    opacity: 0;
    background: var(--bg-elevated);
    border-radius: 0; margin-top: 0;
    font-size: 0.85rem; color: var(--text-secondary); line-height: 1.7;
}
.deep-dive-content.active {
    max-height: 500px; opacity: 1;
    margin-top: 20px; padding: 20px;
    border: 1px solid var(--border);
}

.btn-deep-dive {
    background: transparent; border: 1px solid var(--border);
    color: var(--text-secondary); padding: 8px 16px; border-radius: 0;
    font-size: 0.75rem; font-family: var(--font-label);
    letter-spacing: 0.06em; text-transform: uppercase; font-weight: 600;
    cursor: pointer; transition: all 0.3s ease;
    display: inline-flex; align-items: center; gap: 8px;
}
.btn-deep-dive:hover {
    border-color: var(--accent); color: var(--accent);
    background: var(--accent-dim);
}


/* ═══════════════════════════════════════════════════════════════
   SKILLS — Constellation Nodes
   ═══════════════════════════════════════════════════════════════ */

.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px; margin-top: 40px;
}
.skill-node {
    padding: 32px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 0;
    transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    overflow: hidden;
}
/* Constellation glow pip */
.skill-node::before {
    content: '';
    position: absolute; top: 16px; right: 16px;
    width: 6px; height: 6px;
    background: var(--accent);
    border-radius: 0;
    box-shadow: 0 0 10px var(--accent);
    animation: nodePulse 3s infinite;
}
@keyframes nodePulse {
    0%, 100% { opacity: 0.4; box-shadow: 0 0 6px var(--accent); }
    50% { opacity: 1; box-shadow: 0 0 16px var(--accent), 0 0 30px var(--accent-glow); }
}

.skill-node:hover {
    border-color: var(--accent);
    transform: translateY(-6px);
    box-shadow: var(--accent-bloom), var(--shadow-hover);
}
.skill-node-header {
    display: flex; align-items: center; gap: 16px; margin-bottom: 20px;
}
.skill-node-header i { font-size: 1.8rem; color: var(--accent); }
.skill-node-header h3 {
    font-size: 1.3rem; font-weight: 800; margin: 0;
    letter-spacing: -0.01em;
}
.skill-node-desc { color: var(--text-secondary); line-height: 1.7; margin-bottom: 24px; font-size: 0.95rem; }

/* Skill Tags */
.tags, .skill-tags { display: flex; gap: 8px; flex-wrap: wrap; }
.tags span, .skill-tags span {
    display: inline-flex; align-items: center; gap: 6px;
    font-family: var(--font-label);
    font-size: 0.7rem; font-weight: 600; letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 5px 12px; border-radius: 0;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    transition: all 0.3s; cursor: default;
}
.tags span i, .skill-tags span i { font-size: 1rem; }
.tags span:hover, .skill-tags span:hover {
    border-color: var(--accent); color: var(--accent);
    transform: translateY(-2px);
    background: var(--accent-dim);
    box-shadow: var(--accent-bloom);
}


/* ═══════════════════════════════════════════════════════════════
   BLOG / WRITEUPS
   ═══════════════════════════════════════════════════════════════ */

.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 40px;
}

.blog-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 0;
    padding: 32px;
    position: relative;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    text-decoration: none;
    display: block;
    color: inherit;
}
.blog-card::before {
    content: ''; position: absolute; inset: -1px;
    background: var(--border-gradient); border-radius: 0;
    z-index: -1; opacity: 0; transition: opacity 0.4s ease;
}
.blog-card::after {
    content: ''; position: absolute; inset: 0;
    background: var(--bg-card); border-radius: 0; z-index: -1;
}
.blog-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-hover); }
.blog-card:hover::before { opacity: 1; }
.blog-card > * { position: relative; z-index: 1; }

.blog-date {
    font-family: var(--font-label);
    font-size: 0.72rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.blog-date::before {
    content: '';
    display: inline-block;
    width: 20px; height: 1px;
    background: var(--accent);
}

.blog-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text);
    line-height: 1.5;
    margin-bottom: 16px;
    letter-spacing: -0.01em;
}

.blog-read-more {
    font-family: var(--font-label);
    font-size: 0.75rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--accent);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: gap 0.3s ease;
}
.blog-card:hover .blog-read-more { gap: 10px; }

.blog-cta {
    text-align: center;
    margin-top: 32px;
}
.blog-cta a {
    font-family: var(--font-label);
    font-size: 0.85rem;
    letter-spacing: 0.06em;
    color: var(--text-secondary);
    text-decoration: none;
    border-bottom: 1px dashed var(--border);
    padding-bottom: 2px;
    transition: all 0.2s ease;
}
.blog-cta a:hover {
    color: var(--accent);
    border-color: var(--accent);
}
.blog-cta a i { margin-left: 6px; }

@media (max-width: 768px) {
    .blog-card { padding: 24px; }
}


/* ═══════════════════════════════════════════════════════════════
   TIMELINE (Experience)
   ═══════════════════════════════════════════════════════════════ */

.timeline {
    border-left: 1px solid var(--border);
    padding-left: 32px; margin-left: 16px;
}
.timeline-item {
    position: relative; margin-bottom: 48px; padding: 24px; left: -24px;
    border-radius: 0; border: 1px solid transparent;
    transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}
.timeline-item:hover {
    background: var(--bg-card);
    border-color: var(--border);
    transform: translateX(8px);
    box-shadow: var(--accent-bloom);
}
.timeline-item::before {
    content: ''; position: absolute; left: -17px; top: 32px;
    width: 10px; height: 10px; border-radius: 0;
    background: var(--bg-deepest); border: 2px solid var(--accent);
    box-shadow: 0 0 10px var(--accent-glow);
    transition: all 0.4s ease;
}
.timeline-item:hover::before {
    background: var(--accent);
    box-shadow: 0 0 20px var(--accent);
    transform: scale(1.3);
}
.timeline-meta {
    font-family: var(--font-label); font-size: 0.75rem; color: var(--accent);
    margin-bottom: 8px; letter-spacing: 0.1em; text-transform: uppercase;
}
.timeline-title { font-size: 1.3rem; font-weight: 800; margin-bottom: 4px; color: var(--text); }
.timeline-org { color: var(--text-secondary); font-weight: 500; margin-bottom: 16px; font-size: 1rem; }
.timeline-details { list-style: none; color: var(--text-secondary); font-size: 0.92rem; }
.timeline-details li { position: relative; padding-left: 20px; margin-bottom: 8px; }
.timeline-details li::before {
    content: '→'; position: absolute; left: 0; color: var(--accent);
    font-family: var(--font-mono);
}

/* Simple List */
.simple-list { list-style: none; color: var(--text-secondary); font-size: 0.95rem; }
.simple-list li { padding-left: 20px; position: relative; margin-bottom: 12px; }
.simple-list li::before {
    content: '▸'; position: absolute; left: 0; color: var(--accent);
    font-family: var(--font-mono);
}
.simple-list li a {
    transition: color 0.2s ease, text-shadow 0.2s ease;
}
.simple-list li a:hover {
    color: var(--accent);
    text-shadow: var(--accent-bloom);
}


/* ═══════════════════════════════════════════════════════════════
   TERM OUTPUT TEXT
   ═══════════════════════════════════════════════════════════════ */

.term-output {
    font-family: var(--font-mono); font-size: 0.9rem; line-height: 1.7;
    background: var(--bg-elevated); padding: 24px; border-radius: 0;
    border: 1px solid var(--border); color: var(--text-secondary);
}
.term-output.small {
    font-size: 0.8rem; padding: 16px; border: none;
    background: transparent; border-top: 1px solid var(--border);
    border-radius: 0; margin-top: 16px;
}
.cmd-line { color: var(--text); }
.output-green { color: var(--accent); }
.output-red { color: #ff003c; }

.term-link {
    color: var(--accent);
    text-decoration: underline;
    text-decoration-style: dotted;
    text-underline-offset: 4px;
    transition: all 0.2s;
}
.term-link:hover {
    background: var(--accent);
    color: var(--bg-deepest);
    text-decoration: none;
}


/* ═══════════════════════════════════════════════════════════════
   CONTACT SECTION
   ═══════════════════════════════════════════════════════════════ */

.contact-grid {
    display: flex; flex-direction: column;
    gap: 40px; align-items: center; text-align: center;
}
.contact-links {
    display: flex; flex-wrap: wrap; gap: 12px; justify-content: center;
}
.contact-links .btn {
    font-size: 0.85rem;
    gap: 10px;
}
.contact-links .btn i {
    font-size: 1.3rem;
}
.contact-card {
    max-width: 600px; width: 100%;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 0; padding: 40px;
    backdrop-filter: blur(12px);
    position: relative;
}
/* Gradient border effect for contact card */
.contact-card::before {
    content: ''; position: absolute; inset: -1px;
    background: var(--border-gradient);
    z-index: -1; border-radius: 0;
    opacity: 0.3;
}
.contact-card::after {
    content: ''; position: absolute; inset: 0;
    background: var(--bg-card); z-index: -1; border-radius: 0;
}

@media (max-width: 768px) {
    .contact-card { padding: 24px; }
}


/* ═══════════════════════════════════════════════════════════════
   THM BADGE
   ═══════════════════════════════════════════════════════════════ */

.thm-badge-container {
    padding: 10px;
    background: var(--bg-elevated);
    border-radius: 0;
    display: flex; justify-content: center; align-items: center;
    border: 1px solid var(--border); margin-top: 16px;
    transition: all 0.3s ease;
}
.thm-badge-container:hover {
    border-color: var(--accent);
    box-shadow: var(--accent-bloom);
    transform: translateY(-2px);
}


/* ═══════════════════════════════════════════════════════════════
   INTERACTIVE TERMINAL OVERLAY
   ═══════════════════════════════════════════════════════════════ */

.terminal-overlay {
    position: fixed; inset: 0; z-index: 2000;
    display: flex; align-items: center; justify-content: center; padding: 24px;
    background: rgba(0, 0, 0, 0.75); backdrop-filter: blur(12px);
    opacity: 0; visibility: hidden; transition: all 0.4s ease;
}
.terminal-overlay.active { opacity: 1; visibility: visible; }
.terminal-window {
    width: 100%; max-width: 800px; height: 60vh;
    background: #050508; border: 1px solid var(--border); border-radius: 0;
    display: flex; flex-direction: column; overflow: hidden;
    transform: scale(0.95) translateY(20px);
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8), 0 0 1px rgba(0, 219, 233, 0.2);
}
.terminal-overlay.active .terminal-window { transform: scale(1) translateY(0); }

.terminal-titlebar {
    display: flex; align-items: center; padding: 14px 20px;
    background: #0a0a0e; border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.terminal-dots { display: flex; gap: 8px; flex: 1; }
.terminal-dots span { width: 10px; height: 10px; border-radius: 50%; }
.terminal-dots span:nth-child(1) { background: #ff5f56; }
.terminal-dots span:nth-child(2) { background: #ffbd2e; }
.terminal-dots span:nth-child(3) { background: #27c93f; }
.terminal-title {
    font-family: var(--font-label); font-size: 0.7rem; color: var(--text-dim);
    flex: 2; text-align: center; letter-spacing: 0.1em; text-transform: uppercase;
}
.terminal-close {
    flex: 1; text-align: right; background: none; border: none; color: var(--text-dim);
    font-size: 1.2rem; cursor: pointer;
}
.terminal-close:hover { color: #fff; }

.terminal-body {
    padding: 20px; overflow-y: auto; flex: 1;
    font-family: var(--font-mono); font-size: 0.85rem; color: #0f0; line-height: 1.5;
}
.terminal-output { white-space: pre-wrap; margin-bottom: 10px; }
.terminal-input-line { display: flex; align-items: center; gap: 10px; }
.terminal-prompt { color: #fff; white-space: nowrap; }
.prompt-user { color: #0f0; }
.prompt-path { color: #3b82f6; }
.terminal-input {
    flex: 1; background: none; border: none; outline: none;
    font-family: var(--font-mono); font-size: 0.85rem; color: #fff;
}


/* ═══════════════════════════════════════════════════════════════
   GRADIENT SEPARATOR
   ═══════════════════════════════════════════════════════════════ */

.gradient-line {
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--accent), var(--accent2), transparent);
    border: none;
    margin: 0;
    opacity: 0.5;
}


/* ═══════════════════════════════════════════════════════════════
   FOOTER
   ═══════════════════════════════════════════════════════════════ */

.footer {
    border-top: none; padding: 48px 0; margin-top: 0;
    background: var(--bg-elevated);
    position: relative;
}
.footer-inner {
    display: flex; justify-content: space-between; align-items: center;
    font-size: 0.85rem; color: var(--text-dim);
    font-family: var(--font-label); letter-spacing: 0.05em;
}
.footer-logo {
    font-size: 1.4rem; font-weight: 900; color: var(--text);
    letter-spacing: -1px;
    text-shadow: 0 0 20px var(--accent-glow);
}


/* ═══════════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════════════ */

@media (max-width: 768px) {
    .toggle-label { width: 200px; }
    .hero-title { font-size: 2.8rem; }
    .section-title { font-size: 2rem; }
    .terminal-window { height: 80vh; max-width: 95%; }
    .hero-actions { flex-direction: column; gap: 12px; }
    .section { padding: 56px 0; }
    .cyber-portrait { width: 260px; height: 260px; }
    .nav-links { display: none; } /* Hide text links on very small screens, keep icons or just simplify */
}

@media (max-width: 480px) {
    .hero-title { font-size: 2.2rem; }
    .section-title { font-size: 1.8rem; }
    .nav-controls { gap: 8px; }
    .toggle-label { width: 160px; }
    .toggle-text { font-size: 0.65rem; }
    .cyber-portrait { width: 220px; height: 220px; }
    .card { padding: 20px; }
}


/* ═══════════════════════════════════════════════════════════════
   PRINT STYLESHEET
   ═══════════════════════════════════════════════════════════════ */

@media print {
    body, body.root-access {
        background: #fff !important;
        color: #000 !important;
    }
    body::before, body::after { display: none !important; }
    .view-root, .toggle-container, .root-only-btn, .terminal-overlay,
    .scanlines, .hex-scanner, .ambient-orb, .scroll-progress, .cursor-glow,
    .gradient-line { display: none !important; }
    .section { padding: 40px 0 !important; page-break-inside: avoid; }
    .card {
        background: none !important;
        border: 1px solid #ccc !important;
        box-shadow: none !important;
        color: #000 !important;
        page-break-inside: avoid;
    }
    .gradient-text {
        background: none !important;
        color: #000 !important;
        -webkit-text-fill-color: #000 !important;
    }
    .hero-title, .section-title, p, h3, li { color: #000 !important; }
    .footer { border-top: 1px solid #000; background: none !important; }
}


/* ═══════════════════════════════════════════════════════════════
   DECRYPT / EASTER EGG EFFECTS (preserved)
   ═══════════════════════════════════════════════════════════════ */

.project-card.decrypted {
    filter: none !important;
    border-color: var(--accent) !important;
    box-shadow: 0 0 50px var(--accent-glow), inset 0 0 20px var(--accent-dim) !important;
    transform: scale(1.03) translateY(-8px) !important;
    animation: decryptShimmer 0.5s infinite alternate !important;
    z-index: 50;
}
@keyframes decryptShimmer {
    from { filter: brightness(1) contrast(1); }
    to { filter: brightness(1.4) contrast(1.2) saturate(1.5); }
}

.skill-card.pulse-glow, .skill-node.pulse-glow {
    animation: skillIntensePulse 1s infinite alternate cubic-bezier(0.16, 1, 0.3, 1);
    background: var(--accent-dim) !important;
    z-index: 50;
}
@keyframes skillIntensePulse {
    0% { box-shadow: 0 0 10px var(--accent-dim); border-color: var(--border); transform: scale(1); }
    100% { box-shadow: 0 0 40px var(--accent-glow), 0 0 60px var(--accent-dim); border-color: var(--accent); transform: scale(1.02); }
}

.ui-decrypt-ripple {
    animation: uiAggressiveRipple 2.5s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
}
@keyframes uiAggressiveRipple {
    0% { filter: contrast(300%) brightness(2) hue-rotate(0deg); }
    20% { filter: contrast(150%) brightness(1.5) hue-rotate(180deg); }
    40% { filter: contrast(200%) brightness(0.5) hue-rotate(90deg); }
    60% { filter: contrast(120%) brightness(1.2) hue-rotate(270deg); }
    80% { filter: contrast(150%) brightness(1.1) hue-rotate(360deg); }
    100% { filter: none; }
}

.system-flash {
    position: fixed; inset: 0;
    background: rgba(0, 219, 233, 0.08);
    pointer-events: none; z-index: 99998;
    animation: systemOverload 0.8s ease-out forwards;
}
@keyframes systemOverload {
    0% { opacity: 0; transform: scale(1.1); background: rgba(255, 255, 255, 0.5); }
    10% { opacity: 1; background: rgba(0, 219, 233, 0.15); }
    20% { opacity: 0.8; filter: invert(1); }
    30% { opacity: 1; filter: invert(0); }
    100% { opacity: 0; transform: scale(1); }
}

.cursor-follower.magnetic-pull {
    width: 80px; height: 80px;
    background: var(--accent-dim);
    border: 2px solid var(--accent);
    mix-blend-mode: normal;
}
