/* Shared sticky header + responsive footer chrome.
   Load /palette.css as a separate <link> before this file — do not @import
   (avoids delayed token application / FOUC). */

/* Soften FOUT: brief hide until web fonts ready (class set by inline head script).
   No-JS never gets .js-fonts, so content stays visible. */
html {
  background: var(--cream, #F3EDE3);
}

html.js-fonts body {
  opacity: 0;
}

html.js-fonts.fonts-ready body {
  opacity: 1;
  transition: opacity 0.25s ease;
}

@media (prefers-reduced-motion: reduce) {
  html.js-fonts body,
  html.js-fonts.fonts-ready body {
    opacity: 1;
    transition: none;
  }
}

/* Reserve space for Phosphor glyphs before the icon font loads */
.ph {
  display: inline-block;
  width: 1em;
  height: 1em;
  line-height: 1;
  vertical-align: -0.125em;
  flex-shrink: 0;
}

/* All site copy: balanced line wrapping (widows / orphans). Inherited by descendants. */
body {
  text-wrap: balance;
}

:where(h1, h2, h3, h4, h5, h6, p, li, blockquote, figcaption, dt, dd, th, td, label, legend) {
  text-wrap: balance;
}

/* Accessibility primitives */
.skip-link {
  position: absolute;
  left: 12px;
  top: 12px;
  z-index: 200;
  padding: 10px 16px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--blush);
  font-family: Figtree, system-ui, sans-serif;
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  transform: translateY(-160%);
  transition: transform 0.15s ease;
}

.skip-link:focus {
  transform: translateY(0);
  outline: 3px solid var(--blush);
  outline-offset: 3px;
}

:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 3px;
}

.hdr-cta:focus-visible,
.site-logo:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 3px;
}

.site-footer-logo:focus-visible,
.footer-link:focus-visible,
.site-footer a:focus-visible {
  outline: 3px solid var(--blush);
  outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .skip-link {
    transition: none;
  }
}

:root {
  /* Sticky header: top pad 14 + bottom pad 12 + logo clamp + wave 14 */
  --site-header-height: calc(14px + 12px + clamp(28px, 7.2vw, 52px) + 14px);
  --site-logo-horz-ratio: 1922.63 / 249.6;
  --site-logo-vert-ratio: 994.79 / 571.93;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  /* Transparent so the wave edge is visible; shadow follows the cream silhouette */
  background: transparent;
  filter: drop-shadow(0 5px 12px rgba(var(--ink-rgb), 0.2));
  /* Pad + logo clamp + wave — keeps first paint from jumping when logo paints */
  min-height: var(--site-header-height);
}

/* Solid cream bar above the wave */
.site-header::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  bottom: 14px;
  background: var(--cream);
  pointer-events: none;
  z-index: 0;
}

/* Soft sine-wave edge across the header bottom (fill matches --cream; encoded in SVG) */
.site-header::after {
  content: "";
  display: block;
  position: relative;
  z-index: 0;
  height: 14px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 14' preserveAspectRatio='none'%3E%3Cpath fill='%23F3EDE3' d='M0 0h1440v3.5C1320 12 1200 1 1080 6S840 14 720 7 480 0 360 6 120 14 0 5.5V0z'/%3E%3C/svg%3E") no-repeat center / 100% 100%;
}

.site-header-inner {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: clamp(10px, 2.5vw, 16px);
  padding: 14px clamp(16px, 5vw, 72px) 12px;
  max-width: 1320px;
  margin: 0 auto;
}

.site-logo {
  display: block;
  min-width: 0;
  flex: 1 1 auto;
  max-width: calc(100% - 16.5rem);
}

.site-logo img {
  display: block;
  height: clamp(28px, 7.2vw, 52px);
  width: auto;
  max-width: 100%;
  object-fit: contain;
  object-position: left center;
}

/* Desktop/tablet: horizontal wordmark.
   Use .site-logo img.… so we beat `.site-logo img { display: block }`. */
.site-logo img.site-logo-horz {
  aspect-ratio: var(--site-logo-horz-ratio);
}

