/* Worried Toast — cozy indie studio */
:root {
  --cream: #fff7e6;
  --cream-deep: #fce5ba;
  --toast-light: #f2b765;
  --toast: #d68b3c;
  --toast-deep: #a15c25;
  --brown: #2a1a14;
  --brown-soft: #45271a;
  --brown-muted: #6b3e1c;
  --mint: #86d3bf;
  --mint-deep: #4c9c8b;
  --mint-light: #c8f2e4;
  --orange: #c2410c;
  --orange-soft: #ea580c;
  --blush: #f0806a;
  --surface: #fffdf8;
  --card: #ffffff;
  --border: rgba(42, 26, 20, 0.12);
  --shadow: 0 8px 28px rgba(107, 62, 28, 0.12);
  --radius: 1.25rem;
  --radius-sm: 0.75rem;
  --font: ui-rounded, "Segoe UI", system-ui, -apple-system, "Helvetica Neue",
    Arial, sans-serif;
  --max: 42rem;
  --pad: clamp(1.25rem, 4vw, 2rem);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --cream: #1a1410;
    --cream-deep: #2a1f18;
    --surface: #221a14;
    --card: #2c211a;
    --brown: #fff7e6;
    --brown-soft: #fce5ba;
    --brown-muted: #f2b765;
    --border: rgba(255, 247, 230, 0.14);
    --shadow: 0 8px 28px rgba(0, 0, 0, 0.35);
    --mint-light: #2a4a42;
    color-scheme: dark;
  }
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.55;
  color: var(--brown);
  background:
    radial-gradient(ellipse 80% 50% at 50% -10%, var(--mint-light), transparent 60%),
    radial-gradient(ellipse 60% 40% at 100% 20%, rgba(255, 176, 64, 0.18), transparent 50%),
    var(--cream);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

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

a {
  color: var(--mint-deep);
  text-underline-offset: 0.15em;
}

a:hover {
  color: var(--orange);
}

a:focus-visible {
  outline: 3px solid var(--orange);
  outline-offset: 3px;
  border-radius: 4px;
}

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--card);
  color: var(--brown);
  padding: 0.75rem 1rem;
  z-index: 100;
}

.skip:focus {
  left: var(--pad);
  top: 0.5rem;
}

.wrap {
  width: min(100% - 2 * var(--pad), 56rem);
  margin-inline: auto;
}

/* Header */
.site-header {
  padding: 1.25rem 0 0.5rem;
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.logo-link {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
  color: inherit;
}

.logo-link img.mark {
  width: 2.5rem;
  height: 2.5rem;
}

.logo-link img.wordmark {
  height: 1.35rem;
  width: auto;
}

.nav-links {
  display: flex;
  gap: 0.75rem 1.25rem;
  flex-wrap: wrap;
  font-size: 0.95rem;
  font-weight: 600;
}

.nav-links a {
  text-decoration: none;
  color: var(--brown-soft);
}

.nav-links a:hover {
  color: var(--orange);
}

/* Hero */
.hero {
  padding: clamp(2rem, 6vw, 4rem) 0 clamp(2.5rem, 5vw, 3.5rem);
  text-align: center;
}

.hero-visual {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}

.hero-toaster {
  width: min(220px, 55vw);
  height: auto;
  filter: drop-shadow(0 12px 24px rgba(107, 62, 28, 0.2));
}

.hero-wordmark {
  width: min(340px, 85vw);
  height: auto;
}

.tagline {
  font-size: clamp(1.15rem, 2.8vw, 1.4rem);
  font-weight: 500;
  max-width: 28rem;
  margin: 0 auto 1.75rem;
  color: var(--brown-soft);
  line-height: 1.45;
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.7rem 1.25rem;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.95rem;
  text-decoration: none;
  border: 2px solid transparent;
  transition: transform 0.15s ease, background 0.15s ease, color 0.15s ease;
}

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

.btn-primary {
  background: var(--orange);
  color: #fff;
  border-color: var(--orange);
}

.btn-primary:hover {
  background: #9a3412;
  color: #fff;
}

.btn-ghost {
  background: var(--card);
  color: var(--brown);
  border-color: var(--border);
  box-shadow: var(--shadow);
}

.btn-ghost:hover {
  color: var(--brown);
  border-color: var(--mint-deep);
}

/* Sections */
section {
  padding: 0.5rem 0 2.25rem;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: clamp(1.25rem, 3vw, 1.75rem);
  box-shadow: var(--shadow);
}

.card + .card {
  margin-top: 1.25rem;
}

.card h2 {
  margin: 0 0 0.65rem;
  font-size: 1.2rem;
  letter-spacing: -0.01em;
}

.card p {
  margin: 0;
  color: var(--brown-soft);
}

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

.pill {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--mint-deep);
  background: var(--mint-light);
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  margin-bottom: 0.75rem;
}

