/* Sugar Rhythm: the website.
   Look: a storybook at night. The game's own paintings carry the pictures, its own colours carry the page (plum nights, candy rose,
   lantern gold, mint), and its own font (Fredoka) carries the voice. Nothing here is decoration for its own sake. */

@font-face {
  font-family: "Fredoka";
  src: url("/assets/fonts/fredoka-bold.woff") format("woff");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --ink: #120a1f;
  --night: #1a102c;
  --plum: #2a1840;
  --plum-2: #3a2459;
  --line: rgba(255, 246, 236, 0.12);
  --cream: #fff6ec;
  --mist: #d9c9e6;
  --dim: #b7a5c9;
  --rose: #ff7fb0;
  --rose-deep: #e0457b;
  --gold: #ffd45e;
  --mint: #5ad8ba;
  --sky: #9fd4ff;
  --lilac: #b99cff;

  --display: "Fredoka", ui-rounded, "Arial Rounded MT Bold", "Segoe UI", system-ui, sans-serif;
  --body: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --serif: ui-serif, "Iowan Old Style", "Palatino Linotype", Georgia, serif;

  --gutter: clamp(20px, 5vw, 56px);
  --wrap: min(1180px, 100% - 2 * var(--gutter));
  --radius: 28px;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

*,
*::before,
*::after { box-sizing: border-box; }

html {
  color-scheme: dark;
  background: var(--ink);
  scroll-behavior: smooth;
  scroll-padding-top: 84px;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--ink);
  color: var(--cream);
  font: 400 1.125rem/1.65 var(--body);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

img, picture, video, svg { display: block; max-width: 100%; }
img, video { height: auto; }
a { color: inherit; }
p { margin: 0 0 1em; }
h1, h2, h3, h4 { margin: 0; font-family: var(--display); font-weight: 700; line-height: 1.05; text-wrap: balance; }
ul { margin: 0; padding: 0; list-style: none; }

:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; border-radius: 6px; }

