@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500;600;700&family=Syne:wght@600;700;800&display=swap');

:root {
  --bg: #0a0a0a;
  --bg-elevated: #111111;
  --bg-card: #141414;
  --border: #2a2a2a;
  --border-accent: rgba(0, 229, 255, 0.35);
  --cyan: #00e5ff;
  --cyan-dim: #00b8cc;
  --cyan-glow: rgba(0, 229, 255, 0.12);
  --text: #f5f5f5;
  --muted: #8a8a8a;
  --muted-2: #5c5c5c;
  --font-mono: 'IBM Plex Mono', ui-monospace, Menlo, Consolas, monospace;
  --font-display: 'Syne', system-ui, sans-serif;
  --max: 1100px;
  --radius: 10px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-mono);
  color: var(--text);
  background-color: var(--bg);
  background-image:
    radial-gradient(ellipse 80% 50% at 10% -10%, var(--cyan-glow), transparent 55%),
    radial-gradient(ellipse 60% 40% at 100% 0%, rgba(0, 229, 255, 0.06), transparent 50%),
    linear-gradient(rgba(0, 229, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 229, 255, 0.03) 1px, transparent 1px);
  background-size: auto, auto, 48px 48px, 48px 48px;
  line-height: 1.65;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--cyan);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

img {
  max-width: 100%;
}

.wrap {
  width: min(100% - 2rem, var(--max));
  margin-inline: auto;
}

/* —— Header —— */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  backdrop-filter: blur(12px);
  background: rgba(10, 10, 10, 0.85);
  border-bottom: 1px solid var(--border);
  animation: headerIn 0.55s ease-out both;
}

@keyframes headerIn {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

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

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--text);
  font-weight: 700;
  letter-spacing: 0.04em;
  text-decoration: none;
}

.brand:hover {
  color: var(--cyan);
  text-decoration: none;
}

.brand-mark {
  width: 28px;
  height: 28px;
  border: 1.5px solid var(--cyan);
  border-radius: 6px;
  display: grid;
  place-items: center;
  font-size: 0.7rem;
  color: var(--cyan);
  font-weight: 700;
}

.nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 1rem;
  font-size: 0.78rem;
}

.nav a {
  color: var(--muted);
  text-decoration: none;
}

.nav a:hover,
.nav a.active {
  color: var(--cyan);
}

.nav .num {
  color: var(--cyan);
  margin-right: 0.2rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.65rem 1.1rem;
  border: 1px solid var(--cyan);
  border-radius: 6px;
  color: var(--cyan);
  background: transparent;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease, transform 0.15s ease;
}

.btn:hover {
  background: var(--cyan);
  color: #001018;
  text-decoration: none;
  box-shadow: 0 0 24px rgba(0, 229, 255, 0.25);
  transform: translateY(-1px);
}

.btn-solid {
  background: var(--cyan);
  color: #001018;
}

.btn-solid:hover {
  background: var(--cyan-dim);
  color: #001018;
}

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

.btn-ghost:hover {
  border-color: var(--cyan);
  background: transparent;
  color: var(--cyan);
  box-shadow: none;
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

/* —— Hub home —— */
.hub {
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - 4rem);
  justify-content: center;
  padding: 3rem 0 4rem;
}

.hub-brand {
  font-family: var(--font-display);
  font-size: clamp(2.8rem, 8vw, 4.5rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.05;
  margin: 0 0 0.75rem;
  animation: rise 0.6s ease-out both;
}

.hub-lead {
  color: var(--muted);
  font-size: 1rem;
  max-width: 34rem;
  margin: 0 0 1.75rem;
  animation: rise 0.6s ease-out 0.08s both;
}

.hub .cta-row {
  animation: rise 0.6s ease-out 0.16s both;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.hub-meta {
  margin-top: 2.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 1.5rem;
  font-size: 0.8rem;
  color: var(--muted);
  animation: rise 0.6s ease-out 0.24s both;
}

.hub-meta a {
  color: var(--muted);
}

.hub-meta a:hover {
  color: var(--cyan);
}

/* —— Portfolio —— */
.section {
  padding: 4.5rem 0;
}

.section-label {
  color: var(--cyan);
  font-size: 0.78rem;
  margin: 0 0 0.5rem;
  letter-spacing: 0.02em;
}

.section-title {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 3.5vw, 2.2rem);
  font-weight: 700;
  margin: 0 0 1.75rem;
  letter-spacing: -0.01em;
}

.status-line {
  color: var(--cyan);
  font-size: 0.85rem;
  margin: 0 0 0.85rem;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 2rem;
  align-items: start;
}

.hero-name {
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 5.5vw, 3.4rem);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin: 0 0 0.5rem;
  text-transform: uppercase;
}

.hero-role {
  color: var(--cyan);
  font-size: 1.05rem;
  font-weight: 600;
  margin: 0 0 1rem;
}

.hero-bio {
  color: var(--muted);
  margin: 0 0 1.25rem;
  max-width: 36rem;
}

.contact-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  font-size: 0.85rem;
}

.contact-row a {
  color: var(--text);
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.contact-row a:hover {
  color: var(--cyan);
}

.terminal {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 0 0 1px rgba(0, 229, 255, 0.05), 0 20px 50px rgba(0, 0, 0, 0.45);
  animation: rise 0.7s ease-out 0.12s both;
}

.terminal-bar {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.65rem 0.85rem;
  border-bottom: 1px solid var(--border);
  background: #0f0f0f;
}

.dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #333;
}

