/* ===================================================================
   ALIENS — retro terminal / sci-fi landing template
   Standalone clone of the whitehouse.gov/aliens visual design.
   Replace the copy in index.html; the look lives here.
   =================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;700&family=VT323&display=swap');

:root {
  --green: #4ade80;
  --cyan: #22d3ee;
  --cyan-soft: #67e8f9;
  --red: #dc2626;
  --red-dark: #b91c1c;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'VT323', 'Courier New', Courier, monospace;
  -webkit-font-smoothing: never;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: geometricPrecision;
  background: black;
  color: var(--green);
  overflow-x: hidden;
}

/* Green glow — used on titles, counters, nav logo */
.neon-cyan {
  color: var(--green);
  text-shadow: 0 0 10px var(--cyan), 0 0 20px var(--cyan), 0 0 40px var(--cyan);
}

@supports (background: -webkit-named-image(i)) {
  .neon-cyan {
    text-shadow:
      0 0 10px rgba(34, 211, 238, 0.7),
      0 0 20px rgba(34, 211, 238, 0.55),
      0 0 40px rgba(34, 211, 238, 0.4);
  }
}

/* Scroll-reveal — JS toggles .visible */
.section {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 1s ease, transform 1s ease;
}
.section.visible { opacity: 1; transform: translateY(0); }

/* Starfield canvas */
.aliens-star-canvas canvas { position: fixed; top: 0; left: 0; z-index: -1; }

/* UFO */
.aliens-ufo {
  position: absolute;
  top: 8rem;
  right: 2rem;
  font-size: 4.5rem;
  animation: aliens-ufo-float 25s linear infinite;
  pointer-events: none;
}
@media (min-width: 768px) { .aliens-ufo { right: 5rem; font-size: 6rem; } }
@keyframes aliens-ufo-float {
  0%   { transform: translateX(-200px) rotate(-10deg); }
  100% { transform: translateX(calc(100vw + 200px)) rotate(10deg); }
}

/* Typewriter — JS adds these classes per paragraph */
.typewriter {
  overflow: hidden;
  white-space: normal;
  letter-spacing: normal;
}
.typewriter-start::after {
  content: '';
  border-right: 0.18em solid var(--cyan);
  animation: aliens-blink 1s step-end infinite;
}
.typewriter-done::after { border-right: none; }
@keyframes aliens-blink {
  from, to { border-color: transparent; }
  50%      { border-color: var(--cyan); }
}

/* rest-of-page — JS sets opacity:1 after the typewriter finishes */
#rest-of-page { opacity: 0; transition: opacity 1.2s ease; }

/* ── Nav ─────────────────────────────────────────────── */
.aliens-nav {
  position: fixed;
  top: 0;
  width: 100%;
  z-index: 50;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(34, 211, 238, 0.3);
}
.aliens-nav-inner {
  max-width: 80rem;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 2rem;
}
.aliens-nav-logo { font-size: 1.875rem; font-weight: 700; letter-spacing: 0.15em; }
.aliens-nav-tagline { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 4px; }

@media (max-width: 768px) {
  .aliens-nav-tagline { text-align: right; padding: 0.5rem 0 0 0.75rem; }
}

/* ── Hero ────────────────────────────────────────────── */
.aliens-hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-top: 6rem;
  padding-bottom: 8rem;
  position: relative;
}
.aliens-hero-inner { max-width: 64rem; padding: 0 1.5rem; text-align: center; }
.aliens-hero-title {
  font-size: clamp(3.75rem, 10vw, 8rem);
  font-weight: 700;
  letter-spacing: 0.3em;
  margin-bottom: 5rem;
}
.aliens-typewriter-block {
  display: flex;
  flex-direction: column;
  gap: 3rem;
  font-size: clamp(1.5rem, 3vw, 2.25rem);
  line-height: 2;
  max-width: 56rem;
  margin: 0 auto;
}
.aliens-hero-kicker { font-size: clamp(2.25rem, 4vw, 3rem); font-weight: 700; margin-top: 2rem; }

@media screen and (max-width: 768px) {
  .aliens-hero-title { font-size: 2.5rem; letter-spacing: 0.5em; line-height: 1.5; }
  .aliens-typewriter-block { font-size: 1.25rem; gap: 0; }
  .aliens-hero-kicker { font-size: 1.75rem; }
  .aliens-hero { padding-bottom: 0; }
}

