:root {
  /* Logo-based palette */
  --color-teal-deep: #1a4a4f;
  --color-teal: #2d6b65;
  --color-teal-light: #3d8b7a;
  --color-gold: #e8b931;
  --color-gold-dim: #c99a28;
  --color-cream: #f5f5f0;
  --color-cream-dim: #d0d0c8;

  /* Semantic colors - light default */
  --color-bg: var(--color-cream);
  --color-surface: #ffffff;
  --color-text: var(--color-teal-deep);
  --color-text-muted: #5a7a78;
  --color-accent: var(--color-teal);
  --color-accent-hover: var(--color-teal-light);
  --color-border: #d0d8d0;
  --color-artifact-bg: #e8ece8;

  /* Typography */
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-serif: "Georgia", "Times New Roman", serif;

  /* Spacing */
  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 2rem;
  --space-lg: 4rem;
  --space-xl: 6rem;

  --max-width: 1200px;
  --content-width: 720px;
}

[data-theme="dark"] {
  --color-bg: var(--color-teal-deep);
  --color-surface: #224548;
  --color-text: var(--color-cream);
  --color-text-muted: var(--color-cream-dim);
  --color-accent: var(--color-gold);
  --color-accent-hover: var(--color-gold-dim);
  --color-border: #3a6360;
  --color-artifact-bg: #1a3d40;
}

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

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

body {
  font-family: var(--font-serif);
  background-color: var(--color-bg);
  color: var(--color-text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color 0.3s ease, color 0.3s ease;
  overflow-x: hidden;
}

/* Prevent iOS Safari from adding extra scroll space */
html, body {
  max-width: 100%;
}

/* Navigation */
.nav {
  display: flex;
  align-items: center;
  padding: var(--space-sm) var(--space-md);
  gap: var(--space-sm);
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: transparent;
  transition: background 0.3s ease, box-shadow 0.3s ease;
}

.nav.scrolled {
  background: var(--color-bg);
  box-shadow: 0 1px 8px rgba(0, 0, 0, 0.1);
}

.nav-logo {
  height: 40px;
  width: auto;
  object-fit: contain;
  transition: transform 0.3s ease;
}

.nav-logo:hover {
  transform: scale(1.05);
}

html:not([data-theme="dark"]) .nav.scrolled .nav-logo {
  filter: drop-shadow(0 0 3px rgba(0, 0, 0, 0.6));
}

.theme-toggle {
  background: transparent;
  border: none;
  padding: 0.25rem 0.5rem;
  font-size: 0.625rem;
  font-family: var(--font-sans);
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  cursor: pointer;
  transition: color 0.2s ease;
}

.theme-toggle:hover {
  color: var(--color-accent);
}

/* Hero */
.hero {
  min-height: 90vh;
  padding-top: 60px;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background-color: #1a3a4a;
  background-image: url('Lightening Pine Hero v1.png');
  background-position: center 35%;
  background-size: cover;
  background-repeat: no-repeat;
  background-attachment: fixed;
  z-index: 0;
}

.hero-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(26, 58, 74, 0.55) 0%,
    rgba(26, 58, 74, 0.45) 40%,
    rgba(26, 58, 74, 0.35) 60%,
    rgba(245, 245, 240, 0.6) 85%,
    rgba(245, 245, 240, 0.85) 100%
  );
}

[data-theme="dark"] .hero-bg::after {
  background: linear-gradient(
    to bottom,
    rgba(26, 74, 79, 0.35) 0%,
    rgba(26, 74, 79, 0.5) 50%,
    rgba(26, 74, 79, 0.9) 85%,
    rgba(26, 74, 79, 1.0) 100%
  );
}

.hero-content {
  max-width: var(--max-width);
  margin-top: auto;
  margin-left: auto;
  margin-right: auto;
  padding: 0 var(--space-md) var(--space-xl);
  padding-bottom: 8vh;
  position: relative;
  z-index: 2;
  width: 100%;
}