.dot.r { background: #ff5f56; }
.dot.y { background: #ffbd2e; }
.dot.g { background: #27c93f; }

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

.terminal-body {
  padding: 1rem 1.1rem 1.25rem;
  font-size: 0.82rem;
  line-height: 1.7;
  overflow-x: auto;
}

.terminal-body .k { color: var(--cyan); }
.terminal-body .s { color: #9ae6b4; }
.terminal-body .n { color: #f6ad55; }
.terminal-body .c { color: var(--muted-2); }

.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-top: 2.5rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}

.stat {
  text-align: left;
}

.stat-value {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 2.75rem);
  font-weight: 800;
  color: var(--cyan);
  line-height: 1;
  margin: 0 0 0.35rem;
}

.stat-label {
  color: var(--muted);
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.arsenal-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

.arsenal-card,
.project-card,
.oss-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.15rem 1.2rem;
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.arsenal-card:hover,
.project-card:hover {
  border-color: var(--border-accent);
  transform: translateY(-2px);
}

.arsenal-card h3,
.project-card h3 {
  margin: 0 0 0.75rem;
  font-size: 0.95rem;
  font-weight: 600;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.tag {
  display: inline-block;
  padding: 0.2rem 0.55rem;
  border: 1px solid var(--border-accent);
  border-radius: 4px;
  color: var(--cyan);
  font-size: 0.7rem;
  background: rgba(0, 229, 255, 0.04);
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

.project-card .head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.project-card h3 {
  margin: 0;
}

.project-card p {
  color: var(--muted);
  font-size: 0.85rem;
  margin: 0 0 0.9rem;
}

.ext-link {
  color: var(--cyan);
  flex-shrink: 0;
  font-size: 1rem;
  line-height: 1;
  text-decoration: none;
}

.ext-link:hover {
  opacity: 0.8;
}

.timeline {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  padding-left: 1.25rem;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.35rem;
  bottom: 0.35rem;
  width: 1px;
  background: linear-gradient(var(--cyan), transparent);
}

.timeline-item {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.15rem 1.25rem;
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: -1.35rem;
  top: 1.35rem;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 0 3px rgba(0, 229, 255, 0.2);
}

.timeline-meta {
  color: var(--cyan);
  font-size: 0.75rem;
  margin: 0 0 0.35rem;
}

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

.timeline-role {
  color: var(--muted);
  font-size: 0.85rem;
  margin: 0 0 0.65rem;
}

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

.oss-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 1.25rem;
}

.oss-card h3 {
  margin: 0 0 0.85rem;
  font-size: 0.95rem;
}

.oss-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.oss-list li {
  font-size: 0.85rem;
}

.oss-list a {
  font-weight: 600;
  color: var(--text);
}

.oss-list a:hover {
  color: var(--cyan);
}

.oss-list span {
  display: block;
  color: var(--muted);
  margin-top: 0.2rem;
  font-size: 0.8rem;
}

.contrib-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.footer-cta {
  padding: 4rem 0 2rem;
  border-top: 1px solid var(--border);
}

.footer-cta h2 {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  margin: 0 0 0.5rem;
  letter-spacing: -0.02em;
}

.footer-cta p {
  color: var(--muted);
  margin: 0 0 1.25rem;
  max-width: 32rem;
}

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 1.25rem 0 2rem;
  border-top: 1px solid var(--border);
  color: var(--muted-2);
  font-size: 0.75rem;
}

.footer-bottom a {
  color: var(--muted);
  margin-left: 0.85rem;
}

.footer-bottom a:hover {
  color: var(--cyan);
}

.products-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 1.25rem;
}

/* —— 404 —— */
.page-404 {
  min-height: 70vh;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 3rem 1rem;
}

.page-404 h1 {
  font-family: var(--font-display);
  font-size: 3rem;
  margin: 0 0 0.5rem;
  color: var(--cyan);
}

.page-404 p {
  color: var(--muted);
  margin: 0 0 1.25rem;
}

.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.55s ease, transform 0.55s ease;
}

.reveal.is-visible {
  opacity: 1;
  transform: none;
}

.nav-toggle {
  display: none;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--cyan);
  border-radius: 6px;
  padding: 0.4rem 0.65rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  cursor: pointer;
}

@media (max-width: 900px) {
  .hero-grid,
  .arsenal-grid,
  .projects-grid,
  .oss-grid {
    grid-template-columns: 1fr;
  }

  .stats {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }

  .nav-toggle {
    display: inline-flex;
  }

  .header-inner {
    position: relative;
    flex-wrap: wrap;
  }

  .nav-panel {
    display: none;
    order: 3;
    width: 100%;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.85rem;
    padding: 0.75rem 0 0.25rem;
    border-top: 1px solid var(--border);
    margin-top: 0.5rem;
  }

  .site-header.is-open .nav-panel {
    display: flex;
  }

  .header-actions {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 0.5rem;
  }

  .header-actions .btn-touch {
    display: none;
  }
}

@media (min-width: 901px) {
  .nav-panel {
    display: flex !important;
    align-items: center;
    gap: 1rem;
    flex: 1;
    justify-content: center;
  }

  .header-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
  }
}
