/* ===== MARKETING + GUIDE PAGES — Terminal chrome over painted world ===== */
@import url('https://fonts.googleapis.com/css2?family=Fira+Mono:wght@400;500;700&display=swap');

:root {
  --neon-cyan: #22d3ee;
  --dark-bg: #020c12;
  --panel-bg: #061821;
  --card-bg: rgba(6, 24, 33, 0.7);
  --border-dim: rgba(34, 211, 238, 0.1);
  --border-med: rgba(34, 211, 238, 0.2);
  --border-bright: rgba(34, 211, 238, 0.5);
  --text-primary: #a5b4fc;
  --text-muted: #64748b;
  --text-neon: #22d3ee;
  --hex-tile-width: 128px;
  --hex-row-overlap: calc(var(--hex-tile-width) * 0.75);
}

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

body {
  font-family: 'Fira Mono', 'Space Mono', monospace;
  background: var(--dark-bg);
  color: var(--text-primary);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* ===== BACKGROUND LAYERS ===== */
.bg-layers {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
}

.bg-layers .bg-gradient {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, #020c12 0%, #041824 50%, #020c12 100%);
}

.bg-layers .bg-glow {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 80% 20%, rgba(34, 211, 238, 0.12), transparent 50%);
  opacity: 0.6;
}

/* ===== SCANLINES (used by siege guide) ===== */
.scanlines {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 50;
  background: linear-gradient(
    to bottom,
    rgba(255,255,255,0),
    rgba(255,255,255,0) 50%,
    rgba(0,0,0,0.04) 50%,
    rgba(0,0,0,0.04)
  );
  background-size: 100% 4px;
}

/* ===== MATRIX RAIN (used by siege guide) ===== */
#matrix {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}

.matrix-col {
  position: absolute;
  top: 0;
  font-size: 14px;
  font-family: 'Fira Mono', monospace;
  color: rgba(34, 211, 238, 0.1);
  writing-mode: vertical-lr;
  animation: matrix-rain linear infinite;
  user-select: none;
  pointer-events: none;
}

@keyframes matrix-rain {
  0% { transform: translateY(-100%); opacity: 1; }
  100% { transform: translateY(100vh); opacity: 0; }
}

/* ===== NAVBAR ===== */
header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(2, 12, 18, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(34, 211, 238, 0.08);
}

.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  height: 60px;
}

.brand-group {
  display: flex;
  align-items: center;
}

.brand-stack {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.brand-row {
  display: flex;
  align-items: flex-end;
  gap: 10px;
}

.brand {
  font-family: 'Fira Mono', monospace;
  font-weight: 700;
  font-size: 1.35rem;
  letter-spacing: 0.08em;
  color: var(--text-neon);
  text-transform: uppercase;
  cursor: default;
  line-height: 1;
}

.brand-version {
  font-size: 12px;
  color: #2a7a96;
  letter-spacing: 0.12em;
  margin-top: 3px;
}

.brand-version .blink {
  color: var(--text-neon);
  animation: blink 1s step-end infinite;
}

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

.nav-links {
  display: flex;
  gap: 12px;
  align-items: center;
}

.nav-links a {
  color: var(--text-primary);
  text-decoration: none;
  font-family: 'Fira Mono', monospace;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  transition: all 0.2s ease;
}

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 16px;
  border-radius: 0;
  border: none;
  font-family: 'Fira Mono', monospace;
  font-weight: 700;
  font-size: 13px;
  text-decoration: none;
  cursor: pointer;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition: all 0.2s ease;
}

.btn-primary,
.btn-primary:visited {
  background: var(--text-neon);
  color: #000;
  box-shadow: 0 0 15px rgba(34, 211, 238, 0.3);
}

.btn-primary:hover {
  background: #67e8f9;
  box-shadow: 0 0 25px rgba(34, 211, 238, 0.5);
}

.btn-secondary,
.btn-secondary:visited {
  background: rgba(34, 211, 238, 0.05);
  color: #0e7490;
  border: 1px solid rgba(34, 211, 238, 0.15);
}

.btn-secondary:hover {
  color: var(--text-neon);
  border-color: rgba(34, 211, 238, 0.4);
  background: rgba(34, 211, 238, 0.08);
}

.btn-prefix {
  color: #155e75;
}