@media (prefers-color-scheme: dark) {
  .pill {
    color: var(--mint);
  }
}

.game-preview {
  display: grid;
  gap: 1rem;
}

@media (min-width: 560px) {
  .game-preview {
    grid-template-columns: auto 1fr;
    align-items: center;
  }
}

.mascot-thumb {
  width: 96px;
  height: 96px;
  margin: 0 auto;
}

@media (min-width: 560px) {
  .mascot-thumb {
    margin: 0;
  }
}

.muted {
  color: var(--brown-muted);
  font-size: 0.92rem;
}

/* Contact strip */
.contact {
  text-align: center;
  padding-bottom: 2.5rem;
}

.contact .card {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  align-items: center;
}

.contact p {
  margin: 0;
  max-width: 28rem;
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 1.5rem 0 2rem;
  text-align: center;
  font-size: 0.9rem;
  color: var(--brown-muted);
}

.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  justify-content: center;
  margin-bottom: 0.65rem;
}

.site-footer a {
  color: var(--brown-soft);
  text-decoration: none;
  font-weight: 600;
}

.site-footer a:hover {
  color: var(--orange);
}

/* Privacy / 404 pages */
.page-main {
  padding: 2rem 0 3rem;
}

.page-main h1 {
  margin: 0 0 1rem;
  font-size: clamp(1.6rem, 4vw, 2rem);
  letter-spacing: -0.02em;
}

.page-main h2 {
  margin: 1.75rem 0 0.5rem;
  font-size: 1.15rem;
}

.page-main p,
.page-main li {
  color: var(--brown-soft);
}

.page-main ul {
  padding-left: 1.25rem;
}

.page-main .card {
  max-width: var(--max);
  margin-inline: auto;
}

.back-link {
  display: inline-block;
  margin-bottom: 1rem;
  font-weight: 600;
  text-decoration: none;
}

/* 404 */
.not-found {
  text-align: center;
  padding: 3rem 0 4rem;
}

.not-found .big {
  font-size: clamp(3.5rem, 12vw, 5rem);
  font-weight: 800;
  line-height: 1;
  margin: 0 0 0.5rem;
  color: var(--toast);
}

.not-found .hero-toaster {
  width: min(160px, 40vw);
  margin: 0 auto 1.25rem;
}

/* Mobile header: one compact row; hero keeps the big branding */
@media (max-width: 480px) {
  .site-header {
    padding: 0.85rem 0 0.35rem;
  }

  .site-header .wrap {
    flex-wrap: nowrap;
    gap: 0.5rem;
  }

  .logo-link img.wordmark {
    display: none; /* hero wordmark is the only big brand mark */
  }

  .logo-link img.mark {
    width: 2rem;
    height: 2rem;
  }

  .nav-links {
    width: auto;
    flex: 1 1 auto;
    justify-content: flex-end;
    flex-wrap: nowrap;
    gap: 0.45rem 0.7rem;
    font-size: 0.8125rem;
    padding-top: 0;
  }

  .cta-row {
    flex-direction: column;
    align-items: stretch;
  }

  .cta-row .btn {
    width: 100%;
  }
}


/* Accessibility utilities */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.mt-1 {
  margin-top: 1rem;
}

.mb-1_5 {
  margin-bottom: 1.5rem;
}

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

  .btn {
    transition: none;
  }

  .btn:hover {
    transform: none;
  }
}


/* Embedded Pop the Toast — wide desktop stage, mobile full-screen overlay */
.play-wrap {
  /* Break out of the usual ~56rem column so the toaster can breathe */
  width: min(100% - 2 * var(--pad), 68rem); /* ~1088px */
}

.play-teaser {
  padding: clamp(1.25rem, 2.5vw, 1.85rem);
}

.play-teaser-copy {
  max-width: 40rem;
}

