/* Pleb the Squirrel — Quantum Gauntlet teaser
   ENDESGA-32 palette + rust-orange #E07A2F
   Self-contained: no CDNs, trackers, or remote fonts. */

@font-face {
  font-family: "Press Start 2P";
  src: url("fonts/PressStart2P.woff") format("woff");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #181425;
  --bg-2: #1e1730;
  --surface: #262b44;
  --line: #3a4466;
  --text: #ead4aa;
  --text-bright: #ffffff;
  --muted: #8b9bb4;
  --accent: #E07A2F;
  --accent-hot: #feae34;
  --gold: #fee761;
  --cyan: #2ce8f5;
  --error: #e43b44;
  --pink: #b55088;
  --shadow: #3e2731;
  --ink: #181425;
  --ground: #3a4466;
  --safe-x: max(1.25rem, env(safe-area-inset-left));
  --safe-r: max(1.25rem, env(safe-area-inset-right));
  --max: 68rem;
}

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

html {
  color-scheme: dark;
  background: var(--bg);
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(1200px 500px at 80% -10%, #3a4466 0%, transparent 60%),
    var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-text-size-adjust: 100%;
}

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

img.pixel {
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

a { color: var(--cyan); }
a:hover { color: var(--gold); }

:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 3px;
}

.pixel-type,
.kicker,
.brand-mode,
h1, h2,
.btn,
.btn-disabled,
.error-text,
.domains,
.foot-license,
.monitor-label {
  font-family: "Press Start 2P", ui-monospace, "Cascadia Mono", "Segoe UI Mono", monospace;
  font-weight: 400;
  letter-spacing: 0.02em;
  -webkit-font-smoothing: none;
  font-smooth: never;
}

.wrap {
  width: min(var(--max), 100%);
  margin-inline: auto;
  padding-inline: var(--safe-x) var(--safe-r);
}

/* —— Hero —— */
.hero {
  position: relative;
  padding-top: max(2rem, env(safe-area-inset-top));
  padding-bottom: 0;
  overflow: hidden;
}

.hero-grid {
  display: grid;
  gap: 1.5rem;
  align-items: end;
  padding-top: 1.75rem;
  padding-bottom: 2rem;
}

.kicker {
  display: block;
  font-size: 0.625rem;
  line-height: 1.8;
  color: var(--cyan);
  margin: 0 0 0.65rem;
  text-transform: uppercase;
}

.brand-mode {
  display: block;
  font-size: 0.75rem;
  line-height: 1.6;
  color: var(--accent);
  margin: 0 0 1.5rem;
  text-transform: uppercase;
}

h1 {
  margin: 0 0 1.25rem;
  color: var(--text-bright);
  font-size: 1rem;
  line-height: 1.45;
  text-transform: uppercase;
}

h1 .nah {
  display: block;
  margin-top: 0.7rem;
  color: var(--accent);
  font-size: 2rem;
  line-height: 1.1;
  text-transform: none;
}

.tagline {
  margin: 0;
  max-width: 28rem;
  color: var(--text);
  font-size: 1.05rem;
}

.hero-art {
  justify-self: center;
  width: min(22rem, 80vw);
}

.hero-art img {
  width: 100%;
  animation: bob 2.8s ease-in-out infinite;
}

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

.ground {
  height: 1.75rem;
  background:
    linear-gradient(var(--accent-hot), var(--accent-hot)) top / 100% 6px no-repeat,
    var(--ground);
  box-shadow: inset 20px 0 0 var(--accent);
}

/* —— Sections —— */
.section {
  padding: 2.75rem 0;
}

.section h2 {
  margin: 0 0 1rem;
  font-size: 0.8rem;
  line-height: 1.7;
  color: var(--text-bright);
  text-transform: uppercase;
}

.section p {
  margin: 0 0 1.25rem;
  color: var(--text);
  max-width: 38rem;
}

.section-play,
.section-links {
  background: var(--bg-2);
}

.shot {
  margin: 0 0 1.5rem;
  border: 4px solid var(--line);
  box-shadow: 0 0 0 4px var(--bg), 0 0 0 8px var(--accent);
  background: var(--ink);
}

.shot img {
  width: 100%;
  vertical-align: middle;
}

/* Boss error monitor */
.monitor {
  margin: 0;
  padding: 1.15rem 1rem 1.25rem;
  max-width: 38rem;
  background: #3e2731;
  border: 4px solid #a22633;
  box-shadow: inset 0 0 0 4px #181425;
  text-align: center;
}

.monitor-label {
  display: block;
  font-size: 0.55rem;
  color: #f6757a;
  letter-spacing: 0.16em;
  margin-bottom: 0.85rem;
  text-transform: uppercase;
}

.error-wrap {
  position: relative;
  display: inline-block;
}

.error-text {
  position: relative;
  display: inline-block;
  margin: 0;
  color: var(--cyan);
  font-size: clamp(0.7rem, 3.6vw, 1.05rem);
  line-height: 1.45;
  text-transform: uppercase;
  animation: glitch 2.4s steps(2, end) infinite;
}

.error-text::before,
.error-text::after {
  content: attr(data-text);
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  overflow: hidden;
  pointer-events: none;
}

.error-text::before {
  color: var(--error);
  animation: glitch-cut 2.4s infinite;
  clip-path: inset(0 0 58% 0);
}

.error-text::after {
  color: var(--gold);
  animation: glitch-cut-2 2.4s infinite;
  clip-path: inset(62% 0 0 0);
}

@keyframes glitch {
  0%, 88%, 100% { transform: none; text-shadow: none; }
  90% { transform: translate(-2px, 1px); text-shadow: -2px 0 var(--error), 2px 0 var(--cyan); }
  92% { transform: translate(2px, -1px); text-shadow: 2px 0 var(--error), -2px 0 var(--cyan); }
  94% { transform: translate(-1px, 0); text-shadow: -1px 0 var(--pink), 1px 0 var(--cyan); }
  96% { transform: none; }
}

@keyframes glitch-cut {
  0%, 88%, 100% { transform: none; opacity: 0.85; }
  90% { transform: translate(3px, 0); }
  93% { transform: translate(-3px, 0); }
}

@keyframes glitch-cut-2 {
  0%, 88%, 100% { transform: none; opacity: 0.85; }
  91% { transform: translate(-3px, 0); }
  94% { transform: translate(3px, 0); }
}

/* —— Play CTA —— */
.btn {
  display: inline-block;
  text-decoration: none;
  text-align: center;
  border: 4px solid var(--text);
  padding: 1rem 1.15rem;
  line-height: 1.55;
  cursor: pointer;
}

.btn-play {
  color: var(--ink);
  background: var(--accent);
  box-shadow: 0 6px 0 var(--shadow);
  font-size: 0.75rem;
  width: 100%;
  max-width: 26rem;
}

.btn-play:hover,
.btn-play:focus-visible {
  background: var(--accent-hot);
  color: var(--ink);
  transform: translateY(2px);
  box-shadow: 0 4px 0 var(--shadow);
}

.btn-play:active {
  transform: translateY(6px);
  box-shadow: 0 0 0 var(--shadow);
}

.play-note {
  margin: 1rem 0 0;
  color: var(--muted);
  font-size: 0.95rem;
}

/* —— Links row —— */
.links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.btn-ghost,
.btn-disabled {
  font-size: 0.55rem;
  line-height: 1.6;
  padding: 0.85rem 0.9rem;
  min-height: 3rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-ghost {
  color: var(--text);
  background: var(--surface);
  border-color: var(--line);
  box-shadow: 0 4px 0 #181425;
}

.btn-ghost:hover,
.btn-ghost:focus-visible {
  color: var(--gold);
  border-color: var(--accent);
}

.btn-disabled {
  color: #5a6988;
  background: #1a1d30;
  border-color: #3a4466;
  box-shadow: none;
  cursor: not-allowed;
  opacity: 0.72;
  user-select: none;
}

/* —— Footer —— */
.site-footer {
  padding: 2rem 0 max(2.5rem, env(safe-area-inset-bottom));
  border-top: 6px solid var(--accent-hot);
  background: var(--bg);
  color: var(--muted);
  font-size: 0.875rem;
}

.site-footer p { margin: 0 0 0.85rem; max-width: none; }

.foot-license {
  font-size: 0.55rem;
  line-height: 1.7;
  color: var(--text);
}

.domains {
  font-size: 0.5rem;
  line-height: 1.9;
  color: var(--muted);
  word-break: break-word;
}

.domains li { list-style: none; }
.domains ul, .domains {
  margin: 1rem 0 0;
  padding: 0;
}

/* —— 404 —— */
.page-404 {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.page-404 main {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 3rem var(--safe-x) 2rem;
}

.page-404 .hero-art {
  width: min(16rem, 70vw);
  margin: 1.5rem auto;
}

.page-404 h1 {
  font-size: 0.8rem;
  text-transform: uppercase;
}

/* —— Desktop —— */
@media (min-width: 720px) {
  h1 { font-size: 1.5rem; }
  h1 .nah { font-size: 3rem; }
  .kicker { font-size: 0.7rem; }
  .brand-mode { font-size: 0.9rem; }
  .hero-grid {
    grid-template-columns: 1fr min(24rem, 42%);
    gap: 2rem;
    padding-top: 3rem;
    padding-bottom: 0;
    align-items: end;
  }
  .hero-copy { align-self: center; padding-bottom: 1.5rem; }
  .hero-art { justify-self: end; width: 100%; margin-bottom: 0; }
  .btn-play {
    width: auto;
    font-size: 0.85rem;
    padding: 1.15rem 1.5rem;
  }
  .section { padding: 3.5rem 0; }
  .section h2 { font-size: 0.95rem; }
  .error-text { font-size: 1.15rem; }
  .btn-ghost, .btn-disabled { font-size: 0.6rem; }
  .page-404 main { padding-top: 1.5rem; padding-bottom: 0.75rem; }
  .page-404 .hero-art { width: min(11.5rem, 28vw); margin: 0.6rem auto; }
  .page-404 .site-footer { padding-top: 1.1rem; padding-bottom: 1.1rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hero-art img { animation: none; }
  .error-text,
  .error-text::before,
  .error-text::after {
    animation: none;
  }
  .error-text::before,
  .error-text::after { content: none; }
  .btn-play { transition: none; }
  .btn-play:hover,
  .btn-play:focus-visible,
  .btn-play:active {
    transform: none;
    box-shadow: 0 6px 0 var(--shadow);
  }
}
