/* Pocket Preserve game website (pocketpreserve.yashasystems.ai): Blossom
   palette, pixel accents, parallax hero. Source art lives in art/website/. */

:root {
  --forest: #0f2826;
  --forest-2: #163b37;
  --forest-3: #1f4c46;
  --ivory: #fff8ea;
  --cream: #f6ecd7;
  --paper: #fffdf7;
  --teal: #2a9384;
  --jade: #74c9a5;
  --pink: #f29ab4;
  --pink-deep: #d9668b;
  --gold: #f5c45c;
  --gold-deep: #d99a2b;
  --ink: #2a2520;
  --ink-soft: #5c5850;
  --on-dark: #f3efe4;
  --on-dark-soft: #b9c9c2;
  --radius: 22px;
  --shadow: 0 18px 40px rgba(10, 30, 28, .22);
  --display: "Fredoka", "Nunito", system-ui, sans-serif;
  --body: "Nunito", system-ui, -apple-system, "Segoe UI", sans-serif;
  --pixel: "Pixelify Sans", "Fredoka", monospace;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; }
body {
  margin: 0;
  background: var(--forest);
  color: var(--ink);
  font: 400 17px/1.6 var(--body);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
h1, h2, h3 { font-family: var(--display); font-weight: 600; line-height: 1.12; margin: 0; letter-spacing: -.01em; }
h2 { font-size: clamp(32px, 4.4vw, 54px); }
h3 { font-size: 22px; }
p { margin: 0; }
.wrap { width: min(1180px, 100% - 32px); margin-inline: auto; }
.eyebrow {
  font: 500 14px/1 var(--pixel);
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--teal);
  margin-bottom: 14px;
}
.lead { font-size: clamp(17px, 1.6vw, 20px); color: var(--ink-soft); max-width: 640px; margin-top: 16px; }
.num { font: 500 14px/1 var(--pixel); }
.skip-link { position: absolute; left: -999px; top: 8px; z-index: 100; background: var(--gold); color: var(--ink); padding: 10px 16px; border-radius: 12px; }
.skip-link:focus { left: 8px; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; border-radius: 8px; }

