/* Game Wonder Limited — design tokens from Pencil */
:root {
  --bg: #070b14;
  --bg-elevated: #0e1424;
  --bg-light: #f3f5f8;
  --bg-card: #131a2e;
  --text: #ffffff;
  --text-muted: #9aa4b8;
  --text-dark: #0b1220;
  --text-dark-muted: #5b6578;
  --accent: #7132ff;
  --accent-alt: #00e0ff;
  --neon-pink: #ff4fd8;
  --border: #24304a;
  --footer-bg: #7132ff;
  --header-muted: rgba(242, 244, 247, 0.7);
  --shadow-card: 0 10px 24px rgba(11, 18, 32, 0.08);

  --font-heading: "Anton", sans-serif;
  --font-body: "Funnel Sans", system-ui, sans-serif;
  --font-caption: "IBM Plex Mono", ui-monospace, monospace;

  --container: 1280px;
  --gutter: clamp(1.25rem, 4vw, 5rem);
  --section-space: clamp(3.5rem, 8vw, 6.25rem);
  --radius-card: 1rem;
  --header-h: 4.5rem;
  --ease: 0.2s ease;
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  overflow-x: hidden;
}

body.nav-open {
  overflow: hidden;
}

.scroll-anchor {
  position: absolute;
  top: 0;
  left: 0;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

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

a {
  color: inherit;
  text-decoration: none;
}

ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

h1,
h2,
h3 {
  margin: 0;
  font-weight: 400;
  line-height: 1.15;
}

p {
  margin: 0;
}

.container {
  width: min(100% - var(--gutter) * 2, var(--container));
  margin-inline: auto;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.5rem;
  border-radius: 9999px;
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  transition: transform var(--ease), opacity var(--ease), background-color var(--ease);
  white-space: nowrap;
}

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

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

.btn-primary {
  background: var(--accent);
  color: #fff;
  box-shadow:
    0 8px 20px rgba(139, 92, 246, 0.45),
    0 0 32px rgba(139, 92, 246, 0.55);
}

.btn-download {
  background: var(--text);
  color: var(--accent);
  padding: 0.7rem 1.4rem;
}

/* Header — mobile first */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--accent);
  border-bottom: 1px solid var(--border);
  min-height: var(--header-h);
  overflow: visible;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: var(--header-h);
  padding-block: 0.75rem;
  position: relative;
}

.brand img {
  width: clamp(144px, 33.6vw, 192px); /* mobile: 120% of original */
  height: auto;
  object-fit: contain;
}

.nav-toggle {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 2.5rem;
  height: 2.5rem;
  padding: 0.5rem;
  border: 0;
  border-radius: 0.5rem;
  background: transparent;
  cursor: pointer;
  margin-left: auto;
}

.nav-toggle span {
  display: block;
  height: 2px;
  width: 100%;
  background: var(--text);
  border-radius: 2px;
  transition: transform var(--ease), opacity var(--ease);
}

.nav-toggle[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}

.nav-toggle[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.site-nav {
  position: absolute;
  top: 100%;
  left: 50%;
  width: 100vw;
  margin-left: -50vw;
  background: var(--accent);
  max-height: 0;
  overflow: hidden;
  box-shadow: none;
  transition: max-height 0.28s ease, box-shadow 0.28s ease;
}

.site-nav.is-open {
  max-height: 20rem;
  box-shadow: 0 16px 28px rgba(11, 18, 32, 0.3);
  clip-path: inset(0 -48px -48px -48px);
}

.site-nav ul {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0.75rem var(--gutter) 1.25rem;
  width: min(100% - var(--gutter) * 2, var(--container));
  margin-inline: auto;
}

.site-nav a {
  display: block;
  padding: 0.7rem 0.5rem;
  font-size: 0.9375rem;
  color: var(--header-muted);
}

.site-nav a.is-active,
.site-nav a:hover {
  color: var(--text);
}

.header-inner > .btn-download {
  display: none;
}

/* Hero — centered title + CTA, matches Pencil banner */
.hero {
  position: relative;
  height: clamp(22rem, 55vw, 40rem);
  min-height: 20rem;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: var(--bg);
}

.hero-media {
  position: absolute;
  inset: 0;
}

.hero-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    #190054c2,
    rgba(255, 255, 255, 0.45) 100%
  );
}

