:root {
  --bg: #040a07;
  --bg-soft: #0a1a12;
  --text: #dfffe9;
  --muted: #90c6a1;
  --accent: #5cff96;
  --accent-soft: #79ffb0;
  --card: rgba(8, 24, 15, 0.76);
  --border: rgba(110, 232, 154, 0.26);
  --shadow: 0 22px 42px rgba(0, 0, 0, 0.36);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  background:
    radial-gradient(120% 120% at 10% 0%, #133723 0%, var(--bg) 44%, #020703 100%),
    linear-gradient(180deg, rgba(0, 255, 128, 0.03) 0%, rgba(0, 0, 0, 0) 100%);
  color: var(--text);
  font-family: "Space Grotesk", sans-serif;
  line-height: 1.55;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -4;
  pointer-events: none;
  background:
    repeating-linear-gradient(
      0deg,
      rgba(8, 35, 20, 0.14) 0px,
      rgba(8, 35, 20, 0.14) 1px,
      transparent 1px,
      transparent 3px
    );
  opacity: 0.28;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -3;
  pointer-events: none;
  background:
    linear-gradient(rgba(118, 255, 166, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(118, 255, 166, 0.05) 1px, transparent 1px);
  background-size: 34px 34px;
  opacity: 0.2;
}

.bg-code {
  position: fixed;
  inset: -3% -3% -3% -3%;
  z-index: -6;
  pointer-events: none;
  overflow: hidden;
  opacity: 0.2;
  mix-blend-mode: screen;
}

.bg-code pre {
  position: absolute;
  top: 0;
  margin: 0;
  height: auto;
  padding: 3.5rem 4rem;
  font-family: "IBM Plex Mono", monospace;
  font-size: clamp(0.62rem, 0.95vw, 0.8rem);
  line-height: 1.38;
  color: rgba(176, 255, 210, 0.4);
  white-space: pre;
  transform: scale(1.04);
  filter: blur(0.2px);
}

.bg-code-left {
  left: 0;
  width: min(64%, 92ch);
  transform: rotate(-3deg) scale(1.04);
}

.bg-code-right {
  right: -1rem;
  width: min(50%, 78ch);
  transform: rotate(2.5deg) scale(1.02);
  opacity: 0.94;
}

.bg-code-cloud {
  right: -2rem;
  width: min(54%, 84ch);
  transform: rotate(2.2deg) scale(1.02);
  opacity: 0.9;
}

.py-key {
  color: rgba(112, 220, 255, 0.62);
  text-shadow: 0 0 8px rgba(112, 220, 255, 0.35);
}

.py-fn {
  color: rgba(126, 255, 180, 0.64);
  text-shadow: 0 0 8px rgba(126, 255, 180, 0.3);
}

.py-str {
  color: rgba(255, 214, 122, 0.58);
  text-shadow: 0 0 8px rgba(255, 214, 122, 0.25);
}

.py-num {
  color: rgba(204, 173, 255, 0.58);
  text-shadow: 0 0 8px rgba(204, 173, 255, 0.26);
}

.py-com {
  color: rgba(142, 190, 154, 0.46);
  font-style: italic;
}

.yaml-key {
  color: rgba(112, 220, 255, 0.62);
  text-shadow: 0 0 8px rgba(112, 220, 255, 0.35);
}

.yaml-str {
  color: rgba(255, 214, 122, 0.58);
  text-shadow: 0 0 8px rgba(255, 214, 122, 0.25);
}

.yaml-var {
  color: rgba(204, 173, 255, 0.58);
  text-shadow: 0 0 8px rgba(204, 173, 255, 0.26);
}

.yaml-com {
  color: rgba(142, 190, 154, 0.46);
  font-style: italic;
}

.site-fx {
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  overflow: hidden;
}

.site-fx-core {
  position: absolute;
  left: 0;
  top: 0;
  width: 24rem;
  height: 24rem;
  border-radius: 50%;
  background:
    radial-gradient(circle at 40% 35%, rgba(110, 255, 168, 0.38), rgba(33, 126, 73, 0.24) 52%, rgba(1, 8, 4, 0) 76%),
    radial-gradient(circle at 58% 72%, rgba(150, 255, 193, 0.2), rgba(9, 26, 17, 0) 72%);
  opacity: 0.34;
  filter: blur(24px);
  will-change: transform;
}

.site-stream {
  position: absolute;
  left: 0;
  top: 0;
  font-family: "IBM Plex Mono", monospace;
  font-size: clamp(0.7rem, 1.15vw, 0.86rem);
  letter-spacing: 0.08em;
  text-transform: none;
  color: rgba(152, 255, 194, 0.82);
  opacity: 0.74;
  text-shadow: 0 0 10px rgba(101, 255, 161, 0.4);
  white-space: nowrap;
  max-width: min(82vw, 62ch);
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 0.2rem 0.44rem;
  border-radius: 0.5rem;
  border: 1px solid rgba(110, 232, 154, 0.34);
  background: rgba(4, 15, 9, 0.56);
  will-change: transform;
}

.site-stream-a {
  max-width: 48ch;
}

.site-stream-b {
  max-width: 46ch;
}

.site-stream-c {
  max-width: 56ch;
}

.site-stream-d {
  max-width: 58ch;
}

.site-stream-e {
  max-width: 58ch;
}

.site-particles {
  position: absolute;
  inset: 0;
}

.site-particle {
  position: absolute;
  left: 0;
  top: 0;
  padding: 0.12rem 0.33rem;
  border: 1px solid rgba(110, 232, 154, 0.28);
  border-radius: 0.45rem;
  background: rgba(4, 16, 9, 0.5);
  color: rgba(165, 255, 199, 0.82);
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.64rem;
  white-space: nowrap;
  max-width: min(46vw, 34ch);
  overflow: hidden;
  text-overflow: ellipsis;
  opacity: 0.4;
  box-shadow: 0 0 16px rgba(101, 255, 161, 0.2);
  will-change: transform;
}

.site-logo-chip {
  position: absolute;
  left: 0;
  top: 0;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(110, 232, 154, 0.32);
  border-radius: 0.62rem;
  background: rgba(4, 16, 9, 0.56);
  box-shadow: 0 0 16px rgba(101, 255, 161, 0.2);
  opacity: 0.52;
  will-change: transform;
  cursor: grab;
  touch-action: none;
}

.site-logo-icon {
  width: 18px;
  height: 18px;
  object-fit: contain;
  filter: drop-shadow(0 0 4px rgba(110, 232, 154, 0.38));
}

.site-logo-chip.is-dragging {
  cursor: grabbing;
}

.pong-overlay {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: grid;
  place-items: center;
  background: rgba(2, 10, 6, 0.8);
  backdrop-filter: blur(5px);
}

.pong-overlay[hidden] {
  display: none;
}

.pong-shell {
  width: min(940px, calc(100vw - 1.4rem));
  border: 1px solid var(--border);
  border-radius: 1rem;
  background: rgba(5, 20, 12, 0.95);
  box-shadow: var(--shadow);
  padding: 0.9rem;
}

.pong-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.7rem;
  margin-bottom: 0.7rem;
}

.pong-title {
  font-family: "IBM Plex Mono", monospace;
  color: var(--accent-soft);
  font-size: 0.86rem;
  letter-spacing: 0.06em;
}

.pong-status {
  font-family: "IBM Plex Mono", monospace;
  color: #b8f5ce;
  font-size: 0.76rem;
  opacity: 0.92;
}

.pong-close {
  min-width: 70px;
}

.pong-canvas {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 0.82rem;
  border: 1px solid rgba(110, 232, 154, 0.28);
  background: radial-gradient(120% 120% at 10% 0%, #133723 0%, #040a07 45%, #020703 100%);
  cursor: crosshair;
}

.bg-orb {
  position: fixed;
  z-index: -1;
  width: 34rem;
  height: 34rem;
  border-radius: 50%;
  filter: blur(60px);
  opacity: 0.18;
  will-change: transform;
}

.bg-orb-a {
  top: 0;
  left: 0;
  background: #3eff98;
}

.bg-orb-b {
  top: 0;
  left: 0;
  background: #60ffbc;
}

.container {
  width: min(1100px, calc(100% - 2.2rem));
  margin: 0 auto;
}

.site-header {
  position: sticky;
  top: 0;
  backdrop-filter: blur(8px);
  background: rgba(3, 13, 8, 0.74);
  border-bottom: 1px solid rgba(110, 232, 154, 0.24);
  z-index: 10;
}

.nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.85rem 0;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  position: relative;
}

.projects-menu {
  position: relative;
}

.projects-menu summary {
  list-style: none;
  cursor: pointer;
}

.projects-menu summary::-webkit-details-marker {
  display: none;
}

.projects-dropdown {
  position: absolute;
  right: 0;
  top: calc(100% + 0.45rem);
  min-width: 220px;
  padding: 0.42rem;
  border-radius: 0.7rem;
  border: 1px solid var(--border);
  background: rgba(4, 16, 9, 0.94);
  box-shadow: var(--shadow);
  display: grid;
  gap: 0.24rem;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(-12px);
  transition:
    opacity 180ms ease,
    transform 180ms ease,
    visibility 180ms step-end;
}

.projects-menu:not([open]) > .projects-dropdown {
  display: grid !important;
}

.projects-menu[open] .projects-dropdown {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0);
  transition:
    opacity 180ms ease,
    transform 180ms ease,
    visibility 0ms step-start;
}

