/* MazeOMatic 300 site: the game's look (night-blue glass, glossy candy capsules, jewel beads). */

:root {
  --night: #0b1224;
  --night-2: #131d3a;
  --ink: #f4f6ff;
  --muted: #b9c1dc;
  --card: rgba(255, 255, 255, 0.07);
  --card-edge: rgba(255, 255, 255, 0.14);
  --calm: linear-gradient(#5ad7ff, #1a8fe0);
  --challenge: linear-gradient(#ffd34d, #f08a12);
  --infuriate: linear-gradient(#ff7a6b, #d81e2a);
  --gold: #ffd25a;
  --pink: #ff74ad;
  --link: #8fd8ff;
  --radius: 24px;
  --page: 1060px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: ui-rounded, "SF Pro Rounded", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--ink);
  background: radial-gradient(1200px 700px at 50% -10%, #22336a 0%, var(--night) 60%) fixed, var(--night);
  line-height: 1.55;
  font-size: 18px;
}

a { color: var(--link); font-weight: 700; }
a:hover { color: #fff; }

.wrap { max-width: var(--page); margin: 0 auto; padding: 0 20px; }

section { padding: 64px 0; }
section.band { background: rgba(255, 255, 255, 0.035); border-top: 1px solid var(--card-edge); border-bottom: 1px solid var(--card-edge); }

h1, h2, h3 { line-height: 1.2; margin: 0 0 0.5em; }
h2 { font-size: clamp(28px, 4vw, 40px); font-weight: 900; }
h3 { font-size: 21px; font-weight: 800; }
p { margin: 0 0 1em; }
.center { text-align: center; }
.intro { color: var(--muted); max-width: 720px; margin: 0 auto; }

/* ---- Header ---- */

.topbar { padding: 18px 0; }
.topbar .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink); font-weight: 900; font-size: 20px; }
.brand img { width: 40px; height: 40px; border-radius: 10px; box-shadow: 0 4px 14px rgba(0, 0, 0, 0.5); }
.topbar nav a { margin-left: 18px; text-decoration: none; color: var(--ink); font-weight: 700; }
.topbar nav a:hover { color: var(--link); }

/* ---- Hero ---- */

.hero { padding: 28px 0 72px; text-align: center; }
.hero .icon { width: 132px; height: 132px; border-radius: 30px; box-shadow: 0 14px 40px rgba(0, 0, 0, 0.6), 0 0 60px rgba(90, 160, 255, 0.25); }
.hero h1 {
  font-size: clamp(40px, 8vw, 76px);
  font-weight: 900;
  margin: 26px 0 6px;
  background: linear-gradient(#ffffff, #ffe1a0);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 0 40px rgba(255, 210, 120, 0.25);
}
.tagline { font-size: clamp(21px, 3.2vw, 28px); font-weight: 800; margin: 0 auto 10px; max-width: 760px; }
.lede { font-size: 19px; color: var(--muted); max-width: 680px; margin: 0 auto 30px; }

/* Glass and emoji beads: cut-outs of the game's own beads (beads/*.png). */
.beads { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px; margin: 30px 0 26px; }
.bead {
  width: clamp(44px, 9vw, 76px);
  height: auto;
  aspect-ratio: 1;
  filter: drop-shadow(0 8px 10px rgba(0, 0, 0, 0.55));
  animation: roll 0.9s cubic-bezier(0.2, 0.9, 0.3, 1.2) both;
}
@keyframes roll {
  from { transform: translateX(-60px) rotate(-200deg); opacity: 0; }
  to { transform: none; opacity: 1; }
}
.beads .bead:nth-child(2) { animation-delay: 0.08s; }
.beads .bead:nth-child(3) { animation-delay: 0.16s; }
.beads .bead:nth-child(4) { animation-delay: 0.24s; }
.beads .bead:nth-child(5) { animation-delay: 0.32s; }
.beads .bead:nth-child(6) { animation-delay: 0.40s; }
.beads .bead:nth-child(7) { animation-delay: 0.48s; }
.beads .bead:nth-child(8) { animation-delay: 0.56s; }
.beads.glass { margin-bottom: 0; }
.beads.glass .bead { animation: none; width: clamp(40px, 8vw, 64px); }
@media (prefers-reduced-motion: reduce) { .bead { animation: none; } }

.store-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: #000;
  color: #fff;
  text-decoration: none;
  padding: 14px 26px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  font-weight: 800;
  font-size: 18px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5);
}
.store-badge:hover { color: #fff; transform: translateY(-1px); }
.small { font-size: 15px; color: var(--muted); margin-top: 14px; }

/* ---- Glossy capsules (the game's buttons) ---- */

.modes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-top: 30px; }
@media (max-width: 760px) { .modes { grid-template-columns: 1fr; } }
.mode {
  border-radius: var(--radius);
  padding: 24px 24px 26px;
  color: #fff;
  position: relative;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
}
.mode::before {          /* the glossy highlight along the top */
  content: "";
  position: absolute;
  inset: 4px 14px auto;
  height: 40%;
  border-radius: 20px 20px 60% 60% / 20px 20px 30px 30px;
  background: linear-gradient(rgba(255, 255, 255, 0.45), rgba(255, 255, 255, 0));
  pointer-events: none;
}
.mode h3 { font-size: 28px; font-weight: 900; text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35); margin-bottom: 4px; }
.mode .sub { font-weight: 800; opacity: 0.95; margin-bottom: 10px; text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3); }
.mode p { margin: 0; text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3); }
.mode.calm { background: var(--calm); box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45), 0 0 30px rgba(60, 180, 255, 0.35); }
.mode.challenge { background: var(--challenge); box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45), 0 0 30px rgba(255, 180, 40, 0.35); }
.mode.infuriate { background: var(--infuriate); box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45), 0 0 30px rgba(255, 60, 60, 0.35); }

