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

:root {
  --bg: #0e1118;
  --bg-elevated: #161b26;
  --text: #e8ecf4;
  --muted: #8b95a8;
  --accent: #ff6b35;
  --accent-soft: rgba(255, 107, 53, 0.15);
  --sky: #3d8bfd;
  --ground: #2d4a2f;
  --ground-top: #5a8f5e;
  --font: "DM Sans", system-ui, sans-serif;
  --font-display: "Space Grotesk", var(--font);
  --radius: 14px;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
}

html {
  scroll-behavior: smooth;
}

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

  .stage__cloud--1,
  .stage__cloud--2,
  .stage__cloud--3 {
    animation: none;
  }

  .stage__hill--far,
  .stage__hill--mid {
    animation: none;
  }

  .stage.playing .stage__ground-scroll {
    animation: none;
  }

  .stage.playing .hero-sprite,
  .stage.playing .hero-sprite__bob,
  .stage.playing .trap-net,
  .stage.playing .smw-hero__run--a,
  .stage.playing .smw-hero__run--b {
    animation: none !important;
  }

  .stage.playing .hero-sprite {
    left: 50%;
    bottom: 26%;
    transform: translateX(-50%) scale(0.55);
  }

  .stage.playing .smw-hero__run--a {
    opacity: 1;
  }

  .stage.playing .smw-hero__run--b {
    opacity: 0;
  }

  .stage.playing .trap-net {
    opacity: 1;
    top: 6%;
  }
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  font-size: 1.05rem;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
  background-image: radial-gradient(
      ellipse 120% 80% at 50% -20%,
      #1a2740 0%,
      transparent 55%
    ),
    radial-gradient(ellipse 80% 50% at 100% 50%, #1e1a35 0%, transparent 45%);
}

.noise {
  pointer-events: none;
  position: fixed;
  inset: 0;
  opacity: 0.04;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  z-index: 9999;
}

/* --- Header --- */
.site-header {
  max-width: 960px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem 1rem;
  text-align: center;
}

.logo {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.75rem;
  letter-spacing: -0.03em;
  color: var(--text);
  text-decoration: none;
}

.logo__dot {
  color: var(--accent);
}

.tagline {
  margin: 0.35rem 0 0;
  font-size: 0.95rem;
  color: var(--muted);
}

/* --- Main --- */
main {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 1.5rem 4rem;
}

.hero {
  text-align: center;
  padding: 1rem 0 2.5rem;
}

.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 4vw, 2.35rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  margin: 0 0 0.75rem;
  line-height: 1.15;
}

.lede {
  margin: 0 auto;
  max-width: 36rem;
  color: var(--muted);
}

/* --- Featured short --- */
.featured {
  display: grid;
  gap: 1.75rem;
  margin-bottom: 3.5rem;
}

@media (min-width: 800px) {
  .featured {
    grid-template-columns: 1fr 1.15fr;
    align-items: start;
  }
}

.featured__intro h2 {
  font-family: var(--font-display);
  font-size: 1.35rem;
  margin: 0 0 0.5rem;
  letter-spacing: -0.02em;
}

.featured__intro p {
  margin: 0 0 1.25rem;
  color: var(--muted);
  font-size: 0.98rem;
}

.btn {
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  border: none;
  border-radius: 999px;
  padding: 0.65rem 1.35rem;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

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

.btn--primary {
  background: var(--accent);
  color: #1a0f0a;
  box-shadow: 0 4px 20px rgba(255, 107, 53, 0.35);
}

.btn--primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 28px rgba(255, 107, 53, 0.45);
}

.btn--primary:active {
  transform: translateY(0);
}

