:root {
  color-scheme: dark;
  --bg: #05070b;
  --bg-soft: #081018;
  --panel: rgba(12, 19, 29, 0.78);
  --panel-strong: rgba(13, 22, 34, 0.94);
  --line: rgba(148, 163, 184, 0.22);
  --line-strong: rgba(56, 189, 248, 0.46);
  --text: #f8fafc;
  --muted: #bfccdc;
  --quiet: #8ea0b7;
  --cyan: #38bdf8;
  --teal: #2dd4bf;
  --green: #22c55e;
  --amber: #f59e0b;
  --rose: #fb7185;
  --shadow: 0 24px 90px rgba(0, 0, 0, 0.46);
  --max: 1180px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  color: var(--text);
  background:
    linear-gradient(135deg, rgba(5, 7, 11, 0.96), rgba(3, 8, 13, 0.98)),
    repeating-linear-gradient(90deg, rgba(56, 189, 248, 0.04) 0 1px, transparent 1px 72px),
    repeating-linear-gradient(180deg, rgba(45, 212, 191, 0.035) 0 1px, transparent 1px 72px),
    var(--bg);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.6;
  overflow-x: hidden;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -3;
  pointer-events: none;
  content: "";
  background:
    linear-gradient(180deg, rgba(2, 6, 12, 0.2), rgba(2, 6, 12, 0.92) 88%),
    linear-gradient(90deg, rgba(56, 189, 248, 0.08), transparent 36%, rgba(245, 158, 11, 0.08));
}

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

button {
  font: inherit;
}

img,
svg,
canvas {
  display: block;
  max-width: 100%;
}

#signal-canvas {
  position: fixed;
  inset: 0;
  z-index: -2;
  opacity: 0.7;
  pointer-events: none;
}

.site-header {
  position: fixed;
  top: 16px;
  left: 50%;
  z-index: 10;
  width: min(calc(100% - 32px), var(--max));
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(5, 7, 11, 0.72);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.28);
  transform: translateX(-50%);
  backdrop-filter: blur(18px);
  transition: border-color 180ms ease, background 180ms ease;
}

.site-header.is-scrolled {
  border-color: rgba(56, 189, 248, 0.36);
  background: rgba(5, 7, 11, 0.92);
}

.brand,
.nav-links,
.hero-actions,
.contact-actions,
.project-toolbar,
.project-links {
  display: flex;
  align-items: center;
}

.brand {
  gap: 10px;
  font-size: 1rem;
  font-weight: 800;
}

.brand-mark {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(56, 189, 248, 0.72);
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.18), rgba(45, 212, 191, 0.1));
  box-shadow: inset 0 0 20px rgba(56, 189, 248, 0.16);
  font-size: 0.78rem;
}

.nav-links {
  justify-content: flex-end;
  gap: 28px;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 650;
}

.nav-links a {
  transition: color 160ms ease;
}

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

.hero {
  position: relative;
  min-height: 100vh;
  display: grid;
  align-content: end;
  padding: 150px 24px 52px;
  overflow: hidden;
}

.hero-media {
  position: absolute;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  background: #03060b;
}

.hero-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 66% center;
  opacity: 0.74;
  transform: scale(1.03);
  animation: heroDrift 18s ease-in-out infinite alternate;
}

.hero-media::after {
  position: absolute;
  inset: 0;
  content: "";
  background:
    linear-gradient(90deg, rgba(5, 7, 11, 0.98) 0%, rgba(5, 7, 11, 0.77) 45%, rgba(5, 7, 11, 0.48) 100%),
    linear-gradient(180deg, rgba(5, 7, 11, 0.12), var(--bg) 94%);
}

.scan-layer {
  position: absolute;
  inset: 0;
  opacity: 0.15;
  background: repeating-linear-gradient(180deg, transparent 0 10px, rgba(56, 189, 248, 0.16) 11px, transparent 12px);
  mix-blend-mode: screen;
  animation: scan 8s linear infinite;
}

.hero-content,
.hero-metrics,
.section {
  width: min(100%, var(--max));
  margin-inline: auto;
}

.hero-content {
  max-width: 850px;
  margin-inline: max(0px, calc((100vw - var(--max)) / 2)) auto;
}

