/* ==========================================================================
   Tokens
   ========================================================================== */
:root {
  --bg: #0A0F1C;
  --bg-alt: #0F1830;
  --panel: #101A33;
  --panel-border: rgba(148, 178, 224, 0.14);
  --grid-line: rgba(148, 178, 224, 0.07);

  --text: #EAF0FB;
  --muted: #8FA0C0;
  --muted-dim: #5E6E8C;

  --accent: #FF8A3D;
  --accent-dim: #C9691F;
  --accent-soft: rgba(255, 138, 61, 0.14);
  --accent-2: #57D9C8;

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

  --container: 880px;
  --edge: 24px;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* ==========================================================================
   Reset
   ========================================================================== */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
h1, h2, h3 { font-family: var(--font-display); margin: 0; }
p { margin: 0; }

/* blueprint grid background across the whole page */
body {
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 34px 34px;
  background-position: center top;
}

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

/* ==========================================================================
   Circuit trace (scroll progress + section nav)
   ========================================================================== */
.trace {
  position: fixed;
  left: 10px;
  top: 0;
  bottom: 0;
  width: 20px;
  z-index: 50;
  display: none;
}
.trace__line {
  position: absolute;
  left: 9px;
  top: 6vh;
  bottom: 6vh;
  width: 2px;
  background: var(--panel-border);
}
.trace__fill {
  position: absolute;
  left: 9px;
  top: 6vh;
  width: 2px;
  height: 0%;
  background: linear-gradient(180deg, var(--accent), var(--accent-2));
  box-shadow: 0 0 8px var(--accent-soft);
  transition: height 0.1s linear;
}
.trace__node {
  position: absolute;
  left: 3px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--muted-dim);
  transition: border-color 0.4s var(--ease), box-shadow 0.4s var(--ease), transform 0.3s var(--ease);
}
.trace__node:hover { transform: scale(1.25); }
.trace__node.is-active {
  border-color: var(--accent);
  box-shadow: 0 0 10px var(--accent-soft), 0 0 0 3px var(--accent-soft);
}
.trace__node[data-node="0"] { top: 6vh; }
.trace__node[data-node="1"] { top: calc(6vh + (94vh - 6vh) * 0.22); }
.trace__node[data-node="2"] { top: calc(6vh + (94vh - 6vh) * 0.46); }
.trace__node[data-node="3"] { top: calc(6vh + (94vh - 6vh) * 0.70); }
.trace__node[data-node="4"] { top: calc(94vh - 8px); }

@media (min-width: 720px) {
  .trace { display: block; }
}

/* ==========================================================================
   Hero
   ========================================================================== */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 90px var(--edge) 60px;
  overflow: hidden;
}

.hero__bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.hero__circuit {
  position: absolute;
  top: -5%;
  right: -10%;
  width: 90%;
  height: 110%;
  opacity: 0.55;
}
.ct-path {
  fill: none;
  stroke: var(--panel-border);
  stroke-width: 1.4;
}
.ct-path--b { stroke: rgba(87, 217, 200, 0.14); }
.ct-path--c { stroke: rgba(255, 138, 61, 0.12); }
.ct-node { fill: var(--accent); opacity: 0.7; animation: pulse 3.2s ease-in-out infinite; }
.ct-node--b { fill: var(--accent-2); animation-delay: 1.2s; }
@keyframes pulse {
  0%, 100% { opacity: 0.25; r: 3; }
  50% { opacity: 0.9; r: 5; }
}

.hero__inner {
  position: relative;
  z-index: 2;
  max-width: 640px;
  text-align: center;
}

.avatar {
  width: 148px;
  height: 148px;
  margin: 0 auto 28px;
  border-radius: 50%;
  padding: 4px;
  background: conic-gradient(from 180deg, var(--accent), var(--accent-2), var(--accent));
  box-shadow: 0 0 0 1px var(--panel-border), 0 12px 40px rgba(255, 138, 61, 0.18);
}
.avatar img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  background: var(--panel);
  display: block;
  border: 3px solid var(--bg);
}
.avatar__img--placeholder { object-fit: contain; padding: 2px; }

.eyebrow {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 14px;
}

.hero__name {
  font-size: clamp(2.3rem, 8vw, 3.4rem);
  font-weight: 700;
  letter-spacing: -0.01em;
  margin-bottom: 10px;
}

.hero__role {
  font-family: var(--font-mono);
  color: var(--muted);
  font-size: clamp(0.85rem, 2.6vw, 1rem);
  margin-bottom: 22px;
  line-height: 1.7;
}
.hero__role .dot { color: var(--accent); margin: 0 2px; }

