/* ==========================================================================
   TOKENS
   ========================================================================== */
:root {
  --bg: #0B0F14;
  --bg-panel: #10161D;
  --bg-panel-2: #141C25;
  --ink: #E9EEF3;
  --ink-dim: #8FA0B0;
  --ink-faint: #5C6B7A;
  --line: #1E2833;
  --line-bright: #2C3A48;
  --amber: #FFB300;
  --amber-dim: #7A5C1C;
  --teal: #39D9C0;

  --font-display: 'Space Grotesk', sans-serif;
  --font-body: 'IBM Plex Sans', sans-serif;
  --font-mono: 'IBM Plex Mono', monospace;

  --rail-w: 84px;
  --nav-h: 72px;
  --max-w: 1180px;

  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
ul, ol { margin: 0; padding: 0; list-style: none; }
img { max-width: 100%; display: block; }

.mono { font-family: var(--font-mono); }

h1, h2, h3 {
  font-family: var(--font-display);
  margin: 0;
  letter-spacing: -0.01em;
}

:focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: 3px;
}

.section-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 32px;
}

/* ==========================================================================
   BACKGROUND GRID TEXTURE (schematic feel)
   ========================================================================== */
body {
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 48px 48px;
  background-position: -1px -1px;
  background-attachment: fixed;
}

/* ==========================================================================
   TELEMETRY RAIL (signature element — desktop)
   ========================================================================== */
.rail {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: var(--rail-w);
  border-right: 1px solid var(--line);
  background: var(--bg-panel);
  z-index: 60;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: var(--nav-h) 0 24px;
}

.rail-track {
  position: relative;
  width: 2px;
  flex: 1;
  background: var(--line);
  margin-top: 8px;
}

.rail-fill {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  background: linear-gradient(to bottom, var(--teal), var(--amber));
  height: 0%;
  transition: height 0.1s linear;
}

.rail-marker {
  position: absolute;
  left: 50%;
  top: 0%;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--amber);
  box-shadow: 0 0 0 4px rgba(255, 179, 0, 0.15);
  transform: translate(-50%, -50%);
  transition: top 0.1s linear;
}

.rail-ticks {
  display: none; /* labels shown on hover/wide screens via title-less approach below */
}

/* On very wide screens, show vertical text labels next to the rail */
@media (min-width: 1400px) {
  .rail { width: 140px; }
  .rail-ticks {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: absolute;
    left: 34px;
    top: var(--nav-h);
    bottom: 24px;
    height: calc(100% - var(--nav-h) - 24px);
  }
  .rail-ticks li {
    font-family: var(--font-mono);
    font-size: 10px;
    letter-spacing: 0.08em;
    color: var(--ink-faint);
    white-space: nowrap;
  }
  .rail-ticks li.active {
    color: var(--amber);
  }
}

@media (max-width: 900px) {
  .rail { display: none; }
}

/* Mobile top progress bar (replaces rail) */
.mobile-progress {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0%;
  background: linear-gradient(to right, var(--teal), var(--amber));
  z-index: 100;
  transition: width 0.1s linear;
}

@media (max-width: 900px) {
  .mobile-progress { display: block; }
}

/* ==========================================================================
   NAV
   ========================================================================== */