.eyebrow {
  margin: 0 0 14px;
  color: var(--cyan);
  font-size: 0.82rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

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

h1 {
  max-width: 850px;
  margin-bottom: 22px;
  font-size: 5.35rem;
  line-height: 0.97;
  letter-spacing: 0;
}

h2 {
  max-width: 920px;
  margin-bottom: 0;
  font-size: 3.35rem;
  line-height: 1.04;
  letter-spacing: 0;
}

h3 {
  margin-bottom: 12px;
  font-size: 1.12rem;
  line-height: 1.25;
}

.hero-copy {
  max-width: 720px;
  color: var(--muted);
  font-size: 1.08rem;
}

.dynamic-line {
  width: min(100%, 720px);
  min-height: 58px;
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 28px 0 30px;
  padding: 14px 16px;
  border: 1px solid rgba(56, 189, 248, 0.34);
  border-radius: 8px;
  background: rgba(5, 12, 20, 0.7);
  box-shadow: inset 0 0 28px rgba(56, 189, 248, 0.1);
  color: var(--text);
}

.line-label {
  flex: 0 0 auto;
  color: var(--quiet);
  font-size: 0.8rem;
  font-weight: 800;
  text-transform: uppercase;
}

#dynamic-text {
  position: relative;
  min-height: 1.4em;
  color: var(--teal);
  font-weight: 800;
}

#dynamic-text::after {
  content: "";
  display: inline-block;
  width: 8px;
  height: 1em;
  margin-left: 4px;
  border-right: 2px solid var(--amber);
  vertical-align: -0.16em;
  animation: caret 900ms steps(1) infinite;
}

.hero-actions,
.contact-actions,
.project-links {
  flex-wrap: wrap;
  gap: 12px;
}

.button {
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-weight: 850;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.button:hover {
  transform: translateY(-2px);
  border-color: rgba(56, 189, 248, 0.62);
}

.button-primary {
  color: #03121a;
  background: linear-gradient(135deg, var(--cyan), var(--teal));
  border-color: transparent;
}

.button-secondary {
  background: rgba(12, 19, 29, 0.72);
  color: var(--text);
}

.hero-metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-top: 48px;
}

.hero-metrics article {
  min-height: 150px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(6, 12, 20, 0.74);
  backdrop-filter: blur(14px);
}

.metric-value,
.metric-suffix {
  color: var(--text);
  font-size: 2.25rem;
  font-weight: 900;
  line-height: 1;
}

.metric-label {
  margin-top: 10px;
  color: var(--quiet);
  font-size: 0.88rem;
  font-weight: 750;
}

.section {
  padding: 112px 24px 0;
}

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

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

.principle-card,
.project-card,
.experience-item,
.education-grid article {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(14, 23, 36, 0.88), rgba(7, 13, 21, 0.88));
  box-shadow: var(--shadow);
}

.principle-card {
  min-height: 254px;
  padding: 22px;
}

.principle-card p,
.project-card p,
.education-grid p,
.contact-copy p {
  color: var(--muted);
}

.card-index {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  margin-bottom: 28px;
  border: 1px solid rgba(45, 212, 191, 0.4);
  border-radius: 8px;
  color: var(--teal);
  font-size: 0.75rem;
  font-weight: 900;
}

.diagram-shell {
  overflow: hidden;
  border: 1px solid rgba(56, 189, 248, 0.28);
  border-radius: 8px;
  background:
    linear-gradient(145deg, rgba(13, 23, 36, 0.92), rgba(5, 9, 15, 0.96)),
    repeating-linear-gradient(90deg, rgba(56, 189, 248, 0.04) 0 1px, transparent 1px 56px);
  box-shadow: var(--shadow);
}

.architecture-diagram {
  width: 100%;
  min-height: 530px;
}

.diagram-grid path {
  fill: none;
  stroke: rgba(148, 163, 184, 0.1);
  stroke-width: 1;
}

.diagram-node rect,
.diagram-badge rect {
  fill: rgba(7, 14, 24, 0.92);
  stroke: rgba(56, 189, 248, 0.35);
  stroke-width: 1.5;
}

.diagram-node.node-core rect {
  fill: rgba(14, 32, 42, 0.95);
  stroke: rgba(45, 212, 191, 0.62);
}

.diagram-node text,
.diagram-badge text {
  fill: var(--text);
  font-size: 18px;
  font-weight: 780;
  text-anchor: middle;
}

.diagram-node text:not(:first-of-type) {
  fill: var(--muted);
  font-size: 15px;
  font-weight: 650;
}

.diagram-badge text {
  fill: var(--amber);
  font-size: 15px;
}