.sr-only {
  position: absolute !important;
  width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip {
  position: fixed; left: 16px; top: -80px; z-index: 100;
  padding: 12px 20px; border-radius: 999px; background: var(--gold); color: var(--ink);
  font: 700 1rem var(--display); text-decoration: none; transition: top 0.2s var(--ease);
}
.skip:focus { top: 16px; }

.wrap { width: var(--wrap); margin-inline: auto; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.65em;
  min-height: 52px; padding: 0 28px; border-radius: 999px; border: 2px solid transparent;
  font: 700 1.05rem/1 var(--display); letter-spacing: 0.01em; text-decoration: none; cursor: pointer;
  transition: transform 0.18s var(--ease), background-color 0.18s, color 0.18s, border-color 0.18s;
}
.btn:active { transform: scale(0.97); }
.btn--solid { background: var(--cream); color: var(--ink); }
.btn--solid:hover { background: #fff; }
.btn--ghost { border-color: rgba(255, 246, 236, 0.55); color: var(--cream); background: transparent; }
.btn--ghost:hover { border-color: var(--cream); background: rgba(255, 246, 236, 0.08); }
.btn--soon { border-color: rgba(255, 246, 236, 0.28); color: var(--mist); cursor: default; }
.btn--soon:active { transform: none; }
.btn svg { width: 22px; height: 22px; flex: none; }
.btn--small { min-height: 44px; padding: 0 20px; font-size: 0.98rem; }

/* ---------- header ---------- */
.top {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  transition: background-color 0.25s, box-shadow 0.25s;
}
.top::before {
  content: ""; position: absolute; inset: 0 0 -28px; z-index: -1; pointer-events: none;
  background: linear-gradient(180deg, rgba(18, 10, 31, 0.78), rgba(18, 10, 31, 0));
  transition: opacity 0.25s;
}
.top.is-solid::before { opacity: 0; }
.top.is-solid { background: rgba(18, 10, 31, 0.94); box-shadow: 0 1px 0 var(--line); }
.top__bar { display: flex; align-items: center; gap: 24px; min-height: 72px; }

.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; font: 700 1.5rem/1 var(--display); }
.brand img { width: 34px; height: 34px; border-radius: 9px; }

.nav { display: none; margin-left: auto; gap: 4px; }
.nav a { padding: 10px 14px; border-radius: 999px; text-decoration: none; font-weight: 600; font-size: 1rem; color: var(--mist); }
.nav a:hover { color: var(--cream); background: rgba(255, 246, 236, 0.08); }
.top__cta { margin-left: auto; }

.menu { margin-left: 12px; position: relative; }
.menu summary {
  display: flex; align-items: center; justify-content: center; width: 48px; height: 48px; border-radius: 50%;
  list-style: none; cursor: pointer; background: rgba(255, 246, 236, 0.1);
}
.menu summary::-webkit-details-marker { display: none; }
.menu summary svg { width: 24px; height: 24px; }
.menu__panel {
  position: absolute; right: 0; top: 56px; width: min(280px, 82vw); padding: 10px; border-radius: 22px;
  background: var(--night); border: 1px solid var(--line); box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
}
.menu__panel a { display: block; padding: 14px 16px; border-radius: 14px; text-decoration: none; font: 700 1.15rem var(--display); }
.menu__panel a:hover { background: rgba(255, 246, 236, 0.08); }

@media (max-width: 599px) {
  .top__cta { display: none; }
  .menu { margin-left: auto; }
  .brand { white-space: nowrap; }
}
@media (min-width: 900px) {
  .nav { display: flex; }
  .top__cta { margin-left: 8px; }
  .menu { display: none; }
}

/* ---------- hero ---------- */
.hero {
  position: relative; isolation: isolate; overflow: clip;
  min-height: 100svh; display: grid; align-items: end;
  padding: 120px 0 clamp(56px, 11vh, 120px);
}
.hero__art { position: absolute; inset: -6% 0 0; z-index: -2; }
.hero__art picture, .story__art picture { display: block; width: 100%; height: 100%; }
.hero__art img { width: 100%; height: 100%; object-fit: cover; object-position: 66% 24%; will-change: transform; }
.hero::after {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background:
    linear-gradient(90deg, rgba(18, 10, 31, 0.9) 0%, rgba(18, 10, 31, 0.62) 40%, rgba(18, 10, 31, 0) 74%),
    linear-gradient(0deg, var(--ink) 0%, rgba(18, 10, 31, 0) 34%);
}
@media (max-width: 760px) {
  .hero::after { background: linear-gradient(0deg, var(--ink) 4%, rgba(18, 10, 31, 0.78) 46%, rgba(18, 10, 31, 0.1) 100%); }
  .hero__art img { object-position: 58% 20%; }
}

.eyebrow {
  display: inline-flex; align-items: center; gap: 10px; margin-bottom: 22px;
  font: 700 0.95rem/1 var(--display); letter-spacing: 0.14em; text-transform: uppercase; color: var(--rose);
}
.eyebrow::before { content: ""; width: 28px; height: 3px; border-radius: 3px; background: currentColor; }

.hero h1 { font-size: clamp(3.6rem, 12.5vw, 9.4rem); line-height: 0.88; letter-spacing: -0.012em; margin-left: -0.04em; }
.hero__tag { margin: 22px 0 18px; font: 700 clamp(1.5rem, 3.4vw, 2.3rem)/1.15 var(--display); color: #ffd1e3; }
.hero__lede { max-width: 34em; color: var(--mist); font-size: clamp(1.05rem, 1.5vw, 1.25rem); }
.hero__actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 30px; }
.hero__note { margin: 18px 0 0; font-size: 0.95rem; color: var(--dim); }

.orbit { position: relative; width: 96px; height: 96px; margin-bottom: 26px; }
.orbit__ring { position: absolute; inset: 0; animation: spin 7s linear infinite; }
.orbit__ring::before {
  content: ""; position: absolute; inset: 14px; border-radius: 50%; border: 2px dashed rgba(255, 246, 236, 0.28);
}
.orbit img { position: absolute; width: 40px; height: 40px; left: 50%; }
.orbit .a { top: 0; transform: translate(-50%, -2px); }
.orbit .b { bottom: 0; transform: translate(-50%, 2px); }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- the path divider: the game's tiles in a row ---------- */
.path {
  position: relative; height: 56px; margin: 0; overflow: hidden;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='132' height='56'%3E%3Cpath d='M0 28H132' stroke='%23fff6ec' stroke-opacity='.22' stroke-width='3' stroke-linecap='round'/%3E%3Crect x='47' y='13' width='30' height='30' rx='9' transform='rotate(45 62 28)' fill='%232a1840' stroke='%23ffb7d2' stroke-opacity='.7' stroke-width='3'/%3E%3C/svg%3E") repeat-x center / 132px 56px;
}
.path::after {
  content: ""; position: absolute; top: 20px; left: -20px; width: 16px; height: 16px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff, var(--rose)); box-shadow: 0 0 16px var(--rose);
  animation: glide 9s linear infinite;
}
@keyframes glide { to { transform: translateX(calc(100vw + 40px)); } }