.nav-links a.btn-primary,
.nav-links a.btn-primary:visited {
  color: #000;
}

/* ===== TEXT UTILITIES ===== */
.text-neon {
  color: var(--text-neon);
  text-shadow: 0 0 5px rgba(34, 211, 238, 0.4);
}

/* ===== GLITCH EFFECT (used by siege guide) ===== */
.text-glitch {
  position: relative;
  display: inline-block;
}

.text-glitch::before,
.text-glitch::after {
  content: attr(data-text);
  position: absolute;
  top: -4px;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0.8;
}

.text-glitch::before {
  color: #ff00ff;
  z-index: -1;
  animation: glitch-1 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94) both infinite;
}

.text-glitch::after {
  color: #00ffff;
  z-index: -2;
  animation: glitch-2 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94) both infinite;
}

@keyframes glitch-1 {
  0%   { transform: translate(0); }
  20%  { transform: translate(-2px, 2px); }
  40%  { transform: translate(-2px, -2px); }
  60%  { transform: translate(2px, 2px); }
  80%  { transform: translate(2px, -2px); }
  100% { transform: translate(0); }
}

@keyframes glitch-2 {
  0%   { transform: translate(0); }
  20%  { transform: translate(2px, -2px); }
  40%  { transform: translate(2px, 2px); }
  60%  { transform: translate(-2px, -2px); }
  80%  { transform: translate(-2px, 2px); }
  100% { transform: translate(0); }
}

/* ===== HERO — full-bleed hex world ===== */
.hero {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  display: flex;
  align-items: center;
  min-height: min(82vh, 860px);
  padding: 100px 0;
}

.hero-field {
  position: absolute;
  inset: -220px -120px;
  z-index: -2;
  pointer-events: none;
  animation: field-drift 90s linear infinite alternate;
}

@keyframes field-drift {
  from { transform: translate(0, 0); }
  to { transform: translate(-110px, -60px); }
}

.hex-row { display: flex; }
.hex-row + .hex-row { margin-top: calc(var(--hex-row-overlap) * -1); }
.hex-row.offset { margin-left: calc(var(--hex-tile-width) / 2); }
.hex-tile { width: var(--hex-tile-width); height: auto; display: block; }

.hero-scrim {
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(2, 12, 18, 0.94) 0%, rgba(2, 12, 18, 0.78) 32%, rgba(2, 12, 18, 0.3) 62%, rgba(2, 12, 18, 0.55) 100%),
    linear-gradient(180deg, rgba(2, 12, 18, 0.55) 0%, transparent 25%, transparent 70%, rgba(2, 12, 18, 0.96) 100%);
}

.hero-inner {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

.hero-copy {
  max-width: 620px;
}

.hero-copy h1 {
  font-family: 'JetBrains Mono', 'Fira Mono', monospace;
  font-weight: 800;
  font-size: clamp(2.5rem, 6vw, 4.2rem);
  line-height: 1.02;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-neon);
  text-shadow: 0 0 5px rgba(34, 211, 238, 0.4), 0 4px 30px rgba(0, 0, 0, 0.8);
  margin-bottom: 20px;
}

.hero-copy > p {
  font-size: 1.05rem;
  color: #cbd5e1;
  line-height: 1.7;
  margin-bottom: 28px;
  max-width: 440px;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.8);
}

.btn-hero-cta {
  background: rgba(2, 12, 18, 0.7) !important;
  border: 1px solid #22d3ee !important;
  color: #22d3ee !important;
  padding: 13px 30px;
  font-size: 14px;
  letter-spacing: 0.1em;
  transition: all 0.2s ease;
  box-shadow: 0 0 12px rgba(34, 211, 238, 0.15);
  backdrop-filter: blur(3px);
}

.btn-hero-cta:hover {
  background: rgba(34, 211, 238, 0.18) !important;
  box-shadow: 0 0 20px rgba(34, 211, 238, 0.35) !important;
}

.btn-hero-cta .btn-prefix {
  color: var(--text-neon);
  transition: transform 0.2s ease;
}

.btn-hero-cta:hover .btn-prefix {
  transform: translateX(2px);
}

.hero-meta {
  margin-top: 20px;
  font-size: 12px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: #2a7a96;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.8);
}

