/* Puddle, https://dglfactor.tech/puddle. Calm, light, one idea per screen.
   Colors are the app icon's (Tools/IconRenderer) and the Drop palette (PaletteColors.swift). */

:root {
  color-scheme: light dark;
  --bg-top: #F6F3EE;
  --bg-bottom: #DCE5F1;
  --text: #1C1C1E;
  --muted: rgba(28, 28, 30, 0.62);
  --hairline: rgba(28, 28, 30, 0.12);
  --glass: rgba(255, 255, 255, 0.55);
  --glass-rim: rgba(255, 255, 255, 0.9);
  --shadow: rgba(30, 40, 60, 0.14);
  --accent: #7F9CC4;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Helvetica Neue", "Segoe UI", Roboto, system-ui, sans-serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --measure: 34rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg-top: #1A2130;
    --bg-bottom: #0B0E15;
    --text: #F5F5F7;
    --muted: rgba(245, 245, 247, 0.62);
    --hairline: rgba(245, 245, 247, 0.14);
    --glass: rgba(255, 255, 255, 0.08);
    --glass-rim: rgba(255, 255, 255, 0.35);
    --shadow: rgba(0, 0, 0, 0.5);
    --accent: #A6BEE0;
  }
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 1.125rem;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg-bottom);
  background-image: linear-gradient(180deg, var(--bg-top) 0, var(--bg-bottom) 100vh, var(--bg-bottom) 100%);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { color: inherit; }
a:focus-visible, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 8px; }

.skip { position: absolute; left: -9999px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip:focus { left: 1rem; top: 1rem; z-index: 10; background: var(--bg-top); padding: 0.5rem 1rem; border-radius: 999px; }

/* Top bar: just the language switch. */
.bar {
  position: absolute; inset: 0 0 auto 0;
  display: flex; justify-content: flex-end; gap: 0.25rem;
  padding: max(1rem, env(safe-area-inset-top)) 1.25rem 0;
  z-index: 2;
}
.lang a {
  display: inline-block; padding: 0.35rem 0.7rem; border-radius: 999px;
  font-size: 0.875rem; color: var(--muted); text-decoration: none;
}
.lang a[aria-current="true"] { color: var(--text); background: var(--glass); box-shadow: inset 0 0 0 0.5px var(--glass-rim); }

/* Every section is one calm screen. */
.screen {
  min-height: 100vh; min-height: 100svh;
  display: grid; place-items: center;
  padding: 6rem 1.5rem;
  text-align: center;
}

/* Hero: who we are on one side, the app moving on the other (stacked on a phone: the film right
   under the App Store button, not a screen further down). */
.hero {
  display: grid; gap: 2.75rem; place-items: center;
  max-width: 70rem; margin: 0 auto; padding: 4.5rem 1.5rem 4rem;
  text-align: center;
}
.hero-drop { width: min(40vw, 11rem); aspect-ratio: 1; margin: 0 auto 1.5rem; animation: breathe 7s ease-in-out infinite; }
@keyframes breathe { 50% { transform: scale(1.035); } }
.hero h1 {
  margin: 0; font-size: clamp(3.5rem, 12vw, 6.5rem); font-weight: 700; letter-spacing: -0.035em; line-height: 1;
}
.hero .line {
  margin: 1rem auto 0; max-width: 22ch;
  font-size: clamp(1.35rem, 3.6vw, 1.9rem); line-height: 1.25; letter-spacing: -0.015em; color: var(--muted);
}
.store { margin-top: 2rem; display: flex; flex-direction: column; align-items: center; gap: 0.6rem; }
.hero-film { width: 100%; }
@media (min-width: 900px) {
  .hero { grid-template-columns: minmax(0, 1fr) minmax(0, 27rem); gap: 4.5rem; min-height: 100vh; min-height: 100svh;
          text-align: left; padding-block: 3rem; }
  .hero-text { justify-self: end; max-width: 30rem; }
  .hero-drop { width: 12rem; margin: 0 0 1.75rem; }
  .hero .line { margin-left: 0; }
  .store { align-items: flex-start; }
}
.soon {
  display: inline-block; padding: 0.8rem 1.4rem; border-radius: 999px;
  background: var(--glass); box-shadow: inset 0 0 0 0.5px var(--glass-rim), 0 10px 30px -12px var(--shadow);
  font-size: 1rem; font-weight: 600;
  -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px);
}
.store-badge img { display: block; height: 3.25rem; width: auto; }
.store small { color: var(--muted); font-size: 0.875rem; }

