/* ============================================================
   BitcoinVN Open Source v2
   Modern Terminal Theme
   ============================================================ */

:root {
  --bg-primary: #0B1222;
  --bg-secondary: #111D2E;
  --bg-terminal: #0A0F1A;
  --bg-surface: #162033;
  --accent-gold: #F0B429;
  --accent-gold-hover: #F7C948;
  --terminal-green: #34D399;
  --text-primary: #D1D5DB;
  --text-secondary: #6B7280;
  --text-heading: #F9FAFB;
  --border-color: #1E2D3D;
  --border-hover: #2D4356;
  --link-color: #F0B429;
  --link-visited: #A78BFA;
  --danger: #EF4444;

  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', 'SF Mono', monospace;

  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;
  --space-3xl: 4rem;

  --container-max: 1100px;
  --container-pad: 1.5rem;
  --radius: 8px;
  --radius-sm: 4px;
}


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

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-sans);
  line-height: 1.75;
  min-height: 100vh;
  overflow-x: hidden;
}

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

a {
  color: var(--link-color);
  text-decoration: none;
  transition: color 0.15s ease;
}

a:visited {
  color: var(--link-visited);
}

a:hover {
  color: var(--accent-gold-hover);
  text-decoration: underline;
}

ul, ol {
  padding-left: var(--space-lg);
}

hr {
  border: none;
  border-top: 1px solid var(--border-color);
  margin: var(--space-xl) 0;
}

/* ============================================================
   Base Elements
   ============================================================ */
::selection {
  background-color: var(--accent-gold);
  color: var(--bg-primary);
}

:focus-visible {
  outline: 2px solid var(--accent-gold);
  outline-offset: 2px;
}

::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--accent-gold);
}

code {
  font-family: var(--font-mono);
  background-color: var(--bg-terminal);
  padding: 0.2em 0.4em;
  border-radius: var(--radius-sm);
  font-size: 0.875em;
  color: var(--accent-gold);
}

pre {
  background-color: var(--bg-terminal);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: var(--space-lg);
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 0.875rem;
  line-height: 1.6;
  margin-bottom: var(--space-lg);
}

pre code {
  background: none;
  padding: 0;
  border-radius: 0;
  font-size: inherit;
  color: inherit;
}

/* ============================================================
   Typography
   ============================================================ */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-mono);
  color: var(--text-heading);
  font-weight: 600;
  line-height: 1.4;
  word-break: break-word;
}

h1 {
  font-size: 2rem;
  margin-bottom: var(--space-lg);
  letter-spacing: -0.02em;
}

h2 {
  font-size: 1.5rem;
  margin-bottom: var(--space-md);
  letter-spacing: -0.01em;
}

h3 {
  font-size: 1.25rem;
  margin-bottom: var(--space-md);
  color: var(--accent-gold);
}

h4 {
  font-size: 1.1rem;
  margin-bottom: var(--space-sm);
}

h5 {
  font-size: 1rem;
  margin-bottom: var(--space-sm);
}

h6 {
  font-size: 0.9rem;
  margin-bottom: var(--space-sm);
  color: var(--text-secondary);
}

p {
  margin-bottom: var(--space-md);
}

strong {
  color: var(--text-heading);
  font-weight: 600;
}

@media (min-width: 768px) {
  h1 { font-size: 2.25rem; }
  h2 { font-size: 1.75rem; }
}

@media (min-width: 1024px) {
  h1 { font-size: 2.5rem; }
}


/* ============================================================
   Layout
   ============================================================ */
.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--container-pad);
}

.site-wrapper {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  max-width: var(--container-max);
  margin: 0 auto;
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
}

.site-content {
  flex: 1;
  padding-top: var(--space-xl);
  padding-bottom: var(--space-3xl);
}

.section {
  margin-bottom: var(--space-3xl);
  scroll-margin-top: 60px;
}

.card-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-lg);
}

@media (min-width: 768px) {
  .card-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}


