/* Shapes Saga early access. Colours, slabs, logo and type follow the game's own UI
   (Assets/_Game/UI/Hud.uss and Front.uss, reference 1080 px wide; sizes here are about a third). */
@font-face { font-family: "Lexend"; src: url(/fonts/lexend-latin.woff2) format("woff2"); font-weight: 100 900; font-display: swap; }

:root {
  /* slab, from Hud.uss */
  --face: #F4EBDD;
  --face-edge: #E2D3BE;
  --face-top: #FFFDF8;
  --side: #C4AD92;
  --side-edge: #A8906F;
  --slab-shadow: rgba(84, 62, 44, .13);
  /* accent slab (Play) */
  --accent: #7FA88A;
  --accent-edge: #6E977A;
  --accent-top: #A3C4AB;
  --accent-side: #557A60;
  --accent-side-edge: #3F5E48;
  /* groove */
  --groove: #E2D3BE;
  --groove-top: #CDB89C;
  /* text */
  --ink: #2B2420;
  --ink-2: #5E4F44;
  --ink-3: #8C7B6B;
  --white: #FFFDF8;
  --gold: #E8961A;
  --brick: #C8553D;
  /* sky, from the game's home screen */
  --sky-top: #F6D8C4;
  --sky-low: #EFD8C8;
  --lawn: #A1C8A0;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100svh; display: flex; flex-direction: column;
  font-family: "Lexend", system-ui, sans-serif; font-size: 16px; line-height: 1.5; color: var(--ink-2);
  background: linear-gradient(180deg, var(--sky-top) 0%, var(--sky-low) 40%, #DCD9C0 70%, var(--lawn) 100%);
  overflow-x: clip;
}
img, video { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
button { font: inherit; color: inherit; }
h1, h2, p { margin: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------------------------------------------------------------- scene */
.scene { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.bg { position: absolute; left: -40px; top: -40px; width: calc(100% + 80px); height: calc(112% + 80px); max-width: none; object-fit: cover; object-position: 50% 62%; filter: blur(12px) saturate(1.08); will-change: transform; }
/* depth of field: the scene sits behind the UI the way the game blurs behind its cards */
/* The game's light: warm sun from the upper left, a soft sky fade at the top (Front.uss .sky-fade). */
.light {
  position: absolute; inset: 0;
  background:
    radial-gradient(60% 50% at 15% 0%, rgba(255, 238, 210, .7), rgba(255, 238, 210, 0) 70%),
    linear-gradient(180deg, rgba(246, 216, 196, .75) 0%, rgba(246, 216, 196, .2) 16%, rgba(246, 216, 196, 0) 30%),
    linear-gradient(0deg, rgba(58, 47, 40, .18), rgba(58, 47, 40, 0) 30%);
}
.cloud { position: absolute; width: 230px; opacity: .95; }
.k0 { top: 9%; left: -260px; animation: drift 80s linear -10s infinite; }
.k1 { top: 24%; left: -260px; width: 170px; animation: drift 110s linear -55s infinite; }
.k2 { top: 4%; left: -260px; width: 140px; opacity: .8; animation: drift 140s linear -100s infinite; }
.k3 { top: 34%; left: -260px; width: 200px; animation: drift 95s linear -75s infinite; }
@keyframes drift { to { translate: calc(100vw + 560px) 0; } }

/* ---------------------------------------------------------------- slab (the game's raised tile) */
.slab { position: relative; display: block; padding: 0 0 6px; border: 0; background: none; text-decoration: none; }
.slab::after { content: ""; position: absolute; left: 6px; right: 6px; bottom: -5px; height: 40%; border-radius: 16px; background: var(--slab-shadow); z-index: 0; }
.slab::before {
  content: ""; position: absolute; inset: 6px 0 0 0; z-index: 1; border-radius: 16px;
  background: var(--side); border-bottom: 2px solid var(--side-edge);
}
.slab > .slab-face {
  position: relative; z-index: 2; display: block; overflow: hidden; border-radius: 16px;
  background: var(--face); border: 2px solid var(--face-edge); border-top-color: var(--face-top);
  transition: translate .06s;
}
.gloss { position: absolute; left: 8px; right: 8px; top: 4px; height: 26%; max-height: 16px; border-radius: 10px; background: rgba(255,255,255,.4); pointer-events: none; }
button.slab { cursor: pointer; }
button.slab:active > .slab-face, .slab.pressed > .slab-face { translate: 0 4px; }
button.slab:active::after { opacity: .5; }
button.slab:focus-visible { outline: 3px solid #2F5DA8; outline-offset: 4px; border-radius: 18px; }
.slab.accent::before { background: var(--accent-side); border-color: var(--accent-side-edge); }
.slab.accent > .slab-face {
  background: var(--accent); border-color: var(--accent-edge); border-top-color: var(--accent-top);
  color: var(--white); font-weight: 700; text-shadow: 0 2px 0 rgba(63, 94, 72, .45);
}
.slab.accent .gloss { background: rgba(255,255,255,.22); }
.slab[aria-busy="true"] { pointer-events: none; filter: saturate(.5); }

/* ---------------------------------------------------------------- top */
.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; max-width: 1240px; margin: 0 auto; padding: 12px 16px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 700; font-size: 18px; color: var(--ink); }
.brand img { width: 44px; height: 44px; border-radius: 13px; box-shadow: 0 4px 0 var(--side), 0 8px 14px -6px rgba(84,62,44,.5); }
.chips { display: flex; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px 6px 8px; border-radius: 14px;
  background: var(--face); border: 2px solid var(--face-edge); border-top-color: var(--face-top);
  box-shadow: 0 4px 0 var(--side), 0 8px 12px -6px rgba(84,62,44,.35);
  font-size: 13px; font-weight: 700; color: var(--ink);
}
.chip img { width: 22px; height: 22px; }
.chip-green { padding-left: 12px; background: var(--accent); border-color: var(--accent-edge); border-top-color: var(--accent-top); color: var(--white); box-shadow: 0 4px 0 var(--accent-side), 0 8px 12px -6px rgba(63,94,72,.45); }
@media (max-width: 420px) { .brand span { display: none; } }

/* ---------------------------------------------------------------- stage */
.stage { flex: 1; width: 100%; max-width: 1240px; margin: 0 auto; padding: 0 16px 24px; display: grid; gap: 28px; align-items: center; }
.intro { text-align: center; }

.shapes-row { display: flex; justify-content: center; align-items: flex-end; gap: 6px; height: 70px; margin: 6px 0 8px; }
.shapes-row img { width: 64px; height: 64px; filter: drop-shadow(0 8px 6px rgba(84,62,44,.25)); }

/* The stone logo: face, outline and three depth layers, like Front.uss .stone-word */
.logo {
  font-weight: 700; font-size: clamp(76px, 22vw, 150px); line-height: .96; letter-spacing: -.03em;
  color: #FBF5EC; margin: 8px 0 .42em;
}
.logo-line { display: block; }
.logo .ch {
  display: inline-block;
  -webkit-text-stroke: 4px #B39A7A; paint-order: stroke fill;
  text-shadow:
    0 .041em 0 #D9C7B0, 0 .062em 0 #CEBAA1, 0 .082em 0 #C4AD92, 0 .102em 0 #B69E80, 0 .122em 0 #A8906F,
    0 .234em .1em rgba(84, 62, 44, .28);
}
/* like the game's result-score pill */
.lede { width: fit-content; font-size: clamp(16px, 4.4vw, 21px); font-weight: 600; color: var(--ink); max-width: 30ch; margin: 0 auto 24px; padding: 8px 20px; border-radius: 18px; background: rgba(255, 253, 248, .85); box-shadow: 0 4px 0 rgba(196, 173, 146, .55); }

/* the signup card */
.card { max-width: 520px; margin: 0 auto; text-align: left; }
.card > .slab-face { padding: 26px 30px 20px; border-radius: 22px; background: var(--face) url(/assets/card-paper.webp) center / 100% 100%; }
.card::before { border-radius: 22px; inset: 8px 0 0 0; }
.card { padding-bottom: 8px; }
.caption { font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); }
.card-title { font-size: clamp(20px, 5.4vw, 24px); font-weight: 700; color: var(--ink); text-shadow: 0 2px 0 #fff; margin: 2px 0 14px; letter-spacing: -.01em; }
.gift-row { list-style: none; margin: 0 0 14px; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.gift-row li { display: flex; align-items: center; gap: 8px; padding: 6px 10px 6px 6px; border-radius: 14px; background: rgba(255, 253, 248, .8); border: 2px solid var(--face-edge); font-size: 12.5px; line-height: 1.3; color: var(--ink-3); }
.gift-row b { display: block; font-size: 14px; color: var(--ink); }
.gift-row img { width: 40px; height: 40px; flex: none; filter: drop-shadow(0 3px 3px rgba(84,62,44,.25)); }
.field-row { display: grid; gap: 12px; }
.signup input[type="email"] {
  width: 100%; min-height: 52px; padding: 0 18px; border-radius: 16px;
  background: #EFE5D6; border: 0; border-top: 4px solid var(--groove-top); box-shadow: inset 0 0 0 2px var(--groove);
  font: 500 16px "Lexend", system-ui, sans-serif; color: var(--ink);
}
.signup input[type="email"]::placeholder { color: #A89C8E; }
.signup input[type="email"]:focus { outline: none; box-shadow: inset 0 0 0 2px var(--accent); background: #F7F0E5; }
.signup input[aria-invalid="true"] { box-shadow: inset 0 0 0 2px var(--brick); }
.go > .slab-face { min-height: 52px; display: flex; align-items: center; justify-content: center; padding: 0 24px; font-size: 18px; white-space: nowrap; }

.platform { display: flex; align-items: center; gap: 8px; border: 0; padding: 0; margin: 14px 0 6px; flex-wrap: wrap; }
.platform label { position: relative; }
.platform input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.platform span:not(.count) {
  display: inline-block; padding: 6px 14px; border-radius: 12px; font-size: 13px; font-weight: 700; color: var(--ink-3);
  background: #ECE6DD; border: 2px solid #CFC4B6;
}
.platform input:checked + span { color: var(--white); background: var(--accent); border-color: var(--accent-side); box-shadow: 0 3px 0 var(--accent-side); }
.platform input:focus-visible + span { outline: 3px solid #2F5DA8; outline-offset: 2px; }
.count { margin-left: auto; font-size: 12px; font-weight: 700; color: var(--accent-side); }
.check { display: flex; gap: 10px; align-items: flex-start; margin-top: 8px; font-size: 12.5px; line-height: 1.45; color: var(--ink-3); cursor: pointer; }
.check input { flex: none; width: 20px; height: 20px; margin: 0; accent-color: #557A60; }
.check a { color: var(--ink-2); font-weight: 700; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.turnstile:not(:empty) { margin-top: 10px; }
.form-msg { min-height: 1.3em; margin-top: 6px; font-size: 13px; font-weight: 700; color: var(--brick); }
.form-msg.ok { color: var(--accent-side); }

/* ---------------------------------------------------------------- Android phone (Pixel-style: even bezels, punch-hole camera) */
.device-wrap { display: grid; justify-items: center; gap: 22px; padding-bottom: 8px; }
.device {
  position: relative; display: block; width: min(260px, 68vw); aspect-ratio: 1080 / 2340; padding: 9px; border: 0; cursor: zoom-in;
  border-radius: 34px; background: linear-gradient(160deg, #3B3F3A, #1C1E1B 60%);
  box-shadow: 0 0 0 2px #5A5F58 inset, 0 36px 50px -26px rgba(43,36,32,.65), 0 12px 0 -6px rgba(84,62,44,.18);
}
.device::before, .device::after { content: ""; position: absolute; right: -4px; width: 4px; border-radius: 0 3px 3px 0; background: #2A2D29; }
.device::before { top: 22%; height: 9%; }
.device::after { top: 35%; height: 15%; }
.device-screen { display: block; position: relative; width: 100%; height: 100%; overflow: hidden; border-radius: 26px; background: var(--lawn); }
.device-screen video, .device-screen img { width: 100%; height: 100%; object-fit: cover; }
.punch { position: absolute; top: 18px; left: 50%; width: 11px; height: 11px; margin-left: -5.5px; border-radius: 50%; background: #0D0E0D; box-shadow: 0 0 0 2px rgba(255,255,255,.06); }
.device:focus-visible { outline: 3px solid #2F5DA8; outline-offset: 6px; }

.gallery-btn > .slab-face { display: flex; align-items: center; gap: 12px; padding: 8px 18px 8px 10px; font-size: 15px; font-weight: 700; color: var(--ink); }
.thumbs { display: flex; }
.thumbs img { width: 26px; height: 46px; object-fit: cover; border-radius: 6px; border: 2px solid #fff; box-shadow: 0 2px 4px rgba(84,62,44,.3); }
.thumbs img + img { margin-left: -8px; }
.thumbs img:nth-child(1) { rotate: -8deg; }
.thumbs img:nth-child(3) { rotate: 8deg; }

/* ---------------------------------------------------------------- footer */
.foot { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 18px; padding: 10px 16px 18px; font-size: 12.5px; color: #4E5E4C; }
.foot a { font-weight: 600; text-decoration: none; }
.foot a:hover { text-decoration: underline; }

/* ---------------------------------------------------------------- overlays: gallery and result card */
.overlay { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 16px; background: rgba(58, 47, 40, .55); backdrop-filter: blur(6px); }
.overlay[hidden] { display: none; }
.round > .slab-face { width: 48px; height: 48px; display: grid; place-items: center; border-radius: 16px; font-size: 30px; line-height: 1; font-weight: 700; color: var(--ink-2); }
.close { position: absolute; top: 14px; right: 14px; z-index: 2; }
.gallery { grid-template-rows: 1fr auto auto; gap: 14px; padding-top: 70px; }
.gallery-stage { display: flex; align-items: center; gap: 18px; min-height: 0; height: 100%; }
.device-lg { height: min(72svh, 760px); width: auto; rotate: 0deg !important; cursor: grab; touch-action: pan-y; }
.slides { list-style: none; margin: 0; padding: 0; display: flex; height: 100%; transition: translate .45s cubic-bezier(.2, .8, .2, 1); }
.slides li { flex: 0 0 100%; height: 100%; }
.gallery-caption { min-height: 1.5em; color: var(--white); font-weight: 600; text-align: center; text-shadow: 0 2px 6px rgba(0,0,0,.3); }
.gallery-thumbs { list-style: none; margin: 0; padding: 0 4px 4px; display: flex; gap: 8px; max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.gallery-thumbs::-webkit-scrollbar { display: none; }
.gallery-thumbs button { display: block; padding: 0; border: 2px solid transparent; border-radius: 9px; background: none; cursor: pointer; opacity: .6; transition: opacity .2s, translate .2s; }
.gallery-thumbs img { width: 38px; height: 70px; object-fit: cover; border-radius: 7px; }
.gallery-thumbs [aria-current="true"] { opacity: 1; border-color: var(--white); translate: 0 -4px; }
@media (max-width: 600px) {
  .gallery-stage { gap: 0; }
  .nav { position: absolute; top: 46%; z-index: 2; }
  .prev { left: 8px; }
  .next { right: 8px; }
  .device-lg { height: min(64svh, 640px); }
}

.result { width: min(400px, 100%); text-align: center; }
.result > .slab-face { padding: 26px 24px 22px; }
.stars { display: flex; justify-content: center; align-items: flex-end; gap: 4px; margin-bottom: 8px; }
.stars img { width: 64px; height: 64px; filter: drop-shadow(0 6px 4px rgba(84,62,44,.25)); }
.stars img:nth-child(2) { width: 84px; height: 84px; }
.result-title { font-size: 32px; font-weight: 700; color: var(--gold); text-shadow: 0 3px 0 #fff; letter-spacing: -.01em; }
.result p { margin: 8px 0 20px; color: var(--ink-2); font-size: 15px; }
.result .slab, .mini-card .slab.accent { width: 100%; }
.result .slab.accent > .slab-face { min-height: 52px; display: flex; align-items: center; justify-content: center; font-size: 18px; }

.noscript { position: fixed; bottom: 0; left: 0; right: 0; padding: 12px; background: var(--ink); color: #fff; text-align: center; font-size: 14px; }

/* ---------------------------------------------------------------- desktop */
@media (min-width: 900px) {
  .top { padding: 16px 28px; }
  .brand { font-size: 20px; }
  .stage { grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); gap: 32px; padding: 0 28px 20px; }
  .intro { padding-bottom: 20px; }
  .shapes-row { height: 84px; }
  .shapes-row img { width: 78px; height: 78px; }
  .logo { font-size: clamp(104px, 9vw, 136px); }
  .card { max-width: 560px; }
  .field-row { grid-template-columns: 1fr auto; }
  .device-wrap .device { width: clamp(250px, 20vw, 300px); rotate: 3deg; }
  .device-wrap { padding-top: 10px; }
  .cloud { width: 300px; }
  .k1 { width: 220px; }
  .k2 { width: 180px; }
}
@media (min-width: 900px) and (max-height: 960px) {
  .shapes-row { height: 64px; }
  .shapes-row img { width: 58px; height: 58px; }
  .logo { font-size: 88px; }
  .lede { margin-bottom: 20px; max-width: none; }
  .device-wrap .device { width: 228px; }
  .shapes-row { margin-top: 0; }
  .card > .slab-face { padding: 22px 30px 14px; }
  .card-title { margin-bottom: 10px; }
}

@media (min-width: 900px) and (max-height: 780px) {
  .top { padding-block: 8px; }
  .shapes-row { height: 44px; }
  .shapes-row img { width: 40px; height: 40px; }
  .logo { font-size: 78px; }
  .lede { font-size: 17px; margin-bottom: 10px; max-width: none; }
  .card > .slab-face { padding: 18px 26px 10px; }
  .caption { display: none; }
  .gift-row { margin-bottom: 10px; }
  .gift-row img { width: 32px; height: 32px; }
  .card-title { font-size: 20px; margin-bottom: 8px; }
  .platform { margin: 8px 0 2px; }
  .check { margin-top: 4px; font-size: 12px; }
  .device-wrap { gap: 14px; padding-top: 0; }
  .device-wrap .device { width: 200px; }
  .foot { padding-block: 4px 8px; }
}

/* ---------------------------------------------------------------- confirm, unsubscribe and 404 pages */
.mini { display: grid; place-items: center; padding: 16px; }
.mini-card { margin: auto; }
a.slab { color: inherit; }
.mini-card { width: min(440px, 100%); text-align: center; }
.mini-card > .slab-face { padding: 28px 22px 24px; border-radius: 22px; }
.mini-card .brand { justify-content: center; margin-bottom: 12px; }
.mini-card h1 { font-size: clamp(28px, 7vw, 34px); font-weight: 700; color: var(--ink); text-shadow: 0 3px 0 #fff; margin: 10px 0 8px; letter-spacing: -.01em; }
.mini-card p { margin-bottom: 18px; }
.mini-card .slab.accent > .slab-face { min-height: 52px; display: flex; align-items: center; justify-content: center; padding: 0 22px; font-size: 17px; }
.mini-shapes { display: flex; justify-content: center; gap: 2px; }
.mini-shapes img { width: 56px; height: 56px; animation: hop 2.4s ease-in-out infinite; }
.mini-shapes img:nth-child(2) { animation-delay: .15s; }
.mini-shapes img:nth-child(3) { animation-delay: .3s; }
.mini-shapes img:nth-child(4) { animation-delay: .45s; }
@keyframes hop { 0%, 60%, 100% { translate: 0 0; } 30% { translate: 0 -10px; } }
.share { margin-top: 14px; }
.share p { margin-bottom: 8px; font-size: 14px; }
.share-row { display: flex; gap: 8px; }
.share-row input { flex: 1; min-width: 0; min-height: 44px; padding: 0 12px; border-radius: 12px; border: 0; border-top: 3px solid var(--groove-top); background: #EFE5D6; font: 500 13px "Lexend", sans-serif; color: var(--ink); }
.share-row .slab > .slab-face { min-height: 44px; display: flex; align-items: center; padding: 0 16px; font-size: 15px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