/* How it works: a sticky stage while the section scrolls by. */
.how { position: relative; height: 320vh; }
.how .stage {
  position: sticky; top: 0; height: 100vh; height: 100svh;
  display: grid; place-items: center; padding: 1.5rem; text-align: center;
}
/* A fixed width: the changing "In N days" must never re-center the stage (layout shift). */
.how .stage > div { width: min(100%, 30rem); display: flex; flex-direction: column; align-items: center; }
.row {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 1rem;
  width: min(100%, 26rem); padding: 1rem 1.25rem; border-radius: 1.5rem; text-align: left;
  background: var(--glass); box-shadow: inset 0 0 0 0.5px var(--glass-rim), 0 24px 60px -30px var(--shadow);
  -webkit-backdrop-filter: blur(24px); backdrop-filter: blur(24px);
}
.row .drop { width: 3.25rem; height: 3.25rem; }
.row b { display: block; font-weight: 600; }
.row span { color: var(--muted); font-size: 0.95rem; font-variant-numeric: tabular-nums; }
.row .amount { font-weight: 600; font-variant-numeric: tabular-nums; }
.how .big { width: min(46vw, 13rem); aspect-ratio: 1; margin: 0 auto 2.5rem; }
.steps { position: relative; height: 4.5rem; margin-top: 2rem; width: min(100%, var(--measure)); }
.steps p {
  position: absolute; inset: 0; margin: 0;
  font-size: clamp(1.25rem, 3.2vw, 1.6rem); line-height: 1.3; letter-spacing: -0.01em;
  opacity: 0; transform: translateY(0.6rem);
  transition: opacity 0.6s var(--ease), transform 0.6s var(--ease);
}
.steps p.on { opacity: 1; transform: none; }

/* Principles: one per screen, words rise in as they arrive. */
.principle .inner { max-width: var(--measure); }
.principle h2 { margin: 0; font-size: clamp(2rem, 6vw, 3.25rem); line-height: 1.08; letter-spacing: -0.03em; font-weight: 700; }
.principle p { margin: 1.1rem auto 0; color: var(--muted); font-size: clamp(1.1rem, 2.6vw, 1.3rem); max-width: 30ch; }
.principle .art { height: 9rem; margin: 0 auto 2.25rem; display: flex; justify-content: center; align-items: flex-end; gap: 1rem; }
.principle .art.center { align-items: center; }
.drop.cup { width: 6.5rem; height: 6.5rem; }
.drop.xl { width: 8rem; height: 8rem; }
.reveal { opacity: 0; transform: translateY(1.25rem); transition: opacity 0.9s var(--ease), transform 0.9s var(--ease); }
/* scenes.js adds .in to the section when it comes into view. */
.in .reveal { opacity: 1; transform: none; }
.in .reveal:nth-child(2) { transition-delay: 0.1s; }
.in .reveal:nth-child(3) { transition-delay: 0.2s; }

/* "Calm": a single reminder slides in once. */
.notice {
  display: grid; grid-template-columns: auto 1fr; gap: 0.75rem; align-items: center; text-align: left;
  width: min(100%, 21rem); padding: 0.8rem 1rem; border-radius: 1.25rem;
  background: var(--glass); box-shadow: inset 0 0 0 0.5px var(--glass-rim), 0 20px 50px -28px var(--shadow);
  -webkit-backdrop-filter: blur(24px); backdrop-filter: blur(24px);
  transform: translateY(-1rem) scale(0.98); opacity: 0;
  transition: opacity 0.8s var(--ease) 0.3s, transform 0.8s var(--ease) 0.3s;
}
.in .notice { transform: none; opacity: 1; }
.notice .drop { width: 2.4rem; height: 2.4rem; }
.notice b { display: block; font-size: 0.95rem; }
.notice span { font-size: 0.9rem; color: var(--muted); }