/* ============================================================
   Header - Terminal Title Bar
   ============================================================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: rgba(30, 45, 61, 0.5);
  backdrop-filter: blur(12px);
  transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

.site-header.is-scrolled {
  background-color: rgba(22, 32, 51, 0.95);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border-color);
  background-color: rgba(10, 15, 26, 0.6);
}

.header-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.header-left .terminal-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.site-logo {
  display: flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  margin-left: 10px;
}

.site-logo:hover {
  text-decoration: none;
}

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

.logo-tilde {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-secondary);
  flex-shrink: 0;
  transition: color 0.15s ease;
}

.site-logo:hover .logo-tilde {
  color: var(--text-heading);
}

.logo-text {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: color 0.15s ease;
}

.header-right {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
}

.nav-links {
  display: none;
  list-style: none;
  padding: 0;
  margin: 0;
  gap: var(--space-xs);
}

@media (min-width: 768px) {
  .nav-links {
    display: flex;
  }
}

.nav-links li {
  list-style: none;
}

.nav-links a {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.15s ease, background-color 0.15s ease;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
}

.nav-links a:visited {
  color: var(--text-secondary);
}

.nav-links a:hover {
  color: var(--text-heading);
  background-color: rgba(255, 255, 255, 0.05);
  text-decoration: none;
}

.nav-links a.active {
  color: var(--accent-gold);
  background-color: rgba(240, 180, 41, 0.08);
}

/* Mobile nav toggle */
.nav-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 1.2rem;
  cursor: pointer;
  width: 36px;
  height: 36px;
  transition: border-color 0.15s ease;
}

.nav-toggle:hover {
  border-color: var(--accent-gold);
}

@media (min-width: 768px) {
  .nav-toggle {
    display: none;
  }
}

/* Mobile nav dropdown */
.nav-mobile {
  display: none;
  padding: var(--space-sm) 16px var(--space-md);
  border-top: 1px solid var(--border-color);
  max-width: var(--container-max);
  margin: 0 auto;
}

.nav-mobile.is-open {
  display: block;
}

.nav-mobile ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.nav-mobile li {
  list-style: none;
}

.nav-mobile a {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text-primary);
  text-decoration: none;
  padding: var(--space-sm) 0;
  border-bottom: 1px solid var(--border-color);
  transition: color 0.15s ease;
}

.nav-mobile a:visited {
  color: var(--text-primary);
}

.nav-mobile a:hover {
  color: var(--accent-gold);
  text-decoration: none;
}

@media (min-width: 768px) {
  .nav-mobile {
    display: none !important;
  }
}


/* ============================================================
   Footer
   ============================================================ */
.site-footer {
  background-color: var(--bg-terminal);
  border-top: 1px solid var(--border-color);
  padding: var(--space-3xl) 0 var(--space-xl);
  margin-top: auto;
}

.site-footer .container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-lg);
  text-align: center;
}

.footer-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-sm);
}

.footer-logo {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  text-decoration: none;
  font-family: var(--font-mono);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-heading);
  transition: color 0.15s ease;
}

.footer-logo:visited {
  color: var(--text-heading);
}

.footer-logo:hover {
  color: var(--accent-gold);
  text-decoration: none;
}

.footer-logo-img {
  width: 28px;
  height: 28px;
}

.footer-tagline {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin: 0;
}

.footer-nav ul {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-sm) var(--space-lg);
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-nav a {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.15s ease;
}

.footer-nav a:visited {
  color: var(--text-secondary);
}

.footer-nav a:hover {
  color: var(--accent-gold);
  text-decoration: none;
}

.footer-social {
  display: flex;
  gap: var(--space-lg);
}

.footer-social a {
  color: var(--text-secondary);
  transition: color 0.15s ease;
  display: flex;
  align-items: center;
}

.footer-social a:visited {
  color: var(--text-secondary);
}

.footer-social a:hover {
  color: var(--accent-gold);
}

.footer-copyright {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin: 0;
  padding-top: var(--space-md);
  border-top: 1px solid var(--border-color);
  width: 100%;
  text-align: center;
}


/* ============================================================
   Hero Section
   ============================================================ */
