:root {
  --p-bg: #faf6ee; --p-surface: #f0eadc; --p-ink: #15211c; --p-muted: #4e5f57;
  --p-accent: #cf204f; --p-accent-ink: #faf6ee; --p-action: #cf204f; --p-action-ink: #faf6ee;
  --p-inv-bg: #15211c; --p-inv-surface: #222d28; --p-inv-ink: #faf6ee; --p-inv-muted: #9a9e96;
  --p-inv-accent: #cf204f; --p-inv-accent-ink: #faf6ee; --p-inv-action: #cf204f; --p-inv-action-ink: #faf6ee;
  --font-display: "Roboto", system-ui, -apple-system, sans-serif;
  --font-text: "Roboto", system-ui, -apple-system, sans-serif;
  --font-mono: "Roboto Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --display-weight: 500;
  --display-tracking: -0.02em;
  --display-tracking-xl: -0.03em;
}

.brand-icon {
  width: 26px;
  height: 26px;
  border-radius: 22%;
  object-fit: cover;
}

/* Header: logo left, Gameplay & Journal links right */
.nav__links {
  justify-content: flex-end;
  gap: var(--s-5);
}

/* Match Option C hero proportions: compact top space, framed rounded stage inside .wrap */
.hero--product {
  --hgap: 28px;
  --hpadb: 28px;
}

.hero--product .hero__head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--s-6);
}

.hero--product .hero__head > :first-child {
  flex: 1 1 auto;
  min-width: 0;
  align-self: start;
}

.hero--product .hero__head h1 {
  align-self: start;
  text-wrap: initial;
}

.hero--product .hero__head .hero__lead {
  max-width: none;
}

.hero--product .hero__head > .btn-row,
.hero--product .hero__head > .store-badges {
  flex: 0 0 auto;
  justify-content: flex-end;
}

@media (max-width: 1023px) {
  .hero--product .hero__head {
    flex-direction: column;
    align-items: flex-start;
  }
  .hero--product .hero__head > .btn-row,
  .hero--product .hero__head > .store-badges {
    justify-content: flex-start;
  }
}

.hero--product .hero__stage--device {
  margin-top: var(--s-5);
  background: none;
  border-radius: 0;
  box-shadow: none;
  overflow: visible;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
}

.iphone-frame {
  position: relative;
  width: fit-content;
  max-width: 100%;
  margin-inline: auto;
  padding: 12px;
  border-radius: 38px;
  background: #141416;
  border: 2px solid #48484c;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.12),
    0 28px 64px rgba(21, 33, 28, 0.24);
}

.iphone-frame::before {
  content: "";
  position: absolute;
  top: -4px;
  left: 112px;
  width: 54px;
  height: 3px;
  border-radius: 2px;
  background: #5c5c62;
}

.iphone-frame::after {
  content: "";
  position: absolute;
  bottom: -4px;
  left: 96px;
  width: 44px;
  height: 3px;
  border-radius: 2px;
  background: #5c5c62;
}

.iphone-frame__screen {
  border-radius: 26px;
  overflow: hidden;
  background: #000000;
}

.iphone-frame__screen video {
  display: block;
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: clamp(240px, 58svh, 540px);
  object-fit: contain;
}

.hero--product .hero__stage:has(> img:not(.is-cutout), > picture) {
  margin-inline: 0;
  margin-bottom: 0;
  border-radius: var(--r-lg);
  box-shadow: 0 20px 56px rgba(21, 33, 28, 0.12);
}

/* Narrow phone header fit at 320px without clipping menu toggle */
@media (max-width: 374px) {
  .nav__logo {
    font-size: 14px;
    gap: 5px;
  }
  .nav__logo .brand-icon {
    width: 20px;
    height: 20px;
  }
  .nav:not(.is-open) .nav__actions .btn {
    padding-inline: 10px;
    font-size: 13px;
  }
}

/* Keep mobile hero stage uncropped and section gap uniform */
@media (max-width: 639px) {
  .hero--product .hero__stage--device {
    flex: 0 0 auto;
    min-height: 0;
    aspect-ratio: auto;
  }
  .iphone-frame {
    padding: 8px;
    border-radius: 26px;
  }
  .iphone-frame__screen {
    border-radius: 18px;
  }
  #chapters .fill,
  #download .fill {
    flex: 1 0 auto;
    min-height: auto;
  }
}

/* Big stat numbers without subtext in Nesting Doll Gameplay */
#chapters .chapters-grid {
  align-items: center;
}

#chapters .split-col {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: var(--s-6);
}

#chapters .section-head {
  margin-bottom: 0;
}

.gameplay-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--s-5);
  margin: 0;
  padding-top: var(--s-5);
  border-top: 1px solid var(--line);
}

.gameplay-stats > div {
  display: flex;
  flex-direction: column-reverse;
  gap: var(--s-2);
}

.gameplay-stats dt {
  font-size: var(--t-small);
  color: var(--muted);
}