/* "Everything in place": four small glass tiles. */
.tiles { display: grid; grid-template-columns: repeat(2, 7.5rem); gap: 0.75rem; justify-content: center; margin: 0 auto 2.25rem; }
.tile {
  height: 7.5rem; border-radius: 1.6rem; padding: 0.9rem; text-align: left; font-size: 0.85rem; line-height: 1.25;
  background: var(--glass); box-shadow: inset 0 0 0 0.5px var(--glass-rim), 0 18px 40px -26px var(--shadow);
  display: flex; flex-direction: column; justify-content: space-between;
}
.tile .drop { width: 2.2rem; height: 2.2rem; }
.tile b { font-size: 1.05rem; }

/* The film. Fixed aspect ratio: no layout shift while it loads. */
.player { position: relative; width: min(100%, 27rem); margin: 0 auto; aspect-ratio: 4 / 5; border-radius: 2rem; overflow: hidden;
  box-shadow: 0 40px 80px -40px var(--shadow); background: var(--bg-top); }
.player video { display: block; width: 100%; height: 100%; object-fit: cover; }
.sound {
  position: absolute; right: 1rem; bottom: 1rem; width: 2.75rem; height: 2.75rem; border: 0; border-radius: 999px; cursor: pointer;
  background: var(--glass); color: var(--text); box-shadow: inset 0 0 0 0.5px var(--glass-rim);
  -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px);
  display: grid; place-items: center;
}
.sound svg { width: 1.2rem; height: 1.2rem; }
.sound .on { display: none; }
.sound[aria-pressed="true"] .on { display: block; }
.sound[aria-pressed="true"] .off { display: none; }

/* Footer */
footer {
  padding: 3rem 1.5rem max(3rem, env(safe-area-inset-bottom)); text-align: center; color: var(--muted); font-size: 0.95rem;
  border-top: 0.5px solid var(--hairline);
}
footer nav { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.5rem 1.5rem; margin-bottom: 1rem; }
footer a { text-decoration: none; }
footer a:hover { color: var(--text); }

/* Text pages: privacy and support. */
.page { max-width: 40rem; margin: 0 auto; padding: 6rem 1.5rem 4rem; }
.page h1 { font-size: clamp(2.25rem, 7vw, 3.25rem); letter-spacing: -0.03em; line-height: 1.05; margin: 0 0 0.5rem; }
.page .meta { color: var(--muted); margin: 0 0 2.5rem; }
.page h2 { font-size: 1.35rem; letter-spacing: -0.015em; margin: 2.5rem 0 0.5rem; }
.page p, .page li { color: var(--text); }
.page .home { display: inline-flex; align-items: center; gap: 0.6rem; text-decoration: none; font-weight: 600; margin-bottom: 2.5rem; }
.page .home .drop { display: inline-block; width: 1.6rem; height: 1.6rem; }
details { border-top: 0.5px solid var(--hairline); padding: 1rem 0; }
details:last-of-type { border-bottom: 0.5px solid var(--hairline); }
summary { cursor: pointer; font-weight: 600; list-style: none; }
summary::-webkit-details-marker { display: none; }
summary::after { content: "+"; float: right; color: var(--muted); transition: transform 0.3s var(--ease); }
details[open] summary::after { transform: rotate(45deg); }

/* Drops drawn by scenes.js: glass shell, liquid, rim. */
.drop svg { width: 100%; height: 100%; overflow: visible; display: block; }
.drop .shell { fill: var(--glass); }

/* Reduce Motion: everything is simply there; nothing drifts, nothing sticks. */
@media (prefers-reduced-motion: reduce) {
  .hero-drop { animation: none; }
  .reveal, .notice, .steps p { opacity: 1; transform: none; transition: none; }
  .how { height: auto; }
  .how .stage { position: static; height: auto; min-height: 100vh; }
  .steps { height: auto; }
  .steps p { position: static; margin-top: 0.75rem; }
}