.hero-content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  width: min(100% - var(--gutter) * 2, 56rem);
  text-align: center;
  padding-inline: var(--gutter);
}

.hero h1 {
  font-family: var(--font-heading);
  font-size: clamp(2.75rem, 9vw, 5.25rem);
  letter-spacing: 0.04em;
  color: var(--text);
  line-height: 1;
}

.hero .btn-primary {
  padding: 1rem 2rem;
  font-size: 0.9375rem;
  letter-spacing: 0.08em;
  box-shadow:
    0 10px 28px rgba(139, 92, 246, 0.5),
    0 0 36px rgba(139, 92, 246, 0.6);
}

.hero .btn-primary:hover {
  box-shadow:
    0 12px 32px rgba(139, 92, 246, 0.55),
    0 0 42px rgba(139, 92, 246, 0.65);
}

/* Shared section titles */
.about h2,
.meet h2,
.features h2,
.contact h2 {
  font-family: var(--font-heading);
  font-size: clamp(2rem, 5vw, 3rem);
  letter-spacing: 0.02em;
  text-align: center;
}

.section-light {
  background: var(--bg-light);
  color: var(--text-dark);
  padding-block: var(--section-space);
}

.section-dark {
  background: var(--bg);
  color: var(--text);
  padding-block: var(--section-space);
}

.section-elevated {
  background: var(--bg-elevated);
  color: var(--text);
  padding-block: var(--section-space);
}

/* About */
.about-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(2rem, 4vw, 3.5rem);
}

.about-body {
  max-width: 54rem;
  text-align: center;
  color: var(--text-dark-muted);
  display: grid;
  gap: 1rem;
  line-height: 1.7;
}

.about-modules {
  display: grid;
  gap: 1.25rem;
  width: 100%;
}

.module-card {
  background: #fff;
  border: 1px solid #e4e8f0;
  border-radius: 0.75rem;
  padding: 2rem 1.75rem;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  text-align: center;
}

.module-card .bar {
  width: 3rem;
  height: 4px;
  border-radius: 2px;
}

.bar-cyan { background: var(--accent-alt); }
.bar-accent { background: var(--accent); }
.bar-pink { background: var(--neon-pink); }

.module-card h3 {
  font-family: var(--font-caption);
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.08em;
}

.module-card p {
  color: var(--text-dark-muted);
  font-size: 0.9375rem;
}

/* Meet */
.meet-grid {
  display: grid;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
  justify-items: stretch;
}

.meet-copy {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: stretch;
}

.meet-copy h2 {
  text-align: center;
  color: var(--text);
}

.meet-body {
  margin-top: 1.5rem;
  color: var(--text-muted);
  display: grid;
  gap: 1rem;
  line-height: 1.7;
  text-align: center;
}

.meet-points {
  margin-top: 1.75rem;
  display: grid;
  gap: 1.25rem;
  width: 100%;
  justify-items: stretch;
  text-align: left;
}

.meet-points li {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 1rem;
  text-align: left;
}

.meet-points .dot {
  flex-shrink: 0;
  width: 0.625rem;
  height: 0.625rem;
  margin-top: 0.35rem;
  border-radius: 9999px;
  background: #895bf5;
}

.meet-points h3 {
  font-family: var(--font-caption);
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  margin-bottom: 0.35rem;
}

.meet-points p {
  color: var(--text-muted);
  font-size: 0.875rem;
}

.meet-visual {
  margin: 0 auto;
  border-radius: 1.5rem;
  overflow: hidden;
  box-shadow: 0 16px 40px rgba(0, 224, 255, 0.2);
  aspect-ratio: 1;
  background: var(--bg-elevated);
  width: min(100%, 28rem);
  justify-self: center;
}

