/* ==========================================================================
   sections.css — one block per page section, each with its own look:
   night-sky hero, ticker, cartridge cards, save slots, world map, start screen.
   Skin-specific flourishes live at the bottom.
   ========================================================================== */

/* ---- hero: night sky ---- */

.hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
}

.hero__sky {
  position: absolute;
  inset: 0;
  z-index: -1;
}

.hero__stars {
  position: absolute;
  inset: 0;
}

.star {
  position: absolute;
  width: 4px;
  height: 4px;
  background: var(--ink);
  animation: twinkle 1.8s steps(2) infinite;
}

.star--big {
  width: 6px;
  height: 6px;
  background: var(--hl);
}

.cloud {
  position: absolute;
  left: 0;
  width: 128px;
  height: 48px;
  color: var(--cloud);
  animation: drift 70s steps(140) infinite;
}

.cloud--1 {
  top: 10%;
}

.cloud--2 {
  top: 44%;
  width: 192px;
  height: 72px;
  animation-duration: 96s;
  animation-delay: -40s;
}

.cloud--3 {
  top: 74%;
  width: 96px;
  height: 36px;
  animation-duration: 56s;
  animation-delay: -22s;
}

.hero__grid {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 40px 56px;
  padding-block: clamp(44px, 8vw, 96px) clamp(60px, 9vw, 112px);
}

.hero__copy {
  flex: 1 1 460px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 22px;
}

.hero__title {
  font-size: clamp(2.75rem, 6.4vw, 5.5rem);
  line-height: 0.95;
  letter-spacing: -1px;
}

.hero__lead {
  max-width: 34rem;
  font-size: clamp(1.0625rem, 1.6vw, 1.25rem);
  color: var(--muted);
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px 16px;
  margin-top: 6px;
}

.hero__stage {
  flex: 1 1 360px;
  min-width: 0;
  position: relative;
  display: flex;
  justify-content: center;
  padding-block: 28px;
}

.floater {
  position: absolute;
  z-index: 0;
  animation: float 3s steps(5) infinite;
}

.floater--spark {
  left: 1%;
  top: 0;
  width: 42px;
  height: 42px;
  color: var(--a1);
}

.floater--heart {
  right: 1%;
  top: 12%;
  width: 42px;
  height: 36px;
  color: var(--a2);
  animation-duration: 3.6s;
  animation-delay: -1.2s;
}

.floater--coin {
  left: 4%;
  bottom: 2%;
  width: 36px;
  height: 36px;
  color: var(--a3);
  animation-duration: 4.2s;
  animation-delay: -2.1s;
}

.floater--spark2 {
  right: 8%;
  bottom: 8%;
  width: 21px;
  height: 21px;
  color: var(--ink);
  animation: twinkle 1.4s steps(2) infinite;
}

/* scrolling race-flag strip under the hero */
.checker {
  height: 24px;
  background: repeating-conic-gradient(var(--line) 0 25%, var(--a1) 0 50%) 0 0 / 24px 24px;
  animation: checker 1.2s steps(6) infinite;
}

/* ---- ticker ---- */

.marquee {
  overflow: hidden;
  padding-block: 14px;
  background: var(--a1);
  color: var(--on-a1);
  border-block: 4px solid var(--line);
  font-family: var(--font-pixel);
  font-size: 0.875rem;
  white-space: nowrap;
}

.marquee__track {
  display: flex;
  width: max-content;
  animation: marquee 30s linear infinite;
}

.marquee b {
  display: inline-block;
  margin-inline: 0.9em;
  font-weight: 400;
}

/* ---- the lab: save slots ---- */

.lab {
  background: var(--bg2);
  border-block: 4px solid var(--line);
}

.slots {
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 4px 12px 12px 4px;
}

.slot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px 24px;
  padding: 20px 24px;
}

.slot--loading {
  background: var(--card);
  box-shadow: var(--px-border), 8px 12px 0 0 var(--shadow), 12px 8px 0 0 var(--shadow);
}

.slot--empty {
  margin: -4px;
  border: 4px dashed var(--muted);
  color: var(--muted);
}

.slot__id {
  font-family: var(--font-pixel);
  font-size: 0.75rem;
}

.slot__name {
  flex: 1 1 160px;
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 600;
  line-height: 1.1;
}

.slot__bar {
  flex: 1 1 220px;
  height: 32px;
  padding: 4px;
  background: var(--screen);
  border: 4px solid var(--line);
}

