/* Glasshouse Gems: an enchanted greenhouse at twilight. Plum-violet sky, lantern gold, emerald glass, mahogany and brass.
   Layout: key-art hero, a playable jar rescue, alternating phone sections, hazards banner, FAQ, final call. */
:root {
  --sky: #f6efe4; --sky-2: #efe4d4; --panel: #fffaf2; --ink: #2a1712; --ink-2: #6b5244; --line: #e4d2bd;
  --gold: #e9a520; --gold-2: #b47612; --emerald: #1f9a57; --emerald-2: #137341; --violet: #7b3fb8; --cobalt: #2557d6;
  --ruby: #c8203a; --mahogany: #5a2716; --brass: #c79536;
  --night: #1a1030;
  --shadow: 0 10px 0 rgba(60, 30, 15, 0.12), 0 24px 50px rgba(60, 30, 15, 0.16);
  --display: "Fredoka", "Arial Rounded MT Bold", system-ui, sans-serif;
  --body: "Nunito Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --sky: #140c22; --sky-2: #1d1230; --panel: #26173a; --ink: #f7ecdf; --ink-2: #c9b6c9; --line: #3a2752;
    --gold: #f5b83a; --gold-2: #d99a22; --emerald: #2fc27a; --emerald-2: #1f9a5c; --violet: #b07cff; --cobalt: #6f9bff; --ruby: #ff5c74;
    --shadow: 0 10px 0 rgba(0, 0, 0, 0.35), 0 24px 50px rgba(0, 0, 0, 0.5); color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --sky: #140c22; --sky-2: #1d1230; --panel: #26173a; --ink: #f7ecdf; --ink-2: #c9b6c9; --line: #3a2752;
  --gold: #f5b83a; --gold-2: #d99a22; --emerald: #2fc27a; --emerald-2: #1f9a5c; --violet: #b07cff; --cobalt: #6f9bff; --ruby: #ff5c74;
  --shadow: 0 10px 0 rgba(0, 0, 0, 0.35), 0 24px 50px rgba(0, 0, 0, 0.5); color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--sky); color: var(--ink); font: 500 18px/1.6 var(--body); overflow-x: hidden; }
img { max-width: 100%; height: auto; }
a { color: var(--cobalt); }
.wrap { max-width: 1120px; margin: 0 auto; padding-left: max(20px, env(safe-area-inset-left, 0px)); padding-right: max(20px, env(safe-area-inset-right, 0px)); }
h1, h2, h3 { font-family: var(--display); font-weight: 700; text-wrap: balance; margin: 0; }
h1 { font-size: clamp(48px, 8vw, 92px); line-height: .98; letter-spacing: -.01em; }
h2 { font-size: clamp(32px, 4.6vw, 52px); line-height: 1.05; }
h3 { font-size: 22px; line-height: 1.2; }
.lede { font-size: 20px; color: var(--ink-2); max-width: 36em; margin: 16px 0 0; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; border-radius: 8px; }

