/* Home page (planque.app). Builds on styles.css; values mirror planque-design-reference.html ("Website" section).
   Direction: A "the map is the page" (hero) + C "told in the group chat". */
:root {
  --night-top: #070b2a;
  --night-mid: #1b1f5e;
  --night-bottom: #1b1a38;
  --yellow: #ffe14d;
  --pink: #ff8fc7;
  --green: #8fe3a0;
  --blue: #9fd8ff;
  --violet: #cdbbff;
  --orange: #ffc27a;
  --hunt-fill: rgba(190, 165, 255, 0.38);
  --mine-fill: rgba(255, 225, 77, 0.3);
  --beam-top: rgba(190, 165, 255, 0.85);
  --beam-mid: rgba(190, 165, 255, 0.32);
  --beam-end: rgba(190, 165, 255, 0.04);
  --beam-glow: #b9a2ff;
  --store-bg: #101433;
  --store-ink: #ffffff;
  --store-base: #000;
  --bubble: #ffffff;
  --bubble-me: #dce4ff;
  --section: #f5f7ff;
  --ground-filter: none;
  --hero-ink: #101433;
  --shot-frame: #101433;
  --max: 1180px;
  --gutter: 16px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --hunt-fill: rgba(190, 165, 255, 0.28);
    --mine-fill: rgba(255, 225, 77, 0.22);
    --bubble: #2a2760;
    --bubble-me: #3a3678;
    --section: #15143a;
    --ground-filter: invert(1) hue-rotate(200deg) brightness(0.62) saturate(1.5);
    --store-bg: #ffffff;
    --store-ink: #101433;
    --store-base: #9b98d6;
    --hero-ink: #ffffff;
    --shot-frame: #000;
  }
}

