/* ===========================
   DESIGN TOKENS
=========================== */
:root {
    --primary: #D4AF37;
    --primary-glow: rgba(212, 175, 55, 0.15);
    --primary-glow-strong: rgba(212, 175, 55, 0.35);
    --secondary: #FFFFFF;
    --bg-dark: #1A1A1A;
    --bg-surface: #242424;
    --bg-light: #FFFFFF;
    --text-main-dark: #FFFFFF;
    --text-main-light: #1A1A1A;
    --text-muted: #CECECE;
    --border-subtle: #333333;

    --font-heading: 'Doto', monospace;
    --font-body: 'Space Mono', monospace;

    --radius-global: 0px;
    --border-width-btn: 2px;
    --max-width: 1200px;
    --spacing-unit: 8px;
}

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

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main-dark);
    font-family: var(--font-body);
    font-size: 15px;
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

/* ===========================
   NAV
=========================== */
nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: calc(var(--spacing-unit) * 2) calc(var(--spacing-unit) * 4);
    border-bottom: 1px solid var(--border-subtle);
    position: sticky;
    top: 0;
    background-color: rgba(26, 26, 26, 0.92);
    backdrop-filter: blur(8px);
    z-index: 100;
}

.nav-logo {
    font-family: var(--font-heading);
    font-size: 1.4rem;
    color: var(--secondary);
    text-decoration: none;
    letter-spacing: 0.12em;
}

.nav-logo span {
    color: var(--primary);
}

.nav-links {
    display: flex;
    gap: calc(var(--spacing-unit) * 4);
    list-style: none;
}

.nav-links a {
    color: var(--text-muted);
    text-decoration: none;
    font-family: var(--font-body);
    font-size: 0.8rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    transition: color 0.2s;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--primary);
}

/* ===========================
   HAMBURGER MENU
=========================== */
.nav-hamburger {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 28px;
    height: 28px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 110;
}

.nav-hamburger span {
    display: block;
    width: 100%;
    height: 2px;
    background-color: var(--secondary);
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.nav-hamburger.open span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.nav-hamburger.open span:nth-child(2) {
    opacity: 0;
}

.nav-hamburger.open span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* Mobile menu overlay */
.nav-mobile-menu {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(26, 26, 26, 0.97);
    backdrop-filter: blur(12px);
    z-index: 99;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: calc(var(--spacing-unit) * 5);
}

.nav-mobile-menu.open {
    display: flex;
}

.nav-mobile-menu a {
    color: var(--text-main-dark);
    text-decoration: none;
    font-family: var(--font-heading);
    font-size: 1.6rem;
    letter-spacing: 0.12em;
    transition: color 0.2s;
}

.nav-mobile-menu a:hover {
    color: var(--primary);
}

.nav-mobile-menu .btn {
    margin-top: calc(var(--spacing-unit) * 2);
}

/* ===========================
   BUTTONS
=========================== */
.btn {
    display: inline-block;
    font-family: var(--font-heading);
    font-size: 0.85rem;
    letter-spacing: 0.1em;
    padding: calc(var(--spacing-unit) * 1.5) calc(var(--spacing-unit) * 5);
    border: var(--border-width-btn) solid transparent;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 0.25s, color 0.25s, border-color 0.25s, box-shadow 0.25s;
    border-radius: var(--radius-global);
}

.btn-primary {
    background-color: transparent;
    border-color: var(--primary);
    color: var(--primary);
}

.btn-primary:hover {
    background-color: var(--primary);
    color: var(--text-main-light);
    box-shadow: 0 0 20px var(--primary-glow);
}

.btn-secondary {
    background-color: transparent;
    border-color: var(--text-muted);
    color: var(--text-main-dark);
}

.btn-secondary:hover {
    border-color: var(--text-main-dark);
}

/* ===========================
   MAIN CONTENT
=========================== */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: calc(var(--spacing-unit) * 2) calc(var(--spacing-unit) * 4);
    position: relative;
}

/* ===========================
   BLUEPRINT BG
=========================== */
.bg-grid {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    opacity: 0.04;
}

.bg-grid svg {
    width: 100%;
    height: 100%;
}

