/* ==========================================================================
   Egg Dunk: storybook treetop
   The look of the game on the web: a bright sky that deepens as you climb,
   cream parchment cards outlined in chocolate ink, candy-bevel buttons,
   chunky Lilita One lettering. Palette from the game's Palette.cs.
   ========================================================================== */

:root {
  --ink: #3B2A20;
  --ink-soft: #6E4524;
  --twig: #A5733C;
  --cream: #FFF6E6;
  --cream-2: #FFEBC9;
  --parchment: #FFF9EE;

  --gold: #FFC93C;
  --orange: #FF9A3C;
  --leaf: #62C44A;
  --leaf-dark: #3E9A33;
  --red: #FF5E5E;
  --blue: #4FA8E8;
  --pink: #FFA6C1;

  --sky-top: #3F9BE8;
  --sky-mid: #8CCBFF;
  --sky-low: #CDEBFF;

  --text: #3B2A20;
  --dim: #6B5546;

  --display: "Lilita One", "Arial Rounded MT Bold", "Arial Black", system-ui, sans-serif;
  --body: "Nunito", system-ui, -apple-system, "Segoe UI", sans-serif;

  --wrap: 1160px;
  --gutter: 20px;
  --radius: 28px;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  min-height: 100vh;
  font: 600 1.0625rem/1.65 var(--body);
  color: var(--text);
  background-color: var(--sky-low);
  background-image: linear-gradient(180deg, var(--sky-top) 0, var(--sky-mid) 620px, var(--sky-low) 1500px);
  background-repeat: no-repeat;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* Soft sun glow behind the hero. */
body::before {
  content: "";
  position: absolute; inset: 0 0 auto 0; height: 900px; z-index: -1; pointer-events: none;
  background:
    radial-gradient(520px 420px at 18% 22%, rgba(255, 238, 180, .75), transparent 70%),
    radial-gradient(34vmax 22vmax at 90% 8%, rgba(255, 255, 255, .35), transparent 70%);
}

img { max-width: 100%; height: auto; display: block; }
a { color: #B8540F; text-underline-offset: .18em; }
a:hover { color: #8C3B05; }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; border-radius: 8px; box-shadow: 0 0 0 6px var(--gold); }

.wrap { width: min(var(--wrap), 100% - 2 * var(--gutter)); margin-inline: auto; }
.sr-only { position: absolute; 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(--gold); color: var(--ink); padding: 10px 16px; border-radius: 12px; font-weight: 800;
}
.skip:focus { top: 12px; }

/* ---------- Lettering ---------------------------------------------------- */
.toon {
  --face: var(--cream);
  --edge: var(--ink);
  margin: 0;
  font-family: var(--display);
  font-weight: 400;
  line-height: 1.08;
  letter-spacing: .01em;
  color: var(--face);
  -webkit-text-stroke: .2em var(--edge);
  paint-order: stroke fill;
  text-shadow: 0 .09em 0 var(--edge), 0 .14em .12em rgba(59, 42, 32, .35);
}
.toon.gold { --face: #FFC93C; }
.toon.orange { --face: #FF9A3C; }
.toon.green { --face: #8BE06F; }

.title-xl { font-size: clamp(2.3rem, 6vw, 4rem); }
.title-lg { font-size: clamp(2rem, 4.6vw, 3.1rem); }
.title-md { font-size: clamp(1.4rem, 2.4vw, 1.7rem); }

/* Headings that sit on a parchment card use plain ink lettering. */
.ink-title { font: 400 clamp(1.35rem, 2.2vw, 1.65rem)/1.15 var(--display); color: var(--ink); margin: 0 0 10px; letter-spacing: .01em; }

.kicker {
  display: inline-flex; align-items: center; gap: .55em;
  margin: 0 0 14px; padding: 6px 14px 7px;
  font: 400 .95rem/1 var(--display);
  letter-spacing: .08em; text-transform: uppercase;
  color: var(--ink);
  background: var(--cream); border: 3px solid var(--ink); border-radius: 999px;
  box-shadow: 0 3px 0 var(--ink);
}
.lede { color: var(--ink); font-size: clamp(1.08rem, 1.6vw, 1.22rem); max-width: 56ch; margin: 20px 0 0; font-weight: 700; }
.on-sky .lede, .lede.on-sky { text-shadow: 0 1px 0 rgba(255, 255, 255, .45); }

/* ---------- Parchment pieces ---------------------------------------------- */
.slab {
  position: relative;
  border-radius: var(--radius);
  background: linear-gradient(180deg, #FFFBF2, var(--cream) 60%, var(--cream-2));
  border: 4px solid var(--ink);
  box-shadow:
    inset 0 3px 0 rgba(255, 255, 255, .9),
    0 8px 0 var(--ink-soft),
    0 8px 0 4px var(--ink),
    0 24px 36px rgba(40, 70, 110, .28);
}
.slab.wood {
  background: linear-gradient(180deg, #B98245, #A5733C 55%, #8E5F2D);
  color: var(--cream);
}

.btn {
  --face: linear-gradient(180deg, #86E26A, #62C44A 55%, #4FB03B);
  --lip: #2F7A27;
  --fg: #fff;
  position: relative;
  display: inline-flex; align-items: center; justify-content: center; gap: .6em;
  min-height: 58px;
  padding: 12px 28px 14px;
  border: 4px solid var(--ink);
  border-radius: 999px;
  background: var(--face);
  color: var(--fg);
  font: 400 1.2rem/1.1 var(--display);
  letter-spacing: .03em;
  text-decoration: none;
  white-space: nowrap;
  text-shadow: 0 2px 0 rgba(59, 42, 32, .55);
  box-shadow: inset 0 4px 0 rgba(255, 255, 255, .5), 0 7px 0 var(--lip), 0 7px 0 4px var(--ink), 0 16px 22px rgba(40, 70, 110, .3);
  transition: transform .12s ease, box-shadow .12s ease, filter .2s;
  cursor: pointer;
  max-width: 100%;
}
.btn:hover { color: var(--fg); filter: brightness(1.06); }
.btn:active {
  transform: translateY(6px);
  box-shadow: inset 0 4px 0 rgba(255, 255, 255, .5), 0 1px 0 var(--lip), 0 1px 0 4px var(--ink), 0 4px 8px rgba(40, 70, 110, .3);
}
.btn svg { width: 1.3em; height: 1.3em; flex: none; filter: drop-shadow(0 2px 0 rgba(59, 42, 32, .5)); }
.btn.orange { --face: linear-gradient(180deg, #FFC24D, #FF9A3C 55%, #F0802A); --lip: #B85A12; }
.btn.cream { --face: linear-gradient(180deg, #FFFFFF, #FFF1D6 70%); --lip: #C9A878; --fg: var(--ink); text-shadow: none; }
.btn.cream svg { filter: none; }
.btn.small { min-height: 46px; padding: 8px 20px 10px; font-size: 1rem; }
.btn small { display: block; font: 800 .7rem/1.2 var(--body); letter-spacing: .06em; text-transform: uppercase; opacity: .92; text-shadow: none; }
.btn .stack { display: flex; flex-direction: column; align-items: flex-start; text-align: left; }

.chip {
  display: inline-flex; align-items: center; gap: .45em;
  padding: 8px 15px 9px;
  border-radius: 999px;
  border: 3px solid var(--ink);
  background: var(--cream);
  box-shadow: 0 4px 0 var(--ink);
  font: 400 1rem/1 var(--display);
  color: var(--ink);
  white-space: nowrap;
}
.chip b { color: #D9740B; font-weight: 400; }

/* A phone holding a real screenshot. */
.phone {
  position: relative;
  border-radius: 38px;
  padding: 9px;
  background: linear-gradient(180deg, #FFFBF2, #F3DDB4);
  border: 4px solid var(--ink);
  box-shadow: inset 0 2px 0 #fff, 0 10px 0 var(--ink-soft), 0 10px 0 4px var(--ink), 0 30px 50px rgba(40, 70, 110, .35);
}
.phone img { border-radius: 28px; width: 100%; aspect-ratio: 9 / 16; object-fit: cover; background: #8CCBFF; }

/* ---------- Header --------------------------------------------------------- */
.top {
  position: sticky; top: 0; z-index: 50;
  padding: 10px 0;
  background: rgba(255, 246, 230, .92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 4px solid var(--ink);
}
.top .wrap { display: flex; align-items: center; gap: 20px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); margin-right: auto; }
.brand img { width: 42px; height: 42px; border-radius: 12px; border: 3px solid var(--ink); }
.brand span { font: 400 1.35rem/1 var(--display); letter-spacing: .02em; }
.nav { display: flex; gap: 4px; }
.nav a {
  padding: 8px 14px; border-radius: 999px;
  color: var(--ink); text-decoration: none; font-weight: 800; font-size: .95rem;
}
.nav a:hover { background: rgba(255, 201, 60, .45); color: var(--ink); }
@media (max-width: 860px) { .nav { display: none; } }
@media (max-width: 380px) { .brand span { display: none; } }

/* ---------- Sections -------------------------------------------------------- */
section { position: relative; padding: clamp(64px, 10vw, 112px) 0; }
.section-head { max-width: 760px; margin-bottom: clamp(36px, 5vw, 56px); }
.section-head.center { margin-inline: auto; text-align: center; }
.section-head.center .lede { margin-inline: auto; }

.js .reveal { opacity: 0; transform: translateY(26px); transition: opacity .7s ease, transform .7s cubic-bezier(.2, .8, .2, 1); }
.js .reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .js .reveal { opacity: 1; transform: none; transition: none; }
}

/* ---------- Footer: the forest floor ---------------------------------------- */
.foot {
  margin-top: 40px;
  padding: 52px 0 40px;
  background: linear-gradient(180deg, #7A4E26, #5A3818);
  border-top: 6px solid var(--ink);
  color: #F1DDBF;
  font-size: .98rem;
}
.foot .wrap { display: grid; gap: 28px; grid-template-columns: 1.3fr 1fr 1fr; }
.foot h3 { margin: 0 0 12px; font: 400 1.05rem/1 var(--display); letter-spacing: .08em; text-transform: uppercase; color: var(--gold); }
.foot ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.foot a { color: #FFF6E6; text-decoration: none; font-weight: 700; }
.foot a:hover { color: var(--gold); }
.foot .studio { display: flex; gap: 14px; align-items: flex-start; }
.foot .studio img { width: 52px; height: 52px; border-radius: 14px; flex: none; }
.foot .studio p { margin: 0; }
.foot .studio strong { color: #fff; }
.foot .legal { grid-column: 1 / -1; padding-top: 22px; border-top: 2px solid rgba(255, 246, 230, .15); font-size: .88rem; margin: 0; }
@media (max-width: 760px) { .foot .wrap { grid-template-columns: 1fr 1fr; } .foot .studio { grid-column: 1 / -1; } }
