/* Brainfront website. Same identity as the game: a tabletop map on a lagoon, flat colour,
   thick ink outlines, hard shadows. No framework, no build step. */

@font-face {
  font-family: "Baloo Bhaijaan 2";
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url("../fonts/baloo-bhaijaan-2-latin-wght-normal.woff2") format("woff2");
}

:root {
  --lagoon: #0f3b46;
  --deep: #0a2a33;
  --ink: #08222a;
  --sand: #f3e3c3;
  --sand-dim: #e2cfa8;
  --paper: #fffaf0;
  --foam: #bfe9e0;
  --marigold: #ffb627;
  --hibiscus: #e5446d;
  --good: #2ec4a6;

  --font: "Baloo Bhaijaan 2", "Segoe UI", Tahoma, system-ui, sans-serif;
  --edge: 3px solid var(--ink);
  --drop: 0 5px 0 var(--ink);
  --radius: 18px;
  --wrap: 1120px;
  --hex-bg: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='104' height='180' viewBox='0 0 104 180'%3E%3Cg fill='none' stroke='%23bfe9e0' stroke-opacity='.07' stroke-width='2'%3E%3Cpath d='M52 0l52 30v60L52 120 0 90V30z'/%3E%3Cpath d='M52 120v60M0 90l-52 30M104 90l52 30'/%3E%3C/g%3E%3C/svg%3E");
}

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

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

body {
  margin: 0;
  background-color: var(--lagoon);
  background-image: var(--hex-bg);
  color: var(--sand);
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.55;
}

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

a {
  color: var(--marigold);
  text-underline-offset: 0.2em;
}

a:hover {
  color: #ffc95a;
}

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

h1,
h2,
h3 {
  margin: 0;
  line-height: 1.1;
  font-weight: 800;
}

p {
  margin: 0;
}

.wrap {
  width: min(100% - 32px, var(--wrap));
  margin-inline: auto;
}

.skip-link {
  position: absolute;
  inset-inline-start: 12px;
  top: -60px;
  z-index: 100;
  padding: 10px 16px;
  border: var(--edge);
  border-radius: 12px;
  background: var(--marigold);
  color: var(--ink);
  font-weight: 800;
  text-decoration: none;
}

.skip-link:focus {
  top: 12px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5em;
  min-height: 52px;
  padding: 0.45em 1.4em;
  border: var(--edge);
  border-radius: var(--radius);
  background: var(--sand);
  box-shadow: var(--drop);
  color: var(--ink);
  font-weight: 800;
  font-size: 1.08rem;
  line-height: 1.15;
  text-decoration: none;
  transition:
    transform 120ms ease,
    box-shadow 120ms ease;
}

.btn:hover {
  color: var(--ink);
  transform: translateY(-2px);
  box-shadow: 0 7px 0 var(--ink);
}

.btn:active {
  transform: translateY(4px);
  box-shadow: 0 1px 0 var(--ink);
}

.btn-primary {
  background: var(--marigold);
}

/* Play buttons before launch (no link yet, see GAME_URL in site.js): no hover lift. */
.btn:not([href]) {
  cursor: default;
}

.btn:not([href]):hover,
.btn:not([href]):active {
  transform: none;
  box-shadow: var(--drop);
}

.site-nav .btn:not([href]):hover {
  box-shadow: 0 4px 0 var(--ink);
}

.soon-badge {
  display: inline-block;
  padding: 0.15em 0.6em;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: var(--foam);
  color: var(--ink);
  font-size: 0.68em;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  white-space: nowrap;
}

/* Footer text link before launch. */
a[data-play]:not([href]) {
  cursor: default;
  text-decoration: none;
}

.footer-links a[data-play]:not([href]):hover {
  color: var(--sand);
}

.soon-note {
  font-weight: 600;
  opacity: 0.75;
}

.btn-lg {
  min-height: 60px;
  padding-inline: 1.8em;
  font-size: 1.25rem;
}

.btn svg {
  width: 1.1em;
  height: 1.1em;
}

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgb(10 42 51 / 92%);
  backdrop-filter: blur(8px);
  border-bottom: 3px solid var(--ink);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 68px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--sand);
  font-weight: 800;
  font-size: 1.35rem;
  text-decoration: none;
}

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

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

.site-nav {
  margin-inline-start: auto;
}

