/* Pibbow — site-wide styles. Kawaii/baby-friendly aesthetic.
 * Tokens live in tokens.css (single source of truth with the mobile app).
 * Fonts are self-hosted in /fonts — no third-party requests at runtime. */

@import url('/styles/tokens.css');

/* ── Self-hosted fonts ───────────────────────────────────────────────────
 * DynaPuff uses the same four production weights as the mobile app.
 * Nunito latin subset is served as a single file across weights 400–800.
 * Latin subset = ASCII + Western European. Latin-ext adds Slovenian,
 * Czech, Polish, etc. diacritics (č, š, ž, ć, đ). Downloaded from Google
 * Fonts; SIL Open Font License. */
@font-face {
  font-family: 'DynaPuff';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/dynapuff-400.woff2') format('woff2');
}
@font-face {
  font-family: 'DynaPuff';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('/fonts/dynapuff-500.woff2') format('woff2');
}
@font-face {
  font-family: 'DynaPuff';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('/fonts/dynapuff-600.woff2') format('woff2');
}
@font-face {
  font-family: 'DynaPuff';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('/fonts/dynapuff-700.woff2') format('woff2');
}
@font-face {
  font-family: 'Nunito';
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url('/fonts/nunito-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Nunito';
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url('/fonts/nunito-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
}

body {
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.65;
  color: var(--color-text);
  background:
    radial-gradient(circle at 10% 0%, rgba(184, 236, 250, 0.35) 0%, transparent 40%),
    radial-gradient(circle at 90% 30%, rgba(255, 203, 75, 0.15) 0%, transparent 45%),
    radial-gradient(circle at 50% 100%, rgba(255, 171, 126, 0.18) 0%, transparent 50%),
    linear-gradient(180deg, var(--blue-100) 0%, var(--pastel-100) 100%);
  background-attachment: fixed;
  display: flex;
  flex-direction: column;
}

main { flex: 1; }

a {
  color: var(--color-primary);
  text-decoration: none;
  font-weight: 600;
  transition: opacity 160ms var(--ease-soft);
}
a:hover { opacity: 0.75; }

h1, h2, h3 {
  font-family: var(--font-display);
  color: var(--color-text);
  letter-spacing: -0.02em;
  margin: 0;
}
h1 { font-size: clamp(40px, 6vw, 64px); line-height: 1.08; font-weight: 700; }
h2 { font-size: clamp(28px, 4vw, 40px); line-height: 1.15; font-weight: 600; margin-top: 2em; margin-bottom: 0.5em; }
h3 { font-size: 20px; font-weight: 600; margin-bottom: 8px; }

p { margin: 0.6em 0; }

/* ── Footer ──────────────────────────────────────────────────────────── */
.site-footer {
  position: relative;
  /* Bottom padding covers the fixed .download-bar (80px) plus a visual buffer,
     so the footer's own background extends behind the bar with no page gap. */
  padding: 44px 32px 136px;
  text-align: center;
  color: var(--white-100);
  font-size: 14px;
  background: #4538a7;
  margin-top: 80px;
}
.site-footer .footer-tagline {
  margin: 0 auto 24px;
  color: var(--white-100);
  font-family: var(--font-display);
  font-size: clamp(17px, 2vw, 21px);
  font-weight: 500;
  line-height: 1.4;
}
.site-footer .footer-summary {
  max-width: 390px;
  margin: -12px auto 24px;
  color: rgba(255, 253, 247, 0.78);
  line-height: 1.6;
}
.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  column-gap: 18px;
  row-gap: 4px;
}
.site-footer nav a {
  padding: 3px 0;
  color: rgba(255, 253, 247, 0.78);
  font-weight: 600;
  text-decoration: none;
}
.site-footer nav a:hover {
  color: var(--white-100);
  opacity: 1;
}
.site-footer .footer-meta {
  margin: 4px 0 0;
  color: rgba(255, 253, 247, 0.72);
  font-size: 13px;
}

/* Persistent pre-release store bar. Real official badges replace these
 * status controls only after public store listing URLs exist. */
.download-bar {
  min-height: 80px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  position: fixed;
  z-index: 30;
  right: 0;
  bottom: 0;
  left: 0;
  padding: 10px max(20px, calc((100vw - 1280px) / 2));
  background: rgba(255, 253, 247, 0.96);
  border-top: 1px solid rgba(48, 18, 21, 0.1);
  box-shadow: 0 -10px 32px rgba(48, 18, 21, 0.14);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}
.download-bar-brand {
  min-width: 0;
  display: flex;
  align-items: center;
}
.download-bar-brand:hover {
  opacity: 1;
}
/* The wordmark is live text: white DynaPuff with a 3px outside outline. The
 * stroke is centred, so it is twice that, painted under the fill. */
.download-bar-logo {
  display: block;
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 500;
  line-height: 1.18;
  letter-spacing: -0.01em;
  color: #fff;
  -webkit-text-stroke: 0.1875em var(--color-text);
  paint-order: stroke fill;
}
.download-bar-actions {
  display: flex;
  gap: 8px;
}
.download-bar-store {
  min-width: 138px;
  min-height: 56px;
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  padding: 7px 16px;
  color: var(--white-100);
  background: var(--color-text);
  border: 2px solid var(--color-text);
  border-radius: 14px;
  line-height: 1.05;
}
.download-bar-store strong {
  font-size: 14px;
}
.download-bar-store small {
  margin-top: 5px;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.05em;
  opacity: 0.72;
  text-transform: uppercase;
}
.download-bar-store-light {
  color: var(--color-text);
  background: var(--white-100);
}

.page-close {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  position: fixed;
  z-index: 20;
  top: max(16px, env(safe-area-inset-top));
  right: max(16px, env(safe-area-inset-right));
  color: var(--color-text);
  background: rgba(255, 253, 247, 0.88);
  border: 1px solid rgba(48, 18, 21, 0.1);
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: transform 160ms var(--ease-soft), background 160ms var(--ease-soft);
}
.page-close svg {
  width: 24px;
  height: 24px;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
}
.page-close:hover {
  background: var(--white-100);
  opacity: 1;
  transform: scale(1.04);
}
.page-close:focus-visible {
  outline: 3px solid var(--color-primary);
  outline-offset: 3px;
}

.page-close-contained {
  top: max(48px, env(safe-area-inset-top));
  right: max(20px, calc((100vw - 880px) / 2 + 20px));
}

/* ── Layout containers ──────────────────────────────────────────────── */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 48px 24px;
  overflow-wrap: anywhere;
}
.container.narrow { max-width: 720px; }