body.landing { background: var(--section); background-image: none; }
.landing h2 { font-size: clamp(34px, 5vw, 58px); line-height: 1; letter-spacing: -0.5px; }
.landing em { font-style: normal; color: var(--link); }
.landing .tag { box-shadow: 0 0 0 3px #fff, 0 6px 10px -4px rgba(16, 20, 80, 0.35); padding: 6px 12px 5px 7px; }
.tag.violet { background: var(--violet); }
.tag.orange { background: var(--orange); }

/* ---------- Store buttons ---------- */
.stores { display: flex; flex-wrap: wrap; gap: 12px; }
.store {
  display: flex; flex-direction: column; justify-content: center; min-width: 180px; height: 60px; padding: 0 22px;
  border-radius: var(--r-button); background: var(--store-bg); color: var(--store-ink); text-decoration: none;
  box-shadow: 0 5px 0 var(--store-base), 0 14px 22px -10px rgba(16, 20, 51, 0.55);
  transition: transform 0.08s, box-shadow 0.08s;
}
.store small { font-size: 11px; letter-spacing: 0.3px; opacity: 0.85; }
.store b { font-family: var(--display); font-size: 23px; line-height: 1; }
.store:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--store-base); }
.store:focus-visible, .pill:focus-visible { outline: 3px solid var(--yellow); outline-offset: 3px; }
.store.yellow { background: var(--yellow); color: #101433; box-shadow: 0 5px 0 #c9a800, 0 14px 22px -10px rgba(0, 0, 0, 0.6); }
.store.yellow:active { box-shadow: 0 1px 0 #c9a800; }
.pill {
  display: inline-flex; align-items: center; height: 44px; padding: 0 18px; border-radius: 16px; color: #fff; text-decoration: none;
  font-family: var(--display); font-size: 17px; background: linear-gradient(180deg, #7f8cff 0%, #4b4ff0 55%, #3a35d6 100%);
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.45), 0 4px 0 #2a24a8;
}

/* ---------- 1. Hero: the map world ---------- */
.hero {
  position: relative; overflow: hidden; min-height: 760px; height: min(100vh, 900px);
  background: linear-gradient(180deg, var(--sky-top) 0, var(--sky-mid) 42%, var(--sky-bottom) 68%);
}
.topnav { position: relative; z-index: 6; max-width: var(--max); margin: 0 auto; display: flex; align-items: center; gap: 26px; padding: 20px var(--gutter); }
.topnav-logo { margin-right: auto; }
.topnav-logo img { height: 40px; width: auto; filter: drop-shadow(0 3px 0 rgba(16, 20, 51, 0.18)); }
.topnav-link { color: #fff; text-decoration: none; font-size: 16px; }
.topnav-link:hover { text-decoration: underline; }

.hero-copy { position: relative; z-index: 5; max-width: var(--max); margin: 0 auto; padding: 48px var(--gutter) 0; }
.hero h1 { font-size: clamp(46px, 6.4vw, 84px); line-height: 0.98; letter-spacing: -0.5px; color: #fff; text-shadow: 0 6px 0 rgba(16, 20, 51, 0.18); max-width: 14ch; }
.hero h1 em { font-style: normal; color: var(--yellow); }
.lede { margin: 18px 0 26px; max-width: 30ch; font-size: clamp(17px, 1.8vw, 22px); line-height: 1.3; color: var(--hero-ink); }
.fine { margin-top: 14px; font-size: 15px; color: var(--ink2); }

.cloud.h1c { width: 210px; height: 52px; top: 300px; left: 60%; }
.cloud.h2c { width: 150px; height: 38px; top: 250px; right: 4%; }
.cloud.h3c { width: 110px; height: 28px; top: 110px; left: 3%; }

.ground {
  position: absolute; left: -40%; right: -40%; bottom: 0; height: 900px; z-index: 1;
  background: url(/img/map.jpg) center / 900px repeat; filter: var(--ground-filter);
  transform: perspective(900px) rotateX(64deg); transform-origin: 50% 100%;
  /* Fades into the sky at the horizon, like the app's fog. */
  -webkit-mask-image: linear-gradient(180deg, transparent 0, #000 30%);
  mask-image: linear-gradient(180deg, transparent 0, #000 30%);
}
/* Friends and their areas: a stage pinned to the bottom right. The tilted ground's horizon sits about 210px above the
   bottom whatever the window height, so heights are px from the bottom and positions across are %. Each beam ends on
   the centre of its area (area bottom + half its width, since the circle is squashed around its centre). */
.world { position: absolute; z-index: 3; right: 0; bottom: 0; width: min(62%, 820px); height: 100%; container-type: inline-size; }
.area { position: absolute; border-radius: 50%; border: 7px solid #fff; background: var(--hunt-fill); transform: scaleY(0.42); aspect-ratio: 1; }
.area.mine { border-style: dashed; background: var(--mine-fill); }
.area-lea { left: 4%; width: 30cqw; bottom: calc(100px - 15cqw); }
.area-sam { left: 38%; width: 24cqw; bottom: calc(140px - 12cqw); }
.area-fox { left: 72%; width: 18cqw; bottom: calc(170px - 9cqw); }
.area.mine { left: 33%; width: 30cqw; bottom: calc(36px - 15cqw); }

.beacon { position: absolute; display: flex; flex-direction: column; align-items: center; width: 160px; margin-left: -80px; animation: bob 3.4s ease-in-out infinite; }
.beacon .disc { display: grid; place-items: center; width: 92px; height: 92px; border-radius: 50%; border: 5px solid #fff; box-shadow: 0 0 28px 6px var(--beam-glow); overflow: hidden; }
.beacon .disc img { width: 100px; height: 100px; max-width: none; }
.disc.pink, .face.pink { background: var(--pink); }
.disc.green, .face.green { background: var(--green); }
.disc.yellow, .face.yellow { background: var(--yellow); }
.face.blue { background: var(--blue); }
.beacon .tag { margin-top: 8px; font-size: 15px; }
.beam { width: 150px; clip-path: polygon(38% 0, 62% 0, 100% 100%, 0 100%); background: linear-gradient(180deg, var(--beam-top), var(--beam-mid) 55%, var(--beam-end)); }
.b-lea { left: 19%; bottom: 100px; }
.b-lea .beam { height: 150px; }
.b-sam { left: 50%; bottom: 140px; animation-delay: -1.2s; }
.b-sam .beam { height: 120px; }
.b-fox { left: 81%; bottom: 170px; animation-delay: -2.3s; }
.b-fox .beam { height: 100px; }
.my-pin { position: absolute; left: 46%; bottom: 6px; width: 180px; margin-left: -90px; display: flex; flex-direction: column; align-items: center; }
.my-pin .tag { transform: rotate(-3deg) translateX(-56px); margin-bottom: -18px; position: relative; z-index: 1; }
.my-pin > img { width: 112px; filter: var(--sticker-shadow); }

/* ---------- 2. Group chat ---------- */
.chat-section {
  max-width: var(--max); margin: 0 auto; padding: 96px var(--gutter) 72px;
  display: grid; grid-template-columns: 1fr 1fr; gap: 56px; align-items: center;
}
.chat-copy p { margin-top: 18px; max-width: 34ch; font-size: 20px; line-height: 1.4; color: var(--ink2); }
.thread { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.msg { display: flex; align-items: flex-end; gap: 10px; }
.msg.me { flex-direction: row-reverse; }
.face { flex: none; display: grid; place-items: center; width: 50px; height: 50px; border-radius: 50%; border: 3px solid #fff; overflow: hidden; box-shadow: 0 6px 10px -6px rgba(16, 20, 80, 0.5); }
.face img { width: 58px; max-width: none; }
.bubble { max-width: 380px; padding: 12px 16px; border-radius: 22px 22px 22px 6px; background: var(--bubble); font-size: 17px; line-height: 1.35; box-shadow: 0 10px 22px -14px rgba(16, 20, 80, 0.5); }
.msg.me .bubble { border-radius: 22px 22px 6px 22px; background: var(--bubble-me); }
.bubble .name { display: block; font-size: 13px; color: var(--ink2); margin-bottom: 2px; }
.bubble .tag { font-size: 15px; vertical-align: middle; }
.bubble .tag img[alt='yes'] { width: 20px; height: 20px; }
.invite { padding: 0; overflow: hidden; width: min(340px, 100%); }
.invite .mini { position: relative; display: block; height: 120px; background: url(/img/map.jpg) 60% 30% / 700px; filter: var(--ground-filter); }
.invite .mini::after { content: ''; position: absolute; left: 36%; top: 14%; width: 30%; height: 72%; border-radius: 50%; border: 4px solid #fff; background: var(--mine-fill); }
.invite-body { display: block; padding: 12px 16px 14px; }
.invite-body b { display: block; font-family: var(--display); font-size: 21px; line-height: 1.1; }
.invite-body .link { color: var(--link); font-size: 15px; }
.win { display: flex; align-items: center; gap: 12px; }
.win img { width: 54px; }
.win b { display: block; font-family: var(--display); font-size: 21px; line-height: 1.1; }
.win .sub { font-size: 15px; color: var(--ink2); }
/* Messages arrive one by one when the chat scrolls into view (site.js adds .in). */
.js .thread .msg { opacity: 0; transform: translateY(14px) scale(0.98); transition: opacity 0.4s, transform 0.4s cubic-bezier(0.2, 0.9, 0.3, 1.3); }
.js .thread.in .msg { opacity: 1; transform: none; }
.js .thread.in .msg:nth-child(2) { transition-delay: 0.35s; }
.js .thread.in .msg:nth-child(3) { transition-delay: 0.7s; }
.js .thread.in .msg:nth-child(4) { transition-delay: 1.05s; }
.js .thread.in .msg:nth-child(5) { transition-delay: 1.5s; }

/* ---------- 3. How it works ---------- */
.how { max-width: var(--max); margin: 0 auto; padding: 72px var(--gutter); text-align: center; }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; margin-top: 44px; text-align: left; }
.step-card { position: relative; padding: 18px 18px 24px; border-radius: var(--r-panel); background: var(--panel); border: 1px solid var(--panel-border); box-shadow: var(--panel-shadow); }
.step-card .shot { width: 100%; border-radius: 26px; border: 7px solid var(--shot-frame); aspect-ratio: 560 / 1000; object-fit: cover; object-position: top; }
.step-card .num { position: absolute; top: 4px; left: 4px; display: grid; place-items: center; width: 52px; height: 52px; border-radius: 50%; background: var(--yellow); border: 4px solid #fff; color: #101433; font-family: var(--display); font-size: 26px; transform: rotate(-6deg); box-shadow: 0 6px 10px -4px rgba(16, 20, 80, 0.4); }
.step-card h3 { margin-top: 18px; font-size: 28px; }
.step-card p { margin-top: 6px; font-size: 16px; line-height: 1.45; color: var(--ink2); }
.questions { list-style: none; padding: 0; margin: 36px 0 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }
.questions .tag { font-size: 17px; }
.questions .tag img { width: 28px; height: 28px; }

/* ---------- 4. Characters ---------- */
.characters { max-width: var(--max); margin: 0 auto; padding: 56px var(--gutter) 96px; display: grid; grid-template-columns: 1.1fr 1fr; gap: 48px; align-items: center; }
.cast { display: flex; justify-content: center; gap: 8px; }
.cast figure { margin: 0; display: flex; flex-direction: column; align-items: center; gap: 4px; animation: bob 3.6s ease-in-out infinite; }
.cast figure:nth-child(2) { animation-delay: -1.2s; margin-top: 40px; }
.cast figure:nth-child(3) { animation-delay: -2.4s; }
.cast img { width: 180px; filter: var(--sticker-shadow); }
.cast .tag { font-size: 15px; white-space: nowrap; }
.chars-copy p { margin-top: 18px; max-width: 34ch; font-size: 20px; line-height: 1.4; color: var(--ink2); }

/* ---------- 5. Final call, at night ---------- */
.final {
  position: relative; overflow: hidden; padding: 150px var(--gutter) 120px; text-align: center; color: #fff;
  background: linear-gradient(180deg, var(--night-top) 0, var(--night-mid) 70%, var(--night-bottom) 100%);
}
.final h2 { color: var(--yellow); font-size: clamp(44px, 8vw, 104px); text-shadow: 0 0 40px rgba(255, 225, 77, 0.35); }
.final p { margin: 16px 0 30px; font-size: 20px; color: #c9c4ee; }
.final .stores { justify-content: center; }
.final .moon { position: absolute; width: 110px; right: 6%; top: 26px; filter: var(--sticker-shadow); }
.star { position: absolute; width: 4px; height: 4px; border-radius: 50%; background: #fff; opacity: 0.8; }
.star.s1 { left: 10%; top: 60px; } .star.s2 { left: 24%; top: 170px; } .star.s3 { left: 70%; top: 40px; }
.star.s4 { left: 88%; top: 230px; } .star.s5 { left: 46%; top: 24px; }

.site-footer { padding: 36px var(--gutter) 44px; text-align: center; font-size: 14px; color: var(--ink2); background: var(--section); }
.site-footer > img { width: 120px; margin: 0 auto 14px; }
.site-footer nav { display: flex; justify-content: center; gap: 22px; margin-bottom: 10px; }
.site-footer a { color: var(--ink2); text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }

/* ---------- Dark: night sky over a lit city ---------- */
@media (prefers-color-scheme: dark) {
  .hero { background: linear-gradient(180deg, var(--night-top) 0, var(--night-mid) 48%, var(--night-bottom) 70%); }
  .hero .cloud { display: none; }
  .landing em { color: var(--yellow); }
  .final { background: linear-gradient(180deg, #04061c 0, var(--night-top) 70%, var(--night-bottom) 100%); }
}

/* ---------- Phones and small tablets ---------- */
@media (max-width: 860px) {
  .hero { height: auto; min-height: 0; padding-bottom: 420px; }
  .topnav { gap: 14px; }
  .topnav-link { display: none; }
  .topnav-logo img { height: 32px; }
  .hero-copy { padding-top: 22px; }
  .world { width: 100%; height: 420px; }
  .ground { height: 640px; background-size: 620px; }
  .b-sam, .area-sam { display: none; }
  .area-lea { left: 2%; width: 50cqw; bottom: calc(110px - 25cqw); }
  .b-lea { left: 27%; bottom: 110px; }
  .b-lea .beam { height: 110px; }
  .area-fox { left: 62%; width: 34cqw; bottom: calc(160px - 17cqw); }
  .b-fox { left: 79%; bottom: 160px; }
  .b-fox .beam { height: 60px; }
  .area.mine { left: 40%; width: 46cqw; bottom: calc(20px - 23cqw); }
  .my-pin { left: 60%; bottom: 0; }
  .my-pin .tag { transform: rotate(-3deg); }
  .cloud.h3c { display: none; }
  .cloud.h1c { left: 58%; top: 470px; width: 140px; height: 36px; }
  .cloud.h2c { display: none; }
  .chat-section, .characters { grid-template-columns: 1fr; gap: 32px; padding-top: 64px; }
  .steps { grid-template-columns: 1fr; max-width: 420px; margin-left: auto; margin-right: auto; }
  .cast img { width: 26vw; max-width: 160px; }
  .step-card .shot { aspect-ratio: 560 / 640; }
  .characters .cast { order: 2; }
}
@media (max-width: 480px) {
  .store { flex: 1; min-width: 0; padding: 0 14px; height: 56px; }
  .store b { font-size: 20px; }
  .beacon { transform: scale(0.82); transform-origin: bottom center; }
  .bubble { font-size: 15px; max-width: 270px; }
  .face { width: 42px; height: 42px; }
  .face img { width: 48px; }
  .final .moon { width: 80px; right: 6%; top: 30px; }
}
@media (prefers-reduced-motion: reduce) {
  .beacon, .cast figure { animation: none; }
  .js .thread .msg { opacity: 1; transform: none; transition: none; }
}
