/* ==========================================================================
   Connect+ marketing site — design system
   Extends the game's "Modernist" tokens (green #1D9E75, red #ec3013, Archivo,
   rounded 10–16px, soft raised shadows). Mobile-first, GPU-friendly motion.
   ========================================================================== */

/* ---- Font (self-hosted Archivo variable subset) -------------------------- */
@font-face {
  font-family: "Archivo";
  src: url("../fonts/Archivo.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
  font-style: normal;
}

/* ---- Tokens -------------------------------------------------------------- */
:root {
  --green: #1d9e75;
  --green-deep: #157a5a;
  --red: #ec3013;
  --red-deep: #c2260e;
  --ink: #232120;
  --ink-soft: #55504c;
  --ink-faint: #8a837d;
  --ground: #faf8f7;
  --surface: #ffffff;
  --line: #ece7e3;
  --amber: #f4c25a;
  --rose: #f3c9d3;
  --plum: #45121f;

  --tile-cream: #f6eef0;
  --shadow-sm: 0 2px 6px rgba(35, 33, 32, 0.08);
  --shadow-md: 0 10px 30px rgba(35, 33, 32, 0.10);
  --shadow-lg: 0 24px 60px rgba(35, 33, 32, 0.16);
  --raise: 0 4px 0 rgba(21, 122, 90, 0.28);

  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 22px;
  --r-pill: 999px;

  --pad: clamp(20px, 5vw, 40px);
  --maxw: 1140px;
  --gap: clamp(16px, 3vw, 28px);

  --font: "Archivo", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

@media (prefers-color-scheme: dark) {
  :root {
    --ink: #f0ece9;
    --ink-soft: #c3bcb6;
    --ink-faint: #948d87;
    --ground: #161413;
    --surface: #201d1b;
    --line: #302b28;
    --tile-cream: #2a2422;
    --shadow-sm: 0 2px 6px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 10px 30px rgba(0, 0, 0, 0.45);
    --shadow-lg: 0 24px 60px rgba(0, 0, 0, 0.55);
  }
}

/* ---- Reset --------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--ground);
  line-height: 1.6;
  font-size: 17px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img, svg, picture { display: block; max-width: 100%; height: auto; }
a { color: var(--red); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font: inherit; cursor: pointer; }
ul { padding-left: 1.2em; }

/* ---- Accessibility helpers ---------------------------------------------- */
.skip-link {
  position: absolute; left: 8px; top: -60px; z-index: 200;
  background: var(--ink); color: #fff; padding: 10px 16px; border-radius: var(--r-sm);
  transition: top 0.2s var(--ease);
}
.skip-link:focus { top: 8px; }
:focus-visible { outline: 3px solid var(--red); outline-offset: 3px; border-radius: 4px; }
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---- Typography ---------------------------------------------------------- */
h1, h2, h3, h4 { line-height: 1.1; font-weight: 800; letter-spacing: -0.02em; }
h1 { font-size: clamp(2.3rem, 6vw, 4rem); font-weight: 900; }
h2 { font-size: clamp(1.8rem, 4.5vw, 2.8rem); }
h3 { font-size: clamp(1.2rem, 2.6vw, 1.5rem); }
.kicker {
  display: inline-block; font-size: 0.8rem; font-weight: 800; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--green-deep); margin-bottom: 12px;
}
@media (prefers-color-scheme: dark) { .kicker { color: var(--green); } }
.lead { font-size: clamp(1.05rem, 2.2vw, 1.3rem); color: var(--ink-soft); }

/* ---- Layout -------------------------------------------------------------- */
.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding-inline: var(--pad); }
section { padding-block: clamp(56px, 9vw, 110px); }
section[id] { scroll-margin-top: 82px; }
.section-head { max-width: 720px; margin: 0 auto clamp(32px, 5vw, 56px); text-align: center; }
.section-head .lead { margin-top: 14px; }