.hero {
  min-height: calc(100dvh - 45px);
  display: flex;
  padding: 0;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero > .container {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
  z-index: 1;
  padding-top: var(--space-xl);
  padding-bottom: var(--space-lg);
}

/* Animated floating orbs - large glowing blobs */
.hero::before {
  content: "";
  position: absolute;
  width: 800px;
  height: 800px;
  top: -20%;
  left: -15%;
  background: radial-gradient(circle, rgba(240, 180, 41, 0.25) 0%, rgba(240, 180, 41, 0.08) 40%, transparent 70%);
  border-radius: 50%;
  animation: orbFloat1 12s ease-in-out infinite;
  pointer-events: none;
  will-change: transform, opacity;
}

.hero::after {
  content: "";
  position: absolute;
  width: 700px;
  height: 700px;
  bottom: -15%;
  right: -15%;
  background: radial-gradient(circle, rgba(52, 211, 153, 0.2) 0%, rgba(52, 211, 153, 0.06) 40%, transparent 70%);
  border-radius: 50%;
  animation: orbFloat2 15s ease-in-out infinite;
  pointer-events: none;
  will-change: transform, opacity;
}

/* Multi-layer background: scanlines + orb */
.hero {
  background:
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent 3px,
      rgba(0, 0, 0, 0.1) 3px,
      rgba(0, 0, 0, 0.1) 4px
    ),
    radial-gradient(ellipse 50% 50% at 75% 15%, rgba(167, 139, 250, 0.1) 0%, transparent 60%);
}

/* Grid overlay on container */
.hero > .container::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image:
    linear-gradient(rgba(30, 58, 82, 0.25) 1px, transparent 1px),
    linear-gradient(90deg, rgba(30, 58, 82, 0.25) 1px, transparent 1px);
  background-size: 50px 50px;
  mask-image: radial-gradient(ellipse 80% 70% at 50% 50%, black 5%, transparent 55%);
  -webkit-mask-image: radial-gradient(ellipse 80% 70% at 50% 50%, black 5%, transparent 55%);
  pointer-events: none;
  z-index: -1;
  will-change: opacity;
  animation: gridPulse 6s ease-in-out infinite alternate;
}

/* Scattered star-like particles */
.hero > .container::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image:
    radial-gradient(2px 2px at 10% 15%, rgba(241, 196, 15, 0.7) 50%, transparent 50%),
    radial-gradient(1.5px 1.5px at 25% 70%, rgba(52, 211, 153, 0.6) 50%, transparent 50%),
    radial-gradient(2px 2px at 45% 25%, rgba(209, 213, 219, 0.5) 50%, transparent 50%),
    radial-gradient(2px 2px at 70% 10%, rgba(167, 139, 250, 0.6) 50%, transparent 50%),
    radial-gradient(2.5px 2.5px at 58% 50%, rgba(240, 180, 41, 0.7) 50%, transparent 50%),
    radial-gradient(1.5px 1.5px at 85% 55%, rgba(52, 211, 153, 0.6) 50%, transparent 50%),
    radial-gradient(2px 2px at 30% 85%, rgba(167, 139, 250, 0.5) 50%, transparent 50%),
    radial-gradient(2px 2px at 92% 85%, rgba(241, 196, 15, 0.6) 50%, transparent 50%);
  pointer-events: none;
  z-index: -1;
  animation: starTwinkle 4s ease-in-out infinite alternate;
}