.hero-title {
  font-family: var(--font-sans);
  font-size: clamp(3rem, 12vw, 8rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 0.95;
  margin-bottom: var(--space-sm);
  text-shadow: 0 2px 12px rgba(245, 245, 240, 0.6);
}

[data-theme="dark"] .hero-title {
  text-shadow: 0 2px 16px rgba(245, 245, 240, 0.3);
}

.hero-title .wire {
  color: var(--color-gold);
  display: inline-block;
  position: relative;
}

.hero-title .wire::after {
  content: '';
  position: absolute;
  bottom: 0.1em;
  left: 0;
  width: 100%;
  height: 3px;
  background: var(--color-gold);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.4s ease;
}

.hero-title:hover .wire::after {
  transform: scaleX(1);
  transform-origin: left;
}

.hero-subtitle {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-style: italic;
  color: var(--color-gold);
  max-width: 500px;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .hero-subtitle {
  color: var(--color-text-muted);
  text-shadow: 0 1px 12px rgba(245, 245, 240, 0.25);
}

/* Section Styles */
section {
  padding: var(--space-xl) var(--space-md);
  max-width: var(--max-width);
  margin: 0 auto;
}

section h2 {
  font-family: var(--font-sans);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--color-accent);
  margin-bottom: var(--space-lg);
  display: flex;
  align-items: center;
  gap: 1rem;
}

section h2::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(to right, var(--color-accent), transparent);
}

/* Manifesto */
.manifesto {
  border-bottom: 1px solid var(--color-border);
}

.manifesto-content {
  max-width: var(--content-width);
  margin-left: auto;
  padding-left: var(--space-lg);
  border-left: 2px solid var(--color-gold);
}

.manifesto-content p {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  line-height: 1.7;
  margin-bottom: var(--space-md);
}

.drop-cap {
  font-size: 3.5rem;
  float: left;
  line-height: 1;
  margin-right: 0.5rem;
  margin-top: 0.1rem;
  color: var(--color-gold);
  font-weight: 700;
}

.manifesto-tagline {
  font-family: var(--font-sans);
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-accent);
  margin-top: var(--space-lg);
}

/* Experiments Carousel */
.experiments {
  border-bottom: 1px solid var(--color-border);
}

.experiments-carousel {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  gap: var(--space-sm);
  cursor: grab;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.experiments-carousel::-webkit-scrollbar {
  display: none;
}

.experiments-carousel.dragging {
  cursor: grabbing;
  scroll-snap-type: none;
}

.experiment-card {
  flex: 0 0 300px;
  scroll-snap-align: start;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  padding: var(--space-md);
  position: relative;
  overflow: hidden;
  transition: transform 0.3s ease, border-color 0.3s ease;
}

.experiment-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 3px;
  height: 0;
  background: var(--color-gold);
  transition: height 0.3s ease;
}

.experiment-card:hover {
  transform: translateY(-4px);
  border-color: var(--color-accent);
}

.experiment-card:hover::before {
  height: 100%;
}

.experiment-icon {
  width: 48px;
  height: 48px;
  margin-bottom: var(--space-sm);
  transition: transform 0.4s ease, filter 0.4s ease;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

.experiment-card:hover .experiment-icon {
  transform: translateY(-4px) rotate(3deg);
  filter: drop-shadow(0 6px 12px rgba(0, 0, 0, 0.3));
}

@keyframes iconPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.85; }
}

.experiment-card:hover .experiment-icon {
  animation: iconPulse 2s ease-in-out infinite;
}

.experiment-card h3 {
  font-family: var(--font-sans);
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: var(--space-xs);
  color: var(--color-text);
}

.experiment-card p {
  font-family: var(--font-serif);
  font-size: 0.9375rem;
  color: var(--color-text-muted);
  line-height: 1.6;
}

/* ============================================
   API EXPLORER — carousel entry card
   ============================================ */

.api-explorer-bar {
  display: flex;
  gap: 3px;
  margin-bottom: var(--space-sm);
}

.api-explorer-bar span {
  flex: 1;
  height: 3px;
  border-radius: 1px;
}

/* ============================================
   API EXPLORER CARDS
   ============================================ */

.api-card {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.api-card-tag {
  font-family: var(--font-sans);
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  opacity: 0.45;
  margin-bottom: -0.2rem;
}

.api-card h3 {
  margin-bottom: 0;
}

.api-card-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 0;
  min-height: 90px;
}

.api-card-body p {
  font-family: var(--font-sans);
  font-size: 0.8125rem;
  color: var(--color-text);
}

.api-card-stat {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 0.22rem 0;
  border-bottom: 1px solid var(--color-border);
}

.api-card-stat:last-child {
  border-bottom: none;
}

.api-card-stat-label {
  font-family: var(--font-sans);
  font-size: 0.65rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-text-muted);
}

.api-card-stat-value {
  font-family: var(--font-sans);
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--color-text);
}

.api-card-img {
  width: 100%;
  height: 110px;
  object-fit: cover;
  border-radius: 2px;
  display: block;
}

.api-card-title-sm {
  font-family: var(--font-sans);
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.35;
  margin-top: 0.4rem;
}

.api-card-sub {
  font-family: var(--font-sans);
  font-size: 0.65rem;
  color: var(--color-text-muted);
  margin-top: 0.15rem;
}