/* ── Markdown content (privacy / terms) ─────────────────────────────── */
.container p { margin: 1em 0; }
.container ul { padding-left: 1.4em; }
.container li { margin: 0.4em 0; }
.container strong { color: var(--color-text); }

.legal-content {
  max-width: 880px;
  padding: 56px 32px 80px;
  font-size: 16px;
  line-height: 1.7;
}

.legal-content h1,
.legal-content h2,
.legal-content h3 {
  font-family: var(--font-body);
}

.legal-content h1 {
  max-width: calc(100% - 72px);
  font-size: clamp(34px, 4.5vw, 48px);
  font-weight: 800;
  line-height: 1.12;
}

.legal-content h2 {
  scroll-margin-top: 96px;
  margin: 2.2em 0 0.55em;
  font-size: clamp(22px, 2.6vw, 30px);
  font-weight: 800;
  line-height: 1.2;
}

.legal-content h3 {
  margin: 1.8em 0 0.45em;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.3;
}

.legal-content p {
  margin: 0.85em 0;
}

.legal-content li {
  margin: 0.3em 0;
}

/* ── Hero ────────────────────────────────────────────────────────────── */
.hero {
  position: relative;
  padding: 80px 24px 48px;
  text-align: center;
  overflow: hidden;
}
.hero h1 span.accent {
  background: linear-gradient(180deg, transparent 60%, var(--yellow-100) 60%);
  padding: 0 4px;
  border-radius: 4px;
}
.hero .lead {
  font-size: clamp(17px, 2.2vw, 20px);
  color: var(--color-text-soft);
  max-width: 580px;
  margin: 20px auto 32px;
}
.hero-mascot {
  width: min(320px, 70vw);
  height: auto;
  margin: 0 auto 16px;
  display: block;
  animation: float 5s ease-in-out infinite;
  filter: drop-shadow(var(--shadow-float));
}
@keyframes float {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50%      { transform: translateY(-10px) rotate(-1deg); }
}