/* ===== HERO PROMPT / TAGS (used by siege guide) ===== */
.hero-prompt {
  font-size: 12px;
  color: #155e75;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.hero-prompt .prompt-label { color: #0e7490; }

.hero-prompt .typewriter {
  overflow: hidden;
  white-space: nowrap;
  animation: typewriter 2s steps(40) 0.3s both;
}

@keyframes typewriter {
  from { max-width: 0; }
  to { max-width: 100%; }
}

.hero-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 24px;
}

.tag {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: #0e7490;
  background: rgba(34, 211, 238, 0.04);
  border: 1px solid rgba(34, 211, 238, 0.12);
  padding: 4px 14px;
}

/* ===== TERMINAL WINDOW COMPONENT (used by siege guide) ===== */
.terminal-win {
  background: var(--card-bg);
  backdrop-filter: blur(4px);
  border: 1px solid var(--border-dim);
  border-radius: 0;
  overflow: hidden;
  transition: all 0.3s ease;
}

.terminal-win:hover {
  border-color: var(--border-bright);
  box-shadow: 0 0 20px rgba(34, 211, 238, 0.08);
  transform: translateY(-2px);
}

.tw-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: rgba(4, 18, 24, 0.8);
  border-bottom: 1px solid var(--border-dim);
  user-select: none;
}

.tw-dots { display: flex; gap: 6px; }
.tw-dot { width: 8px; height: 8px; border-radius: 50%; }
.tw-dot--r { background: #ff5f57; }
.tw-dot--y { background: #febc2e; }
.tw-dot--g { background: #28c840; }

.tw-title {
  flex: 1;
  text-align: center;
  font-size: 12px;
  letter-spacing: 0.15em;
  color: #2a7a96;
  text-transform: uppercase;
}

.tw-body { padding: 20px; }

/* ===== SECTIONS ===== */
.section {
  max-width: 1200px;
  margin: 0 auto;
  padding: 80px 24px;
  position: relative;
  border-top: 1px solid rgba(34, 211, 238, 0.06);
}

.section h2 {
  font-family: 'Fira Mono', monospace;
  font-weight: 700;
  font-size: 1.5rem;
  color: var(--text-neon);
  text-shadow: 0 0 5px rgba(34, 211, 238, 0.4);
  margin-bottom: 12px;
}

.section > p {
  font-size: 0.95rem;
  color: #b0bec5;
  margin-bottom: 32px;
  max-width: 700px;
  line-height: 1.7;
}

.section h2.section-label,
h2.section-label {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: #155e75;
  text-shadow: none;
  margin-bottom: 36px;
}

.section-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 40px;
  max-width: 100%;
  overflow: hidden;
}

.section-head > div {
  min-width: 0;
  overflow: hidden;
}

.section-head p {
  color: #94a3b8;
}

.section-head .section-slashes {
  color: #155e75;
  font-size: 14px;
  margin-top: 4px;
  flex-shrink: 0;
}

/* ===== SHOWCASE — art-led zigzag rows ===== */
.showcase-row {
  display: grid;
  grid-template-columns: minmax(220px, 380px) 1fr;
  align-items: center;
  gap: 24px 72px;
  padding: 40px 0;
}

.showcase-row + .showcase-row {
  border-top: 1px solid rgba(34, 211, 238, 0.06);
}

.showcase-row:nth-child(even) .showcase-art { order: 2; }
.showcase-row:nth-child(even) .showcase-copy { order: 1; text-align: right; }
.showcase-row:nth-child(even) .showcase-copy p { margin-left: auto; }

.showcase-art {
  display: flex;
  justify-content: center;
}

.showcase-art img {
  width: min(300px, 70vw);
  height: auto;
  filter: drop-shadow(0 26px 30px rgba(0, 0, 0, 0.55));
  transition: transform 0.3s ease;
}

.showcase-row:hover .showcase-art img {
  transform: translateY(-6px);
}

.showcase-kicker {
  display: block;
  font-size: 12px;
  letter-spacing: 0.25em;
  color: #155e75;
  margin-bottom: 6px;
}

.showcase-copy h3 {
  font-family: 'JetBrains Mono', 'Fira Mono', monospace;
  font-weight: 800;
  font-size: clamp(1.6rem, 3.2vw, 2.4rem);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-neon);
  text-shadow: 0 0 5px rgba(34, 211, 238, 0.3);
  line-height: 1.1;
  margin-bottom: 10px;
}

.showcase-copy p {
  font-size: 1rem;
  color: #94a3b8;
  line-height: 1.7;
  max-width: 42ch;
}

/* ===== GALLERY MARQUEE ===== */
.gallery {
  border-top: 1px solid rgba(34, 211, 238, 0.06);
  padding: 70px 0 80px;
  overflow: hidden;
}

.gallery .section-label {
  max-width: 1200px;
  margin: 0 auto 40px;
  padding: 0 24px;
}

.gallery-track {
  display: flex;
  width: max-content;
  animation: marquee 48s linear infinite;
}

.gallery-track:hover {
  animation-play-state: paused;
}

.gallery-set {
  display: flex;
}

.gallery-set img {
  height: 230px;
  width: auto;
  margin-right: 56px;
  filter: drop-shadow(0 18px 22px rgba(0, 0, 0, 0.5));
}

@keyframes marquee {
  to { transform: translateX(-50%); }
}

/* ===== STEPS GRID (used by siege guide) ===== */
.steps-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 24px;
}