/* Terminal dots (shared between header and other uses) */
.terminal-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.terminal-dot--red { background-color: #FF5F57; }
.terminal-dot--yellow { background-color: #FFBD2E; }
.terminal-dot--green { background-color: #28CA42; }

/* Hero content (no box) */
.hero-terminal {
  max-width: 820px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
  animation: fadeInUp 0.8s ease-out;
}

.terminal-content {
  padding: 0 var(--space-md);
}

.hero-ascii-row {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-md);
}

.hero-ascii {
  font-family: var(--font-mono);
  font-size: 0.45rem;
  color: var(--accent-gold);
  line-height: 1.2;
  display: block;
  text-align: left;
  border: none;
  background: none;
  margin: 0;
  white-space: pre;
  overflow-x: auto;
  opacity: 0.9;
}

.hero-ascii--logo {
  font-size: 0.22rem;
  color: #fbd659;
  text-shadow:
    0 0 8px rgba(251, 214, 89, 0.6),
    0 0 25px rgba(251, 214, 89, 0.25);
  will-change: text-shadow;
  animation: fadeInUp 0.8s ease-out, asciiGlow 4s ease-in-out 1.5s infinite alternate;
}

.hero-ascii--logo .sw {
  color: #ffffff;
  text-shadow: 0 0 8px rgba(255, 255, 255, 0.4);
}

.hero-ascii--text {
  margin: 0;
  text-shadow:
    0 0 6px rgba(251, 214, 89, 0.5),
    0 0 18px rgba(251, 214, 89, 0.2);
  will-change: text-shadow;
  animation: fadeInUp 0.8s ease-out 0.2s both, textGlow 3s ease-in-out 2s infinite alternate;
}

.hero-subtitle {
  font-family: var(--font-mono);
  font-size: 1rem;
  font-weight: 500;
  color: var(--text-heading);
  margin-bottom: var(--space-sm);
  text-align: left;
}

.hero-output {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: var(--text-secondary);
  text-align: left;
  line-height: 1.6;
  margin: 0;
  padding-left: var(--space-lg);
  border-left: 2px solid var(--border-color);
}

@media (min-width: 480px) {
  .hero-ascii--text {
    font-size: 0.55rem;
  }
  .hero-ascii--logo {
    font-size: 0.28rem;
  }
}

/* Hero CTA hint */
.hero-cta-hint {
  margin-top: var(--space-xl);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-secondary);
  animation: fadeInUp 1.2s ease-out, gentlePulse 3s ease-in-out 2s infinite;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
}

.hero-cta-hint .hint-desktop {
  display: none;
}

.hero-cta-hint .hint-mobile {
  display: inline;
}

.hero-cta-hint kbd {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  padding: 2px 8px;
  border: 1px solid var(--border-hover);
  border-radius: 4px;
  background: rgba(30, 45, 61, 0.5);
  color: var(--text-primary);
  line-height: 1.4;
}

.hero-cta-hint .hint-arrow {
  display: inline-block;
  animation: bounceDown 1.5s ease-in-out infinite;
}

@media (min-width: 768px) {
  .hero > .container {
    padding-top: var(--space-2xl);
    padding-bottom: var(--space-xl);
  }
  .hero-ascii-row {
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
  }
  .hero-ascii--text {
    font-size: 0.62rem;
  }
  .hero-ascii--logo {
    font-size: 0.32rem;
  }
  .terminal-content {
    padding: 0 var(--space-xl);
  }
  .hero-subtitle {
    font-size: 1.1rem;
  }
  .hero-output {
    font-size: 0.95rem;
  }
  .hero-cta-hint .hint-desktop {
    display: inline;
  }
  .hero-cta-hint .hint-mobile {
    display: none;
  }
}

@media (min-width: 1024px) {
  .hero-ascii-row {
    gap: var(--space-md);
  }
  .hero-ascii--text {
    font-size: 0.75rem;
  }
  .hero-ascii--logo {
    font-size: 0.38rem;
  }
}


/* ============================================================
   Stats Bar
   ============================================================ */
.stats-bar {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  margin-top: var(--space-lg);
  padding-top: var(--space-md);
  border-top: 1px solid var(--border-color);
  gap: var(--space-sm) var(--space-lg);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text-secondary);
  text-align: center;
}

.stat-item {
  white-space: nowrap;
}

.stat-value {
  color: var(--terminal-green);
  font-weight: 700;
}

.stat-divider {
  color: var(--border-color);
}

@media (min-width: 768px) {
  .stats-bar {
    font-size: 0.9rem;
  }
}


/* ============================================================
   Section Heading
   ============================================================ */
.section-heading {
  font-family: var(--font-mono);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-heading);
  margin-bottom: var(--space-xl);
  letter-spacing: -0.01em;
}

.section-heading .text-green {
  color: var(--terminal-green);
  font-weight: 400;
}

@media (min-width: 768px) {
  .section-heading {
    font-size: 1.25rem;
  }
}


/* ============================================================
   Project Cards - Terminal Style
   ============================================================ */
/* Scroll-reveal: hidden state */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

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

.project-card {
  background-color: var(--bg-terminal);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, opacity 0.6s ease, transform 0.6s ease;
  display: flex;
  flex-direction: column;
}