/* ── Floating decorative shapes ─────────────────────────────────────── */
.blob {
  position: absolute;
  pointer-events: none;
  z-index: 0;
  opacity: 0.6;
}
.blob-1 { top: 10%; left: -80px; width: 260px; animation: drift 12s ease-in-out infinite; }
.blob-2 { top: 60%; right: -60px; width: 200px; animation: drift 9s ease-in-out infinite reverse; }
@keyframes drift {
  0%, 100% { transform: translate(0, 0) rotate(0deg); }
  50%      { transform: translate(12px, -10px) rotate(8deg); }
}

.hero > *:not(.blob) { position: relative; z-index: 1; }

/* ── Flying birds in hero ─────────────────────────────────────────────── */
.hero-bird {
  position: absolute;
  width: 96px;
  height: auto;
  z-index: 2;
  pointer-events: none;
  filter: drop-shadow(0 6px 14px rgba(48, 18, 21, 0.15));
}
.hero-bird-left {
  top: 8%;
  left: 6%;
  animation: bird-fly-left 6s ease-in-out infinite;
  transform: rotate(-8deg);
}
.hero-bird-right {
  top: 14%;
  right: 6%;
  animation: bird-fly-right 7s ease-in-out infinite 0.5s;
  transform: rotate(8deg);
}
@keyframes bird-fly-left {
  0%, 100% { transform: translate(0, 0) rotate(-8deg); }
  50%      { transform: translate(18px, -14px) rotate(-2deg); }
}
@keyframes bird-fly-right {
  0%, 100% { transform: translate(0, 0) rotate(8deg); }
  50%      { transform: translate(-18px, -12px) rotate(2deg); }
}
@media (max-width: 720px) {
  .hero-bird { width: 64px; }
  .hero-bird-left  { top: 4%; left: 2%; }
  .hero-bird-right { top: 8%; right: 2%; }
}
@media (max-width: 480px) {
  .hero-bird { display: none; }
}

/* ── Store badges ───────────────────────────────────────────────────── */
.store-badges {
  display: flex;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 8px;
}
.store-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 26px;
  background: var(--color-text);
  color: var(--color-surface);
  border-radius: var(--radius-pill);
  font-weight: 700;
  font-size: 15px;
  box-shadow: var(--shadow-sticker);
  transition: transform 200ms var(--ease-boing);
}
.store-badge:hover {
  transform: scale(1.05) translateY(-2px);
  opacity: 1;
}
.store-badge:active { transform: scale(0.97); }
.store-badge.disabled {
  background: var(--grey-200);
  /* --grey-300 here measured 4.38:1 on --grey-200, under the 4.5:1 this
     15px bold label needs. --color-text clears it at ~13:1. */
  color: var(--color-text);
  pointer-events: none;
  box-shadow: none;
  cursor: default;
}
.store-badge.primary {
  background: var(--color-primary);
}