.step { text-align: center; }

.step-num {
  font-size: 32px;
  font-weight: 700;
  color: var(--text-neon);
  line-height: 1;
  margin-bottom: 12px;
  text-shadow: 0 0 15px rgba(34, 211, 238, 0.2);
}

.step-label {
  font-size: 15px;
  font-weight: 700;
  color: #e2e8f0;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 8px;
}

.step-text {
  font-size: 15px;
  color: #94a3b8;
  line-height: 1.6;
}

/* ===== FOOTER / CTA ===== */
.footer-cta {
  background: #041218;
  border-top: 1px solid rgba(34, 211, 238, 0.1);
  position: relative;
  overflow: hidden;
}

.footer-cta .footer-grid-bg {
  position: absolute;
  inset: 0;
  opacity: 0.08;
  background-image:
    linear-gradient(rgba(34, 211, 238, 0.3) 1px, transparent 1px),
    linear-gradient(90deg, rgba(34, 211, 238, 0.3) 1px, transparent 1px);
  background-size: 20px 20px;
  pointer-events: none;
}

.footer-inner {
  max-width: 700px;
  margin: 0 auto;
  padding: 70px 24px 80px;
  text-align: center;
  position: relative;
  z-index: 1;
}

.footer-inner h2 {
  font-family: 'Fira Mono', monospace;
  font-weight: 700;
  font-size: clamp(1.5rem, 4vw, 2.2rem);
  color: var(--text-neon);
  text-shadow: 0 0 5px rgba(34, 211, 238, 0.4);
  margin-bottom: 14px;
}

.footer-inner p {
  font-size: 0.95rem;
  color: #b0bec5;
  margin-bottom: 28px;
  line-height: 1.7;
}

.footer-buttons {
  display: flex;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 28px;
}

.footer-buttons .btn-primary {
  padding: 12px 28px;
  font-size: 14px;
}

.footer-buttons .btn-ghost {
  background: rgba(148, 163, 184, 0.05);
  border: 1px solid #475569;
  color: #e2e8f0;
  padding: 12px 28px;
  font-size: 14px;
  text-decoration: none;
  font-family: 'Fira Mono', monospace;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  transition: all 0.2s ease;
  cursor: pointer;
}

.footer-buttons .btn-ghost:hover {
  border-color: #e2e8f0;
  background: rgba(148, 163, 184, 0.1);
}

/* ===== LANCER SPRITES — real game units, 12-frame idle sheet ===== */
.lancer-row {
  display: flex;
  justify-content: center;
  margin-bottom: 8px;
}

.lancer {
  /* character art fills ~1/3 of the sheet frame, so the box runs large */
  --lancer-size: 170px;
  margin: 0 -42px;
  /* 12-frame sheet: full scaled sheet width = 12 * frame size */
  --lancer-shift: calc(var(--lancer-size) * -12);
  width: var(--lancer-size);
  height: var(--lancer-size);
  background: url("/static/img/units/Blue Units/Lancer/Lancer_Idle.png") 0 0 no-repeat;
  background-size: auto 100%;
  animation: lancer-idle 1.4s steps(12) infinite;
}

.lancer:nth-child(2) { animation-delay: -0.45s; }
.lancer:nth-child(3) { animation-delay: -0.9s; }