.project-card:hover {
  border-color: var(--border-hover);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

/* Header bar - like a tab/file bar */
.project-header {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 8px 14px;
  background-color: rgba(30, 45, 61, 0.4);
  border-bottom: 1px solid var(--border-color);
  font-family: var(--font-mono);
  font-size: 0.75rem;
}

.project-index {
  color: var(--text-secondary);
  opacity: 0.5;
  min-width: 1.2em;
}

.project-name {
  color: var(--accent-gold);
  font-weight: 500;
}

.project-badge {
  margin-left: auto;
  font-size: 0.65rem;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  white-space: nowrap;
}

.project-badge--sponsor {
  color: var(--accent-gold);
  background-color: rgba(240, 180, 41, 0.1);
  border: 1px solid rgba(240, 180, 41, 0.25);
}

.project-badge--translation {
  color: var(--terminal-green);
  background-color: rgba(52, 211, 153, 0.1);
  border: 1px solid rgba(52, 211, 153, 0.25);
}

/* Body - clickable link, hover effect only on title */
.project-body {
  display: flex;
  align-items: flex-start;
  gap: var(--space-md);
  padding: var(--space-md) var(--space-lg);
  flex: 1;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
}

.project-body:visited {
  color: inherit;
}

.project-body:hover {
  text-decoration: none;
}

.project-logo-wrap {
  position: relative;
  flex-shrink: 0;
  width: 96px;
  height: 96px;
}

.project-logo {
  width: 96px;
  height: 96px;
  border-radius: var(--radius);
  object-fit: cover;
  flex-shrink: 0;
  background: var(--bg-secondary);
  padding: var(--space-xs);
  image-rendering: pixelated;
  image-rendering: -moz-crisp-edges;
  image-rendering: crisp-edges;
  filter: contrast(1.3) saturate(1.4) brightness(0.95);
  border: 3px solid var(--border-color);
  box-shadow:
    0 0 0 2px var(--bg-primary),
    0 0 0 4px var(--border-color),
    inset 0 0 15px rgba(0, 0, 0, 0.3);
  transition: filter 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
}

.project-body:hover .project-logo {
  filter: contrast(1.4) saturate(1.6) brightness(1.05);
  transform: scale(1.05);
  box-shadow:
    0 0 0 2px var(--bg-primary),
    0 0 0 4px var(--accent-gold),
    0 0 20px rgba(240, 180, 41, 0.25),
    inset 0 0 15px rgba(0, 0, 0, 0.2);
}

/* CRT scanline overlay on project logo */
.project-logo-wrap::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 96px;
  height: 96px;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 0, 0, 0.1) 2px,
    rgba(0, 0, 0, 0.1) 4px
  );
  pointer-events: none;
  border-radius: var(--radius);
}

.project-title {
  font-family: var(--font-mono);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-heading);
  margin-bottom: var(--space-sm);
  transition: color 0.15s ease;
}

.project-body:hover .project-title {
  color: var(--accent-gold);
  text-decoration: underline;
}

.project-desc {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.65;
  margin: 0;
}

/* Footer - terminal command links (each is its own <a>) */
.project-footer {
  padding: 0 var(--space-lg) var(--space-md);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.project-link {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-secondary);
  text-decoration: none;
  padding: 3px 0;
  transition: color 0.15s ease;
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.project-link:visited {
  color: var(--text-secondary);
}

.project-link:hover {
  color: var(--text-heading);
  text-decoration: none;
}


/* ============================================================
   Post Page
   ============================================================ */
.post {
  max-width: 720px;
  margin: 0 auto;
}

.post-header {
  margin-bottom: var(--space-2xl);
  padding-bottom: var(--space-lg);
  border-bottom: 1px solid var(--border-color);
}

.post-title {
  font-family: var(--font-mono);
  font-size: 1.75rem;
  font-weight: 600;
  color: var(--text-heading);
  margin-bottom: var(--space-sm);
}

@media (min-width: 768px) {
  .post-title {
    font-size: 2rem;
  }
}

.post-meta {
  font-size: 0.85rem;
  color: var(--text-secondary);
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-md);
  align-items: center;
}

.post-date::before {
  content: "$ ";
  color: var(--terminal-green);
  font-family: var(--font-mono);
}

.post-categories {
  display: flex;
  gap: var(--space-sm);
  flex-wrap: wrap;
}

.post-category {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  padding: 2px 0.5rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  text-decoration: none;
}

.post-category:visited {
  color: var(--text-secondary);
}

