:root {
  --bg: #060b16;
  --bg-soft: #0c1528;
  --panel: rgba(12, 21, 40, 0.72);
  --panel-strong: rgba(8, 14, 29, 0.92);
  --text: #ecf3ff;
  --muted: #97a9c8;
  --line: rgba(157, 181, 220, 0.22);
  --orange: #ff8a2b;
  --cyan: #18d0da;
  --lime: #a8ff4b;
  --red: #ff4f4f;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.45);
  --radius: 18px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: "Space Grotesk", sans-serif;
  background:
    radial-gradient(circle at 12% 8%, rgba(24, 208, 218, 0.16), transparent 35%),
    radial-gradient(circle at 90% 18%, rgba(255, 138, 43, 0.2), transparent 40%),
    linear-gradient(165deg, #050913 0%, #0a1020 55%, #060b16 100%);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(to bottom, rgba(255, 255, 255, 0.025), transparent 25%),
    repeating-linear-gradient(90deg, transparent 0, transparent 79px, rgba(255, 255, 255, 0.015) 80px);
  z-index: -2;
}

#network {
  position: fixed;
  inset: 0;
  z-index: -1;
  opacity: 0.42;
}

.container {
  width: min(1180px, 92vw);
  margin: 0 auto;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(5, 9, 20, 0.82);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}

.topbar-inner {
  min-height: 120px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--text);
}

.brand img {
  width: 144px;
  height: 144px;
  object-fit: contain;
  filter: drop-shadow(0 0 8px rgba(255, 138, 43, 0.45));
}

.brand strong {
  font-family: "Sora", sans-serif;
  font-size: 1.4rem;
  letter-spacing: 0.03em;
  font-weight: 700;
}

.brand strong span {
  color: var(--orange);
}

.menu {
  display: flex;
  align-items: center;
  gap: 10px;
}

.menu a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.86rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 9px 11px;
  border-radius: 10px;
  transition: 180ms ease;
  border: 1px solid transparent;
}

.menu a:hover,
.menu a.active {
  color: var(--text);
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.03);
}

.menu a.active {
  box-shadow: inset 0 0 0 1px rgba(24, 208, 218, 0.25);
}

.menu-toggle {
  display: none;
  width: 42px;
  height: 42px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.02);
  color: var(--text);
  font-size: 1.15rem;
}

main {
  padding: 32px 0 80px;
}

.page-hero {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: linear-gradient(140deg, rgba(14, 26, 48, 0.88), rgba(7, 13, 25, 0.92));
  box-shadow: var(--shadow);
  padding: clamp(20px, 5vw, 38px);
  margin-bottom: 28px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  border: 1px solid rgba(24, 208, 218, 0.45);
  background: rgba(24, 208, 218, 0.08);
  border-radius: 999px;
  color: #8beef3;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 12px;
  font-family: "IBM Plex Mono", monospace;
}

.page-hero h1 {
  font-family: "Sora", sans-serif;
  font-weight: 800;
  font-size: clamp(1.9rem, 5.1vw, 3.5rem);
  line-height: 1.08;
  margin-bottom: 12px;
  text-wrap: balance;
}

.page-hero h1 .accent {
  color: var(--orange);
  text-shadow: 0 0 24px rgba(255, 138, 43, 0.35);
}

.page-hero p {
  color: var(--muted);
  max-width: 72ch;
  line-height: 1.75;
  font-size: 1rem;
}

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 11px 16px;
  border-radius: 12px;
  border: 1px solid transparent;
  text-decoration: none;
  font-family: "Sora", sans-serif;
  font-weight: 700;
  letter-spacing: 0.02em;
  transition: 180ms ease;
}

.btn-primary {
  color: #111;
  background: linear-gradient(120deg, var(--lime), #dbff9c 45%, var(--orange));
  box-shadow: 0 12px 30px rgba(168, 255, 75, 0.25);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 35px rgba(168, 255, 75, 0.34);
}

.btn-ghost {
  color: var(--text);
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.02);
}

