/* The game's own font, served from this site (no third-party font service). */
@font-face { font-family: "Baloo 2"; src: url("/fonts/Baloo2.ttf") format("truetype"); font-weight: 400 800; font-display: swap; }
/* Look: built from the game's own UI graphics (gemhop/ui/, drawn by Tools/Branding/GemHopUISprites.ps1 in the
   game project). Buttons, cards, windows and banners are 9-sliced like in the game, with the same borders:
   button 44 50 58 50, window 54 54 62 54, card 34 34 40 34, banner 0 46 (top right bottom left, in pixels).
   The sprites are drawn at twice the size they are shown at. Background: the game's mint-to-sand backdrop. */
:root {
  --mint: #cde6d9;          /* top of the game's backdrop */
  --sand: #dcc4a1;
  --cream: #fff8ec;
  --panel-lo: #f4e9d7;
  --ink: #2b211c;           /* the outline every gem, cell and button has */
  --text: #2b211c;
  --muted: #6b5d52;
  --green-deep: #2f8f35;
  --blue: #269eff;
  --gold: #ffcc1a;
  --display: "Baloo 2", "Trebuchet MS", system-ui, sans-serif;
  --body: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --ui: "/gemhop/ui/";
  color-scheme: light;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; background: #e9dcc6; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  background:
    radial-gradient(900px 520px at 75% -60px, rgba(255, 255, 255, .6), transparent 70%),
    linear-gradient(180deg, var(--mint) 0, #dfe6d2 520px, #eadbc2 1100px, #e9dcc6 100%);
  background-repeat: no-repeat;
  color: var(--text);
  font: 400 1.0625rem/1.6 var(--body);
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  overflow-x: hidden;
}
.wrap { max-width: 1080px; margin: 0 auto; }
h1, h2, h3 { font-family: var(--display); line-height: 1.05; text-wrap: balance; margin: 0; font-weight: 800; }
p { margin: 0; }
a { color: #1f6fc4; text-underline-offset: 3px; }
a:hover { color: #0f4f96; }
a:focus-visible, .button:focus-visible, summary:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; border-radius: 10px; }
section[id] { scroll-margin-top: 20px; }

/* ---------- Game UI pieces ---------- */
/* text on coloured game buttons and banners: white with a dark outline, like in the game */
.on-color, .button, .eyebrow, .step-num, .faq summary::after {
  color: #fff;
  text-shadow: -1.5px -1.5px 0 var(--ink), 1.5px -1.5px 0 var(--ink), -1.5px 1.5px 0 var(--ink), 1.5px 1.5px 0 var(--ink), 0 3px 0 var(--ink);
}
/* buttons: the emerald-cut button sprites */
.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px; text-decoration: none; cursor: pointer;
  font: 800 1.2rem/1 var(--display); letter-spacing: .01em;
  background: none; border-style: solid; border-width: 22px 25px 29px 25px;
  border-image: url("/gemhop/ui/Button_Green.png") 44 50 58 50 fill;
  padding: 2px 4px 0; min-height: 76px;
  transition: transform .08s, filter .08s;
}
.button:hover { color: #fff; filter: brightness(1.06); }
.button:active { transform: translateY(3px) scale(.98); filter: brightness(.96); }
.button.ghost { border-image-source: url("/gemhop/ui/Button_Gray.png"); }
.button.blue { border-image-source: url("/gemhop/ui/Button_Blue.png"); }
.button img { width: 30px; height: 30px; margin: -4px 0 -2px; }
/* panels: the card sprite (small panels) and the window sprite (big ones) */
.card {
  background: none; border-style: solid; border-width: 17px 17px 20px 17px;
  border-image: url("/gemhop/ui/Card.png") 34 34 40 34 fill;
}
.window {
  background: none; border-style: solid; border-width: 27px 27px 31px 27px;
  border-image: url("/gemhop/ui/Window.png") 54 54 62 54 fill;
}
/* small labels above the headings: the green banner */
.eyebrow {
  justify-self: start; display: inline-block; font: 800 .9rem/1 var(--display); letter-spacing: .12em; text-transform: uppercase;
  border-style: solid; border-width: 0 16px; border-image: url("/gemhop/ui/Banner_Green.png") 0 46 fill / 0 16px;
  padding: 11px 6px 9px;
}
@media (max-width: 859px) { .hero .eyebrow { justify-self: center; } }

/* ---------- Top bar: back to the studio, jump links ---------- */
.topbar { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding-top: 18px; }
.studio-link { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--muted); font: 700 1rem/1 var(--display); }
.studio-link .back-btn { width: 46px; height: 50px; background: url("/gemhop/ui/Circle_Gray.png") center top / 100% auto no-repeat; display: grid; place-items: start center; padding-top: 9px; }
.studio-link .back-btn img { width: 26px; height: 26px; }
.studio-link:hover { color: var(--text); }
.studio-link:hover .back-btn { filter: brightness(1.06); }
.jump { display: flex; gap: 4px; }
.jump a { color: var(--muted); text-decoration: none; font: 700 .98rem/1 var(--display); padding: 10px 12px 8px; border-radius: 12px; }
.jump a:hover { color: var(--text); background: rgba(255,255,255,.5); }
@media (max-width: 1000px) { .jump { display: none; } }
.studio-link span, .jump a { white-space: nowrap; }

/* ---------- Hero: words left, a little board with a hopping gem right ---------- */
.hero { display: grid; gap: 28px; align-items: center; padding-block: 28px 8px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 860px) { .hero { grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); padding-block: 44px 16px; } }
.hero-text { display: grid; gap: 20px; justify-items: start; }
@media (max-width: 859px) { .hero-text { justify-items: center; text-align: center; } }
.app-row { display: flex; align-items: center; gap: 14px; }
.app-row img { width: 64px; height: 64px; border-radius: 16px; border: 3px solid var(--ink); box-shadow: 0 5px 0 var(--ink); }
.app-row span { color: var(--muted); font: 600 .98rem/1.3 var(--display); text-align: left; }
.app-row b { display: block; color: var(--text); font-size: 1.1rem; }
.wordmark { margin: 0; line-height: 0; }
.wordmark img { width: min(100%, 520px); height: auto; margin: -9% 0 -4% -3%; }
@media (max-width: 859px) { .wordmark img { margin-inline: auto; } }
.tagline { font: 600 clamp(1.15rem, 3vw, 1.4rem)/1.4 var(--display); color: var(--muted); max-width: 32ch; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; }
@media (max-width: 859px) { .actions { justify-content: center; } }

