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

:root {
 --black:   #0A0A0A;
 --panel:   #111111;
 --white:   #F0EDE8;
 --accent:  #4A9EFF;
 --mid:     #9B9B9B;   /* secondary text — ~7:1 on --black (AAA) */
 --faint:   #6E6E6E;   /* decorative only (dots, rules) — not body text */
 --border:  #232323;

 --font-display: 'Martian Mono', ui-monospace, 'Cascadia Code', monospace;
 --font-mono:    'Spline Sans Mono', ui-monospace, 'Cascadia Code', monospace;
}

html { font-size: 16px; scroll-behavior: smooth; }

body {
 background: var(--black);
 color: var(--white);
 font-family: var(--font-mono);
 min-height: 100vh;
 overflow-x: hidden;
 -webkit-font-smoothing: antialiased;
}

/* ─── FOCUS (a11y 2.4.7) ─────────────────────────────────── */
:focus-visible {
 outline: 2px solid var(--accent);
 outline-offset: 3px;
}
a:focus-visible,
button:focus-visible,
.project-card:focus-visible,
.hero-index-item:focus-visible {
 outline: 2px solid var(--accent);
 outline-offset: 3px;
}

/* ─── HERO (asymmetric split) ────────────────────────────── */
.hero {
 position: relative;
 display: flex;
 align-items: center;
 padding: clamp(84px, 11vh, 116px) clamp(24px, 5vw, 80px) clamp(48px, 7vh, 76px);
 overflow: hidden;
 /* tight dark halo hugging each glyph (~5px) -- many stacked full-opacity
    black shadows compound into a near-solid edge that knocks back stars
    right at the letters */
 text-shadow:
   0 0 3px rgba(0, 0, 0, 1),
   0 0 4px rgba(0, 0, 0, 1),
   0 0 4px rgba(0, 0, 0, 1),
   0 0 5px rgba(0, 0, 0, 1),
   0 0 5px rgba(0, 0, 0, 1),
   0 0 6px rgba(0, 0, 0, 1);
}

.cta-primary { text-shadow: none; }

.starfield {
 position: absolute;
 inset: 0;
 width: 100%;
 height: 100%;
 z-index: 0;
 pointer-events: none;
}

.hero-nav {
 position: absolute;
 top: clamp(24px, 4vh, 48px);
 left: clamp(24px, 5vw, 80px);
 right: clamp(24px, 5vw, 80px);
 display: flex;
 align-items: center;
 justify-content: space-between;
 z-index: 10;
}

.nav-logo {
 font-family: var(--font-display);
 font-weight: 700;
 font-size: 13px;
 letter-spacing: 0.08em;
 color: var(--white);
 text-decoration: none;
 text-transform: uppercase;
}

.nav-resume {
 font-family: var(--font-mono);
 font-size: 12px;
 letter-spacing: 0.08em;
 color: var(--mid);
 text-decoration: none;
 text-transform: uppercase;
 border-bottom: 1px solid transparent;
 padding-bottom: 2px;
 transition: color 0.2s, border-color 0.2s;
}

.nav-resume:hover { color: var(--white); border-color: var(--accent); }

.hero-grid {
 position: relative;
 z-index: 5;
 width: 100%;
 display: grid;
 grid-template-columns: minmax(0, 1fr) max-content;
 gap: clamp(40px, 6vw, 96px);
 align-items: start;
}

.hero-content { position: relative; min-width: 0; }

.hero-label {
 font-family: var(--font-mono);
 font-size: 12px;
 letter-spacing: 0.18em;
 color: var(--accent);
 text-transform: uppercase;
 margin-bottom: 24px;
 display: flex;
 align-items: center;
 gap: 12px;
}

.hero-label::before {
 content: '';
 display: block;
 width: 24px;
 height: 1px;
 background: var(--accent);
}

.hero-headline {
 font-family: var(--font-display);
 font-weight: 700;
 font-size: clamp(38px, 6vw, 96px);
 line-height: 0.98;
 letter-spacing: -0.01em;
 color: var(--white);
 margin-bottom: 36px;
 text-transform: lowercase;
}

.hero-headline em {
 font-style: normal;
 color: transparent;
 -webkit-text-stroke: 1px var(--white);
}

.hero-sub {
 font-size: 18px;
 line-height: 1.65;
 color: var(--mid);
 margin-bottom: 44px;
}

.hero-cta-row {
 display: flex;
 align-items: center;
 gap: 28px;
 flex-wrap: wrap;
}

