/* PuzzlePicture website.
   The app's palette, at web sizes. Baloo 2 carries display type because it is
   the app's own face; body copy is left to the system stack, which is far
   easier over a page of prose — and over a page of legal text — than a rounded
   display face would be. */

:root {
  --cream:      #FFF6E9;
  --cream-deep: #FBEEDC;
  --card:       #FFFFFF;
  --ink:        #42385C;
  --ink-soft:   #6E6288;
  --ink-faint:  #A79DBC;
  --grape:      #A78BFA;
  --grape-deep: #7C5CF0;
  --bubblegum:  #FF8FB1;
  --mint:       #43C29D;
  --lemon:      #E9B63F;
  --rule:       #EFE0CB;
  --on-grape:   #FFFDF8;
  --shadow-sm:  0 .25rem .75rem rgba(66, 56, 92, .07);
  --shadow-md:  0 1rem 2rem rgba(66, 56, 92, .10);
  --shadow-lg:  0 2rem 4rem rgba(40, 30, 70, .28);
  --hero: linear-gradient(135deg, #8D6EF7 0%, #A78BFA 42%, #FF8FB1 100%);
}

@media (prefers-color-scheme: dark) {
  :root {
    --cream:      #211C31;
    --cream-deep: #191527;
    --card:       #2E2844;
    --ink:        #F3EEFF;
    --ink-soft:   #C1B6DF;
    --ink-faint:  #8B80A8;
    --grape:      #C3AFFF;
    --grape-deep: #C3AFFF;
    --rule:       #3C3459;
    --shadow-sm:  0 .25rem .75rem rgba(0, 0, 0, .25);
    --shadow-md:  0 1rem 2rem rgba(0, 0, 0, .32);
    --shadow-lg:  0 2rem 4rem rgba(0, 0, 0, .45);
  }
}

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font: 400 1.0625rem/1.7 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
}

h1, h2, h3, .display {
  font-family: "Baloo 2", "Trebuchet MS", Verdana, sans-serif;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.015em;
  /* Baloo sits high in its em box; without this, descenders clip. */
  padding-bottom: .08em;
  margin: 0;
}

p { margin: 0 0 1rem; }
p:last-child { margin-bottom: 0; }

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

a { color: var(--grape-deep); text-decoration-thickness: .08em; text-underline-offset: .18em; }
a:hover { color: var(--bubblegum); }

.wrap { width: 100%; max-width: 70rem; margin: 0 auto; padding: 0 1.5rem; }
.narrow { max-width: 44rem; }

/* --- Top bar ---------------------------------------------------------- */

.topbar { position: relative; z-index: 2; }
.topbar .wrap {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; padding-top: 1.5rem; padding-bottom: 1.5rem;
}

.brand {
  display: inline-flex; align-items: center; gap: .6rem;
  font-family: "Baloo 2", "Trebuchet MS", Verdana, sans-serif;
  font-weight: 800; font-size: 1.35rem; letter-spacing: -0.02em;
  color: var(--ink); text-decoration: none;
}
.brand svg, .brand-mark { width: 2.25rem; height: 2.25rem; flex: none; border-radius: .65rem; }
.brand-mark { box-shadow: 0 0 0 2px rgba(255, 255, 255, .55), var(--shadow-sm); }
.topbar-links { display: flex; align-items: center; gap: 1.5rem; font-size: .95rem; }
.topbar-links a { color: var(--ink-soft); text-decoration: none; font-weight: 700; }
.topbar-links a:hover { color: var(--grape-deep); }

/* On the gradient hero the bar has to invert. */
.on-dark .brand, .on-dark .topbar-links a { color: var(--on-grape); }
.on-dark .topbar-links a:hover { color: #fff; text-decoration: underline; }

/* --- Buttons ---------------------------------------------------------- */

.btn {
  display: inline-flex; align-items: center; gap: .55rem;
  font: 700 1.0625rem/1 "Baloo 2", "Trebuchet MS", Verdana, sans-serif;
  padding: .95rem 1.6rem .8rem; border-radius: 999px;
  text-decoration: none; border: 0; cursor: pointer;
  transition: transform .12s ease, box-shadow .12s ease;
}
.btn svg { width: 1.15rem; height: 1.15rem; }
.btn-primary {
  background: var(--on-grape); color: var(--grape-deep);
  box-shadow: 0 .35rem 0 rgba(0, 0, 0, .14);
}
.btn-primary:hover { color: var(--grape-deep); transform: translateY(-2px); box-shadow: 0 .5rem 0 rgba(0, 0, 0, .14); }
.btn-primary:active { transform: translateY(2px); box-shadow: 0 .1rem 0 rgba(0, 0, 0, .14); }
.btn-ghost {
  background: rgba(255, 255, 255, .16); color: var(--on-grape);
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .45);
}
.btn-ghost:hover { background: rgba(255, 255, 255, .26); color: var(--on-grape); transform: translateY(-2px); }