/* Two-panel post body: text left, thumbnail right */
.post-body--has-thumb {
  display: flex;
  gap: var(--space-xl);
  align-items: flex-start;
}

.post-body--has-thumb .post-content {
  flex: 1;
  min-width: 0;
}

.post-thumbnail {
  position: relative;
  flex-shrink: 0;
  position: sticky;
  top: 80px;
}

.post-thumbnail-img {
  width: 200px;
  height: 200px;
  object-fit: cover;
  border: 3px solid var(--border-color);
  border-radius: var(--radius);
  background: var(--bg-secondary);
  padding: var(--space-sm);
  image-rendering: pixelated;
  image-rendering: -moz-crisp-edges;
  image-rendering: crisp-edges;
  filter: contrast(1.3) saturate(1.4) brightness(0.95);
  box-shadow:
    0 0 0 2px var(--bg-primary),
    0 0 0 4px var(--border-color),
    inset 0 0 20px rgba(0, 0, 0, 0.3);
  transition: filter 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
}

.post-thumbnail-img:hover {
  filter: contrast(1.4) saturate(1.6) brightness(1.05);
  transform: scale(1.05);
  box-shadow:
    0 0 0 2px var(--bg-primary),
    0 0 0 4px var(--accent-gold),
    0 0 20px rgba(240, 180, 41, 0.25),
    inset 0 0 20px rgba(0, 0, 0, 0.2);
}

/* CRT scanline overlay on thumbnail */
.post-thumbnail::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 200px;
  height: 200px;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 0, 0, 0.1) 2px,
    rgba(0, 0, 0, 0.1) 4px
  );
  pointer-events: none;
  border-radius: var(--radius);
}

/* Stack on mobile */
@media (max-width: 600px) {
  .post-body--has-thumb {
    flex-direction: column;
  }
  .post-thumbnail {
    order: -1;
    align-self: center;
    position: static;
  }
}

.post-content {
  font-size: 1rem;
  line-height: 1.8;
}

.post-content p {
  margin-bottom: var(--space-lg);
}

.post-content ul,
.post-content ol {
  margin-bottom: var(--space-lg);
}

.post-content li {
  margin-bottom: var(--space-sm);
}

.post-content h2 {
  margin-top: var(--space-2xl);
}

.post-content h3 {
  margin-top: var(--space-xl);
}

.post-content img {
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  margin: var(--space-lg) 0;
}

.post-nav {
  margin-top: var(--space-3xl);
  padding-top: var(--space-lg);
  border-top: 1px solid var(--border-color);
}

.post-back-link {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.15s ease;
}

.post-back-link:visited {
  color: var(--text-secondary);
}

.post-back-link:hover {
  color: var(--accent-gold);
  text-decoration: none;
}


/* ============================================================
   Generic Page
   ============================================================ */
.page {
  max-width: 720px;
  margin: 0 auto;
}

.page-header {
  margin-bottom: var(--space-2xl);
  padding-bottom: var(--space-lg);
  border-bottom: 1px solid var(--border-color);
}

.page-title {
  font-family: var(--font-mono);
  font-size: 1.75rem;
  font-weight: 600;
  color: var(--text-heading);
}

@media (min-width: 768px) {
  .page-title {
    font-size: 2rem;
  }
}

.page-content {
  font-size: 1rem;
  line-height: 1.8;
}

.page-content p {
  margin-bottom: var(--space-lg);
}

.page-content ul,
.page-content ol {
  margin-bottom: var(--space-lg);
}

.page-content li {
  margin-bottom: var(--space-sm);
}

.page-content h2 {
  margin-top: var(--space-2xl);
}

.page-content h3 {
  margin-top: var(--space-xl);
}


/* ============================================================
   Archive / Contributions List
   ============================================================ */
.archive-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.archive-item {
  display: flex;
  flex-direction: column;
  padding: var(--space-md) 0;
  border-bottom: 1px solid var(--border-color);
  gap: var(--space-xs);
}

@media (min-width: 768px) {
  .archive-item {
    flex-direction: row;
    align-items: baseline;
    gap: var(--space-lg);
  }
}

.archive-date {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-secondary);
  white-space: nowrap;
  min-width: 100px;
}

.archive-title {
  font-family: var(--font-mono);
  font-size: 1rem;
  font-weight: 500;
}