.btn-ghost:hover {
  border-color: rgba(255, 138, 43, 0.55);
  background: rgba(255, 138, 43, 0.08);
}

.split {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 14px;
}

.panel {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: linear-gradient(145deg, rgba(14, 24, 45, 0.85), rgba(8, 14, 26, 0.9));
  padding: 18px;
}

.panel h2,
.panel h3,
.panel h4 {
  font-family: "Sora", sans-serif;
}

.section-head {
  margin: 26px 0 14px;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.section-head h2 {
  font-family: "Sora", sans-serif;
  font-size: clamp(1.3rem, 2.6vw, 2.1rem);
}

.section-head p {
  color: var(--muted);
  max-width: 60ch;
}

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

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

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

.stat {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px;
}

.stat h3 {
  font-family: "Sora", sans-serif;
  font-size: clamp(1.5rem, 3.2vw, 2.2rem);
  margin-bottom: 4px;
}

.stat p {
  font-size: 0.82rem;
  color: var(--muted);
  letter-spacing: 0.07em;
  text-transform: uppercase;
  font-family: "IBM Plex Mono", monospace;
}

.terminal {
  background: var(--panel-strong);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  position: relative;
  height: 100%;
}

.terminal::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.08), transparent 30%);
  mix-blend-mode: soft-light;
}

.terminal-head {
  height: 44px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  padding: 0 14px;
  gap: 8px;
  background: rgba(255, 255, 255, 0.02);
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}

