@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Arizonia&family=Fascinate+Inline&family=Lovers+Quarrel&family=Rock+Salt&family=Story+Script&display=swap');
:root {
    /* Humane Amber-Primary Palette - { / } Engineering Identity */
    --bg-base: #0B0F1A;
    --bg-surface: rgba(17, 24, 39, 0.7);
    --bg-surface-alt: rgba(31, 41, 55, 0.5);
    
    --accent-orange: #F59E0B;
    --accent-blue: #3B82F6;
    --accent-cyan: #06B6D4;
    --accent: var(--accent-orange); /* Switched to Amber as primary Signal */
    
    --accent-glow: rgba(245, 158, 11, 0.25);
    --accent-dim: rgba(245, 158, 11, 0.05);
    
    --text-primary: #E5E7EB;
    --text-secondary: #9CA3AF;
    --text-muted: #6B7280;
    
    --border: rgba(255, 255, 255, 0.08);
    --border-bright: rgba(255, 255, 255, 0.15);
    
    --nav-bg: rgba(11, 15, 26, 0.85);
    --blueprint-grid: radial-gradient(circle, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
    
    --container-max-width: 1100px;
    --section-spacing: 120px;
    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="light"] {
    /* Warm 'Paper-White' for humane readability */
    --bg-base: #FFFBF5; 
    --bg-surface: rgba(255, 251, 245, 0.8);
    --bg-surface-alt: rgba(245, 235, 215, 0.5);
    
    --accent: #D97706; /* Deep Amber for Light mode contrast */
    --accent-glow: rgba(217, 119, 6, 0.15);
    --accent-dim: rgba(217, 119, 6, 0.06);
    
    --text-primary: #111827;
    --text-secondary: #4B5563;
    --text-muted: #9CA3AF;
    
    --border: rgba(0, 0, 0, 0.08);
    --border-bright: rgba(0, 0, 0, 0.12);
    
    --nav-bg: rgba(255, 251, 245, 0.9);
    --blueprint-grid: radial-gradient(circle, rgba(165, 124, 0, 0.06) 1px, transparent 1px);
}


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

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg-base);
    color: var(--text-primary);
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    transition: background-color 0.3s ease, color 0.3s ease;
    position: relative;
}

/* Aesthetic noise and glow removed. Trust over decoration. */

/* --- Micro-Interactions & Depth --- */
.cursor-glow {
    position: fixed;
    top: 0;
    left: 0;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle closest-side, var(--accent-glow), transparent);
    transform: translate(calc(var(--mouse-x, 0) * 1px - 300px), calc(var(--mouse-y, 0) * 1px - 300px));
    pointer-events: none;
    z-index: -2;
    will-change: transform;
    transition: opacity 0.3s ease;
    opacity: 0.5;
}

[data-theme="light"] .cursor-glow {
    opacity: 0.6;
    background: radial-gradient(circle closest-side, rgba(37, 99, 235, 0.2), transparent);
}

/* --- Global Branding Layer: The Journey --- */
.logo-journey-container {
    position: fixed;
    inset: 0;
    z-index: -10; /* Locked at bottom */
    pointer-events: none; /* Must be transparent to clicks */
    display: block;
    background-color: var(--bg-base);
}

.logo-journey-follower {
    position: absolute; /* Relative to fixed container */
    width: 250px;
    height: auto;
    will-change: offset-distance;
    
    /* Move Path Geometry to Parent */
    offset-path: path('M 200,300 L 500,300 C 600,300 600,500 500,550 C 400,600 400,750 550,750 L 750,700 L 500,350 L 900,300 C 1000,300 1000,600 900,650 C 800,700 800,850 1000,850 L 1200,850');
    offset-rotate: 0deg;
}

.logo-journey-image {
    width: 100%;
    height: auto;
    opacity: 0.12;
    transition: opacity 0.8s ease;
    will-change: transform;
    display: block;
    /* Transform handled dynamically via JS on CHILD */
}

[data-theme="light"] .logo-journey-image {
    opacity: 0.08;
}

/* --- Layout Components --- */

.container {
    max-width: var(--container-max-width);
    margin: 0 auto;
    padding: 0 24px;
}

section {
    padding: var(--section-spacing) 0;
}

.grid {
    display: grid;
    gap: 32px;
}

.bg-blueprint {
    background: var(--blueprint-grid);
}

/* --- Navigation --- */

nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 72px;
    background-color: var(--nav-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    z-index: 1000;
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

nav .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100%;
}