.meet-visual img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Features */
.features h2 {
  margin-bottom: clamp(2rem, 4vw, 3rem);
}

.features-grid {
  display: grid;
  gap: 1.25rem;
}

.feature-card {
  background: #fff;
  border: 1px solid #e4e8f0;
  border-radius: var(--radius-card);
  padding: 2rem 1.75rem;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  text-align: center;
}

.feature-num {
  font-family: var(--font-caption);
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.12em;
}

.feature-num.accent { color: var(--accent); }
.feature-num.cyan { color: var(--accent-alt); }
.feature-num.pink { color: var(--neon-pink); }

.feature-card h3 {
  font-family: var(--font-heading);
  font-size: clamp(1.25rem, 2.5vw, 1.5rem);
  letter-spacing: 0.02em;
}

.feature-card p {
  color: var(--text-dark-muted);
  font-size: 0.875rem;
  line-height: 1.55;
}

/* Contact */
.contact-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(1.5rem, 3vw, 3rem);
}

.contact-lead {
  text-align: center;
  color: var(--text-muted);
  max-width: 35rem;
  line-height: 1.6;
}

.contact-grid {
  display: grid;
  gap: 1.25rem;
  width: 100%;
}

.contact-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 2rem 1.75rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.875rem;
  text-align: center;
}

.contact-card h3 {
  font-family: var(--font-caption);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.14em;
}

.contact-card h3.cyan { color: var(--accent-alt); }
.contact-card h3.accent { color: #a47bff; }
.contact-card h3.pink { color: var(--neon-pink); }

.contact-card p,
.contact-card a {
  color: var(--text);
  font-size: 0.9375rem;
  line-height: 1.55;
  word-break: break-word;
}

.contact-card a:hover {
  color: var(--accent-alt);
}

/* Footer */
.site-footer {
  background: var(--footer-bg);
  color: var(--text);
}

.footer-main {
  display: grid;
  gap: 2.5rem;
  padding-block: clamp(3rem, 6vw, 4.5rem);
  justify-items: center;
  text-align: center;
}

.footer-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.875rem;
  max-width: 26.25rem;
  width: 100%;
}

.footer-brand img {
  width: 160px;
  height: auto;
  margin-inline: auto;
}

.footer-blurb {
  max-width: 23.75rem;
  color: var(--header-muted);
  font-size: 0.875rem;
  line-height: 1.6;
  text-align: center;
  margin-inline: auto;
}

.footer-brand p,
.footer-col p,
.footer-col a,
.footer-col li a {
  color: var(--header-muted);
  font-size: 0.875rem;
  line-height: 1.6;
}

.footer-col {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.footer-col h3 {
  font-family: var(--font-caption);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  margin-bottom: 0.875rem;
}

.footer-col ul {
  display: grid;
  gap: 0.75rem;
  justify-items: center;
}

.footer-col a:hover {
  color: var(--text);
}

.footer-col p + p {
  margin-top: 0.75rem;
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.footer-bottom-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  padding-block: 1.5rem;
  color: var(--header-muted);
  font-size: 0.8125rem;
  text-align: center;
}

.legal-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
}

.legal-links a:hover {
  color: var(--text);
}

/* Tablet+ */
@media (min-width: 640px) {
  .about-modules {
    grid-template-columns: repeat(3, 1fr);
  }

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

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

  .footer-main {
    grid-template-columns: 1.4fr 0.8fr 1.2fr;
    gap: 3rem;
    justify-items: start;
    text-align: left;
  }

  .footer-brand,
  .footer-col {
    align-items: flex-start;
  }

  .footer-brand img {
    margin-inline: 0;
  }

  .footer-blurb {
    text-align: left;
    margin-inline: 0;
  }

  .footer-col ul {
    justify-items: start;
  }

  .footer-bottom-inner {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    text-align: left;
  }

  .legal-links {
    justify-content: flex-end;
  }
}