.dot.red { background: #ff5f57; }
.dot.yellow { background: #ffbe2f; }
.dot.green { background: #28ca42; }

.terminal-title {
  margin-left: 10px;
  font-size: 0.78rem;
  color: #7f96c0;
  font-family: "IBM Plex Mono", monospace;
}

.terminal-body {
  min-height: 260px;
  max-height: 300px;
  overflow: auto;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.88rem;
  padding: 18px;
  color: #bfd2f4;
  line-height: 1.5;
  background: linear-gradient(180deg, rgba(20, 30, 52, 0.42), rgba(7, 12, 24, 0.7));
}

.line {
  opacity: 0;
  transform: translateY(7px);
  animation: enter 420ms ease forwards;
}

.line .prompt { color: var(--orange); }
.line .ok { color: #84ff8c; }
.line .warn { color: #ffd166; }
.line .info { color: #67e8f9; }

.card {
  border: 1px solid var(--line);
  background: linear-gradient(155deg, rgba(17, 27, 50, 0.85), rgba(10, 18, 34, 0.9));
  border-radius: 16px;
  padding: 18px;
  position: relative;
  overflow: hidden;
  transition: transform 200ms ease, border-color 200ms ease, box-shadow 200ms ease;
}

.card:hover {
  transform: translateY(-4px);
  border-color: rgba(255, 255, 255, 0.3);
  box-shadow: 0 20px 42px rgba(0, 0, 0, 0.35);
}

.card h3 {
  font-family: "Sora", sans-serif;
  margin-bottom: 10px;
  font-size: 1.08rem;
}

.card p {
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.55;
}

.stack-list {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 12px;
}

.stack-list li {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 9px;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.75rem;
  color: #b4c9ec;
  background: rgba(255, 255, 255, 0.02);
}

.skill-item {
  margin-bottom: 12px;
}

.skill-label {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 0.88rem;
  margin-bottom: 6px;
  color: #dce8ff;
  font-family: "IBM Plex Mono", monospace;
}

.bar {
  width: 100%;
  height: 9px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.08);
}

.fill {
  width: 0;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--cyan), var(--lime));
  box-shadow: 0 0 22px rgba(24, 208, 218, 0.35);
  transition: width 950ms cubic-bezier(0.21, 1, 0.34, 1);
}

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

.step {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(8, 14, 28, 0.8);
  padding: 18px;
  position: relative;
}

.step::before {
  content: attr(data-step);
  position: absolute;
  top: 12px;
  right: 14px;
  color: rgba(140, 165, 205, 0.4);
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.78rem;
}

.step h4 {
  font-family: "Sora", sans-serif;
  margin-bottom: 7px;
}

.step p {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.55;
}

.kv {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(157, 181, 220, 0.16);
  font-size: 0.9rem;
}

.kv:last-child {
  border-bottom: none;
}

.kv strong {
  color: #dce9ff;
}

.kv span {
  color: var(--muted);
  font-family: "IBM Plex Mono", monospace;
}

.project-card .top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.pill {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 9px;
  font-size: 0.74rem;
  font-family: "IBM Plex Mono", monospace;
  color: #cde1ff;
  background: rgba(255, 255, 255, 0.03);
}

.pill.green {
  color: #bafca8;
  border-color: rgba(144, 255, 116, 0.4);
  background: rgba(144, 255, 116, 0.09);
}

.pill.orange {
  color: #ffd4a8;
  border-color: rgba(255, 185, 116, 0.45);
  background: rgba(255, 185, 116, 0.09);
}

.project-meta {
  margin-top: 12px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  font-size: 0.82rem;
}

.project-meta div {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px;
  color: #c7d9f6;
  font-family: "IBM Plex Mono", monospace;
}

.table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 8px;
}

.table th,
.table td {
  text-align: left;
  border-bottom: 1px solid rgba(157, 181, 220, 0.18);
  padding: 10px 8px;
  font-size: 0.88rem;
}

.table th {
  font-family: "IBM Plex Mono", monospace;
  color: #c9ddff;
  font-weight: 600;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
}

.contact-cards {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.contact-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.22);
  padding: 14px;
}

.contact-card strong {
  font-size: 0.95rem;
  font-family: "IBM Plex Mono", monospace;
  color: #e3edff;
  display: block;
  margin-bottom: 6px;
}

.contact-card a,
.contact-card button {
  font-size: 0.89rem;
  color: #99f6ff;
  font-family: "IBM Plex Mono", monospace;
  text-decoration: none;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
}

.legal-copy {
  margin-top: 8px;
  display: grid;
  gap: 8px;
}

.legal-copy p {
  color: var(--muted);
  line-height: 1.7;
  font-size: 0.93rem;
}

.legal-copy a {
  color: #99f6ff;
  text-decoration: none;
}

.legal-copy a:hover {
  text-decoration: underline;
}

.reveal {
  opacity: 0;
  transform: translateY(16px) scale(0.99);
  transition: 460ms ease;
  transition-delay: var(--delay, 0ms);
}

.reveal.in {
  opacity: 1;
  transform: translateY(0) scale(1);
}

@keyframes enter {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

footer {
  border-top: 1px solid var(--line);
  margin-top: 58px;
  padding: 22px 0 30px;
  color: #7f95bb;
  font-size: 0.87rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.footer-links {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.footer-links a {
  color: #9ddde5;
  text-decoration: none;
}

.footer-links a:hover {
  text-decoration: underline;
}

@media (max-width: 980px) {
  .split,
  .grid-3,
  .grid-4,
  .flow {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .grid-2 {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .brand img {
    width: 120px;
    height: 120px;
  }

  .topbar-inner {
    min-height: 100px;
  }

  .menu-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .menu {
    position: absolute;
    top: 100px;
    right: 4vw;
    left: 4vw;
    display: none;
    flex-direction: column;
    align-items: stretch;
    padding: 8px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: rgba(8, 14, 28, 0.96);
  }

  .menu.open {
    display: flex;
  }

  .split,
  .grid-3,
  .grid-4,
  .flow,
  .project-meta {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }

  html {
    scroll-behavior: auto;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }

  .fill {
    width: var(--target, 0%);
  }
}