.board { width: 100%; max-width: 440px; margin-inline: auto; display: block; overflow: visible; filter: drop-shadow(0 14px 18px rgba(80, 55, 30, .18)); }
/* the hop: the gem rises from the left cell, arcs over the middle gem and lands on the right as the next level */
.hop { animation: hop 4.2s cubic-bezier(.45, 0, .4, 1) infinite; }
@keyframes hop {
  0%, 18% { transform: translate(0, 0); }
  32% { transform: translate(60px, -92px) scale(1.12); }
  46% { transform: translate(120px, -110px) scale(1.16); }
  62%, 92% { transform: translate(240px, 0); }
  100% { transform: translate(240px, 0); opacity: 0; }
}
.hop .before { animation: before 4.2s linear infinite; }
.hop .after { animation: after 4.2s linear infinite; }
@keyframes before { 0%, 60% { opacity: 1; } 61%, 100% { opacity: 0; } }
@keyframes after { 0%, 60% { opacity: 0; } 61%, 100% { opacity: 1; } }
.jumped { transform-origin: 180px 180px; animation: jumped 4.2s ease-in infinite; }
@keyframes jumped { 0%, 44% { transform: scale(1); opacity: 1; } 52% { transform: scale(1.25); opacity: 0; } 92% { transform: scale(.6); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }
.target { animation: target 4.2s linear infinite; }
@keyframes target { 0%, 10% { opacity: 0; } 18%, 58% { opacity: 1; } 64%, 100% { opacity: 0; } }
.sparkle { transform-box: fill-box; transform-origin: center; animation: twinkle 4.2s ease-out infinite; opacity: 0; }
@keyframes twinkle { 0%, 60% { opacity: 0; transform: scale(.3); } 66% { opacity: 1; transform: scale(1.1); } 80%, 100% { opacity: 0; transform: scale(.6); } }
@media (prefers-reduced-motion: reduce) {
  .hop, .hop .before, .hop .after, .jumped, .target, .sparkle { animation: none; }
  .hop { transform: translate(120px, -110px) scale(1.16); }
  .hop .after { opacity: 0; }
  .target { opacity: 1; }
}

/* ---------- Sections ---------- */
section { padding-block: 80px 0; }
.section-head { display: grid; gap: 14px; margin-bottom: 30px; }
.section-head h2 { font-size: clamp(2rem, 6vw, 3rem); }
.lead { color: var(--muted); max-width: 62ch; }

/* how to play: a real sequence, so it is numbered on the game's square icon button */
.steps { display: grid; gap: 22px; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); counter-reset: step; }
.step { padding: 8px 10px 6px; display: grid; gap: 12px; align-content: start; position: relative; }
.step-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
.step-top svg { width: 76px; height: 76px; }
.step-num {
  width: 56px; height: 60px; display: grid; place-items: start center; padding-top: 11px;
  font: 800 1.6rem/1 var(--display);
  background: url("/gemhop/ui/Circle_Green.png") center top / 100% auto no-repeat;
}
.step-num::before { counter-increment: step; content: counter(step); }
.step h3 { font-size: 1.55rem; }
.step p { color: var(--muted); }

