/*
  Purpose: sitewide layout, components, and theme tokens.
  Light mode ("sun"): soft indigo-tinted page (#EEF2FF), ink text (#121826), indigo accent (#4F46E5), success green (#22C55E) on html[data-theme="light"].
  Dark mode ("moon", default): solid black page (no tinted overlays); light text (variables on :root).
  scripts/main.js toggles data-theme on <html> and stores the choice in localStorage.
*/
:root{
  --radius-xl: 22px;
  --radius-lg: 16px;
  --radius-md: 12px;
  --radius-sm: 10px;
  --container: 1120px;

  /* Default palette: dark / moon (true black base, cool accents) */
  --bg:#000000;
  --panel:#050508;
  --panel2:#0c0c0c;
  --text:#e9ecff;
  --muted:#a7add6;
  --neonA:#5b7cfa;
  --neonB:#b15cff;
  --neonC:#2ee9ff;
  --ring: rgba(177, 92, 255, .45);
  --shadow: 0 18px 50px rgba(0,0,0,.65);

  /* No radial washes: keeps the dark theme background fully black */
  --sky-a: transparent;
  --sky-b: transparent;
  --sky-c: transparent;

  --header-bg: #000000;
  --header-line: rgba(177,92,255,.15);

  --nav-link: rgba(233,236,255,.86);
  --nav-link-mobile: rgba(233,236,255,.9);
  --nav-hover-bg: rgba(91,124,250,.08);
  --nav-hover-ring: rgba(91,124,250,.25);

  --toggle-border: rgba(177,92,255,.35);
  --toggle-bg: rgba(12,12,14,.6);
  --toggle-shadow: rgba(177,92,255,.12);
  --toggle-hover-border: rgba(177,92,255,.6);

  --mobile-line: rgba(177,92,255,.15);
  --mobile-hover-bg: rgba(91,124,250,.08);

  --btn-border: rgba(177,92,255,.28);
  --btn-bg: rgba(11,13,27,.6);
  --btn-hover-border: rgba(91,124,250,.55);
  --btn-hover-inner: rgba(91,124,250,.25);
  --btn-hover-glow: rgba(91,124,250,.14);
  --btn-primary-grad: linear-gradient(135deg, rgba(91,124,250,.35), rgba(177,92,255,.25));
  --btn-primary-border: rgba(177,92,255,.65);
  --btn-ghost-border: rgba(167,173,214,.28);

  --eyebrow-border: rgba(177,92,255,.25);
  --eyebrow-bg: rgba(11,13,27,.5);
  --eyebrow-text: rgba(233,236,255,.9);
  --eyebrow-dot-inner: radial-gradient(circle at 30% 30%, rgba(46,233,255,1), rgba(46,233,255,.15));
  --eyebrow-dot-glow: rgba(46,233,255,.4);

  --hero-p: rgba(233,236,255,.86);

  --card-border: rgba(177,92,255,.18);
  --card-border-soft: rgba(177,92,255,.14);
  --card-glass: rgba(11,13,27,.55);
  --hero-card-grad: radial-gradient(600px 240px at 30% 20%, rgba(91,124,250,.18), transparent 52%), radial-gradient(500px 240px at 70% 30%, rgba(177,92,255,.14), transparent 50%);
  --hero-visual-bg: rgba(7,8,18,.35);
  --hero-logo-border: rgba(91,124,250,.18);
  --hero-logo-fill: rgba(7,8,18,.35);

  --section-sub: rgba(233,236,255,.82);

  --founder-ph-bg: radial-gradient(120% 80% at 50% 20%, rgba(91,124,250,.12), transparent 55%), rgba(11,13,27,.35);

  --panel-block: rgba(11,13,27,.55);
  --panel-block-border: rgba(177,92,255,.14);

  --feature-hover-border: rgba(91,124,250,.4);
  --feature-hover-inner: rgba(91,124,250,.18);
  --feature-hover-glow: rgba(91,124,250,.12);
  --feature-badge-grad: linear-gradient(135deg, rgba(91,124,250,.22), rgba(177,92,255,.18));
  --feature-badge-border: rgba(177,92,255,.25);
  --feature-text: rgba(233,236,255,.82);

  --spotlight-grad: radial-gradient(700px 300px at 20% 20%, rgba(91,124,250,.18), transparent 55%), radial-gradient(600px 260px at 70% 40%, rgba(177,92,255,.14), transparent 55%);
  --spotlight-cover-bg: rgba(7,8,18,.35);
  --game-meta-text: rgba(233,236,255,.82);

  --game-card-bg: rgba(11,13,27,.55);
  --game-card-border: rgba(177,92,255,.14);
  --tap-highlight: rgba(91, 124, 250, 0.22);
  --game-card-hover-border: rgba(91,124,250,.45);
  --game-card-hover-inner: rgba(91,124,250,.2);
  --game-card-hover-glow: rgba(91,124,250,.16);
  --game-card-shine: radial-gradient(600px 260px at 20% 20%, rgba(91,124,250,.18), transparent 55%), radial-gradient(540px 240px at 70% 30%, rgba(177,92,255,.14), transparent 55%);
  --game-card-img-border: rgba(177,92,255,.18);

  --chip-text: rgba(233,236,255,.9);
  --chip-border: rgba(167,173,214,.22);
  --chip-bg: rgba(7,8,18,.2);

  --step-bg: rgba(11,13,27,.45);
  --step-border: rgba(177,92,255,.14);
  --step-text: rgba(233,236,255,.82);

  --screenshot-border: rgba(177,92,255,.14);
  --screenshot-bg: rgba(7,8,18,.25);

  --dm-frame-border: rgba(177,92,255,.12);
  --dm-frame-bg: rgba(7,8,18,.35);
  --dm-caption: rgba(233,236,255,.82);

  --footer-line: rgba(177,92,255,.14);
  --footer-text: rgba(233,236,255,.82);
  --footer-link-border: rgba(167,173,214,.18);
  --footer-link-bg: rgba(11,13,27,.25);
  --footer-link-hover: rgba(91,124,250,.5);
  --insta-border: rgba(181,96,255,.34);
  --insta-bg: linear-gradient(135deg, rgba(181,96,255,.18), rgba(91,124,250,.16));
  --insta-hover: rgba(201,124,255,.6);
  --copyright: rgba(167,173,214,.92);

  --label: rgba(233,236,255,.9);
  --input-border: rgba(177,92,255,.2);
  --input-bg: rgba(11,13,27,.5);
  --input-focus-border: rgba(91,124,250,.6);
  --help: rgba(167,173,214,.95);

  /* Age suitability page: recommended age callout */
  --age-banner-border: rgba(91,124,250,.35);
  --age-banner-bg: rgba(91,124,250,.08);
  --age-banner-text: rgba(233,236,255,.95);
  --age-banner-accent: rgba(147,180,255,.98);

  --skip-border: rgba(91,124,250,.45);
}