/* ── Clearance / scroll-hint section ─────────────────── */
.aliens-map-section {
  padding: 6rem 0;
  background: rgba(0, 0, 0, 0.9);
  border-top: 1px solid rgba(34, 211, 238, 0.3);
  border-bottom: 1px solid rgba(34, 211, 238, 0.3);
}
.aliens-map-inner { max-width: 72rem; margin: 0 auto; padding: 0 1.5rem; }
.aliens-map-label-wrap { text-align: center; margin-bottom: 2rem; }
.aliens-clearance-badge {
  display: inline-block;
  padding: 0.75rem 2rem;
  background: rgba(220, 38, 38, 0.2);
  color: var(--green);
  font-size: 1rem;
  letter-spacing: 0.15em;
  border: 1px solid #ef4444;
}
.aliens-scroll-hint { text-align: center; margin-top: 2rem; color: rgba(103, 232, 249, 0.7); font-size: 1.125rem; }

.aliens-map-title {
  font-family: 'VT323', 'Courier New', Courier, monospace;
  font-size: clamp(2rem, 5vw, 3.75rem);
  text-align: center;
  margin-bottom: 3rem;
}
@media (max-width: 768px) {
  .aliens-map-title { font-size: 1.5rem; padding: 0 1em; }
}

/* ── Metrics (count-up) ──────────────────────────────── */
.aliens-metrics-section { padding: 6rem 0; }
.aliens-metrics-grid {
  max-width: 72rem;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 3rem;
}
@media (min-width: 768px) { .aliens-metrics-grid { grid-template-columns: repeat(4, 1fr); } }
.aliens-metric { text-align: center; }
.aliens-metric-count { font-size: clamp(3.5rem, 7vw, 5rem); font-weight: 700; }
.aliens-metric-label { font-size: 1.5rem; margin-top: 1rem; letter-spacing: 0.15em; }

/* ── Reveal section ──────────────────────────────────── */
.aliens-reveal-section { padding: 6rem 1.5rem; text-align: center; }
.aliens-reveal-inner { max-width: 56rem; margin: 0 auto; }
.aliens-reveal-intro {
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1.3;
  margin-bottom: 4rem;
  color: var(--green);
}
.aliens-green-highlight { color: var(--green); }
@media (max-width: 768px) {
  .aliens-reveal-intro { font-size: 1.5rem; }
}

/* CTA button */
.aliens-cta-wrap { display: flex; justify-content: center; }
.aliens-cta-button {
  display: inline-block;
  background-color: var(--red);
  color: #fff;
  font-family: inherit;
  font-size: 1.875rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  padding: 2rem 4rem;
  border-radius: 0;
  text-decoration: none;
  transition: background-color 0.2s ease, transform 0.2s ease;
}
.aliens-cta-button:hover {
  background-color: var(--red-dark);
  transform: scale(1.1);
}
@media (max-width: 768px) {
  .aliens-cta-button { font-size: 1.5rem; padding: 2rem; }
}

