@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500&family=Jersey+10&family=Space+Mono:wght@400;700&family=VT323&display=swap');

:root {
  --bg: #080a08;
  --panel: #0b0f0b;
  --green: #a8ff8f;
  --bright: #d9ffd0;
  --dim: #65a65a;
  --line: rgba(168, 255, 143, .48);
  --soft: rgba(168, 255, 143, .08);
  --sans: "Space Mono", monospace;
  --mono: "IBM Plex Mono", monospace;
  --pixel: "VT323", "IBM Plex Mono", monospace;
  --display-pixel: "Jersey 10", "Space Mono", monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--green);
  font-family: var(--mono);
  font-size: 15px;
  line-height: 1.55;
  overflow-x: clip;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 20;
  background: radial-gradient(circle at 50% 30%, transparent 0 42%, rgba(0,0,0,.38) 100%);
}
.scanlines {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 19;
  opacity: .1;
  background: repeating-linear-gradient(to bottom, transparent 0, transparent 3px, #b4ffa2 4px);
}
a { color: inherit; }
a:focus-visible, button:focus-visible { outline: 2px solid var(--bright); outline-offset: 4px; }
.skip-link { position: fixed; left: 1rem; top: -5rem; z-index: 100; padding: .7rem 1rem; background: var(--green); color: var(--bg); }
.skip-link:focus { top: 1rem; }

.system-bar, .nav, main, footer { width: min(1440px, calc(100% - 40px)); margin-inline: auto; }
.system-bar {
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  color: var(--dim);
  font-size: .75rem;
  letter-spacing: .06em;
}
.system-bar p { margin: 0; }
.nav {
  position: sticky;
  top: 0;
  z-index: 30;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  border: 1px solid var(--line);
  background: rgba(8,10,8,.92);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  box-shadow: 0 8px 18px rgba(0,0,0,.28);
}
.nav a {
  padding: .8rem .9rem;
  text-align: center;
  text-decoration: none;
  font-family: var(--sans);
  font-size: .85rem;
  border-right: 1px solid var(--line);
  transition: background .15s, color .15s;
}
.nav a:last-child { border-right: 0; }
.nav a:hover { color: var(--bg); background: var(--green); }

main { padding-top: 6px; }
main section[id] { scroll-margin-top: 4.5rem; }
.terminal-panel { position: relative; border: 1px solid var(--line); background: rgba(9,13,9,.65); transition: border-color .3s, box-shadow .3s; }
.terminal-panel:hover { border-color: rgba(168,255,143,.78); box-shadow: inset 0 0 28px rgba(168,255,143,.035), 0 0 18px rgba(168,255,143,.06); }
.panel-label {
  position: absolute;
  left: 12px;
  top: -9px;
  padding: 0 7px;
  color: var(--dim);
  background: var(--bg);
  font-size: .65rem;
  letter-spacing: .1em;
  font-family: var(--pixel);
}
.hero { display: grid; grid-template-columns: 1fr 1.04fr; gap: 6px; min-height: 690px; }
.hero-copy { padding: clamp(3rem, 6vw, 7rem) clamp(1.4rem, 4vw, 4rem) 2rem; display: flex; flex-direction: column; justify-content: center; }
.eyebrow { margin: 0 0 1rem; color: var(--dim); font-size: .75rem; letter-spacing: .18em; }
h1, h2, h3 { font-family: var(--sans); font-weight: 700; text-transform: uppercase; }
h1 { margin: 0; color: var(--bright); font-size: clamp(3.4rem, 7.4vw, 7.8rem); line-height: .88; letter-spacing: -.08em; text-shadow: 0 0 20px rgba(168,255,143,.18); }
.glitch-text { position: relative; font-family: var(--display-pixel); font-weight: 400; letter-spacing: .02em; text-shadow: 2px 2px 0 var(--dim), 4px 4px 0 rgba(28,55,25,.8); will-change: transform, filter, text-shadow; animation: text-glitch 6.5s steps(1) infinite; }
.glitch-name { animation-name: terminal-glow, text-glitch; animation-duration: 4s, 6.5s; animation-timing-function: ease-in-out, steps(1); animation-iteration-count: infinite; }
.glitch-projects, .glitch-contact { color: var(--bright); letter-spacing: .035em; text-shadow: 1px 1px 0 var(--dim), 0 0 12px rgba(168,255,143,.18); animation-name: text-glitch-soft; }
.glitch-projects { animation-delay: -2.1s; }
.glitch-contact { animation-delay: -4.3s; }
.cursor { animation: blink .9s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.role { margin: 2rem 0 0; font-family: var(--sans); font-size: clamp(.78rem, 1.2vw, 1rem); }
.role span { color: var(--dim); }
.intro { max-width: 57ch; margin: 1.4rem 0 2rem; color: #a8c9a0; }
.hero-actions { display: flex; flex-wrap: wrap; gap: .6rem; }
.button { display: inline-block; padding: .72rem 1rem; border: 1px solid var(--line); text-decoration: none; font-family: var(--sans); font-size: .74rem; }
.button:hover, .button.primary { background: var(--green); color: var(--bg); }
.button.primary:hover { background: var(--bright); }
.quick-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; margin: auto 0 0; background: var(--line); border: 1px solid var(--line); }
.quick-stats div { background: var(--bg); padding: .8rem; }
.quick-stats dt { color: var(--dim); font-size: .6rem; }
.quick-stats dd { margin: .3rem 0 0; font-size: .7rem; }
.pulse { display: inline-block; width: 7px; height: 7px; margin-right: 5px; border-radius: 50%; background: var(--green); box-shadow: 0 0 10px var(--green); animation: pulse 1.5s infinite; }
@keyframes pulse { 50% { opacity: .25; } }

.portrait-panel { margin: 0; min-width: 0; display: grid; grid-template-rows: 1fr auto; overflow: hidden; isolation: isolate; }
.portrait-stage { position: relative; min-height: 650px; overflow: hidden; background: #000; }
.portrait-stage::before { content: ""; position: absolute; z-index: 2; inset: 0; pointer-events: none; background: linear-gradient(to bottom, transparent 0, rgba(168,255,143,.2) 48%, rgba(217,255,208,.7) 50%, rgba(168,255,143,.12) 52%, transparent 100%); background-size: 100% 18%; animation: portrait-scan 4.8s linear infinite; mix-blend-mode: screen; opacity: .55; }
.portrait-stage::after { content: "CAM_01  REC"; position: absolute; z-index: 3; top: 1rem; right: 1rem; color: var(--green); font-size: .6rem; letter-spacing: .12em; text-shadow: 0 0 8px var(--green); animation: rec-blink 1.8s steps(1) infinite; }
#ascii-portrait { width: 100%; height: 100%; min-height: 650px; display: block; object-fit: cover; object-position: center; image-rendering: pixelated; background: #000; filter: saturate(1.1) contrast(1.08) drop-shadow(0 0 5px rgba(126,255,0,.28)); animation: portrait-signal 7s steps(1) infinite; }
.puppet-face { position: absolute; z-index: 4; inset: 0; pointer-events: none; }
.portrait-cutout { position: absolute; overflow: hidden; isolation: isolate; }
.portrait-cutout img { position: absolute; display: block; max-width: none; object-fit: cover; object-position: center; image-rendering: pixelated; opacity: 0; filter: saturate(1.02) contrast(1.01); will-change: opacity; }
.puppet-mouth { left: 40%; top: 45.5%; width: 20%; height: 11%; border-radius: 0; -webkit-mask-image: none; mask-image: none; }
.puppet-mouth img { left: -200%; top: -413.64%; width: 500%; height: 909.1%; animation: frame-talk 4.2s ease-in-out infinite; }
.portrait-panel figcaption { padding: .6rem .9rem; border-top: 1px solid var(--line); color: var(--dim); font-size: .65rem; }

.marquee { width: 100%; overflow: hidden; padding: .55rem 0; border-bottom: 1px solid var(--line); background: var(--green); color: var(--bg); font-family: var(--sans); font-size: .75rem; white-space: nowrap; }
.marquee div { width: max-content; animation: marquee 22s linear infinite; }
@keyframes marquee { to { transform: translateX(-50%); } }

.section { padding: clamp(5rem, 10vw, 9rem) 0; }
.section-heading { display: grid; grid-template-columns: 1fr auto; align-items: end; gap: .4rem; margin-bottom: 2rem; border-bottom: 1px solid var(--line); }
.section-heading p, .section-heading span { margin: 0 0 .7rem; color: var(--dim); font-size: .7rem; }
.section-heading h2 { grid-row: 2; margin: 0 0 1rem; color: var(--bright); font-size: clamp(2.3rem, 6vw, 5rem); line-height: .95; letter-spacing: -.06em; }
.section-heading h2.glitch-projects { font-size: clamp(2.7rem, 6.4vw, 5.4rem); line-height: 1; letter-spacing: .035em; }
.section-heading span { grid-column: 2; grid-row: 2; }
.project-list { border-top: 1px solid var(--line); }
.project { display: grid; grid-template-columns: 70px 1fr 120px; gap: 1.2rem; padding: 1.7rem 1rem; color: inherit; text-decoration: none; border-bottom: 1px solid var(--line); transition: background .22s, transform .22s, box-shadow .22s; }
.project-clickable { cursor: pointer; }
.project-clickable:focus-visible { position: relative; z-index: 2; outline-offset: -3px; }
.project:hover { background: var(--soft); transform: translateX(6px); box-shadow: -3px 0 0 var(--green); }
.project:hover h3 { text-shadow: 0 0 14px rgba(168,255,143,.35); }
.project.featured { background: rgba(168,255,143,.045); }
.project-index { color: var(--dim); font-family: var(--pixel); font-size: 1.05rem; }
.project-main h3 { margin: .15rem 0 .5rem; color: var(--bright); font-size: clamp(1.4rem, 3vw, 2.6rem); letter-spacing: -.05em; }
.project-main > p:not(.project-meta) { max-width: 74ch; margin: 0; color: #a8c9a0; }
.project-meta { margin: 0; color: var(--dim); font-size: .66rem; letter-spacing: .08em; }
.tags { display: flex; flex-wrap: wrap; gap: .5rem; margin: 1rem 0 0; padding: 0; list-style: none; }
.tags li { padding: .2rem .5rem; border: 1px solid rgba(168,255,143,.25); font-size: .65rem; }
.project:hover .tags li { border-color: rgba(168,255,143,.55); }
.project-status { text-align: right; font-family: var(--pixel); font-size: .64rem; }
.project-status span { color: var(--dim); }
.case-study { scroll-margin-top: 1.5rem; margin-top: 3rem; padding: 0; }
.case-study summary { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1.1rem 1.3rem; cursor: pointer; color: var(--green); font-family: var(--sans); font-size: .72rem; letter-spacing: .08em; list-style: none; transition: background .2s, color .2s; }
.case-study summary::-webkit-details-marker { display: none; }
.case-study summary:hover, .case-study summary:focus-visible { background: var(--soft); color: var(--bright); }
.case-study summary strong::after { content: " +"; color: var(--dim); }
.case-study[open] summary { border-bottom: 1px solid var(--line); }
.case-study[open] summary strong::after { content: " −"; }
.case-study-content { padding: clamp(3rem, 6vw, 5rem); animation: dropdown-open .28s ease-out both; }
.case-study h3 { margin: 0; color: var(--bright); font-size: clamp(2rem, 5vw, 4.6rem); letter-spacing: -.06em; }
.case-study-lead { max-width: 72ch; margin: 1rem 0 2.5rem; color: #a8c9a0; }
.case-study-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; border: 1px solid var(--line); background: var(--line); }
.case-study-grid > div { padding: 1.3rem; background: var(--bg); }
.case-study-grid span { color: var(--dim); font-size: .65rem; letter-spacing: .08em; }
.case-study-grid p { margin: .8rem 0 0; color: #a8c9a0; }
@keyframes dropdown-open { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }

.profile-grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: 6px; }
.profile-copy { padding: clamp(3rem, 6vw, 6rem); }
.profile-copy h2 { margin: 0 0 2rem; color: var(--bright); font-size: clamp(2rem, 4.5vw, 4.2rem); line-height: .98; letter-spacing: -.06em; }
.profile-copy > p:not(.eyebrow) { max-width: 65ch; color: #a8c9a0; }
.timeline { padding: 3rem 1.5rem; }
.timeline ol { margin: 0; padding: 0; list-style: none; }
.timeline li { display: grid; grid-template-columns: 74px 1fr; gap: 1rem; padding: 1.3rem 0; border-bottom: 1px dashed rgba(168,255,143,.25); }
.timeline time { color: var(--dim); }
.timeline strong, .timeline span { display: block; }
.timeline strong { color: var(--bright); }
.timeline span { margin-top: .25rem; color: var(--dim); font-size: .75rem; }

.contact { text-align: center; border-top: 1px solid var(--line); }
.contact h2 { margin: 0; color: var(--bright); font-size: clamp(3rem, 9vw, 8.5rem); line-height: .84; letter-spacing: -.08em; }
.contact h2.glitch-contact { line-height: .92; letter-spacing: .025em; }
.contact > p:not(.eyebrow) { margin: 2rem auto; color: #a8c9a0; }
.contact-links { display: flex; justify-content: center; flex-wrap: wrap; gap: 1rem 2.5rem; }
.contact-links a { font-family: var(--sans); text-underline-offset: 5px; }

footer { display: flex; justify-content: space-between; gap: 1rem; padding: 1.5rem 0; border-top: 1px solid var(--line); color: var(--dim); font-size: .67rem; }
footer p { margin: 0; }

.reveal { opacity: 0; transform: translateY(28px); transition: opacity .7s ease, transform .7s cubic-bezier(.2,.75,.25,1); }
.reveal.is-visible { opacity: 1; transform: none; }
.project.reveal { transition-delay: calc(var(--reveal-index, 0) * 70ms); }

@keyframes terminal-glow { 0%, 100% { text-shadow: 2px 2px 0 var(--dim), 4px 4px 0 rgba(28,55,25,.8), 0 0 18px rgba(168,255,143,.14); } 50% { text-shadow: 2px 2px 0 var(--dim), 4px 4px 0 rgba(28,55,25,.8), 0 0 30px rgba(168,255,143,.3); } }
@keyframes text-glitch { 0%, 91%, 94%, 97%, 100% { transform: translate(0) skewX(0); filter: none; clip-path: none; } 92% { transform: translate(2px, -1px) skewX(-2deg); text-shadow: -3px 0 var(--dim), 3px 0 var(--bright), 0 0 16px rgba(168,255,143,.5); filter: contrast(1.35); } 93% { transform: translate(-2px, 1px) skewX(2deg); text-shadow: 3px 0 var(--dim), -2px 0 var(--bright); } 95% { transform: translate(1px) skewX(-1deg); text-shadow: -2px 0 var(--bright), 2px 0 var(--dim); clip-path: inset(18% 0 42% 0); } 96% { transform: translate(-1px); text-shadow: 2px 0 var(--bright), -2px 0 var(--dim); clip-path: inset(58% 0 8% 0); } }
@keyframes text-glitch-soft { 0%, 93%, 96%, 100% { transform: translate(0); filter: none; } 94% { transform: translateX(1px); text-shadow: -1px 0 var(--dim), 1px 0 var(--bright), 0 0 12px rgba(168,255,143,.25); } 95% { transform: translateX(-1px); text-shadow: 1px 0 var(--dim), -1px 0 var(--bright); } }
@keyframes portrait-scan { from { transform: translateY(-120%); } to { transform: translateY(650%); } }
@keyframes rec-blink { 50% { opacity: .35; } }
@keyframes portrait-signal { 0%, 94%, 100% { transform: translate(0); filter: saturate(1.1) contrast(1.08) drop-shadow(0 0 5px rgba(126,255,0,.28)); } 95% { transform: translateX(2px); filter: saturate(1.35) contrast(1.18) drop-shadow(0 0 9px rgba(126,255,0,.5)); } 96% { transform: translateX(-1px); } }
@keyframes frame-talk { 0%, 25%, 54%, 70%, 92%, 100% { opacity: 1; } 31%, 47%, 76%, 86% { opacity: 0; } 28%, 50%, 73%, 89% { opacity: .5; } }

@media (max-width: 800px) {
  @supports not (overflow: clip) {
    body { overflow-x: visible; }
  }
  .system-bar, .nav, main, footer { width: min(100% - 20px, 1440px); }
  .system-bar { flex-wrap: wrap; justify-content: flex-start; padding-block: .55rem; }
  .system-bar p:last-child { margin-left: auto; }
  .hide-small { display: none; }
  .nav { grid-template-columns: repeat(4, 1fr); }
  .nav a { min-width: 0; padding: .72rem .2rem; font-size: .68rem; }
  .nav a:last-child { display: none; }
  .hero { grid-template-columns: 1fr; min-height: 0; }
  .hero-copy { min-height: 0; padding-block: 5rem 2rem; }
  .quick-stats { margin-top: 2.5rem; }
  .portrait-panel, .portrait-stage { min-height: 0; }
  #ascii-portrait { height: auto; min-height: 0; aspect-ratio: 1006 / 1564; object-fit: contain; }
  .portrait-stage::before { opacity: .35; animation-duration: 6s; }
  .project:hover { transform: none; box-shadow: none; }
  .terminal-panel:hover { box-shadow: none; }
  .profile-grid { grid-template-columns: 1fr; }
  .case-study-grid { grid-template-columns: 1fr; }
  .project { grid-template-columns: 40px 1fr; gap: .7rem; padding-inline: .2rem; }
  .project-status { display: none; }
  .reveal { transform: translateY(16px); transition-duration: .5s; }
  .project.reveal { transition-delay: 0ms; }
}

@media (max-width: 500px) {
  body { font-size: 14px; }
  .system-bar { font-size: .6rem; }
  .hero-copy { min-height: 0; padding: 4.5rem 1.1rem 1.5rem; }
  h1 { font-size: clamp(3rem, 18vw, 4.8rem); }
  .role { margin-top: 1.5rem; }
  .hero-actions { display: grid; grid-template-columns: 1fr; }
  .button { width: 100%; text-align: center; }
  .quick-stats { grid-template-columns: 1fr; }
  .quick-stats div { display: flex; justify-content: space-between; gap: 1rem; }
  .quick-stats dd { margin: 0; }
  .portrait-stage::after { top: .8rem; right: .7rem; }
  .section-heading { grid-template-columns: 1fr; }
  .section-heading span { display: none; }
  .project { grid-template-columns: 28px 1fr; }
  .project-main h3 { overflow-wrap: anywhere; }
  .case-study { margin-top: 2.5rem; }
  .case-study summary { padding: 1rem .8rem; font-size: .62rem; }
  .case-study-content { padding: 3rem 1.2rem 1.2rem; }
  .profile-copy { padding: 3.5rem 1.2rem; }
  .timeline { padding: 3rem 1rem; }
  .timeline li { grid-template-columns: 58px 1fr; gap: .65rem; }
  .contact h2 { font-size: clamp(2.8rem, 17vw, 5.2rem); }
  .contact-links { gap: 1rem 1.5rem; }
  footer { flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
  .reveal { opacity: 1; transform: none; }
}