/* ---------- pills ---------- */
.pill {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: 600 16px/1 var(--display);
  color: var(--ink);
  text-decoration: none;
  background: linear-gradient(#ffe38f, var(--gold) 55%, var(--gold-deep));
  border: 2px solid #fff3c9;
  box-shadow: 0 4px 0 #a86f12, 0 10px 24px rgba(0, 0, 0, .25);
  border-radius: 999px;
  padding: 14px 26px;
  transition: transform .15s ease, box-shadow .15s ease;
}
.pill:hover { transform: translateY(-2px); box-shadow: 0 6px 0 #a86f12, 0 14px 28px rgba(0, 0, 0, .28); }
.pill:active { transform: translateY(2px); box-shadow: 0 2px 0 #a86f12, 0 6px 14px rgba(0, 0, 0, .25); }
.pill-small { font-size: 14px; padding: 9px 16px; box-shadow: 0 3px 0 #a86f12; }
.pill-big { font-size: clamp(17px, 1.6vw, 20px); padding: 16px 34px; }

/* ---------- top bar ---------- */
.bar {
  position: fixed; inset: 0 0 auto; z-index: 50;
  display: flex; align-items: center; gap: 24px;
  padding: 12px max(16px, env(safe-area-inset-right)) 12px max(16px, env(safe-area-inset-left));
  color: var(--on-dark);
  transition: background .3s ease, box-shadow .3s ease, backdrop-filter .3s ease;
}
.bar.is-solid { background: rgba(15, 40, 38, .94); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); box-shadow: 0 6px 24px rgba(0, 0, 0, .2); }
.bar-brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font: 600 18px/1 var(--display); text-shadow: 0 2px 8px rgba(0, 0, 0, .35); }
.bar-brand img { border-radius: 10px; box-shadow: 0 2px 8px rgba(0, 0, 0, .3); }
.bar-nav { display: flex; gap: 6px; margin-inline: auto; }
.bar-nav a { text-decoration: none; font: 600 15px/1 var(--display); padding: 10px 14px; border-radius: 999px; text-shadow: 0 2px 8px rgba(0, 0, 0, .35); }
.bar-nav a:hover { background: rgba(255, 255, 255, .14); }
.bar-right { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.bar-nav + .bar-right { margin-left: 0; }

.bgm {
  display: inline-flex; align-items: center; gap: 8px;
  font: 500 13px/1 var(--pixel); letter-spacing: .08em; color: var(--on-dark);
  background: rgba(15, 40, 38, .45); border: 1.5px solid rgba(255, 255, 255, .45);
  border-radius: 999px; padding: 8px 12px; cursor: pointer;
}
.bgm:hover { background: rgba(15, 40, 38, .7); }
.bgm-bars { display: inline-flex; align-items: flex-end; gap: 2px; height: 14px; }
.bgm-bars i { width: 3px; height: 4px; background: currentColor; border-radius: 1px; transition: height .2s; }
.bgm[aria-pressed="true"] { border-color: var(--gold); color: var(--gold); }
.bgm[aria-pressed="true"] .bgm-bars i { animation: eq 1s ease-in-out infinite; }
.bgm[aria-pressed="true"] .bgm-bars i:nth-child(2) { animation-delay: -.3s; }
.bgm[aria-pressed="true"] .bgm-bars i:nth-child(3) { animation-delay: -.6s; }
.bgm[aria-pressed="true"] .bgm-bars i:nth-child(4) { animation-delay: -.15s; }
@keyframes eq { 0%, 100% { height: 4px; } 50% { height: 14px; } }

/* ---------- hero ---------- */
.hero {
  position: relative;
  height: 100svh; min-height: 620px; max-height: 1100px;
  overflow: hidden;
  isolation: isolate;
  background: #f6c9a8;
  color: var(--on-dark);
}
.stage {
  position: absolute; left: 50%; top: 50%;
  width: var(--sw, max(100vw, 177.78svh));
  height: var(--sh, max(100svh, 56.25vw));
  transform: translate(-50%, -50%);
}
.layer { position: absolute; will-change: transform; }
.layer-bg { inset: 0; width: 100%; height: 100%; object-fit: cover; }
.layer-animals { inset: 0; }
.layer-animals img, .layer-fern, .layer-grimble {
  position: absolute; width: auto;
  filter: drop-shadow(0 14px 10px rgba(30, 50, 30, .3));
}
.a-turtle { left: 42.6%; bottom: 8.6%; height: 10.5%; }
.a-rabbit { left: 48.9%; bottom: 10.2%; height: 17%; animation: hop 3.6s ease-in-out infinite; }
.a-fox { left: 54.2%; bottom: 9.4%; height: 16%; }
.layer-fern { left: 15%; bottom: 2%; height: 54%; }
.layer-grimble { left: 77%; bottom: 8%; height: 40%; filter: drop-shadow(0 14px 10px rgba(30, 50, 30, .3)) brightness(.93); }
.layer-grimble { animation: lurk 7s ease-in-out infinite; transform-origin: 50% 100%; }
@keyframes hop { 0%, 80%, 100% { translate: 0 0; } 88% { translate: 0 -10%; } }
@keyframes lurk { 0%, 100% { rotate: 0deg; } 50% { rotate: -2.5deg; } }

.hero::after {
  content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background:
    radial-gradient(ellipse 60% 42% at 50% 22%, rgba(30, 40, 70, .28), transparent 70%),
    linear-gradient(to bottom, rgba(10, 30, 40, .35), transparent 22%, transparent 78%, rgba(15, 40, 38, .55));
}
.hero-copy, .hero-cta { position: absolute; left: 50%; translate: -50% 0; z-index: 2; text-align: center; width: min(92vw, 640px); }
.hero-copy { top: clamp(72px, 9vh, 110px); }
.wordmark { width: clamp(250px, 34vw, 520px); height: auto; margin-inline: auto; filter: drop-shadow(0 8px 18px rgba(20, 30, 50, .45)); }
.hero-tag {
  margin-top: clamp(6px, 1.2vh, 14px);
  font: 600 clamp(18px, 2vw, 26px)/1.25 var(--display);
  text-shadow: 0 2px 0 rgba(30, 50, 60, .45), 0 4px 18px rgba(20, 30, 50, .55);
}
.hero-cta { top: calc(clamp(72px, 9vh, 110px) + clamp(170px, 21vw, 330px)); display: grid; justify-items: center; gap: 16px; }
.stores { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.store {
  display: inline-flex; align-items: center; gap: 10px;
  background: rgba(10, 18, 18, .82); color: #fff;
  border: 1.5px solid rgba(255, 255, 255, .5);
  border-radius: 12px; padding: 7px 14px 7px 12px;
  font: 600 16px/1.05 var(--body); text-align: left;
}
.store small { display: block; font-size: 10.5px; font-weight: 600; opacity: .8; letter-spacing: .02em; }
.store-later { opacity: .72; }

.petals { position: absolute; inset: 0; z-index: 1; pointer-events: none; overflow: hidden; }
.petals i {
  position: absolute; top: -20px; width: 11px; height: 9px;
  background: var(--pink); border-radius: 80% 0 80% 0;
  box-shadow: inset -2px -2px 0 rgba(217, 102, 139, .45);
  animation: fall linear infinite;
  opacity: .9;
}
@keyframes fall {
  0% { transform: translate3d(0, 0, 0) rotate(0deg); }
  50% { transform: translate3d(-40px, 55vh, 0) rotate(220deg); }
  100% { transform: translate3d(30px, 110vh, 0) rotate(420deg); }
}

.scroll-cue { position: absolute; z-index: 2; right: 28px; bottom: 24px; width: 28px; height: 44px; border: 2px solid rgba(255, 255, 255, .8); border-radius: 16px; }
.scroll-cue span { position: absolute; left: 50%; top: 8px; width: 4px; height: 8px; margin-left: -2px; background: #fff; border-radius: 2px; animation: cue 1.8s ease-in-out infinite; }
@keyframes cue { 0% { opacity: 0; translate: 0 0; } 30% { opacity: 1; } 100% { opacity: 0; translate: 0 14px; } }

/* ---------- story ---------- */
.story { background: var(--ivory); padding: clamp(72px, 10vw, 128px) 0; position: relative; }
.panels { list-style: none; margin: 44px 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(14px, 2vw, 28px); }
.panel { background: var(--paper); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); border: 3px solid #fff; }
.panel img { width: 100%; aspect-ratio: 720 / 802; object-fit: cover; image-rendering: auto; }
.panel p { padding: 18px 20px 22px; font: 600 clamp(17px, 1.5vw, 20px)/1.35 var(--display); color: var(--ink); }
.panel .num { display: block; color: var(--pink-deep); margin-bottom: 8px; }
.panel:nth-child(2) { translate: 0 28px; }

/* ---------- characters ---------- */
.cast {
  position: relative; overflow: hidden;
  background: radial-gradient(ellipse 70% 80% at 30% 60%, var(--char-glow, #2f7f62) 0%, var(--forest) 70%);
  color: var(--on-dark);
  padding: clamp(72px, 9vw, 120px) 0;
  transition: background .5s ease;
}
.cast .eyebrow { color: var(--jade); }
.cast-inner { display: grid; grid-template-columns: 1fr; gap: 28px; }
.cast-tabs { display: flex; gap: 10px; flex-wrap: wrap; }
.cast-tabs button {
  display: inline-flex; align-items: center; gap: 10px;
  font: 600 16px/1 var(--display); color: var(--on-dark);
  background: rgba(255, 255, 255, .08); border: 2px solid rgba(255, 255, 255, .22);
  border-radius: 999px; padding: 6px 18px 6px 6px; cursor: pointer;
  transition: background .2s, border-color .2s, transform .2s;
}
.cast-tabs button img { width: 40px; height: 40px; object-fit: contain; object-position: 50% 15%; background: rgba(255, 248, 234, .9); border-radius: 50%; padding: 2px; }
.cast-tabs button:hover { background: rgba(255, 255, 255, .16); transform: translateY(-2px); }
.cast-tabs button[aria-selected="true"] { background: var(--ivory); color: var(--ink); border-color: var(--gold); }
.cast-panel { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: clamp(24px, 4vw, 64px); align-items: center; min-height: 520px; }
.cast-figure { --fig-h: clamp(360px, 46vw, 560px); margin: 0; display: grid; place-items: end center; height: var(--fig-h); position: relative; }
.cast-figure::after { content: ""; position: absolute; bottom: -6px; width: 60%; height: 26px; background: radial-gradient(closest-side, rgba(0, 0, 0, .35), transparent); z-index: 0; }
.cast-figure img { position: relative; z-index: 1; height: var(--fig-h); max-width: 100%; width: auto; object-fit: contain; filter: drop-shadow(0 16px 24px rgba(0, 0, 0, .3)); animation: rise .5s cubic-bezier(.2, .9, .3, 1.2); }
.cast-figure img.is-small { height: calc(var(--fig-h) * .55); }
@keyframes rise { from { opacity: 0; translate: 0 24px; scale: .96; } to { opacity: 1; translate: 0 0; scale: 1; } }
.cast-role { font: 500 15px/1 var(--pixel); color: var(--gold); letter-spacing: .1em; text-transform: uppercase; }
.cast-info h3 { font-size: clamp(48px, 7vw, 88px); margin: 10px 0 14px; font-weight: 700; }
.cast-line { font: 600 clamp(19px, 1.8vw, 24px)/1.3 var(--display); margin-bottom: 14px; color: #fff; }
.cast-info p:last-child { color: var(--on-dark-soft); font-size: 18px; max-width: 520px; }

/* ---------- gameplay ---------- */
.play { background: var(--cream); padding: clamp(72px, 10vw, 128px) 0; position: relative; }
.play-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(28px, 5vw, 72px); align-items: center; margin-top: 40px; }
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 18px; }
.steps li { display: grid; grid-template-columns: 52px 1fr; gap: 16px; background: var(--paper); border-radius: var(--radius); padding: 20px 22px; box-shadow: 0 8px 20px rgba(60, 50, 30, .08); border: 2px solid #fff; }
.steps .num { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 16px; background: var(--teal); color: #fff; font-size: 22px; clip-path: polygon(25% 3%, 75% 3%, 100% 50%, 75% 97%, 25% 97%, 0 50%); }
.steps li:nth-child(2) .num { background: var(--pink-deep); }
.steps li:nth-child(3) .num { background: var(--gold-deep); }
.steps h3 { margin-bottom: 6px; color: var(--ink); }
.steps p { color: var(--ink-soft); }
.phones { position: relative; display: flex; justify-content: center; align-items: center; min-height: 560px; }
.phone { width: min(46%, 270px); border-radius: 30px; border: 8px solid #1d2422; box-shadow: 0 24px 50px rgba(30, 30, 20, .3); background: #1d2422; }
.phone-a { rotate: -4deg; translate: 18px 0; z-index: 1; }
.phone-b { rotate: 5deg; translate: -18px 40px; }
.chips { list-style: none; padding: 0; margin: 48px 0 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.chips li { background: rgba(255, 255, 255, .6); border: 2px dashed rgba(42, 147, 132, .35); border-radius: 18px; padding: 16px 18px; color: var(--ink-soft); font-size: 15.5px; }
.chips strong { display: block; color: var(--ink); font: 600 17px/1.25 var(--display); margin-bottom: 4px; }

/* ---------- soundtrack ---------- */
.ost { background: linear-gradient(160deg, var(--forest-2), var(--forest) 70%); color: var(--on-dark); padding: clamp(72px, 9vw, 120px) 0; }
.ost .eyebrow { color: var(--jade); }
.ost .lead { color: var(--on-dark-soft); }
.ost-inner { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(28px, 5vw, 72px); align-items: center; }
.player { display: grid; grid-template-columns: 132px 1fr; gap: 20px; align-items: center; background: rgba(255, 248, 234, .07); border: 1.5px solid rgba(255, 255, 255, .16); border-radius: 26px; padding: 16px; box-shadow: 0 20px 40px rgba(0, 0, 0, .25); }
.player-art { width: 132px; height: 132px; object-fit: cover; object-position: 50% 30%; border-radius: 18px; }
.player.is-playing .player-art { animation: breathe 4s ease-in-out infinite; }
@keyframes breathe { 50% { scale: 1.03; } }
.player-kicker { font: 500 12.5px/1.2 var(--pixel); letter-spacing: .08em; text-transform: uppercase; color: var(--jade); }
.player-title { font: 700 30px/1.1 var(--display); margin: 6px 0 12px; }
.player-row { display: grid; grid-template-columns: 52px 1fr auto; gap: 12px; align-items: center; }
.play-btn { width: 52px; height: 52px; border-radius: 50%; border: 0; background: var(--gold); color: var(--ink); display: grid; place-items: center; cursor: pointer; box-shadow: 0 3px 0 #a86f12; }
.play-btn .i-pause, .player.is-playing .play-btn .i-play { display: none; }
.player.is-playing .play-btn .i-pause { display: inline; }
.seek { width: 100%; accent-color: var(--gold); }
.time { font: 500 13px/1 var(--pixel); color: var(--on-dark-soft); white-space: nowrap; }

/* ---------- follow ---------- */
.follow { background: linear-gradient(180deg, #fde3ea, var(--ivory)); padding: clamp(72px, 9vw, 120px) 0; position: relative; text-align: center; }
.follow-inner { display: grid; justify-items: center; }
.follow .eyebrow { color: var(--pink-deep); }
.socials { list-style: none; padding: 0; margin: 34px 0 0; display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }
.socials a {
  display: grid; gap: 3px; text-decoration: none;
  font: 600 18px/1 var(--display); color: var(--ink);
  background: var(--paper); border: 2px solid #fff; border-radius: 18px;
  padding: 14px 20px; min-width: 150px; box-shadow: 0 8px 20px rgba(120, 60, 80, .12);
  transition: transform .15s ease, box-shadow .15s ease;
}
.socials a:hover { transform: translateY(-3px); box-shadow: 0 12px 26px rgba(120, 60, 80, .18); }
.socials small { font: 600 13px/1.2 var(--body); color: var(--ink-soft); }
.fine { margin-top: 40px; max-width: 760px; font-size: 14.5px; color: var(--ink-soft); }
.fine a { color: var(--teal); }

/* ---------- footer ---------- */
.foot { background: var(--forest); color: var(--on-dark-soft); padding: 40px 0 calc(40px + env(safe-area-inset-bottom)); font-size: 14.5px; }
.foot-inner { display: flex; flex-wrap: wrap; align-items: center; gap: 18px 28px; }
.foot-inner img { width: 120px; height: auto; }
.foot nav { display: flex; flex-wrap: wrap; gap: 6px 18px; flex: 1; }
.foot a { text-decoration: none; }
.foot a:hover { color: #fff; text-decoration: underline; }

/* ---------- reveal on scroll ---------- */
.reveal { opacity: 0; translate: 0 28px; transition: opacity .7s ease, translate .7s cubic-bezier(.2, .8, .2, 1); }
.reveal.is-in { opacity: 1; translate: 0 0; }
.panel.reveal.is-in:nth-child(2) { translate: 0 28px; }
.phone-b.reveal.is-in { translate: -18px 40px; }
.phone-a.reveal.is-in { translate: 18px 0; }

/* ---------- responsive ---------- */
@media (max-width: 980px) {
  .bar-nav { display: none; }
  .chips { grid-template-columns: repeat(2, 1fr); }
  .play-grid, .ost-inner { grid-template-columns: 1fr; }
  .phones { min-height: 0; padding-bottom: 40px; }
}
@media (max-width: 720px) {
  body { font-size: 16px; }
  .bar { gap: 10px; }
  .bar-brand span, .scroll-cue { display: none; }
  .panels { grid-template-columns: 1fr; gap: 18px; }
  .panel { display: grid; grid-template-columns: 40% 1fr; align-items: center; }
  .panel img { height: 100%; aspect-ratio: auto; min-height: 160px; }
  .panel:nth-child(2), .panel.reveal.is-in:nth-child(2) { translate: 0 0; }
  .cast-panel { grid-template-columns: 1fr; min-height: 0; text-align: center; justify-items: center; }
  .cast-figure { --fig-h: 340px; }
  .cast-tabs { justify-content: center; }
  .cast-tabs button { padding-right: 14px; font-size: 15px; }
  .cast-head { text-align: center; }
  .chips { grid-template-columns: 1fr; }
  .player { grid-template-columns: 84px 1fr; }
  .player-art { width: 84px; height: 84px; }
  .player-title { font-size: 24px; }
  .player-row { grid-template-columns: 48px 1fr; }
  .time { grid-column: 1 / -1; }
  .socials a { min-width: 0; flex: 1 1 140px; }
}
/* Portrait screens see only the middle of the 16:9 stage: pull the cast in. */
@media (max-aspect-ratio: 4/5) {
  .layer-fern { left: 34.5%; bottom: 3%; height: 33%; }
  .layer-grimble { left: 57.4%; bottom: 7%; height: 29%; }
  .a-turtle { left: 45.6%; height: 7%; bottom: 8.8%; }
  .a-rabbit { left: 49.2%; height: 11.5%; }
  .a-fox { left: 52.1%; height: 10.8%; }
  .hero-copy { top: 84px; }
  .wordmark { width: min(78vw, 360px); }
  .hero-cta { top: calc(96px + min(78vw, 360px) * .48 + 64px); }
}
@media (max-aspect-ratio: 4/5) and (max-height: 700px) {
  .stores { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .a-rabbit, .layer-grimble, .scroll-cue span, .player.is-playing .player-art, .cast-figure img { animation: none; }
  .petals { display: none; }
  .reveal { opacity: 1; translate: none; transition: none; }
}