/* Classified addendum box */
.aliens-addendum-box {
  margin-top: 6rem;
  padding: 2.5rem;
  border: 1px solid rgba(239, 68, 68, 0.5);
  background: rgba(69, 10, 10, 0.3);
  border-radius: 1.5rem;
}
.aliens-addendum-label { color: #f87171; font-size: 1rem; letter-spacing: 8px; margin-bottom: 1.5rem; }
.aliens-reveal-headline {
  font-size: clamp(2.5rem, 6vw, 3.75rem);
  font-weight: 700;
  color: var(--green);
  line-height: 1;
  font-family: inherit;
  margin: 0;
}
.aliens-yellow-warning { margin-top: 2rem; font-size: clamp(1.875rem, 3vw, 2.25rem); color: var(--green); }
.aliens-closing-text { margin-top: 2.5rem; font-size: 1.5rem; color: var(--green); }

@media (max-width: 768px) {
  .aliens-reveal-headline { font-size: 2rem; }
  .aliens-yellow-warning, .aliens-closing-text { font-size: 1.25rem; }
  .aliens-addendum-box { padding: 1.25rem; }
}

/* ── Email signup ────────────────────────────────────── */
.email-form { padding: 4rem 1.5rem; text-align: center; }
.email-form h3 {
  font-family: 'VT323', 'Courier New', Courier, monospace;
  color: var(--green);
  font-size: clamp(1.5rem, 3vw, 2rem);
  margin-bottom: 2rem;
}
.email-form__wrapper { max-width: 28rem; margin: 0 auto 1rem; text-align: left; }
.email-form__label {
  display: block;
  font-family: 'VT323', 'Courier New', Courier, monospace;
  color: var(--green);
  margin-bottom: 0.5rem;
  font-size: 1.25rem;
}
.email-form__required { color: #fff; }
.email-form__input {
  width: 100%;
  padding: 0.6em 0.8em;
  background: black;
  color: var(--green);
  border: 1px solid var(--green);
  font-family: 'VT323', 'Courier New', Courier, monospace;
  font-size: 1.25rem;
}
.email-form__button {
  display: inline-block;
  margin: 0.5rem auto 0;
  padding: 0.6em 2em;
  background-color: transparent;
  color: var(--green);
  border: 1px solid var(--green);
  font-family: 'VT323', 'Courier New', Courier, monospace;
  font-size: 1.25rem;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease;
}
.email-form__button:hover { background: var(--green); color: black; }

/* ── Footer ──────────────────────────────────────────── */
.aliens-footer {
  padding: 4rem 0;
  text-align: center;
  color: var(--green);
  font-size: 0.875rem;
  letter-spacing: 0.15em;
}

/* ===================================================================
   Split-flap counter (the .num-container component)
   =================================================================== */
.num-container {
  position: relative;
  display: flex;
  justify-content: center;
  gap: 20px;
}
.digit {
  position: relative;
  width: 140px;
  height: 200px;
  overflow: hidden;
  border-radius: 5px;
  filter: drop-shadow(0 0 10px #000a);
}
.mark {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  font-size: 90px;
  width: 30px;
  color: #1c1c1c;
}
.static-top,
.static-bottom,
.flip-top,
.flip-bottom {
  position: absolute;
  width: 100%;
  height: 50%;
  overflow: hidden;
  left: 0;
  backface-visibility: hidden;
}
.static-top,
.flip-top { top: 0; transform-origin: bottom; }
.static-bottom,
.flip-bottom { bottom: 0; transform-origin: top; }
.static-top,
.flip-top { background: transparent; border-bottom: 1px solid #333; }
.static-bottom,
.flip-bottom { background: transparent; border-top: 1px solid #000; }
.static-top span,
.flip-top span {
  position: absolute;
  width: 100%;
  height: 200%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 160px;
  color: #eee;
  top: 0;
}
.static-bottom span,
.flip-bottom span {
  position: absolute;
  width: 100%;
  height: 200%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 160px;
  color: #eee;
  top: -100%;
}

@media screen and (max-width: 1200px) {
  .num-container { gap: 10px; }
  .static-bottom span,
  .flip-bottom span,
  .static-top span,
  .flip-top span { font-size: 90px; }
  .mark { width: 20px; font-size: 60px; }
  .digit { width: 80px; height: 120px; }
}
@media screen and (max-width: 500px) {
  .num-container { gap: 5px; }
  .static-bottom span,
  .flip-bottom span,
  .static-top span,
  .flip-top span { font-size: 40px; }
  .mark { width: 16px; font-size: 30px; }
  .digit { width: 40px; height: 70px; }
}

.flip-top {
  animation: flipTop 0.5s linear forwards;
  animation-iteration-count: 1;
  z-index: 5;
}
.flip-bottom {
  animation: flipBottom 0.5s linear forwards;
  animation-iteration-count: 1;
  z-index: 4;
}
.flip-top.fast { animation: flipTop 0.08s linear forwards; }
.flip-bottom.fast { animation: flipBottom 0.08s linear forwards; }

@keyframes flipTop {
  0%   { transform: rotateX(0deg); }
  100% { transform: rotateX(-90deg); }
}
@keyframes flipBottom {
  0%   { transform: rotateX(90deg); }
  100% { transform: rotateX(0deg); }
}

/* Respect reduced-motion preferences */
@media (prefers-reduced-motion: reduce) {
  .aliens-ufo { animation: none; }
  .section { opacity: 1; transform: none; transition: none; }
  #rest-of-page { opacity: 1; }
}