/* nav */
.nav { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 10; background: color-mix(in srgb, var(--sky) 86%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.nav .wrap { display: flex; align-items: center; gap: 22px; height: 68px; }
.brand { display: flex; align-items: center; gap: 11px; font: 700 22px/1 var(--display); color: var(--ink); text-decoration: none; margin-right: auto; }
.brand img { border-radius: 11px; box-shadow: 0 2px 6px rgba(0,0,0,.25); }
.nav-links { display: flex; gap: 24px; }
.nav-links a { color: var(--ink); text-decoration: none; font-weight: 700; font-size: 16px; }
.nav-links a:hover { color: var(--emerald); }
@media (max-width: 760px) { .nav-links { display: none; } }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 52px; padding: 0 24px; border: 0; border-radius: 16px; cursor: pointer;
  background: linear-gradient(#3fd486, var(--emerald) 55%, #c99a1e 140%); color: #fff; font: 600 19px/1 var(--display); text-decoration: none;
  box-shadow: 0 5px 0 var(--emerald-2), 0 10px 24px rgba(31, 154, 87, .35); text-shadow: 0 1px 0 rgba(0,0,0,.25); position: relative; overflow: hidden; }
.btn::after { content: ""; position: absolute; inset: -40% auto -40% -30%; width: 26%; background: linear-gradient(90deg, transparent, rgba(255,255,240,.55), transparent); transform: skewX(-20deg); animation: sweep 3.2s ease-in-out infinite; }
@keyframes sweep { 0%, 55% { left: -30%; } 85%, 100% { left: 120%; } }
.btn:active { transform: translateY(3px); box-shadow: 0 2px 0 var(--emerald-2); }
.btn.gold { background: linear-gradient(#ffd56a, var(--gold) 60%, var(--gold-2)); color: #3a2205; text-shadow: none; box-shadow: 0 5px 0 #9a6410, 0 10px 24px rgba(233,165,32,.35); }
.btn.small { min-height: 42px; font-size: 16px; padding: 0 18px; }
.store { display: inline-flex; align-items: center; gap: 12px; min-height: 62px; padding: 0 24px 0 18px; border-radius: 18px; background: var(--ink); color: var(--sky); text-decoration: none; box-shadow: 0 5px 0 rgba(0,0,0,.28); }
.store svg { width: 28px; height: 28px; flex: none; }
.store small { display: block; font: 700 12px/1.1 var(--body); opacity: .75; }
.store strong { display: block; font: 700 22px/1.1 var(--display); }
.store.soon { cursor: default; }
.tag { display: inline-block; padding: 7px 14px; border-radius: 999px; background: var(--gold); color: #3a2205; font: 600 14px/1 var(--display); letter-spacing: .02em; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.chip { padding: 6px 13px; border-radius: 999px; border: 1px solid var(--line); background: var(--panel); font-weight: 700; font-size: 14px; color: var(--ink-2); }
.cta { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; margin-top: 28px; }

/* hero: full-bleed key art with the copy on the dusk side */
.hero { position: relative; isolation: isolate; color: #fff7ea; min-height: min(86vh, 760px); display: grid; align-items: center; overflow: hidden; background: var(--night); }
.hero .art { position: absolute; inset: 0 0 0 40%; z-index: -2; }   /* the jar sits right of the copy */
.hero .art img { width: 100%; height: 100%; object-fit: cover; object-position: 62% 50%; }
.hero::before { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(90deg, #140c22 0%, #140c22 40%, rgba(20,8,34,.62) 48%, rgba(20,8,34,0) 60%), linear-gradient(0deg, rgba(20,8,34,.6), transparent 26%); }
.hero .copy { padding-block: 70px 80px; max-width: 500px; }
.hero h1 .w { display: inline-block; }
.hero h1 .c1 { color: #7fb4ff; } .hero h1 .c2 { color: #ffc94a; } .hero h1 .c3 { color: #5fe39a; }
.hero .lede { color: #f1e2ff; }
.hero .chip { background: rgba(255,255,255,.1); border-color: rgba(255,255,255,.22); color: #f7ecdf; }
.hero .store { background: #fff7ea; color: #2a1712; }
.fireflies { position: absolute; inset: 0; z-index: -1; pointer-events: none; }
.fireflies i { position: absolute; width: 6px; height: 6px; border-radius: 50%; background: #ffd77a; box-shadow: 0 0 12px 4px rgba(255, 200, 90, .6); animation: drift 9s ease-in-out infinite; opacity: .8; }
@keyframes drift { 0%,100% { transform: translate(0,0); opacity: .2; } 50% { transform: translate(18px,-26px); opacity: 1; } }
@media (max-width: 820px) {
  .hero { min-height: 0; align-items: end; }
  .hero .art { inset: 0; }
  .hero .copy { max-width: none; }
  .hero .art img { object-position: 64% 0%; height: auto; min-height: 0; aspect-ratio: 3 / 2.4; }
  .hero::before { background: linear-gradient(0deg, rgba(20,8,34,.96) 0%, rgba(20,8,34,.85) 48%, rgba(20,8,34,.1) 78%); }
  .hero .copy { padding-top: clamp(260px, 52vw, 420px); padding-bottom: 46px; }
}

/* brass divider with rivets */
.brass { height: 18px; background: radial-gradient(circle at 12px 9px, #fff1c2 0 2px, #8a5a14 2.5px 3.5px, transparent 4px) 0 0/36px 18px, linear-gradient(#f0c766, #b27a1e 55%, #7a4d10); box-shadow: 0 2px 0 rgba(0,0,0,.25) inset, 0 -1px 0 rgba(255,255,255,.35) inset; }

section { padding: 96px 0; }
.band { background: var(--sky-2); }
.head { display: grid; gap: 14px; margin-bottom: 40px; }
.row { display: grid; grid-template-columns: 1.05fr .95fr; gap: 64px; align-items: center; }
.row.flip > :first-child { order: 2; }
.row > * { min-width: 0; }
@media (max-width: 860px) { .row { grid-template-columns: 1fr; gap: 40px; } .row.flip > :first-child { order: 0; } section { padding: 70px 0; } }

/* icon bullet list */
.list { list-style: none; padding: 0; margin: 28px 0 0; display: grid; gap: 18px; }
.list li { display: grid; grid-template-columns: 52px 1fr; gap: 14px; align-items: start; }
.list li img { width: 52px; height: 52px; filter: drop-shadow(0 3px 4px rgba(0,0,0,.3)); }
.list b { display: block; font: 600 20px/1.25 var(--display); }
.list span { color: var(--ink-2); }

/* phone frame */
.phone { position: relative; width: min(330px, 78vw); margin: 0 auto; aspect-ratio: 640 / 1382; border-radius: 46px; padding: 11px; background: linear-gradient(145deg, #3a3340, #0e0c12 60%, #2a2530); box-shadow: var(--shadow), 0 0 0 2px rgba(255,255,255,.06) inset; }
.phone img { display: block; width: 100%; height: 100%; object-fit: cover; border-radius: 36px; }
.phones { display: flex; justify-content: center; gap: 22px; }
.phones .phone { width: min(260px, 42vw); }
.phones .phone:nth-child(2) { transform: translateY(40px); }

/* playable demo */
.demo { background: linear-gradient(160deg, #3b1d12, #24100a); border: 3px solid var(--brass); border-radius: 28px; padding: 18px; color: #fbeedd; box-shadow: var(--shadow), 0 0 0 6px rgba(199,149,54,.18); max-width: 470px; margin: 0 auto; width: 100%; }
.demo-top { display: grid; grid-template-columns: auto 1fr; gap: 14px; align-items: center; margin-bottom: 14px; }
.jar { position: relative; width: 88px; height: 104px; border-radius: 44px 44px 16px 16px; border: 3px solid #e7c06a; background: rgba(170,220,255,.12); overflow: hidden; box-shadow: inset 0 0 18px rgba(255,255,255,.18); }
.jar img { position: absolute; left: 50%; bottom: 6px; width: 70px; height: 70px; transform: translateX(-50%); border-radius: 16px; transition: transform .3s; }
.jar .water { position: absolute; left: 0; right: 0; bottom: 0; height: 20%; background: linear-gradient(rgba(90,190,255,.75), rgba(30,110,220,.85)); transition: height .4s ease; z-index: 1; }
.jar.free img { transform: translate(-50%, -26px) rotate(-8deg) scale(1.08); }
.meters { display: grid; gap: 8px; }
.meter { display: grid; grid-template-columns: 70px 1fr 42px; gap: 8px; align-items: center; font: 600 15px/1 var(--display); }
.bar { height: 14px; border-radius: 99px; background: rgba(255,255,255,.12); overflow: hidden; }
.bar i { display: block; height: 100%; width: 0; border-radius: 99px; transition: width .35s ease; }
.m-key i { background: linear-gradient(90deg, #f5b83a, #ffe08a); }
.m-chain i { background: linear-gradient(90deg, #1f9a57, #6ff0a8); }
.m-water i { background: linear-gradient(90deg, #2557d6, #6fd0ff); }
.grid6 { display: grid; grid-template-columns: repeat(6, 1fr); gap: 4px; padding: 8px; border-radius: 18px; background: linear-gradient(#17221c, #0f1714); box-shadow: inset 0 4px 12px rgba(0,0,0,.6); touch-action: none; user-select: none; -webkit-user-select: none; }
.cell { aspect-ratio: 1; border: 0; padding: 3px; background: transparent; border-radius: 12px; cursor: pointer; transition: transform .16s ease, background .2s; }
.cell img { width: 100%; height: 100%; display: block; pointer-events: none; transition: transform .2s ease, opacity .2s ease, filter .2s; }
.cell.sel { background: rgba(255, 220, 120, .22); box-shadow: inset 0 0 0 2px rgba(255, 220, 120, .8); }
.cell.pop img { transform: scale(1.25); filter: brightness(1.8) saturate(1.2); opacity: 0; }
.cell.drop img { animation: drop .28s ease-out; }
@keyframes drop { from { transform: translateY(-60%); opacity: .2; } to { transform: none; opacity: 1; } }
.demo-msg { min-height: 28px; text-align: center; font: 600 17px/1.4 var(--display); margin: 12px 0 4px; }
.demo-actions { display: flex; justify-content: center; gap: 10px; }
@media (prefers-reduced-motion: reduce) { .btn::after, .fireflies i, .cell.drop img { animation: none; } .cell img, .jar img, .bar i, .jar .water { transition: none; } }

/* gems strip */
.gems { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 16px; }
.gem { background: var(--panel); border: 1px solid var(--line); border-radius: 22px; padding: 18px 14px; text-align: center; box-shadow: var(--shadow); }
.gem img { width: 84px; height: 84px; filter: drop-shadow(0 6px 8px rgba(0,0,0,.35)); }
.gem b { display: block; font: 600 19px/1.2 var(--display); margin-top: 8px; }
.gem span { display: block; color: var(--ink-2); font-size: 15px; line-height: 1.4; margin-top: 4px; }
@media (max-width: 860px) { .gems { grid-template-columns: repeat(2, minmax(0, 1fr)); } .gem:last-child { grid-column: 1 / -1; } }
.powerups { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 26px; }
.pu { display: flex; align-items: center; gap: 12px; background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 10px 16px 10px 10px; min-width: 0; }
.pu img { width: 56px; height: 56px; }
.pu b { font: 600 17px/1.2 var(--display); display: block; }
.pu span { color: var(--ink-2); font-size: 14px; }

/* hazards banner */
.banner { border-radius: 28px; overflow: hidden; box-shadow: var(--shadow); border: 3px solid var(--brass); }
.banner img { display: block; width: 100%; }
.hz { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; margin-top: 26px; }
.hz div { background: var(--panel); border: 1px solid var(--line); border-radius: 20px; padding: 18px 20px; }
.hz b { font: 600 20px/1.2 var(--display); display: block; margin-bottom: 4px; }
.hz span { color: var(--ink-2); font-size: 16px; }
@media (max-width: 760px) { .hz { grid-template-columns: 1fr; } }

/* comfort cards */
.comfort { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.cf { background: var(--panel); border: 1px solid var(--line); border-radius: 20px; padding: 20px; }
.cf h3 { font-size: 19px; margin-bottom: 6px; }
.cf p { margin: 0; color: var(--ink-2); font-size: 16px; }
@media (max-width: 900px) { .comfort { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px) { .comfort { grid-template-columns: 1fr; } }

/* faq */
.faq details { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 16px 20px; margin: 10px 0; }
.faq summary { cursor: pointer; font: 600 19px/1.3 var(--display); }
.faq p { margin: 10px 0 0; color: var(--ink-2); }

/* final */
.final { padding: 0; }
.final .inner { position: relative; isolation: isolate; text-align: center; color: #fff7ea; padding: 90px 20px; overflow: hidden; }
.final .inner::before { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(rgba(20,8,34,.55), rgba(20,8,34,.88)), var(--final-bg) center 40%/cover; }
.final h2 { font-size: clamp(36px, 6vw, 64px); }
.final p { font-size: 20px; font-weight: 700; color: #f1e2ff; margin: 10px 0 0; }
.final .cta { justify-content: center; }
.final .store { background: #fff7ea; color: #2a1712; }

/* share row (from Box Rush) */
.share { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 18px; justify-content: center; }
.share-label { font-size: .875rem; font-weight: 700; color: #f1e2ff; margin-right: 2px; }
.share-btn { display: inline-flex; align-items: center; gap: 7px; min-height: 40px; padding: 0 12px; border-radius: 999px; border: 1px solid rgba(255,255,255,.35); background: transparent; color: #fff7ea; font: inherit; font-size: .875rem; font-weight: 700; text-decoration: none; cursor: pointer; }
.share-btn svg { width: 16px; height: 16px; flex: none; }
.share-btn:hover { border-color: #fff7ea; }
.share-note { flex-basis: 100%; font-size: .875rem; font-weight: 700; color: #f1e2ff; }
.share-note:empty { display: none; }
.share-btn.icon { width: 40px; padding: 0; justify-content: center; }
.share-btn.icon svg { width: 18px; height: 18px; }
.share-btn.icon span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.fb-dialog { padding: 0; border: 1px solid var(--line); border-radius: 16px; background: var(--panel); color: var(--ink); width: min(440px, calc(100vw - 32px)); max-height: calc(100vh - 32px); overflow: auto; box-shadow: 0 24px 60px rgb(0 0 0 / .28); }
.fb-dialog::backdrop { background: rgb(10 6 20 / .6); }
.fb-inner { position: relative; padding: 22px 22px 20px; }
.fb-dialog h2 { font-size: 1.35rem; line-height: 1.2; margin: 0; padding-right: 36px; }
.fb-dialog p { margin: 8px 0 14px; color: var(--ink-2); font-size: .95rem; }
.fb-x { position: absolute; top: 10px; right: 10px; width: 40px; height: 40px; border: 0; border-radius: 999px; background: transparent; color: var(--ink-2); font-size: 26px; line-height: 1; cursor: pointer; }
.fb-post { margin: 0 0 16px; padding: 12px 14px; border-left: 3px solid var(--gold); background: var(--sky-2); border-radius: 0 10px 10px 0; font-size: .95rem; }
.fb-actions { display: grid; gap: 10px; }
.fb-go { display: flex; align-items: center; justify-content: center; min-height: 48px; border-radius: 12px; border: 1px solid var(--line); color: var(--ink); text-decoration: none; font-weight: 800; }
.fb-go.primary { background: var(--emerald); border-color: var(--emerald); color: #fff; }

/* docs (privacy, terms, support) */
.doc { padding: 56px 0 80px; }
.doc .wrap { max-width: 780px; }
.doc h1 { font-size: clamp(36px, 6vw, 52px); margin-bottom: 8px; }
.doc h2 { font-size: 26px; margin-top: 32px; }
.doc details { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 14px 18px; margin: 10px 0; }
.doc summary { cursor: pointer; font-weight: 800; }
.muted { color: var(--ink-2); }

footer { border-top: 1px solid var(--line); padding: 30px 0 44px; color: var(--ink-2); font-size: 15px; background: var(--sky); }
footer nav { display: flex; flex-wrap: wrap; gap: 18px; margin-bottom: 10px; }
footer a { color: var(--ink-2); }