.archive-title a {
  color: var(--text-heading);
  text-decoration: none;
  transition: color 0.15s ease;
}

.archive-title a:visited {
  color: var(--text-heading);
}

.archive-title a:hover {
  color: var(--accent-gold);
  text-decoration: none;
}

.archive-categories {
  display: flex;
  gap: var(--space-xs);
  flex-wrap: wrap;
}

@media (min-width: 768px) {
  .archive-categories {
    margin-left: auto;
  }
}


/* ============================================================
   404 Error Page
   ============================================================ */
.error-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 60vh;
  padding: var(--space-2xl) var(--container-pad);
}

.error-title {
  font-family: var(--font-mono);
  font-size: 2rem;
  font-weight: 700;
  color: var(--danger);
  margin-bottom: var(--space-md);
}

@media (min-width: 768px) {
  .error-title {
    font-size: 3rem;
  }
}

.error-code {
  font-family: var(--font-mono);
  font-size: 1rem;
  color: var(--text-secondary);
  margin-bottom: var(--space-lg);
}

.error-message {
  font-size: 1.05rem;
  color: var(--text-secondary);
  margin-bottom: var(--space-2xl);
  max-width: 480px;
  line-height: 1.7;
}

.error-action {
  font-family: var(--font-mono);
  font-size: 0.9rem;
}

.error-action a {
  color: var(--terminal-green);
  text-decoration: none;
  transition: color 0.15s ease;
}

.error-action a:visited {
  color: var(--terminal-green);
}

.error-action a:hover {
  color: var(--accent-gold);
  text-decoration: underline;
}


/* ============================================================
   Terminal Effects (subtle, modern)
   ============================================================ */

/* Blinking cursor - thin line style */
.cursor {
  display: inline-block;
  width: 2px;
  height: 1.15em;
  background: var(--terminal-green);
  animation: blink 1.2s step-end infinite;
  vertical-align: text-bottom;
  margin-left: 4px;
  border-radius: 1px;
}

/* Terminal box */
.terminal-box {
  background-color: var(--bg-terminal);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: var(--space-lg);
}

.terminal-header {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--terminal-green);
  margin-bottom: var(--space-md);
  padding-bottom: var(--space-sm);
  border-bottom: 1px solid var(--border-color);
}

.terminal-body {
  font-size: 0.95rem;
  line-height: 1.75;
}


/* ============================================================
   Mission Section
   ============================================================ */
.mission-layout {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-xl);
}

.mission-ascii {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  line-height: 1.3;
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  white-space: pre;
  overflow-x: auto;
  text-align: center;
}

.mission-ascii .ma-box {
  color: var(--border-hover);
}

.mission-ascii .ma-arrow {
  color: var(--terminal-green);
}

.mission-ascii .ma-gold {
  color: var(--accent-gold);
}

.mission-ascii .ma-green {
  color: var(--terminal-green);
}

.mission-ascii .ma-label {
  color: var(--text-heading);
}

.mission-text {
  max-width: 640px;
  font-size: 0.95rem;
  line-height: 1.75;
  text-align: center;
}

.mission-text p {
  margin-bottom: var(--space-md);
}

.mission-cta {
  margin-top: var(--space-lg);
  text-align: center;
}

.mission-cta-link {
  font-family: var(--font-mono);
  font-size: 1.1rem;
  color: var(--text-secondary);
  text-decoration: none;
  padding: var(--space-sm) var(--space-lg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  transition: color 0.15s ease, border-color 0.15s ease;
  display: inline-block;
}

.mission-cta-link:visited {
  color: var(--text-secondary);
}

.mission-cta-link:hover {
  color: var(--text-heading);
  border-color: var(--border-hover);
}

.mission-cta-link:hover .text-muted {
  color: var(--text-heading);
}

@media (min-width: 480px) {
  .mission-ascii {
    font-size: 0.8rem;
  }
}

@media (min-width: 768px) {
  .mission-ascii {
    font-size: 0.95rem;
  }

  .mission-layout {
    gap: var(--space-2xl);
  }
}


/* ============================================================
   Animations
   ============================================================ */
@keyframes blink {
  0%, 49% { opacity: 1; }
  50%, 100% { opacity: 0; }
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes orbFloat1 {
  0%, 100% { transform: translate(0, 0) scale(1); opacity: 0.7; }
  33% { transform: translate(8%, 12%) scale(1.1); opacity: 1; }
  66% { transform: translate(-5%, 5%) scale(0.95); opacity: 0.8; }
}

@keyframes orbFloat2 {
  0%, 100% { transform: translate(0, 0) scale(1); opacity: 0.6; }
  40% { transform: translate(-10%, -8%) scale(1.15); opacity: 1; }
  70% { transform: translate(5%, -3%) scale(0.9); opacity: 0.7; }
}

@keyframes gridPulse {
  0% { opacity: 0.3; }
  100% { opacity: 0.7; }
}

@keyframes starTwinkle {
  0% { opacity: 0.5; }
  50% { opacity: 1; }
  100% { opacity: 0.6; }
}

@keyframes gentlePulse {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 1; }
}

@keyframes bounceDown {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(4px); }
}