/* --- Hero ------------------------------------------------------------- */

.hero {
  position: relative; overflow: hidden;
  background: var(--hero); color: var(--on-grape);
  border-radius: 0 0 2.5rem 2.5rem;
}
/* Loose pieces drifting behind the type, the same motif as the app icon. */
.hero-motif {
  position: absolute; inset: 0; pointer-events: none;
  opacity: .16; color: #fff;
}
.hero-motif svg { position: absolute; }
.hero-motif svg:nth-child(1) { width: 15rem; top: -3rem; left: -4rem; transform: rotate(-18deg); }
.hero-motif svg:nth-child(2) { width: 11rem; bottom: -3rem; left: 22%; transform: rotate(24deg); }
.hero-motif svg:nth-child(3) { width: 8rem; top: 18%; right: 4%; transform: rotate(9deg); }

.hero-grid {
  position: relative;
  display: grid; grid-template-columns: 1.05fr .95fr;
  gap: 3rem; align-items: center;
  padding: 3rem 0 4.5rem;
}
.hero h1 { font-size: clamp(2.6rem, 5.2vw, 4.1rem); margin-bottom: .75rem; }
.hero-lede { font-size: clamp(1.1rem, 1.6vw, 1.3rem); opacity: .96; max-width: 32rem; }
.hero-cta { display: flex; flex-wrap: wrap; gap: .85rem; margin-top: 2rem; }
.hero-note { margin-top: 1.25rem; font-size: .95rem; opacity: .95; }

.hero-art { display: flex; justify-content: center; }

/* --- Phone frame ------------------------------------------------------ */

.phone {
  position: relative; flex: none;
  width: 100%; max-width: 20rem;
  padding: .5rem;
  background: linear-gradient(160deg, #3A3350, #16121F);
  border-radius: 2.6rem;
  box-shadow: var(--shadow-lg), inset 0 0 0 1px rgba(255, 255, 255, .12);
}
.phone img { border-radius: 2.15rem; }
/* Earpiece pill, so the frame reads as hardware and not as a rounded border. */
.phone::before {
  content: ""; position: absolute; z-index: 1;
  top: 1.05rem; left: 50%; transform: translateX(-50%);
  width: 3.25rem; height: .3rem; border-radius: 999px;
  background: rgba(255, 255, 255, .22);
}
.phone-sm { max-width: 14rem; }
.phone-tilt-l { transform: rotate(-4deg); }
.phone-tilt-r { transform: rotate(4deg); }

/* --- Sections --------------------------------------------------------- */

section { padding: 4.5rem 0; }
.section-head { max-width: 36rem; margin: 0 auto 2.75rem; text-align: center; }
.section-head h2 { font-size: clamp(1.9rem, 3.4vw, 2.6rem); margin-bottom: .5rem; }
.section-head p { color: var(--ink-soft); font-size: 1.1rem; }

.tinted { background: var(--cream-deep); }

/* --- Feature cards ---------------------------------------------------- */

.cards { display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); align-items: stretch; }
.card {
  background: var(--card); border-radius: 1.5rem; padding: 1.75rem;
  box-shadow: var(--shadow-sm);
}
.card h3 { font-size: 1.2rem; margin-bottom: .4rem; }
.card p { color: var(--ink-soft); font-size: .98rem; }
.card-icon {
  width: 3rem; height: 3rem; border-radius: 1rem; margin-bottom: 1.1rem;
  display: grid; place-items: center; color: #fff;
}
.card-icon svg { width: 1.5rem; height: 1.5rem; }
.i-grape { background: var(--grape); }
.i-pink  { background: var(--bubblegum); }
.i-mint  { background: var(--mint); }
.i-lemon { background: var(--lemon); }

/* --- Showcase --------------------------------------------------------- */