/* Mobile: stacked/vertical mark (narrower — frees header room) */
.site-logo img.site-logo-vert {
  display: none;
  aspect-ratio: var(--site-logo-vert-ratio);
}

.site-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
  min-width: 0;
}

.site-header-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

.hdr-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex: 0 0 auto;
  white-space: nowrap;
  font-family: "Bricolage Grotesque", sans-serif;
  font-weight: 700;
  font-size: clamp(14px, 3.8vw, 16px);
  padding: 10px 14px 10px 18px;
  border-radius: 999px;
  border: 2px solid transparent;
  color: var(--blush);
  background: var(--terracotta);
  box-shadow: 0 6px 0 var(--terracotta-shadow);
  /* Optical nudge: hard shadow makes the pill read low in the bar */
  transform: translateY(-7px);
  transition: background 0.15s ease, box-shadow 0.15s ease, color 0.15s ease, border-color 0.15s ease;
  /* 28px icon + 10px pad ×2 + 2px border ×2 — keeps Outline/Filled aligned */
  min-height: 52px;
  text-decoration: none;
  box-sizing: border-box;
}

/* Secondary header CTA — same pill height/shadow as primary, outlined fill */
.hdr-cta--outline {
  gap: 0;
  padding: 10px 18px;
  color: var(--terracotta-deep);
  background: transparent;
  border-color: var(--terracotta);
  box-shadow: 0 6px 0 var(--terracotta-shadow);
}

.hdr-cta--outline:hover {
  color: var(--terracotta-deep);
  background: rgba(var(--terracotta-rgb), 0.1);
  border-color: var(--terracotta-deep);
  box-shadow: 0 6px 0 var(--terracotta-deep);
}

.hdr-cta--outline[aria-current="page"] {
  color: var(--terracotta-deep);
  background: rgba(var(--terracotta-rgb), 0.12);
  border-color: var(--terracotta-deep);
  box-shadow: 0 6px 0 var(--terracotta-shadow);
}

.hdr-cta-icon {
  display: grid;
  place-items: center;
  color: var(--blush);
  font-size: 28px;
  line-height: 1;
  flex-shrink: 0;
}

.hdr-cta-icon .ph {
  display: block;
  width: 1em;
  height: 1em;
  font-size: 1em;
  line-height: 1;
  vertical-align: 0;
}

/* Primary only — outline hover is handled by .hdr-cta--outline:hover above */
.hdr-cta:not(.hdr-cta--outline):hover {
  background: var(--teal);
  box-shadow: 0 6px 0 var(--teal-shadow);
  color: var(--blush);
}

/* Phones: stacked logo; primary CTA keeps icon + Download label */
@media (max-width: 767px) {
  :root {
    /* Vert mark is shorter-wide; bump height so wordmark stays readable */
    --site-header-height: calc(14px + 12px + clamp(36px, 11vw, 48px) + 14px);
  }

  .site-logo img.site-logo-horz {
    display: none;
  }

  .site-logo img.site-logo-vert {
    display: block;
    height: clamp(36px, 11vw, 48px);
  }

  .hdr-cta {
    min-height: 40px;
    padding: 6px 12px;
    font-size: 14px;
    box-shadow: 0 4px 0 var(--terracotta-shadow);
    transform: translateY(-4px);
  }

  .hdr-cta:not(.hdr-cta--outline) {
    gap: 5px;
    padding: 6px 10px 6px 12px;
  }

  .hdr-cta--outline {
    padding: 6px 12px;
    box-shadow: 0 4px 0 var(--terracotta-shadow);
  }

  .hdr-cta--outline:hover {
    box-shadow: 0 4px 0 var(--terracotta-deep);
  }

  .hdr-cta:not(.hdr-cta--outline):hover {
    box-shadow: 0 4px 0 var(--teal-shadow);
  }

  .hdr-cta-icon {
    font-size: 20px;
  }

  .site-logo {
    max-width: calc(100% - 16.5rem);
  }
}

