/* ==========================================================================
   Brotato Online Play — Main Layout & Section Styles
   Warm Crash Zone Comic-Arcade Theme
   ========================================================================== */

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

html {
  scroll-behavior: smooth;
  background-color: var(--bg-void);
  color: var(--text-cream);
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  overflow-x: clip;
}

body.crash-zone-body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  color: var(--text-cream);
  background-color: var(--bg-void);
  background-image:
    radial-gradient(ellipse 80% 50% at 15% 18%, rgba(245, 197, 66, 0.06), transparent 60%),
    radial-gradient(ellipse 70% 45% at 85% 42%, rgba(76, 230, 200, 0.055), transparent 62%),
    radial-gradient(ellipse 65% 40% at 50% 84%, rgba(255, 77, 94, 0.055), transparent 65%),
    repeating-radial-gradient(
      circle at 50% 0%,
      rgba(242, 226, 196, 0.016) 0px,
      rgba(242, 226, 196, 0.016) 1px,
      transparent 1px,
      transparent 46px
    );
  line-height: 1.6;
  overflow-x: clip;
  position: relative;
}

body.has-modal {
  overflow: hidden;
}

/* Subtle tactile paper/ink grain overlay */
.grain-overlay {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: var(--z-noise);
  opacity: 0.04;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='1'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 180px 180px;
}

img,
svg,
canvas {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
  color: inherit;
  cursor: pointer;
}

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

::selection {
  background: var(--accent-gold);
  color: var(--text-ink);
}

/* ---- Container & Section Scaffolding ---- */
.container {
  width: min(100% - (var(--container-pad) * 2), var(--container-max));
  margin-inline: auto;
}

.section {
  position: relative;
  padding-block: var(--section-gap);
  z-index: var(--z-content);
}

section[id] {
  scroll-margin-top: calc(var(--nav-height, 70px) + 12px);
}

.section + .section {
  border-top: 1px solid rgba(245, 239, 230, 0.07);
}

.section-header {
  max-width: 740px;
  margin-bottom: clamp(2.25rem, 4vw, 3.25rem);
}

.section-kicker {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent-gold);
  background: var(--accent-gold-soft);
  border: var(--border-ink);
  box-shadow: var(--shadow-comic-xs);
  padding: 0.32rem 0.72rem;
  border-radius: var(--radius-xs);
  margin-bottom: 1rem;
}

.section-title {
  margin: 0 0 0.85rem;
  font-family: var(--font-display);
  font-size: var(--text-3xl);
  line-height: 1.12;
  letter-spacing: 0.015em;
  color: var(--text-cream);
  text-shadow: 3px 3px 0 #000000;
}

html[lang^="zh"] .section-title,
html[lang^="zh"] .hero-title {
  font-family: var(--font-body);
  font-weight: 900;
  letter-spacing: 0.02em;
}

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

/* ---- Scroll Reveal ---- */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity var(--dur-slow) var(--ease-out), transform var(--dur-slow) var(--ease-out);
}

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

/* ==========================================================================
   STICKY TRANSLUCENT NAVIGATION
   ========================================================================== */
.site-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: var(--z-nav);
  background: rgba(18, 15, 20, 0.84);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 2px solid #000000;
  box-shadow: 0 4px 0 rgba(0, 0, 0, 0.55);
  transition: background var(--dur-fast), box-shadow var(--dur-fast);
}

.site-nav.is-scrolled {
  background: rgba(15, 12, 17, 0.95);
  box-shadow: 0 6px 0 rgba(0, 0, 0, 0.72), 0 12px 32px rgba(0, 0, 0, 0.55);
}

.nav-inner {
  height: var(--nav-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  gap: 0.68rem;
  flex-shrink: 0;
  transition: transform var(--dur-fast) var(--ease-snappy);
}

.brand-mark:hover {
  transform: translateY(-1px);
}

.brand-emblem {
  display: grid;
  place-items: center;
  border-radius: 10px;
  box-shadow: var(--shadow-comic-xs);
  flex-shrink: 0;
}

.brand-text {
  font-family: var(--font-display);
  font-size: 1.05rem;
  letter-spacing: 0.03em;
  color: var(--text-cream);
  text-shadow: 2px 2px 0 #000;
}

html[lang^="zh"] .brand-text {
  font-family: var(--font-body);
  font-weight: 900;
  font-size: 1.1rem;
}

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

.nav-link {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text-secondary);
  padding: 0.45rem 0.85rem;
  border-radius: var(--radius-sm);
  border: 2px solid transparent;
  transition: color var(--dur-fast), background var(--dur-fast), border-color var(--dur-fast), transform var(--dur-fast);
}