/* ===========================
   TRAINING WRAPPER
   Title (centered) → Panels (2 cols) → Blog CTA (centered)
=========================== */
.training-wrapper {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: var(--max-width);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

/* ===========================
   HERO TITLE — centered, full width
=========================== */
.hero-title {
    font-family: var(--font-heading);
    font-size: clamp(1.8rem, 4vw, 3rem);
    letter-spacing: 0.06em;
    line-height: 1.15;
    margin-bottom: calc(var(--spacing-unit) * 2);
}

.hero-title em {
    font-style: normal;
    color: var(--primary);
}

/* ===========================
   TRAINING PANELS — two columns
=========================== */
.training-panels {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: calc(var(--spacing-unit) * 3);
    width: 100%;
    margin-bottom: calc(var(--spacing-unit) * 2);
    align-items: center;
}

.panel-nn {
    display: flex;
    align-items: center;
    justify-content: center;
}

.panel-data {
    display: flex;
    flex-direction: column;
    gap: calc(var(--spacing-unit) * 2);
}

/* ===========================
   NEURAL NETWORK ANIMATION
=========================== */
.nn-visual {
    display: flex;
    justify-content: center;
    width: 100%;
}

.nn-visual svg {
    width: 100%;
    max-width: 500px;
    height: auto;
}

.nn-node {
    fill: #2e2e2e;
    stroke: none;
    transition: fill 0.5s ease, filter 0.5s ease;
}

.nn-node.active {
    fill: var(--primary);
    filter: drop-shadow(0 0 6px rgba(212, 175, 55, 0.45));
}

.nn-edge {
    stroke: var(--border-subtle);
    stroke-width: 0.5;
    transition: stroke 0.4s ease, stroke-width 0.4s ease;
}

.nn-edge.active {
    stroke: var(--primary);
    stroke-width: 1;
    filter: drop-shadow(0 0 2px var(--primary-glow-strong));
}

.nn-signal {
    fill: var(--primary);
    opacity: 0;
    filter: drop-shadow(0 0 4px rgba(212, 175, 55, 0.5));
}

/* ===========================
   METRICS GRID — 2x2
=========================== */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0;
    border: 1px solid var(--border-subtle);
}

.metric-item {
    padding: calc(var(--spacing-unit) * 1) calc(var(--spacing-unit) * 2);
    border-right: 1px solid var(--border-subtle);
    border-bottom: 1px solid var(--border-subtle);
    text-align: center;
}

.metric-item:nth-child(2n) {
    border-right: none;
}

.metric-item:nth-child(n+3) {
    border-bottom: none;
}

.metric-value {
    font-family: var(--font-heading);
    font-size: clamp(1.2rem, 2.5vw, 1.8rem);
    color: var(--primary);
    display: block;
    line-height: 1;
    margin-bottom: calc(var(--spacing-unit) * 0.5);
    transition: all 0.3s ease;
}

.metric-label {
    font-size: 0.65rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-muted);
}

/* ===========================
   TRAINING LOG
=========================== */
.training-console {
    background-color: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    padding: calc(var(--spacing-unit) * 2);
    text-align: left;
    height: 140px;
    overflow: hidden;
    position: relative;
}

.console-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: calc(var(--spacing-unit) * 1.5);
    padding-bottom: calc(var(--spacing-unit) * 1.5);
    border-bottom: 1px solid var(--border-subtle);
}

.console-title {
    font-family: var(--font-body);
    font-size: 0.68rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.console-indicator {
    display: flex;
    gap: 6px;
}

.console-indicator span {
    width: 8px;
    height: 8px;
    border: 1px solid var(--border-subtle);
}

.console-indicator span.active {
    background-color: var(--primary);
    border-color: var(--primary);
}

.log-lines {
    font-family: var(--font-body);
    font-size: 0.68rem;
    line-height: 1.8;
    color: var(--text-muted);
}

.log-line {
    opacity: 0;
    animation: fadeInLine 0.4s ease forwards;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.log-line .log-key {
    color: var(--primary);
}

.log-line .log-val {
    color: var(--secondary);
}

.console-fade {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 40px;
    background: linear-gradient(transparent, var(--bg-surface));
    pointer-events: none;
}

@keyframes fadeInLine {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===========================
   DIVIDER
=========================== */
.divider-label {
    font-family: var(--font-body);
    font-size: 0.68rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: calc(var(--spacing-unit) * 2);
    margin-bottom: calc(var(--spacing-unit) * 1);
    width: 100%;
}

.divider-label::before,
.divider-label::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border-subtle);
}

/* ===========================
   BLOG CTA — centered, full width
=========================== */
.blog-cta {
    text-align: center;
    width: 100%;
}

.blog-cta p {
    color: var(--text-muted);
    font-size: 0.78rem;
    margin-bottom: calc(var(--spacing-unit) * 1);
    max-width: 50ch;
    margin-left: auto;
    margin-right: auto;
}

/* ===========================
   FOOTER
=========================== */
footer {
    border-top: 1px solid var(--border-subtle);
    padding: calc(var(--spacing-unit) * 3) calc(var(--spacing-unit) * 4);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: calc(var(--spacing-unit) * 2);
    position: relative;
    z-index: 1;
}

footer .nav-logo {
    font-size: 1rem;
}

footer p {
    font-size: 0.72rem;
    color: var(--text-muted);
    letter-spacing: 0.05em;
}

/* ===========================
   RESPONSIVE
=========================== */
@media (max-width: 900px) {
    .training-panels {
        grid-template-columns: 1fr;
        gap: calc(var(--spacing-unit) * 4);
    }

    .main-content {
        justify-content: flex-start;
        padding-top: calc(var(--spacing-unit) * 6);
    }
}

@media (max-width: 768px) {
    .nav-links {
        display: none;
    }

    nav .btn {
        display: none;
    }

    .nav-hamburger {
        display: flex;
    }
}

@media (max-width: 600px) {
    .hero-title {
        font-size: clamp(1.6rem, 6vw, 2.2rem);
    }

    .nn-visual svg {
        max-width: 320px;
    }
}