.hero__tagline {
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.7;
  max-width: 560px;
  margin: 0 auto 34px;
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 18px;
  border-radius: 999px;
  border: 1px solid var(--panel-border);
  background: var(--panel);
  color: var(--text);
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 0.88rem;
  transition: border-color 0.25s var(--ease), transform 0.25s var(--ease), background 0.25s var(--ease), box-shadow 0.25s var(--ease);
}
.btn__icon { width: 16px; height: 16px; flex-shrink: 0; }
.btn:hover, .btn:focus-visible {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(255, 138, 61, 0.15);
}
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.btn--primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #1A0E04;
  font-weight: 600;
}
.btn--primary:hover { background: #FF9E5C; box-shadow: 0 8px 24px rgba(255, 138, 61, 0.32); }

.scroll-cue {
  position: absolute;
  bottom: 26px;
  left: 50%;
  transform: translateX(-50%);
  width: 22px;
  height: 34px;
  border: 2px solid var(--panel-border);
  border-radius: 12px;
}
.scroll-cue span {
  position: absolute;
  top: 6px;
  left: 50%;
  width: 4px;
  height: 8px;
  margin-left: -2px;
  border-radius: 2px;
  background: var(--accent);
  animation: scrollcue 1.8s var(--ease) infinite;
}
@keyframes scrollcue {
  0% { opacity: 1; transform: translateY(0); }
  70% { opacity: 0; transform: translateY(10px); }
  100% { opacity: 0; transform: translateY(10px); }
}

/* ==========================================================================
   Stats strip
   ========================================================================== */
.stats {
  border-top: 1px solid var(--panel-border);
  border-bottom: 1px solid var(--panel-border);
  background: var(--bg-alt);
  overflow-x: auto;
  scrollbar-width: none;
}
.stats::-webkit-scrollbar { display: none; }
.stats__track {
  display: flex;
  min-width: max-content;
  margin: 0 auto;
  max-width: var(--container);
}
.stat {
  flex: 1;
  min-width: 150px;
  padding: 22px var(--edge);
  border-right: 1px solid var(--panel-border);
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.stat:last-child { border-right: none; }
.stat__n {
  font-family: var(--font-display);
  font-size: 1.7rem;
  font-weight: 700;
  color: var(--accent);
}
.stat__l {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ==========================================================================
   Sections (shared)
   ========================================================================== */
.section { padding: 76px var(--edge); }
.section__inner { max-width: var(--container); margin: 0 auto; }

.section__eyebrow {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 14px;
}
.section__title {
  font-size: clamp(1.5rem, 4.5vw, 2.1rem);
  font-weight: 600;
  margin-bottom: 34px;
  max-width: 26ch;
  line-height: 1.25;
}

.lead {
  font-size: clamp(1.05rem, 2.6vw, 1.25rem);
  line-height: 1.8;
  color: var(--text);
  max-width: 66ch;
}
.lead::first-letter {
  font-family: var(--font-display);
  font-size: 1.6em;
  color: var(--accent);
}

/* ==========================================================================
   Cards
   ========================================================================== */
.cards {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}
@media (min-width: 620px) {
  .cards { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 960px) {
  .cards { grid-template-columns: repeat(3, 1fr); }
}

.card {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 14px;
  padding: 22px 20px;
  overflow: hidden;
  transition: transform 0.3s var(--ease), border-color 0.3s var(--ease), box-shadow 0.3s var(--ease);
}
.card::before {
  content: "";
  position: absolute;
  top: -1px; left: -1px;
  width: 40px; height: 40px;
  border-top: 2px solid var(--accent);
  border-left: 2px solid var(--accent);
  border-radius: 14px 0 0 0;
  opacity: 0.7;
}
.card:hover {
  transform: translateY(-4px);
  border-color: rgba(255, 138, 61, 0.4);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.35);
}

.card__tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.07em;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid rgba(255, 138, 61, 0.3);
  padding: 4px 9px;
  border-radius: 999px;
  margin-bottom: 14px;
}
.card__title {
  font-size: 1.06rem;
  font-weight: 600;
  margin-bottom: 8px;
  line-height: 1.35;
}
.card__text {
  font-size: 0.92rem;
  line-height: 1.65;
  color: var(--muted);
}

.cards--projects { grid-template-columns: 1fr; }
@media (min-width: 720px) {
  .cards--projects { grid-template-columns: repeat(3, 1fr); }
}
.card--project { display: flex; flex-direction: column; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 16px; }
.tag {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--accent-2);
  border: 1px solid rgba(87, 217, 200, 0.3);
  background: rgba(87, 217, 200, 0.08);
  padding: 4px 9px;
  border-radius: 6px;
}

/* ==========================================================================
   Contact
   ========================================================================== */
.section--contact { background: var(--bg-alt); border-top: 1px solid var(--panel-border); }
.contact-list { display: flex; flex-direction: column; gap: 1px; border: 1px solid var(--panel-border); border-radius: 14px; overflow: hidden; }
.contact-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 18px 20px;
  background: var(--panel);
  transition: background 0.25s var(--ease), padding-left 0.25s var(--ease);
}
.contact-row:hover { background: #14203F; padding-left: 26px; }
.contact-row__label {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.contact-row__value { font-weight: 500; color: var(--text); font-size: 0.98rem; word-break: break-word; text-align: right; }

/* ==========================================================================
   Footer
   ========================================================================== */
.footer {
  text-align: center;
  padding: 50px var(--edge) 60px;
  color: var(--muted);
}
.footer p:first-child {
  font-style: italic;
  max-width: 46ch;
  margin: 0 auto 14px;
  line-height: 1.6;
  color: var(--muted);
}
.footer__copy {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--muted-dim);
}

/* ==========================================================================
   Reveal on scroll
   ========================================================================== */
[data-reveal] {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}
[data-reveal].is-visible {
  opacity: 1;
  transform: translateY(0);
}
.cards [data-reveal]:nth-child(1) { transition-delay: 0s; }
.cards [data-reveal]:nth-child(2) { transition-delay: 0.08s; }
.cards [data-reveal]:nth-child(3) { transition-delay: 0.16s; }
.cards [data-reveal]:nth-child(4) { transition-delay: 0.24s; }
.cards [data-reveal]:nth-child(5) { transition-delay: 0.32s; }
