/* ───────────────────────────────────────────────────────────
   Rilo — marketing site
   One fixed "world" behind the page wears Rilo's app themes
   (lib/themes.js: grass, bamboo, sakura, sunset, snow). Each
   full-screen scene picks a theme; the world crossfades to it
   and the scene's content fades in.
   ─────────────────────────────────────────────────────────── */

:root{
  --ink:#12301A;
  --ink-2:#2C4A36;
  --ink-3:#3D5A46;
  --card:#FFFBF1;
  --line:#12301A;
  --green-ink:#246E31;

  --radius:22px;
  --wrap:1120px;
  --hills:clamp(104px,13vw,168px);

  --shadow:0 22px 44px rgba(18,48,26,.22);
  --ease:cubic-bezier(.22,.8,.3,1);
}

*,*::before,*::after{box-sizing:border-box}
[hidden]{display:none !important}

html{
  scroll-behavior:smooth;
  scroll-padding-top:70px;
  -webkit-text-size-adjust:100%;
}

body{
  margin:0;
  /* the world paints the real background; this is only the fallback */
  background:#EEF8E6;
  color:var(--ink);
  font-family:Inter,system-ui,-apple-system,"Segoe UI",sans-serif;
  font-size:17px;
  line-height:1.6;
  overflow-x:hidden;
}

h1,h2,h3{
  font-family:Fredoka,Inter,system-ui,sans-serif;
  font-weight:600;
  line-height:1.08;
  letter-spacing:-.01em;
  margin:0;
  text-wrap:balance;
}
h2{font-size:clamp(2rem,6.4vw,3.1rem)}

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

.skip-link{
  position:absolute;left:0;top:-80px;z-index:200;
  background:var(--ink);color:#fff;padding:12px 18px;border-radius:0 0 12px 0;
  font-weight:600;
}
.skip-link:focus{top:0}

:focus-visible{outline:3px solid var(--ink);outline-offset:3px;border-radius:6px}

.wrap{width:100%;max-width:var(--wrap);margin-inline:auto;padding-inline:20px}
.wrap--narrow{max-width:700px}
.center{text-align:center}

.sr-only{
  position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;
  clip:rect(0 0 0 0);white-space:nowrap;border:0;
}

/* ───────────────────────── buttons ───────────────────────── */

.btn{
  display:inline-flex;align-items:center;justify-content:center;gap:8px;
  font-family:Fredoka,sans-serif;font-weight:600;
  text-decoration:none;
  background:var(--ink);color:#fff;
  border:2px solid var(--line);
  border-radius:999px;
  box-shadow:0 4px 0 var(--line);
  transition:transform .12s ease,box-shadow .12s ease;
  cursor:pointer;
}
.btn--sm{font-size:15px;padding:9px 18px;min-height:42px}
.btn--lg{font-size:19px;padding:14px 28px;min-height:56px}
.btn:hover{transform:translateY(2px);box-shadow:0 2px 0 var(--line)}
.btn:active{transform:translateY(4px);box-shadow:0 0 0 var(--line)}
.btn--ghost{background:var(--card);color:var(--ink)}

/* ───────────────────────── nav ───────────────────────── */

.nav{
  position:fixed;top:0;left:0;right:0;z-index:100;
  background:rgba(255,253,246,.55);
  backdrop-filter:blur(14px) saturate(1.2);
  -webkit-backdrop-filter:blur(14px) saturate(1.2);
  border-bottom:1px solid rgba(18,48,26,.08);
}
.nav__in{
  width:100%;max-width:var(--wrap);margin-inline:auto;
  padding:10px 20px;
  display:flex;align-items:center;gap:18px;
}
.nav__brand{
  display:flex;align-items:center;gap:9px;
  font-family:Fredoka,sans-serif;font-weight:600;font-size:21px;
  text-decoration:none;margin-right:auto;
}
.nav__icon{border-radius:9px}
.nav__links{display:none;gap:26px;font-weight:500;font-size:15.5px}
.nav__links a{text-decoration:none;color:var(--ink-2)}
.nav__links a:hover{color:var(--ink)}
@media (min-width:860px){.nav__links{display:flex}}