.site-nav ul {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 22px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-nav a {
  color: var(--sand);
  font-weight: 700;
  text-decoration: none;
}

.site-nav a:hover,
.site-nav a[aria-current="page"] {
  color: var(--marigold);
}

/* The nav Play button keeps its dark text: ".site-nav a:hover" would turn it gold on gold. */
.site-nav .btn,
.site-nav .btn:hover {
  color: var(--ink);
}

.site-nav .btn {
  min-height: 42px;
  padding-inline: 1em;
  font-size: 1rem;
  box-shadow: 0 4px 0 var(--ink);
  color: var(--ink);
}

.nav-toggle {
  display: none;
}

/* Small screens: with JS the links fold behind a menu button; without JS they just wrap. */
@media (max-width: 760px) {
  .js .nav-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-inline-start: auto;
    width: 46px;
    height: 46px;
    border: var(--edge);
    border-radius: 12px;
    background: var(--sand);
    box-shadow: 0 4px 0 var(--ink);
    color: var(--ink);
    cursor: pointer;
  }
  .js .site-nav {
    display: none;
    position: absolute;
    inset-inline: 0;
    top: 100%;
    padding: 16px;
    background: var(--deep);
    border-bottom: 3px solid var(--ink);
  }
  .js .site-nav.is-open {
    display: block;
  }
  .js .site-nav ul {
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
  }
  .js .site-nav a {
    display: block;
    padding: 10px 6px;
    font-size: 1.1rem;
  }
  .js .site-nav .btn {
    display: flex;
    margin-top: 8px;
    width: 100%;
  }
}

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

.hero {
  position: relative;
  padding-block: clamp(40px, 7vw, 88px) clamp(48px, 8vw, 104px);
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  inset: auto -20% -40% -20%;
  height: 70%;
  background: radial-gradient(closest-side, rgb(10 42 51 / 85%), transparent);
  pointer-events: none;
}

.hero-inner {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
  align-items: center;
  gap: clamp(28px, 5vw, 64px);
}

.eyebrow {
  display: inline-block;
  margin-bottom: 14px;
  padding: 4px 12px;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: var(--foam);
  color: var(--ink);
  font-weight: 800;
  font-size: 0.9rem;
}

.wordmark {
  font-size: clamp(3.2rem, 9vw, 5.6rem);
  font-weight: 800;
  line-height: 0.95;
  letter-spacing: -0.02em;
  color: var(--marigold);
  -webkit-text-stroke: 4px var(--ink);
  paint-order: stroke fill;
  text-shadow: 0 7px 0 var(--ink);
}

.wordmark span {
  color: var(--hibiscus);
}

.hero-tagline {
  margin-top: 18px;
  color: var(--foam);
  font-size: clamp(1.35rem, 3vw, 1.75rem);
  font-weight: 800;
  line-height: 1.2;
}

.hero-copy {
  margin-top: 14px;
  max-width: 34em;
  font-size: 1.12rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px 16px;
  margin-top: 28px;
}

.hero-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin: 22px 0 0;
  padding: 0;
  list-style: none;
  color: var(--foam);
  font-weight: 700;
  font-size: 0.98rem;
}

.hero-facts li::before {
  content: "⬢ ";
  color: var(--marigold);
}

.hero-media {
  position: relative;
}

.frame {
  position: relative;
  overflow: hidden;
  border: 4px solid var(--ink);
  border-radius: 22px;
  background: var(--deep);
  box-shadow: 0 9px 0 var(--ink);
}

.frame video,
.frame img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.frame.is-portrait {
  max-width: 360px;
  margin-inline: auto;
}

.frame.is-portrait video {
  aspect-ratio: 2 / 3;
}

.video-toggle {
  position: absolute;
  inset-inline-end: 12px;
  bottom: 12px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 40px;
  padding: 0 14px;
  border: var(--edge);
  border-radius: 999px;
  background: var(--sand);
  box-shadow: 0 3px 0 var(--ink);
  color: var(--ink);
  font: inherit;
  font-weight: 800;
  font-size: 0.92rem;
  cursor: pointer;
}

.video-toggle[hidden] {
  display: none;
}

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

.section {
  padding-block: clamp(56px, 8vw, 96px);
}

.section-alt {
  background-color: var(--deep);
  border-block: 3px solid var(--ink);
}

.section-head {
  max-width: 44em;
  margin-bottom: clamp(28px, 4vw, 44px);
}

.section-head h2 {
  font-size: clamp(2rem, 4.5vw, 2.9rem);
  color: var(--sand);
}