@keyframes lancer-idle {
  to { background-position-x: var(--lancer-shift); }
}

/* ===== SCROLL-REVEAL ===== */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s cubic-bezier(0.22, 1, 0.36, 1),
              transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

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

.reveal-stagger > * {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.5s cubic-bezier(0.22, 1, 0.36, 1),
              transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

.reveal-stagger.visible > *:nth-child(1) { transition-delay: 0s; }
.reveal-stagger.visible > *:nth-child(2) { transition-delay: 0.08s; }
.reveal-stagger.visible > *:nth-child(3) { transition-delay: 0.16s; }
.reveal-stagger.visible > *:nth-child(4) { transition-delay: 0.24s; }

.reveal-stagger.visible > * {
  opacity: 1;
  transform: translateY(0);
}

/* Hero entrance */
.hero-copy h1 {
  animation: heroFadeUp 0.7s cubic-bezier(0.22, 1, 0.36, 1) 0.1s both;
}

.hero-copy > p {
  animation: heroFadeUp 0.7s cubic-bezier(0.22, 1, 0.36, 1) 0.35s both;
}

.hero-actions {
  animation: heroFadeUp 0.6s cubic-bezier(0.22, 1, 0.36, 1) 0.55s both;
}

.hero-meta {
  animation: heroFadeUp 0.6s cubic-bezier(0.22, 1, 0.36, 1) 0.7s both;
}

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

/* CTA entrance */
.footer-cta h2 {
  animation: heroFadeUp 0.8s cubic-bezier(0.22, 1, 0.36, 1) both;
  animation-play-state: paused;
}

.footer-cta p {
  animation: heroFadeUp 0.8s cubic-bezier(0.22, 1, 0.36, 1) 0.15s both;
  animation-play-state: paused;
}

.footer-buttons {
  animation: heroFadeUp 0.7s cubic-bezier(0.22, 1, 0.36, 1) 0.3s both;
  animation-play-state: paused;
}

.footer-cta.visible h2,
.footer-cta.visible p,
.footer-cta.visible .footer-buttons {
  animation-play-state: running;
}

/* ===== REDUCED MOTION ===== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
  .hero-field,
  .gallery-track,
  .lancer {
    animation: none !important;
  }
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
  .showcase-row { gap: 24px 40px; }
}

@media (max-width: 880px) {
  .hero { min-height: 0; padding: 70px 0 80px; }
  .showcase-row {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 18px;
    padding: 32px 0;
  }
  .showcase-row:nth-child(even) .showcase-art { order: 0; }
  .showcase-row:nth-child(even) .showcase-copy { order: 0; text-align: center; }
  .showcase-copy p { margin: 0 auto; }
  .showcase-row:nth-child(even) .showcase-copy p { margin: 0 auto; }
  .showcase-art img { width: min(240px, 70vw); }
  .gallery-set img { height: 170px; margin-right: 40px; }
  .steps-grid { grid-template-columns: 1fr; gap: 20px; }
  .nav-links .btn-primary { white-space: nowrap; }
}

@media (max-width: 640px) {
  .navbar {
    flex-direction: row;
    height: 52px;
    padding: 0 16px;
    gap: 8px;
  }
  .brand-group { justify-content: flex-start; }
  .brand-stack { align-items: flex-start; }
  .brand-row { justify-content: flex-start; }
  .brand { font-size: 1.5rem; }
  .brand-version { font-size: 10px; }
  .nav-links { gap: 8px; }
  .nav-links .btn-primary { white-space: nowrap; }
  .btn { padding: 7px 12px; font-size: 12px; }

  .hero { padding: 56px 0 64px; }
  .hero-inner { padding: 0 16px; }
  .hero-copy h1 { font-size: 2rem; }
  .section { padding: 50px 16px; }
  .gallery { padding: 50px 0 60px; }
  .gallery-set img { height: 140px; margin-right: 32px; }
  .lancer { --lancer-size: 120px; margin: 0 -30px; }

  .footer-inner { padding: 50px 16px 60px; }
  .footer-buttons { flex-direction: column; align-items: center; }
  .footer-buttons .btn-primary,
  .footer-buttons .btn-ghost {
    width: 100%;
    max-width: 280px;
    text-align: center;
    justify-content: center;
  }
}
