/* ================================================
   JELLIES: jellies-shell.css
   Shared shell for the redesigned pages: tokens, water background,
   top bar, mobile tab bar, buttons, store badges, cards, footer.
   Dark is the default; light follows the visitor's system setting,
   and an explicit data-theme on <html> wins either way.
   ================================================ */

:root {
  --base: #060D16; --card: #101F30; --inset: #16283C;
  --ink: #F3F1EA; --sub: #BFD0D8; --faint: #8C9BAE;
  --mint: #8EC5B0; --mint-deep: #5A9A80; --mint-text: #9ED4C0; --on-mint: #0A1826;
  --lav: #C5C3E8; --lav-text: #C5C3E8; --lav-tint: rgba(197,195,232,.12);
  --coral: #EE8A78; --coral-deep: #B85A4A; --coral-tint: rgba(238,138,120,.13); --on-coral: #2A0F0A;
  --ring-mint: #8EC5B0; --ring-amber: #D9A55F; --ring-coral: #EE8A78;
  --w1: #2C5A6E; --w2: #17394D; --w3: #0C2032;
  --ray: rgba(255,255,255,.07); --bubble: rgba(255,255,255,.18);
  --hair: rgba(255,255,255,.07); --hair-strong: rgba(255,255,255,.24);
  --glass: rgba(255,255,255,.08); --wave: rgba(255,255,255,.22); --bar: rgba(16,31,48,.84);
  --medal: #0D1B2A;
  --glow: 0 0 28px rgba(142,197,176,.35);
  --card-border: 1px solid rgba(255,255,255,.07); --shadow: none;
  --serif: 'Fraunces', Georgia, 'Times New Roman', serif;
  --sans: 'Nunito', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --notefont: 'Newsreader', Georgia, serif;
  --p: 0; /* page-depth progress, 0 at top, 1 at bottom (set by jellies-shell.js) */
  color-scheme: dark;
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --base: #EEF1FA; --card: #FFFFFF; --inset: #EEF1FA;
    --ink: #12212F; --sub: #3E5163; --faint: #5B6B7C;
    --mint: #2F8266; --mint-deep: #1F5E48; --mint-text: #2C7057; --on-mint: #FFFFFF;
    --lav: #6F69C4; --lav-text: #5F59B8; --lav-tint: rgba(111,105,196,.1);
    --coral: #C4553F; --coral-deep: #8F3B2B; --coral-tint: rgba(196,85,63,.09); --on-coral: #FFFFFF;
    --ring-mint: #2C7057; --ring-amber: #C99A54; --ring-coral: #C4553F;
    --w1: #C9E9EF; --w2: #AEE0C8; --w3: #8FCBB0;
    --ray: rgba(255,255,255,.4); --bubble: rgba(255,255,255,.6);
    --hair: rgba(18,33,47,.09); --hair-strong: rgba(18,33,47,.28);
    --glass: rgba(255,255,255,.55); --wave: rgba(255,255,255,.7); --bar: rgba(255,255,255,.88);
    --medal: #FFFFFF;
    --glow: 0 0 24px rgba(47,130,102,.28);
    --card-border: 1px solid transparent;
    --shadow: 0 1px 2px rgba(18,33,47,.08), 0 4px 14px rgba(18,33,47,.06);
    color-scheme: light;
  }
}

