/* ==========================================================================
   Glido — theme (colours sampled from the app icon, the store screenshots and the feature graphic).
   Identity: glossy jelly arrows on an ice-white board under an alpine sky. Sky-blue ground, the
   store banners' royal-blue gradient for the bands, the feature graphic's dotted night navy for
   Tech inside, and the yellow-on-navy lettering of the game title.
   ========================================================================== */

:root {
  /* Ground and text */
  --page: #EDF5FD;          /* pale alpine sky */
  --page-deep: #DCEAF9;     /* gallery sky */
  --ink: #14264F;           /* title outline navy */
  --ink-soft: #3D5079;      /* 7.6:1 on --page */
  --link: #1A56BF;

  /* Bands */
  --band: #1D5FD0;          /* store banner royal blue (white text 5.6:1) */
  --band-top: #2F86EA;
  --band-ink: #FFFFFF;
  --dark: #14264F;          /* feature graphic night navy */
  --dark-ink: #F4F8FF;
  --dark-soft: rgba(244, 248, 255, 0.78);
  --focus: #14264F;
  --gold: #FFD23F;          /* title yellow */

  /* Board */
  --board: #F6F9FE;
  --tile: #E3EBF6;
  --rim: #9CC6F0;

  /* Jelly colours: light top / deep bottom */
  --red: #F0525C;     --red-d: #D3303D;
  --blue: #4C8DF0;    --blue-d: #2462D6;
  --green: #4CC75A;   --green-d: #2C9F3B;
  --yellow: #FFC93A;  --yellow-d: #EE9F1A;
  --purple: #9B5CE6;  --purple-d: #7739C9;
  --pink: #F2648F;    --pink-d: #D63F6C;
  --teal: #2EC6A8;    --teal-d: #149C85;
  --orange: #FF9A3C;  --orange-d: #E87017;
}

body {
  background-image: linear-gradient(180deg, #D5E7FB 0, var(--page) 760px);
  background-repeat: no-repeat;
}

/* ---------- Bands: the royal-blue gradient of the store banners ---------- */
.bar, .cta { background-image: linear-gradient(180deg, var(--band-top), var(--band)); }
.bar { box-shadow: 0 3px 0 rgba(20, 38, 79, 0.18); }
.cta { position: relative; overflow: hidden; }
.cta__title { color: var(--gold); -webkit-text-stroke: 0.05em var(--ink); paint-order: stroke fill; text-shadow: 0 0.06em 0 var(--ink); }
/* A glide trail crossing the band, like the arrow leaving the board on the feature graphic. */
.cta::before {
  content: "";
  position: absolute;
  left: -10%;
  right: 30%;
  top: 50%;
  height: 10px;
  border-radius: 10px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.22));
  transform: translateY(-50%) rotate(-4deg);
  pointer-events: none;
}
.cta__inner { position: relative; }

/* ---------- Hero ---------- */
.hero { overflow: clip; }
.hero__icon { box-shadow: 0 12px 26px -12px rgba(29, 95, 208, 0.7); }
.hero__name {
  color: var(--gold);
  -webkit-text-stroke: 0.07em var(--ink);
  paint-order: stroke fill;
  text-shadow: 0 0.06em 0 var(--ink);
  letter-spacing: 0;
}
.hero__tagline { color: var(--band); }

/* ---------- Hero board: jelly arrows on an ice board (js/hero.js plays it once) ---------- */
.hero__visual { position: relative; }
.glide { position: relative; max-width: 440px; margin-inline: auto; }
.glide__hud {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 0 6px 14px;
}
.glide__hearts { display: inline-flex; gap: 4px; }
.heart { width: 28px; height: 28px; fill: #EE3B4B; filter: drop-shadow(0 2px 0 #A81E2B); }
.heart.is-lost { animation: gl-heart 0.6s ease-out forwards; }
.glide__progress {
  flex: 1;
  height: 12px;
  border-radius: 12px;
  background: #D2E0F1;
  box-shadow: inset 0 2px 2px rgba(20, 38, 79, 0.12);
  overflow: hidden;
}
.glide__fill {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--green), var(--green-d));
  transition: width 0.5s ease-out;
}
.glide__fill.is-one { width: 11%; }
.glide__fill.is-two { width: 22%; }