.section-head p {
  margin-top: 12px;
  color: var(--foam);
  font-size: 1.15rem;
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 22px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.card {
  padding: 24px;
  border: var(--edge);
  border-radius: var(--radius);
  background: var(--sand);
  box-shadow: var(--drop);
  color: var(--ink);
}

.card h3 {
  margin-top: 14px;
  font-size: 1.45rem;
}

.card p {
  margin-top: 8px;
}

.card-icon {
  width: 56px;
  height: 56px;
}

.step-number {
  display: inline-grid;
  place-items: center;
  width: 2em;
  height: 2em;
  margin-inline-end: 6px;
  border: 2px solid var(--ink);
  border-radius: 8px;
  background: var(--marigold);
  font-size: 0.8em;
  vertical-align: 0.15em;
}

/* Bonus table */
.bonus {
  margin-top: 36px;
  padding: 22px 24px;
  border: var(--edge);
  border-radius: var(--radius);
  background: var(--paper);
  box-shadow: var(--drop);
  color: var(--ink);
}

.bonus h3 {
  font-size: 1.3rem;
}

.bonus table {
  width: 100%;
  margin-top: 12px;
  border-collapse: collapse;
}

.bonus th,
.bonus td {
  padding: 10px 8px;
  border-top: 2px solid var(--sand-dim);
  text-align: start;
}

.bonus th {
  font-weight: 700;
}

.bonus td {
  font-weight: 800;
  white-space: nowrap;
}

.bonus caption {
  caption-side: bottom;
  padding-top: 12px;
  text-align: start;
  font-size: 0.95rem;
  opacity: 0.8;
}

/* Modes */
.mode-card {
  display: flex;
  flex-direction: column;
}

.mode-card .tag {
  align-self: flex-start;
  margin-top: 14px;
  padding: 2px 10px;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: var(--foam);
  font-weight: 800;
  font-size: 0.85rem;
}

.mode-ranked {
  background: var(--marigold);
}

/* Screenshots */
.gallery {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 22px;
  margin: 0;
}

.shot {
  margin: 0;
}

.shot figcaption {
  margin-top: 10px;
  color: var(--foam);
  font-weight: 700;
}

.shot-wide {
  grid-column: span 6;
}

.shot-tall {
  grid-column: span 3;
}

.shot-tall .frame img {
  aspect-ratio: 2 / 3;
}

@media (max-width: 900px) {
  .shot-wide {
    grid-column: span 12;
  }
  .shot-tall {
    grid-column: span 6;
  }
}

/* Features */
.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px 28px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.features li {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 4px 14px;
  align-items: start;
}

.features svg {
  grid-row: span 2;
  width: 40px;
  height: 40px;
}

.features strong {
  font-size: 1.15rem;
}

.features span {
  color: var(--foam);
}

/* FAQ */
.faq {
  display: grid;
  gap: 14px;
  max-width: 820px;
}

.faq details {
  border: var(--edge);
  border-radius: var(--radius);
  background: var(--sand);
  box-shadow: 0 4px 0 var(--ink);
  color: var(--ink);
}

.faq summary {
  position: relative;
  padding: 16px 52px 16px 20px;
  font-weight: 800;
  font-size: 1.12rem;
  cursor: pointer;
  list-style: none;
}

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

.faq summary::after {
  content: "+";
  position: absolute;
  inset-inline-end: 18px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.6rem;
  line-height: 1;
}

.faq details[open] summary::after {
  content: "–";
}

.faq .answer {
  padding: 0 20px 18px;
}

.faq .answer a {
  color: #8a5300;
}

/* Final call to action */
.cta-band {
  text-align: center;
}

.cta-band h2 {
  font-size: clamp(2rem, 5vw, 3rem);
}

.cta-band p {
  margin: 12px auto 26px;
  max-width: 36em;
  color: var(--foam);
  font-size: 1.15rem;
}

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

.site-footer {
  padding-block: 36px;
  background: var(--deep);
  border-top: 3px solid var(--ink);
  color: var(--foam);
  font-size: 0.98rem;
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 18px 28px;
}

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

.footer-links a {
  color: var(--sand);
  font-weight: 700;
}

.footer-note {
  flex-basis: 100%;
  opacity: 0.8;
  font-size: 0.9rem;
}

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

.legal {
  padding-block: clamp(36px, 6vw, 72px);
}

.breadcrumbs ol {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 18px;
  padding: 0;
  list-style: none;
  color: var(--foam);
  font-size: 0.95rem;
}

.breadcrumbs li + li::before {
  content: "›";
  margin-inline-end: 6px;
}

.breadcrumbs a {
  color: var(--foam);
}

.doc {
  max-width: 820px;
  padding: clamp(24px, 4vw, 48px);
  border: var(--edge);
  border-radius: calc(var(--radius) + 4px);
  background: var(--paper);
  box-shadow: 0 7px 0 var(--ink);
  color: var(--ink);
}

.doc h1 {
  font-size: clamp(2rem, 5vw, 2.8rem);
}

.doc .updated {
  margin-top: 8px;
  opacity: 0.75;
  font-weight: 600;
}

.doc h2 {
  margin-top: 34px;
  font-size: 1.5rem;
}

.doc h3 {
  margin-top: 20px;
  font-size: 1.15rem;
}

.doc p,
.doc ul {
  margin-top: 12px;
}

.doc ul {
  padding-inline-start: 1.3em;
}

.doc li + li {
  margin-top: 6px;
}

.doc a {
  color: #8a5300;
}

.toc {
  margin-top: 22px;
  padding: 16px 20px;
  border: 2px solid var(--sand-dim);
  border-radius: 14px;
  background: #fff6e3;
}

.toc h2 {
  margin: 0;
  font-size: 1.05rem;
}

.toc ol {
  margin: 8px 0 0;
  padding-inline-start: 1.3em;
  columns: 2 220px;
}

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

.not-found {
  padding-block: clamp(64px, 12vw, 140px);
  text-align: center;
}

.not-found h1 {
  font-size: clamp(2.4rem, 7vw, 4rem);
}

.not-found p {
  margin: 14px auto 28px;
  max-width: 30em;
  color: var(--foam);
  font-size: 1.15rem;
}

/* --- Responsive ------------------------------------------------------------- */

@media (max-width: 900px) {
  .hero-inner {
    grid-template-columns: 1fr;
  }
}

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