@keyframes asciiGlow {
  0% {
    text-shadow:
      0 0 8px rgba(251, 214, 89, 0.5),
      0 0 25px rgba(251, 214, 89, 0.2);
  }
  100% {
    text-shadow:
      0 0 14px rgba(251, 214, 89, 0.8),
      0 0 35px rgba(251, 214, 89, 0.35);
  }
}

@keyframes textGlow {
  0% {
    text-shadow:
      0 0 5px rgba(251, 214, 89, 0.4),
      0 0 16px rgba(251, 214, 89, 0.15);
  }
  100% {
    text-shadow:
      0 0 10px rgba(251, 214, 89, 0.7),
      0 0 25px rgba(251, 214, 89, 0.3);
  }
}


/* ============================================================
   Utility Classes
   ============================================================ */
.text-gold { color: var(--accent-gold); }
.text-green { color: var(--terminal-green); }
.text-muted { color: var(--text-secondary); }
.text-center { text-align: center; }


/* ============================================================
   Responsive - Small Phones
   ============================================================ */
@media (max-width: 479px) {
  .container {
    padding: 0 var(--space-md);
  }

  .site-content {
    padding-top: var(--space-lg);
  }

  .hero-ascii--text {
    font-size: 0.35rem;
  }
  .hero-ascii--logo {
    display: none;
  }

  .hero-subtitle {
    font-size: 1rem;
  }

  .hero-output {
    font-size: 0.95rem;
    line-height: 1.7;
  }

  .stats-bar {
    font-size: 0.85rem;
    flex-direction: column;
    gap: var(--space-sm);
  }

  .stat-divider {
    display: none;
  }

  /* Card readability */
  .project-description {
    font-size: 0.92rem;
    line-height: 1.7;
  }

  .project-link {
    font-size: 0.78rem;
  }

  .project-type-badge {
    font-size: 0.7rem;
  }

  /* Post/article readability */
  .post-content {
    font-size: 1.05rem;
    line-height: 1.85;
  }

  .post-date,
  .post-meta {
    font-size: 0.9rem;
  }

  .post-category {
    font-size: 0.75rem;
  }

  /* Mission readability */
  .mission-text {
    font-size: 1rem;
    line-height: 1.8;
  }

  .mission-cta-link {
    font-size: 1rem;
  }

  /* Nav mobile readability */
  .nav-mobile a {
    font-size: 0.95rem;
  }

  /* Footer readability */
  .footer-tagline {
    font-size: 0.85rem;
  }

  .footer-nav a {
    font-size: 0.85rem;
  }

  .footer-copyright {
    font-size: 0.8rem;
  }
}


/* ============================================================
   Print Styles
   ============================================================ */
@media print {
  .site-header,
  .site-footer,
  .nav-toggle {
    display: none;
  }

  body {
    background: #fff;
    color: #000;
  }

  a {
    color: #000;
    text-decoration: underline;
  }
}

/* Reduce animations for users who prefer it */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Disable heavy hero effects on small screens for performance */
@media (max-width: 479px) {
  .hero::before,
  .hero::after {
    animation: none;
  }
  .hero > .container::before,
  .hero > .container::after {
    display: none;
  }
  .hero-ascii--logo,
  .hero-ascii--text {
    animation: fadeInUp 0.8s ease-out;
    text-shadow: 0 0 8px rgba(251, 214, 89, 0.5);
  }
}
