/* Box Rush: a sunny loading dock (light) and the town at dusk (dark).
   Layout: chunky rounded blocks, candy box colors, one playable dock in the middle. */
:root {
  --sky: #e6f1ff;
  --sky-2: #d4e7ff;
  --panel: #ffffff;
  --ink: #1b2436;
  --ink-2: #4c5a73;
  --line: #cfdcf0;
  --blue: #2f6fe0;
  --blue-deep: #1f4fb0;
  --green: #22a457;
  --green-deep: #167a3f;
  --orange: #ff8a1f;
  --yellow: #ffc531;
  --pink: #f0508f;
  --purple: #7d55e8;
  --teal: #19b8b0;
  --on-color: #ffffff;
  --hazard: #1b2436;
  --shadow: 0 10px 0 rgba(27, 36, 54, 0.12), 0 24px 50px rgba(27, 36, 54, 0.14);
  --display: "Fredoka", "Arial Rounded MT Bold", system-ui, sans-serif;
  --body: "Nunito Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --sky: #0f1626; --sky-2: #152036; --panel: #1b2740; --ink: #eef3ff; --ink-2: #a9b6cf; --line: #2b3a58;
    --blue: #6fa0ff; --blue-deep: #4a7fe8; --green: #4fd27f; --green-deep: #2fae5f; --hazard: #0b101b;
    --shadow: 0 10px 0 rgba(0, 0, 0, 0.35), 0 24px 50px rgba(0, 0, 0, 0.45);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --sky: #0f1626; --sky-2: #152036; --panel: #1b2740; --ink: #eef3ff; --ink-2: #a9b6cf; --line: #2b3a58;
  --blue: #6fa0ff; --blue-deep: #4a7fe8; --green: #4fd27f; --green-deep: #2fae5f; --hazard: #0b101b;
  --shadow: 0 10px 0 rgba(0, 0, 0, 0.35), 0 24px 50px rgba(0, 0, 0, 0.45); color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
[id] { scroll-margin-top: 92px; }
body { margin: 0; background: var(--sky); color: var(--ink); font: 18px/1.6 var(--body); -webkit-font-smoothing: antialiased; overflow-x: hidden; }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--blue); text-underline-offset: 3px; }
:focus-visible { outline: 3px solid var(--orange); outline-offset: 3px; border-radius: 10px; }

.wrap { width: 100%; max-width: 1160px; margin: 0 auto; padding-left: max(18px, env(safe-area-inset-left, 0px)); padding-right: max(18px, env(safe-area-inset-right, 0px)); }
h1, h2, h3 { font-family: var(--display); font-weight: 700; line-height: 1.02; margin: 0; letter-spacing: -0.01em; text-wrap: balance; }
h1 { font-size: clamp(52px, 8vw, 96px); }
h2 { font-size: clamp(36px, 5vw, 58px); }
h3 { font-size: 26px; }
p { margin: 0; }
.lede { font-size: clamp(19px, 2vw, 22px); color: var(--ink-2); max-width: 40ch; }
.tag { display: inline-flex; align-items: center; gap: 8px; padding: 7px 14px; border-radius: 999px; font: 600 15px/1 var(--display); letter-spacing: 0.02em; background: var(--yellow); color: #1b2436; }

/* nav */
.nav { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 30; background: color-mix(in srgb, var(--sky) 88%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-bottom: 2px solid var(--line); }
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 31; background: var(--sky); }
.nav .wrap { display: flex; align-items: center; gap: 18px; min-height: 70px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink); font: 700 26px/1 var(--display); white-space: nowrap; }
@media (max-width: 420px) { .brand { font-size: 22px; } .nav .btn { padding: 0 16px; font-size: 16px; } }
.brand img { width: 42px; height: 42px; border-radius: 11px; }
.nav-links { display: none; gap: 26px; margin-left: auto; }
.nav-links a { color: var(--ink-2); text-decoration: none; font: 600 17px/1 var(--display); }
.nav-links a:hover { color: var(--ink); }
.nav .btn { margin-left: auto; }
@media (min-width: 880px) { .nav-links { display: flex; } .nav .btn { margin-left: 6px; } }

