:root {
  --bg: #07070c;
  --bg-card: rgba(14, 14, 22, 0.72);
  --bg-card-hover: rgba(20, 20, 32, 0.88);
  --text: #e8e8f2;
  --text-muted: #9494a8;
  --accent: #00ffc8;
  --accent-dim: rgba(0, 255, 200, 0.12);
  --pink: #ff2d6a;
  --pink-dim: rgba(255, 45, 106, 0.14);
  --border: rgba(255, 255, 255, 0.08);
  --glow: 0 0 40px rgba(0, 255, 200, 0.15);
  --font-display: "Syne", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;
  --radius: 16px;
  --max: 1080px;
}

*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: 5rem;
}

body {
  margin: 0;
  font-family: var(--font-display);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
}

.noise {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  z-index: 9999;
}

.bg-glow {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(ellipse 60% 50% at 15% 10%, rgba(0, 255, 200, 0.09), transparent 55%),
    radial-gradient(ellipse 50% 40% at 85% 20%, rgba(255, 45, 106, 0.08), transparent 50%),
    radial-gradient(ellipse 40% 30% at 50% 90%, rgba(100, 80, 255, 0.06), transparent 45%);
}

.grid-lines {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.02) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse at center, black 20%, transparent 75%);
}

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

.container {
  position: relative;
  z-index: 1;
  width: min(var(--max), calc(100% - 2rem));
  margin-inline: auto;
}

/* ── Nav ── */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(16px);
  background: rgba(7, 7, 12, 0.75);
  border-bottom: 1px solid var(--border);
}

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

.logo {
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
}

.logo span { color: var(--accent); }

.nav-links {
  display: flex;
  gap: 1.5rem;
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 0.9rem;
}

.nav-links a {
  color: var(--text-muted);
  transition: color 0.2s;
}

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

.nav-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 1rem;
  border-radius: 999px;
  background: var(--accent-dim);
  border: 1px solid rgba(0, 255, 200, 0.25);
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  transition: background 0.2s, transform 0.2s;
}

.nav-cta:hover {
  background: rgba(0, 255, 200, 0.2);
  transform: translateY(-1px);
}

/* ── Hero ── */
.hero {
  padding: 5rem 0 4rem;
  min-height: 88vh;
  display: flex;
  align-items: center;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 3rem;
  align-items: center;
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--accent);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.eyebrow::before {
  content: "";
  width: 2rem;
  height: 1px;
  background: var(--accent);
}

h1 {
  font-size: clamp(2.8rem, 7vw, 4.8rem);
  font-weight: 800;
  line-height: 1.02;
  letter-spacing: -0.04em;
  margin: 0 0 1.25rem;
}

h1 .highlight {
  background: linear-gradient(135deg, var(--accent), #6ee7ff 50%, var(--pink));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-desc {
  font-size: 1.12rem;
  color: var(--text-muted);
  max-width: 34rem;
  margin-bottom: 2rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.85rem 1.4rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.95rem;
  border: 1px solid transparent;
  transition: transform 0.2s, box-shadow 0.2s, background 0.2s;
  cursor: pointer;
}

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

.btn-primary {
  background: var(--accent);
  color: #041510;
  box-shadow: var(--glow);
}

.btn-primary:hover {
  box-shadow: 0 0 50px rgba(0, 255, 200, 0.3);
}

.btn-ghost {
  background: transparent;
  border-color: var(--border);
  color: var(--text);
}

.btn-ghost:hover {
  border-color: rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.04);
}

/* Terminal card */
.terminal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(12px);
}

.terminal-bar {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.75rem 1rem;
  background: rgba(0, 0, 0, 0.35);
  border-bottom: 1px solid var(--border);
}

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

.dot-r { background: #ff5f57; }
.dot-y { background: #febc2e; }
.dot-g { background: #28c840; }

.terminal-title {
  margin-left: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-muted);
}

.terminal-body {
  padding: 1.25rem 1.5rem 1.5rem;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  line-height: 1.75;
}

.t-prompt { color: var(--accent); }
.t-cmd { color: var(--text); }
/* Terminal hero slot */
#hero-terminal-slot {
  min-height: 220px;
}

#hero-terminal-slot .terminal-variant[hidden] {
  display: none;
}

.t-out {
  color: var(--text-muted);
  margin-top: 0.5rem;
}
.t-key { color: #8ab4ff; }
.t-val { color: var(--pink); }
.t-cursor {
  display: inline-block;
  width: 8px;
  height: 1em;
  background: var(--accent);
  vertical-align: text-bottom;
  animation: blink 1s step-end infinite;
}

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

/* ── Sections ── */
section { padding: 4.5rem 0; }

.section-label {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--pink);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-bottom: 0.75rem;
}

section h2 {
  font-size: clamp(1.8rem, 4vw, 2.4rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  margin: 0 0 2rem;
}

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

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  backdrop-filter: blur(8px);
  transition: border-color 0.25s, transform 0.25s, background 0.25s;
}

.card:hover {
  border-color: rgba(0, 255, 200, 0.22);
  background: var(--bg-card-hover);
  transform: translateY(-3px);
}

.card-icon {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-size: 1.2rem;
  margin-bottom: 1rem;
  background: var(--accent-dim);
}

.card[data-service].active {
  border-color: rgba(0, 255, 200, 0.35);
  box-shadow: 0 8px 24px rgba(0, 255, 200, 0.08);
}

