/* Cloudy Isle website — storybook pastel style (matches the game). No external resources. */

@font-face {
  font-family: "Nunito";
  src: url("/assets/fonts/nunito-extrabold.woff2") format("woff2");
  font-weight: 800;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light;
  --ink: #2f2150;          /* main text, plum */
  --ink-soft: #54476f;     /* secondary text (AA on cream and white) */
  --cream: #fff8ee;
  --paper: #ffffff;
  --sky: #6aa9ee;
  --sky-soft: #dceaff;
  --lilac: #c7b8f0;
  --lilac-soft: #efe9ff;
  --pink: #f6b3c0;
  --pink-soft: #ffe8ec;
  --peach: #fcc79a;
  --peach-soft: #fff0df;
  --leaf: #4f8a22;
  --leaf-soft: #e9f6dc;
  --sun: #ffb43a;
  --sun-deep: #e88a0c;
  --purple: #6a3fb5;
  --focus: #1c5fd6;
  --radius: 22px;
  --radius-lg: 32px;
  --shadow: 0 10px 30px rgba(74, 52, 120, 0.12), 0 2px 6px rgba(74, 52, 120, 0.08);
  --head: "Nunito", ui-rounded, "SF Pro Rounded", "Segoe UI", system-ui, -apple-system, sans-serif;
  --body: ui-rounded, "SF Pro Rounded", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --wrap: 1120px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font: 400 1.0625rem/1.65 var(--body);
  overflow-x: hidden;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--purple); text-underline-offset: 3px; }
a:hover { color: var(--ink); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 8px; }
h1, h2, h3 { font-family: var(--head); font-weight: 800; line-height: 1.15; margin: 0 0 0.5em; letter-spacing: -0.01em; }
h1 { font-size: clamp(2rem, 1.2rem + 3.6vw, 3.5rem); }
h2 { font-size: clamp(1.6rem, 1.1rem + 2vw, 2.4rem); }
h3 { font-size: 1.25rem; }
p { margin: 0 0 1em; }
ul { padding-left: 1.2em; }

.wrap { width: min(100% - 32px, var(--wrap)); margin-inline: auto; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 100; background: var(--paper); padding: 10px 16px; border-radius: 12px; box-shadow: var(--shadow); }
.skip:focus { top: 12px; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 248, 238, 0.86);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(106, 63, 181, 0.08);
}
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 68px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); font-family: var(--head); font-weight: 800; font-size: 1.3rem; }
.brand img { width: 42px; height: 42px; border-radius: 12px; box-shadow: 0 2px 8px rgba(74, 52, 120, 0.2); }
.brand:hover img { animation: squash 0.5s ease; }
.nav ul { list-style: none; display: flex; gap: 4px; margin: 0; padding: 0; }
.nav a { display: block; padding: 10px 12px; border-radius: 999px; text-decoration: none; color: var(--ink); font-weight: 600; }
.nav a:hover, .nav a[aria-current="page"] { background: var(--lilac-soft); }
.nav-toggle { display: none; }

@media (max-width: 860px) {
  .nav-toggle {
    display: inline-flex; align-items: center; justify-content: center;
    width: 48px; height: 48px; border: 0; border-radius: 14px; background: var(--lilac-soft); color: var(--ink); cursor: pointer;
  }
  .nav { position: absolute; left: 0; right: 0; top: 100%; background: var(--cream); box-shadow: var(--shadow); display: none; }
  .nav.open { display: block; animation: drop 0.25s ease; }
  .nav ul { flex-direction: column; padding: 8px 16px 16px; }
  .nav a { padding: 14px 12px; }
}
@media (max-width: 860px) {
  html:not(.js) .nav { position: static; display: block; box-shadow: none; }
  html:not(.js) .site-header .wrap { flex-wrap: wrap; }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 52px; padding: 12px 24px; border-radius: 999px; border: 0;
  font: 800 1.05rem/1.2 var(--head); text-decoration: none; cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: scale(0.96, 0.92); }
