:root {
  --bg-deep: #0b1917;
  --bg-panel: #122825;
  --bg-panel-alt: #0f211e;
  --accent-gold: #d9a940;
  --accent-gold-light: #f0cd7c;
  --text-cream: #f3ead2;
  --text-muted: #b7c7c0;
  --border-glow: rgba(217, 169, 64, 0.28);
  --shadow-deep: rgba(0, 0, 0, 0.45);
  --font-display: "Cinzel", serif;
  --font-body: "Nunito", sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg-deep);
  color: var(--text-cream);
  font-family: var(--font-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

.wrap {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--accent-gold-light);
  margin: 0 0 0.6em;
  letter-spacing: 0.01em;
}

h2 {
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  text-align: center;
}

p { color: var(--text-muted); }

a { color: var(--accent-gold-light); }

/* Header */

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(11, 25, 23, 0.85);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--border-glow);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 0.75rem;
  padding-bottom: 0.75rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
}

.brand-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
}

.brand-name {
  font-family: var(--font-display);
  color: var(--text-cream);
  font-size: 1rem;
  letter-spacing: 0.02em;
}

.site-nav {
  display: flex;
  gap: 1.5rem;
}

.site-nav a {
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  transition: color 0.2s ease;
}

.site-nav a:hover { color: var(--accent-gold-light); }

/* Hero */

.hero {
  background-size: cover;
  background-position: center;
  padding: 7rem 0 6rem;
  text-align: center;
}

.hero-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
}

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

.hero-inner > * {
  opacity: 0;
  animation: fadeInUp 0.7s ease both;
}

.hero-inner > *:nth-child(1) { animation-delay: 0.05s; }
.hero-inner > *:nth-child(2) { animation-delay: 0.15s; }
.hero-inner > *:nth-child(3) { animation-delay: 0.25s; }
.hero-inner > *:nth-child(4) { animation-delay: 0.35s; }
.hero-inner > *:nth-child(5) { animation-delay: 0.45s; }

.hero-logo {
  width: 100%;
  max-width: 560px;
  height: auto;
  display: block;
  margin: 0 auto;
  filter: drop-shadow(0 10px 30px var(--shadow-deep));
}

.hero h1 {
  font-size: clamp(2rem, 5vw, 3.4rem);
  margin-bottom: 0.2em;
  text-shadow: 0 4px 18px var(--shadow-deep);
}

.hero-subtitle {
  font-family: var(--font-display);
  color: var(--accent-gold);
  text-transform: uppercase;
  letter-spacing: 0.25em;
  font-size: 0.85rem;
  margin-bottom: 1.5rem;
}

.hero-pitch {
  max-width: 640px;
  font-size: 1.05rem;
  color: rgba(243, 234, 210, 0.9);
  margin-bottom: 2.25rem;
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
}

.btn {
  display: inline-block;
  padding: 0.85rem 1.75rem;
  border-radius: 999px;
  font-weight: 700;
  text-decoration: none;
  font-size: 0.95rem;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  border: 1px solid transparent;
}

.btn:hover { transform: translateY(-2px); }

.btn-primary {
  background: linear-gradient(180deg, var(--accent-gold-light), var(--accent-gold));
  color: #23180a;
  box-shadow: 0 8px 22px rgba(217, 169, 64, 0.25);
}

.btn-secondary {
  background: transparent;
  border-color: var(--border-glow);
  color: var(--text-cream);
}

.btn-secondary:hover { border-color: var(--accent-gold); }

/* Trailer */

.trailer-frame {
  max-width: 860px;
  margin: 2rem auto 0;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--border-glow);
  box-shadow: 0 20px 50px var(--shadow-deep);
}

.trailer-frame video {
  width: 100%;
  display: block;
  background: #000;
}

/* Sections */

.section {
  padding: 5rem 0;
}

.section-alt {
  background: var(--bg-panel-alt);
}

.section-lead {
  text-align: center;
  max-width: 620px;
  margin: -0.5rem auto 2.5rem;
}

/* Features */

.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  margin-top: 2.5rem;
}

.feature-grid .reveal:nth-child(1) { transition-delay: 0ms; }
.feature-grid .reveal:nth-child(2) { transition-delay: 80ms; }
.feature-grid .reveal:nth-child(3) { transition-delay: 160ms; }
.feature-grid .reveal:nth-child(4) { transition-delay: 240ms; }
.feature-grid .reveal:nth-child(5) { transition-delay: 320ms; }
.feature-grid .reveal:nth-child(6) { transition-delay: 400ms; }

.feature-card {
  background: var(--bg-panel);
  border: 1px solid var(--border-glow);
  border-radius: 16px;
  padding: 1.75rem 1.5rem;
  text-align: center;
}

.feature-icon {
  width: 56px;
  height: 56px;
  display: block;
  margin: 0 auto 0.75rem;
}

.feature-card h3 {
  font-size: 1.05rem;
  margin-bottom: 0.4em;
}

.feature-card p {
  font-size: 0.92rem;
  margin: 0;
}

/* Gallery */

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

.gallery .reveal:nth-child(1) { transition-delay: 0ms; }
.gallery .reveal:nth-child(2) { transition-delay: 100ms; }
.gallery .reveal:nth-child(3) { transition-delay: 200ms; }
.gallery .reveal:nth-child(4) { transition-delay: 300ms; }
.gallery .reveal:nth-child(5) { transition-delay: 400ms; }

.gallery img {
  width: 100%;
  height: 220px;
  object-fit: cover;
  border-radius: 14px;
  border: 1px solid var(--border-glow);
}

