/* ==========================================================
   Hedgehog Security — Core Stylesheet
   Shared across all pages: themes, base, nav, footer,
   buttons, section layout, reveal, glitch, responsive.
   ========================================================== */

/* ── CSS CUSTOM PROPERTIES — THEME SYSTEM ──────────────── */
:root {
    --transition-speed: 0.4s;
}

/* DARK THEME (Default — DEFCON style) */
[data-theme="dark"] {
    --bg-primary: #0a0a0f;
    --bg-secondary: #12121a;
    --bg-tertiary: #1a1a2e;
    --bg-card: rgba(18, 18, 26, 0.85);
    --bg-card-hover: rgba(26, 26, 46, 0.95);
    --text-primary: #e8e8f0;
    --text-secondary: #9898b0;
    --text-muted: #5a5a78;
    --accent-primary: #00ff88;
    --accent-secondary: #00cc6a;
    --accent-glow: rgba(0, 255, 136, 0.15);
    --accent-glow-strong: rgba(0, 255, 136, 0.3);
    --accent-warn: #ff3366;
    --accent-amber: #ffaa00;
    --border-color: rgba(0, 255, 136, 0.12);
    --border-subtle: rgba(255, 255, 255, 0.06);
    --hero-gradient: linear-gradient(170deg, #0a0a0f 0%, #0d1117 30%, #0a0a0f 100%);
    --card-border: 1px solid rgba(0, 255, 136, 0.1);
    --card-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    --glow-effect: 0 0 40px rgba(0, 255, 136, 0.08);
    --nav-bg: rgba(10, 10, 15, 0.92);
    --font-display: 'Orbitron', sans-serif;
    --font-body: 'Rajdhani', sans-serif;
    --font-mono: 'Share Tech Mono', monospace;
    --scanline-opacity: 0.03;
    --noise-opacity: 0.015;
    --grid-color: rgba(0, 255, 136, 0.04);
    --btn-text: #0a0a0f;
    --code-bg: rgba(0, 255, 136, 0.06);
    --timeline-line: rgba(0, 255, 136, 0.15);
    --safe-harbour-bg: rgba(0, 255, 136, 0.04);
    --safe-harbour-border: rgba(0, 255, 136, 0.2);
    --warning-bg: rgba(255, 51, 102, 0.06);
    --warning-border: rgba(255, 51, 102, 0.25);
}

/* LIGHT THEME */
[data-theme="light"] {
    --bg-primary: #f4f4f8;
    --bg-secondary: #ffffff;
    --bg-tertiary: #eaeaf0;
    --bg-card: rgba(255, 255, 255, 0.92);
    --bg-card-hover: rgba(255, 255, 255, 1);
    --text-primary: #1a1a2e;
    --text-secondary: #4a4a68;
    --text-muted: #8888a0;
    --accent-primary: #007744;
    --accent-secondary: #005533;
    --accent-glow: rgba(0, 119, 68, 0.08);
    --accent-glow-strong: rgba(0, 119, 68, 0.15);
    --accent-warn: #cc2255;
    --accent-amber: #cc8800;
    --border-color: rgba(0, 119, 68, 0.15);
    --border-subtle: rgba(0, 0, 0, 0.08);
    --hero-gradient: linear-gradient(170deg, #f4f4f8 0%, #e8e8f0 30%, #f4f4f8 100%);
    --card-border: 1px solid rgba(0, 0, 0, 0.08);
    --card-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
    --glow-effect: 0 0 40px rgba(0, 119, 68, 0.05);
    --nav-bg: rgba(244, 244, 248, 0.95);
    --font-display: 'Orbitron', sans-serif;
    --font-body: 'Rajdhani', sans-serif;
    --font-mono: 'Share Tech Mono', monospace;
    --scanline-opacity: 0;
    --noise-opacity: 0;
    --grid-color: rgba(0, 119, 68, 0.03);
    --btn-text: #ffffff;
    --code-bg: rgba(0, 119, 68, 0.06);
    --timeline-line: rgba(0, 119, 68, 0.15);
    --safe-harbour-bg: rgba(0, 119, 68, 0.04);
    --safe-harbour-border: rgba(0, 119, 68, 0.2);
    --warning-bg: rgba(204, 34, 85, 0.06);
    --warning-border: rgba(204, 34, 85, 0.2);
}

/* VT100 TERMINAL THEME */
[data-theme="terminal"] {
    --bg-primary: #000000;
    --bg-secondary: #0a0a00;
    --bg-tertiary: #111100;
    --bg-card: rgba(10, 10, 0, 0.9);
    --bg-card-hover: rgba(17, 17, 0, 0.95);
    --text-primary: #33ff33;
    --text-secondary: #22cc22;
    --text-muted: #118811;
    --accent-primary: #33ff33;
    --accent-secondary: #22cc22;
    --accent-glow: rgba(51, 255, 51, 0.1);
    --accent-glow-strong: rgba(51, 255, 51, 0.25);
    --accent-warn: #ff3333;
    --accent-amber: #ffcc00;
    --border-color: rgba(51, 255, 51, 0.2);
    --border-subtle: rgba(51, 255, 51, 0.08);
    --hero-gradient: linear-gradient(170deg, #000000 0%, #050500 30%, #000000 100%);
    --card-border: 1px solid rgba(51, 255, 51, 0.15);
    --card-shadow: 0 0 20px rgba(51, 255, 51, 0.05);
    --glow-effect: 0 0 60px rgba(51, 255, 51, 0.06);
    --nav-bg: rgba(0, 0, 0, 0.95);
    --font-display: 'Share Tech Mono', monospace;
    --font-body: 'Share Tech Mono', monospace;
    --font-mono: 'Share Tech Mono', monospace;
    --scanline-opacity: 0.06;
    --noise-opacity: 0.03;
    --grid-color: rgba(51, 255, 51, 0.03);
    --btn-text: #000000;
    --code-bg: rgba(51, 255, 51, 0.06);
    --timeline-line: rgba(51, 255, 51, 0.2);
    --safe-harbour-bg: rgba(51, 255, 51, 0.04);
    --safe-harbour-border: rgba(51, 255, 51, 0.25);
    --warning-bg: rgba(255, 51, 51, 0.06);
    --warning-border: rgba(255, 51, 51, 0.25);
}

/* ── BASE & RESET ──────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

html {
    scroll-behavior: smooth;
    scroll-padding-top: 80px;
}

body {
    font-family: var(--font-body);
    background: var(--bg-primary);
    color: var(--text-primary);
    overflow-x: hidden;
    transition: background var(--transition-speed), color var(--transition-speed);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* Scanline overlay */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(0, 0, 0, var(--scanline-opacity)) 2px,
        rgba(0, 0, 0, var(--scanline-opacity)) 4px
    );
    pointer-events: none;
    z-index: 9998;
}

/* Noise texture overlay */
body::after {
    content: '';
    position: fixed;
    inset: 0;
    opacity: var(--noise-opacity);
    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)'/%3E%3C/svg%3E");
    pointer-events: none;
    z-index: 9997;
}

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