.projects-menu.is-closing .projects-dropdown {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(-12px);
}

.projects-dropdown a {
  color: var(--text);
  text-decoration: none;
  font-size: 0.9rem;
  padding: 0.46rem 0.55rem;
  border-radius: 0.45rem;
}

.projects-dropdown a:hover {
  background: rgba(98, 240, 150, 0.18);
}

.brand {
  font-weight: 700;
  letter-spacing: 0.15em;
  font-size: 0.84rem;
  color: #89ffbe;
  text-shadow: 0 0 12px rgba(101, 255, 161, 0.45);
}

.hero {
  padding: 5.5rem 0 3rem;
}

.eyebrow {
  font-family: "IBM Plex Mono", monospace;
  text-transform: uppercase;
  color: var(--accent-soft);
  letter-spacing: 0.09em;
  font-size: 0.77rem;
  margin-bottom: 0.9rem;
}

h1 {
  font-size: clamp(2rem, 5vw, 4.1rem);
  line-height: 1.04;
  margin: 0;
  max-width: 16ch;
}

.lead {
  color: var(--muted);
  max-width: 68ch;
  font-size: 1.09rem;
  margin-top: 1.15rem;
}

.hero-actions {
  margin-top: 1.8rem;
  display: flex;
  gap: 0.8rem;
  flex-wrap: wrap;
}