.api-temp-big {
  font-family: var(--font-sans);
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1;
  margin-bottom: 0.5rem;
}

.api-temp-big span {
  font-size: 0.9rem;
  font-weight: 400;
  color: var(--color-text-muted);
}

.api-trivia-question {
  font-family: var(--font-sans);
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1.4;
  margin-bottom: 0.5rem;
}

.api-trivia-cat {
  font-family: var(--font-sans);
  font-size: 0.65rem;
  color: var(--color-text-muted);
  margin-bottom: 0.35rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.api-trivia-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.3rem;
}

.api-trivia-option {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  padding: 0.3rem 0.4rem;
  font-size: 0.68rem;
  font-family: var(--font-sans);
  cursor: pointer;
  text-align: left;
  color: var(--color-text);
  transition: border-color 0.15s;
  border-radius: 2px;
  line-height: 1.3;
}

.api-trivia-option:hover:not(:disabled) {
  border-color: var(--color-accent);
}

.api-trivia-option.correct {
  background: #10b981;
  color: #fff;
  border-color: #10b981;
}

.api-trivia-option.incorrect {
  background: #ef4444;
  color: #fff;
  border-color: #ef4444;
}

.api-pokemon-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
}

.api-pokemon-sprite {
  width: 56px;
  height: 56px;
  image-rendering: pixelated;
  flex-shrink: 0;
}

.api-pokemon-name {
  font-family: var(--font-sans);
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.1;
}

.api-pokemon-num {
  font-family: var(--font-sans);
  font-size: 0.65rem;
  color: var(--color-text-muted);
  margin-top: 0.1rem;
}

.api-fact-text {
  font-family: var(--font-serif);
  font-size: 0.875rem;
  font-style: italic;
  line-height: 1.6;
  color: var(--color-text);
}

.api-loading {
  font-family: var(--font-sans);
  font-size: 0.8rem;
  color: var(--color-text-muted);
  font-style: italic;
}

.api-tabs {
  display: flex;
  align-self: flex-start;
  border: 1px solid var(--color-border);
  border-radius: 3px;
  overflow: hidden;
}

.api-tab {
  background: transparent;
  border: none;
  padding: 0.2rem 0.65rem;
  font-family: var(--font-sans);
  font-size: 0.6rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-text-muted);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.api-tab + .api-tab {
  border-left: 1px solid var(--color-border);
}

.api-tab.active {
  background: var(--color-accent);
  color: var(--color-bg);
}

.api-code {
  font-family: "Courier New", monospace;
  font-size: 0.67rem;
  line-height: 1.6;
  background: #0a1a1a;
  color: #6ee7b7;
  padding: 0.75rem;
  overflow-x: auto;
  border-radius: 2px;
  margin: 0;
  white-space: pre;
  flex: 1;
  scrollbar-width: thin;
}

.api-code .code-comment {
  color: #4b6f5e;
}

.api-card-refresh {
  background: transparent;
  border: 1px solid var(--color-border);
  color: var(--color-text-muted);
  font-family: var(--font-sans);
  font-size: 0.7rem;
  padding: 0.3rem 0.7rem;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
  align-self: flex-start;
  margin-top: auto;
  border-radius: 2px;
}

.api-card-refresh:hover {
  border-color: var(--color-accent);
  color: var(--color-accent);
}

