/* Ghost Defense TD — global stylesheet.
 * Mobile-first, dark/neon theme matching the game's aesthetic.
 * No preprocessor; one file; small and auditable.
 */

:root {
  --bg: #0a0a1a;
  --bg-elevated: #11112a;
  --fg: #e6e6f5;
  --fg-muted: #8a8aa8;
  --accent: #0ff;
  --accent-soft: #5eead4;
  --danger: #ff3b6b;
  --border: #1f1f3a;
  --radius: 6px;
  --maxw: 64rem;
  --gap: 1rem;
  --gap-lg: 2rem;
}

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

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

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 17px;
  line-height: 1.55;
  color: var(--fg);
  background:
    radial-gradient(circle at 20% 0%, rgba(0, 255, 255, 0.06), transparent 40%),
    radial-gradient(circle at 80% 100%, rgba(94, 234, 212, 0.04), transparent 50%),
    var(--bg);
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

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

a:hover,
a:focus-visible {
  color: var(--accent-soft);
}

a:focus-visible,
button:focus-visible,
input:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 3px;
}

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

h1, h2, h3 {
  line-height: 1.15;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 0 0 0.6em;
}

h1 { font-size: clamp(2rem, 5vw + 1rem, 3.5rem); }
h2 { font-size: clamp(1.4rem, 2vw + 1rem, 2rem); }
h3 { font-size: 1.15rem; }

p { margin: 0 0 1em; }

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

.site-header {
  display: flex;
  align-items: center;
  gap: var(--gap);
  padding: 1rem clamp(1rem, 4vw, 2rem);
  border-bottom: 1px solid var(--border);
  background: rgba(10, 10, 26, 0.85);
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(8px);
  flex-wrap: wrap;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--fg);
  text-decoration: none;
  font-weight: 700;
  font-size: 1.1rem;
}

.brand-mark {
  width: 1.6rem;
  height: 1.6rem;
  border-radius: 4px;
  background:
    linear-gradient(135deg, var(--accent), var(--accent-soft));
  box-shadow: 0 0 12px rgba(0, 255, 255, 0.5);
}

.site-nav {
  display: flex;
  gap: 1.2rem;
  font-size: 0.95rem;
  margin-left: auto;
}

.site-nav a {
  color: var(--fg-muted);
  text-decoration: none;
}

.site-nav a:hover,
.site-nav a:focus-visible {
  color: var(--accent);
}

.lang-switch {
  margin-left: 0.5rem;
  padding: 0.25rem 0.55rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--fg-muted);
  text-decoration: none;
  font-size: 0.85rem;
  letter-spacing: 0.05em;
}

.lang-switch:hover,
.lang-switch:focus-visible {
  border-color: var(--accent);
  color: var(--accent);
}

/* ---- Main ---- */

main {
  flex: 1 0 auto;
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: clamp(1.5rem, 5vw, 3rem) clamp(1rem, 4vw, 2rem);
}

.page > h1 {
  margin-top: 0;
}

/* ---- Hero (home) ---- */

.hero {
  display: grid;
  gap: var(--gap-lg);
  margin: 0 0 var(--gap-lg);
}

.hero-title {
  margin: 0 0 0.4em;
  background: linear-gradient(120deg, var(--accent), var(--accent-soft));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-pitch {
  font-size: 1.15rem;
  color: var(--fg);
  max-width: 40ch;
}

/* ---- Install buttons ---- */

.install-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: var(--gap);
}

.install-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.85rem 1.4rem;
  border-radius: var(--radius);
  font-weight: 600;
  text-decoration: none;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--fg);
  min-width: 12rem;
  justify-content: center;
}

.install-btn-ios {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent), 0 0 18px rgba(0, 255, 255, 0.25);
}

.install-btn-android {
  border-color: var(--accent-soft);
  box-shadow: 0 0 0 1px var(--accent-soft), 0 0 18px rgba(94, 234, 212, 0.2);
}

.install-btn:hover,
.install-btn:focus-visible {
  background: #1a1a3c;
  color: var(--accent);
}

/* ---- Feature strip ---- */

.features {
  display: grid;
  gap: var(--gap);
  grid-template-columns: 1fr;
  margin: var(--gap-lg) 0;
}