.nav-link:hover {
  color: var(--text-cream);
  background: rgba(245, 197, 66, 0.12);
  border-color: rgba(245, 197, 66, 0.35);
  transform: translateY(-1px);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-shrink: 0;
}

.lang-switcher {
  display: inline-flex;
  align-items: center;
  background: var(--bg-obsidian);
  border: var(--border-ink);
  border-radius: var(--radius-sm);
  padding: 2px;
  box-shadow: var(--shadow-comic-xs);
}

.lang-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.76rem;
  font-weight: 700;
  padding: 0.3rem 0.56rem;
  border-radius: 5px;
  transition: background var(--dur-fast), color var(--dur-fast);
}

.lang-btn:hover {
  color: var(--text-cream);
}

.lang-btn.is-active {
  background: var(--accent-gold);
  color: var(--text-ink);
  box-shadow: inset 0 0 0 1.5px #000;
}

.nav-menu-btn {
  display: none;
  width: 38px;
  height: 38px;
  padding: 8px;
  background: var(--bg-surface);
  border: var(--border-ink);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-comic-xs);
  flex-direction: column;
  justify-content: space-between;
  align-items: stretch;
}

.nav-menu-btn span {
  display: block;
  height: 2.5px;
  background: var(--text-cream);
  border-radius: 2px;
  transition: transform var(--dur-fast), opacity var(--dur-fast);
}

.nav-menu-btn[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(7.5px) rotate(45deg);
}

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

.nav-menu-btn[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-7.5px) rotate(-45deg);
}

.mobile-nav-drawer {
  background: var(--bg-obsidian);
  border-top: 2px solid #000;
  border-bottom: 2px solid #000;
  padding: 0.75rem var(--container-pad) 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.mobile-nav-drawer[hidden] {
  display: none;
}

.mobile-nav-link {
  font-weight: 700;
  padding: 0.68rem 0.9rem;
  border-radius: var(--radius-sm);
  color: var(--text-cream);
  background: var(--bg-surface);
  border: var(--border-ink);
  box-shadow: var(--shadow-comic-xs);
}

/* ==========================================================================
   FULL-BLEED HERO SECTION WITH AUTHENTIC BROTATO ARENA CANVAS
   ========================================================================== */
.hero {
  position: relative;
  min-height: clamp(670px, 92vh, 900px);
  padding-top: calc(var(--nav-height) + clamp(2rem, 5vh, 3.75rem));
  padding-bottom: clamp(2.5rem, 5vh, 3.75rem);
  display: flex;
  align-items: center;
  overflow: hidden;
  border-bottom: 3px solid #000000;
  background: #231e22;
}

.arena-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  cursor: crosshair;
}

/* Warm Crash Zone vignette that keeps hero copy ultra-legible while showcasing live arena */
.hero-vignette {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background:
    linear-gradient(
      95deg,
      rgba(18, 15, 20, 0.88) 0%,
      rgba(18, 15, 20, 0.7) 42%,
      rgba(18, 15, 20, 0.22) 76%,
      rgba(18, 15, 20, 0.48) 100%
    ),
    linear-gradient(
      180deg,
      rgba(18, 15, 20, 0.45) 0%,
      transparent 20%,
      transparent 78%,
      rgba(18, 15, 20, 0.92) 100%
    );
}

.hero-inner {
  position: relative;
  z-index: 3;
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(260px, 0.62fr);
  align-items: end;
  gap: clamp(1.5rem, 4vw, 3rem);
  pointer-events: none;
}

.hero-content,
.hero-stage-controls {
  pointer-events: auto;
}

.hero-content {
  max-width: 740px;
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--accent-gold);
  background: rgba(27, 22, 29, 0.9);
  border: var(--border-ink);
  box-shadow: var(--shadow-comic-sm);
  padding: 0.42rem 0.88rem;
  border-radius: var(--radius-pill);
  margin-bottom: 1.3rem;
}