:root[data-theme="light"] {
  --base: #EEF1FA; --card: #FFFFFF; --inset: #EEF1FA;
  --ink: #12212F; --sub: #3E5163; --faint: #5B6B7C;
  --mint: #2F8266; --mint-deep: #1F5E48; --mint-text: #2C7057; --on-mint: #FFFFFF;
  --lav: #6F69C4; --lav-text: #5F59B8; --lav-tint: rgba(111,105,196,.1);
  --coral: #C4553F; --coral-deep: #8F3B2B; --coral-tint: rgba(196,85,63,.09); --on-coral: #FFFFFF;
  --ring-mint: #2C7057; --ring-amber: #C99A54; --ring-coral: #C4553F;
  --w1: #C9E9EF; --w2: #AEE0C8; --w3: #8FCBB0;
  --ray: rgba(255,255,255,.4); --bubble: rgba(255,255,255,.6);
  --hair: rgba(18,33,47,.09); --hair-strong: rgba(18,33,47,.28);
  --glass: rgba(255,255,255,.55); --wave: rgba(255,255,255,.7); --bar: rgba(255,255,255,.88);
  --medal: #FFFFFF;
  --glow: 0 0 24px rgba(47,130,102,.28);
  --card-border: 1px solid transparent;
  --shadow: 0 1px 2px rgba(18,33,47,.08), 0 4px 14px rgba(18,33,47,.06);
  color-scheme: light;
}

/* ---- Base ---- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--base);
  color: var(--ink);
  font: 400 17px/1.55 var(--sans);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
img, svg { max-width: 100%; }
a { color: inherit; }
button { font-family: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--mint-text); outline-offset: 3px; border-radius: 8px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }

.skip {
  position: absolute; left: 16px; top: -60px; z-index: 50;
  background: var(--mint); color: var(--on-mint); font: 800 15px var(--sans);
  padding: 10px 16px; border-radius: 12px; text-decoration: none;
}
.skip:focus { top: 12px; }

/* ---- The water ---- */
.world {
  position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden;
  background: linear-gradient(180deg, var(--w1) 0%, var(--w2) 30%, var(--w3) 65%, var(--base) 100%);
  background-size: 100% 400%;
  background-position: 50% calc(var(--p) * 100%);
}
.ray {
  position: absolute; top: -15%; width: 16vw; min-width: 90px; height: 130%;
  background: linear-gradient(180deg, var(--ray), transparent 70%); filter: blur(5px);
  opacity: calc(1 - var(--p) * 2.4); /* gone by mid-page */
  transform-origin: top center; animation: sway 11s ease-in-out infinite alternate;
}
.ray:nth-child(1) { left: 8%; transform: rotate(16deg); }
.ray:nth-child(2) { left: 42%; transform: rotate(12deg); animation-delay: -4s; width: 11vw; }
.ray:nth-child(3) { left: 74%; transform: rotate(18deg); animation-delay: -7s; }
@keyframes sway { from { margin-left: -14px; } to { margin-left: 18px; } }
.bubbles { position: absolute; inset: 0; transform: translateY(calc(var(--p) * -140px)); }
.b {
  position: absolute; bottom: -60px; left: var(--l); width: var(--s); height: var(--s); border-radius: 50%;
  background: var(--bubble); animation: rise var(--t) linear var(--d) infinite;
}
.b:nth-child(3n) { background: rgba(142,197,176,.3); }
.b:nth-child(3n+1) { background: rgba(197,195,232,.3); }
@keyframes rise { from { transform: translate(0,0); } to { transform: translate(var(--x), -118vh); } }

.wave { height: 60px; overflow: hidden; position: relative; margin-top: 8px; }
.wave svg { position: absolute; left: 0; top: 0; width: 200%; height: 100%; animation: drift 26s linear infinite; }
.wave svg.rev { animation-direction: reverse; animation-duration: 38s; opacity: .7; }
.wave path { fill: none; stroke: var(--wave); stroke-width: 2; vector-effect: non-scaling-stroke; }
@keyframes drift { to { transform: translateX(-50%); } }

/* ---- Layout ---- */
main, header, footer { position: relative; z-index: 1; }
.in {
  max-width: 1120px; margin: 0 auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}
section { padding-block: 52px 36px; }
.split { display: grid; grid-template-columns: .9fr 1.1fr; gap: 48px; align-items: center; }
.split > * { min-width: 0; }
.split.flip { grid-template-columns: 1.1fr .9fr; }
.split.flip > .txt { order: 2; }
@media (max-width: 860px) {
  .split, .split.flip { grid-template-columns: 1fr; gap: 28px; }
  .split.flip > .txt { order: 0; }
}