.glide__board {
  position: relative;
  padding: clamp(10px, 2.4vw, 16px);
  background: var(--board);
  border: 5px solid var(--rim);
  border-radius: 26px;
  box-shadow: inset 0 3px 0 #FFFFFF, 0 26px 50px -26px rgba(20, 60, 140, 0.55);
}
.glide__tiles, .glide__arrows {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  grid-template-rows: repeat(6, auto);
  gap: clamp(5px, 1.2vw, 8px);
}
.glide__tiles span {
  aspect-ratio: 1;
  border-radius: 22%;
  background: var(--tile) radial-gradient(circle, #B6C6DB 0 2.5px, transparent 3px);
}
.glide__arrows {
  position: absolute;
  inset: clamp(10px, 2.4vw, 16px);
  grid-template-rows: repeat(6, minmax(0, 1fr));
}

/* Placement on the 5 x 6 board */
.at-a { grid-column: 1 / span 3; grid-row: 2; }
.at-b { grid-column: 4; grid-row: 2 / span 3; }
.at-c { grid-column: 2; grid-row: 1; }
.at-d { grid-column: 1 / span 2; grid-row: 3; }
.at-e { grid-column: 1; grid-row: 4; }
.at-f { grid-column: 2 / span 2; grid-row: 4; }
.at-g { grid-column: 5; grid-row: 3 / span 3; }
.at-h { grid-column: 1 / span 3; grid-row: 5; }
.at-i { grid-column: 2 / span 3; grid-row: 6; }

/* A jelly arrow: a glossy bar ending in a square head with a white arrow. */
.jelly { --c: var(--red); --d: var(--red-d); --dx: 0; --dy: 0; position: relative; display: flex; min-width: 0; min-height: 0; }
.jelly--red { --c: var(--red); --d: var(--red-d); }
.jelly--blue { --c: var(--blue); --d: var(--blue-d); }
.jelly--green { --c: var(--green); --d: var(--green-d); }
.jelly--yellow { --c: var(--yellow); --d: var(--yellow-d); }
.jelly--purple { --c: var(--purple); --d: var(--purple-d); }
.jelly--pink { --c: var(--pink); --d: var(--pink-d); }
.jelly--teal { --c: var(--teal); --d: var(--teal-d); }
.jelly--orange { --c: var(--orange); --d: var(--orange-d); }

.jelly--right { flex-direction: row; --dx: 1; }
.jelly--left { flex-direction: row-reverse; --dx: -1; }
.jelly--up { flex-direction: column-reverse; --dy: -1; }
.jelly--down { flex-direction: column; --dy: 1; }

.jelly__head {
  position: relative;
  z-index: 1;
  flex: none;
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  border-radius: 24%;
  background: linear-gradient(180deg, var(--c), var(--d));
  box-shadow: inset 0 -4px 0 rgba(0, 0, 0, 0.16), inset 0 3px 0 rgba(255, 255, 255, 0.45), 0 4px 8px -4px rgba(20, 38, 79, 0.5);
}
.jelly--right .jelly__head, .jelly--left .jelly__head { height: 100%; }
.jelly--up .jelly__head, .jelly--down .jelly__head { width: 100%; }
.jelly__head::before {
  content: "";
  position: absolute;
  left: 16%;
  top: 10%;
  width: 22%;
  height: 16%;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.55);
}
.jelly__head svg {
  width: 56%;
  fill: none;
  stroke: #FFFFFF;
  stroke-width: 3.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 1.5px 0 rgba(0, 0, 0, 0.18));
}
.jelly--left .jelly__head svg { transform: rotate(180deg); }
.jelly--up .jelly__head svg { transform: rotate(-90deg); }
.jelly--down .jelly__head svg { transform: rotate(90deg); }

.jelly__body {
  flex: 1;
  align-self: center;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--c), var(--d));
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.4);
}
.jelly--right .jelly__body, .jelly--left .jelly__body { height: 38%; }
.jelly--right .jelly__body { margin: 0 -14% 0 12%; }
.jelly--left .jelly__body { margin: 0 12% 0 -14%; }
.jelly--up .jelly__body, .jelly--down .jelly__body {
  width: 38%;
  background: linear-gradient(90deg, var(--c), var(--d));
  box-shadow: inset 2px 0 0 rgba(255, 255, 255, 0.4);
}
.jelly--up .jelly__body { margin: -14% 0 12% 0; }
.jelly--down .jelly__body { margin: 12% 0 -14% 0; }

/* The one moment: tap, bump back, glide out. */
.jelly__head::after {
  content: "";
  position: absolute;
  inset: -12%;
  border: 3px solid rgba(255, 255, 255, 0.95);
  border-radius: 50%;
  box-shadow: 0 0 0 2px rgba(20, 38, 79, 0.25);
  opacity: 0;
  pointer-events: none;
}
.jelly.is-tapped .jelly__head::after { animation: gl-tap 0.5s ease-out; }
.jelly.is-bumping { animation: gl-bump 0.62s cubic-bezier(0.3, 1.6, 0.5, 1); }
.jelly.is-gliding { animation: gl-glide 0.85s cubic-bezier(0.55, 0, 0.8, 0.4) forwards; }