.pulse-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--accent-slime);
  border: 1.5px solid #000;
  animation: slime-pulse 2s infinite;
  flex-shrink: 0;
}

.hero-title {
  margin: 0 0 1.05rem;
  font-family: var(--font-display);
  font-size: var(--text-hero);
  line-height: 1.06;
  letter-spacing: 0.015em;
  color: var(--text-cream);
  text-shadow:
    4px 4px 0 #000000,
    -1px -1px 0 #000000,
    0 12px 32px rgba(0, 0, 0, 0.65);
}

.hero-subtitle {
  margin: 0 0 1.8rem;
  font-size: clamp(1rem, 1.45vw, 1.16rem);
  line-height: 1.65;
  color: var(--text-cream);
  opacity: 0.92;
  max-width: 58ch;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.85);
}

.hero-cta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.9rem;
  margin-bottom: 2rem;
}

.hero-highlights {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.highlight-chip {
  flex: 1 1 auto;
  min-width: 0;
  background: rgba(27, 22, 29, 0.9);
  border: var(--border-ink);
  border-radius: var(--radius-md);
  padding: 0.68rem 0.92rem;
  box-shadow: var(--shadow-comic-sm);
  display: flex;
  flex-direction: column;
  gap: 0.16rem;
  backdrop-filter: blur(8px);
}

.highlight-val {
  font-family: var(--font-mono);
  font-size: clamp(0.8rem, 1.05vw, 0.9rem);
  font-weight: 700;
  color: var(--accent-gold);
  line-height: 1.25;
  white-space: nowrap;
}

.highlight-label {
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--text-muted);
  line-height: 1.3;
}

/* Interactive Arena Stage Controls Dock */
.hero-stage-controls {
  justify-self: end;
  width: 100%;
  max-width: 330px;
  background: rgba(24, 19, 26, 0.92);
  border: var(--border-ink);
  border-radius: var(--radius-lg);
  padding: 1rem;
  box-shadow: var(--shadow-comic-lg);
  backdrop-filter: blur(10px);
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.stage-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.host-pill {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--text-ink);
  background: var(--accent-gold);
  border: var(--border-ink);
  border-radius: var(--radius-xs);
  padding: 0.24rem 0.6rem;
  box-shadow: 2px 2px 0 #000;
  transition: transform var(--dur-fast), background var(--dur-fast);
}

.host-pill.is-flashing {
  animation: gold-pulse 0.65s var(--ease-snappy);
  background: var(--accent-slime);
}

.stage-hint {
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--text-muted);
}

.stage-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.6rem;
}

.tactical-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: 1.5px solid #000;
  flex-shrink: 0;
}

.tactical-dot--gold {
  background: var(--accent-gold);
  box-shadow: 0 0 8px var(--accent-gold-glow);
}

.tactical-dot--green {
  background: var(--accent-slime);
  box-shadow: 0 0 8px var(--accent-slime-glow);
}

/* ==========================================================================
   FEATURE PILLARS
   ========================================================================== */
.pillars-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.4rem;
}

.pillar-card {
  position: relative;
  background: linear-gradient(180deg, var(--bg-surface) 0%, var(--bg-obsidian) 100%);
  border: var(--border-ink);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  box-shadow: var(--shadow-comic-lg);
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  overflow: hidden;
  transition: transform var(--dur-med) var(--ease-snappy), box-shadow var(--dur-med) var(--ease-snappy);
}

.pillar-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 5px;
  background: var(--pillar-accent, var(--accent-gold));
  border-bottom: 2px solid #000;
}

.pillar-card:hover {
  transform: translate(-2px, -3px);
  box-shadow: 8px 9px 0 #000000;
}

.pillar-card--gold {
  --pillar-accent: var(--accent-gold);
  --pillar-soft: var(--accent-gold-soft);
}

.pillar-card--cyan {
  --pillar-accent: var(--accent-cyan);
  --pillar-soft: var(--accent-cyan-soft);
}

.pillar-card--green {
  --pillar-accent: var(--accent-slime);
  --pillar-soft: var(--accent-slime-soft);
}