/* ── How it works (3-step onboarding illustrations) ─────────────────── */
.how-it-works {
  max-width: 1100px;
  margin: 48px auto 32px;
  padding: 16px 24px 32px;
  text-align: center;
}
.how-it-works h2 {
  margin-bottom: 48px;
}
.steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 32px;
}
.step {
  text-align: center;
  padding: 0 16px;
}
.step img {
  width: 100%;
  max-width: 280px;
  height: auto;
  margin: 0 auto 16px;
  display: block;
  animation: float 7s ease-in-out infinite;
  filter: drop-shadow(var(--shadow-soft));
}
.step:nth-child(2) img { animation-delay: 1.2s; }
.step:nth-child(3) img { animation-delay: 2.4s; }
.step h3 {
  font-family: var(--font-display);
  font-size: 22px;
  margin: 12px 0 8px;
}
.step p {
  color: var(--color-text-soft);
  font-size: 15px;
  line-height: 1.55;
  max-width: 300px;
  margin: 0 auto;
}

/* ── Feature grid ───────────────────────────────────────────────────── */
.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
  padding: 48px 24px;
  max-width: 1100px;
  margin: 0 auto;
}
.feature-card {
  background: var(--color-surface);
  border-radius: var(--radius-card);
  padding: 28px 24px;
  text-align: center;
  box-shadow: var(--shadow-soft);
  border: 2px solid rgba(255, 253, 247, 0.6);
  transition: transform 240ms var(--ease-boing), box-shadow 240ms var(--ease-soft);
}
.feature-card:hover {
  transform: translateY(-6px) rotate(-0.5deg);
  box-shadow: var(--shadow-float);
}
/* Every card gets the same 80×80 illustration box so the h3 below lines up.
   Works for <img class="feature-illo"> and <div class="feature-illo"> (emoji). */
.feature-card .feature-illo {
  width: 80px;
  height: 80px;
  margin: 0 auto 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  object-fit: contain;          /* only applies to img elements */
  animation: wobble 6s ease-in-out infinite;
}
.feature-card .feature-illo-emoji {
  font-size: 48px;
  line-height: 1;
}
/* Stagger wobble so cards don't wobble in unison */
.feature-card:nth-child(2) .feature-illo { animation-delay: 0.8s; }
.feature-card:nth-child(3) .feature-illo { animation-delay: 1.6s; }
.feature-card:nth-child(4) .feature-illo { animation-delay: 2.4s; }
@keyframes wobble {
  0%, 100% { transform: rotate(0deg); }
  25%      { transform: rotate(-8deg); }
  75%      { transform: rotate(8deg); }
}
.feature-card h3 {
  font-family: var(--font-display);
  font-size: 20px;
  margin: 4px 0 8px;
}
.feature-card p {
  color: var(--color-text-soft);
  font-size: 15px;
  line-height: 1.55;
  margin: 0;
}

/* Feature card color accents */
.feature-card.tint-yellow { background: var(--yellow-100); }
.feature-card.tint-orange { background: #FFE8D5; }
.feature-card.tint-mint   { background: var(--green-100); }
.feature-card.tint-blue   { background: var(--blue-100); }

/* ── CTA band ────────────────────────────────────────────────────────── */
.cta-band {
  text-align: center;
  padding: 72px 24px;
  background: var(--color-surface);
  border-radius: var(--radius-card);
  max-width: 880px;
  margin: 48px auto;
  box-shadow: var(--shadow-soft);
  position: relative;
  overflow: hidden;
}
.cta-band::before {
  content: '';
  position: absolute;
  top: -40px;
  right: -40px;
  width: 200px;
  height: 200px;
  background: var(--yellow-100);
  border-radius: 50%;
  opacity: 0.45;
  z-index: 0;
}
.cta-band::after {
  content: '';
  position: absolute;
  bottom: -30px;
  left: -30px;
  width: 160px;
  height: 160px;
  background: var(--blue-100);
  border-radius: 50%;
  opacity: 0.55;
  z-index: 0;
}
.cta-band > * { position: relative; z-index: 1; }
.cta-band h2 { margin-top: 0; }
.cta-bird {
  position: absolute;
  top: 16px;
  right: 32px;
  width: 72px;
  height: auto;
  z-index: 2;
  transform: rotate(12deg);
  animation: bird-fly-right 6s ease-in-out infinite;
  filter: drop-shadow(0 4px 10px rgba(48, 18, 21, 0.12));
}
@media (max-width: 640px) {
  .cta-bird { width: 56px; right: 16px; top: 12px; }
}

/* ── Deep link handler pages ────────────────────────────────────────── */
.deep-link-page {
  max-width: 480px;
  margin: 0 auto;
  padding: 80px 24px 48px;
  text-align: center;
}
.deep-link-page .spinner {
  display: inline-block;
  width: 44px;
  height: 44px;
  border: 4px solid var(--color-border);
  border-top-color: var(--color-primary);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
  margin-bottom: 20px;
}
@keyframes spin { to { transform: rotate(360deg); } }
/* The deep-link pages are transient spinners, not headlines. They now use
   semantic h1/h2 (they skipped h1 entirely before, starting at h2), but
   keep the visual weight of the h2/h3 they replaced -- the global h1
   reaches 64px and the global h2 carries a 2em top margin. */
.deep-link-page h1 { font-size: clamp(28px, 4vw, 40px); line-height: 1.15; font-weight: 600; }
.deep-link-page h2 { font-size: 20px; font-weight: 600; margin-top: 0; margin-bottom: 8px; }
.deep-link-note { color: var(--color-text-soft); }
.fallback-section { display: none; margin-top: 40px; }
.fallback-section.visible { display: block; }

/* ── Utility ─────────────────────────────────────────────────────────── */
.card {
  background: var(--color-surface);
  border-radius: var(--radius-card);
  padding: 28px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-soft);
}

