:root {
  --bg: #1F4E79;
  --panel: rgba(255, 255, 255, 0.09);
  --panel-strong: rgba(255, 255, 255, 0.14);
  --text: #ffffff;
  --muted: rgba(255, 255, 255, 0.82);
  --line: rgba(255, 255, 255, 0.22);
  --cyan: #ffffff;
  --lime: #dff6ff;
  --amber: #ffe8a3;
  --rose: #ffd1dc;
  --green: #34d399;
  --shadow: 0 18px 48px rgba(12, 37, 59, 0.26);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.6;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  content: "";
  background-image:
    radial-gradient(circle at 12% 22%, rgba(110,231,249,.09), transparent 20%),
    radial-gradient(circle at 82% 68%, rgba(223,246,255,.08), transparent 22%),
    linear-gradient(rgba(255,255,255,.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.05) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: linear-gradient(to bottom, rgba(0,0,0,.65), transparent 76%);
}

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

.progress {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 50;
  height: 3px;
  width: 0;
  background: #ffffff;
}

#signal-canvas {
  position: fixed;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  opacity: 0.62;
  filter: drop-shadow(0 0 10px rgba(110, 231, 249, .12));
  pointer-events: none;
}

main,
footer {
  position: relative;
  z-index: 1;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid var(--line);
  background: rgba(31, 78, 121, 0.86);
  backdrop-filter: blur(18px);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(1180px, calc(100% - 32px));
  height: 72px;
  margin: 0 auto;
}

.brand,
.mono,
.eyebrow,
.date,
.tags span,
.button,
footer {
  font-family: "JetBrains Mono", Consolas, monospace;
}

.brand {
  color: var(--cyan);
  font-weight: 700;
}

.nav-links {
  display: flex;
  gap: 22px;
  align-items: center;
  color: var(--muted);
  font-size: 0.92rem;
}

.nav-links a {
  transition: color .2s ease;
}

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

.menu-button {
  display: none;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(255,255,255,.04);
}

.menu-button span {
  display: block;
  width: 18px;
  height: 2px;
  margin: 5px auto;
  background: var(--text);
}

.section {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 96px 0;
}

.compact {
  padding: 32px 0 72px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.02fr) minmax(360px, .98fr);
  gap: 44px;
  align-items: center;
  min-height: calc(100vh - 72px);
  padding-top: 72px;
}

.eyebrow {
  margin: 0 0 18px;
  color: var(--cyan);
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 780px;
  margin-bottom: 20px;
  font-size: clamp(3rem, 6.4vw, 6.6rem);
  line-height: 0.95;
  letter-spacing: 0;
}

h2 {
  max-width: 780px;
  font-size: clamp(1.8rem, 3.4vw, 3.6rem);
  line-height: 1.05;
  letter-spacing: 0;
}

h3 {
  margin-bottom: 10px;
  font-size: 1.18rem;
  line-height: 1.25;
}

.lead {
  max-width: 720px;
  color: var(--muted);
  font-size: 1.18rem;
}

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

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(255,255,255,.08);
  color: var(--text);
  font-size: .9rem;
  transition: transform .2s ease, border-color .2s ease, background .2s ease;
}

.button:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, .65);
  background: rgba(255,255,255,.15);
}

.button.primary {
  border-color: #ffffff;
  background: #ffffff;
  color: var(--bg);
  font-weight: 700;
}

.featured-project {
  grid-column: 1 / -1;
  border-color: rgba(255, 255, 255, .58);
  background: linear-gradient(135deg, rgba(255,255,255,.16), rgba(255,255,255,.07));
}

.project-metrics,
.project-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 18px 0;
}

.project-metrics > span {
  min-width: 150px;
  padding: 10px 14px;
  border-left: 2px solid #ffffff;
  background: rgba(255,255,255,.07);
  color: var(--muted);
  font-size: .82rem;
}

.project-metrics strong {
  display: block;
  color: var(--text);
  font-family: "JetBrains Mono", Consolas, monospace;
  font-size: 1.1rem;
}

.project-links a {
  padding-bottom: 3px;
  border-bottom: 1px solid rgba(255,255,255,.55);
  color: var(--text);
  font-family: "JetBrains Mono", Consolas, monospace;
  font-size: .82rem;
}

.project-links a:hover {
  border-bottom-color: #ffffff;
}

.chip-panel {
  display: grid;
  gap: 18px;
}

.chip-frame,
.waveform-card,
.timeline-item,
.project-card,
.panel,
.skill-group,
.education-grid article,
.stats article,
.contact {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}

.chip-frame {
  position: relative;
  min-height: 250px;
  padding: 48px;
  overflow: hidden;
}