/* chunky buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 50px; padding: 0 24px; border-radius: 16px; border: 0; cursor: pointer; text-decoration: none; white-space: nowrap; font: 700 18px/1 var(--display); color: var(--on-color); background: var(--green); box-shadow: 0 5px 0 var(--green-deep); transition: transform 0.1s ease, box-shadow 0.1s ease; }
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--green-deep); }
.btn.blue { background: var(--blue); box-shadow: 0 5px 0 var(--blue-deep); }
.store { display: inline-flex; align-items: center; gap: 12px; min-height: 62px; padding: 0 24px 0 18px; border-radius: 18px; background: var(--ink); color: var(--sky); text-decoration: none; box-shadow: 0 5px 0 rgba(0, 0, 0, 0.25); }
.store svg { width: 28px; height: 28px; flex: none; }
.store small { display: block; font: 700 12px/1.1 var(--body); opacity: 0.75; }
.store strong { display: block; font: 700 22px/1.1 var(--display); }
.store.soon { cursor: default; }

/* hero */
.hero { position: relative; overflow: hidden; padding-block: 48px 0; }
.hero-grid { display: grid; gap: 36px; align-items: end; }
@media (min-width: 960px) { .hero-grid { grid-template-columns: 1.05fr 0.95fr; } .hero { padding-block: 72px 0; } }
.hero h1 .w { display: inline-block; }
.hero h1 .c1 { color: var(--orange); } .hero h1 .c2 { color: var(--blue); } .hero h1 .c3 { color: var(--green); }
.hero .lede { margin-top: 18px; }
.cta { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; margin-top: 28px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 22px; }
.chip { padding: 8px 14px; border-radius: 12px; background: var(--panel); box-shadow: inset 0 0 0 2px var(--line); font: 600 15px/1 var(--display); color: var(--ink-2); }
.art { position: relative; border-radius: 32px 32px 0 0; overflow: hidden; aspect-ratio: 4 / 3; max-width: 100%; box-shadow: var(--shadow); }
.art img { width: 100%; height: 100%; object-fit: cover; }
.hazard { height: 22px; background: repeating-linear-gradient(-45deg, var(--yellow) 0 22px, var(--hazard) 22px 44px); }

/* flying boxes (one orchestrated moment on load) */
.fly { position: absolute; inset: 0; pointer-events: none; }
.fly i { position: absolute; width: 38px; height: 38px; border-radius: 9px; box-shadow: inset 0 -5px 0 rgba(0, 0, 0, 0.18); opacity: 0; animation: toss 1.6s cubic-bezier(0.3, 0.7, 0.4, 1) both; }
.fly i:nth-child(1) { left: 8%; top: 60%; background: var(--pink); animation-delay: 0.3s; }
.fly i:nth-child(2) { left: 22%; top: 72%; background: var(--blue); animation-delay: 0.55s; }
.fly i:nth-child(3) { left: 14%; top: 82%; background: var(--yellow); animation-delay: 0.8s; }
@keyframes toss { 0% { opacity: 0; transform: translate(0, 40px) rotate(0); } 15% { opacity: 1; } 100% { opacity: 0; transform: translate(260px, -220px) rotate(200deg); } }

