/* Smashtop landing page. Shared by index.html and 404.html.
   Colours match the game's menu. No web fonts: the system font stack only. */

:root {
  --bg: #1a1a1f;
  --bg-deep: #141418;
  --panel: #26262c;
  --panel-2: #2e2e35;
  --line: #3a3a43;
  --text: #f5f5f5;
  --dim: #a5a5ae;
  --accent: #ffaa78;
  --accent-hi: #ffbe96;
  --accent-ink: #1a1a1f;
  --accent-soft: rgba(255, 170, 120, 0.12);
  --radius: 16px;
  --radius-sm: 10px;
  --wrap: 1180px;
  --gutter: 16px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, Ubuntu, Cantarell, "Noto Sans",
    "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji";
  --mono: ui-monospace, "Cascadia Code", "Segoe UI Mono", Consolas, "SF Mono", Menlo,
    "Liberation Mono", monospace;
  color-scheme: dark;
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.6;
  overflow-wrap: break-word;
}

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

a {
  color: var(--accent);
  text-underline-offset: 0.18em;
  text-decoration-thickness: 1px;
}

a:hover {
  color: var(--accent-hi);
}

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
  border-radius: 6px;
}

h1,
h2,
h3 {
  line-height: 1.15;
  margin: 0 0 0.5em;
  letter-spacing: -0.01em;
}

h2 {
  font-size: clamp(1.75rem, 1.2rem + 2.2vw, 2.6rem);
}

h3 {
  font-size: 1.15rem;
}

p {
  margin: 0 0 1em;
}

code,
kbd,
pre {
  font-family: var(--mono);
  font-size: 0.92em;
}

code {
  background: var(--panel-2);
  border-radius: 6px;
  padding: 0.1em 0.4em;
  overflow-wrap: anywhere;
}

kbd {
  display: inline-block;
  min-width: 1.9em;
  padding: 0 0.42em;
  border: 1px solid var(--line);
  border-bottom-width: 2px;
  border-radius: 6px;
  background: var(--panel-2);
  color: var(--text);
  text-align: center;
  font-size: 0.8em;
  line-height: 1.45;
  white-space: nowrap;
  vertical-align: 0.06em;
}

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

.skip {
  position: absolute;
  left: var(--gutter);
  top: -100px;
  z-index: 100;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 700;
}

.skip:focus {
  top: 12px;
}

.wrap {
  width: 100%;
  max-width: calc(var(--wrap) + 2 * var(--gutter));
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* ---------- Header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(26, 26, 31, 0.86);
  border-bottom: 1px solid rgba(58, 58, 67, 0.6);
  -webkit-backdrop-filter: saturate(140%) blur(10px);
  backdrop-filter: saturate(140%) blur(10px);
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 60px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}

.brand:hover {
  color: var(--text);
}

.brand img {
  width: 30px;
  height: 30px;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 4px;
}

.site-nav a:not(.btn) {
  display: none;
  padding: 8px 12px;
  border-radius: 8px;
  color: var(--dim);
  text-decoration: none;
  font-size: 0.95rem;
}

.site-nav a:not(.btn):hover {
  color: var(--text);
  background: var(--panel);
}

@media (min-width: 760px) {
  .site-nav a:not(.btn) {
    display: inline-block;
  }
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 24px;
  border: 1px solid transparent;
  border-radius: 12px;
  font: inherit;
  font-weight: 700;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.15s ease, background-color 0.15s ease, border-color 0.15s ease,
    box-shadow 0.15s ease;
}

.btn svg {
  width: 20px;
  height: 20px;
  flex: none;
}

.btn-primary {
  background: var(--accent);
  color: var(--accent-ink);
  box-shadow: 0 8px 28px -10px rgba(255, 170, 120, 0.7);
}

.btn-primary:hover {
  background: var(--accent-hi);
  color: var(--accent-ink);
  transform: translateY(-1px);
  box-shadow: 0 12px 32px -10px rgba(255, 170, 120, 0.85);
}

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

.btn-ghost {
  border-color: var(--line);
  color: var(--text);
  background: transparent;
}