/* Color variants — top stripe + gradient tint + hover bar */
.api-card--iss     { border-top: 3px solid #6366f1; background: linear-gradient(160deg, rgba(99,102,241,0.07) 0%, var(--color-surface) 45%); }
.api-card--nasa    { border-top: 3px solid #8b5cf6; background: linear-gradient(160deg, rgba(139,92,246,0.07) 0%, var(--color-surface) 45%); }
.api-card--trivia  { border-top: 3px solid #10b981; background: linear-gradient(160deg, rgba(16,185,129,0.07) 0%, var(--color-surface) 45%); }
.api-card--pokemon { border-top: 3px solid #ef4444; background: linear-gradient(160deg, rgba(239,68,68,0.07) 0%, var(--color-surface) 45%); }
.api-card--weather { border-top: 3px solid #0ea5e9; background: linear-gradient(160deg, rgba(14,165,233,0.07) 0%, var(--color-surface) 45%); }
.api-card--cat     { border-top: 3px solid #f59e0b; background: linear-gradient(160deg, rgba(245,158,11,0.07) 0%, var(--color-surface) 45%); }
.api-card--dog     { border-top: 3px solid #14b8a6; background: linear-gradient(160deg, rgba(20,184,166,0.07) 0%, var(--color-surface) 45%); }
.api-card--wiki    { border-top: 3px solid #64748b; background: linear-gradient(160deg, rgba(100,116,139,0.07) 0%, var(--color-surface) 45%); }

.api-card--iss::before     { background: #6366f1; }
.api-card--nasa::before    { background: #8b5cf6; }
.api-card--trivia::before  { background: #10b981; }
.api-card--pokemon::before { background: #ef4444; }
.api-card--weather::before { background: #0ea5e9; }
.api-card--cat::before     { background: #f59e0b; }
.api-card--dog::before     { background: #14b8a6; }
.api-card--wiki::before    { background: #64748b; }

/* Featured Artifact */
.artifact {
  border-bottom: 1px solid var(--color-border);
}

.artifact-figure {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-md);
}

.artifact-image {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  border: 1px solid var(--color-border);
  border-radius: 4px;
}

.artifact-figure figcaption {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
  max-width: var(--content-width);
}

.artifact-figure figcaption strong {
  font-family: var(--font-sans);
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--color-text);
}

.artifact-figure figcaption span {
  font-family: var(--font-serif);
  font-size: 1rem;
  color: var(--color-text-muted);
  line-height: 1.7;
}

/* Newsletter */
.newsletter {
  border-bottom: 1px solid var(--color-border);
}

.newsletter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--space-sm);
  margin-bottom: var(--space-lg);
}

.newsletter-card {
  display: flex;
  flex-direction: column;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  text-decoration: none;
  color: inherit;
  overflow: hidden;
  transition: transform 0.3s ease, border-color 0.3s ease;
}

.newsletter-card:hover {
  transform: translateY(-4px);
  border-color: var(--color-accent);
}

.newsletter-image {
  width: 100%;
  height: 160px;
  object-fit: cover;
  filter: grayscale(20%);
  transition: filter 0.3s ease;
}

.newsletter-card:hover .newsletter-image {
  filter: grayscale(0%);
}

.newsletter-card-content {
  padding: var(--space-sm);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  flex: 1;
}

.newsletter-date {
  font-family: var(--font-sans);
  font-size: 0.6875rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-accent);
}

.newsletter-title {
  font-family: var(--font-sans);
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.3;
  color: var(--color-text);
}

.newsletter-excerpt {
  font-family: var(--font-serif);
  font-size: 0.875rem;
  color: var(--color-text-muted);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.newsletter-cta {
  display: inline-block;
  font-family: var(--font-sans);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-accent);
  text-decoration: none;
  padding: 0.75rem 1.5rem;
  border: 1px solid var(--color-accent);
  transition: all 0.2s ease;
}

.newsletter-cta:hover {
  background: var(--color-accent);
  color: var(--color-bg);
}

.newsletter-loading,
.newsletter-error {
  font-family: var(--font-sans);
  font-size: 0.875rem;
  color: var(--color-text-muted);
  padding: var(--space-md);
}

.newsletter-error a {
  color: var(--color-accent);
}

/* Skeleton loading */
.skeleton-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  padding: var(--space-sm);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.skeleton-image {
  height: 140px;
  background: linear-gradient(90deg, var(--color-border) 25%, var(--color-surface) 50%, var(--color-border) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 2px;
}

.skeleton-text {
  height: 1rem;
  background: linear-gradient(90deg, var(--color-border) 25%, var(--color-surface) 50%, var(--color-border) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 2px;
}

.skeleton-text.short {
  width: 60%;
  height: 0.75rem;
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Footer */
.footer {
  background: var(--color-teal-deep);
  color: var(--color-cream);
  padding: var(--space-sm) var(--space-md);
  border-top: 2px solid var(--color-gold);
}

[data-theme="dark"] .footer {
  background: var(--color-teal-deep);
  color: var(--color-cream);
}

.footer-content {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-md);
}

.footer-left {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.footer-logo {
  height: 40px;
  width: auto;
  display: block;
}

.footer-links {
  display: flex;
  gap: var(--space-md);
}

.footer-links a {
  color: var(--color-gold);
  text-decoration: none;
  font-family: var(--font-sans);
  font-size: 0.875rem;
  font-weight: 500;
  transition: opacity 0.2s ease;
}

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

.footer-copyright {
  font-family: var(--font-sans);
  font-size: 0.75rem;
  opacity: 0.6;
}

/* Responsive */
/* Tablet (portrait and landscape) - adjust hero image to show tree/rock */
@media (min-width: 601px) and (max-width: 1400px),
       (max-aspect-ratio: 4/3) {
  .hero-bg {
    background-position: center 65%;
    background-attachment: scroll; /* iOS Safari doesn't handle fixed well */
  }
}


@media (max-width: 768px) {
  :root {
    --space-lg: 3rem;
    --space-xl: 4rem;
  }

  .hero {
    min-height: 70vh;
  }

  .hero-bg {
    background-attachment: scroll;
  }

  .hero::before {
    width: 300px;
    height: 300px;
    right: -30%;
  }

  .manifesto-content {
    margin-left: 0;
    padding-left: var(--space-md);
  }

  .manifesto-content p {
    font-size: 1.25rem;
  }

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

  .newsletter-grid > :nth-child(n+5),
  .desktop-only {
    display: none;
  }

  .footer-content {
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
  }

  .footer-left {
    flex-wrap: wrap;
  }
}

@media (max-width: 480px) {
  :root {
    --space-md: 1.5rem;
    --space-lg: 2rem;
    --space-xl: 3rem;
  }

  .nav-logo {
    height: 36px;
  }


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

  .manifesto-content p {
    font-size: 1.125rem;
  }

  .drop-cap {
    font-size: 2.5rem;
  }

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

@media (min-width: 1024px) {
  .artifact-figure {
    grid-template-columns: 1.2fr 0.8fr;
    align-items: center;
  }
}

/* ============================================
   TERMINAL MODE - 1980 EASTER EGG
   ============================================ */

.terminal-link {
  opacity: 0.4 !important;
  font-size: 0.75rem !important;
}

.terminal-link:hover {
  opacity: 1 !important;
}

.terminal-overlay {
  position: fixed;
  inset: 0;
  background: #000;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.terminal-overlay[hidden] {
  display: none;
}

.terminal-screen {
  width: 100%;
  max-width: 800px;
  height: 100%;
  max-height: 650px;
  background: #0a0a0a;
  border: 2px solid #0f0;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow:
    0 0 20px rgba(0, 255, 0, 0.3),
    inset 0 0 60px rgba(0, 255, 0, 0.05);
}

.terminal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 1rem;
  background: #0f0;
  color: #000;
  font-family: "Courier New", monospace;
  font-size: 0.875rem;
  font-weight: bold;
}

.terminal-btn {
  background: #000;
  color: #0f0;
  border: 1px solid #0f0;
  padding: 0.25rem 0.5rem;
  font-family: "Courier New", monospace;
  font-size: 0.75rem;
  cursor: pointer;
  transition: all 0.15s ease;
}

.terminal-btn:hover {
  background: #0f0;
  color: #000;
}

.terminal-content {
  flex: 1;
  overflow: auto;
  padding: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.terminal-content[hidden] {
  display: none;
}

.ascii-art {
  color: #0f0;
  font-family: "Courier New", monospace;
  font-size: clamp(0.5rem, 1.5vw, 0.875rem);
  line-height: 1.3;
  text-shadow: 0 0 10px rgba(0, 255, 0, 0.7);
  white-space: pre;
  margin: 0;
}

/* CRT Scanline Effect */
.crt-overlay {
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    rgba(0, 0, 0, 0.15),
    rgba(0, 0, 0, 0.15) 1px,
    transparent 1px,
    transparent 2px
  );
  pointer-events: none;
  z-index: 10000;
}

/* Asteroids Game */
.asteroids-game {
  flex: 1;
  width: 100%;
  background: #000;
}

.asteroids-game[hidden] {
  display: none;
}

.asteroids-ui {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 1rem;
  background: #000;
  border-top: 1px solid #0f0;
  color: #0f0;
  font-family: "Courier New", monospace;
  font-size: 0.875rem;
}

.asteroids-ui[hidden] {
  display: none;
}

.asteroids-ui span {
  text-shadow: 0 0 10px rgba(0, 255, 0, 0.7);
}

/* Flicker animation for that authentic CRT feel */
@keyframes flicker {
  0%, 100% { opacity: 1; }
  92% { opacity: 1; }
  93% { opacity: 0.8; }
  94% { opacity: 1; }
}

.terminal-screen {
  animation: flicker 4s infinite;
}

/* Responsive terminal */
@media (max-width: 600px) {
  .ascii-art {
    font-size: 0.45rem;
  }

  .terminal-header {
    font-size: 0.75rem;
  }
}

/* Mobile/Desktop visibility utilities */
.mobile-only {
  display: none;
}

@media (max-width: 768px) {
  .desktop-only {
    display: none;
  }
  .mobile-only {
    display: inline;
  }
}

/* Matrix Rain Transition */
.matrix-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 9999;
  background: #000;
}

.matrix-canvas[hidden] {
  display: none;
}