a {
    color: var(--accent-primary);
    text-decoration: none;
    transition: all 0.3s ease;
}
a:hover {
    color: var(--accent-secondary);
    text-shadow: 0 0 8px var(--accent-glow);
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-display);
    font-weight: 700;
    letter-spacing: 0.02em;
}

/* ── NAVIGATION ────────────────────────────────────────── */
.navbar-hh {
    background: var(--nav-bg);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-bottom: 1px solid var(--border-color);
    padding: 0.75rem 0;
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    transition: background var(--transition-speed);
}

.nav-brand {
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: 0.15em;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: 0.6rem;
}
.nav-brand .brand-icon {
    color: var(--accent-primary);
    font-size: 1.3rem;
}
.nav-brand span {
    background: linear-gradient(135deg, var(--text-primary), var(--accent-primary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.navbar-hh .nav-link {
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-secondary);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 0.5rem 1rem !important;
    transition: color 0.3s, text-shadow 0.3s;
    position: relative;
}
.navbar-hh .nav-link:hover,
.navbar-hh .nav-link.active {
    color: var(--accent-primary);
}
.navbar-hh .nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%) scaleX(0);
    width: 60%;
    height: 2px;
    background: var(--accent-primary);
    transition: transform 0.3s ease;
}
.navbar-hh .nav-link:hover::after {
    transform: translateX(-50%) scaleX(1);
}