/* the scene dots down the right edge */
.dots{display:none}
@media (min-width:1000px){
  .dots{
    position:fixed;right:22px;top:50%;transform:translateY(-50%);z-index:90;
    display:flex;flex-direction:column;gap:12px;
  }
  .dots a{
    display:block;width:11px;height:11px;border-radius:50%;
    border:2px solid var(--ink);background:transparent;
    transition:background .3s ease,transform .3s var(--ease);
  }
  .dots a.is-on{background:var(--ink);transform:scale(1.25)}
  .dots a:hover{background:rgba(18,48,26,.35)}
}

/* ───────────────────────── the world ───────────────────────── */

.world{position:fixed;inset:0;z-index:-1;pointer-events:none;overflow:hidden}

.sky{
  position:absolute;inset:0;
  opacity:0;
  transition:opacity 1.2s ease;
}
.sky.is-on{opacity:1}
/* decor in a hidden theme doesn't need to keep moving */
.sky:not(.is-on) *{animation-play-state:paused !important}

.sky[data-theme="grass"] {background:linear-gradient(180deg,#A6DDF0 0%,#CDEDF0 30%,#EAF6E6 58%,#EEF8E6 100%)}
.sky[data-theme="bamboo"]{background:linear-gradient(180deg,#FFD7A3 0%,#FFE8C4 26%,#F8F1D9 54%,#EAF5E2 100%)}
.sky[data-theme="sakura"]{background:linear-gradient(180deg,#FFD3E0 0%,#FFE6EE 30%,#FFF4F2 58%,#F1F7EA 100%)}
.sky[data-theme="sunset"]{background:linear-gradient(180deg,#FFB08A 0%,#FFCBA4 28%,#FFE3C8 52%,#F3E9DA 100%)}
.sky[data-theme="snow"]  {background:linear-gradient(180deg,#C9E6FA 0%,#E0F0FB 34%,#F2F8FC 62%,#F6FAFD 100%)}

/* each theme's things drift in slightly as it arrives */
.sky .deco{transform:scale(1.04);transition:transform 1.6s var(--ease)}
.sky.is-on .deco{transform:none}

.w-sun{
  position:absolute;border-radius:50%;
  width:var(--s);height:var(--s);
  background:var(--core);
  box-shadow:0 0 0 calc(var(--s) * .28) var(--glow);
  animation:sun-glow 6s ease-in-out infinite;
}
/* on a phone the high suns tuck into the corner, clear of the headlines */
@media (max-width:759px){
  .w-sun--top{scale:.7;translate:40% -40%}
  .w-sun--top[style*="left"]{translate:-40% -40%}
}

.w-hills{position:absolute;left:0;right:0;bottom:-1px;height:var(--hills)}
.w-hills svg{position:absolute;inset:0;width:100%;height:100%;display:block}
.w-rilo{
  position:absolute;left:5%;bottom:46%;
  width:clamp(64px,8vw,112px);
  filter:drop-shadow(0 6px 10px rgba(18,48,26,.18));
}

.w-bamboo{position:absolute;bottom:0;width:60px;height:auto;transform-origin:50% 100%}
.w-sway{animation:bamboo-sway var(--d,7s) ease-in-out infinite;transform-origin:50% 100%}

.w-branch{
  position:absolute;top:56px;right:-6px;
  width:clamp(220px,32vw,420px);
  transform:scaleX(-1);
}
.w-branch svg{display:block;width:100%;height:auto}

.w-birds{position:absolute;top:16%;left:8%;width:clamp(160px,20vw,280px)}
@media (max-width:759px){.w-birds{top:auto;bottom:calc(var(--hills) + 34%);left:2%;width:130px}}

.w-fall{
  position:absolute;top:0;
  animation:leaf-fall var(--d,13s) linear var(--delay,0s) infinite both;
}
.w-fly{position:absolute;animation:butterfly var(--d,14s) ease-in-out var(--delay,0s) infinite}
.w-fly svg g{transform-origin:11px 8px;animation:flap .35s ease-in-out infinite alternate}

/* ───────────────────────── scenes ───────────────────────── */

.scene{
  position:relative;
  min-height:100vh;min-height:100svh;
  display:flex;align-items:center;
  padding:92px 0 calc(var(--hills) + 24px);
}
.scene > .wrap{width:100%}

/* the fade: everything marked .fx slides up into place when its scene
   arrives, staggered by --i, and fades back out when the scene leaves */
.fx{
  opacity:0;
  transform:translateY(28px);
  transition:
    opacity .8s ease calc(var(--i,0) * 90ms),
    transform .9s var(--ease) calc(var(--i,0) * 90ms);
}
.scene.is-in .fx{opacity:1;transform:none}
/* leaving is quicker and unstaggered so it never lags behind the scroll */
.scene:not(.is-in) .fx{transition-duration:.45s;transition-delay:0s}

.label{
  font-family:Fredoka,sans-serif;
  font-size:12.5px;font-weight:600;
  letter-spacing:.13em;text-transform:uppercase;
  color:var(--green-ink);
  margin:0 0 10px;
}
.lede{color:var(--ink-3);margin:14px 0 0;font-size:1.08rem}

/* ─────────────── the iPhone mockup ───────────────
   The screen is exactly the screenshot's shape (780×1688), so nothing
   is cropped; the bezel is an even border around it. That makes the
   whole phone ~2.08:1, the shape of a real iPhone 15/16. */

.phone{
  position:relative;
  width:100%;
  padding:3.4%;
  background:#0E1510;
  border-radius:16% / 7.7%;
  box-shadow:var(--shadow),0 0 0 1.5px rgba(255,255,255,.22) inset;
}
.phone__screen{
  position:relative;
  aspect-ratio:780/1688;
  border-radius:13.5% / 6.25%;
  overflow:hidden;
  background:#A6DDF0;
  /* keeps the rounded clip on Safari while children animate */
  isolation:isolate;
}
.phone__screen img{
  position:absolute;inset:0;
  width:100%;height:100%;
  object-fit:cover;
}
.phone__island{
  position:absolute;z-index:2;
  top:2.9%;left:50%;transform:translateX(-50%);
  width:27%;aspect-ratio:3.4/1;
  background:#0E1510;
  border-radius:999px;
}

/* screens that crossfade inside one phone */
.scr{opacity:0;transform:scale(1.03);transition:opacity .7s ease,transform 1.2s var(--ease)}
.scr.is-on{opacity:1;transform:none}

/* ───────────────────────── 1 · hero ───────────────────────── */

.scene--hero{padding-top:96px}
.hero{text-align:center}
.hero__title{font-size:clamp(2.4rem,9vw,4.4rem)}
.hero__sub{
  margin:14px auto 0;max-width:30ch;
  font-size:clamp(1.05rem,3.6vw,1.28rem);
  color:var(--ink-2);
}
.hero__cta{
  margin-top:24px;
  display:flex;flex-direction:column;align-items:center;gap:12px;
}
@media (min-width:620px){.hero__cta{flex-direction:row;justify-content:center;gap:14px}}

.fan{
  margin-top:34px;
  display:flex;align-items:flex-end;justify-content:center;
}
.fan__front{z-index:3;width:min(40vw,200px)}
.fan__side{z-index:1;width:min(29vw,160px)}
.fan__side--l{margin-right:-9%}
.fan__side--r{margin-left:-9%}
.fan__side--l .phone{transform:rotate(-8deg)}
.fan__side--r .phone{transform:rotate(8deg)}
@media (min-width:760px){
  .fan__front{width:230px}
  .fan__side{width:185px}
  .fan__side--l{margin-right:-30px}
  .fan__side--r{margin-left:-30px}
}

/* ───────────────────── split scenes ───────────────────── */

.split{display:grid;gap:30px;align-items:center}
.split__text{text-align:center;min-width:0}
.split__art{display:flex;justify-content:center}
.split__art .phone{width:min(48vw,205px)}

@media (min-width:860px){
  .split{grid-template-columns:1.1fr 1fr;gap:64px}
  .split__text{text-align:left}
  .split--flip .split__text{order:2}
  .split--flip .split__art{order:1}
  .split__art .phone{width:245px}
}
/* short screens (landscape laptops): keep the phone inside the view */
@media (min-width:860px) and (max-height:760px){
  .split__art .phone{width:210px}
}

/* ── the step / feature tabs that drive the phone ── */
.tabs{
  list-style:none;margin:26px 0 0;padding:0;
  display:grid;gap:10px;
  text-align:left;
}
.tab{
  position:relative;overflow:hidden;
  width:100%;
  display:flex;align-items:flex-start;gap:14px;
  padding:14px 16px;
  font:inherit;color:inherit;text-align:left;
  background:rgba(255,251,241,.55);
  border:2px solid transparent;
  border-radius:18px;
  cursor:pointer;
  transition:background .35s ease,border-color .35s ease,box-shadow .35s ease;
}
.tab:hover{background:rgba(255,251,241,.8)}
.tab.is-on{
  background:var(--card);
  border-color:var(--line);
  box-shadow:0 4px 0 var(--line);
}
.tab__num{
  flex:0 0 auto;
  width:32px;height:32px;
  display:grid;place-items:center;
  border-radius:50%;
  background:rgba(18,48,26,.12);color:var(--ink);
  font-family:Fredoka,sans-serif;font-weight:600;font-size:16px;
  transition:background .35s ease,color .35s ease;
}
.tab.is-on .tab__num{background:var(--ink);color:#fff}
.tab__body{display:block;min-width:0}
.tab__body b{
  display:block;
  font-family:Fredoka,sans-serif;font-weight:600;font-size:1.15rem;line-height:1.25;
  padding-top:3px;
}
/* the description only opens on the active tab, which keeps the scene short */
.tab__body > span{
  display:block;
  max-height:0;overflow:hidden;opacity:0;
  color:var(--ink-3);font-size:15.5px;line-height:1.45;
  transition:max-height .5s var(--ease),opacity .35s ease,margin .5s var(--ease);
}
.tab.is-on .tab__body > span{max-height:5em;opacity:1;margin-top:4px}

/* the progress line along the bottom of the active tab */
.tab::after{
  content:"";
  position:absolute;left:0;bottom:0;height:3px;width:100%;
  background:var(--green-ink);
  transform:scaleX(0);transform-origin:left;
}
.tab.is-timing::after{animation:tab-fill var(--cycle,4s) linear forwards}
@keyframes tab-fill{to{transform:scaleX(1)}}

/* ───────────────────── 5 · moods + levels ───────────────────── */

.moods{
  list-style:none;margin:26px auto 0;padding:0;
  display:grid;grid-template-columns:repeat(4,1fr);
  gap:10px;max-width:560px;
}
.moods li{
  background:var(--card);
  border:2px solid var(--line);
  border-radius:18px;
  box-shadow:0 4px 0 var(--line);
  padding:10px 4px 8px;
}
.moods img{width:min(16vw,76px);margin:0 auto 4px}
.moods span{font-family:Fredoka,sans-serif;font-weight:600;font-size:13.5px;color:var(--ink-2)}

.sub-h{font-size:clamp(1.5rem,4.6vw,2.1rem);margin-top:44px}

.skins{
  list-style:none;margin:20px calc(50% - 50vw) 0;padding:6px 20px 14px;
  display:flex;gap:12px;
  overflow-x:auto;
  scroll-snap-type:x proximity;
  -webkit-overflow-scrolling:touch;
  scrollbar-width:none;
}
.skins::-webkit-scrollbar{display:none}
.skins li{
  flex:0 0 auto;width:104px;
  scroll-snap-align:center;
  background:var(--card);
  border:2px solid var(--line);
  border-radius:18px;
  box-shadow:0 4px 0 var(--line);
  padding:10px 6px 8px;
}
.skins li.is-max{background:#FFF3C9}
.skins img{width:66px;margin:0 auto 4px}
.skins b{display:block;font-family:Fredoka,sans-serif;font-weight:600;font-size:13px;line-height:1.2}
.skins small{display:block;font-size:12px;color:var(--ink-3);margin-top:2px}
@media (min-width:860px){
  .skins{padding-inline:max(20px,calc(50vw - var(--wrap)/2))}
}

/* ───────────────────── 6 · waitlist + faq ───────────────────── */

.scene--end{align-items:flex-start;padding-top:110px}
.end__rilo{width:clamp(110px,22vw,150px);margin:0 auto 14px}
.wait .lede{max-width:40ch;margin-inline:auto}

.wait__form{
  display:flex;flex-direction:column;gap:12px;
  max-width:540px;margin:22px auto 0;
}
.wait__form input{
  flex:1 1 auto;min-width:0;
  font-family:Inter,sans-serif;font-size:17px;
  color:var(--ink);
  background:var(--card);
  border:2px solid var(--line);
  border-radius:999px;
  box-shadow:0 4px 0 var(--line);
  padding:0 22px;min-height:56px;
}
.wait__form input::placeholder{color:#7D9185}
.wait__form input[aria-invalid="true"]{border-color:#B3261E}
.wait__form .btn{flex:0 0 auto}
@media (min-width:620px){.wait__form{flex-direction:row;align-items:stretch}}

.wait__error{margin:14px auto 0;max-width:540px;font-size:15px;font-weight:500;color:#8C1D18}
.wait__done p{
  margin:22px 0 0;
  font-family:Fredoka,sans-serif;font-weight:600;
  font-size:clamp(1.2rem,4.4vw,1.5rem);
}

.soon{
  display:inline-block;margin:0 0 14px;padding:6px 14px;border-radius:999px;
  background:var(--card);color:var(--ink);border:2px solid var(--ink);
  font-family:Fredoka,sans-serif;font-weight:600;font-size:14px;letter-spacing:.02em;
}

.price{
  margin:30px auto 0;max-width:36ch;
  font-family:Fredoka,sans-serif;font-weight:500;
  font-size:clamp(1.05rem,3.6vw,1.3rem);
  line-height:1.45;color:var(--ink-2);
}
.price strong{font-weight:600;color:var(--ink)}

.faq{display:grid;gap:10px;margin-top:30px;text-align:left}
.q{
  background:rgba(255,251,241,.9);
  border:2px solid var(--line);
  border-radius:18px;
  overflow:hidden;
}
.q summary{
  padding:14px 50px 14px 18px;
  cursor:pointer;
  font-family:Fredoka,sans-serif;font-weight:600;font-size:1.04rem;
  position:relative;list-style:none;
}
.q summary::-webkit-details-marker{display:none}
.q summary::after{
  content:"";
  position:absolute;right:20px;top:50%;
  width:14px;height:14px;
  background:
    linear-gradient(var(--ink),var(--ink)) center/14px 2.5px no-repeat,
    linear-gradient(var(--ink),var(--ink)) center/2.5px 14px no-repeat;
  transform:translateY(-50%);
  transition:transform .25s ease;
}
.q[open] summary::after{
  background:linear-gradient(var(--ink),var(--ink)) center/14px 2.5px no-repeat;
  transform:translateY(-50%) rotate(180deg);
}
.q p{margin:0;padding:0 18px 16px;color:var(--ink-3)}

/* ───────────────────────── footer ───────────────────────── */

.foot{position:relative;background:var(--ink);color:#DCE9DE;padding:28px 0}
.foot__in{display:flex;flex-direction:column;align-items:center;gap:7px;text-align:center;font-size:15px}
.foot p{margin:0}
.foot a{color:#fff;text-decoration:underline;text-underline-offset:3px}
.foot__c{color:#8FA894;font-size:14px}
@media (min-width:620px){.foot__in{flex-direction:row;justify-content:space-between}}

/* ───────────────────────── motion ───────────────────────── */

.float{animation:float 6.5s ease-in-out infinite}
@keyframes float{0%,100%{translate:0 0}50%{translate:0 -12px}}

@keyframes sun-glow{
  0%,100%{opacity:.9;transform:scale(1)}
  50%{opacity:1;transform:scale(1.04)}
}
@keyframes bamboo-sway{
  0%,100%{transform:rotate(-1.2deg)}
  50%{transform:rotate(1.2deg)}
}
@keyframes leaf-fall{
  0%{transform:translate3d(0,-40px,0) rotate(0deg);opacity:0}
  10%{opacity:1}
  50%{transform:translate3d(26px,50vh,0) rotate(160deg)}
  90%{opacity:1}
  100%{transform:translate3d(-10px,105vh,0) rotate(320deg);opacity:0}
}
@keyframes flap{from{transform:scaleX(1)}to{transform:scaleX(.35)}}
@keyframes butterfly{
  0%{transform:translate3d(0,0,0)}
  25%{transform:translate3d(90px,-40px,0)}
  50%{transform:translate3d(160px,10px,0)}
  75%{transform:translate3d(60px,50px,0)}
  100%{transform:translate3d(0,0,0)}
}

/* everything above is decoration — switch it all off on request */
@media (prefers-reduced-motion:reduce){
  html{scroll-behavior:auto}
  .fx{opacity:1;transform:none;transition:none}
  .float{animation:none}
  .w-fall,.w-fly{display:none}
  *,*::before,*::after{
    animation-duration:.001ms !important;
    animation-iteration-count:1 !important;
    transition-duration:.001ms !important;
  }
}