.card:nth-child(3n+1) .card-icon { background: var(--accent-dim); }
.card:nth-child(3n+2) .card-icon { background: var(--pink-dim); }
.card:nth-child(3n+3) .card-icon { background: rgba(138, 180, 255, 0.12); }

.card-tag {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--pink);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin: 0 0 0.35rem;
}

.card-meta {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0.75rem;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--accent);
}

.card-meta::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
  animation: pulse 2s ease infinite;
}

.card-list {
  margin: 0.75rem 0 0;
  padding-left: 1.1rem;
  color: var(--text-muted);
  font-size: 0.88rem;
}

.card-list li { margin-bottom: 0.35rem; }
.card-list li::marker { color: var(--accent); }

.card code {
  font-family: var(--font-mono);
  font-size: 0.85em;
  color: var(--accent);
}

.cards--duo {
  grid-template-columns: repeat(2, 1fr);
}

.cards--lab {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.card h3 {
  margin: 0 0 0.5rem;
  font-size: 1.05rem;
}

.card p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.92rem;
}

.hero-desc a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.hero-desc a:hover { color: #6ee7ff; }

/* Stats bar */
.stats-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  margin-bottom: 2rem;
  padding: 1rem 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.stat strong {
  display: block;
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--accent);
  letter-spacing: -0.02em;
}

.stat span {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-muted);
}

.card a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.card a:hover { color: #6ee7ff; }

/* Featured article */
.section-featured {
  background: linear-gradient(180deg, transparent, rgba(0, 255, 200, 0.03), transparent);
}

.featured-article {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) + 4px);
  padding: 2rem;
  backdrop-filter: blur(10px);
}

.featured-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.badge {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  padding: 0.3rem 0.65rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.03);
}

.badge-accent {
  border-color: rgba(0, 255, 200, 0.3);
  color: var(--accent);
  background: var(--accent-dim);
}

.featured-article h3 {
  margin: 0 0 1rem;
  font-size: clamp(1.3rem, 3vw, 1.75rem);
  letter-spacing: -0.02em;
}

.featured-article h3 a {
  color: var(--text);
  transition: color 0.2s;
}

.featured-article h3 a:hover { color: var(--accent); }

.featured-desc {
  color: var(--text-muted);
  margin: 0 0 1.5rem;
  max-width: 52rem;
}

.featured-desc a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.featured-foot {
  font-style: italic;
  color: var(--text-muted);
  font-size: 0.9rem;
  margin: 1.25rem 0 1.5rem;
  padding-left: 1rem;
  border-left: 2px solid var(--pink);
}

/* Code block */
.code-block {
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 0.5rem;
}

.code-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.55rem 1rem;
  background: rgba(0, 0, 0, 0.4);
  border-bottom: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-muted);
}

.code-lang {
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.code-block pre {
  margin: 0;
  padding: 1.15rem 1.25rem;
  overflow-x: auto;
  background: rgba(0, 0, 0, 0.25);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  line-height: 1.7;
}

.code-block code { color: var(--text-muted); }

.c-comment { color: #6a9955; }
.c-kw { color: var(--pink); }
.c-str { color: #ce9178; }

.timeline-item h3 a {
  color: var(--text);
  transition: color 0.2s;
}

.timeline-item h3 a:hover { color: var(--accent); }

/* Skills */
.skills-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.skill {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  padding: 0.45rem 0.85rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-muted);
  transition: border-color 0.2s, color 0.2s;
}

.skill:hover {
  border-color: rgba(0, 255, 200, 0.35);
  color: var(--accent);
}

/* Timeline */
.timeline {
  display: grid;
  gap: 1rem;
}

.timeline-item {
  display: grid;
  grid-template-columns: 7rem 1fr;
  gap: 1.5rem;
  padding: 1.25rem 0;
  border-bottom: 1px solid var(--border);
}

.timeline-item:last-child { border-bottom: none; }

.timeline-year {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--accent);
  padding-top: 0.15rem;
}

.timeline-item h3 {
  margin: 0 0 0.35rem;
  font-size: 1.05rem;
}

.timeline-item p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.92rem;
}

/* Links grid */
.links-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}

.link-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.25rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color 0.2s, transform 0.2s;
}

.link-card:hover {
  border-color: rgba(255, 45, 106, 0.35);
  transform: translateY(-2px);
}

.link-card strong {
  display: block;
  font-size: 0.95rem;
}

.link-card small {
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.75rem;
}

.link-icon {
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: var(--pink-dim);
  font-size: 1.1rem;
  flex-shrink: 0;
}

/* Footer */
.footer {
  padding: 2.5rem 0 3rem;
  border-top: 1px solid var(--border);
  text-align: center;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.78rem;
}

.footer span { color: var(--accent); }

/* Reveal animation */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

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

/* Responsive */
@media (max-width: 860px) {
  .hero-grid {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }

  .terminal,
  #hero-terminal-slot { order: -1; }

  .nav-links { display: none; }

  .timeline-item {
    grid-template-columns: 1fr;
    gap: 0.35rem;
  }
}

@media (max-width: 480px) {
  .hero { padding-top: 3rem; min-height: auto; }
  .hero-actions { flex-direction: column; }
  .btn { justify-content: center; }
  .stats-bar { gap: 1rem; }
  .featured-article { padding: 1.25rem; }
  .cards--duo { grid-template-columns: 1fr; }
}

.lab-intro {
  color: var(--text-muted);
  max-width: 40rem;
  margin: -1rem 0 2rem;
}
