/* Theme definitions: Pitch Black True Dark Mode by default */
:root {
    /* Default: Absolute True Dark Mode (#000000 / OLED Black) */
    --bg-page: #000000;
    --bg-surface: #0a0c0a;
    --bg-surface-alt: #10140f;
    --bg-subtle: #0d100c;
    --ink: #f2f5ed;
    --ink-muted: #9aa293;
    --ink-subtle: #6a7463;
    --lime: #00ff66;
    --lime-glow: rgba(0, 255, 102, 0.4);
    --lime-soft: rgba(0, 255, 102, 0.08);
    --line: #1c221a;
    --line-light: #252e22;
    --dark: #000000;
    --dark-surface: #070906;
    --dark-border: #181f16;
    --accent-red: #ff4d4d;
    --card-bg: #080a07;
    --card-shadow: 10px 10px 0 var(--lime);
    --grid-opacity: 0.06;
    --marquee-bg: #070a06;
    --marquee-color: #00ff66;
    --marquee-border: #1c221a;
    --max: 1240px;
}

/* Light Mode Overrides (When user clicks "Turn On Lights") */
html[data-theme="light"] {
    --bg-page: #f0efe8;
    --bg-surface: #faf9f5;
    --bg-surface-alt: #e7e5dc;
    --bg-subtle: #d9dccf;
    --ink: #10120f;
    --ink-muted: #555a51;
    --ink-subtle: #666a60;
    --lime: #16a34a;
    --lime-glow: rgba(22, 163, 74, 0.3);
    --lime-soft: rgba(22, 163, 74, 0.12);
    --line: #ced0c6;
    --line-light: #e0e2d8;
    --dark: #111510;
    --dark-surface: #181c16;
    --dark-border: #282e24;
    --card-bg: #d9dccf;
    --card-shadow: 10px 10px 0 #16a34a;
    --grid-opacity: 0.08;
    --marquee-bg: #e2fbd7;
    --marquee-color: #14532d;
    --marquee-border: #ced0c6;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    background-color: var(--bg-page);
    transition: background-color 0.25s ease, color 0.25s ease;
}

body {
    margin: 0;
    background: var(--bg-page);
    color: var(--ink);
    font-family: 'Manrope', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    transition: background-color 0.25s ease, color 0.25s ease;
}

.grid {
    position: absolute;
    inset: 0 0 auto;
    height: 950px;
    pointer-events: none;
    background-image: linear-gradient(rgba(0, 255, 102, var(--grid-opacity)) 1px, transparent 1px), 
                      linear-gradient(90deg, rgba(0, 255, 102, var(--grid-opacity)) 1px, transparent 1px);
    background-size: 44px 44px;
    mask-image: linear-gradient(#000, transparent);
}

.shell {
    width: min(calc(100% - 48px), var(--max));
    margin: auto;
}

/* Navigation */
.nav {
    height: 88px;
    display: flex;
    align-items: center;
    border-bottom: 1px solid var(--line);
    position: relative;
    z-index: 10;
    background: var(--bg-page);
}

.wordmark {
    display: flex;
    align-items: center;
    gap: 12px;
    font: 600 13px 'DM Mono', monospace;
    color: var(--ink);
    text-decoration: none;
    letter-spacing: 0.05em;
}

.wordmark span {
    background: var(--lime);
    color: #000000;
    padding: 7px 10px;
    font-weight: 800;
    box-shadow: 0 0 10px var(--lime-glow);
}

.nav nav {
    display: flex;
    gap: 28px;
    margin: auto;
}

.nav nav a,
.nav-cta,
.nav-live {
    color: var(--ink);
    text-decoration: none;
    font: 500 12px 'DM Mono', monospace;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    transition: all 0.2s ease;
}

.nav nav a:hover {
    color: var(--lime);
    text-decoration: underline;
    text-underline-offset: 5px;
    text-shadow: 0 0 8px var(--lime-glow);
}

.nav-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

/* Turn On Lights / Theme Toggle Button */
.theme-toggle-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-surface);
    color: var(--ink);
    border: 1px solid var(--line);
    padding: 8px 14px;
    font: 600 11px 'DM Mono', monospace;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    transition: all 0.2s ease;
    border-radius: 4px;
}

