/* The home page: the game's sticker look (thick ink outlines, offset shadows, floor colours). */
:root {
  --primary: #ff6b6b; --dot: #f3dec5; --on-floor: #2b2340; --grass: #9be3a1;
  --f1: #8ecdf5; --f2: #ffb3c7; --f3: #ffd166; --f4: #9be3c3; --f5: #ff9a8a; --f6: #c9b8ff; --f7: #ffc59e;
}
@media (prefers-color-scheme: dark) {
  :root { --dot: #29223f; --grass: #7fcf88; }
}

body.home {
  padding: 0 max(16px, env(safe-area-inset-right)) 40px max(16px, env(safe-area-inset-left));
  background-color: var(--bg);
  background-image: radial-gradient(var(--dot) 1.6px, transparent 1.8px);
  background-size: 22px 22px;
}
.home section, .home .top, .home .bottom { max-width: 1040px; margin-inline: auto; }
.home h1, .home h2, .home h3 { font-family: "Fredoka", system-ui, sans-serif; font-weight: 600; line-height: 1.15; text-wrap: balance; }
.home h2 { font-size: clamp(1.7rem, 4vw, 2.3rem); margin: 0 0 8px; }
.home h3 { font-size: 1.3rem; margin: 12px 0 6px; }
.home section { padding-block: clamp(40px, 7vw, 72px); }

/* Header */
.top { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-block: 18px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font: 600 1.5rem "Fredoka", system-ui, sans-serif; }
.brand img { border-radius: 11px; border: 2.5px solid var(--line); }
.brand em { font-style: normal; color: var(--primary); }
.top nav { display: flex; gap: 20px; }
.top nav a { color: var(--ink); text-decoration: none; font-weight: 800; }
.top nav a:hover { color: var(--accent); }

/* Hero */
.hero { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr); gap: clamp(24px, 5vw, 56px); align-items: center; padding-top: clamp(16px, 4vw, 40px) !important; }
.kicker { margin: 0 0 10px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; font-size: 0.85rem; color: var(--muted); }
.hero h1 { font-size: clamp(2.6rem, 7vw, 4.4rem); margin: 0 0 16px; }
.hero h1 span { color: var(--accent); }
.lede { font-size: 1.2rem; color: var(--muted); margin: 0 0 26px; max-width: 46ch; }
.actions { display: flex; flex-wrap: wrap; gap: 14px; }
.sticker {
  display: inline-flex; align-items: center; min-height: 52px; padding: 0 24px;
  border: 3px solid var(--line); border-radius: 999px; box-shadow: 4px 4px 0 var(--line);
  background: var(--paper); color: var(--ink); font: 600 1.1rem "Fredoka", system-ui, sans-serif; text-decoration: none;
}
.sticker.primary { background: var(--primary); color: var(--on-floor); }
a.sticker:hover { transform: translate(-1px, -1px); box-shadow: 5px 5px 0 var(--line); }
a.sticker:active { transform: translate(3px, 3px); box-shadow: 1px 1px 0 var(--line); }
.app-store-badge { display: inline-flex; border-radius: 10px; }
.app-store-badge img { display: block; height: 52px; width: auto; }
.app-store-badge:focus-visible { outline: 3px solid var(--line); outline-offset: 3px; }

.hero-phones { position: relative; display: grid; justify-items: center; min-height: 0; }
.phone {
  width: min(62%, 270px); height: auto; border-radius: 34px;
  border: 3px solid var(--line); box-shadow: 6px 6px 0 var(--line); background: var(--paper);
}
/* Placed with translate/rotate so the float animation can use transform on top. */
.hero-phones .phone.back { grid-area: 1 / 1; translate: -28% 6%; rotate: -7deg; }
.hero-phones .phone.front { grid-area: 1 / 1; translate: 22% -2%; rotate: 4deg; }
.float-heart { position: absolute; width: 34px; height: 34px; pointer-events: none; }
.float-heart.h1 { left: 4%; top: 22%; }
.float-heart.h2 { right: 2%; top: 6%; width: 26px; height: 26px; }
.float-heart.h3 { right: 14%; bottom: 10%; width: 30px; height: 30px; }