/* ---- Type ---- */
h1, h2, h3 { font-family: var(--serif); font-weight: 500; margin: 0; text-wrap: balance; letter-spacing: -.01em; }
h1 { font-size: clamp(46px, 8.4vw, 92px); line-height: 1.0; }
h2 { font-size: clamp(31px, 5vw, 48px); line-height: 1.1; margin-bottom: 14px; }
h3 { font-size: 24px; line-height: 1.2; }
.lede { color: var(--sub); font-size: 19px; max-width: 52ch; margin: 0 0 18px; }
.label { font: 700 14px var(--sans); color: var(--mint-text); letter-spacing: .02em; margin: 0 0 12px; }
.fine { color: var(--sub); font-size: 14px; margin: 0; }
em { font-style: italic; }

/* ---- Buttons + store badges ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: 800 16px var(--sans); text-decoration: none; min-height: 44px;
  border: 1.5px solid var(--mint); border-bottom: 4px solid var(--mint-deep);
  background: var(--mint); color: var(--on-mint);
  padding: 12px 20px; border-radius: 16px; cursor: pointer;
  transition: transform .08s, border-bottom-width .08s;
}
.btn:active { transform: translateY(3px); border-bottom-width: 1.5px; }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--hair-strong); border-bottom-width: 1.5px; }
.btn.small { padding: 8px 14px; font-size: 14px; border-radius: 14px; border-bottom-width: 3px; min-height: 40px; }
.full { width: 100%; }
.link {
  background: none; border: 0; padding: 4px 0; min-height: 32px;
  font: 700 14px var(--sans); color: var(--lav-text); cursor: pointer;
  text-decoration: underline; text-underline-offset: 3px; text-align: left;
}
.cta-row { display: flex; flex-wrap: wrap; gap: 12px 16px; align-items: center; margin: 24px 0 10px; }
/* Official badges, used as provided. The Google Play art has built-in padding,
   so it is drawn larger and pulled in to match the App Store badge's height. */
.badge { display: inline-block; height: 48px; border-radius: 8px; }
.badge img { display: block; height: 48px; width: auto; }
.badge.gp img { height: 71px; margin: -12px; }
.badge:hover { filter: brightness(1.1); }

/* ---- Top bar ---- */
.nav { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-block: 16px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; border-radius: 999px; }
.medal {
  width: 42px; height: 42px; border-radius: 50%; background: var(--medal);
  display: grid; place-items: center; border: 1px solid var(--hair-strong); flex: none;
}
.medal img { width: 30px; height: 30px; display: block; }
.word { font: 600 26px var(--serif); letter-spacing: -.01em; }
.nav nav { display: flex; align-items: center; gap: 24px; }
.nav nav a:not(.btn) { font: 700 15px var(--sans); text-decoration: none; color: var(--sub); padding-block: 10px; }
.nav nav a:not(.btn):hover, .nav nav a[aria-current] { color: var(--ink); }
.nav nav a[aria-current] { border-bottom: 2px solid var(--mint); padding-bottom: 2px; }

/* ---- Mobile tab bar ---- */
.tabbar { display: none; }
@media (max-width: 720px) {
  .nav nav { display: none; }
  .tabbar {
    display: flex; position: fixed; z-index: 30;
    left: max(12px, env(safe-area-inset-left, 0px));
    right: max(12px, env(safe-area-inset-right, 0px));
    bottom: calc(10px + env(safe-area-inset-bottom, 0px)); /* clears the iPhone home indicator */
    justify-content: space-around; gap: 2px; padding: 7px 8px; border-radius: 26px;
    background: var(--bar); -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px);
    border: 1px solid var(--hair-strong); box-shadow: 0 8px 24px rgba(0,0,0,.25);
  }
  .tabbar a {
    flex: 1 1 0; min-width: 0; min-height: 48px;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
    padding: 6px 2px; border-radius: 18px; text-decoration: none;
    font: 700 11.5px var(--sans); color: var(--sub); white-space: nowrap;
  }
  .tabbar svg { width: 23px; height: 23px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
  .tabbar a[aria-current] { color: var(--mint-text); }
  .tabbar a.dl { background: var(--mint); color: var(--on-mint); }
  /* Room under the footer so the floating bar never covers it */
  footer { padding-bottom: calc(110px + env(safe-area-inset-bottom, 0px)) !important; }
}