.nav-links {
    display: flex;
    gap: 32px;
    align-items: center;
}

.nav-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: var(--transition-smooth);
}

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

.nav-cta {
    background: var(--bg-surface-alt);
    border: 1px solid var(--accent);
    color: var(--accent) !important;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    transition: var(--transition-smooth);
    white-space: nowrap;
    box-shadow: 0 0 15px -10px var(--accent-glow);
}

.nav-cta:hover {
    background: var(--accent);
    color: #0B0F1A !important; /* High contrast on dark theme bg-base */
    box-shadow: 0 0 25px -5px var(--accent-glow);
    transform: translateY(-1px);
}

[data-theme="light"] .nav-cta:hover {
    color: #FFFFFF !important;
}

.mobile-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 24px;
    height: 18px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
}

.mobile-toggle span {
    width: 100%;
    height: 2px;
    background-color: var(--text-primary);
    border-radius: 2px;
    transition: all 0.3s ease;
}

.mobile-toggle.active span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.mobile-toggle.active span:nth-child(2) { opacity: 0; }
.mobile-toggle.active span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

.nav-logo {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 700;
    font-size: 20px;
    letter-spacing: -0.05em;
    color: var(--text-primary);
    text-decoration: none;
}

/* --- Typography --- */

h1, h2, h3 {
    letter-spacing: -0.03em;
    line-height: 1.1;
}

h1 { font-size: 64px; font-weight: 700; }
h2 { font-size: 40px; font-weight: 600; margin-bottom: 24px; }
h3 { font-size: 24px; font-weight: 600; margin-bottom: 12px; }

.mono {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85em;
    color: var(--accent);
}

/* --- Stylized Visual Accents --- */
.font-display {
    font-family: 'Fascinate Inline', cursive;
}

.font-handwritten {
    font-family: 'Rock Salt', cursive;
    font-size: 11px;
    letter-spacing: 0;
    line-height: 1.4;
}

.font-script {
    font-family: 'Story Script', cursive;
    font-size: 24px;
}

.font-signature {
    font-family: 'Lovers Quarrel', 'Arizonia', cursive;
    font-size: 42px;
    letter-spacing: 0.05em;
}

.arch-number {
    position: absolute;
    top: -40px;
    left: -20px;
    font-size: 120px;
    opacity: 0.04;
    color: var(--text-primary);
    pointer-events: none;
    z-index: -1;
    font-family: 'Fascinate Inline', cursive;
}

.annotation {
    position: absolute;
    color: var(--accent);
    opacity: 0.6;
    pointer-events: none;
}

/* --- Hero Section --- */

#hero {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding-top: 72px;
    position: relative;
}

.hero-content {
    max-width: 800px;
}