.play-teaser-copy h2 {
  font-size: clamp(1.2rem, 2.2vw, 1.45rem);
}

/* Desktop: mobile-only hint hidden on wide screens */
@media (min-width: 701px) {
  .play-embed-hint-mobile {
    display: none;
  }
}

@media (max-width: 700px) {
  .play-embed-hint-desktop {
    display: none;
  }
}

.play-embed {
  margin-top: 1.15rem;
  position: relative;
  width: 100%;
  border-radius: calc(var(--radius) - 0.2rem);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--cream-deep);
  /* Mobile poster: compact card preview */
  aspect-ratio: 4 / 5;
  max-height: min(420px, 70vh);
}

.play-embed-poster {
  appearance: none;
  border: 0;
  width: 100%;
  height: 100%;
  min-height: 240px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 1.5rem;
  background:
    radial-gradient(ellipse 70% 50% at 50% 40%, rgba(94, 191, 168, 0.28), transparent 65%),
    var(--cream-deep);
  color: inherit;
  font: inherit;
}

.play-embed-poster img {
  width: min(140px, 36vw);
  height: auto;
  filter: drop-shadow(0 10px 20px rgba(107, 62, 28, 0.22));
}

.play-embed-cta {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.45rem;
}

.play-embed-frame {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 240px;
  border: 0;
  background: var(--cream);
}

.play-embed-frame[hidden],
.play-embed-poster[hidden] {
  display: none !important;
}

/* Desktop / tablet: big inline stage — game canvas scales with iframe size */
@media (min-width: 701px) {
  .play-embed {
    aspect-ratio: 16 / 10;
    height: clamp(560px, 68vh, 720px);
    max-height: 720px;
    min-height: 560px;
  }

  .play-embed-poster {
    min-height: 560px;
  }

  .play-embed-poster img {
    width: min(180px, 22vw);
  }
}

@media (min-width: 960px) {
  .play-embed {
    aspect-ratio: auto;
    height: 680px;
    max-height: 720px;
  }
}

/* Mobile: playing = fixed full-viewport overlay (poster stays inline until then) */
@media (max-width: 700px) {
  .play-embed.is-overlay {
    position: fixed;
    inset: 0;
    z-index: 10000;
    width: 100%;
    height: 100%;
    height: 100dvh;
    max-height: none;
    min-height: 0;
    aspect-ratio: auto;
    border-radius: 0;
    border: 0;
    margin: 0;
    background: var(--cream);
    /* Safe-area: game chrome handles top bar; pad the frame edges lightly */
    padding:
      env(safe-area-inset-top, 0px)
      env(safe-area-inset-right, 0px)
      env(safe-area-inset-bottom, 0px)
      env(safe-area-inset-left, 0px);
  }

  .play-embed.is-overlay .play-embed-frame {
    min-height: 0;
    height: 100%;
    background: var(--cream);
  }

  body.play-overlay-open {
    overflow: hidden;
    /* Prevent iOS rubber-band scroll behind overlay */
    touch-action: none;
  }
}


/* Unmix screenshot gallery (coming soon) */
.shot-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.85rem;
  margin-top: 1.35rem;
  padding: 0;
  list-style: none;
}

.shot-card {
  margin: 0;
  min-width: 0;
}

.shot-phone {
  background: var(--cream-deep);
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) - 0.15rem);
  padding: 0.4rem;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.shot-phone picture {
  position: relative;
  display: block;
  width: 100%;
  /* Shared phone frame so the row aligns; mystery is shorter so we cover */
  aspect-ratio: 9 / 19.5;
  overflow: hidden;
  border-radius: calc(var(--radius-sm) - 0.1rem);
  background: var(--cream-deep);
}

.shot-phone img {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  border-radius: 0;
}

@media (max-width: 700px) {
  .shot-row {
    display: flex;
    gap: 0.75rem;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
    padding-bottom: 0.35rem;
    margin-inline: calc(-1 * clamp(0.25rem, 1.5vw, 0.5rem));
    padding-inline: clamp(0.25rem, 1.5vw, 0.5rem);
  }

  .shot-card {
    flex: 0 0 min(58vw, 11.5rem);
    scroll-snap-align: start;
  }
}

@media (prefers-reduced-motion: reduce) {
  .shot-row {
    scroll-snap-type: none;
  }
}