@keyframes gl-tap {
  0% { opacity: 1; transform: scale(0.55); }
  100% { opacity: 0; transform: scale(1.25); }
}
@keyframes gl-bump {
  0% { transform: none; }
  30% { transform: translate(calc(var(--dx) * 16px), calc(var(--dy) * 16px)); }
  55% { transform: translate(calc(var(--dx) * -5px), calc(var(--dy) * -5px)); }
  100% { transform: none; }
}
@keyframes gl-glide {
  0% { transform: none; opacity: 1; }
  65% { opacity: 1; }
  100% { transform: translate(calc(var(--dx) * 135%), calc(var(--dy) * 135%)); opacity: 0; }
}
@keyframes gl-heart {
  0% { transform: none; }
  35% { transform: scale(1.35) translateY(-4px); }
  100% { transform: scale(0.9); fill: #C3CFE0; filter: none; }
}

/* ---------- Modes: four boards, the dots get denser from Easy to Expert ---------- */
.patches {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 3px;
  padding: 3px;
  border-radius: 28px;
  background: var(--rim);
  box-shadow: 0 24px 44px -30px rgba(20, 60, 140, 0.6);
  overflow: hidden;
}
.patch { background: var(--board); }
.patch:first-child { border-radius: 25px 0 0 25px; }
.patch:last-child { border-radius: 0 25px 25px 0; }
.patch__fabric {
  height: 76px;
  background-color: var(--tile);
  border-bottom: 3px solid var(--c, var(--blue));
}
.patch--easy { --c: var(--green); }
.patch--medium { --c: var(--blue); }
.patch--hard { --c: var(--orange); }
.patch--expert { --c: var(--purple); }
.patch--easy .patch__fabric { background-image: radial-gradient(circle, var(--green) 0 4px, transparent 4.5px); background-size: 38px 38px; }
.patch--medium .patch__fabric { background-image: radial-gradient(circle, var(--blue) 0 3.5px, transparent 4px); background-size: 24px 24px; }
.patch--hard .patch__fabric { background-image: radial-gradient(circle, var(--orange) 0 3px, transparent 3.5px); background-size: 16px 16px; }
.patch--expert .patch__fabric { background-image: radial-gradient(circle, var(--purple) 0 2.2px, transparent 2.7px); background-size: 9px 9px; }
.patch__title { color: var(--ink); }

/* ---------- Feature notes: a jelly chip marks each one ---------- */
.note { border-top: 2px dotted rgba(29, 95, 208, 0.35); }
.note__title::before {
  content: "";
  flex: none;
  width: 20px;
  height: 20px;
  border-radius: 6px;
  background: radial-gradient(circle at 32% 26%, rgba(255, 255, 255, 0.6) 0 2.5px, transparent 3px), linear-gradient(180deg, var(--c), var(--d));
  box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.16);
}
.note--calm { --c: var(--red); --d: var(--red-d); }
.note--daily { --c: var(--yellow); --d: var(--yellow-d); }
.note--boost { --c: var(--purple); --d: var(--purple-d); }
.note--map { --c: var(--green); --d: var(--green-d); }
.note--offline { --c: var(--teal); --d: var(--teal-d); }
.note--languages { --c: var(--blue); --d: var(--blue-d); }

/* ---------- Gallery: five screenshots in a row, the artwork below ---------- */
.gallery { background: linear-gradient(180deg, var(--page-deep), var(--page)); border-top: 3px solid var(--rim); }
.shots { grid-template-columns: repeat(5, minmax(0, 1fr)); align-items: start; }
.shot--wide { grid-column: 2 / span 3; margin-top: 8px; }
.shot img {
  width: 100%;
  border-radius: 18px;
  box-shadow: 0 0 0 3px #FFFFFF, 0 20px 34px -22px rgba(20, 60, 140, 0.75);
}

/* ---------- Tech inside: the feature graphic's dotted night ---------- */
.tech {
  background-image: radial-gradient(rgba(244, 248, 255, 0.08) 1.4px, transparent 1.8px);
  background-size: 22px 22px;
}
.tech .section-title { color: var(--dark-ink); }
.spec { border-top: 2px dotted rgba(244, 248, 255, 0.3); }
.spec__title { color: var(--gold); }

/* ---------- Smaller screens ---------- */
@media (max-width: 960px) {
  .patches { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .patch:first-child { border-radius: 25px 0 0 0; }
  .patch:nth-child(2) { border-radius: 0 25px 0 0; }
  .patch:nth-child(3) { border-radius: 0 0 0 25px; }
  .patch:last-child { border-radius: 0 0 25px 0; }
  .shot--wide { margin-top: 0; }
}
@media (max-width: 720px) {
  .patches { grid-template-columns: 1fr; }
  .patch:first-child { border-radius: 25px 25px 0 0; }
  .patch:nth-child(2), .patch:nth-child(3) { border-radius: 0; }
  .patch:last-child { border-radius: 0 0 25px 25px; }
  .patch__fabric { height: 52px; }
  .glide__board { border-width: 4px; border-radius: 20px; }
  .heart { width: 24px; height: 24px; }
}