/* Nav Dropdown */
.nav-dropdown {
    position: relative;
}
.nav-dropdown-toggle {
    cursor: pointer;
}
.nav-dropdown-menu {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(8px);
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    padding: 0.5rem;
    min-width: 220px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s, visibility 0.25s, transform 0.25s;
    z-index: 1100;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
}
.nav-dropdown:hover .nav-dropdown-menu,
.nav-dropdown:focus-within .nav-dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}
.nav-dropdown-item {
    display: block;
    padding: 0.55rem 0.85rem;
    color: var(--text-secondary);
    text-decoration: none;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    letter-spacing: 0.03em;
    border-radius: 6px;
    transition: background 0.2s, color 0.2s;
}
.nav-dropdown-item:hover {
    background: var(--bg-tertiary);
    color: var(--accent-primary);
}

/* Theme Toggle */
.theme-toggle-group {
    display: flex;
    background: var(--bg-tertiary);
    border-radius: 8px;
    padding: 3px;
    gap: 2px;
    border: 1px solid var(--border-subtle);
}
.theme-toggle-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.3s;
    line-height: 1;
}
.theme-toggle-btn.active {
    background: var(--accent-primary);
    color: var(--bg-primary);
    box-shadow: 0 0 12px var(--accent-glow);
}
.theme-toggle-btn:hover:not(.active) {
    color: var(--text-primary);
}

/* Mobile toggle */
.navbar-toggler {
    border: 1px solid var(--border-color);
    padding: 0.4rem 0.6rem;
}
.navbar-toggler-icon {
    background-image: none;
    display: flex;
    align-items: center;
    justify-content: center;
}
.navbar-toggler-icon::before {
    content: '\f0c9';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    color: var(--accent-primary);
    font-size: 1.1rem;
}

/* ── BUTTONS ───────────────────────────────────────────── */
.btn-hh-primary {
    background: var(--accent-primary);
    color: var(--btn-text);
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 0.85rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    padding: 0.9rem 2.2rem;
    border: none;
    border-radius: 4px;
    position: relative;
    overflow: hidden;
    transition: all 0.3s;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.btn-hh-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px var(--accent-glow-strong);
    color: var(--btn-text);
}
.btn-hh-primary::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, transparent, rgba(255,255,255,0.15));
    opacity: 0;
    transition: opacity 0.3s;
}
.btn-hh-primary:hover::before {
    opacity: 1;
}

.btn-hh-outline {
    background: transparent;
    color: var(--accent-primary);
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 0.85rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    padding: 0.9rem 2.2rem;
    border: 2px solid var(--accent-primary);
    border-radius: 4px;
    transition: all 0.3s;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.btn-hh-outline:hover {
    background: var(--accent-glow);
    transform: translateY(-2px);
    box-shadow: 0 8px 30px var(--accent-glow);
    color: var(--accent-primary);
}

/* ── SECTION COMMON ────────────────────────────────────── */
.section-hh {
    padding: 7rem 0;
    position: relative;
}

.section-label {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--accent-primary);
    letter-spacing: 0.2em;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}
.section-label::before {
    content: '>';
    opacity: 0.5;
}

.section-title {
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 800;
    margin-bottom: 1.5rem;
}

.section-desc {
    font-size: 1.15rem;
    color: var(--text-secondary);
    max-width: 600px;
}

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

/* ── SCROLL REVEAL ANIMATIONS ──────────────────────────── */
.reveal {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}
.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}
.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }
.reveal-delay-4 { transition-delay: 0.4s; }
.reveal-delay-5 { transition-delay: 0.5s; }
.reveal-delay-6 { transition-delay: 0.6s; }