.cta-primary {
 font-family: var(--font-mono);
 font-weight: 500;
 font-size: 13px;
 letter-spacing: 0.1em;
 text-transform: uppercase;
 color: var(--black);
 background: var(--white);
 padding: 15px 28px;
 text-decoration: none;
 transition: background 0.2s, color 0.2s;
}

.cta-primary:hover { background: var(--accent); color: var(--black); }

.cta-secondary {
 font-family: var(--font-mono);
 font-size: 13px;
 letter-spacing: 0.1em;
 text-transform: uppercase;
 color: var(--mid);
 text-decoration: none;
 border-bottom: 1px solid var(--border);
 padding-bottom: 3px;
 transition: color 0.2s, border-color 0.2s;
}

.cta-secondary:hover { color: var(--white); border-color: var(--white); }

/* ─── HERO INDEX (right column) ──────────────────────────── */
.hero-index {
 position: relative;
 border-top: 1px solid var(--border);
 padding-top: 16px;
 min-width: 0;
}

.hero-index-head {
 display: flex;
 align-items: baseline;
 justify-content: space-between;
 font-family: var(--font-mono);
 font-size: 11px;
 letter-spacing: 0.2em;
 text-transform: uppercase;
 color: var(--mid);
 margin-bottom: 8px;
}

.hero-index-list { list-style: none; }

.hero-index-item {
 width: 100%;
 display: grid;
 grid-template-columns: auto auto auto;
 justify-content: start;
 align-items: center;
 gap: 16px;
 background: none;
 border: none;
 border-bottom: 1px solid var(--border);
 padding: 15px 4px;
 cursor: pointer;
 text-align: left;
 color: var(--white);
 font-family: var(--font-mono);
 transition: background 0.2s, padding 0.2s;
}

.hero-index-item:hover,
.hero-index-item:focus-visible { background: var(--panel); padding-left: 12px; }

.idx-num {
 font-size: 11px;
 letter-spacing: 0.1em;
 color: var(--faint);
}

.idx-name {
 font-size: 15px;
 letter-spacing: 0.01em;
 min-width: 0;
 overflow: hidden;
 text-overflow: ellipsis;
 white-space: nowrap;
}

.idx-dot {
 width: 7px; height: 7px;
 border-radius: 50%;
 background: var(--faint);
}