.btn-ghost:hover {
  border-color: var(--accent);
  color: var(--text);
  background: var(--accent-soft);
}

.btn-sm {
  padding: 8px 14px;
  border-radius: 10px;
  font-size: 0.95rem;
}

/* ---------- Hero ---------- */

.hero {
  position: relative;
  padding: 48px 0 40px;
  overflow: hidden;
}

.hero::before {
  /* A warm glow behind the screenshot, like the light off a blast. */
  content: "";
  position: absolute;
  inset: -20% -10% auto auto;
  width: 70vw;
  height: 70vw;
  max-width: 900px;
  max-height: 900px;
  background: radial-gradient(closest-side, rgba(255, 170, 120, 0.16), transparent);
  pointer-events: none;
}

.hero .wrap {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 40px;
  align-items: center;
}

.hero-icon {
  width: 88px;
  height: 88px;
  margin-bottom: 18px;
  filter: drop-shadow(0 10px 24px rgba(0, 0, 0, 0.45));
}

.eyebrow {
  margin-bottom: 10px;
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.hero h1 {
  margin-bottom: 12px;
  font-size: clamp(2.5rem, 1.6rem + 4.4vw, 4.4rem);
  letter-spacing: -0.025em;
}

.tagline {
  margin-bottom: 16px;
  color: var(--text);
  font-size: clamp(1.3rem, 1.05rem + 1.1vw, 1.75rem);
  font-weight: 600;
  line-height: 1.3;
}

.lead {
  max-width: 34em;
  color: var(--dim);
  font-size: 1.125rem;
}

.cta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 28px 0 14px;
}

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

.hero-shot {
  margin: 0;
}

.hero-shot a {
  display: block;
  border-radius: var(--radius);
}

.hero-shot img {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 30px 80px -30px rgba(0, 0, 0, 0.9), 0 0 0 6px rgba(38, 38, 44, 0.8);
}

.hero-shot figcaption {
  margin-top: 14px;
  color: var(--dim);
  font-size: 0.9rem;
  text-align: center;
}

@media (min-width: 960px) {
  .hero {
    padding: 72px 0 64px;
  }

  .hero .wrap {
    grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
    gap: 56px;
  }

  .hero-shot img {
    transform: perspective(1600px) rotateY(-6deg) rotateX(2deg);
    transition: transform 0.4s ease;
  }

  .hero-shot a:hover img {
    transform: perspective(1600px) rotateY(-2deg) rotateX(1deg);
  }
}

/* ---------- Sections ---------- */

.section {
  padding: 64px 0;
}

.section-alt {
  background: var(--bg-deep);
  border-block: 1px solid #222228;
}

.section-head {
  max-width: 46em;
  margin-bottom: 32px;
}

.section-head p {
  color: var(--dim);
  font-size: 1.1rem;
}

