/* ==========================================================================
   Bone Brigade — Steam Launch Waitlist Design System
   Palette: Midnight slate, carved stone, bone parchment, tarnished gold, crimson
   ========================================================================== */

:root {
  --bg-void: #0d0f16;
  --bg-stone: #151822;
  --bg-stone-raised: #1c202d;
  --bg-input: #0e1118;

  --ink-bone: #ede2c9;
  --ink-ash: #b2aba0;
  --ink-muted: #7b766d;

  --gold: #d4a84b;
  --gold-dim: rgba(212, 168, 75, 0.28);
  --crimson: #b52430;
  --crimson-hover: #cb2c39;
  --crimson-active: #941b25;
  --soul-green: #43be90;
  --danger: #e26d6d;

  --border-stone: rgba(237, 226, 201, 0.12);
  --border-stone-strong: rgba(237, 226, 201, 0.22);

  --font-display: 'Cinzel', Georgia, 'Times New Roman', serif;
  --font-body: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  --radius-sm: 4px;
  --radius-md: 6px;
  --shadow-stone: 0 18px 48px rgba(0, 0, 0, 0.58), inset 0 1px 0 rgba(237, 226, 201, 0.08);
  --container-max: 1080px;
}

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

html {
  scroll-behavior: smooth;
  background-color: var(--bg-void);
  color: var(--ink-bone);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body {
  margin: 0;
  min-height: 100vh;
  background-color: var(--bg-void);
  color: var(--ink-bone);
  line-height: 1.6;
  overflow-x: hidden;
}

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

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ==========================================================================
   Hero — Layered 2.5D Pixel-Art Graveyard + Above-the-Fold Waitlist
   ========================================================================== */

.hero {
  position: relative;
  min-height: min(100svh, 920px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: clamp(2.5rem, 5vh, 4rem) 1.25rem clamp(8.5rem, 16vh, 11.5rem);
  overflow: hidden;
  isolation: isolate;
  border-bottom: 1px solid var(--border-stone);
}

.parallax-stage {
  position: absolute;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background-color: #101120;
}

.parallax-layer {
  position: absolute;
  left: 0;
  right: 0;
  background-repeat: repeat-x;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  will-change: background-position;
}

.layer-sky {
  inset: 0;
  background-image: url('/assets/worlds/graveyard/sky_far.webp');
  background-size: auto 100%;
  background-position: 0 0;
  animation: drift-sky 140s linear infinite;
}

.layer-mid {
  bottom: 120px;
  height: 420px;
  background-image: url('/assets/worlds/graveyard/mid.webp');
  background-size: auto 100%;
  background-position: 0 bottom;
  animation: drift-mid 72s linear infinite;
}

.layer-ground {
  bottom: 0;
  height: 210px;
  background-image: url('/assets/worlds/graveyard/ground.webp');
  background-size: auto 100%;
  background-position: 0 bottom;
  animation: drift-ground 34s linear infinite;
}

.hero-vignette {
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(ellipse 76% 64% at 50% 42%, rgba(13, 15, 22, 0.34) 0%, rgba(13, 15, 22, 0.84) 100%),
    linear-gradient(180deg, rgba(13, 15, 22, 0.52) 0%, rgba(13, 15, 22, 0.25) 45%, rgba(13, 15, 22, 0.14) 76%, rgba(13, 15, 22, 0.72) 100%);
}

@keyframes drift-sky {
  from { background-position: 0 0; }
  to { background-position: -1376px 0; }
}

@keyframes drift-mid {
  from { background-position: 0 bottom; }
  to { background-position: -874px bottom; }
}

@keyframes drift-ground {
  from { background-position: 0 bottom; }
  to { background-position: -481.6px bottom; }
}

/* Marching pixel-art army on the stone road */
.march-lane {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 24px;
  height: 150px;
  z-index: 1;
  pointer-events: none;
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: clamp(0.4rem, 2.5vw, 2.2rem);
  padding: 0 1rem;
}

.march-unit {
  flex: 0 0 auto;
  background-repeat: no-repeat;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  filter: drop-shadow(0 8px 6px rgba(0, 0, 0, 0.75));
}

.march-unit--sm {
  width: 96px;
  height: 96px;
  background-size: 576px 384px;
  background-position-y: -96px; /* row 1: move */
  animation: sprite-walk-sm 0.62s steps(6) infinite;
}

.march-unit--lg {
  width: 132px;
  height: 132px;
  background-size: 792px 528px;
  background-position-y: -132px; /* row 1: move */
  animation: sprite-walk-lg 0.72s steps(6) infinite;
}

.march-unit--float {
  transform: translateY(-10px);
}

@keyframes sprite-walk-sm {
  from { background-position-x: 0; }
  to { background-position-x: -576px; }
}

@keyframes sprite-walk-lg {
  from { background-position-x: 0; }
  to { background-position-x: -792px; }
}

/* Hero Foreground Content */
.hero-content {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 660px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.hero-logo {
  width: min(460px, 84vw);
  height: auto;
  margin-bottom: 1.1rem;
  filter: drop-shadow(0 12px 26px rgba(0, 0, 0, 0.72));
}

.hero-title {
  margin: 0 0 0.85rem;
  font-family: var(--font-display);
  font-size: clamp(1.55rem, 3.6vw, 2.35rem);
  font-weight: 700;
  line-height: 1.18;
  letter-spacing: 0.055em;
  text-transform: uppercase;
  color: var(--ink-bone);
  text-shadow: 0 3px 16px rgba(0, 0, 0, 0.85);
}

.hero-lead {
  margin: 0 0 1.75rem;
  max-width: 540px;
  font-size: clamp(0.98rem, 1.8vw, 1.08rem);
  color: #d7cfc0;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.85);
}

/* ==========================================================================
   Waitlist Form Card (Tactile Carved Stone)
   ========================================================================== */

.waitlist-panel {
  width: 100%;
  max-width: 540px;
  background: linear-gradient(180deg, rgba(25, 29, 41, 0.94) 0%, rgba(16, 19, 28, 0.96) 100%);
  border: 1px solid var(--border-stone-strong);
  border-radius: var(--radius-md);
  padding: 0.55rem;
  box-shadow: var(--shadow-stone);
  backdrop-filter: blur(8px);
}

.waitlist-form {
  display: flex;
  gap: 0.55rem;
  align-items: stretch;
}

.honeypot-field {
  position: absolute;
  left: -9999px;
  opacity: 0;
  pointer-events: none;
  height: 0;
  width: 0;
}

.waitlist-input {
  flex: 1 1 auto;
  min-width: 0;
  height: 50px;
  padding: 0 1rem;
  background-color: var(--bg-input);
  border: 1px solid var(--border-stone);
  border-radius: var(--radius-sm);
  color: var(--ink-bone);
  font-family: var(--font-body);
  font-size: 0.98rem;
  transition: border-color 150ms ease, background-color 150ms ease;
}

.waitlist-input::placeholder {
  color: var(--ink-muted);
}

.waitlist-input:focus {
  outline: none;
  border-color: var(--gold);
  background-color: #111520;
}

.btn-primary {
  flex: 0 0 auto;
  height: 50px;
  padding: 0 1.45rem;
  border: 1px solid rgba(237, 226, 201, 0.24);
  border-radius: var(--radius-sm);
  background: linear-gradient(180deg, var(--crimson-hover) 0%, var(--crimson) 52%, var(--crimson-active) 100%);
  color: #f8f2e4;
  font-family: var(--font-display);
  font-size: 0.92rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 232, 220, 0.24);
  transition: transform 120ms ease, filter 150ms ease, background 150ms ease;
  white-space: nowrap;
}

.btn-primary:hover:not(:disabled) {
  filter: brightness(1.08);
  transform: translateY(-1px);
}

.btn-primary:active:not(:disabled) {
  transform: translateY(0);
  filter: brightness(0.96);
}

.btn-primary:focus-visible,
.btn-secondary:focus-visible,
.unit-tile:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

.btn-primary:disabled {
  opacity: 0.7;
  cursor: wait;
}

.form-feedback {
  margin: 0.55rem 0.35rem 0.15rem;
  font-size: 0.88rem;
  text-align: left;
  min-height: 1.25em;
}

.form-feedback:empty {
  display: none;
}

.form-feedback--error {
  color: var(--danger);
}

.form-feedback--success {
  color: var(--soul-green);
}

/* Success state after signing up */
.waitlist-success {
  padding: 0.75rem 0.85rem;
  text-align: center;
}

.waitlist-success[hidden] {
  display: none;
}

.success-heading {
  margin: 0 0 0.35rem;
  font-family: var(--font-display);
  font-size: 1.15rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--soul-green);
}

.success-copy {
  margin: 0 0 0.95rem;
  font-size: 0.93rem;
  color: var(--ink-ash);
}

.success-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.6rem;
}