.hero-tag {
    display: inline-block;
    padding: 6px 12px;
    background: var(--accent-glow);
    border: 1px solid var(--accent);
    color: var(--accent);
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 24px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.hero-headline {
    margin-bottom: 24px;
    background: linear-gradient(135deg, var(--accent-orange) 0%, var(--accent-cyan) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subheadline {
    font-size: 20px;
    color: var(--text-secondary);
    margin-bottom: 40px;
    max-width: 600px;
}

.hero-proof {
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
    margin-bottom: 48px;
}

.proof-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--text-secondary);
}

.proof-item i {
    color: var(--accent);
}

.cta-group {
    display: flex;
    gap: 16px;
}

.btn {
    display: inline-flex;
    align-items: center;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    text-decoration: none;
    transition: var(--transition-smooth);
}

.btn-primary {
    background: var(--accent);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px -10px var(--accent);
}

.btn-secondary {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: var(--bg-surface);
    color: var(--text-primary);
    border-color: var(--border-bright);
}

/* Theme Toggle Button */
.theme-toggle {
    background: none;
    border: 1px solid var(--border);
    color: var(--text-secondary);
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.theme-toggle:hover {
    color: var(--accent);
    border-color: var(--accent);
    background: var(--accent-dim);
}

.theme-toggle .fa-sun { display: none; }
[data-theme="light"] .theme-toggle .fa-sun { display: block; }
[data-theme="light"] .theme-toggle .fa-moon { display: none; }

/* --- Engineering Impact Layer --- */

.impact-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1px;
    background-color: var(--border);
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
    margin-top: 48px;
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

.impact-stat {
    background-color: var(--bg-base);
    padding: 32px 24px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    transition: background-color 0.3s ease;
}

.impact-value {
    font-family: 'JetBrains Mono', monospace;
    font-size: 28px;
    font-weight: 600;
    color: var(--accent);
}

.impact-label {
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}

/* --- Projects / Systems Section --- */

.section-label {
    display: block;
    color: var(--accent);
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 12px;
    text-transform: uppercase;
}

.systems-grid {
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
}

.system-card {
    background-color: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 32px;
    transition: var(--transition-smooth);
    display: flex;
    flex-direction: column;
    backdrop-filter: blur(12px) saturate(1.8); /* Glassmorphism for readability */
    -webkit-backdrop-filter: blur(12px) saturate(1.8);
    position: relative;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

.system-card:hover {
    border-color: var(--accent);
    background: linear-gradient(to bottom right, var(--bg-surface), var(--accent-dim));
    transform: translateY(-4px);
}

/* --- Evidence Components --- */

.system-evidence {
    margin: 24px 0;
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding: 20px 0;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

/* Architecture Diagram (Minimal) */
.arch-diagram {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    background-color: var(--bg-surface-alt);
    border-radius: 6px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    position: relative;
    border: 1px solid var(--border);
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

.arch-node {
    padding: 6px 10px;
    border: 1px solid var(--border-bright);
    background-color: var(--bg-surface-alt);
    border-radius: 4px;
    color: var(--text-secondary);
    transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease;
}

.arch-connector {
    flex-grow: 1;
    height: 1px;
    background-color: var(--border-bright);
    margin: 0 8px;
    position: relative;
    transition: background-color 0.3s ease;
}

.trace-container {
    position: fixed;
    right: 0.1rem;
    top: 0;
    width: 2px;
    height: 100vh;
    background-color: var(--border);
    z-index: 500;
    transition: background-color 0.3s ease;
}

.trace-line {
    width: 1px;
    background: linear-gradient(to bottom, var(--accent-orange), var(--accent-cyan), transparent);
    transition: height 0.3s ease, background 0.5s ease;
    box-shadow: 0 0 15px var(--accent-glow);
}

[data-theme="light"] .trace-line {
    background: linear-gradient(to bottom, var(--accent-orange), var(--accent-cyan), transparent);
    width: 2px; /* Slight thickness increase for light mode visibility */
}

.trace-line.glitch {
    background: #EF4444;
    box-shadow: 0 0 15px #EF4444;
}

/* Performance Chart (Before/After) */
.perf-chart {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.chart-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.chart-label {
    width: 60px;
    font-size: 11px;
    color: var(--text-muted);
}

.chart-bar-container {
    flex-grow: 1;
    height: 8px;
    background: var(--border);
    border-radius: 4px;
    overflow: hidden;
}

.chart-bar {
    height: 100%;
    background: var(--accent);
    border-radius: 4px;
    transition: width 1.5s ease-in-out;
}

.chart-bar.before { background: var(--text-muted); }

/* Trade-off Matrix */
.decision-blocks {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 16px;
}

.decision-block {
    padding: 12px;
    border-radius: 6px;
    font-size: 12px;
}

.decision-block.rejected {
    background: rgba(239, 68, 68, 0.05);
    border: 1px solid rgba(239, 68, 68, 0.1);
    color: #F87171;
}

.decision-block.accepted {
    background: var(--accent-dim);
    border: 1px solid var(--accent-glow);
    color: var(--accent);
}

.decision-block span {
    display: block;
    font-weight: 700;
    margin-bottom: 4px;
    text-transform: uppercase;
    font-size: 10px;
}

/* --- Narrative Sections --- */

.thinking-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 32px;
    margin-top: 48px;
}

.thinking-card {
    padding: 32px;
    background-color: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

.incident-card {
    padding: 24px;
    background: rgba(239, 68, 68, 0.03);
    border-left: 3px solid #EF4444;
    border-radius: 0 8px 8px 0;
    margin-top: 24px;
}

.incident-tag {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    color: #F87171;
    margin-bottom: 8px;
    display: block;
}

/* Staggered Reveal Logic Support */
.reveal {
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.reveal.staggered-1 { transition-delay: 0.1s; }
.reveal.staggered-2 { transition-delay: 0.2s; }
.reveal.staggered-3 { transition-delay: 0.3s; }
.reveal.staggered-4 { transition-delay: 0.4s; }

.system-desc {
    color: var(--text-secondary);
    font-size: 15px;
    margin-bottom: 24px;
    flex-grow: 1;
}

.system-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.system-tag {
    padding: 4px 10px;
    background-color: var(--accent-dim);
    border: 1px solid var(--border);
    border-radius: 4px;
    font-size: 12px;
    color: var(--text-secondary);
    transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease;
}

/* --- Skills Section --- */

.skills-wrapper {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 40px;
}

.skill-category h4 {
    font-size: 16px;
    color: var(--text-primary);
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}

.skill-list {
    list-style: none;
}

.skill-list li {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
    color: var(--text-secondary);
}

.skill-list li::before {
    content: '';
    width: 6px;
    height: 6px;
    background: var(--accent);
    border-radius: 50%;
}

/* --- Raw Evidence Snippets --- */
.code-block {
    background-color: #0A0A0B;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 24px;
    overflow-x: auto;
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
    line-height: 1.5;
    color: #F3F4F6;
    margin: 32px 0;
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

[data-theme="light"] .code-block {
    background-color: #F9FAFB;
    color: #111827;
}

.code-block .keyword { color: #3B82F6; }
.code-block .string { color: #10B981; }
.code-block .number { color: #F59E0B; }
.code-block .comment { color: #6B7280; font-style: italic; }
.code-block .operator { color: #EF4444; }
.code-block .highlight-line { background-color: rgba(239, 68, 68, 0.1); border-left: 3px solid #EF4444; display: block; padding-left: 8px; margin-left: -11px; }

/* --- High-Signal Impact Strip --- */
.impact-strip {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 48px;
    padding: 24px;
    background-color: var(--bg-surface-alt);
    border: 1px solid var(--border);
    border-radius: 8px;
    max-width: 800px;
}

.impact-strip-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    font-size: 15px;
    color: var(--text-secondary);
}

.impact-strip-item i {
    color: #10B981;
    margin-top: 4px;
    flex-shrink: 0;
}

.impact-strip-item strong {
    color: var(--text-primary);
}

/* --- Progressive Disclosure (Details/Summary) --- */
details {
    background-color: var(--bg-base);
    border: 1px dashed var(--border);
    border-radius: 6px;
    margin-top: 24px;
    overflow: hidden;
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

details[open] {
    border: 1px solid var(--border-bright);
}

summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    font-weight: 600;
    color: var(--text-primary);
    cursor: pointer;
    user-select: none;
    list-style: none; /* Hide default arrow */
    transition: background-color 0.2s ease;
}

summary::-webkit-details-marker {
    display: none; /* Chrome/Safari */
}

summary:hover {
    background-color: var(--bg-surface-alt);
}

summary::after {
    content: "Read Full Details \2192";
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--accent);
}

details[open] summary {
    border-bottom: 1px solid var(--border);
    background-color: var(--bg-surface-alt);
}

details[open] summary::after {
    content: "Close \2191";
    color: var(--text-muted);
}

.details-content {
    padding: 24px;
}

/* --- About / Narrative --- */

.about-content {
    max-width: 680px;
    font-size: 18px;
    color: var(--text-secondary);
}

.about-content p {
    margin-bottom: 24px;
}

/* --- Contact --- */

#contact .container {
    text-align: center;
}

.social-links {
    display: flex;
    justify-content: center;
    gap: 32px;
    margin: 40px 0;
}

.social-link {
    color: var(--text-secondary);
    font-size: 24px;
    transition: var(--transition-smooth);
}

.social-link:hover {
    color: var(--accent);
    transform: scale(1.1);
}

/* --- Utilities --- */

.reveal {
    opacity: 0;
    transform: translateY(20px);
    filter: blur(10px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out, filter 0.8s ease-out;
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0);
}

/* --- Responsive --- */

@media (max-width: 768px) {
    h1 { font-size: 42px; }
    h2 { font-size: 32px; }
    .hero-subheadline { font-size: 18px; }
    .btn { width: 100%; text-align: center; justify-content: center; }
    .cta-group { flex-direction: column; }
    
    .mobile-toggle { display: flex; }
    
    .nav-links {
        position: fixed;
        top: 72px;
        left: 0;
        right: 0;
        height: 0;
        background-color: var(--nav-bg);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        flex-direction: column;
        padding: 0;
        overflow: hidden;
        transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        border-bottom: 0 solid var(--border);
        gap: 0;
    }
    
    .nav-links.active {
        height: auto;
        padding: 32px;
        border-bottom: 1px solid var(--border);
        gap: 24px;
    }
    
    .nav-links a {
        font-size: 18px;
        width: 100%;
        text-align: center;
    }
    
    .nav-cta {
        font-size: 12px;
        padding: 6px 12px;
    }
}