.flow-line {
  fill: none;
  stroke: url(#flowGradient);
  stroke-width: 5;
  stroke-linecap: round;
  stroke-dasharray: 12 14;
  filter: url(#softGlow);
  animation: dashFlow 2.8s linear infinite;
}

.pulse-dot {
  fill: var(--teal);
  filter: url(#softGlow);
  opacity: 0.95;
}

.dot-one {
  animation: pulseA 2.4s ease-in-out infinite;
}

.dot-two {
  animation: pulseA 2.4s ease-in-out infinite 0.4s;
}

.dot-three {
  animation: pulseA 2.4s ease-in-out infinite 0.8s;
}

.dot-four {
  animation: pulseA 2.4s ease-in-out infinite 1.2s;
}

.skill-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.skill-cloud span {
  padding: 9px 12px;
  border: 1px solid rgba(148, 163, 184, 0.25);
  border-radius: 8px;
  background: rgba(8, 16, 25, 0.82);
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 740;
}

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

.experience-item {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 26px;
  padding: 24px;
}

.experience-meta {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.experience-meta span {
  color: var(--teal);
  font-weight: 900;
}

.experience-meta strong {
  font-size: 1.3rem;
}

.experience-meta em {
  color: var(--muted);
  font-style: normal;
}

.experience-item ul {
  margin: 0;
  padding-left: 20px;
  color: var(--muted);
}

.experience-item li + li {
  margin-top: 10px;
}

.project-toolbar {
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 24px;
}

.filter-button {
  min-height: 42px;
  padding: 0 15px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(8, 16, 25, 0.76);
  color: var(--muted);
  cursor: pointer;
  font-weight: 850;
  transition: background 160ms ease, border-color 160ms ease, color 160ms ease;
}

.filter-button:hover,
.filter-button.is-active {
  color: #03121a;
  border-color: transparent;
  background: linear-gradient(135deg, var(--cyan), var(--teal));
}

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

.project-card {
  min-height: 292px;
  display: flex;
  flex-direction: column;
  padding: 22px;
  transition: opacity 200ms ease, transform 200ms ease, border-color 200ms ease;
}

.project-card:hover {
  transform: translateY(-3px);
  border-color: rgba(56, 189, 248, 0.44);
}

.project-card.is-hidden {
  display: none;
}

.project-card.featured {
  border-color: rgba(45, 212, 191, 0.44);
}

.project-topline {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
  color: var(--quiet);
  font-size: 0.76rem;
  font-weight: 900;
  text-transform: uppercase;
}

.project-links {
  margin-top: auto;
  padding-top: 18px;
}

.project-links a,
.education-grid a {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  padding: 0 12px;
  border: 1px solid rgba(56, 189, 248, 0.34);
  border-radius: 8px;
  color: var(--cyan);
  font-weight: 850;
}

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

.education-grid article {
  min-height: 210px;
  padding: 22px;
}

.education-grid span {
  color: var(--teal);
  font-size: 0.8rem;
  font-weight: 900;
  text-transform: uppercase;
}

.contact-section {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 24px;
  margin-top: 112px;
  padding: 38px 24px;
  border: 1px solid rgba(56, 189, 248, 0.28);
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(15, 28, 40, 0.95), rgba(6, 12, 20, 0.95));
  box-shadow: var(--shadow);
}

.contact-copy h2 {
  font-size: 3rem;
}

.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 700ms ease, transform 700ms ease;
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@keyframes heroDrift {
  from {
    transform: scale(1.03) translate3d(0, 0, 0);
  }
  to {
    transform: scale(1.08) translate3d(-1.2%, -1%, 0);
  }
}

@keyframes scan {
  from {
    transform: translateY(-80px);
  }
  to {
    transform: translateY(80px);
  }
}

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

@keyframes dashFlow {
  to {
    stroke-dashoffset: -52;
  }
}

@keyframes pulseA {
  50% {
    transform: scale(1.45);
    opacity: 0.62;
  }
}

@media (max-width: 1000px) {
  h1 {
    font-size: 4.35rem;
  }

  h2 {
    font-size: 2.7rem;
  }

  .hero-metrics,
  .principle-grid,
  .project-grid,
  .education-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .experience-item {
    grid-template-columns: 1fr;
  }

  .architecture-diagram {
    min-width: 960px;
  }

  .diagram-shell {
    overflow-x: auto;
  }

  .contact-section {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .site-header {
    top: 10px;
    width: min(calc(100% - 20px), var(--max));
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }

  .nav-links {
    width: 100%;
    justify-content: space-between;
    gap: 10px;
    overflow-x: auto;
    font-size: 0.82rem;
  }

  .hero {
    min-height: 980px;
    padding: 170px 16px 36px;
  }

  .hero-media img {
    object-position: 58% center;
  }

  .hero-media::after {
    background:
      linear-gradient(180deg, rgba(5, 7, 11, 0.94) 0%, rgba(5, 7, 11, 0.78) 48%, rgba(5, 7, 11, 0.97) 100%);
  }

  .hero-content {
    max-width: 100%;
  }

  h1 {
    font-size: 3.05rem;
    line-height: 1;
  }

  h2 {
    font-size: 2.05rem;
  }

  .dynamic-line {
    min-height: 86px;
    align-items: flex-start;
    flex-direction: column;
  }

  .hero-metrics,
  .principle-grid,
  .project-grid,
  .education-grid {
    grid-template-columns: 1fr;
  }

  .hero-metrics {
    margin-top: 12px;
  }

  .section {
    padding: 86px 16px 0;
  }

  .project-card,
  .principle-card,
  .experience-item,
  .education-grid article {
    padding: 18px;
  }

  .contact-section {
    margin-top: 86px;
    padding: 28px 16px;
  }

}

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