/* ---- Buttons ------------------------------------------------------------- */
.btn {
  --btn-bg: var(--ink); --btn-fg: #fff;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  padding: 15px 26px; border-radius: var(--r-md); border: 2px solid transparent;
  background: var(--btn-bg); color: var(--btn-fg); font-weight: 800; font-size: 1rem;
  box-shadow: var(--shadow-sm); transition: transform 0.18s var(--ease), box-shadow 0.18s var(--ease), background 0.18s var(--ease);
  white-space: nowrap;
}
.btn:hover { text-decoration: none; transform: translateY(-2px); box-shadow: var(--shadow-md); }
.btn:active { transform: translateY(0); }
/* Use the deeper red so white text clears WCAG AA (4.5:1); #ec3013 is only 4.2. */
.btn--primary { --btn-bg: var(--red-deep); --btn-fg: #fff; }
.btn--primary:hover { background: #9e1f0a; }
.btn--green { --btn-bg: var(--green); --btn-fg: #fff; }
.btn--green:hover { background: var(--green-deep); }
.btn--ghost {
  --btn-bg: transparent; --btn-fg: var(--ink);
  border-color: var(--line); box-shadow: none;
}
.btn--ghost:hover { border-color: var(--ink); background: transparent; }
.btn svg { width: 20px; height: 20px; }

/* store badges */
.store-badges { display: flex; flex-wrap: wrap; gap: 14px; }
.store-badge {
  display: inline-flex; align-items: center; gap: 12px; padding: 12px 20px;
  /* Fixed dark chrome so store badges stay legible in BOTH themes
     (var(--ink) flips to near-white in dark mode). */
  background: #1b1917; color: #fff; border: 1px solid transparent;
  border-radius: var(--r-md); box-shadow: var(--shadow-sm);
  transition: transform 0.18s var(--ease), box-shadow 0.18s var(--ease);
}
@media (prefers-color-scheme: dark) {
  .store-badge { background: #2a2623; border-color: #3a352f; }
}
.store-badge:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); text-decoration: none; }
.store-badge svg { width: 26px; height: 26px; flex: none; }
.store-badge small { display: block; font-size: 0.66rem; opacity: 0.8; letter-spacing: 0.04em; }
.store-badge strong { display: block; font-size: 1.05rem; line-height: 1.15; }
.store-badge[aria-disabled="true"] { opacity: 0.55; pointer-events: none; }

/* ---- Cards --------------------------------------------------------------- */
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: clamp(22px, 3vw, 30px); box-shadow: var(--shadow-sm);
  transition: transform 0.22s var(--ease), box-shadow 0.22s var(--ease);
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.card h3 { margin-bottom: 8px; }
.card p { color: var(--ink-soft); }
.card-grid { display: grid; gap: var(--gap); grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.card h4 { font-size: 1.1rem; margin-bottom: 8px; letter-spacing: -0.01em; }
.card p sup { font-size: 0.7rem; }
.card p sup a { color: var(--red); text-decoration: none; font-weight: 800; }

/* research section */
.research-sub { text-align: center; margin-bottom: 24px; }
.badge-pill { display: inline-block; font-size: 0.68rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; padding: 5px 11px; border-radius: 999px; margin-bottom: 12px; }
.badge-pill.demo { background: color-mix(in srgb, var(--green) 16%, var(--surface)); color: var(--green-deep); }
.badge-pill.emerging { background: #fbe7d6; color: #8a4b1a; }
@media (prefers-color-scheme: dark) {
  .badge-pill.demo { color: #6fd6ac; }
  .badge-pill.emerging { background: #3a281c; color: #e8b98a; }
}
.refs { max-width: 820px; margin: 28px auto 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); }
.refs summary { cursor: pointer; padding: 16px 22px; font-weight: 800; color: var(--ink); }
.refs ol { margin: 0; padding: 4px 22px 22px 40px; display: grid; gap: 10px; }
.refs li { color: var(--ink-soft); font-size: 0.9rem; }

/* tile chip (gameplay motif reused across the site) */
.tile {
  display: inline-flex; align-items: center; justify-content: center;
  width: 52px; height: 52px; border-radius: 50%; font-weight: 900; font-size: 1.4rem;
  border: 3px solid var(--plum); background: var(--tile-cream); color: var(--plum);
  box-shadow: var(--raise);
}
.tile--amber { background: var(--amber); border-color: #7a5a12; color: #4a1d12; box-shadow: 0 4px 0 rgba(122,90,18,0.35); }
.tile--rose  { background: var(--rose);  border-color: var(--plum); color: var(--plum); }

/* ---- Header / nav -------------------------------------------------------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: color-mix(in srgb, var(--ground) 86%, transparent);
  backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid transparent; transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.site-header.scrolled { border-bottom-color: var(--line); box-shadow: var(--shadow-sm); }
.nav { display: flex; align-items: center; justify-content: space-between; height: 68px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 900; font-size: 1.25rem; color: var(--ink); }
.brand:hover { text-decoration: none; }
.brand img { width: 34px; height: 34px; border-radius: 8px; }
.brand .plus { color: var(--red); }
.nav-links { display: none; align-items: center; gap: 26px; list-style: none; padding: 0; margin: 0; }
.nav-links a { color: var(--ink-soft); font-weight: 700; font-size: 0.95rem; }
.nav-links a:hover { color: var(--ink); text-decoration: none; }
.nav-cta { display: none; }
.nav-toggle {
  display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px;
  background: transparent; border: 2px solid var(--line); border-radius: var(--r-sm); color: var(--ink);
}
.nav-toggle svg { width: 22px; height: 22px; }

@media (min-width: 900px) {
  .nav-links, .nav-cta { display: flex; }
  .nav-toggle { display: none; }
}

/* mobile drawer */
.mobile-menu {
  position: fixed; inset: 0; z-index: 150; background: var(--ground);
  display: flex; flex-direction: column; padding: 24px var(--pad);
  transform: translateX(100%); transition: transform 0.3s var(--ease); visibility: hidden;
}
.mobile-menu.open { transform: translateX(0); visibility: visible; }
.mobile-menu .mm-head { display: flex; align-items: center; justify-content: space-between; height: 44px; }
.mobile-menu ul { list-style: none; padding: 0; margin: 28px 0 0; display: grid; gap: 4px; }
.mobile-menu a { display: block; padding: 14px 8px; font-size: 1.3rem; font-weight: 800; color: var(--ink); border-bottom: 1px solid var(--line); }
.mobile-menu a:hover { text-decoration: none; color: var(--red); }
.mobile-menu .btn { margin-top: 24px; }

/* ---- Hero ---------------------------------------------------------------- */
.hero { position: relative; overflow: hidden; padding-block: clamp(48px, 8vw, 96px); }
.hero-bg { position: absolute; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }
.hero-blob {
  position: absolute; border-radius: 50%; filter: blur(6px); opacity: 0.5;
  animation: float 12s ease-in-out infinite;
}
.hero-blob.b1 { width: 340px; height: 340px; background: radial-gradient(circle at 30% 30%, #33b98c, #1d9e75); top: -80px; left: -60px; }
.hero-blob.b2 { width: 260px; height: 260px; background: radial-gradient(circle at 60% 40%, #f6d78a, var(--amber)); bottom: -60px; right: -40px; animation-delay: -4s; }
.hero-inner { position: relative; z-index: 1; display: grid; gap: clamp(30px, 5vw, 56px); align-items: center; }
.hero-copy h1 { margin-bottom: 18px; }
.hero-copy .lead { max-width: 46ch; margin-bottom: 28px; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; margin-bottom: 18px; }
.hero-note { font-size: 0.9rem; color: var(--ink-faint); display: inline-flex; gap: 8px; align-items: center; }

.hero-stage {
  position: relative; aspect-ratio: 1 / 1; max-width: 460px; margin-inline: auto; width: 100%;
  display: grid; place-items: center;
}
.hero-stage picture { display: contents; }
.hero-art { width: 100%; border-radius: var(--r-lg); box-shadow: var(--shadow-lg); }
.float-tile {
  position: absolute; animation: float 7s ease-in-out infinite;
  will-change: transform;
}
.float-tile:nth-child(2) { top: -6%; left: 4%; animation-delay: -1s; }
.float-tile:nth-child(3) { top: 30%; right: -6%; animation-delay: -3s; }
.float-tile:nth-child(4) { bottom: -4%; left: 22%; animation-delay: -5s; }

@keyframes float {
  0%, 100% { transform: translateY(0) rotate(-2deg); }
  50% { transform: translateY(-16px) rotate(2deg); }
}

@media (min-width: 860px) {
  .hero-inner { grid-template-columns: 1.05fr 0.95fr; }
  .hero-copy { text-align: left; }
}

/* ---- Alternating band backgrounds --------------------------------------- */
.band { background: var(--surface); border-block: 1px solid var(--line); }
.band--green { background: linear-gradient(180deg, color-mix(in srgb, var(--green) 12%, var(--ground)), var(--ground)); border: none; }

/* ---- Scroll reveal ------------------------------------------------------- */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity 0.6s var(--ease), transform 0.6s var(--ease); }
.reveal.in { opacity: 1; transform: none; }
.reveal.d1 { transition-delay: 0.08s; }
.reveal.d2 { transition-delay: 0.16s; }
.reveal.d3 { transition-delay: 0.24s; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; }
  .hero-blob, .float-tile { animation: none; }
}

/* ---- Stat / counter row -------------------------------------------------- */
.stats { display: grid; gap: var(--gap); grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); text-align: center; }
.stat .num { font-size: clamp(2rem, 5vw, 3rem); font-weight: 900; color: var(--green-deep); line-height: 1; }
@media (prefers-color-scheme: dark) { .stat .num { color: var(--green); } }
.stat .label { color: var(--ink-soft); font-weight: 600; margin-top: 6px; }

/* ---- Footer -------------------------------------------------------------- */
.site-footer { background: var(--ink); color: #d8d2cd; padding-block: clamp(48px, 7vw, 80px) 32px; }
@media (prefers-color-scheme: dark) { .site-footer { background: #0e0d0c; } }
.footer-grid { display: grid; gap: 36px; grid-template-columns: 1fr; }
.footer-brand { max-width: 320px; }
.footer-brand .brand { color: #fff; }
.footer-brand p { color: #a49e99; margin-top: 12px; font-size: 0.95rem; }
.footer-cols { display: grid; gap: 30px; grid-template-columns: repeat(2, 1fr); }
.footer-col h3 { font-size: 0.8rem; letter-spacing: 0.14em; text-transform: uppercase; color: #8a847f; margin-bottom: 14px; }
.footer-col ul { list-style: none; padding: 0; display: grid; gap: 10px; }
.footer-col a { color: #d8d2cd; font-weight: 600; font-size: 0.95rem; }
.footer-col a:hover { color: #fff; }
.footer-bottom { margin-top: 40px; padding-top: 24px; border-top: 1px solid #322d2a; display: flex; flex-wrap: wrap; gap: 14px; justify-content: space-between; color: #8a847f; font-size: 0.88rem; }
.site-footer .footer-bottom a { color: #cfc9c4; font-weight: 600; }
.site-footer .footer-bottom a:hover { color: #fff; }

@media (min-width: 760px) {
  .footer-grid { grid-template-columns: 1.4fr 2fr; }
  .footer-cols { grid-template-columns: repeat(3, 1fr); }
}

/* ---- Legal / article pages ---------------------------------------------- */
.legal { max-width: 760px; margin-inline: auto; }
.legal h1 { font-size: clamp(2rem, 5vw, 2.8rem); margin-bottom: 8px; }
.legal .updated { color: var(--ink-faint); font-size: 0.92rem; margin-bottom: 28px; }
.legal h2 { font-size: 1.4rem; margin-top: 36px; margin-bottom: 10px; }
.legal h3 { font-size: 1.12rem; margin-top: 22px; margin-bottom: 8px; }
.legal p, .legal li { color: var(--ink-soft); }
.legal ul { margin: 10px 0; }
.legal a { font-weight: 600; }
.legal .toc { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: 18px 22px; margin: 24px 0; }
.legal .toc ul { list-style: none; padding: 0; display: grid; gap: 8px; }
.legal .callout { background: color-mix(in srgb, var(--green) 10%, var(--surface)); border: 1px solid color-mix(in srgb, var(--green) 30%, var(--line)); border-radius: var(--r-md); padding: 16px 20px; margin: 22px 0; }
.breadcrumb { font-size: 0.9rem; color: var(--ink-faint); margin-bottom: 20px; }
.breadcrumb a { color: var(--ink-soft); }

/* ---- FAQ ----------------------------------------------------------------- */
.faq-list { max-width: 760px; margin-inline: auto; display: grid; gap: 12px; }
.faq-item { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; }
.faq-q { display: flex; align-items: center; justify-content: space-between; gap: 16px; width: 100%; text-align: left; background: none; border: 0; padding: 20px 22px; font-weight: 800; font-size: 1.05rem; color: var(--ink); }
.faq-q .chev { flex: none; transition: transform 0.25s var(--ease); }
.faq-item[open] .faq-q .chev, .faq-q[aria-expanded="true"] .chev { transform: rotate(180deg); }
.faq-a { padding: 0 22px 20px; color: var(--ink-soft); }

/* ---- Carousel ------------------------------------------------------------ */
.carousel { position: relative; }
.carousel-track { display: flex; gap: var(--gap); overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 14px; scrollbar-width: thin; }
.carousel-track::-webkit-scrollbar { height: 8px; }
.carousel-track::-webkit-scrollbar-thumb { background: var(--line); border-radius: 999px; }
.shot { flex: 0 0 auto; scroll-snap-align: center; width: min(78vw, 300px); border-radius: var(--r-lg); box-shadow: var(--shadow-md); }
.carousel-controls { display: flex; justify-content: center; gap: 12px; margin-top: 22px; }
.carousel-controls button { width: 46px; height: 46px; border-radius: 50%; border: 2px solid var(--line); background: var(--surface); color: var(--ink); display: grid; place-items: center; }
.carousel-controls button:hover { border-color: var(--ink); }

/* ---- Steps (how to play) ------------------------------------------------- */
.steps { display: grid; gap: var(--gap); counter-reset: step; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.step { position: relative; padding-top: 12px; }
.step .badge { width: 44px; height: 44px; border-radius: 50%; background: var(--red); color: #fff; font-weight: 900; display: grid; place-items: center; margin-bottom: 16px; box-shadow: var(--shadow-sm); }
.step h3 { margin-bottom: 6px; }
.step p { color: var(--ink-soft); }

/* ---- Testimonials -------------------------------------------------------- */
.quote { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 26px; box-shadow: var(--shadow-sm); }
.quote p { font-size: 1.05rem; }
.quote .who { display: flex; align-items: center; gap: 12px; margin-top: 18px; }
.quote .who img { width: 44px; height: 44px; border-radius: 50%; }
.quote .who .mono { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; font-weight: 900; color: #fff; background: var(--c, var(--green)); flex: none; }
.quote .who b { display: block; color: var(--ink); }
.quote .who span { color: var(--ink-faint); font-size: 0.9rem; }
.stars { color: var(--amber); letter-spacing: 2px; }

/* ---- Download band ------------------------------------------------------- */
.download { text-align: center; }
.download-card { background: linear-gradient(135deg, var(--green), var(--green-deep)); color: #fff; border-radius: var(--r-lg); padding: clamp(36px, 6vw, 68px); box-shadow: var(--shadow-lg); }
.download-card h2, .download-card p { color: #fff; }
.download-card .store-badges { justify-content: center; margin-top: 26px; }
.download-card .store-badge { background: rgba(255,255,255,0.14); backdrop-filter: blur(4px); }