.feature {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.2rem;
  background: var(--bg-elevated);
}

.feature h2 {
  color: var(--accent);
  font-size: 1.15rem;
  margin: 0 0 0.4em;
}

.feature p {
  color: var(--fg-muted);
  margin: 0;
}

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

.site-footer {
  border-top: 1px solid var(--border);
  padding: 1.5rem clamp(1rem, 4vw, 2rem);
  margin-top: auto;
  display: flex;
  flex-wrap: wrap;
  gap: var(--gap);
  justify-content: space-between;
  align-items: center;
  font-size: 0.9rem;
  color: var(--fg-muted);
}

.footer-nav {
  display: flex;
  gap: 1.2rem;
  flex-wrap: wrap;
}

.footer-nav a {
  color: var(--fg-muted);
}

.footer-nav a:hover,
.footer-nav a:focus-visible {
  color: var(--accent);
}

.footer-copy {
  margin: 0;
}

/* ---- Tablet+ ---- */

@media (min-width: 720px) {
  .hero {
    grid-template-columns: 1.2fr 1fr;
    align-items: center;
  }

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

/* ---- Lead paragraph + page sections ---- */

.lead {
  font-size: 1.1rem;
  color: var(--fg);
  max-width: 60ch;
}

.page section {
  margin: 2rem 0;
}

.page section h2 {
  color: var(--accent-soft);
  margin-bottom: 0.4em;
}

/* ---- Hero sub-pitch ---- */

.hero-sub {
  font-size: 0.95rem;
  color: var(--fg-muted);
  max-width: 40ch;
  margin: 0 0 var(--gap);
}

.hero-art {
  display: flex;
  justify-content: center;
}

.hero-art img {
  border-radius: 18%;
  box-shadow: 0 0 60px rgba(0, 255, 255, 0.18), 0 0 120px rgba(94, 234, 212, 0.08);
  width: clamp(8rem, 30vw, 20rem);
  height: auto;
}

/* ---- Home mini gallery ---- */

.home-gallery {
  display: grid;
  gap: var(--gap);
  grid-template-columns: 1fr;
  margin: var(--gap-lg) 0;
}

.home-shot {
  display: block;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-elevated);
}

.home-shot:hover,
.home-shot:focus-visible {
  border-color: var(--accent);
}

.home-shot img {
  width: 100%;
  height: auto;
}

/* ---- Screenshot gallery ---- */

.gallery {
  display: grid;
  gap: var(--gap);
  grid-template-columns: 1fr;
  margin: 1.5rem 0;
}

.gallery-item {
  margin: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-elevated);
}

.gallery-item img {
  width: 100%;
  height: auto;
}

.gallery-item figcaption {
  padding: 0.6rem 0.9rem;
  color: var(--fg-muted);
  font-size: 0.9rem;
  border-top: 1px solid var(--border);
}

.gallery-cta {
  margin-top: 1.5rem;
  font-size: 1.05rem;
}

/* ---- FAQ ---- */

.faq-section {
  border-top: 1px solid var(--border);
  padding-top: 1.2rem;
}

.faq-item {
  margin: 0.5rem 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-elevated);
  padding: 0.5rem 0.9rem;
}

.faq-item[open] {
  border-color: var(--accent);
}

.faq-item summary {
  cursor: pointer;
  font-weight: 600;
  padding: 0.4rem 0;
  list-style: none;
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item summary::before {
  content: "+";
  display: inline-block;
  width: 1.2rem;
  color: var(--accent);
  font-weight: 700;
}

.faq-item[open] summary::before {
  content: "−";
}

.faq-item p {
  margin: 0.3rem 0 0.6rem 1.2rem;
  color: var(--fg-muted);
}

/* FAQ → support gate (pure CSS, no JS) */
.faq-gate {
  margin-top: 2.5rem;
  padding: 1.2rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-elevated);
}

.faq-gate h2 {
  margin-top: 0;
}

.faq-gate-control {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
}

.faq-gate-control label {
  cursor: pointer;
  color: var(--fg);
}

.faq-gate-link {
  margin: 0;
  flex-basis: 100%;
  display: none;
}

.faq-gate-control input[type="checkbox"]:checked ~ .faq-gate-link {
  display: block;
}