/* the gem ladder: five levels side by side, arrows between them */
.ladder { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; padding: 12px 6px 6px; align-items: start; }
.rung { display: grid; justify-items: center; gap: 8px; text-align: center; position: relative; }
.rung svg { width: min(88px, 100%); aspect-ratio: 1; }
.rung b { font: 800 1.15rem/1.1 var(--display); }
.rung span { color: var(--muted); font-size: .9rem; line-height: 1.3; }
.rung + .rung::before {
  content: "›"; position: absolute; left: -12px; top: 22px; font: 800 1.8rem/1 var(--display); color: #b8a383;
}
@media (max-width: 620px) {
  .ladder { gap: 4px; padding-inline: 0; }
  .rung b { font-size: .95rem; }
  .rung span { display: none; }
  .rung + .rung::before { left: -7px; font-size: 1.3rem; }
}
.ladder-note { margin-top: 26px; }

/* game facts: big gold numbers on cards */
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 16px; }
.fact { padding: 6px 4px 2px; text-align: center; display: grid; gap: 6px; justify-items: center; }
.fact b {
  display: block; font: 800 3rem/1 var(--display); color: var(--gold); font-variant-numeric: tabular-nums;
  -webkit-text-stroke: .07em var(--ink); paint-order: stroke fill; text-shadow: 0 .06em 0 var(--ink);
}
.fact span { color: var(--muted); font-size: .95rem; }
.facts + .lead { margin-top: 26px; }