/* ---------- sections ---------- */
.section { padding-block: clamp(72px, 10vw, 140px); }
.section--tight { padding-block: clamp(48px, 7vw, 96px); }
.kicker { margin-bottom: 14px; font: 700 0.95rem/1 var(--display); letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent, var(--rose)); }
.h2 { font-size: clamp(2.2rem, 5.4vw, 4.2rem); letter-spacing: -0.005em; }
.lead { max-width: 36em; margin-top: 20px; color: var(--mist); font-size: clamp(1.1rem, 1.6vw, 1.3rem); }
.head { margin-bottom: clamp(36px, 5vw, 64px); }

.reveal { transition: opacity 0.75s var(--ease), transform 0.75s var(--ease); }
.js .reveal:not(.in) { opacity: 0; transform: translateY(26px); }

/* ---------- the one-button idea ---------- */
.idea { display: grid; gap: clamp(32px, 5vw, 72px); align-items: center; }
.idea__big { font: 700 clamp(2rem, 4.6vw, 3.6rem)/1.1 var(--display); text-wrap: balance; }
.idea__big em { font-style: normal; color: var(--rose); }
@media (min-width: 900px) { .idea { grid-template-columns: 1.05fr 0.95fr; } }

.frame {
  position: relative; border-radius: var(--radius); overflow: hidden; background: var(--plum);
  box-shadow: 0 0 0 1px var(--line), 0 30px 70px rgba(0, 0, 0, 0.45);
}
.frame video, .frame img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.frame figcaption {
  position: absolute; left: 14px; bottom: 14px; padding: 8px 14px; border-radius: 999px;
  background: rgba(18, 10, 31, 0.82); font: 700 0.9rem/1 var(--display); letter-spacing: 0.02em;
}

/* ---------- how it plays ---------- */
.steps { display: grid; gap: 28px; }
@media (min-width: 860px) { .steps { grid-template-columns: repeat(3, 1fr); } }
.step h3 { margin: 22px 0 10px; font-size: 1.7rem; }
.step p { color: var(--mist); margin: 0; }
.step__n { color: var(--gold); font-family: var(--display); font-weight: 700; }