.idx-dot.active { background: #3DFF8F; box-shadow: 0 0 6px #3DFF8F66; }
.idx-dot.wip { background: #FFB84A; }

.scroll-indicator {
 position: absolute;
 bottom: clamp(28px, 4vh, 48px);
 right: clamp(24px, 5vw, 80px);
 display: flex;
 flex-direction: column;
 align-items: center;
 gap: 8px;
 z-index: 5;
}

.scroll-indicator span {
 font-family: var(--font-mono);
 font-size: 10px;
 letter-spacing: 0.2em;
 text-transform: uppercase;
 color: var(--mid);
 writing-mode: vertical-lr;
}

.scroll-line {
 width: 1px;
 height: 48px;
 background: linear-gradient(to bottom, var(--mid), transparent);
 animation: scrollPulse 2s ease-in-out infinite;
}

@keyframes scrollPulse {
 0%, 100% { opacity: 0.3; transform: scaleY(1); }
 50% { opacity: 1; transform: scaleY(0.6); }
}

/* ─── SECTIONS ───────────────────────────────────────────── */
section {
 position: relative;
 z-index: 1;
 background: var(--black);
 padding: clamp(40px, 6vh, 68px) clamp(24px, 5vw, 80px);
}

.section-header {
 display: flex;
 align-items: baseline;
 gap: 20px;
 margin-bottom: 36px;
 border-top: 1px solid var(--border);
 padding-top: 28px;
}

.section-label {
 font-family: var(--font-mono);
 font-size: 11px;
 letter-spacing: 0.2em;
 text-transform: uppercase;
 color: var(--mid);
}

.section-title {
 font-family: var(--font-display);
 font-weight: 700;
 font-size: clamp(26px, 3.6vw, 46px);
 letter-spacing: -0.01em;
 color: var(--white);
 text-transform: lowercase;
}

.projects-grid {
 display: grid;
 grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
 gap: 1px;
 background: var(--border);
 border: 1px solid var(--border);
}

.project-card {
 background: var(--black);
 padding: 40px 36px;
 display: flex;
 flex-direction: column;
 gap: 16px;
 transition: background 0.25s;
 cursor: pointer;
 position: relative;
 overflow: hidden;
}

.project-card::after {
 content: '';
 position: absolute;
 bottom: 0; left: 0;
 width: 0; height: 2px;
 background: var(--accent);
 transition: width 0.3s ease;
}

.project-card:hover { background: var(--panel); }
.project-card:hover::after,
.project-card:focus-visible::after { width: 100%; }

.project-card.flash { animation: cardFlash 1.1s ease-out; }

@keyframes cardFlash {
 0%   { background: rgba(74, 158, 255, 0.16); box-shadow: inset 0 0 0 1px var(--accent); }
 100% { background: var(--black); box-shadow: inset 0 0 0 1px transparent; }
}

.project-tag {
 font-family: var(--font-mono);
 font-size: 11px;
 letter-spacing: 0.16em;
 text-transform: uppercase;
 color: var(--accent);
}

.project-name {
 font-family: var(--font-display);
 font-weight: 700;
 font-size: 21px;
 letter-spacing: -0.01em;
 color: var(--white);
 line-height: 1.2;
}

.project-desc {
 font-size: 16px;
 line-height: 1.62;
 color: var(--mid);
 flex: 1;
}

.accent-note { color: var(--accent); }

.project-status {
 display: inline-flex;
 align-items: center;
 gap: 8px;
 font-family: var(--font-mono);
 font-size: 11px;
 letter-spacing: 0.12em;
 text-transform: uppercase;
 color: var(--mid);
 margin-top: 8px;
}

.project-status-dot {
 width: 6px; height: 6px;
 border-radius: 50%;
 background: var(--faint);
}

.project-status-dot.active { background: #3DFF8F; box-shadow: 0 0 6px #3DFF8F66; }
.project-status-dot.wip { background: #FFB84A; }

.card-cta {
 font-family: var(--font-mono);
 font-size: 11px;
 letter-spacing: 0.12em;
 text-transform: uppercase;
 color: var(--mid);
 transition: color 0.2s;
 margin-top: 4px;
}

.project-card:hover .card-cta,
.project-card:focus-visible .card-cta { color: var(--accent); }

/* ─── MODAL ──────────────────────────────────────────────── */
#project-modal {
 position: fixed;
 inset: 0;
 z-index: 100;
 display: flex;
 align-items: center;
 justify-content: center;
 padding: clamp(16px, 4vw, 40px);
 pointer-events: none;
 opacity: 0;
 transition: opacity 0.3s ease;
}

#project-modal.open {
 pointer-events: all;
 opacity: 1;
}

.modal-backdrop {
 position: absolute;
 inset: 0;
 background: rgba(0, 0, 0, 0.85);
}

.modal-panel {
 position: relative;
 z-index: 1;
 background: var(--panel);
 border: 1px solid var(--border);
 width: 100%;
 max-width: 780px;
 max-height: 85vh;
 overflow-y: auto;
 padding: 48px clamp(24px, 5vw, 64px);
 transform: translateY(12px) scale(0.985);
 transition: transform 0.35s ease;
}

#project-modal.open .modal-panel {
 transform: translateY(0) scale(1);
}

.modal-header {
 display: flex;
 align-items: flex-start;
 justify-content: space-between;
 gap: 24px;
 margin-bottom: 32px;
}

.modal-meta { flex: 1; }

.modal-tag {
 font-family: var(--font-mono);
 font-size: 11px;
 letter-spacing: 0.16em;
 text-transform: uppercase;
 color: var(--accent);
 display: block;
 margin-bottom: 12px;
}

.modal-title {
 font-family: var(--font-display);
 font-weight: 700;
 font-size: clamp(26px, 4.4vw, 44px);
 letter-spacing: -0.01em;
 color: var(--white);
 line-height: 1.02;
 margin-bottom: 14px;
 text-transform: lowercase;
}

.modal-status {
 display: inline-flex;
 align-items: center;
 gap: 8px;
 font-family: var(--font-mono);
 font-size: 11px;
 letter-spacing: 0.12em;
 text-transform: uppercase;
 color: var(--mid);
}

.modal-close {
 font-family: var(--font-mono);
 font-size: 12px;
 letter-spacing: 0.08em;
 text-transform: uppercase;
 color: var(--mid);
 background: none;
 border: 1px solid var(--border);
 padding: 9px 16px;
 cursor: pointer;
 transition: color 0.2s, border-color 0.2s;
 flex-shrink: 0;
}

.modal-close:hover { color: var(--white); border-color: var(--white); }

.modal-detail {
 border-top: 1px solid var(--border);
 padding-top: 28px;
 margin-bottom: 32px;
}

.modal-detail p {
 font-size: 16px;
 line-height: 1.75;
 color: rgba(240, 237, 232, 0.85);
 margin-bottom: 16px;
}

.modal-detail p:last-child { margin-bottom: 0; }

.modal-footer {
 display: flex;
 align-items: center;
 justify-content: space-between;
 flex-wrap: wrap;
 gap: 20px;
 border-top: 1px solid var(--border);
 padding-top: 24px;
}

.modal-stack {
 display: flex;
 flex-wrap: wrap;
 gap: 8px;
}

.stack-tag {
 font-family: var(--font-mono);
 font-size: 11px;
 letter-spacing: 0.1em;
 text-transform: uppercase;
 color: var(--mid);
 border: 1px solid var(--border);
 padding: 5px 10px;
}

.modal-links {
 display: flex;
 gap: 20px;
 flex-wrap: wrap;
}

.modal-link {
 font-family: var(--font-mono);
 font-size: 12px;
 letter-spacing: 0.08em;
 text-transform: uppercase;
 color: var(--accent);
 text-decoration: none;
 border-bottom: 1px solid transparent;
 padding-bottom: 2px;
 transition: border-color 0.2s;
}

.modal-link:hover { border-color: var(--accent); }

/* ─── ABOUT ──────────────────────────────────────────────── */
.about-grid {
 display: grid;
 grid-template-columns: 0.4fr 0.6fr;
 grid-auto-flow: dense;
 gap: 80px;
 align-items: center;
}

.about-text {
 grid-column: 2;
 font-size: 18px;
 line-height: 1.75;
 color: var(--mid);
}

.about-text strong { color: var(--white); font-weight: 500; }

.about-stats { display: flex; flex-direction: column; gap: 32px; grid-column: 1; text-align: center; }

.stat-row {
 border-top: 1px solid var(--border);
 padding-top: 20px;
}

.stat-num {
 font-family: var(--font-display);
 font-weight: 700;
 font-size: 40px;
 letter-spacing: -0.02em;
 color: var(--white);
 line-height: 1;
 margin-bottom: 6px;
}

.stat-label {
 font-family: var(--font-mono);
 font-size: 11px;
 letter-spacing: 0.14em;
 text-transform: uppercase;
 color: var(--mid);
}

/* ─── FOOTER ─────────────────────────────────────────────── */
footer {
 position: relative;
 z-index: 1;
 background: var(--black);
 padding: clamp(32px, 5vh, 64px) clamp(24px, 5vw, 80px);
 border-top: 1px solid var(--border);
 display: flex;
 align-items: center;
 justify-content: space-between;
 flex-wrap: wrap;
 gap: 24px;
}

.footer-logo {
 font-family: var(--font-display);
 font-weight: 700;
 font-size: 12px;
 letter-spacing: 0.1em;
 text-transform: uppercase;
 color: var(--mid);
}

.footer-links { display: flex; gap: 32px; }

.footer-links a {
 font-family: var(--font-mono);
 font-size: 12px;
 letter-spacing: 0.08em;
 text-transform: uppercase;
 color: var(--mid);
 text-decoration: none;
 transition: color 0.2s;
}

.footer-links a:hover { color: var(--white); }

.footer-copy {
 font-family: var(--font-mono);
 font-size: 11px;
 letter-spacing: 0.08em;
 color: var(--mid);
 width: 100%;
}

/* ─── RESPONSIVE ─────────────────────────────────────────── */
@media (max-width: 1024px) {
 .scroll-indicator { display: none; }
}

/* phones only: stack the hero, index drops full-width below it */
@media (max-width: 680px) {
 .hero-grid { grid-template-columns: minmax(0, 1fr); gap: clamp(40px, 8vh, 64px); }
 .hero { align-items: flex-start; }
 .nav-resume { display: none; }
}

@media (max-width: 768px) {
 .about-grid { grid-template-columns: 1fr; gap: 48px; }
 .about-text, .about-stats { grid-column: auto; }
 .about-stats { flex-direction: row; flex-wrap: wrap; }
 .stat-row { flex: 1; min-width: 120px; }
 .projects-grid { grid-template-columns: 1fr; }
 .modal-panel { max-height: 92vh; }
 .modal-footer { flex-direction: column; align-items: flex-start; }
}

/* ─── REDUCED MOTION ─────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
 html { scroll-behavior: auto; }
 .scroll-line { animation: none; }
 .project-card.flash { animation: none; }
 * { transition: none !important; }
}