@media (max-width: 379px) {
  .site-logo {
    max-width: calc(100% - 15rem);
  }

  .hdr-cta {
    min-height: 38px;
    font-size: 13.5px;
    padding: 5px 10px;
  }

  .hdr-cta:not(.hdr-cta--outline) {
    gap: 4px;
    padding: 5px 8px 5px 10px;
  }

  .hdr-cta--outline {
    padding: 5px 10px;
  }

  .hdr-cta-icon {
    font-size: 18px;
  }
}

.site-footer {
  position: relative;
  background: transparent;
  color: var(--white);
}

/* Closer CTA band (all pages) — above terracotta chrome */
.site-footer-cta {
  color: var(--ink);
  background-image: url("/uploads/backgrounds/guess-bg-2.png");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  padding: clamp(72px, 9vw, 130px) clamp(20px, 5vw, 72px);
}

@media (max-width: 767px) {
  .site-footer-cta {
    /* ~2x zoom so the open center (better for reading) fills more of the viewport */
    background-size: 200%;
    background-position: center;
  }
}

.site-footer-cta-inner {
  max-width: 820px;
  margin: 0 auto;
  text-align: center;
}

.site-footer-cta-card {
  --qw-bg: var(--peach);
  --qw-age: var(--terracotta-deep);
  max-width: 380px;
  width: 100%;
  margin: 0 auto 28px;
  padding: 0;
  background: transparent;
  border: 0;
  text-align: left;
}

.site-footer-cta-card .qw-row {
  display: flex;
  align-items: flex-end;
  gap: 8px;
}

.site-footer-cta-card .qw-mono {
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--qw-bg);
  color: var(--white);
  font-family: "Bricolage Grotesque", sans-serif;
  font-weight: 700;
  font-size: 13.5px;
  line-height: 1;
  display: grid;
  place-items: center;
  box-shadow: 0 2px 6px rgba(var(--ink-rgb), 0.12);
}

.site-footer-cta-card .qw-col {
  flex: 1 1 auto;
  min-width: 0;
  max-width: calc(100% - 40px);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.site-footer-cta-card figcaption {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0 0.25em;
  margin: 0 4px 3px;
  font-family: "Bricolage Grotesque", sans-serif;
  font-weight: 600;
  font-size: 0.8125rem;
  line-height: 1.3;
  color: var(--muted);
}

.site-footer-cta-card .qw-name {
  font-weight: 600;
  color: var(--muted);
}

.site-footer-cta-card .qw-age {
  font-weight: 600;
  color: var(--qw-age);
}

.site-footer-cta-card blockquote {
  margin: 0;
  padding: 12px 18px;
  width: fit-content;
  max-width: 100%;
  background: var(--qw-bg);
  border-radius: 22px;
  border-top-left-radius: 6px;
  border-top-right-radius: 22px;
  border-bottom-left-radius: 22px;
  border-bottom-right-radius: 22px;
  box-shadow: 0 4px 14px rgba(var(--ink-rgb), 0.12);
  font-family: "Bricolage Grotesque", sans-serif;
  font-weight: 500;
  font-size: clamp(1.32rem, 1.85vw, 1.52rem);
  line-height: 1.32;
  letter-spacing: -0.02em;
  color: var(--ink);
  text-align: left;
}

@media (max-width: 767px) {
  .site-footer-cta-card {
    display: none;
  }
}

.site-footer-cta-heading {
  font-family: "Bricolage Grotesque", sans-serif;
  font-weight: 800;
  font-size: clamp(40px, 5.5vw, 76px);
  line-height: 1;
  letter-spacing: -0.03em;
  margin: 0 0 14px;
  color: var(--ink);
}

.site-footer-cta-body {
  margin: 0 auto 28px;
  font-size: 20px;
  line-height: 1.5;
  color: var(--muted);
  max-width: 40ch;
}

.site-footer-cta .store-cta {
  margin: 0 auto;
}

.site-footer-cta .play-link {
  display: inline-block;
  transition: opacity 0.15s ease;
}

.site-footer-cta .play-link:hover {
  opacity: 0.85;
}

/* Terracotta logo/nav bar under the CTA */
.site-footer-bar {
  position: relative;
  /* Shadow follows the terracotta silhouette */
  filter: drop-shadow(0 -5px 12px rgba(var(--ink-rgb), 0.18));
  color: var(--white);
}

/* Soft sine-wave edge across the bar top (fill matches --terracotta; encoded in SVG) */
.site-footer-bar::before {
  content: "";
  display: block;
  position: relative;
  z-index: 0;
  height: 14px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 14' preserveAspectRatio='none'%3E%3Cg transform='translate(0 14) scale(1 -1)'%3E%3Cpath fill='%23A35D4F' d='M0 0h1440v3.5C1320 12 1200 1 1080 6S840 14 720 7 480 0 360 6 120 14 0 5.5V0z'/%3E%3C/g%3E%3C/svg%3E") no-repeat center / 100% 100%;
}

/* Solid terracotta bar below the wave */
.site-footer-bar::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 14px;
  bottom: 0;
  background: var(--terracotta);
  pointer-events: none;
  z-index: 0;
}