.pillar-card--crimson {
  --pillar-accent: var(--accent-crimson);
  --pillar-soft: var(--accent-crimson-soft);
}

.pillar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.pillar-icon {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: var(--radius-sm);
  background: var(--pillar-soft);
  color: var(--pillar-accent);
  border: var(--border-ink);
  box-shadow: var(--shadow-comic-xs);
  flex-shrink: 0;
}

.pillar-tag {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--pillar-accent);
  background: rgba(18, 15, 20, 0.7);
  border: 1.5px solid rgba(245, 239, 230, 0.14);
  padding: 0.25rem 0.6rem;
  border-radius: var(--radius-xs);
}

.pillar-title {
  margin: 0;
  font-family: var(--font-heading);
  font-size: 1.38rem;
  font-weight: 800;
  color: var(--text-cream);
  line-height: 1.25;
}

.pillar-body {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.96rem;
  line-height: 1.65;
  flex: 1;
}

.pillar-specs {
  margin: 0.35rem 0 0;
  padding: 0.85rem 0 0;
  list-style: none;
  border-top: 1px dashed rgba(245, 239, 230, 0.16);
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.pillar-specs li {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-cream);
  background: rgba(18, 15, 20, 0.72);
  border: 1.5px solid #000;
  box-shadow: 2px 2px 0 #000;
  padding: 0.28rem 0.65rem;
  border-radius: var(--radius-xs);
}

/* ==========================================================================
   GLOBAL REGIONS & DROP-PROOF CO-OP SECTION
   ========================================================================== */
.relay-section {
  background:
    radial-gradient(ellipse 80% 60% at 50% 0%, rgba(245, 197, 66, 0.055), transparent 65%),
    linear-gradient(180deg, rgba(27, 22, 29, 0.55) 0%, rgba(18, 15, 20, 0.9) 100%);
}

.relay-lab-root {
  min-height: 360px;
}

/* ==========================================================================
   IN-GAME SCREENSHOTS GALLERY (3 DISTINCT VIEWS)
   ========================================================================== */
.gallery-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 256px;
  gap: 1.35rem;
  align-items: start;
}

.gallery-stage {
  background: var(--bg-obsidian);
  border: var(--border-ink);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-comic-lg);
  overflow: hidden;
}

.gallery-view[hidden] {
  display: none;
}

.gallery-stage-btn {
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
  border: none;
  background: #141016;
  overflow: hidden;
  aspect-ratio: 16 / 10;
}

.gallery-main-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: radial-gradient(circle at center, #251f27 0%, #100d12 100%);
  transition: transform var(--dur-slow) var(--ease-out), opacity var(--dur-med);
}

.gallery-stage-btn:hover .gallery-main-img {
  transform: scale(1.02);
}

.gallery-zoom-badge {
  position: absolute;
  right: 1rem;
  bottom: 1rem;
  display: inline-flex;
  align-items: center;
  gap: 0.42rem;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--text-ink);
  background: var(--accent-gold);
  border: var(--border-ink);
  border-radius: var(--radius-xs);
  padding: 0.35rem 0.68rem;
  box-shadow: var(--shadow-comic-sm);
  transition: transform var(--dur-fast);
}

.gallery-stage-btn:hover .gallery-zoom-badge {
  transform: translate(-1px, -1px);
}

.gallery-caption-bar {
  padding: 1.25rem 1.4rem;
  border-top: var(--border-ink);
  background: var(--bg-surface);
}

.gallery-caption-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.45rem;
}

.gallery-tag {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--accent-cyan);
  background: var(--accent-cyan-soft);
  border: 1.5px solid #000;
  padding: 0.18rem 0.52rem;
  border-radius: var(--radius-xs);
}

.gallery-counter {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-muted);
}

.gallery-caption-title {
  margin: 0 0 0.35rem;
  font-size: 1.12rem;
  font-weight: 800;
  color: var(--text-cream);
}

.gallery-caption-desc {
  margin: 0;
  font-size: 0.92rem;
  color: var(--text-secondary);
}

