/* =========================================================================
   TOKENS
   ========================================================================= */
:root {
  --chassis: #121212;
  --panel: #1e1e1e;
  --panel-raised: #232323;
  --racing-red: #e50000;
  --cyber-blue: #00d2ff;
  --text-hi: #f2f2f2;
  --text-mid: #b9b9b9;
  --text-low: #6f6f6f;
  --hairline: rgba(255, 255, 255, 0.08);
  --grid-line: rgba(0, 210, 255, 0.06);

  --font-display: "Arial Black", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", "Cascadia Mono", "Roboto Mono", "Consolas", monospace;

  --gutter: clamp(20px, 5vw, 72px);
  --radius: 2px;
  --ease-track: cubic-bezier(0.22, 1, 0.36, 1);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
}

body {
  margin: 0;
  background: var(--chassis);
  color: var(--text-hi);
  font-family: var(--font-mono);
  font-size: 15px;
  line-height: 1.6;
  overflow-x: hidden;
}

::selection { background: var(--racing-red); color: #fff; }

a { color: inherit; text-decoration: none; }

/* Web-slinging grid overlay, fixed behind everything */
.grid-overlay {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(circle at 50% 30%, black, transparent 85%);
}

/* Cursor telemetry trail */
#cursor-trail {
  position: fixed;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  width: 100%;
  height: 100%;
}
#cursor-trail path {
  fill: none;
  stroke: var(--cyber-blue);
  stroke-width: 1.4;
  opacity: 0.55;
  filter: drop-shadow(0 0 4px var(--cyber-blue));
}

/* =========================================================================
   PRELOADER — "THE STARTING GRID"
   ========================================================================= */
#preloader {
  position: fixed;
  inset: 0;
  z-index: 999;
  background: var(--chassis);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 28px;
  transition: opacity 0.6s var(--ease-track), visibility 0.6s var(--ease-track);
}
#preloader.is-done { opacity: 0; visibility: hidden; pointer-events: none; }
#preloader.flash::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--cyber-blue);
  animation: flashOut 0.45s ease-out forwards;
}
@keyframes flashOut { 0% { opacity: 0.9; } 100% { opacity: 0; } }

.grid-lights { display: flex; gap: 16px; }
.grid-light {
  width: 22px; height: 22px;
  border-radius: 50%;
  background: #2a0000;
  border: 1px solid rgba(229, 0, 0, 0.4);
  transition: background 0.15s ease, box-shadow 0.15s ease;
}
.grid-light.lit {
  background: var(--racing-red);
  box-shadow: 0 0 18px 4px rgba(229, 0, 0, 0.7);
}
.grid-label {
  font-size: 11px;
  letter-spacing: 0.35em;
  color: var(--text-low);
  text-transform: uppercase;
}

/* =========================================================================
   LAYOUT PRIMITIVES
   ========================================================================= */
main { position: relative; z-index: 1; }

.section {
  min-height: 100vh;
  padding: clamp(90px, 12vh, 140px) var(--gutter) 90px;
  border-bottom: 1px solid var(--hairline);
  scroll-snap-align: start;
  position: relative;
}
#scroll-track { scroll-snap-type: y proximity; }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 11px;
  letter-spacing: 0.3em;
  color: var(--cyber-blue);
  text-transform: uppercase;
  margin-bottom: 18px;
}
.eyebrow::before {
  content: "";
  width: 26px; height: 1px;
  background: var(--cyber-blue);
}

.section-title {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: -0.01em;
  font-size: clamp(32px, 5vw, 58px);
  line-height: 1.02;
  margin: 0 0 40px;
  color: var(--text-hi);
}
.section-title em {
  font-style: italic;
  color: var(--racing-red);
}

.reveal { opacity: 0; transform: translateY(28px); transition: opacity 0.7s var(--ease-track), transform 0.7s var(--ease-track); }
.reveal.in-view { opacity: 1; transform: translateY(0); }

/* =========================================================================
   NAV / TELEMETRY RAIL
   ========================================================================= */
#hud-nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px var(--gutter);
  background: linear-gradient(180deg, rgba(18,18,18,0.92), rgba(18,18,18,0));
  backdrop-filter: blur(4px);
}
.hud-nav__id {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 900;
  font-size: 16px;
  letter-spacing: 0.02em;
}
.hud-nav__id span { color: var(--racing-red); }
.hud-nav__links { display: flex; gap: 26px; }
.hud-nav__links a {
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-mid);
  padding-bottom: 3px;
  border-bottom: 1px solid transparent;
  transition: color 0.25s ease, border-color 0.25s ease;
}
.hud-nav__links a:hover,
.hud-nav__links a.active {
  color: var(--cyber-blue);
  border-color: var(--cyber-blue);
}
.hud-nav__status {
  display: flex; align-items: center; gap: 8px;
  font-size: 10px; letter-spacing: 0.15em; color: var(--text-low);
}
.status-ring {
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--cyber-blue);
  box-shadow: 0 0 8px 2px rgba(0, 210, 255, 0.7);
  animation: pulseRing 2.2s ease-in-out infinite;
}
@keyframes pulseRing { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }

/* progress rail along the left edge */
#progress-rail {
  position: fixed;
  left: 0; top: 0;
  width: 3px; height: 100%;
  background: rgba(255,255,255,0.05);
  z-index: 40;
}
#progress-rail__fill {
  width: 100%; height: 0%;
  background: linear-gradient(180deg, var(--racing-red), var(--cyber-blue));
  transition: height 0.15s linear;
}

/* =========================================================================
   HERO
   ========================================================================= */
#hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 0 var(--gutter);
  position: relative;
}
.hero__mask { overflow: hidden; }
.hero__title {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 900;
  text-transform: uppercase;
  font-size: clamp(48px, 10vw, 128px);
  line-height: 0.92;
  margin: 0;
  transform: translateY(110%);
}
.hero__title .accent { color: var(--racing-red); }
#hero.hero-in .hero__title { transform: translateY(0); transition: transform 1.1s var(--ease-track); }

.hero__role {
  font-size: 13px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--cyber-blue);
  margin: 22px 0 10px;
}
.hero__summary {
  max-width: 620px;
  color: var(--text-mid);
  font-size: 14.5px;
}
.hero__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  margin-top: 36px;
  font-size: 11.5px;
  color: var(--text-low);
  letter-spacing: 0.05em;
}
.hero__meta a { color: var(--text-mid); border-bottom: 1px solid var(--hairline); }
.hero__meta a:hover { color: var(--cyber-blue); border-color: var(--cyber-blue); }

.hero__scroll-cue {
  position: absolute;
  bottom: 40px; left: var(--gutter);
  font-size: 10px;
  letter-spacing: 0.3em;
  color: var(--text-low);
  display: flex; align-items: center; gap: 10px;
}
.hero__scroll-cue::after {
  content: "";
  width: 1px; height: 34px;
  background: linear-gradient(var(--racing-red), transparent);
  animation: dripLine 1.8s ease-in-out infinite;
}
@keyframes dripLine { 0% { transform: scaleY(0); transform-origin: top; } 50% { transform: scaleY(1); transform-origin: top; } 51% { transform-origin: bottom; } 100% { transform: scaleY(0); transform-origin: bottom; } }

/* =========================================================================
   CARDS / PANELS
   ========================================================================= */
.panel {
  background: var(--panel);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  padding: 26px;
  position: relative;
}
.panel::before {
  content: "";
  position: absolute; top: 0; left: 0;
  width: 28px; height: 2px;
  background: var(--racing-red);
}

/* =========================================================================
   SKILLS / TELEMETRY DASHBOARD
   ========================================================================= */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 22px;
}
.skill-card .skill-card__head {
  display: flex; justify-content: space-between; align-items: baseline;
  margin-bottom: 14px;
}
.skill-card__label {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 900;
  font-size: 15px;
  letter-spacing: 0.01em;
}
.skill-card__unit { font-size: 10px; color: var(--cyber-blue); letter-spacing: 0.15em; }
.skill-card__value {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 900;
  font-size: 30px;
  color: var(--racing-red);
}
.skill-bar-track {
  height: 6px;
  background: rgba(255,255,255,0.06);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 16px;
}
.skill-bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--racing-red), var(--cyber-blue));
  transition: width 1.4s var(--ease-track);
}
.skill-card__items {
  display: flex; flex-wrap: wrap; gap: 6px;
}
.skill-chip {
  font-size: 10.5px;
  padding: 5px 9px;
  border: 1px solid var(--hairline);
  border-radius: 999px;
  color: var(--text-mid);
}

.chart-wrap { margin-top: 46px; }
.chart-wrap canvas { max-height: 320px; }
.chart-fallback-bars { display: grid; gap: 12px; margin-top: 46px; }
.cfb-row { display: grid; grid-template-columns: 160px 1fr 48px; align-items: center; gap: 12px; font-size: 11px; }
.cfb-row .skill-bar-track { margin: 0; }

/* =========================================================================
   TIMELINE / TRACK LOG
   ========================================================================= */