/* ---------- worlds ---------- */
.world { display: grid; gap: 28px; align-items: center; margin-bottom: clamp(56px, 8vw, 110px); }
.world:last-child { margin-bottom: 0; }
.world__art { position: relative; border-radius: var(--radius); overflow: hidden; box-shadow: 0 0 0 1px var(--line), 0 30px 70px rgba(0, 0, 0, 0.4); }
.world__art img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; }
.world h3 { font-size: clamp(2.2rem, 4.4vw, 3.4rem); }
.world__text p { color: var(--mist); max-width: 30em; }
.tags { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.tag {
  display: inline-flex; align-items: center; min-height: 36px; padding: 0 16px; border-radius: 999px;
  border: 2px solid color-mix(in srgb, var(--accent, var(--rose)) 70%, transparent);
  font: 700 0.92rem/1 var(--display); color: var(--cream);
}
.tag--fill { background: var(--accent, var(--rose)); border-color: transparent; color: var(--ink); }
@media (min-width: 900px) {
  .world { grid-template-columns: 1.25fr 1fr; gap: clamp(36px, 5vw, 80px); }
  .world:nth-child(even) .world__art { order: 2; }
}

/* the game's own colour for each world and each guardian */
.w1 { --accent: #ff9ec4; }
.w2 { --accent: #b9a4f5; }
.w3 { --accent: #8fe3c8; }
.w4 { --accent: #ffd88a; }
.w5 { --accent: #9fd4ff; }
.b1 { --accent: #e063c7; }
.b2 { --accent: #3fb8c8; }
.b3 { --accent: #6fb7ff; }
.b4 { --accent: #ff9a3a; }
.b5 { --accent: #c86bff; }

/* ---------- Dream and Nightmare ---------- */
.compare { position: relative; aspect-ratio: 16 / 9; border-radius: var(--radius); overflow: hidden; touch-action: pan-y; user-select: none; }
.compare picture, .compare img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.compare__night { position: absolute; inset: 0; clip-path: inset(0 0 0 var(--pos, 50%)); }
.compare input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: ew-resize; z-index: 3; }
.compare__handle {
  position: absolute; z-index: 2; top: 0; bottom: 0; left: var(--pos, 50%); width: 4px; margin-left: -2px; background: var(--cream);
  box-shadow: 0 0 24px rgba(0, 0, 0, 0.5); pointer-events: none;
}
.compare__handle::after {
  content: ""; position: absolute; top: 50%; left: 50%; width: 56px; height: 56px; margin: -28px 0 0 -28px; border-radius: 50%;
  background: var(--cream) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='56' height='56'%3E%3Cpath d='M22 20l-9 8 9 8M34 20l9 8-9 8' fill='none' stroke='%23120a1f' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 56px no-repeat;
}
.compare input:focus-visible ~ .compare__handle::after { outline: 3px solid var(--gold); outline-offset: 4px; }
.compare__label {
  position: absolute; z-index: 2; bottom: 16px; padding: 8px 16px; border-radius: 999px; background: rgba(18, 10, 31, 0.82);
  font: 700 0.95rem/1 var(--display); pointer-events: none;
}
.compare__label--dream { left: 16px; }
.compare__label--night { right: 16px; }

/* ---------- bosses and screenshots: scrolling rows ---------- */
.rail {
  display: grid; grid-auto-flow: column; grid-auto-columns: min(80vw, 400px); gap: 20px;
  overflow-x: auto; scroll-snap-type: x mandatory; padding: 4px var(--gutter) 22px; margin-inline: calc(-1 * var(--gutter));
  scrollbar-width: thin; scrollbar-color: var(--plum-2) transparent; overscroll-behavior-x: contain;
}
.rail > * { scroll-snap-align: start; }
.rail--shots { grid-auto-columns: min(86vw, 640px); }
@media (min-width: 1240px) {
  .rail { margin-inline: 0; padding-inline: 0; }
}
.boss {
  overflow: hidden; border-radius: var(--radius); background: var(--night);
  box-shadow: 0 0 0 1px var(--line); border-top: 5px solid var(--accent);
}
.boss img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; object-position: 70% 30%; }
.boss__body { padding: 20px 22px 24px; }
.boss h3 { font-size: 1.7rem; }
.boss__title { margin: 6px 0 14px; color: var(--dim); font-size: 1rem; }
.boss .tag { --accent: inherit; border-color: color-mix(in srgb, var(--accent) 75%, transparent); }

.shot { margin: 0; }
.shot .frame img { aspect-ratio: 16 / 9; }
.shot figcaption { padding: 14px 4px 0; color: var(--mist); font-size: 1rem; }

/* ---------- difficulty ---------- */
.levels { display: grid; gap: 20px; }
@media (min-width: 860px) { .levels { grid-template-columns: repeat(3, 1fr); } }
.level { padding: 28px; border-radius: var(--radius); background: var(--night); box-shadow: 0 0 0 1px var(--line); }
.level h3 { margin-top: 18px; font-size: 2rem; }
.level p { margin: 10px 0 0; color: var(--mist); }
.hearts { display: flex; gap: 6px; }
.hearts svg { width: 26px; height: 26px; }
.hearts .off { opacity: 0.18; }
.level--easy { --accent: var(--mint); }
.level--normal { --accent: var(--rose); }
.level--hard { --accent: #ffaa5a; }
.level .tag { margin-top: 0; }
.level__bar { height: 6px; margin-bottom: 22px; border-radius: 6px; background: var(--accent); }

.fair { display: grid; gap: 14px 40px; margin-top: 44px; }
@media (min-width: 760px) { .fair { grid-template-columns: repeat(2, 1fr); } }
.fair li { position: relative; padding-left: 38px; color: var(--mist); }
.fair li::before {
  content: ""; position: absolute; left: 4px; top: 0.45em; width: 14px; height: 14px; border-radius: 4px; transform: rotate(45deg);
  background: var(--plum); border: 2px solid var(--rose);
}
.fair strong { color: var(--cream); }

/* ---------- your own music ---------- */
.music { display: grid; gap: 40px; align-items: center; }
@media (min-width: 900px) { .music { grid-template-columns: 1fr 1fr; gap: 80px; } }
.music__art { padding: 28px; border-radius: var(--radius); background: var(--night); box-shadow: 0 0 0 1px var(--line); }
.music__art svg { width: 100%; height: auto; }
.wave rect { fill: var(--rose); transform-origin: center; transform-box: fill-box; animation: bars 2.4s ease-in-out infinite; }
.wave rect:nth-child(3n) { animation-delay: -0.4s; }
.wave rect:nth-child(3n + 1) { animation-delay: -1.1s; }
@keyframes bars { 50% { transform: scaleY(0.62); } }
.trail { stroke-dasharray: 8 14; animation: march 1.6s linear infinite; }
@keyframes march { to { stroke-dashoffset: -44; } }
.privacy-line { margin-top: 18px; padding-left: 18px; border-left: 4px solid var(--mint); color: var(--mist); }

/* ---------- story ---------- */
.story { position: relative; isolation: isolate; overflow: clip; min-height: min(86svh, 760px); display: grid; align-items: end; padding-block: 96px; }
.story__art { position: absolute; inset: 0; z-index: -2; }
.story__art img { width: 100%; height: 100%; object-fit: cover; }
.story::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(0deg, rgba(18, 10, 31, 0.95), rgba(18, 10, 31, 0.1) 70%), linear-gradient(180deg, var(--ink), transparent 22%); }
.story blockquote { margin: 0; max-width: 24em; font: italic 400 clamp(1.6rem, 3.6vw, 2.7rem)/1.3 var(--serif); text-wrap: balance; }
.story cite { display: block; margin-top: 20px; font: 700 0.95rem/1 var(--display); letter-spacing: 0.12em; text-transform: uppercase; color: var(--rose); font-style: normal; }

/* ---------- FAQ ---------- */
.faq { max-width: 860px; margin-inline: auto; }
.faq details { border-bottom: 1px solid var(--line); }
.faq details:first-child { border-top: 1px solid var(--line); }
.faq summary {
  display: flex; align-items: center; justify-content: space-between; gap: 20px; min-height: 64px; padding: 14px 0;
  font: 700 1.3rem/1.2 var(--display); list-style: none; cursor: pointer;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: ""; flex: none; width: 14px; height: 14px; border-right: 3px solid var(--rose); border-bottom: 3px solid var(--rose);
  transform: rotate(45deg) translate(-3px, -3px); transition: transform 0.25s var(--ease);
}
.faq details[open] summary::after { transform: rotate(-135deg) translate(-3px, -3px); }
.faq .answer { padding: 0 0 22px; color: var(--mist); max-width: 40em; }
.faq .answer p:last-child { margin-bottom: 0; }
.faq a { color: var(--rose); text-underline-offset: 3px; }

/* ---------- closing call ---------- */
.final { text-align: center; }
.final .h2 { max-width: 14em; margin-inline: auto; }
.final .hero__actions { justify-content: center; }
.final .lead { margin-inline: auto; }

/* ---------- footer ---------- */
.foot { padding-block: 56px 72px; border-top: 1px solid var(--line); color: var(--dim); font-size: 1rem; }
.foot__grid { display: grid; gap: 36px; }
@media (min-width: 760px) { .foot__grid { grid-template-columns: 1.4fr 1fr 1fr; } }
.foot h2 { margin-bottom: 14px; font-size: 1rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--cream); }
.foot li + li { margin-top: 8px; }
.foot a { text-underline-offset: 3px; }
.foot a:hover { color: var(--cream); }
.foot .brand { margin-bottom: 14px; color: var(--cream); }
.foot small { display: block; margin-top: 34px; font-size: 0.9rem; }

/* ---------- trailer dialog ---------- */
.trailer { width: min(1100px, 94vw); padding: 0; border: 0; background: transparent; color: var(--cream); overflow: visible; }
.trailer::backdrop { background: rgba(10, 5, 20, 0.86); }
.trailer video { width: 100%; aspect-ratio: 16 / 9; border-radius: 20px; background: #000; }
.trailer__close {
  position: absolute; right: 0; top: -60px; width: 48px; height: 48px; border: 0; border-radius: 50%;
  background: var(--cream); color: var(--ink); cursor: pointer; display: grid; place-items: center;
}
.trailer__close svg { width: 22px; height: 22px; }

/* ---------- press page ---------- */
.press-hero { padding: 150px 0 40px; }
.facts { display: grid; gap: 0; margin: 36px 0 0; border-top: 1px solid var(--line); }
.facts div { display: grid; gap: 4px 24px; padding: 16px 0; border-bottom: 1px solid var(--line); }
@media (min-width: 700px) { .facts div { grid-template-columns: 220px 1fr; } }
.facts dt { font: 700 1.05rem var(--display); color: var(--rose); }
.facts dd { margin: 0; color: var(--mist); }
.downloads { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); margin-top: 24px; }
.download { display: block; border-radius: 20px; overflow: hidden; background: var(--night); box-shadow: 0 0 0 1px var(--line); text-decoration: none; }
.download img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; background: var(--plum); }
.download span { display: block; padding: 12px 16px 14px; font: 700 0.98rem/1.2 var(--display); }
.download small { display: block; margin-top: 4px; font: 400 0.85rem var(--body); color: var(--dim); }
.downloads--copy { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); align-items: start; }
.copyblock { padding: 24px 26px; border-radius: 22px; background: var(--night); box-shadow: 0 0 0 1px var(--line); color: var(--mist); }
.copyblock h3 { margin-bottom: 10px; font-size: 1.3rem; color: var(--cream); }
.copyblock p:last-child { margin-bottom: 0; }

/* ---------- 404 ---------- */
.lost { min-height: 100svh; display: grid; place-items: center; text-align: center; padding: 40px var(--gutter); }
.lost h1 { font-size: clamp(3rem, 10vw, 7rem); }
.lost .lead { margin-inline: auto; margin-bottom: 28px; }

/* ---------- motion preferences ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
  .js .reveal:not(.in) { opacity: 1; transform: none; }
  .path::after { display: none; }
}

/* ---------- the sugar bar (as in the game: a glass candy tube, one notch per miss it holds) ---------- */
.sugar { display: flex; align-items: center; width: min(100%, 270px); height: 36px; }
.sugar__tube { position: relative; flex: 1; height: 26px; border-radius: 13px; overflow: hidden; background: rgba(42, 24, 64, 0.8);
  box-shadow: inset 0 0 0 2px rgba(255, 241, 214, 0.9), 0 0 14px rgba(255, 143, 191, 0.35); }
.sugar__fill { position: absolute; inset: 0; background: linear-gradient(90deg, #ff8fbf, #ffcf6e);
  transform-origin: left; animation: sugar-drain 6s ease-in-out infinite; }
.sugar__fill::after { content: ""; position: absolute; left: 8%; right: 8%; top: 4px; height: 4px; border-radius: 2px; background: rgba(255, 255, 255, 0.35); }
.sugar__notches { position: absolute; inset: 0; display: flex; justify-content: space-evenly; }
.sugar__notches i { width: 2px; background: rgba(42, 24, 64, 0.45); }
.sugar__cap { width: 18px; height: 32px; background: linear-gradient(180deg, #fff, #ffc1da);
  clip-path: polygon(0 0, 100% 42%, 100% 58%, 0 100%); }
.sugar__cap--r { transform: scaleX(-1); }
@keyframes sugar-drain { 0%, 30% { transform: scaleX(1); } 45%, 60% { transform: scaleX(0.72); } 85%, 100% { transform: scaleX(1); } }
@media (prefers-reduced-motion: reduce) { .sugar__fill { animation: none; } }