/* sections */
section { padding-block: 88px; }
@media (min-width: 960px) { section { padding-block: 120px; } }
.panel-band { background: var(--sky-2); }
.head { display: grid; gap: 14px; max-width: 760px; margin-bottom: 44px; }
.row { display: grid; gap: 40px; align-items: center; }
@media (min-width: 900px) { .row { grid-template-columns: 1fr 1fr; gap: 72px; } .row.flip > :first-child { order: 2; } }
.shot { width: min(320px, 80vw); margin: 0 auto; border-radius: 30px; border: 8px solid #1b2436; box-shadow: var(--shadow); }
.list { list-style: none; padding: 0; margin: 24px 0 0; display: grid; gap: 14px; }
.list li { display: grid; grid-template-columns: 40px 1fr; gap: 14px; align-items: start; }
.list b { display: block; font: 600 20px/1.25 var(--display); }
.list span { color: var(--ink-2); }

/* stickers: the game's colorblind-friendly box marks */
.box { --c: var(--blue); width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; background: var(--c); color: rgba(0, 0, 0, 0.55); box-shadow: inset 0 -5px 0 rgba(0, 0, 0, 0.18); font-size: 20px; line-height: 1; }
.box svg { width: 52%; height: 52%; fill: rgba(20, 20, 30, 0.6); }
.b-pink { --c: var(--pink); } .b-blue { --c: var(--blue); } .b-yellow { --c: var(--yellow); } .b-green { --c: var(--green); } .b-purple { --c: var(--purple); } .b-teal { --c: var(--teal); } .b-orange { --c: var(--orange); }

/* the playable dock */
.dock-game { display: grid; gap: 18px; padding: 22px; border-radius: 28px; background: var(--panel); box-shadow: var(--shadow); }
.dg-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; font: 600 18px/1 var(--display); }
.dg-top .stars { color: var(--yellow); letter-spacing: 2px; font-size: 22px; }
.lanes { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.truck { position: relative; display: grid; gap: 8px; padding: 12px 12px 18px; border-radius: 16px; background: var(--sky); box-shadow: inset 0 0 0 2px var(--line); transition: transform 0.45s ease, opacity 0.45s ease; }
.truck.leaving { transform: translateX(120%); opacity: 0; }
.truck .cab { display: flex; align-items: center; gap: 8px; font: 600 15px/1 var(--display); color: var(--ink-2); }
.truck .cab .box { width: 26px; height: 26px; border-radius: 7px; }
.truck .bed { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.slot { aspect-ratio: 1; border-radius: 9px; box-shadow: inset 0 0 0 2px var(--line); background: var(--panel); display: grid; place-items: stretch; }
.slot .box { width: 100%; height: 100%; animation: land 0.3s ease; }
@keyframes land { from { transform: translateY(-30px) scale(0.6); opacity: 0; } to { transform: none; opacity: 1; } }
.queue { font-size: 14px; color: var(--ink-2); font-weight: 700; }
.dockbar { display: grid; gap: 8px; }
.dockbar .label { display: flex; justify-content: space-between; font: 600 15px/1 var(--display); color: var(--ink-2); }
.dslots { display: grid; grid-template-columns: repeat(3, minmax(0, 60px)); justify-content: center; gap: 8px; padding: 10px; border-radius: 14px; background: repeating-linear-gradient(-45deg, rgba(255, 197, 49, 0.35) 0 10px, transparent 10px 20px); box-shadow: inset 0 0 0 2px var(--yellow); }
.pile { display: grid; grid-template-columns: repeat(3, minmax(0, 64px)); gap: 8px; justify-content: center; padding: 14%; border-radius: 50%; aspect-ratio: 1; align-content: center; background: radial-gradient(circle, var(--sky-2) 0 62%, var(--hazard) 63% 66%, var(--yellow) 67% 70%, var(--hazard) 71% 74%, transparent 75%); max-width: 100%; margin: 0 auto; width: min(330px, 100%); }
.pile button { width: 100%; aspect-ratio: 1; height: auto; border: 0; border-radius: 14px; cursor: pointer; padding: 0; transition: transform 0.12s ease, opacity 0.25s ease; }
.pile button .box { width: 100%; height: 100%; border-radius: 14px; font-size: 28px; }
.pile button:hover { transform: translateY(-3px); }
.pile button:disabled { opacity: 0; transform: scale(0.4); cursor: default; }
.msg { min-height: 1.6em; text-align: center; font: 600 19px/1.3 var(--display); }
.msg.win { color: var(--green); } .msg.jam { color: var(--pink); }
.dg-actions { display: flex; justify-content: center; }

/* numbers band */
.big { display: grid; gap: 18px; }
@media (min-width: 820px) { .big { grid-template-columns: repeat(3, 1fr); } }
.stat { padding: 26px; border-radius: 26px; background: var(--panel); box-shadow: var(--shadow); display: grid; gap: 6px; }
.stat b { font: 700 54px/1 var(--display); color: var(--blue); }
.stat:nth-child(2) b { color: var(--orange); } .stat:nth-child(3) b { color: var(--green); }
.stat span { color: var(--ink-2); font-weight: 700; }

/* events */
.events { display: grid; gap: 12px; margin-top: 22px; }
.ev { display: grid; grid-template-columns: 14px 1fr; gap: 14px; align-items: center; padding: 14px 18px; border-radius: 18px; background: var(--panel); box-shadow: inset 0 0 0 2px var(--line); }
.ev i { width: 14px; height: 14px; border-radius: 4px; background: var(--c); }
.ev b { font: 600 19px/1.2 var(--display); }
.ev span { display: block; color: var(--ink-2); font-size: 16px; }

/* comfort */
.comfort { display: grid; gap: 14px; }
@media (min-width: 820px) { .comfort { grid-template-columns: repeat(3, 1fr); } }
.cf { padding: 22px; border-radius: 22px; background: var(--panel); box-shadow: inset 0 0 0 2px var(--line); display: grid; gap: 8px; align-content: start; }
.cf h3 { font-size: 22px; }
.cf p { color: var(--ink-2); font-size: 17px; }
.stickers { display: flex; gap: 8px; }

/* faq */
.faq { max-width: 820px; }
.faq details { padding: 18px 22px; border-radius: 18px; background: var(--panel); box-shadow: inset 0 0 0 2px var(--line); }
.faq details + details { margin-top: 12px; }
.faq summary { cursor: pointer; list-style: none; display: flex; justify-content: space-between; gap: 16px; font: 600 21px/1.3 var(--display); }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--blue); font: 700 26px/1 var(--display); transition: transform 0.2s; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { margin-top: 10px; color: var(--ink-2); }

.final { text-align: center; padding-block: 0; }
.final .town { position: relative; border-radius: 34px; overflow: hidden; min-height: 420px; display: grid; place-items: center; padding: 48px 20px; background: #3c8fe0 url("img/townart.webp") center / cover no-repeat; box-shadow: var(--shadow); }
.final .town::before { content: ""; position: absolute; inset: 0; background: radial-gradient(60% 70% at 50% 50%, rgba(12, 24, 52, 0.72), rgba(12, 24, 52, 0.25)); }
.final .inner { position: relative; display: grid; gap: 18px; justify-items: center; color: #fff; }
.final h2 { text-shadow: 0 4px 0 rgba(0, 0, 0, 0.25); }
.final .store { background: #fff; color: #1b2436; }

footer { margin-top: 88px; padding-block: 44px 60px; border-top: 2px solid var(--line); color: var(--ink-2); font-size: 16px; }
footer .wrap { display: grid; gap: 14px; }
footer nav { display: flex; flex-wrap: wrap; gap: 8px 22px; }
footer nav a { color: var(--ink); font: 600 17px/1.4 var(--display); text-decoration: none; }

/* document pages */
.doc { padding-block: 56px 88px; }
.doc .wrap { max-width: 820px; }
.doc h1 { font-size: clamp(44px, 6vw, 62px); margin-bottom: 18px; }
.doc h2 { font-size: 30px; margin: 40px 0 10px; }
.doc p, .doc li { color: var(--ink-2); }
.doc p + p { margin-top: 14px; }
.doc b, .doc strong { color: var(--ink); }
.doc details { padding: 16px 20px; border-radius: 16px; background: var(--panel); box-shadow: inset 0 0 0 2px var(--line); margin-top: 12px; }
.doc summary { cursor: pointer; font: 600 20px/1.35 var(--display); color: var(--ink); }
.doc details > p { margin-top: 10px; }
.doc .muted { color: var(--ink-2); }
.doc ul { padding-left: 22px; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .fly { display: none; }
}