/* --- Stage (Super Mario World–inspired 16-bit look) --- */
.stage--smw {
  position: relative;
  height: 320px;
  border-radius: var(--radius);
  overflow: hidden;
  background: #101010;
  box-shadow: var(--shadow), inset 0 0 0 3px #202830, inset 0 0 0 5px #485860;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

/* SNES-style sky band */
.stage__sky {
  position: absolute;
  inset: 0 0 38%;
  background: linear-gradient(
    180deg,
    #2030c8 0%,
    #5c94fc 18%,
    #7cb4fc 55%,
    #b8e0ff 100%
  );
}

/* Distant rounded hills */
.stage__parallax {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 38%;
  height: 30%;
  pointer-events: none;
  z-index: 1;
}

.stage__hill {
  position: absolute;
  left: -8%;
  width: 116%;
  border-radius: 50% 50% 0 0 / 100% 100% 0 0;
}

.stage__hill--far {
  bottom: 8%;
  height: 42%;
  background: linear-gradient(180deg, #40b848 0%, #209028 100%);
  opacity: 0.88;
  animation: hill-sway 28s ease-in-out infinite alternate;
}

.stage__hill--mid {
  bottom: 0;
  height: 28%;
  background: linear-gradient(180deg, #58d058 0%, #38b038 55%, #209028 100%);
  opacity: 0.98;
  animation: hill-sway 22s ease-in-out infinite alternate-reverse;
}

@keyframes hill-sway {
  from {
    transform: translateX(-6px);
  }
  to {
    transform: translateX(6px);
  }
}

/* Puffy SMW-style clouds */
.stage__cloud {
  position: absolute;
  z-index: 2;
  background: #f8f8f8;
  border-radius: 20px;
  box-shadow: 18px 6px 0 -2px #f8f8f8, -16px 8px 0 -4px #f8f8f8,
    32px 4px 0 -6px #e8e8e8;
}

.stage__cloud--1 {
  top: 14%;
  left: 8%;
  width: 56px;
  height: 22px;
  animation: cloud-drift 22s linear infinite;
}

.stage__cloud--2 {
  top: 22%;
  left: 48%;
  width: 40px;
  height: 17px;
  animation: cloud-drift 30s linear infinite reverse;
}

.stage__cloud--3 {
  top: 18%;
  right: 6%;
  width: 52px;
  height: 20px;
  animation: cloud-drift 26s linear infinite;
}

@keyframes cloud-drift {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(36px);
  }
}

/* Bush silhouettes */
.stage__bush {
  position: absolute;
  bottom: 38%;
  z-index: 2;
  width: 72px;
  height: 28px;
  background: #109018;
  border-radius: 50% 50% 40% 40%;
  box-shadow: 24px 6px 0 -4px #109018, -20px 8px 0 -6px #088010;
}

.stage__bush--1 {
  left: 4%;
}

.stage__bush--2 {
  right: 10%;
  transform: scale(0.85);
}

/* Ground: scrolling dirt + grass lip (SMW vibe) */
.stage__ground {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 38%;
  z-index: 4;
  display: flex;
  flex-direction: column;
}

.stage__ground-scroll {
  flex: 1;
  min-height: 0;
  background-color: #884010;
  background-image: repeating-linear-gradient(
      90deg,
      rgba(0, 0, 0, 0.22) 0 2px,
      transparent 2px 4px
    ),
    repeating-linear-gradient(0deg, rgba(0, 0, 0, 0.18) 0 2px, transparent 2px 4px);
  background-size: 8px 8px;
  animation: smw-ground-scroll 14s linear infinite;
}

.stage.playing .stage__ground-scroll {
  animation-duration: 1.1s;
}

@keyframes smw-ground-scroll {
  from {
    background-position: 0 0;
  }
  to {
    background-position: -32px 0;
  }
}

.stage__ground-top {
  height: 16px;
  flex-shrink: 0;
  background: repeating-linear-gradient(
      90deg,
      #00c800 0 6px,
      #00a000 6px 12px
    );
  border-bottom: 3px solid #007000;
  box-shadow: inset 0 -2px 0 #58f058;
}

.stage__ground-dirt {
  display: none;
}

.stage__caption--smw {
  font-family: "Press Start 2P", ui-monospace, monospace;
  font-size: 0.55rem;
  line-height: 1.6;
  max-width: 96%;
  text-align: center;
  white-space: normal;
  color: #fff8e0;
  text-shadow: 2px 2px 0 #181818, -1px -1px 0 #181818;
  z-index: 12;
}

@media (min-width: 520px) {
  .stage__caption--smw {
    font-size: 0.62rem;
  }
}

/* Pixel plumber (inline SVG) */
.hero-sprite {
  position: absolute;
  bottom: 38%;
  left: 6%;
  width: 96px;
  height: 96px;
  z-index: 6;
  transform-origin: 50% 100%;
  -webkit-font-smoothing: none;
}

.hero-sprite__bob {
  width: 100%;
  height: 100%;
  position: relative;
}

.smw-hero__svg {
  width: 100%;
  height: 100%;
  display: block;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  filter: drop-shadow(3px 3px 0 rgba(0, 0, 0, 0.45));
  overflow: visible;
}


.smw-hero__run--b {
  opacity: 0;
}

.stage.playing .hero-sprite__bob {
  animation: smw-bob 0.28s steps(2) infinite;
}

.stage.playing .smw-hero__run--a {
  animation: smw-frame-a 0.2s steps(2) infinite;
}

.stage.playing .smw-hero__run--b {
  animation: smw-frame-b 0.2s steps(2) infinite;
}

@keyframes smw-bob {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-4px);
  }
}

