/* The Tibblo game page (/tibblo/ and /tibblo/tr/). Loaded after tibblo.css.
   Every animation lives under html.motion, which the page's head sets only when
   the visitor has not asked for reduced motion. Without it the page is still. */

.home { overflow-x: clip; }
.home .top { position: relative; z-index: 3; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Hero ---------- */
.hero-x { position: relative; isolation: isolate; }
.hero-sky { position: absolute; inset: -120px 0 0; z-index: -1; overflow: hidden; pointer-events: none; }
.blob { position: absolute; border-radius: 50%; }
.b1 { width: 520px; height: 520px; left: -180px; top: 40px; background: #FFE9D2; }
.b2 { width: 380px; height: 380px; right: -120px; top: -40px; background: #E3F4EF; }
.b3 { width: 220px; height: 220px; left: 46%; bottom: -60px; background: #FFF0C9; }

.hero-grid { display: grid; gap: 24px; align-items: center; padding-top: 24px; padding-bottom: 40px; }
@media (min-width: 960px) { .hero-grid { grid-template-columns: 1fr 1.05fr; gap: 40px; padding-top: 48px; padding-bottom: 72px; } }

.hero-copy h1 { margin: 0 0 18px; font-size: clamp(42px, 7.2vw, 76px); line-height: 1; font-weight: 900; letter-spacing: -0.03em; }
.hero-copy h1 em {
  font-style: normal; color: var(--coral); white-space: nowrap; padding-bottom: .12em;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 12' preserveAspectRatio='none'%3E%3Cpath d='M2 8 Q 25 2 50 7 T 100 7 T 150 7 T 198 6' fill='none' stroke='%2311968C' stroke-width='4' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat 0 100% / 100% .2em;
}
.hero-copy .lead { margin: 0; font-size: clamp(18px, 2vw, 21px); color: var(--ink-2); max-width: 36ch; }

.stores { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.store {
  display: inline-flex; align-items: center; gap: 10px; min-width: 176px;
  padding: 9px 18px 9px 14px; border-radius: 14px; background: var(--ink); color: #fff; text-decoration: none;
  box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .35); transition: transform .2s ease, background-color .2s;
}
.store:hover { background: #3D2F53; transform: translateY(-2px); }
.store svg { width: 26px; height: 26px; flex: none; fill: none; stroke: #fff; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.store[data-store="google-play"] svg path { fill: #fff; }
.store span { display: grid; line-height: 1.15; }
.store small { font-size: 12px; font-weight: 700; color: #D9CFEA; }
.store b { font-size: 19px; font-weight: 900; letter-spacing: -0.01em; }

.chips { list-style: none; margin: 22px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px 18px; font-size: 15px; font-weight: 800; color: var(--ink-2); }
.chips li { display: inline-flex; align-items: center; gap: 8px; }
.chips li::before { content: ""; width: 18px; height: 18px; border-radius: 50%; flex: none;
  background: var(--teal) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 18 18'%3E%3Cpath d='M5 9.5l2.6 2.5L13 6.5' fill='none' stroke='%23fff' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 100% no-repeat; }

/* The stage: Fenn on a warm disc, two friends behind, clouds passing */
.stage { position: relative; width: 100%; max-width: 580px; margin: 0 auto; aspect-ratio: 1 / .92; }
.stage-disc { position: absolute; left: 9%; right: 9%; top: 6%; aspect-ratio: 1; border-radius: 50%;
  background: radial-gradient(circle at 50% 42%, #FFE8CC 0 58%, #FFDDB5 58.2% 100%); }
.stage-disc::after { content: ""; position: absolute; inset: 7%; border-radius: 50%; border: 3px dashed rgba(232, 87, 46, .16); }
.cloud { position: absolute; fill: #fff; width: 20%; filter: drop-shadow(0 4px 0 rgba(46, 34, 64, .05)); }
.c1 { top: 10%; left: 4%; }
.c2 { top: 25%; right: 2%; width: 15%; }
.buddy { position: absolute; height: auto; filter: drop-shadow(0 6px 0 rgba(46, 34, 64, .06)); }
.bd1 { width: 17%; left: 9%; bottom: 13%; }
.bd2 { width: 21%; right: 6%; bottom: 12%; }
.fenn { position: absolute; left: 50%; bottom: 0; width: 64%; transform: translateX(-50%); padding: 0; border: 0; background: none; cursor: pointer; border-radius: 40% 40% 30% 30%; -webkit-tap-highlight-color: transparent; }
.fenn .pet-svg { display: block; width: 100%; height: auto; overflow: visible; }
.bubble { position: absolute; left: 58%; top: 12%; margin: 0; padding: 10px 16px; border-radius: 18px 18px 18px 6px; background: #fff; color: var(--ink);
  font-weight: 900; font-size: clamp(15px, 1.6vw, 19px); white-space: nowrap; box-shadow: 0 2px 0 var(--line), 0 12px 24px -12px rgba(46, 34, 64, .3); }
.hearts { position: absolute; inset: 0; pointer-events: none; }
.heart { position: absolute; width: 26px; height: 26px; }
.heart svg { width: 100%; height: 100%; fill: var(--coral); }

/* ---------- Pets drawn from the game's layers ---------- */
.pet-svg { overflow: visible; }
.pet-svg .p-shadow { fill: #2E2240; opacity: .12; }
.p-eyes-blink, .p-eyes-happy, .p-mouth-open { display: none; }
.is-blink .p-eyes-open { display: none; }
.is-blink .p-eyes-blink { display: inline; }
.is-happy .p-eyes-open, .is-happy .p-eyes-blink, .is-happy .p-mouth-smile { display: none; }
.is-happy .p-eyes-happy, .is-happy .p-mouth-open { display: inline; }
.p-squash, .p-hop { transform-origin: 200px 436px; }
.p-face { transition: transform .35s cubic-bezier(.2, .7, .2, 1); }

/* ---------- Ribbon ---------- */
.ribbon { position: relative; z-index: 2; background: var(--teal); color: #fff; transform: rotate(-1.6deg); margin: 8px -20px 0; overflow: hidden;
  box-shadow: inset 0 -4px 0 var(--teal-dark); }
.ribbon-track { display: flex; width: max-content; padding: 14px 0 16px; }
.ribbon-track > span { display: flex; align-items: center; flex: none; font-weight: 900; font-size: clamp(18px, 2.2vw, 24px); letter-spacing: -0.01em; white-space: nowrap; }
.ribbon i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--sun); margin: 0 22px; }

/* ---------- Tour: what you do together ---------- */
.band.day { padding-top: 88px; }
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 56px; }
.step { display: grid; gap: 22px; justify-items: center; text-align: center; }
.step-shot { width: min(300px, 78vw); border-radius: 26px; box-shadow: 0 1px 0 var(--line), 0 24px 48px -24px rgba(46, 34, 64, .4); }
.step h3 { margin: 0 0 10px; font-size: clamp(26px, 3vw, 36px); font-weight: 900; letter-spacing: -0.02em; line-height: 1.1; }
.step p { margin: 0 auto; color: var(--ink-2); max-width: 44ch; }
.step-tag { display: inline-block; margin-bottom: 12px; padding: 4px 12px; border-radius: 999px; font-size: 14px; font-weight: 900; letter-spacing: .02em;
  color: var(--accent); background: color-mix(in srgb, var(--accent) 13%, #fff); }
.tour-phone { display: none; }

@media (min-width: 980px) {
  .tour { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 64px; }
  .tour-phone { display: block; position: sticky; top: calc(50vh - var(--ph) / 2 - 14px); align-self: start;
    --pw: min(330px, calc((100vh - 150px) * .46)); --ph: calc(var(--pw) * 2.173); }
  .tour-screens { position: relative; width: var(--pw); height: var(--ph); margin: 0 auto; border-radius: 30px; overflow: hidden; background: #FFE9D2;
    box-shadow: 0 1px 0 var(--line), 0 30px 60px -28px rgba(46, 34, 64, .45); transition: transform .7s cubic-bezier(.2, .7, .2, 1); }
  .tour-screens img { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; transform: scale(1.04); transition: opacity .55s ease, transform .8s cubic-bezier(.2, .7, .2, 1); }
  .tour-screens img.on { opacity: 1; transform: none; }
  .tour-dots { list-style: none; display: flex; justify-content: center; gap: 6px; margin: 16px 0 0; padding: 0; }
  .tour-dots li { width: 8px; height: 8px; border-radius: 4px; background: var(--line); transition: width .35s ease, background-color .35s; }
  .tour-dots li.on { width: 26px; background: var(--coral); }
  .steps { gap: 0; }
  .step { min-height: 78vh; align-content: center; justify-items: start; text-align: left; }
  .step p { margin: 0; }
  .step-shot { display: none; }
  .js .step { opacity: .3; transition: opacity .5s ease; }
  .js .step.on { opacity: 1; }
  .tour[data-tilt="1"] .tour-screens { transform: rotate(1.6deg); }
  .tour[data-tilt="0"] .tour-screens { transform: rotate(-1.6deg); }
}

/* ---------- A little every day ---------- */
.daily { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; grid-template-columns: 1fr; }
@media (min-width: 560px) { .daily { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1000px) { .daily { grid-template-columns: repeat(4, 1fr); gap: 18px; } }
.daily li { display: grid; gap: 4px; align-content: start; padding: 22px; border-radius: 22px; background: var(--cream); font-size: 16px; color: var(--ink-2); line-height: 1.45; }
.daily svg { width: 44px; height: 44px; padding: 8px; margin-bottom: 10px; border-radius: 14px; background: #fff; fill: none; stroke: var(--coral); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; transition: transform .3s cubic-bezier(.3, 1.6, .5, 1); }
.daily li:nth-child(2) svg { stroke: var(--teal); }
.daily li:nth-child(3) svg { stroke: #8A5BD6; }
.daily li:nth-child(4) svg { stroke: #3B6FD9; }
.daily li:hover svg { transform: rotate(-8deg) scale(1.08); }
.daily b { font-size: 19px; font-weight: 900; color: var(--ink); }

/* ---------- Friends ---------- */
.friends { list-style: none; margin: 0; padding: 0; display: grid; gap: 22px 14px; grid-template-columns: repeat(2, 1fr); }
@media (min-width: 560px) { .friends { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 900px) { .friends { grid-template-columns: repeat(5, 1fr); gap: 28px 18px; } }
.friend { text-align: center; }
.friend-tile { display: block; width: 100%; aspect-ratio: 1; padding: 9% 9% 5%; border: 0; border-radius: 26px; background: var(--tint); cursor: pointer;
  transition: transform .3s cubic-bezier(.3, 1.5, .5, 1), box-shadow .3s; -webkit-tap-highlight-color: transparent; }
.friend-tile:hover { transform: translateY(-4px); box-shadow: 0 14px 24px -16px rgba(46, 34, 64, .4); }
.friend-tile .pet-svg { width: 100%; height: 100%; }
.friend b { display: block; margin-top: 12px; font-size: 20px; font-weight: 900; }
.friend span { display: block; color: var(--ink-2); font-size: 15px; font-weight: 700; line-height: 1.35; }
.friend i { display: block; font-style: normal; font-size: 14px; margin-top: 4px; line-height: 1.4; color: var(--ink-2); }
.t-fenn .friend-tile { box-shadow: inset 0 0 0 3px #FFC79A; }

/* ---------- Take a peek ---------- */
.peek { padding: 72px 0 80px; background: linear-gradient(#FFF6EA, #FFEEDB); }
.peek .sec-head { margin-bottom: 32px; }
.shelf { overflow-x: auto; overflow-y: hidden; scroll-snap-type: x mandatory; scrollbar-width: none; padding: 8px 0 28px; }
.shelf::-webkit-scrollbar { display: none; }
.shelf:focus-visible { outline-offset: -3px; }
.shelf-track { list-style: none; display: flex; width: max-content; margin: 0; padding: 0 var(--pad); }
.shelf-track li { flex: none; width: clamp(190px, 46vw, 250px); margin-right: 18px; scroll-snap-align: center; }
.shelf-track img { width: 100%; border-radius: 22px; box-shadow: 0 1px 0 var(--line), 0 20px 36px -22px rgba(46, 34, 64, .45); }

/* ---------- Families (night band) ---------- */
.promises { list-style: none; margin: 0; padding: 0; display: grid; gap: 0 40px; grid-template-columns: 1fr; }
@media (min-width: 700px) { .promises { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1040px) { .promises { grid-template-columns: repeat(3, 1fr); } }
.promises li { display: grid; gap: 4px; padding: 20px 0 22px 40px; position: relative; border-top: 1px solid rgba(246, 238, 255, .16); color: #CFC3E3; font-size: 16px; line-height: 1.5; }
.promises li::before { content: ""; position: absolute; left: 0; top: 22px; width: 26px; height: 26px; border-radius: 50%;
  background: var(--sun) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 18 18'%3E%3Cpath d='M5 9.5l2.6 2.5L13 6.5' fill='none' stroke='%232E2240' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 72% no-repeat; }
.promises b { color: #fff; font-size: 19px; font-weight: 900; }

/* ---------- Launch ---------- */
.band.launch { background: var(--cream-2); }
.launch-grid { display: grid; gap: 36px; align-items: center; }
@media (min-width: 900px) { .launch-grid { grid-template-columns: 1fr 1.2fr; gap: 56px; } }
.launch h2 { margin: 0 0 12px; font-size: clamp(30px, 4vw, 44px); line-height: 1.08; font-weight: 900; letter-spacing: -0.02em; }
.launch p { margin: 0; color: var(--ink-2); font-size: 19px; max-width: 40ch; }
.launch .actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 26px; }
.launch-art img { width: 100%; border-radius: 28px; box-shadow: 0 1px 0 var(--line), 0 30px 50px -30px rgba(46, 34, 64, .45); }

/* =================== Motion (only with html.motion) =================== */
@keyframes rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
@keyframes drift { 0%, 100% { transform: translate(0, 0); } 50% { transform: translate(28px, 18px); } }
@keyframes cloud { from { transform: translateX(-30%); } to { transform: translateX(30%); } }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-7%); } }
@keyframes breathe { 0%, 100% { transform: scale(1, 1); } 50% { transform: scale(1.014, .982); } }
@keyframes wag { 0%, 100% { transform: rotate(-6deg); } 50% { transform: rotate(6deg); } }
@keyframes earwig { 0%, 86%, 100% { transform: rotate(0); } 91% { transform: rotate(-7deg); } 96% { transform: rotate(4deg); } }
@keyframes sway { 0%, 100% { transform: rotate(-4deg); } 50% { transform: rotate(4deg); } }
@keyframes hop { 0% { transform: none; } 30% { transform: translateY(-34px) scale(.97, 1.04); } 55% { transform: translateY(0) scale(1.05, .94); } 75% { transform: translateY(-8px); } 100% { transform: none; } }
@keyframes float-up { 0% { opacity: 0; transform: translate(0, 0) scale(.6); } 15% { opacity: 1; } 100% { opacity: 0; transform: translate(var(--dx), -150px) scale(1.1); } }
@keyframes pop { 0% { transform: scale(.7); opacity: 0; } 60% { transform: scale(1.06); opacity: 1; } 100% { transform: none; } }
@keyframes slide { to { transform: translateX(-50%); } }
@keyframes draw { from { background-size: 0 .2em; } to { background-size: 100% .2em; } }
@keyframes float { 0%, 100% { transform: translateY(0) rotate(-.6deg); } 50% { transform: translateY(-10px) rotate(.6deg); } }

.motion .rise { opacity: 0; animation: rise .8s cubic-bezier(.2, .7, .2, 1) forwards; animation-delay: calc(var(--r) * 90ms + 80ms); }
.motion .hero-copy h1 em { animation: draw 1s .8s cubic-bezier(.6, 0, .2, 1) both; }
.motion .b1 { animation: drift 22s ease-in-out infinite; }
.motion .b2 { animation: drift 26s ease-in-out -9s infinite reverse; }
.motion .b3 { animation: drift 18s ease-in-out -4s infinite; }
.motion .c1 { animation: cloud 26s ease-in-out infinite alternate; }
.motion .c2 { animation: cloud 34s ease-in-out -12s infinite alternate-reverse; }
.motion .bd1 { animation: bob 3.4s ease-in-out infinite; }
.motion .bd2 { animation: bob 3.9s ease-in-out -1.4s infinite; }
.motion .stage { transition: transform .4s ease-out; }
.motion .stage-disc::after { animation: spin 90s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.motion .bubble.say { animation: pop .45s cubic-bezier(.3, 1.5, .5, 1); }
.motion .heart { animation: float-up 1.3s ease-out forwards; }

.motion .pet-svg .p-squash { animation: breathe 3.6s ease-in-out infinite; }
.motion .pet-svg .p-tail { animation: wag 1.8s ease-in-out infinite; }
.motion .pet-svg .p-ear { animation: earwig 5.5s ease-in-out infinite; }
.motion .pet-svg .p-sway { animation: sway 3.2s ease-in-out infinite; }
.motion .is-happy .p-hop { animation: hop .7s cubic-bezier(.3, .7, .4, 1); }
.motion .is-happy .p-tail { animation-duration: .5s; }
.motion .friend .p-squash { animation-delay: calc(var(--i) * -.41s); }
.motion .friend .p-tail, .motion .friend .p-sway, .motion .friend .p-ear { animation-delay: calc(var(--i) * -.67s); }

.motion .ribbon-track { animation: slide 38s linear infinite; }

.motion .shelf.rolling { overflow: hidden; scroll-snap-type: none; -webkit-mask-image: linear-gradient(90deg, transparent, #000 5%, #000 95%, transparent); mask-image: linear-gradient(90deg, transparent, #000 5%, #000 95%, transparent); }
.motion .shelf.rolling .shelf-track { animation: slide 80s linear infinite; padding: 0; }
.motion .shelf.rolling:hover .shelf-track, .motion .shelf.rolling:focus-within .shelf-track { animation-play-state: paused; }
.motion .shelf.rolling li { transition: transform .35s cubic-bezier(.3, 1.4, .5, 1); }
.motion .shelf.rolling li:hover { transform: translateY(-8px) rotate(-1deg); }

.motion .launch-art { animation: float 7s ease-in-out infinite; }

.motion.ready .reveal:not(.in) { opacity: 0; transform: translateY(26px); }
.motion .reveal { transition: opacity .7s ease, transform .8s cubic-bezier(.2, .7, .2, 1); transition-delay: calc(var(--d, 0) * 80ms); }
@media (max-width: 979px) { .motion.ready .step:not(.in) { opacity: 0; transform: translateY(26px); } .motion .step { transition: opacity .7s ease, transform .8s cubic-bezier(.2, .7, .2, 1); } }

/* Narrow phones: keep "Support" from reading as part of the logo. */
@media (max-width: 440px) { .home .top nav a:not(.opt) { background: var(--cream-2); padding: 6px 10px; } }