.btn-secondary {
  height: 40px;
  padding: 0 1rem;
  background-color: var(--bg-stone-raised);
  border: 1px solid var(--border-stone-strong);
  border-radius: var(--radius-sm);
  color: var(--ink-bone);
  font-family: var(--font-body);
  font-size: 0.86rem;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 150ms ease, background-color 150ms ease;
}

.btn-secondary:hover {
  border-color: var(--gold);
  background-color: #222737;
}

.hero-meta {
  margin: 0.9rem 0 0;
  font-size: 0.82rem;
  color: var(--ink-ash);
  letter-spacing: 0.02em;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.9);
}

.hero-meta strong {
  color: var(--gold);
  font-weight: 600;
}

/* ==========================================================================
   Main Content Sections
   ========================================================================== */

.section {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: clamp(3.5rem, 7vw, 5.25rem) 1.5rem;
}

.section-header {
  max-width: 620px;
  margin-bottom: 2.5rem;
}

.section-eyebrow {
  margin: 0 0 0.45rem;
  font-family: var(--font-display);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold);
}

.section-title {
  margin: 0 0 0.65rem;
  font-family: var(--font-display);
  font-size: clamp(1.45rem, 2.8vw, 2rem);
  font-weight: 700;
  letter-spacing: 0.045em;
  color: var(--ink-bone);
  line-height: 1.25;
}