.chip-core {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 14px;
  min-height: 160px;
  place-items: center;
  border: 1px solid rgba(163,230,53,.32);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, .16), rgba(255, 255, 255, .06)),
    rgba(255, 255, 255, .08);
  padding: 24px;
  text-align: center;
}

.chip-core strong {
  font-size: clamp(2.2rem, 5vw, 4rem);
  line-height: 1;
}

.chip-core p {
  max-width: 350px;
  margin-bottom: 0;
  color: var(--muted);
}

.pin-row,
.pin-col {
  position: absolute;
  background-repeat: repeat;
}

.pin-row {
  left: 28px;
  right: 28px;
  height: 18px;
  background-image: repeating-linear-gradient(90deg, var(--line) 0 10px, transparent 10px 22px);
}

.pin-row.top { top: 18px; }
.pin-row.bottom { bottom: 18px; }

.pin-col {
  top: 30px;
  bottom: 30px;
  width: 18px;
  background-image: repeating-linear-gradient(0deg, var(--line) 0 10px, transparent 10px 22px);
}

.pin-col.left { left: 16px; }
.pin-col.right { right: 16px; }

.waveform-card {
  overflow: hidden;
}

.waveform-head {
  display: flex;
  justify-content: space-between;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-family: "JetBrains Mono", Consolas, monospace;
  font-size: .78rem;
}

.waveform-card svg {
  display: block;
  width: 100%;
  height: auto;
}

.axis {
  fill: var(--muted);
  font-family: "JetBrains Mono", Consolas, monospace;
  font-size: 12px;
}

.trace {
  fill: none;
  stroke-width: 3;
  stroke-linejoin: round;
  stroke-linecap: round;
  stroke-dasharray: 900;
  animation: draw 2.8s ease forwards;
}

.cyan { stroke: var(--cyan); }
.lime { stroke: var(--lime); }
.amber { stroke: url(#coverage); }
.rose { stroke: var(--rose); }

.scan {
  stroke: var(--cyan);
  stroke-width: 2;
  stroke-dasharray: 6 8;
  animation: blink 1.3s linear infinite;
}

.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}

.stats article {
  padding: 24px;
}

.stats strong {
  display: block;
  margin-bottom: 8px;
  color: var(--cyan);
  font-size: clamp(2rem, 4vw, 3.2rem);
  line-height: 1;
}

.stats span {
  color: var(--muted);
}

.section-heading {
  margin-bottom: 34px;
}

.timeline {
  display: grid;
  gap: 16px;
}

.timeline-item {
  display: grid;
  grid-template-columns: 190px 1fr;
  gap: 28px;
  padding: 28px;
}

.date {
  color: var(--amber);
  font-size: .84rem;
}

.timeline-item h3 span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: .95rem;
  font-weight: 500;
}

ul {
  padding-left: 20px;
}

li {
  margin: 8px 0;
  color: var(--muted);
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.skill-grid,
.split-grid,
.education-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.project-card,
.panel,
.skill-group,
.education-grid article {
  padding: 26px;
}

.project-top {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  justify-content: space-between;
}

.project-top span,
.education-grid span {
  color: var(--cyan);
  font-family: "JetBrains Mono", Consolas, monospace;
  font-size: .78rem;
}

.project-card p,
.panel p,
.skill-group p,
.education-grid p {
  color: var(--muted);
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}

.tags span {
  padding: 6px 9px;
  border: 1px solid rgba(255, 255, 255, .24);
  border-radius: 6px;
  background: rgba(255, 255, 255, .08);
  color: #ffffff;
  font-size: .74rem;
}

.tags.large span {
  border-color: rgba(255, 255, 255, .22);
  background: rgba(255, 255, 255, .08);
  color: #ffffff;
}

.dense-list {
  margin-bottom: 0;
}

.contact {
  padding: 52px;
}

.contact-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.contact-row a,
.contact-row span {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--muted);
}

footer {
  display: flex;
  justify-content: space-between;
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 26px 0 42px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: .82rem;
}

@keyframes draw {
  from { stroke-dashoffset: 900; }
  to { stroke-dashoffset: 0; }
}

@keyframes blink {
  50% { opacity: .25; }
}

@media (max-width: 920px) {
  .hero,
  .timeline-item,
  .project-grid,
  .skill-grid,
  .split-grid,
  .education-grid,
  .stats {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: auto;
  }
}

@media (max-width: 720px) {
  .menu-button {
    display: block;
  }

  .nav-links {
    position: absolute;
    top: 72px;
    left: 16px;
    right: 16px;
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #1F4E79;
  }

  .nav-links.open {
    display: flex;
  }

  .nav-links a {
    padding: 12px;
  }

  .section {
    padding: 72px 0;
  }

  .hero {
    padding-top: 42px;
  }

  .chip-frame,
  .contact {
    padding: 28px;
  }

  .project-top,
  footer {
    flex-direction: column;
  }
}

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