.gallery img:first-child {
  grid-column: span 2;
  grid-row: span 2;
  height: 456px;
}

.gameplay-heading {
  margin-top: 3rem;
  text-align: center;
}

.gameplay-gallery {
  grid-template-columns: repeat(2, 1fr);
}

.gameplay-gallery img {
  height: 280px;
  object-fit: cover;
  object-position: top;
}

.gameplay-gallery img:first-child {
  grid-column: auto;
  grid-row: auto;
  height: 280px;
}

/* Beta / CTA section */

.section-cta {
  background: radial-gradient(ellipse at center, var(--bg-panel) 0%, var(--bg-deep) 75%);
  text-align: center;
}

.beta-inner { display: flex; flex-direction: column; align-items: center; }

.signup-form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
  margin-bottom: 1rem;
}

.signup-input {
  padding: 0.85rem 1.25rem;
  border-radius: 999px;
  border: 1px solid var(--border-glow);
  background: var(--bg-panel);
  color: var(--text-cream);
  font-family: var(--font-body);
  font-size: 0.95rem;
  min-width: 260px;
}

.signup-input::placeholder {
  color: var(--text-muted);
}

.signup-input:focus {
  outline: none;
  border-color: var(--accent-gold);
}

.hidden-field {
  position: absolute;
  left: -9999px;
}

.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;
}

/* Footer */

.site-footer {
  border-top: 1px solid var(--border-glow);
  padding: 2rem 0;
  text-align: center;
}

.footer-inner p {
  margin: 0.25rem 0;
  font-size: 0.9rem;
}

/* Responsive */

@media (max-width: 800px) {
  .feature-grid { grid-template-columns: repeat(2, 1fr); }
  .gallery { grid-template-columns: repeat(2, 1fr); }
  .gallery img:first-child { grid-column: span 2; height: 260px; }
  .gameplay-gallery img:first-child { grid-column: auto; height: 260px; }
  .site-nav { gap: 1rem; }
}

@media (max-width: 540px) {
  .feature-grid { grid-template-columns: 1fr; }
  .gallery { grid-template-columns: 1fr; }
  .gallery img:first-child { height: 220px; }
  .hero { padding: 5.5rem 0 4rem; }
  .site-nav a:nth-child(3) { display: none; }
}

/* Scroll reveal */

.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

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

@media (prefers-reduced-motion: reduce) {
  .hero-inner > *,
  .reveal {
    animation: none !important;
    transition: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
}

/* Ambient motes and critters */

.ambient {
  position: fixed;
  inset: 0;
  z-index: 2;
  overflow: hidden;
  pointer-events: none;
}

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

.mote {
  position: absolute;
  border-radius: 50%;
  background: radial-gradient(circle, currentColor 0%, transparent 70%);
  box-shadow: 0 0 4px 1px currentColor;
  animation: mote-flicker ease-in-out infinite;
}

@keyframes mote-flicker {
  0%, 100% { transform: translate(0, 0) scale(0.6); opacity: 0.05; }
  50% { transform: translate(var(--mote-dx, 6px), var(--mote-dy, -18px)) scale(1.1); opacity: 0.38; }
}

.critter {
  position: absolute;
  top: 0;
  left: 0;
  width: 0;
  height: 0;
  opacity: 0;
}

.critter-svg {
  width: 46px;
  height: 40px;
  display: block;
}

.critter.pip {
  animation: pip-fly 42s linear infinite;
}

.critter.pip .critter-svg {
  filter: drop-shadow(0 0 8px rgba(233, 216, 149, 0.45));
}

.critter.courier {
  animation: courier-fly 58s linear infinite;
  animation-delay: 14s;
}

.critter.courier .critter-svg {
  filter: drop-shadow(0 0 8px rgba(152, 200, 120, 0.4));
  transform: scaleX(-1);
}

@keyframes pip-fly {
  0% { transform: translate(-10vw, 22vh) scale(0.9); opacity: 0; }
  6% { opacity: 0.85; }
  22% { transform: translate(30vw, 10vh) scale(1); opacity: 0.85; }
  40% { transform: translate(70vw, 30vh) scale(0.95); opacity: 0.85; }
  47% { opacity: 0; }
  48%, 100% { transform: translate(110vw, 18vh) scale(0.9); opacity: 0; }
}

@keyframes courier-fly {
  0% { transform: translate(110vw, 65vh) scale(0.85); opacity: 0; }
  5% { opacity: 0.8; }
  24% { transform: translate(65vw, 48vh) scale(0.95); opacity: 0.8; }
  42% { transform: translate(15vw, 70vh) scale(0.9); opacity: 0.8; }
  49% { opacity: 0; }
  50%, 100% { transform: translate(-15vw, 60vh) scale(0.85); opacity: 0; }
}

@keyframes flap {
  from { transform: scaleX(1); }
  to { transform: scaleX(0.55); }
}

.pip-wing-l, .pip-wing-r, .courier-wing-top, .courier-wing-bottom {
  transform-box: fill-box;
  animation: flap ease-in-out infinite alternate;
}

.pip-wing-l { transform-origin: 100% 50%; animation-duration: 0.3s; }
.pip-wing-r { transform-origin: 0% 50%; animation-duration: 0.3s; }
.courier-wing-top, .courier-wing-bottom { transform-origin: 100% 50%; animation-duration: 0.26s; }

@media (prefers-reduced-motion: reduce) {
  .ambient { display: none; }
}