.gallery-thumbs {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.gallery-thumb {
  display: grid;
  grid-template-columns: 78px minmax(0, 1fr);
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  padding: 0.52rem;
  text-align: left;
  background: var(--bg-obsidian);
  border: var(--border-ink);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-comic-sm);
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 700;
  transition: transform var(--dur-fast) var(--ease-snappy), border-color var(--dur-fast), background var(--dur-fast), color var(--dur-fast);
}

.gallery-thumb img,
.gallery-thumb-preview {
  width: 78px;
  height: 52px;
  border-radius: 6px;
  border: 1.5px solid #000;
  background: #120f14;
}

.gallery-thumb img {
  object-fit: cover;
}

.gallery-thumb-preview {
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.gallery-thumb-preview--lobby {
  background: linear-gradient(135deg, rgba(245, 197, 66, 0.22) 0%, #1d1721 100%);
  color: var(--accent-gold);
}

.gallery-thumb-preview--region {
  background: linear-gradient(135deg, rgba(76, 230, 200, 0.22) 0%, #171e22 100%);
  color: var(--accent-cyan);
}

.gallery-thumb:hover {
  transform: translate(-1px, -2px);
  background: var(--bg-surface);
  color: var(--text-cream);
}

.gallery-thumb.is-active {
  background: var(--bg-elevated);
  border-color: var(--accent-gold);
  color: var(--accent-gold);
  box-shadow: 4px 4px 0 #000, 0 0 0 1px var(--accent-gold);
}

/* ==========================================================================
   HOW TO PLAY IN 3 EASY STEPS (#how-to-play)
   ========================================================================== */
.howto-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.35rem;
  margin-bottom: 1.75rem;
}

.howto-card {
  position: relative;
  background: linear-gradient(180deg, var(--bg-surface) 0%, var(--bg-obsidian) 100%);
  border: var(--border-ink);
  border-radius: var(--radius-lg);
  padding: 1.6rem;
  box-shadow: var(--shadow-comic-lg);
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  overflow: hidden;
  transition: transform var(--dur-med) var(--ease-snappy), box-shadow var(--dur-med) var(--ease-snappy);
}

.howto-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--accent-gold);
  border-bottom: 2px solid #000;
}

.howto-card:nth-child(2)::before {
  background: var(--accent-cyan);
}

.howto-card:nth-child(3)::before {
  background: var(--accent-slime);
}

.howto-card:hover {
  transform: translate(-2px, -3px);
  box-shadow: 8px 9px 0 #000000;
}

.howto-step-num {
  align-self: flex-start;
  font-family: var(--font-display);
  font-size: 1.1rem;
  color: var(--text-ink);
  background: var(--accent-gold);
  border: var(--border-ink);
  border-radius: var(--radius-xs);
  padding: 0.16rem 0.56rem;
  box-shadow: 2px 2px 0 #000;
}

.howto-card:nth-child(2) .howto-step-num {
  background: var(--accent-cyan);
}

.howto-card:nth-child(3) .howto-step-num {
  background: var(--accent-slime);
}

.howto-card-title {
  margin: 0;
  font-size: 1.22rem;
  font-weight: 800;
  color: var(--text-cream);
  line-height: 1.25;
}

.howto-card-body {
  margin: 0;
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.65;
  flex: 1;
}

.howto-card-body strong {
  color: var(--text-cream);
}

.howto-tip {
  margin: 0.35rem 0 0;
  font-size: 0.83rem;
  font-weight: 600;
  color: var(--accent-spud);
  background: rgba(242, 226, 196, 0.08);
  border: 1.5px solid rgba(242, 226, 196, 0.2);
  border-radius: var(--radius-sm);
  padding: 0.58rem 0.78rem;
  line-height: 1.48;
}

.howto-cta-banner {
  background:
    radial-gradient(ellipse 70% 120% at 85% 50%, rgba(245, 197, 66, 0.16), transparent 65%),
    linear-gradient(135deg, var(--bg-elevated) 0%, var(--bg-obsidian) 100%);
  border: var(--border-gold);
  border-radius: var(--radius-lg);
  padding: clamp(1.35rem, 3vw, 2rem);
  box-shadow: 6px 6px 0 #000000, 0 0 28px rgba(245, 197, 66, 0.14);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.howto-cta-copy {
  max-width: 620px;
}