.showcase { display: flex; justify-content: center; align-items: flex-end; gap: 1.5rem; flex-wrap: wrap; }
.showcase figure { margin: 0; text-align: center; max-width: 14rem; }
.showcase figcaption { margin-top: 1.1rem; color: var(--ink-soft); font-size: .95rem; }
.showcase figcaption strong { display: block; color: var(--ink); font-size: 1.05rem; }

/* --- Steps ------------------------------------------------------------ */

.steps { display: grid; gap: 2rem; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); counter-reset: step; }
.step { counter-increment: step; }
.step::before {
  content: counter(step);
  display: grid; place-items: center;
  width: 2.5rem; height: 2.5rem; margin-bottom: .9rem;
  border-radius: 999px; background: var(--grape); color: var(--on-grape);
  font: 800 1.15rem/1 "Baloo 2", "Trebuchet MS", Verdana, sans-serif;
}
.step h3 { font-size: 1.15rem; margin-bottom: .35rem; }
.step p { color: var(--ink-soft); font-size: .98rem; }

/* --- Closing band ----------------------------------------------------- */

.closing {
  background: var(--hero); color: var(--on-grape);
  border-radius: 2.5rem; padding: 3.5rem 2rem; text-align: center;
  margin-bottom: 4.5rem;
}
.closing h2 { font-size: clamp(1.9rem, 3.4vw, 2.6rem); margin-bottom: .6rem; }
.closing p { opacity: .92; max-width: 30rem; margin: 0 auto 2rem; }

/* --- Footer ----------------------------------------------------------- */

footer { border-top: 1px solid var(--rule); padding: 2.5rem 0 3.5rem; color: var(--ink-faint); font-size: .92rem; }
footer .wrap { display: flex; flex-wrap: wrap; gap: .75rem 2rem; justify-content: space-between; align-items: center; }
footer nav { display: flex; gap: 1.5rem; flex-wrap: wrap; }
footer a { color: var(--ink-soft); text-decoration: none; }
footer a:hover { color: var(--grape-deep); text-decoration: underline; }

/* --- Policy page ------------------------------------------------------ */

.policy-head { background: var(--cream-deep); padding: .25rem 0 1.5rem; }

.policy h1 { font-size: clamp(2.1rem, 4.5vw, 3rem); margin-bottom: .35rem; }
.policy .updated { color: var(--ink-faint); font-size: .95rem; margin: 0 0 1.75rem; }

.langs { display: flex; flex-wrap: wrap; gap: .5rem; margin: 0; }
.langs a {
  border-radius: 999px; padding: .45rem 1.05rem;
  font-size: .92rem; font-weight: 600; text-decoration: none;
  color: var(--ink-soft); background: var(--card); box-shadow: var(--shadow-sm);
}
.langs a:hover { color: var(--grape-deep); }
.langs a[aria-current="true"] { background: var(--grape); color: var(--on-grape); }

.policy { padding: 2.25rem 0 1rem; }
.policy h2 {
  font-size: 1.4rem; margin: 2.75rem 0 .6rem;
  padding-top: 2rem; border-top: 1px solid var(--rule);
}
.policy h2:first-of-type { border-top: 0; padding-top: 0; margin-top: 0; }
.policy ul { padding-left: 1.15rem; margin: 0 0 1rem; }
.policy li { margin: .45rem 0; }
.policy section { display: none; }
.policy section[data-active] { display: block; }
/* Without scripting every language simply prints in turn: worse to read, but
   nobody is left staring at a blank page. */
.no-js .policy section { display: block; }

.callout {
  background: var(--card); border-left: 4px solid var(--grape);
  border-radius: 0 1rem 1rem 0; padding: 1.15rem 1.35rem; margin: 0 0 1rem;
  box-shadow: var(--shadow-sm);
}

/* --- Narrow screens --------------------------------------------------- */

@media (max-width: 60rem) {
  .hero-grid { grid-template-columns: 1fr; gap: 2.5rem; text-align: center; padding-bottom: 3.5rem; }
  .hero-lede { margin-left: auto; margin-right: auto; }
  .hero-cta { justify-content: center; }
  .hero-motif { opacity: .12; }
  .phone-tilt-l, .phone-tilt-r { transform: none; }
}

@media (max-width: 34rem) {
  section { padding: 3rem 0; }
  .hero { border-radius: 0 0 1.75rem 1.75rem; }
  .closing { padding: 2.5rem 1.25rem; border-radius: 1.75rem; }
  .topbar-links { gap: 1rem; }
  .showcase { gap: 2.5rem; }
}

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