/* ---- Feature cards ---- */

.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-top: 30px; }
@media (max-width: 900px) { .features { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .features { grid-template-columns: 1fr; } }
.card {
  background: var(--card);
  border: 1px solid var(--card-edge);
  border-radius: var(--radius);
  padding: 24px 22px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}
.card .badge {
  width: 54px;
  height: 54px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  font-size: 28px;
  margin-bottom: 14px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid var(--card-edge);
}
.card .badge svg { width: 34px; height: 34px; }
.card p { color: var(--muted); margin: 0; }

/* Some favorite emoji beads */
.emoji-wall { display: grid; grid-template-columns: repeat(9, 1fr); gap: 14px; margin: 28px auto 0; max-width: 820px; }
.emoji-wall .bead { width: 100%; animation: none; }
@media (max-width: 640px) { .emoji-wall { grid-template-columns: repeat(3, 1fr); gap: 18px; max-width: 300px; } }

/* ---- Screenshots ---- */

.shots { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 22px; margin-top: 30px; }
.shot { margin: 0; text-align: center; }
.shot .frame {
  aspect-ratio: 9 / 19.5;
  border-radius: 34px;
  background: rgba(255, 255, 255, 0.05);
  border: 3px dashed rgba(255, 255, 255, 0.22);
  display: grid;
  place-items: center;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
  color: var(--muted);
  font-weight: 700;
  padding: 12px;
}
.shot .frame img { width: 100%; height: 100%; object-fit: cover; display: block; }
.shot .frame:has(img) { border: none; padding: 0; }
.shot figcaption { margin-top: 12px; font-weight: 800; }

/* ---- Unlock ---- */

.pack {
  max-width: 640px;
  margin: 28px auto 0;
  text-align: center;
  border-radius: var(--radius);
  padding: 28px 26px;
  background: var(--card);
  border: 1px solid rgba(255, 210, 90, 0.4);
  box-shadow: 0 0 40px rgba(255, 190, 60, 0.15);
}
.pack h3 { color: var(--gold); font-size: 26px; font-weight: 900; }
.pack ul { list-style: none; padding: 0; margin: 0 0 6px; color: var(--muted); }
.pack li { margin: 4px 0; }

/* ---- Text pages (support, privacy) ---- */

.page { background: var(--card); border: 1px solid var(--card-edge); border-radius: var(--radius); padding: 36px clamp(22px, 5vw, 48px); margin: 12px 0 64px; }
.page h1 { font-size: clamp(30px, 5vw, 42px); font-weight: 900; }
.page h2 { font-size: 24px; margin-top: 1.6em; }
.page p, .page li { color: #dfe4f5; }
.page ul { padding-left: 1.2em; }
.page li { margin-bottom: 0.4em; }
.updated { color: var(--muted); font-size: 15px; }

details { background: rgba(255, 255, 255, 0.06); border: 1px solid var(--card-edge); border-radius: 14px; padding: 14px 18px; margin: 10px 0; }
details summary { font-weight: 800; cursor: pointer; }
details p { margin: 10px 0 0; color: var(--muted) !important; }

/* ---- Footer ---- */

footer { padding: 34px 0 44px; text-align: center; color: var(--muted); font-size: 15px; }
footer a { margin: 0 10px; }

@media (max-width: 560px) {
  body { font-size: 17px; }
  section { padding: 48px 0; }
  .topbar nav { white-space: nowrap; }
  .topbar nav a { margin-left: 12px; }
  .brand { font-size: 18px; }
  .beads { gap: 7px; }
  .beads .bead { width: 40px; }
  .beads.glass .bead { width: 35px; }
}

/* ---- Hero: title, tilting phone, text ---- */

.hero-grid {
  display: grid;
  grid-template-columns: 1fr minmax(260px, 340px);
  grid-template-areas: "intro phone" "rest phone";
  column-gap: 48px;
  align-items: center;
}
.hero-intro { grid-area: intro; align-self: end; }
.hero-rest { grid-area: rest; align-self: start; }
.hero-phone { grid-area: phone; width: min(100%, 330px, calc((100vh - 230px) * 0.43)); justify-self: center; }
@media (max-width: 820px) {
  .hero-grid { grid-template-columns: 1fr; grid-template-areas: "intro" "phone" "rest"; }
  .hero-intro .icon { width: 84px; height: 84px; border-radius: 20px; }
  .hero-intro h1 { margin-top: 14px; }
  .hero-phone { margin: 10px auto 6px; width: min(72vw, 300px, calc((100vh - 120px) * 0.43)); }
}

/* The phone: a body with rounded corners, a metal edge behind it for thickness, and the
   recorded game on its screen. JS sets the rotation from the recorded tilt. */
.stage { perspective: 1100px; position: relative; padding: 10px 0 40px; }
.device {
  position: relative;
  transform-style: preserve-3d;
  transform: rotateX(12deg);
  will-change: transform;
}
.device .body {
  position: relative;
  border-radius: 15% / 7%;
  padding: 3.6%;
  background: linear-gradient(145deg, #4a4f5c, #1c1f27 45%, #3b404c);
  box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, 0.18), inset 0 0 0 4px #0b0d12;
  transform: translateZ(6px);
}
.device .edge {               /* the phone's side, seen when it tilts */
  position: absolute;
  inset: 0;
  border-radius: 15% / 7%;
  background: linear-gradient(90deg, #2a2e37, #6a707d 30%, #2a2e37 60%, #555b67);
  transform: translateZ(-6px);
  box-shadow: 0 0 0 1px #0007;
}
.device .screen {
  position: relative;
  border-radius: 12% / 5.6%;
  overflow: hidden;
  background: #000;
  aspect-ratio: 590 / 1282;
}
.device video { width: 100%; height: 100%; display: block; object-fit: cover; }
.device .glare {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(115deg, rgba(255, 255, 255, 0) 30%, rgba(255, 255, 255, 0.13) 45%, rgba(255, 255, 255, 0) 60%);
  background-size: 250% 250%;
  mix-blend-mode: screen;
}
.device .tap {                /* a finger tap: the springs fire */
  position: absolute;
  left: 50%;
  top: 72%;
  width: 22%;
  aspect-ratio: 1;
  margin: -11% 0 0 -11%;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.85);
  background: rgba(255, 255, 255, 0.25);
  opacity: 0;
  pointer-events: none;
}
.device .tap.on { animation: tap 0.7s ease-out; }
@keyframes tap {
  0% { transform: scale(0.4); opacity: 0.95; }
  100% { transform: scale(1.6); opacity: 0; }
}
.device .button { position: absolute; width: 1.4%; background: #3d424d; border-radius: 2px; }
.device .power { right: -1.2%; top: 26%; height: 11%; }
.device .vol1 { left: -1.2%; top: 22%; height: 7%; }
.device .vol2 { left: -1.2%; top: 31%; height: 7%; }
.floor-shadow {
  position: absolute;
  left: 12%;
  right: 12%;
  bottom: 6px;
  height: 26px;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0));
  filter: blur(4px);
}
@media (min-width: 821px) {
  .hero { text-align: left; }
  .hero .beads { justify-content: flex-start; }
  .hero .lede, .hero .tagline { margin-left: 0; }
}

/* Play button, shown only when the browser won't autoplay the video. */
.device .play {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 34%;
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  border: 2px solid rgba(255, 255, 255, 0.75);
  border-radius: 50%;
  background: rgba(10, 16, 34, 0.55);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.5), 0 0 30px rgba(90, 215, 255, 0.35);
  display: grid;
  place-items: center;
  cursor: pointer;
  padding: 0;
}
.device .play[hidden] { display: none; }
.device .play svg { width: 46%; height: 46%; fill: #fff; margin-left: 8%; }
.device .play:hover { background: rgba(10, 16, 34, 0.7); }