.track-log { position: relative; padding-left: 30px; }
.track-log::before {
  content: "";
  position: absolute; left: 6px; top: 6px; bottom: 6px; width: 2px;
  background: linear-gradient(180deg, var(--racing-red), var(--cyber-blue));
}
.track-entry {
  position: relative;
  margin-bottom: 44px;
  padding: 22px 26px;
}
.track-entry::before {
  content: "";
  position: absolute; left: -30px; top: 26px;
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--chassis);
  border: 2px solid var(--cyber-blue);
  box-shadow: 0 0 0 4px var(--chassis);
}
.track-entry__head { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.track-entry__org { font-family: var(--font-display); font-style: italic; font-weight: 900; font-size: 19px; }
.track-entry__period { font-size: 10.5px; color: var(--racing-red); letter-spacing: 0.15em; }
.track-entry__role { font-size: 12px; color: var(--cyber-blue); margin-bottom: 14px; letter-spacing: 0.05em; }
.track-entry ul { margin: 0; padding-left: 18px; color: var(--text-mid); font-size: 13px; }
.track-entry li { margin-bottom: 7px; }
.track-entry__lat { font-size: 9.5px; letter-spacing: 0.2em; color: var(--text-low); text-transform: uppercase; margin-top: 14px; }

/* =========================================================================
   PROJECT
   ========================================================================= */
.project-panel { padding: 34px; }
.project-panel__head { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 14px; margin-bottom: 18px; }
.project-panel__name { font-family: var(--font-display); font-style: italic; font-weight: 900; font-size: 34px; }
.project-panel__tag { font-size: 10.5px; letter-spacing: 0.2em; color: var(--cyber-blue); }
.project-panel__period { font-size: 10.5px; color: var(--racing-red); letter-spacing: 0.1em; }
.project-panel__desc { color: var(--text-mid); max-width: 640px; margin-bottom: 22px; font-size: 13.5px; }

.microservice-graph {
  display: flex; flex-wrap: wrap; gap: 10px;
  margin-bottom: 26px;
}
.node {
  padding: 8px 14px;
  border: 1px solid var(--cyber-blue);
  border-radius: 999px;
  font-size: 11px;
  color: var(--cyber-blue);
  position: relative;
}

.stack-list { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 22px; }
.stack-chip {
  font-size: 10.5px; padding: 6px 10px;
  background: var(--panel-raised);
  border-radius: var(--radius);
  color: var(--text-mid);
}

.project-panel ul.points { padding-left: 18px; color: var(--text-mid); font-size: 13px; margin: 0; }
.project-panel ul.points li { margin-bottom: 8px; }

/* =========================================================================
   CERTS / EDUCATION
   ========================================================================= */
.cert-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 40px;
}
.cert-card { padding: 20px; }
.cert-card__code { font-family: var(--font-display); font-style: italic; font-weight: 900; font-size: 20px; color: var(--racing-red); }
.cert-card__name { font-size: 12.5px; color: var(--text-hi); margin-top: 6px; }
.cert-card__issuer { font-size: 10px; color: var(--text-low); letter-spacing: 0.1em; margin-top: 4px; text-transform: uppercase; }

.edu-line { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; font-size: 13px; color: var(--text-mid); }
.edu-line strong { color: var(--text-hi); }

/* =========================================================================
   CONTACT / FOOTER
   ========================================================================= */
#contact { display: flex; flex-direction: column; justify-content: center; }
.contact-grid { display: flex; flex-wrap: wrap; gap: 40px; align-items: flex-end; justify-content: space-between; }
.contact-cta {
  font-family: var(--font-display);
  font-style: italic; font-weight: 900;
  font-size: clamp(28px, 5vw, 46px);
  max-width: 560px;
  line-height: 1.05;
}
.contact-links { display: flex; flex-direction: column; gap: 10px; }
.contact-links a {
  font-size: 13px;
  color: var(--text-mid);
  border-bottom: 1px solid var(--hairline);
  padding-bottom: 4px;
  transition: color 0.2s ease, border-color 0.2s ease;
}
.contact-links a:hover { color: var(--cyber-blue); border-color: var(--cyber-blue); }
.status-tag {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 10.5px; letter-spacing: 0.15em; color: var(--cyber-blue);
  margin-top: 24px;
}

footer {
  padding: 24px var(--gutter);
  font-size: 10.5px;
  color: var(--text-low);
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px;
  position: relative; z-index: 1;
}

/* =========================================================================
   RESPONSIVE
   ========================================================================= */
@media (max-width: 720px) {
  .hud-nav__links { display: none; }
  .track-log { padding-left: 22px; }
  .project-panel { padding: 22px; }
}

/* Keyboard focus visibility */
a:focus-visible, button:focus-visible {
  outline: 2px solid var(--cyber-blue);
  outline-offset: 3px;
}