.theme-toggle-btn:hover {
    background: var(--lime);
    color: #000000;
    border-color: var(--lime);
    box-shadow: 0 0 16px var(--lime-glow);
}

.theme-toggle-btn .toggle-icon {
    font-size: 13px;
    line-height: 1;
}

.nav-live {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: transparent;
    color: var(--lime);
    border: 1px solid var(--lime);
    padding: 8px 13px;
    font-weight: 700;
    border-radius: 2px;
    box-shadow: 0 0 10px var(--lime-soft);
}

.nav-live:hover {
    background: var(--lime);
    color: #000000;
    box-shadow: 0 0 16px var(--lime-glow);
}

.nav-cta {
    border: 1px solid var(--line);
    padding: 8px 13px;
    border-radius: 2px;
}

.nav-cta:hover {
    background: var(--ink);
    color: var(--bg-page);
    border-color: var(--ink);
}

/* Hero Section */
.hero {
    padding: 84px 0 0;
    position: relative;
    background: var(--bg-page);
}

.signal,
.eyebrow {
    font: 500 11px 'DM Mono', monospace;
    letter-spacing: .1em;
}

.signal-banner {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    margin-bottom: 24px;
}

.signal {
    display: inline-flex;
    gap: 9px;
    align-items: center;
    border: 1px solid var(--line);
    padding: 8px 14px;
    background: var(--bg-surface);
    backdrop-filter: blur(6px);
    text-decoration: none;
    color: var(--ink);
    transition: border-color 0.2s ease;
}

.signal.pulse i {
    width: 8px;
    height: 8px;
    background: var(--lime);
    border-radius: 50%;
    box-shadow: 0 0 0 3px rgba(0, 255, 102, 0.2);
    animation: statusPulse 2s infinite ease-in-out;
}

@keyframes statusPulse {
    0%, 100% { box-shadow: 0 0 0 3px rgba(0, 255, 102, 0.2); }
    50% { box-shadow: 0 0 0 8px rgba(0, 255, 102, 0.4); }
}

.signal.interactive {
    border-color: var(--lime);
    background: var(--lime-soft);
    color: var(--lime);
    font-weight: 700;
}

.signal.interactive:hover {
    background: var(--lime);
    color: #000000;
    box-shadow: 0 0 14px var(--lime-glow);
}

.hero-grid {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 70px;
    align-items: end;
    padding: 20px 0 74px;
}

.eyebrow {
    color: var(--ink-subtle);
    text-transform: uppercase;
}

h1 {
    font-size: clamp(48px, 6.5vw, 92px);
    line-height: .96;
    letter-spacing: -.06em;
    margin: 20px 0 24px;
    max-width: 940px;
    color: var(--ink);
}

h1 em,
h2 em {
    font-weight: 400;
    font-style: italic;
    color: var(--lime);
    text-shadow: 0 0 12px var(--lime-soft);
}

.lede {
    font-size: 19px;
    line-height: 1.65;
    max-width: 720px;
    color: var(--ink-muted);
}

.lede strong {
    color: var(--ink);
}

.actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 36px;
}