.nav {
  position: fixed;
  top: 0;
  left: var(--rail-w);
  right: 0;
  height: var(--nav-h);
  background: rgba(11, 15, 20, 0.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  z-index: 50;
}

@media (max-width: 900px) {
  .nav { left: 0; }
}

.nav-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  height: 100%;
  padding: 0 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-brand {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.05em;
  color: var(--ink);
}

.blink {
  color: var(--amber);
  animation: blink 1.1s steps(1) infinite;
}

@keyframes blink {
  50% { opacity: 0; }
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 28px;
  font-family: var(--font-mono);
  font-size: 13px;
}

.nav-links a {
  color: var(--ink-dim);
  position: relative;
  padding: 6px 0;
  transition: color 0.2s;
}

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

.nav-links a.nav-cta {
  color: var(--bg);
  background: var(--amber);
  padding: 8px 16px;
  border-radius: 3px;
}

.nav-links a.nav-cta:hover { background: #ffc233; }

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 32px;
  height: 32px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}

.nav-toggle span {
  display: block;
  height: 2px;
  width: 100%;
  background: var(--ink);
}

@media (max-width: 720px) {
  .nav-toggle { display: flex; }
  .nav-links {
    position: fixed;
    top: var(--nav-h);
    left: 0;
    right: 0;
    background: var(--bg-panel);
    border-bottom: 1px solid var(--line);
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    padding: 8px 0;
    transform: translateY(-8px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s var(--ease), transform 0.2s var(--ease), visibility 0.2s;
  }
  .nav-links.open {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
  }
  .nav-links a {
    width: 100%;
    padding: 14px 32px;
    border-bottom: 1px solid var(--line);
  }
  .nav-links a.nav-cta {
    border-radius: 0;
    background: none;
    color: var(--amber);
  }
}

/* ==========================================================================
   LAYOUT SHELL
   ========================================================================== */
main { margin-left: var(--rail-w); padding-top: var(--nav-h); }

@media (min-width: 1400px) { main { margin-left: 140px; } }
@media (max-width: 900px) { main { margin-left: 0; } }

.section {
  padding: 120px 0;
  border-bottom: 1px solid var(--line);
}

.section-alt { background: var(--bg-panel); }

.eyebrow {
  color: var(--teal);
  font-size: 12px;
  letter-spacing: 0.12em;
  margin-bottom: 16px;
}

.section-title {
  font-size: clamp(28px, 4vw, 40px);
  margin-bottom: 32px;
}

.section-lede {
  color: var(--ink-dim);
  max-width: 560px;
  margin: -12px 0 40px;
  font-size: 17px;
}

/* ==========================================================================
   HERO
   ========================================================================== */
.hero {
  position: relative;
  min-height: calc(100vh - var(--nav-h));
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--line);
  overflow: hidden;
}

.hero-grid {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 15% 20%, rgba(57, 217, 192, 0.08), transparent 45%),
              radial-gradient(circle at 85% 80%, rgba(255, 179, 0, 0.06), transparent 45%);
  pointer-events: none;
}

.hero-inner { position: relative; padding-top: 60px; padding-bottom: 60px; }

.hero-title {
  font-size: clamp(48px, 9vw, 92px);
  line-height: 1;
  margin: 18px 0 20px;
}

.hero-sub {
  max-width: 560px;
  font-size: 19px;
  color: var(--ink-dim);
  margin: 0 0 40px;
}

.waveform-wrap {
  max-width: 560px;
  margin-bottom: 40px;
}

.waveform {
  width: 100%;
  height: 70px;
  display: block;
}

.waveform-baseline {
  stroke: var(--line-bright);
  stroke-width: 1;
}
.waveform-path {
  stroke: var(--amber);
  stroke-width: 2;
  fill: none;

  animation:
    waveDrift 1.5s linear infinite,
    pulseGlow 2.2s ease-in-out infinite,
    microWobble 0.4s ease-in-out infinite;
}

@keyframes pulseGlow {
  0%, 100% { opacity: 0.7; }
  50% { opacity: 1; }
}

@keyframes waveDrift {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(-30px);
  }
}

@keyframes microWobble {
  0%, 100% { transform: translateX(0px) translateY(0px); }
  50% { transform: translateX(-2px) translateY(1px); }
}

/*
.waveform-path {
  stroke: var(--amber);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 2000;
  stroke-dashoffset: 2000;
  animation: draw 2.2s var(--ease) 0.3s forwards;
}
*/
@keyframes draw {
  to { stroke-dashoffset: 0; }
}

.waveform-caption {
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--ink-faint);
  margin: 8px 0 0;
}

.hero-actions {
  display: flex;
  gap: 16px;
  margin-bottom: 32px;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 14px;
  padding: 14px 24px;
  border-radius: 3px;
  transition: transform 0.15s var(--ease), background 0.15s, border-color 0.15s;
}

.btn:hover { transform: translateY(-2px); }

.btn-primary {
  background: var(--amber);
  color: var(--bg);
}
.btn-primary:hover { background: #ffc233; }

.btn-ghost {
  border: 1px solid var(--line-bright);
  color: var(--ink);
}
.btn-ghost:hover { border-color: var(--teal); color: var(--teal); }

.hero-links {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--ink-dim);
}

.hero-links a { color: var(--ink-dim); transition: color 0.15s; }
.hero-links a:hover { color: var(--teal); }
.hero-links .dot { color: var(--ink-faint); }

.scroll-cue {
  position: absolute;
  bottom: 28px;
  left: 32px;
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--ink-faint);
  display: flex;
  align-items: center;
  gap: 6px;
}