.btn {
  display: inline-block;
  border: 1px solid transparent;
  background: linear-gradient(110deg, var(--accent) 0%, var(--accent-soft) 100%);
  color: #07131f;
  text-decoration: none;
  font-weight: 700;
  padding: 0.72rem 1.05rem;
  border-radius: 0.85rem;
  transition: transform 150ms ease, filter 150ms ease;
}

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

.btn-ghost {
  color: var(--text);
  background: rgba(5, 18, 11, 0.74);
  border-color: var(--border);
}

.stats {
  display: grid;
  gap: 0.85rem;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  margin-bottom: 3rem;
}

.card,
.panel,
.timeline-item,
.method {
  border: 1px solid var(--border);
  background: var(--card);
  border-radius: 1rem;
  box-shadow: var(--shadow);
}

.card {
  padding: 1.15rem 1rem;
}

.card h2 {
  margin: 0 0 0.4rem;
  font-size: 1.35rem;
}

.card p {
  margin: 0;
  color: var(--muted);
}

.section-title {
  font-size: clamp(1.5rem, 2.5vw, 2.2rem);
  margin: 0 0 1rem;
}

.grid {
  display: grid;
  gap: 0.9rem;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

.panel {
  padding: 1.1rem;
}

.panel h3 {
  margin-top: 0;
}

.panel p {
  margin-bottom: 0;
  color: var(--muted);
}

.timeline {
  display: grid;
  gap: 0.85rem;
}

.timeline-item {
  --exp-open: 0;
  --exp-dim: 0;
  --exp-zoom: 0;
  --hover-zoom: 1;
  padding: 1.1rem;
  position: relative;
  z-index: 1;
  transition:
    border-color 220ms ease,
    box-shadow 220ms ease,
    transform 220ms ease,
    filter 220ms ease,
    opacity 220ms ease;
  transform: scale(calc((1 + var(--exp-zoom) * 0.12) * var(--hover-zoom)));
  border-color: color-mix(in srgb, var(--border), rgba(101, 255, 161, 0.42) calc(var(--exp-open) * 100%));
  box-shadow:
    var(--shadow),
    0 0 calc(12px + var(--exp-open) * 44px) rgba(101, 255, 161, 0.2);
  filter: blur(calc(var(--exp-dim) * 1.3px)) saturate(calc(1 - var(--exp-dim) * 0.22));
  opacity: calc(1 - var(--exp-dim) * 0.2);
}

.timeline-item h3 {
  margin: 0.18rem 0 0.45rem;
}

.timeline-item p {
  margin: 0;
  color: var(--muted);
}

.timeline-item .exp-bullets {
  margin: calc(var(--exp-open) * 0.65rem) 0 0;
  padding-left: 1.1rem;
  max-height: calc(var(--exp-open) * 580px);
  opacity: var(--exp-open);
  overflow: hidden;
  transform: translateY(calc((1 - var(--exp-open)) * -12px));
  color: #b1f2c8;
}

.timeline-item .exp-bullets li {
  margin: 0.3rem 0;
  font-size: 0.95rem;
  line-height: 1.4;
}

.time {
  color: var(--accent-soft) !important;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.82rem;
}

#focus,
#experience,
#methodology {
  margin-bottom: 3.1rem;
}

