/* Reset */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* Variables */
:root {
  --bg-primary: #0a0e14;
  --bg-card: #111822;
  --bg-elevated: #162030;
  --accent: #d4891c;
  --accent-glow: rgba(212, 137, 28, 0.4);
  --accent-dim: rgba(212, 137, 28, 0.1);
  --teal: #2a8a9a;
  --green: #00ff88;
  --text: #c8d0d8;
  --text-muted: #6a7a8a;
  --border: #1a2a3a;
}

/* Base */
html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: 'Inter', system-ui, sans-serif;
  font-weight: 400;
  color: var(--text);
  background: var(--bg-primary);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--teal);
  text-decoration: none;
  transition: color 0.2s;
}

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

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Scanlines (body::after omitted — applied only to hero) */

/* Skip link */
.skip-link {
  position: absolute;
  top: -100%;
  left: 1rem;
  background: var(--accent);
  color: var(--bg-primary);
  padding: 0.5rem 1rem;
  border-radius: 4px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.85rem;
  z-index: 1000;
}

.skip-link:focus {
  top: 1rem;
  color: var(--bg-primary);
}

/* Layout */
.container {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* Green accent */
.green {
  color: var(--green);
}

.teal {
  color: var(--teal);
}

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

/* ─── Nav ─── */
.site-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(10, 14, 20, 0.95);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text);
}

.nav-logo:hover {
  color: var(--text);
}

.nav-logo img {
  width: 28px;
  height: 28px;
  border-radius: 4px;
}

.nav-brand {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: 0.02em;
}

.nav-links {
  display: flex;
  gap: 1.5rem;
  align-items: center;
}

.nav-links a {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8rem;
  color: var(--text-muted);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  transition: color 0.2s;
}

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

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  transition: transform 0.2s, opacity 0.2s;
}

.nav-toggle[aria-expanded="true"] span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.nav-toggle[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}

.nav-toggle[aria-expanded="true"] span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

/* ─── Hero ─── */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background: url('assets/hero-bg.webp') center/cover no-repeat;
  opacity: 0.25;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(10, 14, 20, 0.6) 0%,
    rgba(10, 14, 20, 0.3) 40%,
    rgba(10, 14, 20, 0.7) 100%
  );
}

.hero-scanlines {
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 255, 136, 0.015) 2px,
    rgba(0, 255, 136, 0.015) 4px
  );
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 2rem 1.5rem;
}

.hero-prompt {
  font-family: 'JetBrains Mono', monospace;
  font-size: 2rem;
  color: var(--green);
  opacity: 0.5;
  margin-bottom: 1rem;
  animation: blink 1.2s step-end infinite;
}

@keyframes blink {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 0.1; }
}

.hero-title {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
  font-size: clamp(2.5rem, 8vw, 5rem);
  color: #c0c0c0;
  letter-spacing: 0.02em;
  line-height: 1.1;
  margin-bottom: 0.5rem;
}

.hero-tagline {
  font-family: 'JetBrains Mono', monospace;
  font-size: clamp(0.8rem, 2vw, 1rem);
  color: var(--green);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  opacity: 0.7;
  margin-bottom: 1rem;
}

.hero-typing {
  font-family: 'JetBrains Mono', monospace;
  font-size: 1rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
  min-height: 1.6em;
}

.typing-prefix {
  color: var(--green);
}

.typing-cursor {
  animation: cursor-blink 0.8s step-end infinite;
}

@keyframes cursor-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

.hero-desc {
  font-size: 1.05rem;
  color: var(--text-muted);
  line-height: 1.7;
  max-width: 520px;
  margin: 0 auto 2rem;
}

.hero-ctas {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

/* ─── Buttons ─── */
.btn {
  display: inline-block;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  padding: 0.75rem 1.5rem;
  border-radius: 4px;
  border: 2px solid var(--accent);
  cursor: pointer;
  transition: background 0.2s, color 0.2s, box-shadow 0.2s;
  text-decoration: none;
}

.btn-solid {
  background: var(--accent);
  color: var(--bg-primary);
}

.btn-solid:hover {
  background: #e09520;
  color: var(--bg-primary);
  box-shadow: 0 0 20px var(--accent-glow);
}

.btn-outline {
  background: transparent;
  color: var(--accent);
}

.btn-outline:hover {
  background: var(--accent-dim);
  color: var(--accent);
  box-shadow: 0 0 20px var(--accent-glow);
}

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

.section:nth-child(even) {
  background: var(--bg-card);
}

.section-title {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
  font-size: 1.25rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
  margin-bottom: 2rem;
}

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

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

/* ─── About ─── */
.about-text {
  font-size: 1.05rem;
  line-height: 1.8;
  max-width: 700px;
  margin-bottom: 1rem;
}

.about-text.muted {
  font-size: 0.95rem;
  color: var(--text-muted);
}

.about-text a {
  border-bottom: 1px solid var(--teal);
}

/* ─── Topics ─── */
.topics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
}

.topic-badge {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.85rem;
  font-weight: 400;
  color: var(--text);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1rem 1.25rem;
  text-align: center;
  transition: border-color 0.2s, background 0.2s;
}

.topic-badge:hover {
  border-color: var(--accent);
  background: var(--bg-elevated);
}

.topic-icon {
  display: block;
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}

/* ─── Terminal Links ─── */
.terminal-links {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.terminal-link {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.9rem;
  color: var(--text);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.85rem 1.25rem;
  display: block;
  transition: border-color 0.2s, background 0.2s;
}

.terminal-link:hover {
  border-color: var(--teal);
  background: var(--bg-elevated);
  color: var(--text);
}

.terminal-link .prompt {
  color: var(--green);
  margin-right: 0.25rem;
}

/* ─── Footer ─── */
.site-footer {
  padding: 2rem 0 3rem;
  text-align: center;
}

.footer-line {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--green), transparent);
  opacity: 0.3;
  margin-bottom: 2rem;
}

.footer-copy {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

.footer-copy a {
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
}

.footer-copy a:hover {
  color: var(--teal);
}

.footer-prompt {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8rem;
  color: var(--green);
  opacity: 0.3;
}

/* ─── Responsive ─── */
@media (max-width: 768px) {
  .nav-links {
    display: none;
    position: absolute;
    top: 56px;
    left: 0;
    right: 0;
    background: rgba(10, 14, 20, 0.98);
    flex-direction: column;
    padding: 1rem 1.5rem;
    gap: 1rem;
    border-bottom: 1px solid var(--border);
  }

  .nav-links.open {
    display: flex;
  }

  .nav-toggle {
    display: flex;
  }

  .hero-ctas {
    flex-direction: column;
    align-items: center;
  }

  .btn {
    width: 100%;
    max-width: 280px;
    text-align: center;
  }

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

  .section {
    padding: 3.5rem 0;
  }
}

@media (max-width: 400px) {
  .topics-grid {
    grid-template-columns: 1fr;
  }
}

/* ─── Reduced motion ─── */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .hero-prompt,
  .typing-cursor {
    animation: none;
    opacity: 0.5;
  }

  .hero-scanlines {
    display: none;
  }

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

  .btn,
  .terminal-link,
  .topic-badge,
  a {
    transition: none;
  }
}