@media (max-width: 640px) {
  .site-footer {
    padding-bottom: 120px;
  }

  .download-bar {
    min-height: 64px;
    gap: 7px;
    padding: 7px 10px calc(7px + env(safe-area-inset-bottom));
  }
  .download-bar-logo {
    font-size: clamp(22px, 7vw, 30px);
  }
  .download-bar-actions {
    min-width: 0;
    flex: 1;
    justify-content: flex-end;
    gap: 5px;
  }
  .download-bar-store {
    width: min(25vw, 108px);
    min-width: 0;
    min-height: 48px;
    align-items: center;
    padding: 5px 3px;
    text-align: center;
    border-radius: 12px;
  }
  .download-bar-store strong {
    font-size: clamp(9px, 2.8vw, 12px);
  }
  .download-bar-store small {
    margin-top: 4px;
    font-size: clamp(6px, 1.8vw, 8px);
  }

  .page-close-contained {
    top: max(32px, env(safe-area-inset-top));
    right: max(16px, env(safe-area-inset-right));
  }

  .legal-content {
    padding: 32px 20px 56px;
    font-size: 15px;
    line-height: 1.68;
  }

  .legal-content h1 {
    max-width: calc(100% - 58px);
    font-size: clamp(30px, 9vw, 38px);
  }

  .hero { padding: 48px 20px 32px; }
  .features { padding: 32px 20px; gap: 16px; }
  .feature-card { padding: 24px 20px; }
  .cta-band { padding: 48px 24px; margin: 32px 16px; }
}

@media (prefers-reduced-motion: reduce) {
  .hero-mascot, .blob, .hero-bird, .cta-bird,
  .feature-card .icon, .feature-card .feature-illo,
  .step img { animation: none; }
  .store-badge, .feature-card { transition: none; }
}

/* ── 404 ─────────────────────────────────────────────── */
.notfound-page {
  max-width: 560px;
  margin: 0 auto;
  padding: 96px 24px 64px;
  text-align: center;
}
.notfound-page h1 { font-size: clamp(30px, 5vw, 44px); }
.notfound-lead { color: var(--color-text-soft); margin-bottom: 32px; }
.notfound-home {
  display: inline-flex;
  padding: 14px 28px;
  background: var(--color-primary);
  color: var(--color-surface);
  border-radius: var(--radius-pill);
  font-weight: 700;
}
.notfound-links ul {
  list-style: none;
  padding: 0;
  margin: 28px 0 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 20px;
}
.notfound-links ul a { color: var(--color-text-soft); text-decoration: underline; }