.slot__bar i {
  display: block;
  height: 100%;
  width: 100%;
  background: repeating-linear-gradient(90deg, var(--screen-ink) 0 12px, transparent 12px 16px);
  animation: load 4s steps(10) infinite;
}

.slot__status {
  min-width: 9.5em;
  font-family: var(--font-term);
  font-size: 1.5rem;
  line-height: 1;
  color: var(--muted);
}

.dots {
  display: inline-block;
  width: 0;
  overflow: hidden;
  vertical-align: bottom;
  animation: dots 1.4s steps(4) infinite;
}

.dots::after {
  content: "...";
}

/* ---- process: world map ---- */

.map {
  position: relative;
}

.walker {
  display: none;
  position: absolute;
  top: 0;
  left: 0;
  width: 40px;
  height: 40px;
  animation: walk 16s steps(96) infinite;
}

.walker__a {
  animation: leg-a 0.4s steps(1) infinite;
}

.walker__b {
  animation: leg-b 0.4s steps(1) infinite;
}

.levels {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 36px 28px;
}

.level {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-top: 22px;
  border-top: 8px dotted var(--hl);
}

.level p {
  color: var(--muted);
}

.level__badge {
  align-self: flex-start;
  margin: 4px;
  padding: 8px 10px;
  background: var(--a1);
  color: var(--on-a1);
  font-family: var(--font-pixel);
  font-size: 0.6875rem;
  line-height: 1.4;
  box-shadow: var(--px-border);
}

.level--boss .level__badge {
  background: var(--a2);
  color: var(--on-a2);
}

.level:hover .level__badge {
  animation: bump 0.4s steps(2) infinite;
}

@media (min-width: 960px) {
  .map {
    padding-top: 48px;
  }

  .walker {
    display: block;
  }
}

/* ---- contact: start screen ---- */

.contact {
  padding-top: 0;
}

.start {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 22px;
  margin: 4px 16px 16px 4px;
  padding: clamp(36px, 7vw, 80px) clamp(20px, 5vw, 64px);
  background: var(--card);
  text-align: center;
  box-shadow: var(--px-border), 12px 16px 0 0 var(--shadow), 16px 12px 0 0 var(--shadow);
}

.start h2 {
  font-size: clamp(2.25rem, 5.4vw, 4.5rem);
}

.start__insert {
  font-family: var(--font-pixel);
  font-size: 0.75rem;
  color: var(--a2);
  animation: flash 1.2s steps(1) infinite;
}

.start__coin {
  display: none;
  position: absolute;
  width: 36px;
  height: 36px;
  color: var(--a1);
  animation: float 3.4s steps(5) infinite;
}

.start__coin--l {
  left: 6%;
  top: 16%;
}

.start__coin--r {
  right: 6%;
  bottom: 18%;
  animation-delay: -1.7s;
}

@media (min-width: 760px) {
  .start__coin {
    display: block;
  }
}

/* ==========================================================================
   Skin flourishes — each skin changes more than color.
   ========================================================================== */

/* PAPER: stickers on a desk. Cards sit slightly crooked. */
[data-theme="paper"] .card:nth-child(odd) {
  rotate: -1.2deg;
}

[data-theme="paper"] .card:nth-child(even) {
  rotate: 1deg;
}

[data-theme="paper"] .star {
  background: var(--a2);
}

/* POCKET: everything speaks in the pixel face. */
[data-theme="pocket"] body {
  font-family: var(--font-display);
  font-size: 1.1875rem;
  line-height: 1.4;
}

[data-theme="pocket"] .hl {
  text-shadow: 4px 4px 0 var(--bg2);
}

/* TERMINAL: phosphor glow, mono type, slow flicker. */
[data-theme="terminal"] body {
  font-family: var(--font-term);
  font-size: 1.4375rem;
  line-height: 1.25;
  text-shadow: 0 0 5px rgba(224, 172, 63, 0.28);
}

[data-theme="terminal"] .hero__lead,
[data-theme="terminal"] .section__lead {
  font-size: 1.5rem;
}

[data-theme="terminal"] .hl {
  text-shadow: 0 0 12px rgba(224, 172, 63, 0.45);
}

[data-theme="terminal"] .btn,
[data-theme="terminal"] .tag,
[data-theme="terminal"] .level__badge,
[data-theme="terminal"] .marquee,
[data-theme="terminal"] .window__bar,
[data-theme="terminal"] .toast {
  text-shadow: none;
}

[data-theme="terminal"] .crt {
  animation: flicker 5s steps(1) infinite;
}