/* ---- Cards ---- */
.card { background: var(--card); border: var(--card-border); box-shadow: var(--shadow); border-radius: 20px; }

/* ---- Safety card ---- */
.safety { padding: 22px; max-width: 760px; }
.safety p { margin: 0 0 10px; }
.safety p:last-child { margin: 0; }

/* ---- Download section ---- */
.final { text-align: center; padding-block: 64px 56px; }
.final h2 { font-size: clamp(40px, 7vw, 76px); }
.final .cta-row { justify-content: center; }

/* ---- Check-in phone card (homepage demo, Our story illustration) ---- */
.phone { max-width: 430px; margin-inline: auto; border-radius: 28px; overflow: hidden; position: relative; width: 100%; }
.split .phone { margin-inline: 0; }
@media (max-width: 860px) { .split .phone { margin-inline: auto; } }
.top { position: relative; padding: 22px 20px 38px; background: linear-gradient(180deg, var(--w1), var(--w2)); }
.top h3 { font-size: 27px; }
.seam { position: absolute; left: 0; right: 0; bottom: -1px; width: 100%; height: 24px; display: block; }
.seam path { fill: var(--card); }
.glass { background: var(--glass); border-radius: 16px; padding: 12px 14px; margin-top: 12px; }
.glass small { display: block; font: 700 12.5px var(--sans); color: var(--sub); }
.glass q { display: block; quotes: none; font: 500 22px/1.25 var(--notefont); margin: 4px 0 2px; }
.glass span { font: 600 12px var(--sans); color: var(--sub); }
.pad { padding: 18px 20px 22px; }
.h-sm { font: 500 19px var(--serif); margin: 0 0 10px; }
.moods { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.mood { height: 50px; border-radius: 14px; border: 1.5px solid var(--hair); background: var(--inset); font-size: 24px; cursor: pointer; padding: 0; transition: transform .12s; }
.mood:hover { transform: translateY(-2px); }
.mood[aria-pressed="true"] { border-color: var(--mint); box-shadow: var(--glow); background: var(--card); }
textarea { width: 100%; margin-top: 12px; min-height: 88px; resize: vertical; border-radius: 14px; border: 1.5px solid var(--hair-strong); background: var(--inset); color: var(--ink); font: 400 16px/1.4 var(--sans); padding: 12px 14px; }
textarea::placeholder { color: var(--faint); }

/* ---- Footer ---- */
footer { padding-block: 34px 40px; }
footer .links { display: flex; flex-wrap: wrap; gap: 8px 22px; margin: 16px 0; }
footer .links a { font-weight: 700; color: var(--sub); padding-block: 6px; }
footer .social { display: flex; gap: 8px; margin: 0 0 16px; }
footer .social a {
  width: 44px; height: 44px; display: grid; place-items: center;
  color: var(--sub); border-radius: 12px;
}
footer .social a:hover { color: var(--ink); }
footer .social svg { width: 20px; height: 20px; }
footer p { margin: 0 0 6px; color: var(--faint); font-size: 14px; }
footer p a { color: var(--sub); font-weight: 700; }

/* ---- Scroll reveal (added by jellies-shell.js only when motion is allowed) ---- */
.rv { transition: opacity .8s ease, transform .8s ease; }
.rv.pre { opacity: 0; transform: translateY(22px); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .ray, .b, .wave svg { animation: none !important; }
  .b { display: none; }
  .bubbles { transform: none; }
  .rv, .rv.pre { opacity: 1; transform: none; transition: none; }
}