.method {
  padding: 1.2rem;
}

/* Homepage box hover highlight without interfering with timeline scroll animation vars */
.stats .card,
#focus .panel,
#experience .timeline-item,
#methodology .method {
  position: relative;
  transition: transform 180ms ease, box-shadow 180ms ease;
}

#experience .timeline-item {
  cursor: pointer;
}

.stats .card::after,
#focus .panel::after,
#experience .timeline-item::after,
#methodology .method::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  border: 1px solid rgba(136, 255, 184, 0);
  box-shadow: inset 0 0 0 1px rgba(136, 255, 184, 0);
  opacity: 0;
  pointer-events: none;
  transition:
    opacity 180ms ease,
    border-color 180ms ease,
    box-shadow 180ms ease;
}

.stats .card:hover::after,
#focus .panel:hover::after,
#experience .timeline-item:hover::after,
#methodology .method:hover::after,
.stats .card:focus-within::after,
#focus .panel:focus-within::after,
#experience .timeline-item:focus-within::after,
#methodology .method:focus-within::after {
  opacity: 1;
  border-color: rgba(136, 255, 184, 0.85);
  box-shadow:
    inset 0 0 0 1px rgba(136, 255, 184, 0.75),
    0 0 18px rgba(92, 255, 150, 0.28);
}

.stats .card:hover,
#focus .panel:hover,
#methodology .method:hover,
.stats .card:focus-within,
#focus .panel:focus-within,
#methodology .method:focus-within {
  transform: translateY(-3px) scale(1.04);
  box-shadow:
    var(--shadow),
    0 0 24px rgba(92, 255, 150, 0.26);
}

#experience .timeline-item:hover,
#experience .timeline-item:focus-within {
  --hover-zoom: 1.04;
}

#experience .timeline-item.is-pinned {
  border-color: rgba(136, 255, 184, 0.92);
  box-shadow:
    var(--shadow),
    0 0 26px rgba(92, 255, 150, 0.32);
}

footer {
  border-top: 1px solid rgba(160, 193, 220, 0.2);
  padding: 2.8rem 0 3.2rem;
}

footer h2 {
  margin-top: 0;
}

footer p {
  color: var(--muted);
}

.badge-wrap {
  margin-top: 1rem;
  display: inline-block;
  border: 1px solid var(--border);
  border-radius: 0.9rem;
  overflow: hidden;
  background: rgba(7, 19, 33, 0.7);
}

.badge-wrap iframe {
  width: min(100%, 340px);
  height: 92px;
  display: block;
}

.small {
  font-size: 0.9rem;
  opacity: 0.95;
}

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

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

.network-diagram-wrap {
  margin: 1rem 0 1.1rem;
  border: 1px solid var(--border);
  border-radius: 1rem;
  overflow: hidden;
  background: rgba(5, 18, 11, 0.64);
}

.wordcloud {
  margin-top: 1rem;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: 0.9rem;
  background: rgba(5, 18, 11, 0.54);
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem 0.9rem;
  align-items: center;
}

.wc {
  font-weight: 700;
  line-height: 1;
  color: #b2ffd3;
  text-shadow: 0 0 14px rgba(101, 255, 161, 0.28);
}

.wc-xl {
  font-size: clamp(2rem, 4vw, 3rem);
}

.wc-l {
  font-size: clamp(1.5rem, 3vw, 2.2rem);
}

.wc-m {
  font-size: clamp(1.15rem, 2.3vw, 1.55rem);
}

.wc-s {
  font-size: clamp(0.95rem, 1.8vw, 1.2rem);
}

.wc-xs {
  font-size: clamp(0.82rem, 1.5vw, 0.95rem);
  opacity: 0.9;
}

.skill-heatmap-wrap {
  margin-top: 1rem;
  overflow-x: auto;
}

.skill-heatmap {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
  font-size: 0.92rem;
}

.skill-heatmap th,
.skill-heatmap td {
  border: 1px solid var(--border);
  padding: 0.62rem 0.58rem;
  text-align: left;
}

.skill-heatmap thead th {
  background: rgba(9, 32, 19, 0.86);
  color: #d7ffe9;
  font-weight: 700;
}

.skill-heatmap tbody th {
  background: rgba(7, 25, 15, 0.82);
  color: #cdf7dd;
  width: 20%;
}