.site-footer-inner {
  position: relative;
  z-index: 1;
  max-width: 1320px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: clamp(20px, 3vw, 28px);
  align-items: center;
  justify-content: space-between;
  padding: clamp(40px, 5vw, 64px) clamp(16px, 5vw, 72px);
}

.site-footer-logo {
  display: block;
  min-width: 0;
  flex: 1 1 auto;
  max-width: min(100%, 320px);
  text-decoration: none;
}

.site-footer-logo img {
  display: block;
  height: clamp(36px, 8vw, 56px);
  width: auto;
  aspect-ratio: 1922.63 / 249.6;
  max-width: 100%;
  object-fit: contain;
  object-position: left center;
}

/* Play Store badge — fixed display height; SVG viewBox 120×40 */
.play-badge {
  display: block;
  height: 80px;
  width: auto;
  aspect-ratio: 120 / 40;
  max-width: 100%;
  object-fit: contain;
}

/* Google Play + iOS waitlist stack under store CTAs */
.store-cta {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.ios-waitlist {
  margin: 0;
  font-family: Figtree, system-ui, sans-serif;
  font-size: 0.9375rem;
  line-height: 1.45;
  color: var(--muted);
  text-align: center;
  max-width: 32ch;
}

.ios-waitlist .ph.ph-apple-logo {
  font-size: inherit;
  width: 1em;
  height: 1em;
  line-height: 1;
  margin-right: 0.3em;
  vertical-align: -0.1em;
}

.ios-waitlist a {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 0.15em;
  text-decoration-thickness: 1px;
}

.ios-waitlist a:hover {
  color: var(--terracotta-deep);
}

.site-footer-end {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: clamp(4px, 1.5vw, 12px) clamp(8px, 2.5vw, 20px);
  font-size: 15px;
  color: var(--white);
  min-width: 0;
}

.site-footer-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: clamp(4px, 1.5vw, 12px) clamp(8px, 2.5vw, 20px);
}

.footer-link {
  color: var(--white);
  text-decoration: underline;
  text-underline-offset: 0.18em;
  text-decoration-thickness: 1px;
  /* Adequate touch target without changing layout much */
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 8px 4px;
}

.footer-link:hover {
  color: var(--blush);
  text-decoration-thickness: 2px;
}

.site-footer-copy {
  margin: 0;
  font-size: 15px;
  color: var(--white);
  line-height: 1.4;
  padding: 8px 4px;
}

.site-footer-copy a {
  color: inherit;
  text-decoration: none;
}

.site-footer-copy a:hover,
.site-footer-copy a:active {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

@media (max-width: 767px) {
  .site-footer-inner {
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
  }

  .site-footer-logo {
    flex: 0 1 auto;
    max-width: min(100%, 280px);
  }

  .site-footer-logo img {
    margin-inline: auto;
    object-position: center;
  }

  .site-footer-end {
    justify-content: center;
    text-align: center;
  }

  .site-footer-nav {
    justify-content: center;
  }
}