/* The House */
.floors { text-align: center; }
.section-lede { color: var(--muted); margin: 0 auto 32px; font-size: 1.1rem; }
.house { max-width: 560px; margin: 0 auto; }
.roof { display: block; width: 100%; height: auto; margin-bottom: -6px; }
.walls { display: grid; grid-template-columns: 34px minmax(0, 1fr) 34px; background: #f5d9b0; border: 4px solid var(--line); border-top: 0; }
.wall-label { writing-mode: vertical-rl; align-self: center; justify-self: center; font: 800 0.75rem "Nunito", sans-serif; letter-spacing: 0.25em; text-transform: uppercase; color: var(--on-floor); }
.wall-label.left { transform: rotate(180deg); }
.floor-list { list-style: none; margin: 0; padding: 12px 0; display: grid; gap: 10px; background: var(--paper); border-inline: 4px solid var(--line); }
.floor-list li {
  display: flex; align-items: center; gap: 14px; margin-inline: 12px; padding: 10px 14px; text-align: left;
  background: var(--c); color: var(--on-floor); border: 3px solid var(--line); border-radius: 16px;
}
.floor-list img { width: 44px; height: 44px; flex: none; background: rgb(255 255 255 / 0.6); border-radius: 12px; padding: 4px; }
.floor-list div { display: grid; min-width: 0; }
.floor-list .n { font-weight: 800; font-size: 0.75rem; letter-spacing: 0.12em; text-transform: uppercase; }
.floor-list b { font: 600 1.2rem "Fredoka", system-ui, sans-serif; }
.floor-list small { font-size: 0.95rem; }
.ground { height: 22px; margin-inline: -24px; background: var(--grass); border: 4px solid var(--line); border-radius: 0 0 14px 14px; }

/* Cards */
.cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; margin-top: 24px; }
.card { background: var(--paper); border: 3px solid var(--line); border-radius: 22px; box-shadow: 5px 5px 0 var(--line); padding: 22px; }
.card p { margin: 0; color: var(--muted); }
.avatars { display: flex; }
.avatars img { width: 52px; height: 52px; }
.avatars img + img { margin-left: -10px; }

/* Write your own cards */
.spotlight { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr); gap: clamp(24px, 5vw, 56px); align-items: center; }
.spotlight .section-lede { margin: 0 0 22px; max-width: 48ch; }
.ticks { list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; }
.ticks li { display: flex; gap: 14px; align-items: flex-start; }
.ticks img { width: 40px; height: 40px; flex: none; background: var(--paper); border: 2.5px solid var(--line); border-radius: 12px; padding: 4px; }
.ticks span { padding-top: 6px; }
.spotlight-phone { position: relative; display: grid; justify-items: center; }
.spotlight-phone .phone { width: min(78%, 290px); rotate: 3deg; }
.tag {
  position: absolute; left: max(0px, calc(50% - 190px)); bottom: 14%; rotate: -8deg;
  padding: 10px 18px; border: 3px solid var(--line); border-radius: 999px; box-shadow: 4px 4px 0 var(--line);
  background: var(--primary); color: var(--on-floor); font: 600 1.05rem "Fredoka", system-ui, sans-serif; white-space: nowrap;
}

/* A peek inside: one row of screens that slides. Swipe, scroll, use the arrows or the dots. */
.gallery {
  display: flex; gap: 22px; margin-top: 20px; padding: 10px 10px 18px;
  overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding-inline: 10px;
  overscroll-behavior-x: contain; scrollbar-width: none;
  mask-image: linear-gradient(90deg, transparent 0, #000 18px, #000 calc(100% - 18px), transparent 100%);
}
.gallery::-webkit-scrollbar { display: none; }
.gallery:focus-visible { outline: 3px dashed var(--accent); outline-offset: 4px; border-radius: 24px; }
.gallery figure { margin: 0; text-align: center; flex: 0 0 clamp(190px, 22%, 236px); scroll-snap-align: start; }
@media (prefers-reduced-motion: no-preference) { .gallery { scroll-behavior: smooth; } }

.slider-controls { display: flex; align-items: center; justify-content: center; gap: 18px; margin-top: 6px; }
.slider-controls[hidden] { display: none; }
.slide-btn {
  display: grid; place-items: center; width: 52px; height: 52px; padding: 0; cursor: pointer;
  background: var(--paper); color: var(--ink); border: 3px solid var(--line); border-radius: 50%; box-shadow: 4px 4px 0 var(--line);
}
.slide-btn svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 3.2; stroke-linecap: round; stroke-linejoin: round; }
.slide-btn:not(:disabled):hover { background: var(--primary); color: var(--on-floor); }
.slide-btn:not(:disabled):active { translate: 3px 3px; box-shadow: 1px 1px 0 var(--line); }
.slide-btn:disabled { opacity: 0.35; cursor: default; }
.slide-btn:focus-visible, .dots button:focus-visible { outline: 3px dashed var(--accent); outline-offset: 3px; }
.dots { display: flex; gap: 4px; }
.dots button { width: 28px; height: 28px; padding: 0; border: 0; background: none; cursor: pointer; display: grid; place-items: center; }
.dots button::before { content: ""; width: 12px; height: 12px; border-radius: 50%; border: 2.5px solid var(--line); background: var(--paper); transition: width 0.2s, background 0.2s; }
.dots button[aria-current="true"]::before { width: 26px; border-radius: 999px; background: var(--primary); }
.gallery img { width: 100%; height: auto; border-radius: 22px; border: 3px solid var(--line); box-shadow: 5px 5px 0 var(--line); }
.gallery figcaption { margin-top: 12px; font-weight: 800; }