.hm-5 {
  background: rgba(48, 170, 98, 0.42);
}

.hm-4 {
  background: rgba(63, 149, 98, 0.34);
}

.hm-3 {
  background: rgba(78, 129, 98, 0.28);
}

.hm-2 {
  background: rgba(91, 108, 95, 0.24);
}

.hm-score {
  font-family: "IBM Plex Mono", monospace;
  color: #c8ffe0;
  font-weight: 700;
  white-space: nowrap;
}

.network-diagram {
  display: block;
  width: 100%;
  height: auto;
}

.nd-link {
  stroke: #7bffb0;
  stroke-width: 2.2;
  fill: none;
}

.nd-cluster {
  fill: rgba(10, 40, 25, 0.6);
  stroke: #6be7a0;
  stroke-width: 2;
}

.nd-box {
  fill: rgba(8, 30, 20, 0.66);
  stroke: #57cf8d;
  stroke-width: 1.8;
}

.nd-node {
  fill: rgba(8, 45, 27, 0.75);
  stroke: #76ffb2;
  stroke-width: 1.4;
}

.nd-title,
.nd-label,
.nd-text,
.nd-subtext,
.nd-foot {
  font-family: "IBM Plex Mono", monospace;
}

.nd-title {
  fill: #c9ffe0;
  font-size: 24px;
}

.nd-label {
  fill: #99efbe;
  font-size: 17px;
}

.nd-text {
  fill: #d6ffea;
  font-size: 18px;
}

.nd-subtext {
  fill: #a7e9c2;
  font-size: 15px;
}

.nd-foot {
  fill: #8fd8ae;
  font-size: 14px;
}

@media (max-width: 740px) {
  .container {
    width: min(1100px, calc(100% - 1.2rem));
  }

  .nav {
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.65rem;
    align-items: stretch;
  }

  .brand {
    letter-spacing: 0.1em;
    font-size: 0.76rem;
    width: 100%;
    text-align: center;
  }

  .nav-actions {
    width: 100%;
    gap: 0.45rem;
  }

  .nav-actions .btn {
    flex: 1 1 0;
    text-align: center;
  }

  .projects-menu {
    flex: 1 1 0;
  }

  .projects-menu summary {
    width: 100%;
    text-align: center;
  }

  .projects-dropdown {
    left: 0;
    right: 0;
    min-width: 0;
  }

  .hero {
    padding: 3.6rem 0 2.2rem;
  }

  h1 {
    max-width: 100%;
    line-height: 1.08;
  }

  .lead {
    font-size: 1rem;
    max-width: 100%;
  }

  .hero-actions {
    gap: 0.55rem;
  }

  .hero-actions .btn {
    width: 100%;
    text-align: center;
  }

  .section-title {
    margin-bottom: 0.8rem;
  }

  .timeline-item {
    transform: scale(calc((1 + var(--exp-zoom) * 0.06) * var(--hover-zoom)));
    filter: blur(calc(var(--exp-dim) * 0.75px)) saturate(calc(1 - var(--exp-dim) * 0.12));
  }

  .timeline-item .exp-bullets li {
    font-size: 0.9rem;
    line-height: 1.35;
  }

  .site-stream-a,
  .site-stream-c,
  .site-stream-d {
    display: none;
  }

  .site-stream {
    max-width: 76vw;
    white-space: normal;
    line-height: 1.25;
    text-overflow: clip;
  }

  .site-particle {
    display: none;
  }

  .site-logo-chip {
    width: 30px;
    height: 30px;
    border-radius: 0.52rem;
    opacity: 0.46;
  }

  .site-logo-icon {
    width: 16px;
    height: 16px;
  }

  .bg-code {
    opacity: 0.14;
  }

  .bg-code pre {
    padding: 2.8rem 1.4rem;
    font-size: 0.58rem;
    transform: rotate(-2deg) scale(1.02);
  }

  .bg-code-right {
    display: none;
  }

  .bg-code-cloud {
    display: none;
  }

  .nd-title {
    font-size: 19px;
  }

  .nd-label {
    font-size: 14px;
  }

  .nd-text {
    font-size: 14px;
  }

  .nd-subtext {
    font-size: 12px;
  }

  .nd-foot {
    font-size: 11px;
  }
}

@media (max-width: 460px) {
  .btn {
    padding: 0.68rem 0.9rem;
    border-radius: 0.72rem;
  }

  .card,
  .panel,
  .timeline-item,
  .method {
    border-radius: 0.82rem;
  }

  .badge-wrap iframe {
    height: 86px;
  }
}