.btn-primary { background: linear-gradient(180deg, #ffc65a, var(--sun)); color: #3a2300; box-shadow: 0 4px 0 var(--sun-deep), var(--shadow); }
.btn-primary:hover { color: #3a2300; }
.btn-soft { background: var(--paper); color: var(--ink); box-shadow: var(--shadow); }

.store-row { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }
.store-badge {
  display: inline-flex; align-items: center; gap: 12px; min-height: 60px; padding: 10px 20px;
  border-radius: 16px; background: var(--ink); color: #fff; text-align: left;
}
.store-badge svg { width: 28px; height: 28px; flex: none; fill: currentColor; }
.store-badge small { display: block; font-size: 0.78rem; opacity: 0.85; }
.store-badge strong { display: block; font: 800 1.05rem/1.2 var(--head); }

/* ---------- Hero ---------- */
.hero {
  position: relative; overflow: hidden; isolation: isolate;
  background: #a9b8ec url("/assets/img/sky.webp") center top / cover no-repeat;
  padding: clamp(28px, 5vw, 64px) 0 0;
}
.hero-copy {
  position: relative; z-index: 5; text-align: center;
  width: min(100% - 32px, 760px); margin-inline: auto;
  background: rgba(255, 250, 242, 0.84);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  border-radius: var(--radius-lg); padding: clamp(20px, 3vw, 36px);
  box-shadow: var(--shadow);
  animation: pop-in 0.7s cubic-bezier(.2, 1.4, .4, 1) both;
}
.hero-copy .eyebrow { display: inline-block; font-weight: 700; color: var(--purple); background: var(--lilac-soft); padding: 4px 14px; border-radius: 999px; margin-bottom: 12px; }
.hero-copy p.lead { font-size: 1.15rem; color: var(--ink-soft); max-width: 36em; margin-inline: auto; }
.hero-copy .actions { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; margin-top: 8px; }

.scene { position: relative; z-index: 1; width: 100%; max-width: 1500px; margin: clamp(-170px, -10vw, -10px) auto 0; aspect-ratio: 16 / 7.4; }
.scene > * { position: absolute; }
.scene img { max-width: none; }
.scene .far { left: -10%; width: 125%; bottom: 30%; opacity: 0.55; }
.scene .island { left: 18%; width: 64%; bottom: 13%; animation: bob 7s ease-in-out infinite; }
.scene .island img { width: 100%; }
.scene .islet { width: 15%; animation: bob 6s ease-in-out infinite; }
.scene .islet-1 { left: 1.5%; bottom: 40%; animation-delay: -1.5s; }
.scene .islet-2 { left: 3%; bottom: 8%; width: 13%; animation-delay: -3s; animation-duration: 8s; }
.scene .islet-3 { right: 1.5%; bottom: 42%; animation-delay: -2.2s; animation-duration: 7.5s; }
.scene .islet-4 { right: 3.5%; bottom: 9%; width: 13%; animation-delay: -4s; }
.scene .guide { left: 43.2%; width: 7%; bottom: 47%; transform-origin: 50% 100%; animation: sway 4s ease-in-out infinite; }
.scene .near { left: -7%; width: 115%; bottom: -4%; z-index: 3; }
.hero::after { content: ""; position: absolute; inset: auto 0 0 0; height: 110px; z-index: 4; background: linear-gradient(to bottom, rgba(255, 248, 238, 0), var(--cream)); }

.cloud { position: absolute; left: 0; z-index: 1; opacity: 0.9; animation: drift linear infinite; will-change: transform; }
.cloud-a { top: 6%; width: 18%; max-width: 280px; animation-duration: 95s; animation-delay: -20s; }
.cloud-b { top: 30%; width: 14%; max-width: 220px; animation-duration: 120s; animation-delay: -70s; opacity: 0.75; }
.cloud-c { top: 55%; width: 20%; max-width: 300px; animation-duration: 140s; animation-delay: -10s; opacity: 0.8; }
.cloud-d { top: 16%; width: 12%; max-width: 180px; animation-duration: 110s; animation-delay: -95s; opacity: 0.7; }

.twinkle { position: absolute; z-index: 2; width: 14px; height: 14px; background: #fffbe6; clip-path: polygon(50% 0, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0 50%, 38% 38%); animation: twinkle 3.2s ease-in-out infinite; }
.t1 { top: 12%; left: 30%; }
.t2 { top: 22%; left: 78%; animation-delay: -1s; width: 10px; height: 10px; }
.t3 { top: 46%; left: 12%; animation-delay: -2s; }
.t4 { top: 38%; left: 88%; animation-delay: -0.5s; width: 18px; height: 18px; }
.t5 { top: 8%; left: 62%; animation-delay: -1.7s; width: 9px; height: 9px; }

@media (max-width: 700px) {
  .scene { aspect-ratio: 4 / 3.6; margin-top: 4px; }
  .scene .island { left: -6%; width: 112%; bottom: 14%; }
  .scene .guide { left: 42%; width: 13%; bottom: 47%; }
  .scene .islet-1, .scene .islet-3 { display: none; }
  .scene .islet-2 { width: 24%; left: -2%; bottom: 2%; }
  .scene .islet-4 { width: 24%; right: -2%; bottom: 3%; }
  .scene .far { bottom: 45%; width: 200%; left: -50%; }
  .cloud-a, .cloud-c { width: 34%; }
}

/* ---------- Sections ---------- */
section { padding: clamp(56px, 8vw, 104px) 0; position: relative; }
.section-head { text-align: center; max-width: 720px; margin: 0 auto clamp(28px, 4vw, 48px); }
.section-head p { color: var(--ink-soft); font-size: 1.1rem; }
.tint-lilac { background: linear-gradient(180deg, var(--cream), var(--lilac-soft) 18%, var(--lilac-soft) 82%, var(--cream)); }
.tint-sky { background: linear-gradient(180deg, var(--cream), var(--sky-soft) 18%, var(--sky-soft) 82%, var(--cream)); }
.tint-peach { background: linear-gradient(180deg, var(--cream), var(--peach-soft) 18%, var(--peach-soft) 82%, var(--cream)); }

.grid { display: grid; gap: 20px; }
.grid-regions { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }

.card {
  background: var(--paper); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow);
  transition: transform 0.25s cubic-bezier(.2, 1.4, .4, 1);
}
.card:hover { transform: translateY(-4px) rotate(-0.4deg); }
.card p { color: var(--ink-soft); margin-bottom: 0; }
.card .tag { display: inline-block; font-size: 0.85rem; font-weight: 700; padding: 2px 10px; border-radius: 999px; background: var(--leaf-soft); color: #2f5a10; margin-bottom: 8px; }

.region { display: grid; grid-template-columns: 64px 1fr; gap: 16px; align-items: start; }
.region img { width: 64px; height: auto; }
.region:hover img { animation: squash 0.6s ease; }
.region h3 { margin-bottom: 4px; }
.region .games { font-size: 0.95rem; margin-top: 8px; }

.pillars { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); margin-top: 32px; }
.pillar { display: flex; gap: 12px; align-items: flex-start; background: rgba(255, 255, 255, 0.7); border-radius: var(--radius); padding: 18px; }
.pillar .icon { flex: none; width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; background: var(--peach-soft); }
.pillar .icon svg { width: 24px; height: 24px; }
.pillar h3 { font-size: 1.05rem; margin-bottom: 2px; }
.pillar p { font-size: 0.95rem; color: var(--ink-soft); margin: 0; }

/* Guides */
.guide-card { text-align: center; padding-top: 16px; }
.guide-card .portrait { height: 260px; display: grid; place-items: end center; margin-bottom: 12px; background: radial-gradient(ellipse at 50% 92%, rgba(106, 63, 181, 0.14) 0 28%, transparent 30%); }
.guide-card .portrait img { max-height: 250px; width: auto; transform-origin: 50% 100%; animation: breathe 3.6s ease-in-out infinite; }
.guide-card:nth-child(2) .portrait img { animation-delay: -1.2s; }
.guide-card:nth-child(3) .portrait img { animation-delay: -2.4s; }
.guide-card:hover .portrait img { animation: hop 0.7s cubic-bezier(.3, 1.5, .5, 1); }
.guide-card .trait { color: var(--purple); font-weight: 700; }
.note { text-align: center; color: var(--ink-soft); margin-top: 28px; }

/* Journeys */
.journey { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: clamp(24px, 5vw, 64px); align-items: center; }
.journey .art { position: relative; }
.journey .art img { width: min(100%, 420px); margin-inline: auto; animation: bob 6s ease-in-out infinite; }
.chapters { counter-reset: ch; list-style: none; padding: 0; margin: 16px 0 0; display: grid; gap: 10px; }
.chapters li { counter-increment: ch; display: grid; grid-template-columns: 40px 1fr; gap: 12px; align-items: start; background: var(--paper); border-radius: 18px; padding: 12px 16px; box-shadow: 0 2px 8px rgba(74, 52, 120, 0.06); }
.chapters li::before { content: counter(ch); width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--lilac); font: 800 1rem var(--head); color: var(--ink); }
.chapters em { color: var(--ink-soft); font-style: normal; font-size: 0.92rem; }
.realms { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; padding: 0; list-style: none; }
.realms li { background: var(--paper); border-radius: 999px; padding: 6px 14px; font-weight: 600; font-size: 0.95rem; box-shadow: 0 2px 6px rgba(74, 52, 120, 0.06); }
@media (max-width: 800px) { .journey { grid-template-columns: 1fr; } }

/* Plans */
.plan { display: flex; flex-direction: column; }
.plan ul { margin: 12px 0 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.plan li { padding-left: 28px; position: relative; color: var(--ink-soft); }
.plan li::before { content: ""; position: absolute; left: 4px; top: 0.55em; width: 12px; height: 12px; border-radius: 50%; background: var(--leaf); box-shadow: 0 0 0 4px var(--leaf-soft); }
.plan.featured { outline: 3px solid var(--lilac); }
.plan .kicker { font-weight: 700; color: var(--purple); }
.calm { margin-top: 28px; background: var(--paper); border-radius: var(--radius); padding: 20px 24px; box-shadow: var(--shadow); }
.calm ul { margin: 8px 0 0; }

/* Download */
.download { text-align: center; }
.download .app-icon { width: 112px; height: 112px; border-radius: 28px; margin: 0 auto 16px; box-shadow: var(--shadow); animation: bob 5s ease-in-out infinite; }

/* FAQ */
.faq { max-width: 820px; margin-inline: auto; display: grid; gap: 12px; }
.faq details { background: var(--paper); border-radius: 18px; box-shadow: 0 2px 10px rgba(74, 52, 120, 0.07); }
.faq summary { cursor: pointer; list-style: none; padding: 18px 56px 18px 20px; font-weight: 700; position: relative; min-height: 56px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 18px; top: 50%; translate: 0 -50%; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--lilac-soft); font: 800 1.2rem var(--head); transition: rotate 0.25s ease; }
.faq details[open] summary::after { rotate: 45deg; }
.faq details > div { padding: 0 20px 18px; color: var(--ink-soft); }
.faq details > div p:last-child { margin-bottom: 0; }

/* ---------- Content pages (legal, support, delete) ---------- */
.page-hero { background: linear-gradient(180deg, var(--sky-soft), var(--cream)); padding: clamp(36px, 6vw, 72px) 0 24px; position: relative; overflow: hidden; }
.page-hero .wrap { position: relative; z-index: 1; width: min(100% - 32px, 820px); }
.page-hero p { color: var(--ink-soft); max-width: 44em; }
.page-hero .cloud { top: 10%; width: 200px; opacity: 0.6; }
.prose { max-width: 820px; margin-inline: auto; padding-bottom: 72px; }
.prose h2 { font-size: 1.6rem; margin-top: 1.8em; }
.prose h3 { margin-top: 1.4em; }
.prose li { margin-bottom: 0.35em; }
.prose .table-wrap { overflow-x: auto; margin: 0 0 1.2em; border-radius: 16px; box-shadow: 0 2px 10px rgba(74, 52, 120, 0.08); background: var(--paper); }
.prose table { border-collapse: collapse; width: 100%; min-width: 520px; font-size: 0.95rem; }
.prose th, .prose td { text-align: left; vertical-align: top; padding: 10px 14px; border-bottom: 1px solid #eee6f7; }
.prose th { background: var(--lilac-soft); font-weight: 700; }
.prose tr:last-child td { border-bottom: 0; }
.prose section:not(.box) { padding: 0; margin-bottom: 8px; }
.box { background: var(--paper); border-radius: var(--radius); padding: 20px 24px; box-shadow: var(--shadow); margin: 0 0 20px; }
.box h2:first-child, .box h3:first-child { margin-top: 0; }
.box > :last-child { margin-bottom: 0; }
.draft-banner { background: #fff3c4; border: 2px dashed #c79100; border-radius: 16px; padding: 14px 18px; margin: 0 0 24px; color: #4a3500; }
mark.ph { background: #fff0a8; color: #4a3500; border-bottom: 2px dashed #c79100; padding: 0 3px; border-radius: 4px; font-weight: 600; }
.toc { columns: 2 220px; list-style: none; padding: 0; margin: 0; }
.toc li { break-inside: avoid; padding: 2px 0; }
.steps { counter-reset: st; list-style: none; padding: 0; display: grid; gap: 10px; }
.steps li { counter-increment: st; position: relative; padding-left: 44px; min-height: 32px; }
.steps li::before { content: counter(st); position: absolute; left: 0; top: 0; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--sun); font: 800 0.95rem var(--head); color: #3a2300; }

/* Form */
.form { display: grid; gap: 16px; }
.field label { display: block; font-weight: 700; margin-bottom: 6px; }
.field .hint { display: block; font-weight: 400; font-size: 0.9rem; color: var(--ink-soft); margin-top: 4px; }
.field input[type="email"], .field select, .field textarea {
  width: 100%; min-height: 52px; padding: 12px 14px; border-radius: 14px; border: 2px solid #d8cdef; background: #fff;
  font: inherit; color: var(--ink);
}
.field textarea { min-height: 110px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--purple); outline: none; box-shadow: 0 0 0 4px rgba(106, 63, 181, 0.18); }
.check { display: flex; gap: 12px; align-items: flex-start; }
.check input { width: 24px; height: 24px; margin-top: 2px; flex: none; accent-color: var(--purple); }
.form-status { min-height: 1.5em; font-weight: 600; }
.form-status.error { color: #a1123a; }
.form-status.ok { color: #2f5a10; }

/* 404 */
.lost { text-align: center; padding: clamp(48px, 8vw, 96px) 0; }
.lost img { width: 200px; margin: 0 auto 16px; animation: sway 4s ease-in-out infinite; transform-origin: 50% 100%; }

/* ---------- Footer ---------- */
.site-footer { background: var(--ink); color: #eae4f7; padding: 48px 0 32px; margin-top: 24px; }
.site-footer a { color: #fff; }
.site-footer .cols { display: grid; gap: 24px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.site-footer h2 { font-size: 1.05rem; color: #fff; margin-bottom: 10px; }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.site-footer ul a { display: inline-block; padding: 4px 0; }
.site-footer .small { font-size: 0.9rem; color: #cfc5e6; margin-top: 28px; border-top: 1px solid rgba(255, 255, 255, 0.15); padding-top: 20px; }
.site-footer mark.ph { background: #fff0a8; }

/* ---------- Motion ---------- */
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-2.2%); } }
@keyframes sway { 0%, 100% { transform: rotate(-2deg); } 50% { transform: rotate(2deg); } }
@keyframes breathe { 0%, 100% { transform: scale(1, 1); } 50% { transform: scale(1.015, 0.985); } }
@keyframes hop { 0% { transform: scale(1); } 25% { transform: scale(1.06, 0.92); } 55% { transform: translateY(-14px) scale(0.96, 1.06); } 100% { transform: none; } }
@keyframes squash { 0% { transform: scale(1); } 30% { transform: scale(1.12, 0.88); } 60% { transform: scale(0.94, 1.08); } 100% { transform: scale(1); } }
@keyframes drift { from { transform: translateX(-30vw); } to { transform: translateX(130vw); } }
@keyframes twinkle { 0%, 100% { opacity: 0.2; transform: scale(0.6) rotate(0deg); } 50% { opacity: 1; transform: scale(1) rotate(20deg); } }
@keyframes pop-in { from { opacity: 0; transform: translateY(16px) scale(0.96); } to { opacity: 1; transform: none; } }
@keyframes drop { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }

.reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.6s ease, transform 0.6s cubic-bezier(.2, 1.2, .4, 1); }
.reveal.in { opacity: 1; transform: none; }
html:not(.js) .reveal { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
  .cloud { display: none; }
}
@media print {
  .site-header, .site-footer, .hero .scene, .cloud { display: none; }
  body { background: #fff; }
}