/* ── GLITCH TEXT EFFECT ────────────────────────────────── */
.glitch-text {
    position: relative;
}
.glitch-text::before,
.glitch-text::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
}
.glitch-text:hover::before {
    animation: glitch1 0.3s ease forwards;
    color: var(--accent-warn);
    z-index: -1;
}
.glitch-text:hover::after {
    animation: glitch2 0.3s ease forwards;
    color: var(--accent-primary);
    z-index: -1;
}
@keyframes glitch1 {
    0% { opacity: 0; transform: translate(0); }
    20% { opacity: 0.8; transform: translate(-3px, 2px); }
    40% { opacity: 0.8; transform: translate(3px, -2px); }
    60% { opacity: 0.8; transform: translate(-2px, -1px); }
    80% { opacity: 0.4; transform: translate(2px, 1px); }
    100% { opacity: 0; transform: translate(0); }
}
@keyframes glitch2 {
    0% { opacity: 0; transform: translate(0); }
    20% { opacity: 0.8; transform: translate(3px, -2px); }
    40% { opacity: 0.8; transform: translate(-3px, 2px); }
    60% { opacity: 0.8; transform: translate(2px, 1px); }
    80% { opacity: 0.4; transform: translate(-2px, -1px); }
    100% { opacity: 0; transform: translate(0); }
}

/* ── FOOTER ────────────────────────────────────────────── */
.footer-hh {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-subtle);
    padding: 4rem 0 2rem;
}

.footer-brand {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 1rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-primary);
    margin-bottom: 1rem;
}
.footer-tagline {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--accent-primary);
    letter-spacing: 0.1em;
    margin-bottom: 1.5rem;
}

.footer-heading {
    font-family: var(--font-display);
    font-size: 0.7rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 1.25rem;
}

.footer-links {
    list-style: none;
    padding: 0;
    margin: 0;
}
.footer-links li {
    margin-bottom: 0.6rem;
}
.footer-links a {
    color: var(--text-secondary);
    font-size: 0.9rem;
    transition: color 0.3s;
}
.footer-links a:hover {
    color: var(--accent-primary);
}

.footer-bottom {
    border-top: 1px solid var(--border-subtle);
    padding-top: 2rem;
    margin-top: 3rem;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}
.footer-copy {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--text-muted);
    letter-spacing: 0.1em;
}
.footer-socials {
    display: flex;
    gap: 1rem;
}
.footer-socials a {
    color: var(--text-muted);
    font-size: 1.1rem;
    transition: color 0.3s, transform 0.3s;
}
.footer-socials a:hover {
    color: var(--accent-primary);
    transform: translateY(-2px);
}

/* ── BACK TO TOP ───────────────────────────────────────── */
.back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 44px;
    height: 44px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent-primary);
    font-size: 1rem;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
    z-index: 999;
}
.back-to-top.visible {
    opacity: 1;
    visibility: visible;
}
.back-to-top:hover {
    background: var(--accent-primary);
    color: var(--bg-primary);
    transform: translateY(-3px);
}

/* ── TERMINAL THEME OVERRIDES (shared elements) ────────── */
[data-theme="terminal"] .hero-headline,
[data-theme="terminal"] .section-title,
[data-theme="terminal"] .cta-content h2,
[data-theme="terminal"] .page-title {
    text-shadow: 0 0 10px var(--accent-glow-strong);
}
[data-theme="terminal"] .btn-hh-primary,
[data-theme="terminal"] .btn-hh-outline {
    border-radius: 0;
}
[data-theme="terminal"] body {
    text-shadow: 0 0 2px rgba(51, 255, 51, 0.3);
}

/* ── SKIP TO CONTENT (accessibility) ───────────────────── */
.skip-link {
    position: absolute;
    top: -100%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--accent-primary);
    color: var(--bg-primary);
    padding: 0.5rem 1.5rem;
    border-radius: 0 0 8px 8px;
    z-index: 10000;
    font-family: var(--font-mono);
    font-size: 0.8rem;
}
.skip-link:focus {
    top: 0;
}

/* ── BLINK ANIMATION (used for cursors) ────────────────── */
@keyframes blink {
    50% { opacity: 0; }
}

/* ── GRID PULSE ANIMATION (used for backgrounds) ──────── */
@keyframes gridPulse {
    0%, 100% { opacity: 0.4; }
    50% { opacity: 1; }
}

/* ── FADE ANIMATIONS ───────────────────────────────────── */
@keyframes fadeSlideUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 0.7; }
}

/* ── RESPONSIVE — SHARED ──────────────────────────────── */
@media (max-width: 767px) {
    .section-hh {
        padding: 4rem 0;
    }
    .footer-bottom {
        flex-direction: column;
        text-align: center;
    }
}