.section-desc {
  margin: 0;
  color: var(--ink-ash);
  font-size: 0.98rem;
}

/* Three-Column Editorial Pillars */
.pillars {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 2.25rem;
  border-top: 1px solid var(--border-stone);
  padding-top: 2.25rem;
}

.pillar-index {
  display: inline-block;
  margin-bottom: 0.7rem;
  font-family: var(--font-display);
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  color: var(--gold);
}

.pillar-title {
  margin: 0 0 0.55rem;
  font-family: var(--font-display);
  font-size: 1.12rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--ink-bone);
}

.pillar-body {
  margin: 0;
  font-size: 0.95rem;
  color: var(--ink-ash);
  line-height: 1.65;
}

/* ==========================================================================
   Interactive Roster Showcase (Real Animated Sprites)
   ========================================================================== */

.roster-section {
  border-top: 1px solid var(--border-stone);
}

.roster-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 0.9rem;
}

.unit-tile {
  appearance: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1rem 0.65rem 0.95rem;
  background: linear-gradient(180deg, var(--bg-stone-raised) 0%, var(--bg-stone) 100%);
  border: 1px solid var(--border-stone);
  border-radius: var(--radius-md);
  color: inherit;
  font: inherit;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(237, 226, 201, 0.06);
  transition: transform 150ms ease, border-color 150ms ease, background 150ms ease;
}

.unit-tile:hover,
.unit-tile[aria-pressed='true'] {
  transform: translateY(-3px);
  border-color: var(--gold-dim);
  background: linear-gradient(180deg, #232838 0%, #171b27 100%);
}

.unit-stage {
  width: 112px;
  height: 112px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  margin-bottom: 0.55rem;
  position: relative;
}

.unit-stage::after {
  content: '';
  position: absolute;
  bottom: 6px;
  left: 50%;
  transform: translateX(-50%);
  width: 58px;
  height: 10px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.45);
}

.unit-sprite {
  position: relative;
  z-index: 1;
  background-repeat: no-repeat;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

.unit-sprite--sm {
  width: 96px;
  height: 96px;
  background-size: 576px 384px;
  background-position-y: 0; /* row 0: idle */
  animation: sprite-idle-sm 1.35s steps(6) infinite;
}

.unit-sprite--lg {
  width: 112px;
  height: 112px;
  background-size: 672px 448px;
  background-position-y: 0; /* row 0: idle */
  animation: sprite-idle-lg 1.35s steps(6) infinite;
}

/* Trigger real Attack animation (row 3) on hover or active click */
.unit-tile:hover .unit-sprite--sm,
.unit-tile.is-attacking .unit-sprite--sm {
  background-position-y: -288px;
  animation: sprite-idle-sm 0.52s steps(6) infinite;
}

.unit-tile:hover .unit-sprite--lg,
.unit-tile.is-attacking .unit-sprite--lg {
  background-position-y: -336px;
  animation: sprite-idle-lg 0.52s steps(6) infinite;
}

@keyframes sprite-idle-sm {
  from { background-position-x: 0; }
  to { background-position-x: -576px; }
}

@keyframes sprite-idle-lg {
  from { background-position-x: 0; }
  to { background-position-x: -672px; }
}

.unit-name {
  font-family: var(--font-display);
  font-size: 0.84rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--ink-bone);
  text-align: center;
}

.unit-tier {
  margin-top: 0.15rem;
  font-size: 0.74rem;
  color: var(--ink-muted);
}

.roster-detail {
  margin-top: 1.35rem;
  padding: 1rem 1.25rem;
  background-color: var(--bg-stone);
  border: 1px solid var(--border-stone);
  border-radius: var(--radius-md);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.65rem 1.5rem;
}

.roster-detail-name {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--gold);
}

.roster-detail-desc {
  margin: 0;
  color: var(--ink-ash);
  font-size: 0.93rem;
  flex: 1 1 320px;
}

/* ==========================================================================
   Footer
   ========================================================================== */

.site-footer {
  border-top: 1px solid var(--border-stone);
  padding: 2.25rem 1.5rem 2.75rem;
  color: var(--ink-muted);
  font-size: 0.86rem;
}

.footer-inner {
  max-width: var(--container-max);
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.footer-links {
  display: flex;
  gap: 1.25rem;
  align-items: center;
}

.footer-links a {
  color: var(--ink-ash);
  text-decoration: none;
  transition: color 140ms ease;
}

.footer-links a:hover {
  color: var(--gold);
}

/* ==========================================================================
   Responsive & Reduced Motion
   ========================================================================== */

@media (max-width: 920px) {
  .pillars {
    grid-template-columns: 1fr;
    gap: 1.75rem;
  }

  .roster-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 600px) {
  .hero {
    min-height: 100svh;
    padding-bottom: 9.25rem;
  }

  .waitlist-form {
    flex-direction: column;
  }

  .btn-primary {
    width: 100%;
  }

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

  .march-unit:nth-child(1),
  .march-unit:nth-child(5) {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .parallax-layer,
  .march-unit,
  .unit-sprite {
    animation: none !important;
  }
}