/* Sun / light theme: cool gray canvas, ink text, indigo accent, green for clues / success highlights */
html[data-theme="light"]{
  /* Brand palette (also referenced by page-specific accents below) */
  --accent: #4f46e5;
  --accent-success: #22c55e;

  --bg: #eef2ff;
  --panel: #ffffff;
  --panel2: #e8ecf4;
  /*
    Text hierarchy (light):
    --text / --hero-heading / --heading = primary ink (#121826 family) for strong readability on the gray canvas.
    Secondary copy uses --hero-p / --section-sub / --feature-text (cool slate grays).
  */
  --text: #121826;
  --hero-heading: #121826;
  --heading: #121826;
  --muted: #5b6475;
  --ring: rgba(79, 70, 229, 0.35);
  --shadow: 0 12px 40px rgba(15, 23, 42, 0.08);

  /* Soft cool wash (indigo + hint of success green) */
  --sky-a: rgba(79, 70, 229, 0.07);
  --sky-b: rgba(34, 197, 94, 0.04);
  --sky-c: rgba(79, 70, 229, 0.055);

  --header-bg: rgba(238, 242, 255, 0.94);
  --header-line: rgba(18, 24, 38, 0.08);

  --nav-link: #121826;
  --nav-link-mobile: #121826;
  --nav-hover-bg: rgba(79, 70, 229, 0.08);
  --nav-hover-ring: rgba(79, 70, 229, 0.22);

  --toggle-border: rgba(18, 24, 38, 0.12);
  --toggle-bg: #ffffff;
  --toggle-shadow: rgba(79, 70, 229, 0.1);
  --toggle-hover-border: rgba(79, 70, 229, 0.45);

  --mobile-line: rgba(18, 24, 38, 0.08);
  --mobile-hover-bg: rgba(79, 70, 229, 0.06);

  --btn-border: rgba(18, 24, 38, 0.12);
  --btn-bg: #ffffff;
  --btn-hover-border: rgba(79, 70, 229, 0.38);
  --btn-hover-inner: rgba(79, 70, 229, 0.12);
  --btn-hover-glow: rgba(79, 70, 229, 0.1);
  --btn-primary-grad: linear-gradient(135deg, #4f46e5, #6366f1);
  --btn-primary-border: rgba(67, 56, 202, 0.85);
  --btn-ghost-border: rgba(18, 24, 38, 0.14);

  --eyebrow-border: rgba(79, 70, 229, 0.22);
  --eyebrow-bg: #ffffff;
  --eyebrow-text: #312e81;
  --eyebrow-dot-inner: radial-gradient(circle at 30% 30%, #4f46e5, rgba(79, 70, 229, 0.2));
  --eyebrow-dot-glow: rgba(79, 70, 229, 0.35);

  --hero-p: #3d4a5c;

  --card-border: rgba(18, 24, 38, 0.1);
  --card-border-soft: rgba(18, 24, 38, 0.07);
  --card-glass: #ffffff;
  --hero-card-grad: radial-gradient(600px 240px at 30% 20%, rgba(79, 70, 229, 0.1), transparent 52%),
    radial-gradient(500px 240px at 70% 30%, rgba(99, 102, 241, 0.08), transparent 50%);
  --hero-visual-bg: #eef1f8;
  --hero-logo-border: rgba(18, 24, 38, 0.1);
  --hero-logo-fill: #ffffff;

  --section-sub: #3d4a5c;

  --founder-ph-bg: radial-gradient(120% 80% at 50% 20%, rgba(79, 70, 229, 0.08), transparent 55%), #eef1f8;

  --panel-block: #ffffff;
  --panel-block-border: rgba(18, 24, 38, 0.1);

  --feature-hover-border: rgba(79, 70, 229, 0.35);
  --feature-hover-inner: rgba(79, 70, 229, 0.12);
  --feature-hover-glow: rgba(79, 70, 229, 0.08);
  --feature-badge-grad: linear-gradient(135deg, rgba(79, 70, 229, 0.18), rgba(99, 102, 241, 0.12));
  --feature-badge-border: rgba(79, 70, 229, 0.22);
  --feature-text: #3d4a5c;

  --spotlight-grad: radial-gradient(700px 300px at 20% 20%, rgba(79, 70, 229, 0.1), transparent 55%),
    radial-gradient(600px 260px at 70% 40%, rgba(99, 102, 241, 0.08), transparent 55%);
  --spotlight-cover-bg: #eef1f8;
  --game-meta-text: #3d4a5c;

  --game-card-bg: #ffffff;
  --game-card-border: rgba(18, 24, 38, 0.1);
  --tap-highlight: rgba(79, 70, 229, 0.18);
  --game-card-hover-border: rgba(79, 70, 229, 0.38);
  --game-card-hover-inner: rgba(79, 70, 229, 0.12);
  --game-card-hover-glow: rgba(79, 70, 229, 0.1);
  --game-card-shine: radial-gradient(600px 260px at 20% 20%, rgba(79, 70, 229, 0.12), transparent 55%),
    radial-gradient(540px 240px at 70% 30%, rgba(99, 102, 241, 0.09), transparent 55%);
  --game-card-img-border: rgba(18, 24, 38, 0.12);

  --chip-text: #121826;
  --chip-border: rgba(18, 24, 38, 0.12);
  --chip-bg: #eef1f8;

  --step-bg: #ffffff;
  --step-border: rgba(18, 24, 38, 0.1);
  --step-text: #3d4a5c;

  --screenshot-border: rgba(18, 24, 38, 0.1);
  --screenshot-bg: #eef1f8;

  --dm-frame-border: rgba(18, 24, 38, 0.1);
  --dm-frame-bg: #ffffff;
  --dm-caption: #3d4a5c;

  --footer-line: rgba(18, 24, 38, 0.08);
  --footer-text: #3d4a5c;
  --footer-link-border: rgba(18, 24, 38, 0.1);
  --footer-link-bg: #eef1f8;
  --footer-link-hover: rgba(79, 70, 229, 0.45);
  --insta-border: rgba(79, 70, 229, 0.22);
  --insta-bg: #eef1f8;
  --insta-hover: rgba(79, 70, 229, 0.45);
  --copyright: #5b6475;

  --label: #121826;
  --input-border: rgba(18, 24, 38, 0.12);
  --input-bg: #ffffff;
  --input-focus-border: #4f46e5;
  --help: #3d4a5c;

  --age-banner-border: rgba(79, 70, 229, 0.28);
  --age-banner-bg: rgba(79, 70, 229, 0.08);
  --age-banner-text: #121826;
  --age-banner-accent: #4338ca;

  --skip-border: rgba(79, 70, 229, 0.45);
}

/* Primary CTA: white label on indigo gradient in light mode */
html[data-theme="light"] .btn-primary{
  color: #ffffff;
}
html[data-theme="light"] .btn.btn-primary:hover{
  border-color: rgba(55, 48, 163, 0.85);
  box-shadow:
    0 0 0 1px rgba(79, 70, 229, 0.22) inset,
    0 18px 60px rgba(79, 70, 229, 0.18);
}

/* Instagram icon uses currentColor; match muted footer tone. */
html[data-theme="light"] .footer-links a.footer-instagram-link{
  color: var(--footer-text);
}

html[data-theme="light"] .section-title{
  color: var(--heading);
}
html[data-theme="light"] .feature-card h3{
  color: var(--heading);
}

/*
  Light theme: same title ink as home (section + feature headings use --heading).
  These blocks used to inherit body --text, so game cards and steps looked "heavier" than the home page.
*/
html[data-theme="light"] .game-card h3,
html[data-theme="light"] .step h3,
html[data-theme="light"] .game-meta h2{
  color: var(--heading);
}

*{ box-sizing:border-box; }

html{
  height:100%;
  /* Stops iOS Safari from inflating small text in a way that breaks layouts */
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
body{
  height:100%;
  margin:0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji","Segoe UI Emoji";
  background:
    radial-gradient(900px 500px at 10% 10%, var(--sky-a), transparent 55%),
    radial-gradient(900px 500px at 90% 20%, var(--sky-b), transparent 60%),
    radial-gradient(800px 600px at 60% 90%, var(--sky-c), transparent 55%),
    var(--bg);
  color:var(--text);
  line-height:1.55;
  overflow-x: hidden;
  -webkit-tap-highlight-color: rgba(91, 124, 250, 0.12);
}
html[data-theme="light"] body{
  -webkit-tap-highlight-color: rgba(79, 70, 229, 0.14);
}

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

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

.container{
  width:100%;
  max-width:var(--container);
  margin:0 auto;
  /* Side padding respects iPhone/Android display cutouts (notch / home indicator) */
  padding-left: max(18px, env(safe-area-inset-left, 0px));
  padding-right: max(18px, env(safe-area-inset-right, 0px));
}

.skip-link{
  position:absolute; left:-999px; top:auto;
  width:1px; height:1px; overflow:hidden;
}
.skip-link:focus{
  left:16px; top:16px; width:auto; height:auto;
  background: var(--panel2);
  border: 1px solid var(--skip-border);
  padding: 10px 12px;
  border-radius: 12px;
  z-index: 1000;
}

/* Header / navigation */
.site-header{
  position:sticky;
  top:0;
  z-index:50;
  backdrop-filter: blur(14px);
  background: var(--header-bg);
  border-bottom: 1px solid var(--header-line);
  /* Content stays below status bar / Dynamic Island */
  padding-top: env(safe-area-inset-top, 0px);
}
.header-inner{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding: 14px 0;
}
.brand{
  display:flex;
  align-items:center;
  gap:10px;
  font-weight:800;
  letter-spacing:.2px;
  min-width: 0;
}
/* Same label color as .nav links (dark: soft lavender-white; light: ink from --nav-link). */
.site-header .brand{
  color: var(--nav-link);
}
.brand-mark{
  width:34px; height:34px;
}
/*
  Company mark (logo.firme.png): white "NIVA" + red "GAMES" in the default (dark) asset.
  Light theme: scripts/main.js swaps to logo.firme.light.png (black "NIVA", "GAMES" #4F46E5) so the mark
  reads clearly on pale surfaces without a silhouette filter.
*/
html[data-theme="light"] .brand-mark{
  width: 34px;
  height: 34px;
  padding: 0;
  box-sizing: border-box;
  object-fit: contain;
  background: transparent;
  border-radius: 0;
  box-shadow: none;
}
.brand-name{
  display:flex;
  flex-direction:column;
  line-height:1.1;
  min-width: 0;
}
.brand-name strong{
  font-size:14px;
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.brand-name span{ font-size:12px; color:var(--muted); font-weight:600; }

.nav{
  display:none;
  align-items:center;
  gap: 18px;
}
.nav a{
  font-weight:700;
  color: var(--nav-link);
  padding: 10px 10px;
  border-radius: 12px;
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
}
.nav a:hover{
  transform: translateY(-1px);
  background: var(--nav-hover-bg);
  box-shadow: 0 0 0 1px var(--nav-hover-ring) inset;
}

.header-actions{
  display:flex;
  align-items:center;
  gap:10px;
  flex-shrink: 0;
}

.mobile-toggle{
  appearance:none;
  border: 1px solid var(--toggle-border);
  background: var(--toggle-bg);
  color: var(--text);
  width:44px; height:44px;
  border-radius: 14px;
  display:grid;
  place-items:center;
  cursor:pointer;
  transition: transform .15s ease, box-shadow .2s ease, border-color .2s ease;
  touch-action: manipulation;
}
.mobile-toggle:hover{
  transform: translateY(-1px);
  box-shadow: 0 0 0 5px var(--toggle-shadow);
  border-color: var(--toggle-hover-border);
}
.mobile-toggle:focus-visible{
  outline:none;
  box-shadow: 0 0 0 4px var(--ring);
}

/* Sun/moon: same footprint as .mobile-toggle; icons swap when html[data-theme="light"] is set */
.theme-toggle{
  appearance:none;
  border: 1px solid var(--toggle-border);
  background: var(--toggle-bg);
  color: var(--text);
  width:44px; height:44px;
  border-radius: 14px;
  display:grid;
  place-items:center;
  cursor:pointer;
  transition: transform .15s ease, box-shadow .2s ease, border-color .2s ease;
  touch-action: manipulation;
}
.theme-toggle:hover{
  transform: translateY(-1px);
  box-shadow: 0 0 0 5px var(--toggle-shadow);
  border-color: var(--toggle-hover-border);
}
.theme-toggle:focus-visible{
  outline:none;
  box-shadow: 0 0 0 4px var(--ring);
}
.theme-toggle__icon{
  width:22px; height:22px;
}
.theme-toggle__sun{ display:block; }
.theme-toggle__moon{ display:none; }
html[data-theme="light"] .theme-toggle__sun{ display:none; }
html[data-theme="light"] .theme-toggle__moon{ display:block; }

/*
  Full-page theme wash (scripts/main.js appends #niva-theme-wash).
  Horizontal “water blade”: a tall band moves left-to-right; the gradient is mostly along X so one side
  of the bright crest can still read as the old page and the other as the new once applyTheme hits ~50%.
*/
#niva-theme-wash{
  position: fixed;
  inset: 0;
  z-index: 99999;
  overflow: hidden;
  pointer-events: none;
  visibility: hidden;
}
#niva-theme-wash.niva-theme-wash--on{
  visibility: visible;
  pointer-events: auto;
}
.niva-theme-wash__band{
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 240vw;
  max-width: none;
  transform: translate3d(-130vw, 0, 0);
  opacity: 0;
  /* Horizontal wash: narrow bright “wet” spine so the wave reads as a vertical curtain sliding sideways */
  background: linear-gradient(
    to right,
    transparent 0%,
    transparent 36%,
    rgba(79, 70, 229, 0.16) 44%,
    rgba(199, 210, 254, 0.42) 48.2%,
    rgba(238, 242, 255, 0.78) 50%,
    rgba(199, 210, 254, 0.42) 51.8%,
    rgba(79, 70, 229, 0.16) 56%,
    transparent 64%,
    transparent 100%
  );
  /* Soft top/bottom fade so the wipe feels like a sheet of water, not a hard rectangle */
  -webkit-mask-image: linear-gradient(to bottom, transparent 0%, #000 8%, #000 92%, transparent 100%);
  mask-image: linear-gradient(to bottom, transparent 0%, #000 8%, #000 92%, transparent 100%);
  will-change: transform, opacity;
}
#niva-theme-wash.niva-theme-wash--play .niva-theme-wash__band{
  animation: niva-theme-wash-sweep 0.88s cubic-bezier(0.42, 0, 0.58, 1) forwards;
}
@keyframes niva-theme-wash-sweep{
  0%{
    transform: translate3d(-130vw, 0, 0);
    opacity: 0;
  }
  8%{
    opacity: 1;
  }
  50%{
    opacity: 1;
  }
  92%{
    opacity: 1;
  }
  100%{
    transform: translate3d(105vw, 0, 0);
    opacity: 0;
  }
}
@media (prefers-reduced-motion: reduce){
  #niva-theme-wash.niva-theme-wash--play .niva-theme-wash__band{
    animation: none;
    opacity: 0;
    transform: translate3d(-130vw, 0, 0);
  }
}

.mobile-menu{
  display:none;
  border-top: 1px solid var(--mobile-line);
  padding: 12px 0 18px;
}
.mobile-menu.is-open{ display:block; }
.mobile-menu a{
  display:flex;
  align-items:center;
  min-height: 48px;
  padding: 10px 12px;
  font-weight:800;
  color: var(--nav-link-mobile);
  border-radius: 14px;
  touch-action: manipulation;
}
.mobile-menu a:hover{
  background: var(--mobile-hover-bg);
}

/* Buttons */
.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:10px;
  padding: 12px 14px;
  border-radius: 14px;
  font-weight:900;
  letter-spacing:.2px;
  border: 1px solid var(--btn-border);
  background: var(--btn-bg);
  color: var(--text);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease, background .18s ease;
  cursor:pointer;
  user-select:none;
  touch-action: manipulation;
}
.btn:hover{
  transform: translateY(-2px);
  border-color: var(--btn-hover-border);
  box-shadow:
    0 0 0 1px var(--btn-hover-inner) inset,
    0 18px 60px var(--btn-hover-glow);
}
.btn:active{ transform: translateY(-1px); }
.btn:focus-visible{
  outline:none;
  box-shadow: 0 0 0 4px var(--ring);
}
.btn-primary{
  background: var(--btn-primary-grad);
  border-color: var(--btn-primary-border);
}
.btn-ghost{
  background: transparent;
  border-color: var(--btn-ghost-border);
}
.btn-small{ padding: 10px 12px; border-radius: 12px; font-weight:850; }

.btn-icon{
  width:18px; height:18px; opacity:.95;
}

/* Sections / layout */
.hero{
  padding: 46px 0 24px;
}
.hero-grid{
  display:grid;
  grid-template-columns: 1fr;
  gap: 22px;
  align-items:center;
}
.eyebrow{
  display:inline-flex;
  align-items:center;
  gap:10px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--eyebrow-border);
  background: var(--eyebrow-bg);
  color: var(--eyebrow-text);
  font-weight:850;
  font-size: 12px;
  letter-spacing:.3px;
}
.eyebrow-dot{
  width:10px; height:10px; border-radius:999px;
  background: var(--eyebrow-dot-inner);
  box-shadow: 0 0 20px var(--eyebrow-dot-glow);
}
.hero h1{
  margin: 12px 0 10px;
  /* Main page title: doubled from previous clamp for sitewide readability */
  font-size: clamp(3.3rem, calc(11vw + 1.7rem), 5rem);
  line-height:1.08;
  letter-spacing:-.04em;
}
/* Long game name: a bit smaller than the global .hero h1 so it fits without dominating */
body.detective-mentalist-page .hero h1{
  font-size: clamp(2.97rem, calc(9.9vw + 1.53rem), 4.5rem);
}
.hero p{
  margin:0;
  color: var(--hero-p);
  font-weight:650;
}
.hero-actions{
  display:flex;
  flex-direction:column;
  align-items:flex-start;
  gap: 10px;
  margin-top: 18px;
}
/*
  Hero store badges (App Store + Google Play):
  Default .hero-actions stacks children in a column on viewports under 720px so full-width .btn CTAs read well.
  This modifier keeps the two badge links in one horizontal row on phones too, with wrap if the row is too narrow.
*/
.hero-actions--store-badges{
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.hero-card{
  border-radius: var(--radius-xl);
  border: 1px solid var(--card-border);
  background:
    var(--hero-card-grad),
    var(--card-glass);
  box-shadow: var(--shadow);
  padding: 18px;
}
.hero-card-top{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 10px;
}
.stat{
  display:flex;
  flex-direction:column;
  gap:4px;
}
.stat strong{ font-size:16px; }
.stat span{ color:var(--muted); font-weight:700; font-size:12px; }
.hero-visual{
  margin-top: 14px;
  border-radius: 18px;
  border: 1px solid var(--hero-logo-border);
  background: var(--hero-visual-bg);
  padding: 14px;
}
.hero-visual img{ width:100%; height:auto; }

/* Smaller framed logo in the hero right column (game pages). Keeps the default .hero-grid: one column on narrow screens, two from 720px up. */
.hero-logo-wrap{
  display:flex;
  justify-content:center;
  align-items:center;
}
/* Wrapper only: no border/padding so the logo fills the slot edge to edge (no visible frame). */
.hero-logo-frame{
  max-width: 220px;
  width: 100%;
}
.hero-logo-frame img{
  display:block;
  width:100%;
  height:auto;
}

/*
  Optional visible frame around a small square logo (e.g. home hero).
  Matches the softer "card" look used by .hero-visual so the block feels part of the same design language.
*/
.hero-logo-frame--bordered{
  max-width: 204px;
  border-radius: 18px;
  border: 1px solid var(--hero-logo-border);
  background: var(--hero-logo-fill);
  padding: 12px;
  box-sizing: border-box;
}
.hero-logo-frame--bordered img{
  display: block;
  width: 100%;
  height: auto;
  border-radius: 12px;
}
/* Home hero: light frame; hero image src switches to the indigo-GAMES light asset in JS */
html[data-theme="light"] .hero-logo-frame--bordered{
  background: var(--hero-logo-fill);
  border-color: var(--hero-logo-border);
  box-shadow: none;
}

.section{
  padding: 26px 0;
}

/* Games listing spacing
   On the games listing page (`/games/`) the single `.game-card` is close enough to the footer
   that its glow/shadow can visually overlap the footer area.
   We add extra bottom padding only for that specific page section so the layout
   stays the same everywhere else. */
.games-listing{
  padding-bottom: 88px;
}
.section-head{
  display:flex;
  flex-direction:column;
  gap: 8px;
  margin-bottom: 14px;
}
.section-title{
  margin:0;
  /* Section headings (h2): doubled from previous clamp sitewide */
  font-size: clamp(2.4rem, calc(5.6vw + 1.7rem), 3rem);
  letter-spacing:-.2px;
}
.section-subtitle{
  margin:0;
  color: var(--section-sub);
  font-weight:650;
}

/* Terms / Privacy / Age: hero title slightly above the old 34px compact size (not sitewide double scale) */
body.policy-page .hero h1{
  font-size: clamp(36px, 2.4vw + 28px, 42px);
  line-height: 1.12;
  letter-spacing: -0.02em;
}
body.policy-page .section-title{
  font-size: 18px;
  letter-spacing: 0;
}

/* Home: "Games that respond to you" — extra paragraph spacing when a card has multiple <p>
   (needs higher specificity than `.feature-card p` later in this file) */
.feature-card.philosophy-card p{
  margin:0 0 10px;
  color: var(--section-sub);
  font-weight:650;
}
.feature-card.philosophy-card p:last-child{ margin-bottom:0; }

/* Home: founders photos (800x800 display target). Two columns even on phones so both portraits sit side by side like on desktop. */
.founders-grid{
  display:grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  justify-items: stretch;
  margin-bottom: 18px;
}
.founder-frame{
  margin:0;
  padding:0;
  overflow:hidden;
  width: min(800px, 100%);
  max-width:800px;
  aspect-ratio: 1 / 1;
  border-radius: var(--radius-lg);
}
.founder-frame img{
  width:100%;
  height:100%;
  max-width:none;
  object-fit: cover;
  object-position: center center;
  /* Nudge the crop upward so the face sits better in the square frame */
  transform: translateY(-3mm);
  /* Corners come from the figure + overflow:hidden (no inner mat / double radius) */
  border-radius: 0;
}
.founder-frame--placeholder{
  display:grid;
  place-items:center;
  min-height:0;
  background: var(--founder-ph-bg);
  border: none;
}
.founder-placeholder-text{
  color: var(--muted);
  font-weight:650;
  font-size: 15px;
  text-align:center;
  padding: 16px;
}
/* Founders section: heading above photos, centered */
.founders-title-block{
  text-align: center;
  align-items: center;
  margin-bottom: 20px;
}
.founders-title-block .section-title{
  max-width: 52ch;
  margin-left: auto;
  margin-right: auto;
}

.feature-grid{
  display:grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.panel{
  border-radius: var(--radius-lg);
  background: var(--panel-block);
  border: 1px solid var(--panel-block-border);
  padding: 16px;
}

/* Age suitability (/age/): "Recommended age" highlight — colors from theme tokens */
.panel.age-rating-banner{
  margin-top: 14px;
  text-align: center;
  border-color: var(--age-banner-border);
  background: var(--age-banner-bg);
}
.age-rating-banner__label{
  margin: 0;
  font-size: 17px;
  font-weight: 800;
  line-height: 1.45;
  color: var(--age-banner-text);
}
.age-rating-banner__accent{
  color: var(--age-banner-accent);
}

/* Founder portraits: no .panel mat — image fills the rounded box edge-to-edge */
figure.founder-frame{
  padding: 0;
  border: none;
  background: transparent;
  box-shadow: none;
  border-radius: var(--radius-xl);
}

.feature-card{
  transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
}
.feature-card:hover{
  transform: translateY(-2px);
  border-color: var(--feature-hover-border);
  box-shadow: 0 0 0 1px var(--feature-hover-inner) inset, 0 22px 70px var(--feature-hover-glow);
}
.feature-card h3{
  display:flex;
  align-items:center;
  gap:10px;
  margin:0 0 8px;
  font-size: 16px;
}
.feature-badge{
  width:30px; height:30px; border-radius: 12px;
  display:grid; place-items:center;
  background: var(--feature-badge-grad);
  border: 1px solid var(--feature-badge-border);
}
.feature-card p{
  margin:0;
  color: var(--feature-text);
  font-weight:650;
}

/* Featured game */
.featured{
  display:grid;
  grid-template-columns: 1fr;
  gap: 14px;
  align-items:center;
}
.game-spotlight{
  padding: 9px;
  border-radius: var(--radius-xl);
  border: 1px solid var(--hero-logo-border);
  background:
    var(--spotlight-grad),
    var(--card-glass);
  box-shadow: var(--shadow);
  overflow:hidden;
}
.spotlight-grid{
  display:grid;
  grid-template-columns: 1fr;
  gap: 7px;
}
.game-cover{
  border-radius: 18px;
  border: 1px solid var(--card-border);
  background: var(--spotlight-cover-bg);
  padding: 12px;
}
.game-cover img{
  width:100%;
  border-radius: 14px;
}

/* Logo art: fill the cover box edge-to-edge so padding / empty bands around the image are gone.
   `object-fit: cover` scales the bitmap to cover the whole rectangle (may crop edges if aspect differs). */
.game-cover.game-cover--logo{
  padding: 0;
  overflow: hidden;
}
.game-spotlight .game-cover.game-cover--logo{
  aspect-ratio: 1 / 1;
  max-width: 270px;
}
.game-spotlight .game-cover.game-cover--logo img{
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  border-radius: 0;
}
.game-card .game-cover.game-cover--logo{
  aspect-ratio: 1 / 1;
  width: 100%;
}
.game-card .game-cover.game-cover--logo img{
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  border: none;
  border-radius: 0;
}
.game-meta h2{
  margin:0 0 4px;
  /* CTA headline: fluid so phones stay a step below laptop/desktop caps */
  font-size: clamp(22px, calc(2.6vw + 12px), 38px);
  letter-spacing:-.2px;
}
.game-meta p{
  margin:0 0 9px;
  color: var(--game-meta-text);
  font-weight:650;
  font-size: 13px;
}
.store-row{
  display:flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}
/* Official store badge links (img inside); replaces text "App Store" / "Google Play" buttons. */
.store-badge-link{
  display: inline-flex;
  align-items: center;
  line-height: 0;
  border-radius: 10px;
  transition: transform .15s ease, opacity .15s ease;
}
.store-badge-link:focus-visible{
  outline: none;
  box-shadow: 0 0 0 4px var(--ring);
}
.store-badge-link:active{
  transform: translateY(-1px);
}
.store-badge-img{
  display: block;
  height: 40px;
  width: auto;
}
/* App Store: dark UI uses the white badge; light UI uses the black badge (both from Apple marketing assets). */
.store-badge-link--app-store .store-badge-img--light{
  display: none;
}
.store-badge-link--app-store .store-badge-img--dark{
  display: block;
}
html[data-theme="light"] .store-badge-link--app-store .store-badge-img--light{
  display: block;
}
html[data-theme="light"] .store-badge-link--app-store .store-badge-img--dark{
  display: none;
}
/* Games listing: store buttons stay clickable above the full-card link (see .game-card__link). */
.game-card .store-row--on-card a{
  pointer-events: auto;
}
.game-spotlight .store-row{
  gap: 6px;
}
/* Placeholder note under store badges: keep spacing without inline styles in HTML. */
.game-spotlight .help{
  margin-top: 10px;
}

/* Games grid */
.games-grid{
  display:grid;
  grid-template-columns: 1fr;
  gap: 14px;
}
.game-card{
  position:relative;
  overflow:hidden;
  transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease;
  border-radius: var(--radius-xl);
  background: var(--game-card-bg);
  border: 1px solid var(--game-card-border);
  /* Mobile: avoid double-tap zoom delay on interactive cards (supported browsers). */
  touch-action: manipulation;
}
/* Full-area navigation to the game page; sits under .game-card-inner in the stacking order. */
.game-card__link{
  position:absolute;
  inset:0;
  z-index:1;
  border-radius: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: var(--tap-highlight);
}
.game-card__link:focus{
  outline:none;
}
/* Ring on the card so focus is visible even though the link is under the content layer. */
.game-card--full-link:has(.game-card__link:focus-visible){
  box-shadow: 0 0 0 4px var(--ring);
}
.game-card:hover{
  transform: translateY(-3px);
  border-color: var(--game-card-hover-border);
  box-shadow: 0 0 0 1px var(--game-card-hover-inner) inset, 0 26px 90px var(--game-card-hover-glow);
}

/* Detective Mentalist - listing card size
   Requirement: make this specific "window" half width and half height, and keep it centered.
   Note: we use `transform` (scale) because the scroll reveal effect also uses `transform`,
   so we must override both the normal and visible reveal states for this card. */
.games-listing .game-card--detective-mentalist{
  margin-left:auto;
  margin-right:auto;
  transform-origin: top center;
}
.games-listing .game-card--detective-mentalist.reveal{
  /* When the card is not yet visible, it starts lowered by `.reveal` (translateY(10px)). */
  transform: translateY(10px) scale(1);
}
.games-listing .game-card--detective-mentalist.reveal.reveal-visible{
  /* When the card becomes visible, it goes to translateY(0) and keeps the scaled size. */
  transform: translateY(0) scale(1);
}
.games-listing .game-card--detective-mentalist:hover{
  /* On hover, keep the card scaled while applying the small lift effect. */
  transform: translateY(-3px) scale(1);
}
.games-listing .game-card--detective-mentalist.reveal.reveal-visible:hover{
  /* This selector is intentionally more specific than `.reveal.reveal-visible`
     so hover keeps the lift (translateY) instead of being overridden back to translateY(0). */
  transform: translateY(-3px) scale(1);
}
.game-card::after{
  content:"";
  position:absolute;
  inset:-2px;
  background: var(--game-card-shine);
  opacity:0;
  transition: opacity .22s ease;
  pointer-events:none;
}
.game-card:hover::after{ opacity:1; }
.game-card-inner{
  position:relative;
  display:grid;
  grid-template-columns: 120px 1fr;
  gap: 14px;
  padding: 14px;
}
/* Listing cards with a stretched link: content layer above the link; clicks pass through to the link. */
.game-card--full-link .game-card-inner{
  z-index:2;
  pointer-events: none;
}
.game-card h3{
  margin: 0 0 8px;
  font-size: 18px;
}
.game-card p{
  margin:0;
  color: var(--feature-text);
  font-weight:650;
}
.game-card .game-cover{
  padding: 0;
  background: transparent;
  border: none;
}
.game-card .game-cover img{ border-radius: 14px; border:1px solid var(--game-card-img-border); }
.chip-list{
  margin-top: 8px;
  display:flex;
  flex-wrap:wrap;
  gap: 7px;
}
.chip{
  font-size: 12px;
  font-weight: 850;
  color: var(--chip-text);
  padding: 7px 9px;
  border-radius: 999px;
  border: 1px solid var(--chip-border);
  background: var(--chip-bg);
}
/* Tighter chips only in the featured spotlight block (other pages keep default .chip sizing). */
.game-spotlight .chip-list{
  margin-top: 6px;
  gap: 5px;
}
.game-spotlight .chip{
  font-size: 11px;
  padding: 6px 8px;
}

/* Detail page sections */
.two-col{
  display:grid;
  grid-template-columns: 1fr;
  gap: 14px;
}
.steps{
  display:grid;
  grid-template-columns: 1fr;
  gap: 12px;
}
.step{
  padding: 16px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--step-border);
  background: var(--step-bg);
}
.step h3{
  margin:0 0 6px;
  font-size: 16px;
}
.step p{
  margin:0;
  color: var(--step-text);
  font-weight:650;
}

.screens{
  display:grid;
  grid-template-columns: 1fr;
  gap: 12px;
}
.screenshot{
  border-radius: var(--radius-lg);
  overflow:hidden;
  border: 1px solid var(--screenshot-border);
  background: var(--screenshot-bg);
  padding: 12px;
}

/* Detective Mentalist detail page: 2x2 screenshot grid with captions (responsive images via srcset in HTML).
   On phones (and short phone-landscape widths) the same grid is overridden in detective-mentalist/index.html to a horizontal swipe carousel; hero, steps, features, and CTA follow the normal site mobile layout. */
.detective-mentalist-page .dm-screen-grid{
  display:grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.detective-mentalist-page .dm-screen-card{
  margin:0;
  display:flex;
  flex-direction:column;
  gap: 12px;
  min-width:0;
}
.detective-mentalist-page .dm-screen-frame{
  border-radius: 14px;
  overflow:hidden;
  border: 1px solid var(--dm-frame-border);
  background: var(--dm-frame-bg);
  min-width:0;
}
.detective-mentalist-page .dm-screen-frame img{
  width:100%;
  height:auto;
}
.detective-mentalist-page .dm-screen-caption{
  margin:0;
  color: var(--dm-caption);
  font-weight:650;
  font-size: clamp(11px, 2.85vw, 14px);
  line-height:1.45;
  overflow-wrap:anywhere;
}

/* Footer */
.site-footer{
  padding: 28px 0 calc(40px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--footer-line);
  margin-top: 16px;
  color: var(--footer-text);
}
.footer-inner{
  display:flex;
  flex-direction:column;
  gap: 12px;
}
.footer-links{
  display:flex;
  flex-wrap:wrap;
  gap: 12px;
}
.footer-links a{
  font-weight:800;
  padding: 10px 10px;
  border-radius: 12px;
  border: 1px solid var(--footer-link-border);
  background: var(--footer-link-bg);
  transition: transform .18s ease, border-color .18s ease;
}
.footer-links a.footer-instagram-link{
  /* This variant marks the social media button while keeping
     the same layout and spacing as the other footer links. */
  border-color: var(--insta-border);
  background: var(--insta-bg);
  /* We center the icon so the button feels balanced without text. */
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width: 42px;
  min-width: 42px;
  padding: 10px;
}
.footer-links a.footer-instagram-link svg{
  /* Fixed icon size keeps consistency across all pages/footers. */
  width: 18px;
  height: 18px;
}
.footer-links a:hover{
  transform: translateY(-2px);
  border-color: var(--footer-link-hover);
}
.footer-links a.footer-instagram-link:hover{
  /* Slightly stronger accent on hover to signal interactivity
     without creating a visual jump in the footer. */
  border-color: var(--insta-hover);
}
.copyright{
  color: var(--copyright);
  font-weight:650;
  font-size: 13px;
}

/* Reveal animations */
.reveal{
  opacity:0;
  transform: translateY(10px);
  transition: opacity .6s ease, transform .6s ease;
}
.reveal.reveal-visible{
  opacity:1;
  transform: translateY(0);
}

/* Forms */
.form{
  display:grid;
  gap: 12px;
}
.field{
  display:grid;
  gap: 8px;
}
label{
  font-weight: 850;
  color: var(--label);
  font-size: 14px;
}
input, textarea{
  width:100%;
  border-radius: 14px;
  border: 1px solid var(--input-border);
  background: var(--input-bg);
  padding: 12px 12px;
  color: var(--text);
  font-weight: 650;
  /* 16px+ avoids iOS zooming the whole page when the field is focused */
  font-size: 16px;
}
textarea{ min-height: 130px; resize: vertical; }
input:focus, textarea:focus{
  outline:none;
  box-shadow: 0 0 0 4px var(--ring);
  border-color: var(--input-focus-border);
}
.help{
  color: var(--help);
  font-weight: 650;
  font-size: 13px;
  margin-top: -4px;
}

/* Narrow phones / portrait: spacing, full-width CTAs, tighter game cards */
@media (max-width: 719px){
  /*
    Hero + section titles: slightly smaller than the laptop clamp so long lines
    fit without dominating small screens (desktop/tablet landscape keep base rules).
  */
  .hero h1{
    font-size: clamp(2.15rem, calc(6.5vw + 0.82rem), 2.75rem);
  }
  body.detective-mentalist-page .hero h1{
    font-size: clamp(1.95rem, calc(5.9vw + 0.72rem), 2.45rem);
  }
  .section-title{
    font-size: clamp(1.42rem, calc(3.2vw + 0.62rem), 1.82rem);
  }
  .hero{
    padding: 32px 0 20px;
  }
  .section{
    padding: 22px 0;
  }
  .hero-actions .btn{
    width: 100%;
    max-width: 100%;
    justify-content: center;
  }
  .game-card-inner{
    grid-template-columns: minmax(88px, 108px) minmax(0, 1fr);
    gap: 12px;
    padding: 12px;
  }
  .footer-links a:not(.footer-instagram-link){
    min-height: 44px;
    display: inline-flex;
    align-items: center;
  }

  /*
    Game spotlight CTA: phones are one column already, but the logo was left-aligned
    with a fixed max width and store badges could crowd narrow viewports. Use a
    vertical flex stack, center alignment, slightly smaller logo cap, and
    wrapping/centered badges so nothing clips past the safe padding.
  */
  .spotlight-grid{
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
  }
  .game-spotlight{
    padding: 14px 12px;
  }
  .game-spotlight .game-cover.game-cover--logo{
    max-width: min(210px, 78vw);
    width: 100%;
  }
  .game-spotlight .game-meta{
    text-align: center;
    max-width: 26rem;
    width: 100%;
  }
  .game-spotlight .game-meta h2{
    font-size: clamp(1.35rem, 4.2vw + 0.55rem, 1.85rem);
  }
  .game-spotlight .game-meta p{
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 12px;
  }
  .game-spotlight .store-row{
    justify-content: center;
    gap: 10px;
    row-gap: 12px;
    width: 100%;
  }
  .game-spotlight .store-badge-link{
    min-height: 44px;
    padding: 4px 2px;
    box-sizing: border-box;
  }
  .game-spotlight .store-badge-img{
    height: clamp(34px, 9vw, 40px);
    width: auto;
  }
}

/* Responsive */
@media (min-width: 720px){
  .container{
    padding-left: max(24px, env(safe-area-inset-left, 0px));
    padding-right: max(24px, env(safe-area-inset-right, 0px));
  }
  .nav{ display:flex; }
  .mobile-toggle{ display:none; }
  .mobile-menu{ display:none !important; }
  .hero-grid{ grid-template-columns: 1.2fr .8fr; gap: 22px; }
  .hero-logo-wrap{ justify-content:flex-end; }
  .hero-actions{ flex-direction:row; flex-wrap:wrap; }
  .feature-grid{ grid-template-columns: repeat(3, 1fr); }
  .spotlight-grid{ grid-template-columns: 270px 1fr; align-items:center; }
  .games-grid{ grid-template-columns: repeat(2, 1fr); }
  /* On the "Games" page we only have one card, so keep it centered and full-row. */
  .games-listing .games-grid{ grid-template-columns: 1fr; justify-items:center; }
  .two-col{ grid-template-columns: 1fr 1fr; }
  .steps{ grid-template-columns: repeat(3, 1fr); }
  /* Age Suitability page: only two paths, keep them paired instead of a 3-column row. */
  .steps.age-suitability-player-paths{ grid-template-columns: 1fr 1fr; }
  .screens{ grid-template-columns: repeat(3, 1fr); }
  .detective-mentalist-page .dm-screen-grid{
    gap: 16px;
  }
  .header-inner{ padding: 16px 0; }
  .footer-inner{ flex-direction:row; align-items:center; justify-content:space-between; }
  .founders-grid{
    grid-template-columns: repeat(2, minmax(0, 800px));
    justify-content: center;
  }
}

@media (prefers-reduced-motion: reduce){
  .reveal{ transition:none; transform:none; opacity:1; }
  .game-card, .feature-card, .btn, .footer-links a{ transition:none; }
}