.scroll-cue span { animation: bob 1.6s ease-in-out infinite; }

@keyframes bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(4px); }
}

@media (max-width: 640px) {
  .scroll-cue { left: 20px; }
}

/* ==========================================================================
   ABOUT
   ========================================================================== */
.about-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 64px;
  margin-bottom: 56px;
}

@media (max-width: 800px) {
  .about-grid { grid-template-columns: 1fr; gap: 40px; }
}

.about-copy p {
  color: var(--ink-dim);
  margin: 0 0 20px;
  font-size: 16px;
}

.about-facts {
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.fact-block {
  border-left: 2px solid var(--line-bright);
  padding-left: 18px;
}

.fact-label {
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--teal);
  margin: 0 0 6px;
}

.fact-main {
  font-family: var(--font-display);
  font-size: 18px;
  margin: 0 0 4px;
}

.fact-sub {
  font-size: 13px;
  color: var(--ink-faint);
  margin: 0;
}

.skills { border-top: 1px solid var(--line); padding-top: 32px; }

.skill-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.skill-tags li {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink);
  border: 1px solid var(--line-bright);
  padding: 8px 14px;
  border-radius: 20px;
}

/* ==========================================================================
   EXPERIENCE / TIMELINE
   ========================================================================== */
.timeline {
  position: relative;
  border-left: 1px solid var(--line-bright);
  padding-left: 40px;
  display: flex;
  flex-direction: column;
  gap: 48px;
}

.timeline-item { position: relative; }

.timeline-marker {
  position: absolute;
  left: -46px;
  top: 4px;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--bg-panel);
  border: 2px solid var(--amber);
}

.timeline-date {
  font-size: 12px;
  color: var(--teal);
  letter-spacing: 0.06em;
  margin: 0 0 6px;
}

.timeline-content h3 {
  font-size: 21px;
  margin-bottom: 4px;
}

.timeline-org {
  color: var(--ink-faint);
  font-size: 14px;
  margin: 0 0 10px;
}

.timeline-content p:last-child {
  color: var(--ink-dim);
  max-width: 640px;
  margin: 0;
}

/* ==========================================================================
   PROJECTS
   ========================================================================== */
.project-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

@media (max-width: 800px) {
  .project-grid { grid-template-columns: 1fr; }
}

.project-card {
  background: var(--bg-panel);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 32px;
  transition: border-color 0.2s, transform 0.2s var(--ease);
}

.project-card:hover {
  border-color: var(--line-bright);
  transform: translateY(-3px);
}

.project-tag {
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--amber);
  margin: 0 0 12px;
}

.project-card h3 {
  font-size: 22px;
  margin-bottom: 12px;
}

.project-card > p {
  color: var(--ink-dim);
  font-size: 15px;
  margin: 0 0 16px;
}

.project-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 11px;
  color: var(--ink-faint);
}

.project-meta li {
  border: 1px solid var(--line);
  padding: 5px 10px;
  border-radius: 3px;
}

.project-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.project-list li {
  font-size: 14px;
  color: var(--ink-dim);
  padding-left: 16px;
  border-left: 2px solid var(--line-bright);
}

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

/* ==========================================================================
   RESUME
   ========================================================================== */
.resume-panel {
  background: var(--bg);
  border: 1px solid var(--line-bright);
  border-radius: 4px;
  padding: 36px 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}

/* ==========================================================================
   CONTACT
   ========================================================================== */
.contact-section { border-bottom: none; }

.contact-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

@media (max-width: 800px) {
  .contact-grid { grid-template-columns: 1fr; }
}

.contact-card {
  background: var(--bg-panel);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 28px;
  transition: border-color 0.2s, transform 0.2s var(--ease);
}

.contact-card:hover {
  border-color: var(--teal);
  transform: translateY(-3px);
}

.contact-value {
  font-family: var(--font-mono);
  font-size: 15px;
  margin: 0;
  word-break: break-word;
}

/* ==========================================================================
   FOOTER
   ========================================================================== */
.site-footer {
  margin-left: var(--rail-w);
  padding: 32px;
  text-align: center;
  color: var(--ink-faint);
  font-size: 12px;
}

@media (min-width: 1400px) { .site-footer { margin-left: 140px; } }
@media (max-width: 900px) { .site-footer { margin-left: 0; } }