@keyframes smw-frame-a {
  0%,
  49% {
    opacity: 1;
  }
  50%,
  100% {
    opacity: 0;
  }
}

@keyframes smw-frame-b {
  0%,
  49% {
    opacity: 0;
  }
  50%,
  100% {
    opacity: 1;
  }
}

/* Trap */
.trap-net {
  position: absolute;
  top: -140px;
  left: 50%;
  width: 112px;
  height: 112px;
  margin-left: -56px;
  z-index: 8;
  opacity: 0;
  pointer-events: none;
  image-rendering: pixelated;
}

.trap-net__rope {
  display: block;
  width: 4px;
  height: 44px;
  margin: 0 auto;
  background: linear-gradient(90deg, #382010, #684030, #382010);
  border: 1px solid #181818;
}

.trap-net__mesh {
  display: block;
  width: 100%;
  height: 76px;
  margin-top: -2px;
  background: repeating-linear-gradient(
      90deg,
      rgba(255, 255, 255, 0.45) 0 3px,
      transparent 3px 8px
    ),
    repeating-linear-gradient(
      0deg,
      rgba(255, 255, 255, 0.35) 0 3px,
      transparent 3px 8px
    ),
    #686880;
  border: 4px solid #181818;
  border-radius: 4px 4px 10px 10px;
  box-shadow: inset 2px 2px 0 rgba(255, 255, 255, 0.2),
    inset -2px -2px 0 rgba(0, 0, 0, 0.35);
}

.stage.playing .hero-sprite {
  animation: hero-run-caught 10s cubic-bezier(0.45, 0, 0.2, 1) forwards;
}

.stage.playing .trap-net {
  animation: net-drop 10s cubic-bezier(0.34, 1.2, 0.64, 1) forwards;
}

@keyframes hero-run-caught {
  0% {
    left: 6%;
    bottom: 38%;
    transform: rotate(0deg) scale(1);
  }
  8% {
    bottom: 50%;
  }
  14% {
    bottom: 38%;
  }
  45% {
    left: 56%;
    bottom: 38%;
    transform: rotate(0deg) scale(1);
  }
  52% {
    left: 60%;
    bottom: 56%;
    transform: rotate(-12deg) scale(1);
  }
  58% {
    left: 64%;
    bottom: 38%;
    transform: rotate(0deg) scale(1);
  }
  68% {
    left: 66%;
    bottom: 38%;
  }
  78% {
    left: 50%;
    bottom: 36%;
    transform: translateX(-50%) scale(0.92) rotate(10deg);
  }
  88% {
    left: 50%;
    bottom: 34%;
    transform: translateX(-50%) scale(0.82) rotate(-8deg);
  }
  100% {
    left: 50%;
    bottom: 32%;
    transform: translateX(-50%) scale(0.72) rotate(0deg);
  }
}

@keyframes net-drop {
  0%,
  62% {
    opacity: 0;
    top: -140px;
  }
  63% {
    opacity: 1;
  }
  76% {
    top: 5%;
    opacity: 1;
  }
  100% {
    top: 5%;
    opacity: 1;
  }
}

/* --- Cards --- */
.grid-section h2 {
  font-family: var(--font-display);
  font-size: 1.25rem;
  margin: 0 0 0.35rem;
}

.grid-section__sub {
  margin: 0 0 1.5rem;
  color: var(--muted);
  font-size: 0.95rem;
}

.card-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 1rem;
}

@media (min-width: 600px) {
  .card-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.card {
  background: var(--bg-elevated);
  border-radius: var(--radius);
  padding: 1.25rem;
  border: 1px solid rgba(255, 255, 255, 0.06);
  transition: border-color 0.2s ease, background 0.2s ease;
}

.card:hover {
  border-color: rgba(255, 107, 53, 0.35);
  background: rgba(22, 27, 38, 0.95);
}

.card__title {
  font-family: var(--font-display);
  font-size: 1rem;
  margin: 0 0 0.5rem;
  color: var(--text);
}

.card__text {
  margin: 0;
  font-size: 0.9rem;
  color: var(--muted);
}

/* --- Footer --- */
.site-footer {
  max-width: 960px;
  margin: 0 auto;
  padding: 2rem 1.5rem 3rem;
  text-align: center;
}

.site-footer p {
  margin: 0;
  font-size: 0.85rem;
  color: var(--muted);
}