/* Desktop navigation */
@media (min-width: 960px) {
  .nav-toggle {
    display: none;
  }

  .brand img {
    width: clamp(120px, 28vw, 160px);
  }

  .site-nav {
    position: absolute;
    left: 50%;
    top: 50%;
    width: auto;
    margin-left: 0;
    transform: translate(-50%, -50%);
    max-height: none;
    overflow: visible;
    border: 0;
    background: transparent;
    box-shadow: none;
    clip-path: none;
  }

  .site-nav.is-open {
    max-height: none;
    box-shadow: none;
  }

  .site-nav ul {
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 2rem;
    padding: 0;
    width: auto;
    margin-inline: 0;
  }

  .site-nav a {
    padding: 0;
  }

  .header-inner > .btn-download {
    display: inline-flex;
    margin-left: auto;
  }

  .module-card,
  .feature-card,
  .contact-card {
    align-items: flex-start;
    text-align: left;
  }

  .meet-grid {
    grid-template-columns: 1.1fr 0.9fr;
  }

  .meet-copy h2,
  .meet-body {
    text-align: left;
  }

  .meet-visual {
    width: auto;
    margin: 0;
    justify-self: stretch;
  }

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

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

  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}

/* Legal pages */
.legal-page {
  background: var(--bg-light);
  color: var(--text-dark);
}

.legal-main {
  padding-block: clamp(2rem, 5vw, 3.5rem) clamp(3rem, 7vw, 5rem);
  min-height: 60vh;
}

.legal-wrap {
  max-width: 52rem;
}

.legal-back {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-bottom: 1.5rem;
  color: var(--accent);
  font-family: var(--font-body);
  font-size: 0.9375rem;
  font-weight: 600;
  transition: opacity var(--ease);
}

.legal-back:hover {
  opacity: 0.8;
}

.legal-back-icon {
  width: 1.5rem;
  height: 1.5rem;
  flex-shrink: 0;
}

.legal-header {
  margin-bottom: 2.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid #e4e8f0;
}

.legal-kicker {
  font-family: var(--font-caption);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  color: var(--accent);
  margin-bottom: 0.75rem;
}

.legal-header h1 {
  font-family: var(--font-heading);
  font-size: clamp(2rem, 5vw, 3rem);
  letter-spacing: 0.02em;
  color: var(--text-dark);
  margin-bottom: 0.75rem;
}

.legal-date {
  color: var(--text-dark-muted);
  font-size: 0.9375rem;
}

.legal-content {
  display: grid;
  gap: 2rem;
}

.legal-content section {
  display: grid;
  gap: 0.85rem;
}

.legal-content h2 {
  font-family: var(--font-body);
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--text-dark);
  text-align: left;
  letter-spacing: 0;
}

.legal-content h3 {
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-dark);
  margin-top: 0.35rem;
}

.legal-content p,
.legal-content li {
  color: var(--text-dark-muted);
  font-size: 0.9375rem;
  line-height: 1.7;
}

.legal-content ul {
  list-style: disc;
  padding-left: 1.25rem;
  display: grid;
  gap: 0.4rem;
}

.legal-content a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.legal-content a:hover {
  color: #6d3fe0;
}

.legal-page .site-footer .legal-links a[aria-current="page"] {
  color: var(--text);
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* Back to top */
.back-to-top {
  position: fixed;
  right: clamp(1rem, 3vw, 1.75rem);
  bottom: clamp(1rem, 3vw, 1.75rem);
  z-index: 90;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3rem;
  height: 3rem;
  padding: 0;
  border: 0;
  border-radius: 9999px;
  background: var(--accent);
  color: #fff;
  box-shadow: 0 8px 24px rgba(139, 92, 246, 0.35);
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(0.5rem);
  transition: opacity 0.25s ease, visibility 0.25s ease, transform 0.25s ease, background-color var(--ease);
}

.back-to-top.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.back-to-top:hover {
  background: #7c4eef;
}

.back-to-top:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 3px;
}

.back-to-top svg {
  width: 1.5rem;
  height: 1.5rem;
}

.back-to-top[hidden] {
  display: none;
}

.back-to-top.is-visible[hidden] {
  display: inline-flex;
}