.gameplay-stats dd {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(36px, 2.4vw + 24px, 56px);
  font-weight: var(--display-weight);
  line-height: 1;
  letter-spacing: var(--display-tracking);
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}

/* Pixel 9 Pro landscape wireframe for uncropped levels board */
#chapters .device-stage {
  display: flex;
  align-items: center;
  height: 100%;
}

.pixel-frame {
  position: relative;
  width: 100%;
  padding: 12px;
  border-radius: 30px;
  background: #0d1411;
  border: 2px solid #3c4a43;
  box-shadow:
    inset 0 0 0 1px rgba(250, 246, 238, 0.08),
    0 28px 64px rgba(0, 0, 0, 0.48);
}

.pixel-frame::before {
  content: "";
  position: absolute;
  top: -4px;
  right: 88px;
  width: 44px;
  height: 3px;
  border-radius: 2px;
  background: #4e5e56;
}

.pixel-frame::after {
  content: "";
  position: absolute;
  top: -4px;
  right: 146px;
  width: 64px;
  height: 3px;
  border-radius: 2px;
  background: #4e5e56;
}

.pixel-frame__cam {
  position: absolute;
  left: 22px;
  top: 50%;
  transform: translateY(-50%);
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #1b2420;
  border: 1px solid #303c36;
  z-index: 2;
}

.pixel-frame__screen {
  border-radius: 20px;
  overflow: hidden;
  background: #0a0f0d;
}

.pixel-frame__screen img {
  width: 100%;
  height: auto;
  aspect-ratio: 2622 / 1206;
  object-fit: contain;
  display: block;
}

@media (max-width: 1023px) {
  #chapters .device-stage {
    height: auto;
  }
  .pixel-frame {
    padding: 9px;
    border-radius: 24px;
  }
  .pixel-frame__screen {
    border-radius: 16px;
  }
}

/* Combined download + footer band: one unified surface, full viewport height */
.footer--combined {
  border-top: 0;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding-block: var(--s-8) var(--s-6);
}

.footer--combined > .wrap {
  flex: 1 0 auto;
  display: flex;
  align-items: center;
}

.footer--combined .download-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-6);
  width: 100%;
}

.footer--combined .download-head {
  display: flex;
  align-items: flex-start;
  gap: var(--s-5);
  min-width: 0;
}

.footer--combined .download-head .section-head,
.footer--combined .download-head .section-head p,
.footer--combined .download-seo {
  max-width: none;
}

.footer--combined .download-seo {
  margin-top: var(--s-3);
}

.footer--combined .footer__bar {
  margin-top: 0;
  padding-top: var(--s-5);
  border-top: 1px solid var(--line);
}

.footer--combined .footer__legal {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

.download-icon {
  width: 64px;
  height: 64px;
  border-radius: 22%;
  object-fit: cover;
  flex: none;
  box-shadow: 0 8px 20px rgba(21, 33, 28, 0.14);
}

.download-head .section-head {
  margin-bottom: 0;
}

.store-badges {
  display: flex;
  flex-wrap: wrap;
  flex: none;
  gap: var(--s-4);
  align-items: center;
}

.store-badge {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  height: 52px;
  min-width: 172px;
  padding: 0 18px;
  border-radius: 10px;
  background: #000000;
  border: 1px solid #a6a6a6;
  color: #ffffff;
  text-decoration: none;
  transition: transform var(--dur) var(--ease), opacity var(--dur) var(--ease);
}

.store-badge:hover {
  transform: translateY(-1px);
  opacity: 0.92;
}

.store-badge__icon {
  width: 24px;
  height: 24px;
  flex: none;
}

.store-badge__text {
  display: grid;
  line-height: 1.1;
}

.store-badge__text small {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.02em;
  opacity: 0.9;
}

.store-badge__text strong {
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

@media (max-width: 1023px) {
  .download-box {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 639px) {
  .download-head {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--s-4);
  }
}

/* Compact dark footer without sitemap */
.footer--dark {
  padding-block: var(--s-6);
}

.footer--dark .footer__legal {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

/* Reading layout for Journal, Privacy, and Terms subpages */
.reading-main {
  padding-top: calc(var(--nav) + var(--s-8));
  padding-bottom: var(--s-9);
}

.reading-article {
  max-width: 72ch;
  display: grid;
  gap: var(--s-5);
}

.reading-article h1 {
  font-size: clamp(34px, 3vw + 20px, 54px);
}

.reading-article h2 {
  margin-top: var(--s-4);
  font-size: clamp(24px, 1.2vw + 18px, 32px);
}

.reading-lead {
  font-size: var(--t-lead);
  line-height: 1.55;
  color: var(--muted);
}

.reading-media {
  border-radius: var(--r-lg);
  width: 100%;
  height: auto;
  aspect-ratio: 2622 / 1206;
  object-fit: cover;
}

.draft-notice {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: var(--s-5);
  display: grid;
  gap: var(--s-2);
}

.draft-notice__label {
  font-size: var(--t-label);
  font-weight: 500;
  color: var(--accent);
}