.button {
    padding: 14px 22px;
    text-decoration: none;
    font: 600 12px 'DM Mono', monospace;
    border: 1px solid var(--line);
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.button.primary {
    background: var(--bg-surface-alt);
    color: var(--ink);
    border-color: var(--line-light);
}

.button.primary:hover {
    background: var(--lime);
    color: #000000;
    border-color: var(--lime);
    box-shadow: 0 0 18px var(--lime-glow);
    transform: translateY(-1px);
}

.button.primary span {
    color: var(--lime);
}

.button.primary:hover span {
    color: #000000;
}

.button.secondary {
    color: var(--ink);
    background: var(--bg-surface);
    border-color: var(--line);
}

.button.secondary:hover {
    background: var(--bg-surface-alt);
    border-color: var(--lime);
    color: var(--lime);
}

.button.highlight {
    background: var(--lime);
    color: #000000;
    border-color: var(--lime);
    font-weight: 700;
    box-shadow: 0 0 14px var(--lime-glow);
}

.button.highlight:hover {
    background: transparent;
    color: var(--lime);
    box-shadow: 0 0 20px var(--lime-glow);
}

/* Profile Card */
.profile-card {
    border: 1px solid var(--line);
    background: var(--card-bg);
    padding: 14px;
    position: relative;
    box-shadow: var(--card-shadow);
    transition: all 0.25s ease;
}

.profile-card img {
    width: 100%;
    height: auto;
    display: block;
    filter: grayscale(1) contrast(1.15);
}

.scanline {
    position: absolute;
    z-index: 1;
    inset: 14px 14px auto;
    height: 3px;
    background: var(--lime);
    box-shadow: 0 0 14px var(--lime);
    animation: scan 4s ease-in-out infinite;
}

@keyframes scan {
    50% { transform: translateY(270px); }
}

.profile-meta {
    display: grid;
    grid-template-columns: 78px 1fr;
    gap: 6px;
    margin-top: 14px;
    font: 400 9px 'DM Mono', monospace;
}

.profile-meta span {
    color: var(--ink-subtle);
}

.profile-meta strong {
    font-weight: 600;
    color: var(--ink);
}

/* Metrics */
.metrics {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    border-block: 1px solid var(--line);
    background: var(--bg-surface);
}

.metrics div {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 28px 20px;
    border-right: 1px solid var(--line);
}

.metrics div:last-child {
    border: 0;
}

.metrics strong {
    font-size: 36px;
    font-weight: 800;
    letter-spacing: -0.03em;
    color: var(--ink);
}

.metrics span {
    font: 500 9px/1.5 'DM Mono', monospace;
    color: var(--ink-muted);
}

/* Live Deploy Callout Banner */
.portal-banner {
    background: var(--dark-surface);
    color: white;
    padding: 22px 0;
    border-bottom: 1px solid var(--line);
}

.portal-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
}

.portal-text {
    display: flex;
    align-items: center;
    gap: 16px;
}

.portal-badge {
    background: var(--lime);
    color: #000000;
    padding: 5px 9px;
    font: 800 10px 'DM Mono', monospace;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    box-shadow: 0 0 10px var(--lime-glow);
}

.portal-text p {
    margin: 0;
    font-size: 14px;
    color: #cdd5c8;
}

.portal-text strong {
    color: #ffffff;
}

.portal-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: transparent;
    color: var(--lime);
    border: 1px solid var(--lime);
    padding: 9px 16px;
    text-decoration: none;
    font: 600 11px 'DM Mono', monospace;
    transition: all 0.2s ease;
    box-shadow: 0 0 10px var(--lime-soft);
}

.portal-btn:hover {
    background: var(--lime);
    color: #000000;
    box-shadow: 0 0 18px var(--lime-glow);
}

/* Marquee: Obsidian Dark in dark mode, light accent in light mode */
.marquee {
    overflow: hidden;
    background: var(--marquee-bg);
    color: var(--marquee-color);
    border-bottom: 1px solid var(--marquee-border);
    font: 700 11px 'DM Mono', monospace;
    padding: 13px 0;
    white-space: nowrap;
}

.marquee div {
    width: max-content;
    animation: marquee 26s linear infinite;
}

.marquee b {
    margin: 0 28px;
    font-weight: 500;
    opacity: 0.8;
}

@keyframes marquee {
    to { transform: translateX(-50%); }
}

/* Sections */
.section {
    padding: 110px 0;
    background: var(--bg-page);
}

.section-head {
    display: grid;
    grid-template-columns: 160px 1fr 360px;
    gap: 40px;
    align-items: start;
    margin-bottom: 60px;
}

.section-head h2 {
    font-size: clamp(36px, 4.5vw, 62px);
    line-height: 1.02;
    letter-spacing: -.045em;
    margin: 0;
    color: var(--ink);
}

.section-head > p:last-child {
    margin: 0;
    color: var(--ink-muted);
    line-height: 1.65;
    font-size: 15px;
}

/* Expertise Grid */
.expertise-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    border: 1px solid var(--line);
    background: var(--bg-surface);
}

.expertise-grid article {
    padding: 38px;
    min-height: 340px;
    border-right: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    background: var(--bg-surface);
    transition: background 0.2s ease, border-color 0.2s ease;
}

.expertise-grid article:hover {
    background: var(--bg-surface-alt);
    border-color: var(--line-light);
}

.expertise-grid article:nth-child(2n) {
    border-right: 0;
}

.expertise-grid article:nth-child(n+3) {
    border-bottom: 0;
}