/* Privacy and footer */
.private .wide { display: flex; gap: 18px; align-items: flex-start; }
.private .wide h2 { font-size: 1.6rem; margin-top: 4px; }
.private .wide p { max-width: 64ch; }
.note { color: var(--muted); max-width: 64ch; margin: 24px auto 0; text-align: center; font-size: 0.95rem; }
.bottom { text-align: center; padding-top: 16px; border-top: 3px dashed var(--line); }
.bottom .muted { color: var(--muted); font-size: 0.9rem; }

@media (max-width: 760px) {
  .hero, .spotlight { grid-template-columns: minmax(0, 1fr); }
  .hero { text-align: center; }
  .lede { margin-inline: auto; }
  .actions { justify-content: center; }
  .hero-phones { margin-top: 12px; }
  .cards { grid-template-columns: minmax(0, 1fr); }
  .ground { margin-inline: -12px; }
  .spotlight-phone { margin-top: 8px; }
}

/* Motion. motion.js adds .motion only when Reduce Motion is off, so without it everything
   simply shows. Floors build up from Floor 1, cards and screens pop in one after another. */
@media (prefers-reduced-motion: no-preference) {
  .motion [data-reveal] {
    opacity: 0; translate: 0 26px; scale: 0.96;
    transition: opacity 0.5s ease, translate 0.6s cubic-bezier(0.2, 0.9, 0.3, 1.3), scale 0.6s cubic-bezier(0.2, 0.9, 0.3, 1.3);
    transition-delay: calc(var(--i, 0) * 90ms);
  }
  .motion [data-reveal].in { opacity: 1; translate: 0 0; scale: 1; }
  .motion .floor-list [data-reveal] { translate: 0 40px; }
  .motion .floor-list [data-reveal].in { translate: 0 0; }

  .hero-phones .phone.front { animation: bob 6s ease-in-out infinite; }
  .hero-phones .phone.back { animation: bob 7s ease-in-out -2.5s infinite; }
  .spotlight-phone .phone { animation: bob 6.5s ease-in-out -1s infinite; }
  .float-heart { animation: drift 5s ease-in-out infinite; }
  .float-heart.h2 { animation-delay: -1.7s; animation-duration: 6s; }
  .float-heart.h3 { animation-delay: -3.2s; animation-duration: 5.5s; }
  .roof-heart { transform-box: fill-box; transform-origin: center; animation: beat 2.6s ease-in-out infinite; }
  .puff { transform-box: fill-box; transform-origin: center; opacity: 0; animation: puff 4.5s ease-out infinite; }
  .puff.p2 { animation-delay: 1.5s; }
  .puff.p3 { animation-delay: 3s; }
  .tag { animation: wiggle 3.2s ease-in-out infinite; }

  .card, .gallery img, .floor-list li, .ticks img { transition: transform 0.2s cubic-bezier(0.2, 0.9, 0.3, 1.4); }
  .card:hover { transform: rotate(-1.2deg) translateY(-3px); }
  .gallery img:hover { transform: translateY(-6px) rotate(1.5deg); }
  .floor-list li:hover { transform: translateX(5px); }
  .ticks li:hover img { transform: rotate(-10deg) scale(1.1); }
}
@keyframes bob { 50% { transform: translateY(-10px); } }
@keyframes drift {
  0%, 100% { transform: translateY(0) rotate(-6deg) scale(1); }
  50% { transform: translateY(-16px) rotate(6deg) scale(1.12); }
}
@keyframes beat {
  0%, 45%, 100% { transform: scale(1); }
  12% { transform: scale(1.2); }
  24% { transform: scale(1); }
  34% { transform: scale(1.12); }
}
@keyframes puff {
  0% { opacity: 0; transform: translate(0, 4px) scale(0.5); }
  20% { opacity: 1; }
  100% { opacity: 0; transform: translate(-14px, -34px) scale(1.15); }
}
@keyframes wiggle {
  0%, 80%, 100% { transform: rotate(0); }
  86% { transform: rotate(-5deg); }
  92% { transform: rotate(4deg); }
}