.kicker {
  display: block;
  margin-bottom: 8px;
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

@media (min-width: 960px) {
  .section {
    padding: 96px 0;
  }
}

/* ---------- Gallery ---------- */

.gallery {
  display: grid;
  gap: 20px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.shot {
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
}

.shot a {
  display: block;
  overflow: hidden;
}

.shot img {
  width: 100%;
  transition: transform 0.35s ease;
}

.shot a:hover img {
  transform: scale(1.025);
}

.shot a:focus-visible {
  outline-offset: -4px;
}

.shot figcaption {
  padding: 14px 18px 16px;
  color: var(--dim);
  font-size: 0.95rem;
}

.shot figcaption strong {
  color: var(--text);
}

@media (min-width: 760px) {
  .gallery {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px;
  }

  .gallery .wide {
    grid-column: 1 / -1;
  }
}

/* ---------- Weapons ---------- */

.weapons {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
  gap: 14px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.weapon {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  gap: 2px 14px;
  align-items: start;
  align-content: start;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.weapon:hover {
  border-color: rgba(255, 170, 120, 0.55);
  transform: translateY(-2px);
}

.weapon-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.weapon h3 {
  margin: 0;
  font-size: 1.08rem;
}

.weapon kbd {
  flex: none;
  color: var(--accent);
}

.weapon p {
  grid-column: 2;
  margin: 0;
  color: var(--dim);
  font-size: 0.95rem;
  line-height: 1.5;
}

.kinds {
  grid-column: 2;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
}

.kinds li {
  padding: 2px 9px;
  border-radius: 999px;
  background: rgba(255, 170, 120, 0.12);
  color: var(--accent);
  font-size: 0.78rem;
  line-height: 1.6;
}

.wicon {
  grid-row: span 2;
  width: 52px;
  height: 52px;
  border-radius: 12px;
  background-color: #1e1e23;
  background-image: url("assets/weapons.png");
  background-repeat: no-repeat;
  background-size: 640px 40px;
  border: 1px solid #33333b;
  /* Each icon is a 40px square in the strip; --i picks which. */
  background-position: calc(5px - var(--i, 0) * 40px) 5px;
}

.w-hammer { --i: 0; }
.w-gun { --i: 1; }
.w-flame { --i: 2; }
.w-laser { --i: 3; }
.w-grenade { --i: 4; }
.w-bugs { --i: 5; }
.w-lightning { --i: 6; }
.w-blackhole { --i: 7; }
.w-spray { --i: 8; }
.w-acid { --i: 9; }
.w-chainsaw { --i: 10; }
.w-cleaner { --i: 11; }
.w-virus { --i: 12; }
.w-meteor { --i: 13; }
.w-nuke { --i: 14; }
.w-pandas { --i: 15; }

.weapon.nuke {
  border-color: rgba(255, 170, 120, 0.35);
  background: linear-gradient(135deg, rgba(255, 170, 120, 0.1), var(--panel) 60%);
}

.weapon.pandas {
  border-color: rgba(150, 210, 110, 0.35);
  background: linear-gradient(135deg, rgba(150, 210, 110, 0.1), var(--panel) 60%);
}

.note {
  margin-top: 24px;
  color: var(--dim);
  font-size: 0.95rem;
}

/* ---------- Safety ---------- */

.facts {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr));
  gap: 16px;
  margin: 0 0 48px;
  padding: 0;
  list-style: none;
}

.fact {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
}

.fact svg {
  display: block;
  width: 40px;
  height: 40px;
  padding: 8px;
  margin-bottom: 14px;
  border-radius: 10px;
  background: var(--accent-soft);
  color: var(--accent);
}

.fact h3 {
  margin-bottom: 6px;
}

.fact p {
  margin: 0;
  color: var(--dim);
  font-size: 0.97rem;
}

.paths {
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
  font-size: 0.9rem;
}

.paths li {
  margin-top: 8px;
  color: var(--dim);
}

.paths code {
  display: inline-block;
  margin-bottom: 2px;
  color: var(--text);
  word-break: break-all;
}

.details {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
}

.detail {
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg);
}

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

.detail h3 {
  font-size: 1.2rem;
}

.detail p,
.detail li {
  color: var(--dim);
}

.detail p:last-child {
  margin-bottom: 0;
}

.detail strong {
  color: var(--text);
}

.steps {
  margin: 0 0 1em;
  padding: 0;
  list-style: none;
  counter-reset: step;
}

.steps li {
  position: relative;
  margin-bottom: 10px;
  padding-left: 40px;
  color: var(--text);
  counter-increment: step;
}

.steps li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 0.85rem;
  font-weight: 800;
}

.ui-label {
  padding: 0.05em 0.45em;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel-2);
  color: var(--text);
  font-size: 0.94em;
  font-weight: 600;
  white-space: nowrap;
}

/* ---------- Controls ---------- */

.menu-figure {
  margin: 0 0 36px;
}

.menu-figure img {
  width: 100%;
  max-width: 1100px;
  margin-inline: auto;
}

.menu-figure .tray {
  width: 71%;
  max-width: 780px;
  margin-top: 4px;
}

.menu-figure figcaption {
  max-width: 46em;
  margin: 12px auto 0;
  color: var(--dim);
  font-size: 0.95rem;
  text-align: center;
}