/* release: the key art in the game's window, with the store note below */
.release img.art { width: 100%; height: auto; display: block; border: 3px solid var(--ink); border-radius: 14px; }
.release-body { padding: clamp(14px, 3vw, 24px) 4px 0; display: flex; flex-wrap: wrap; gap: 20px 32px; align-items: center; justify-content: space-between; }
.release-body .section-head { margin: 0; }
.store {
  display: inline-flex; align-items: center; gap: 12px; padding: 12px 20px; border-radius: 16px;
  background: var(--ink); border: 2px solid #4a3d34; color: #fff; font: 700 1rem/1.15 var(--display);
}
.store svg { width: 30px; height: 30px; flex: none; }
.store small { display: block; color: #d8cabb; font-weight: 600; font-size: .8rem; letter-spacing: .06em; text-transform: uppercase; }

/* support: questions on game cards that open on tap (square icon button as the toggle) + contact card */
.support { display: grid; gap: 24px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 860px) { .support { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); align-items: start; } }
.faq { display: grid; gap: 10px; }
.faq details {
  border-style: solid; border-width: 17px 17px 20px 17px;
  border-image: url("/gemhop/ui/Card.png") 34 34 40 34 fill;
}
.faq summary {
  cursor: pointer; list-style: none; padding: 0 52px 0 4px; position: relative; min-height: 40px; display: flex; align-items: center;
  font: 700 1.12rem/1.3 var(--display);
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+"; position: absolute; right: -2px; top: 50%; transform: translateY(-50%);
  width: 40px; height: 43px; display: grid; place-items: start center; padding-top: 5px;
  background: url("/gemhop/ui/Circle_Blue.png") center top / 100% auto no-repeat; font: 800 1.45rem/1 var(--display);
}
.faq details[open] summary::after { content: "–"; background-image: url("/gemhop/ui/Circle_Purple.png"); }
.faq summary:focus-visible { outline-offset: 4px; }
.faq .answer { padding: 10px 4px 2px; color: var(--muted); display: grid; gap: 8px; }
.faq .answer b { color: var(--text); }
.path { font-family: var(--display); font-weight: 600; color: var(--text); white-space: nowrap; background: rgba(43, 33, 28, .08); padding: 1px 7px; border-radius: 7px; }
.contact { padding: 10px 8px 6px; display: grid; gap: 14px; }
@media (min-width: 860px) { .contact { position: sticky; top: 20px; } }
.contact h3 { font-size: 1.55rem; display: flex; align-items: center; gap: 10px; }
.contact h3 img { width: 36px; height: 36px; }
.contact p, .contact li { color: var(--muted); }
.contact ul { margin: 0; padding-left: 1.2em; display: grid; gap: 4px; }
.mail { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.mail code {
  font: 700 1.02rem/1.2 var(--body); color: var(--text); user-select: all; overflow-wrap: anywhere;
  background: var(--panel-lo); border: 2px solid var(--ink); padding: 11px 12px;
  clip-path: polygon(10px 0, calc(100% - 10px) 0, 100% 10px, 100% calc(100% - 10px), calc(100% - 10px) 100%, 10px 100%, 0 calc(100% - 10px), 0 10px);
}
.copy { font-size: .95rem; min-height: 54px; border-width: 15px 17px 20px 17px; padding: 1px 2px 0; }
.copy-status { color: var(--green-deep); font-size: .9rem; min-height: 1.2em; }

/* privacy policy: long-form text in the game's window */
.policy { padding: clamp(6px, 2vw, 20px); display: grid; gap: 14px; }
.policy > * { max-width: 70ch; }
.policy h3 { font-size: 1.3rem; margin-top: 12px; }
.policy p, .policy li { color: var(--muted); }
.policy ul { margin: 0; padding-left: 1.2em; display: grid; gap: 4px; }

footer {
  margin-top: 96px; padding-block: 28px 40px; border-top: 3px solid var(--ink); box-shadow: 0 -3px 0 #c9b393;
  color: var(--muted); font-size: .92rem; display: flex; flex-wrap: wrap; gap: 8px 24px; justify-content: space-between; align-items: center;
}
footer strong { font-family: var(--display); color: var(--text); font-size: 1.1rem; }

/* ---------- Language switcher ---------- */
.topbar-right { display: flex; align-items: center; gap: 12px; }
.langs { display: flex; gap: 4px; }
.langs a { color: var(--muted); text-decoration: none; font: 700 .95rem/1 var(--display); padding: 9px 10px 7px; border-radius: 10px; border: 2px solid transparent; }
.langs a:hover { color: var(--text); }
.langs a[aria-current="page"] { color: var(--text); background: #fff; border-color: var(--ink); }
/* narrow phones: the logo alone leads home, the text stays for screen readers */
@media (max-width: 440px) {
  .studio-link span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
}