.faq-gate-thanks {
  color: var(--fg-muted);
  margin-bottom: 1rem;
}

/* ---- Press ---- */

.pitch-short {
  font-size: 1.15rem;
  border-left: 3px solid var(--accent);
  padding: 0.6rem 1rem;
  background: var(--bg-elevated);
  border-radius: 0 var(--radius) var(--radius) 0;
}

.press-facts-list {
  list-style: none;
  padding: 0;
  display: grid;
  gap: 0.5rem;
}

.press-facts-list li {
  padding: 0.6rem 0.9rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

/* ---- Legal pages ---- */

.legal section {
  border-top: 1px solid var(--border);
  padding-top: 1rem;
}

.legal section:first-of-type {
  border-top: 0;
  padding-top: 0;
}

.legal-note {
  background: var(--bg-elevated);
  padding: 1rem 1.2rem;
  border-radius: var(--radius);
  border: 1px dashed var(--border);
}

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

.notfound h1 {
  font-size: clamp(1.6rem, 4vw + 1rem, 2.6rem);
}

/* ---- Tablet+ overrides ---- */

@media (min-width: 720px) {
  .gallery {
    grid-template-columns: 1fr 1fr;
  }

  .gallery-wide {
    grid-column: span 2;
  }

  .home-gallery {
    grid-template-columns: 2fr 1fr;
  }
}

/* ---- Support form ---- */

.support .lead {
  margin-bottom: 1.5rem;
}

.support-noscript {
  border: 1px solid var(--danger);
  background: rgba(255, 59, 107, 0.08);
  border-radius: var(--radius);
  padding: 1rem 1.2rem;
  margin: 1rem 0;
}

.support-step {
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  border-radius: var(--radius);
  padding: 1.2rem;
  margin: 1.2rem 0;
}

.support-step h2 {
  margin-top: 0;
  color: var(--accent);
  font-size: 1.1rem;
}

.support-status {
  margin: 0.6rem 0 0;
  color: var(--fg-muted);
  font-size: 0.95rem;
  min-height: 1.4em;
}

.support-status[data-kind="verified"] {
  color: var(--accent-soft);
}

.support-status[data-kind="error"] {
  color: var(--danger);
}

#support-progress {
  display: block;
  width: 100%;
  height: 8px;
  margin-top: 0.6rem;
  appearance: none;
  border: 1px solid var(--border);
  background: var(--bg);
  border-radius: 999px;
  overflow: hidden;
}

#support-progress::-webkit-progress-bar {
  background: var(--bg);
}

#support-progress::-webkit-progress-value {
  background: linear-gradient(90deg, var(--accent), var(--accent-soft));
}

#support-progress::-moz-progress-bar {
  background: linear-gradient(90deg, var(--accent), var(--accent-soft));
}

.support-form fieldset {
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  border-radius: var(--radius);
  padding: 1.2rem;
  margin: 1.2rem 0;
}

.support-form legend {
  color: var(--accent);
  font-weight: 700;
  padding: 0 0.4rem;
}

.support-form p {
  margin: 0 0 1rem;
}

.support-form label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.3rem;
}

.support-form input[type="text"],
.support-form input[type="email"],
.support-form textarea {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--fg);
  padding: 0.6rem 0.8rem;
  font: inherit;
}

.support-form input:focus,
.support-form textarea:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  border-color: var(--accent);
}

.support-form textarea {
  resize: vertical;
  min-height: 7rem;
  font-family: inherit;
}

.support-hint {
  display: block;
  margin-top: 0.3rem;
  color: var(--fg-muted);
  font-size: 0.85rem;
}

/* Honeypot — invisible to humans (display:none), still served in the HTML
 * so naive bots fill it. ARIA + tabindex keep it out of accessibility tree. */
.support-honeypot {
  display: none !important;
}

.support-form button[type="submit"]:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.support-success {
  border: 1px solid var(--accent-soft);
  background: rgba(94, 234, 212, 0.08);
  border-radius: var(--radius);
  padding: 1.2rem;
  margin: 1.2rem 0;
}

.support-success h2 {
  margin-top: 0;
  color: var(--accent-soft);
}

/* ---- Reduced motion ---- */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
}