.controls-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

@media (min-width: 900px) {
  .controls-grid {
    grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
    gap: 40px;
  }
}

.keys {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.98rem;
}

.keys th,
.keys td {
  padding: 11px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.keys thead th {
  color: var(--dim);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.keys tbody th {
  width: 42%;
  font-weight: 400;
}

.keys td {
  color: var(--dim);
}

.keys kbd {
  margin: 2px 2px 2px 0;
}

.tips {
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
}

.tips h3 {
  margin-bottom: 12px;
}

.tips ul {
  margin: 0;
  padding-left: 1.1em;
  color: var(--dim);
}

.tips li {
  margin-bottom: 10px;
}

.tips li::marker {
  color: var(--accent);
}

/* ---------- Download band ---------- */

.download-band {
  position: relative;
  overflow: hidden;
  padding: 44px 24px;
  border: 1px solid rgba(255, 170, 120, 0.35);
  border-radius: 24px;
  background:
    radial-gradient(120% 140% at 100% 0%, rgba(255, 170, 120, 0.18), transparent 60%),
    var(--panel);
  text-align: center;
}

.download-band img {
  width: 72px;
  height: 72px;
  margin: 0 auto 14px;
}

.download-band p {
  max-width: 40em;
  margin-inline: auto;
  color: var(--dim);
}

.download-band .cta {
  justify-content: center;
}

/* ---------- Credits ---------- */

.credits {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
}

@media (min-width: 900px) {
  .credits {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.credits .detail h3 {
  font-size: 1.1rem;
}

/* ---------- Footer ---------- */

.site-footer {
  padding: 36px 0 44px;
  border-top: 1px solid #222228;
  background: var(--bg-deep);
  color: var(--dim);
  font-size: 0.92rem;
}

.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 24px;
}

.site-footer p {
  margin: 0;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  margin: 0;
  padding: 0;
  list-style: none;
}

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

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

/* ---------- Lightbox (only ever opened by the script) ---------- */

.lightbox {
  width: min(96vw, 1600px);
  max-width: none;
  max-height: 96vh;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-deep);
  color: var(--text);
  cursor: zoom-out;
}

.lightbox::backdrop {
  background: rgba(10, 10, 12, 0.88);
}

.lightbox img {
  width: 100%;
  max-height: calc(96vh - 70px);
  object-fit: contain;
}

.lightbox p {
  margin: 0;
  padding: 12px 56px 14px 18px;
  color: var(--dim);
  font-size: 0.92rem;
}

.lb-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: rgba(20, 20, 24, 0.85);
  color: var(--text);
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
}

/* ---------- 404 ---------- */

.lost {
  display: grid;
  place-items: center;
  min-height: calc(100vh - 160px);
  padding: 56px 0;
  text-align: center;
}

.lost img {
  width: 128px;
  height: 128px;
  margin: 0 auto 20px;
  transform: rotate(-8deg);
}

.lost h1 {
  font-size: clamp(2.2rem, 1.6rem + 3vw, 3.4rem);
}

.lost p {
  max-width: 32em;
  margin-inline: auto;
  color: var(--dim);
  font-size: 1.1rem;
}

.lost .cta {
  justify-content: center;
}

.lost .big-code {
  margin-bottom: 4px;
  color: var(--accent);
  font-family: var(--mono);
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.2em;
}

/* ---------- Motion ---------- */

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

  *,
  *::before,
  *::after {
    transition: none !important;
    animation: none !important;
  }

  .hero-shot img,
  .hero-shot a:hover img,
  .shot a:hover img,
  .weapon:hover,
  .btn-primary:hover {
    transform: none !important;
  }
}

@media print {
  .site-header,
  .lightbox {
    display: none;
  }
}

/* ---------- Very narrow phones ---------- */

@media (max-width: 359px) {
  .site-header .wrap {
    gap: 8px;
  }

  .brand {
    gap: 8px;
    font-size: 0.95rem;
  }

  .btn-sm {
    padding: 8px 10px;
  }
}