.howto-cta-title {
  margin: 0 0 0.35rem;
  font-family: var(--font-heading);
  font-size: clamp(1.25rem, 2.2vw, 1.55rem);
  font-weight: 800;
  color: var(--text-cream);
}

.howto-cta-desc {
  margin: 0;
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.55;
}

/* ==========================================================================
   FOOTER
   ========================================================================== */
.site-footer {
  position: relative;
  z-index: var(--z-content);
  background: #0d0a0f;
  border-top: 3px solid #000000;
  padding-top: 3rem;
  padding-bottom: 2rem;
}

.footer-inner {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  gap: 2.5rem;
  padding-bottom: 2.1rem;
  border-bottom: 1px solid rgba(245, 239, 230, 0.1);
}

.footer-title {
  font-family: var(--font-display);
  font-size: 1.32rem;
  color: var(--accent-gold);
  text-shadow: 2px 2px 0 #000;
  margin-bottom: 0.7rem;
}

html[lang^="zh"] .footer-title {
  font-family: var(--font-body);
  font-weight: 900;
}

.footer-desc {
  margin: 0 0 1.1rem;
  color: var(--text-secondary);
  font-size: 0.92rem;
  max-width: 52ch;
}

.footer-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.footer-chip {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-cream);
  background: var(--bg-surface);
  border: var(--border-ink);
  border-radius: var(--radius-xs);
  padding: 0.24rem 0.58rem;
  box-shadow: 2px 2px 0 #000;
}

.footer-cols {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.5rem;
}

.footer-col-title {
  margin: 0 0 0.75rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent-cyan);
}

.footer-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

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

.footer-bottom {
  padding-top: 1.35rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  font-size: 0.82rem;
  color: var(--text-muted);
}

/* ==========================================================================
   RESPONSIVE BREAKPOINTS (1440px down to 390px, zero overflow)
   ========================================================================== */
@media (max-width: 1080px) {
  .hero-inner {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .hero-stage-controls {
    justify-self: start;
    max-width: 100%;
  }

  .stage-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .gallery-shell {
    grid-template-columns: 1fr;
  }

  .gallery-thumbs {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.75rem;
  }

  .gallery-thumb {
    grid-template-columns: 1fr;
    gap: 0.45rem;
    text-align: center;
  }

  .gallery-thumb img,
  .gallery-thumb-preview {
    width: 100%;
    height: 64px;
  }
}

@media (max-width: 860px) {
  .nav-links {
    display: none;
  }

  .nav-menu-btn {
    display: inline-flex;
  }

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

  .footer-inner {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  :root {
    --nav-height: 62px;
    --container-pad: 0.9rem;
  }

  .nav-inner {
    gap: 0.5rem;
  }

  .brand-mark {
    gap: 0.48rem;
    min-width: 0;
    flex-shrink: 1;
  }

  .brand-emblem svg {
    width: 28px;
    height: 28px;
  }

  .brand-text {
    font-size: 0.86rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  html[lang^="zh"] .brand-text {
    font-size: 0.96rem;
  }

  .nav-actions {
    gap: 0.4rem;
  }

  .lang-btn {
    font-size: 0.72rem;
    padding: 0.26rem 0.44rem;
  }

  .nav-menu-btn {
    width: 36px;
    height: 36px;
    padding: 7px;
  }

  .hero {
    min-height: auto;
  }

  .hero-highlights {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.55rem;
  }

  .highlight-chip {
    padding: 0.62rem 0.72rem;
  }

  .highlight-val {
    font-size: 0.78rem;
    white-space: normal;
  }

  .stage-actions {
    grid-template-columns: 1fr;
  }

  .gallery-thumbs {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.5rem;
  }

  .gallery-thumb {
    padding: 0.38rem;
    font-size: 0.74rem;
  }

  .gallery-thumb img,
  .gallery-thumb-preview {
    height: 48px;
  }

  .howto-cta-banner {
    flex-direction: column;
    align-items: flex-start;
  }

  .howto-cta-banner .btn {
    width: 100%;
  }

  .footer-cols {
    grid-template-columns: 1fr;
  }
}

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

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

  .pulse-dot,
  .host-pill.is-flashing {
    animation: none;
  }
}