.expertise-grid article > span {
    font: 500 11px 'DM Mono', monospace;
    color: var(--ink-subtle);
}

.icon {
    font-size: 38px;
    margin: 24px 0 18px;
    color: var(--lime);
    text-shadow: 0 0 14px var(--lime-glow);
}

.expertise-grid h3 {
    font-size: 24px;
    margin: 0 0 12px;
    letter-spacing: -0.02em;
    color: var(--ink);
}

.expertise-grid p {
    color: var(--ink-muted);
    line-height: 1.6;
    margin: 0;
    font-size: 15px;
}

.expertise-grid ul {
    list-style: none;
    padding: 0;
    margin: 28px 0 0;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.expertise-grid li {
    font: 500 9px 'DM Mono', monospace;
    border: 1px solid var(--line);
    padding: 7px 10px;
    background: var(--bg-page);
    color: var(--ink);
}

/* Career / Experience Section */
.career-section {
    background: var(--bg-surface);
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
}

.timeline {
    border-top: 1px solid var(--line);
}

.timeline-item {
    display: grid;
    grid-template-columns: 220px 1fr 200px;
    gap: 30px;
    padding: 32px 0;
    border-bottom: 1px solid var(--line);
    align-items: start;
}

.timeline-meta span {
    font: 600 12px 'DM Mono', monospace;
    color: var(--lime);
    display: block;
    text-shadow: 0 0 8px var(--lime-soft);
}

.timeline-meta small {
    font: 400 10px 'DM Mono', monospace;
    color: var(--ink-subtle);
}

.timeline-content h3 {
    margin: 0 0 8px;
    font-size: 22px;
    color: var(--ink);
}

.timeline-content p {
    margin: 0 0 14px;
    color: var(--ink-muted);
    font-size: 15px;
}

.timeline-content ul {
    margin: 0;
    padding-left: 18px;
    color: var(--ink-muted);
    font-size: 14px;
}

.timeline-content li {
    margin-bottom: 6px;
}

.timeline-badge {
    text-align: right;
    font: 600 10px 'DM Mono', monospace;
    background: var(--lime);
    color: #000000;
    padding: 8px 12px;
    align-self: start;
    width: fit-content;
    margin-left: auto;
    box-shadow: 0 0 10px var(--lime-glow);
}

/* Dark Projects Section */
.dark {
    background: var(--dark);
    color: white;
}

.section-head.light .eyebrow,
.section-head.light > p:last-child {
    color: #989d91;
}

.section-head.light h2 {
    color: #ffffff;
}

.projects {
    border-top: 1px solid var(--line);
}

.projects a {
    display: grid;
    grid-template-columns: 80px 1fr 40px;
    gap: 30px;
    align-items: center;
    color: white;
    text-decoration: none;
    padding: 34px 0;
    border-bottom: 1px solid var(--line);
    transition: all .25s ease;
}

.projects a:hover {
    padding-left: 14px;
    background: rgba(0, 255, 102, 0.04);
}

.projects a > span,
.projects small {
    font: 500 10px 'DM Mono', monospace;
    color: #8f9588;
    letter-spacing: 0.05em;
}

.projects h3 {
    font-size: 30px;
    margin: 6px 0;
    letter-spacing: -0.02em;
    color: #ffffff;
}

.projects p {
    color: #a9aea3;
    margin: 0;
    font-size: 14px;
}

.projects a > b {
    font-size: 24px;
    color: var(--lime);
    font-weight: normal;
    transition: transform 0.2s ease;
}

.projects a:hover > b {
    transform: translate(4px, -4px);
    text-shadow: 0 0 10px var(--lime);
}

.all-work {
    display: flex;
    justify-content: space-between;
    color: white;
    text-decoration: none;
    font: 500 12px 'DM Mono', monospace;
    margin-top: 36px;
    padding: 16px 20px;
    border: 1px solid var(--line);
    transition: border-color 0.2s ease;
}

.all-work:hover {
    border-color: var(--lime);
    box-shadow: 0 0 12px var(--lime-soft);
}

.all-work span {
    color: var(--lime);
}

/* Operating Model */
.approach .section-head {
    grid-template-columns: 160px 1fr;
}

.pipeline {
    display: grid;
    grid-template-columns: 1fr 30px 1fr 30px 1fr 30px 1fr;
    border-top: 1px solid var(--line);
    padding-top: 36px;
}

.pipeline > div span {
    font: 500 10px 'DM Mono', monospace;
    color: var(--ink-subtle);
}

.pipeline strong {
    display: block;
    font: 600 15px 'DM Mono', monospace;
    margin: 22px 0 10px;
    color: var(--ink);
}

.pipeline p {
    font-size: 13px;
    line-height: 1.6;
    color: var(--ink-muted);
    margin: 0;
}

.pipeline i {
    align-self: center;
    font-style: normal;
    color: var(--line);
    font-size: 16px;
}

/* Connect / Contact Section: True Pitch Black in dark mode */
.contact {
    background: var(--dark-surface);
    border-block: 1px solid var(--line);
}

html[data-theme="light"] .contact {
    background: var(--lime);
}

.contact-inner {
    padding: 100px 0;
}

.contact h2 {
    font-size: clamp(46px, 6.5vw, 90px);
    line-height: .96;
    letter-spacing: -.055em;
    max-width: 1000px;
    margin: 25px 0;
    color: var(--ink);
}

.contact h2 em {
    color: var(--lime);
    text-shadow: 0 0 14px var(--lime-glow);
}

html[data-theme="light"] .contact h2 em {
    color: #14532d;
    text-shadow: none;
}

.contact p:not(.eyebrow) {
    font-size: 18px;
    max-width: 680px;
    line-height: 1.6;
    color: var(--ink-muted);
}

html[data-theme="light"] .contact p:not(.eyebrow) {
    color: #14532d;
}

.contact-links {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 36px;
}

.contact-links a {
    color: var(--ink);
    background: var(--bg-surface);
    border: 1px solid var(--line);
    padding: 13px 18px;
    text-decoration: none;
    font: 600 11px 'DM Mono', monospace;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.contact-links a:hover {
    background: var(--lime);
    color: #000000;
    border-color: var(--lime);
    box-shadow: 0 0 16px var(--lime-glow);
}

.contact-links a.featured-link {
    background: var(--lime);
    color: #000000;
    border-color: var(--lime);
    box-shadow: 0 0 12px var(--lime-glow);
}

.contact-links a.featured-link:hover {
    background: transparent;
    color: var(--lime);
    box-shadow: 0 0 18px var(--lime-glow);
}

/* Footer */
footer {
    min-height: 110px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font: 500 10px 'DM Mono', monospace;
    color: var(--ink-subtle);
    background: var(--bg-page);
}

footer a {
    color: var(--ink);
    text-decoration: none;
}

footer a:hover {
    color: var(--lime);
    text-decoration: underline;
}

/* Responsive */
@media (max-width: 900px) {
    .nav nav { display: none; }
    .nav-actions { margin-left: auto; }
    .hero { padding-top: 60px; }
    .hero-grid { grid-template-columns: 1fr; gap: 40px; }
    .profile-card { max-width: 320px; }
    .metrics { grid-template-columns: 1fr 1fr; }
    .section-head { grid-template-columns: 1fr; gap: 20px; }
    .expertise-grid { grid-template-columns: 1fr; }
    .expertise-grid article { border-right: 0 !important; border-bottom: 1px solid var(--line) !important; }
    .timeline-item { grid-template-columns: 1fr; gap: 14px; }
    .timeline-badge { margin-left: 0; }
    .pipeline { grid-template-columns: 1fr; gap: 16px; }
    .pipeline i { transform: rotate(90deg); margin: 8px 0; }
    .projects a { grid-template-columns: 40px 1fr 25px; gap: 15px; }
}

@media (max-width: 540px) {
    .shell { width: calc(100% - 30px); }
    h1 { font-size: 46px; }
    .actions, .contact-links { flex-direction: column; }
    .metrics { grid-template-columns: 1fr; }
    .metrics div { border-right: 0; border-bottom: 1px solid var(--line); }
    .section { padding: 75px 0; }
    .projects p { display: none; }
    .portal-inner { flex-direction: column; align-items: flex-start; }
    .theme-toggle-btn span.toggle-text { display: none; }
    footer { align-items: flex-start; flex-direction: column; justify-content: center; gap: 10px; padding: 24px 0; }
}

@media (prefers-reduced-motion: reduce) {
    * {
        scroll-behavior: auto !important;
        animation: none !important;
    }
}
