/* The front page. Colours are the app's Bubblegum theme, and Night Candy in dark mode
   (web/src/core/theme/palettes.ts). */

@font-face {
  font-family: 'Fredoka';
  src: url('/fonts/fredoka-latin.woff2') format('woff2');
  font-weight: 300 700;
  font-display: swap;
}

:root {
  --bg-top: #ffe3f1;
  --bg-bottom: #e6f0ff;
  --text: #6b4f8f;
  --accent: #ff8fc7;
  --accent-shadow: #e36aa8;
  --on-accent: #3d2a5c;
  --stroke: #ffa6d1;
  --screen: #ffffff;
  --bezel: #4b3a6e;
  --drop: rgba(107, 79, 143, 0.2);
  --t0: #ffc8dd; --t1: #bde0fe; --t2: #cdf5c8; --t3: #fff1a8;
  --t4: #e2c8ff; --t5: #ffd6b0; --t6: #b8f2e6; --t7: #ffb5c8;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg-top: #2a2058;
    --bg-bottom: #14264f;
    --text: #cfc4ff;
    --accent: #ff6fb5;
    --accent-shadow: #c74a8a;
    --on-accent: #1e1440;
    --stroke: #ff8fc7;
    --screen: #2f2760;
    --bezel: #0a0820;
    --drop: rgba(0, 0, 0, 0.4);
    --t0: #ff9ed2; --t1: #8fd8ff; --t2: #a8f0b8; --t3: #ffe58a;
    --t4: #c6a8ff; --t5: #ffb98a; --t6: #7ff0e0; --t7: #ff8fb0;
  }
}

* { box-sizing: border-box; }

html, body { margin: 0; min-height: 100%; }

body {
  min-height: 100vh;
  min-height: 100dvh;
  background: linear-gradient(var(--bg-top), var(--bg-bottom)) fixed;
  color: var(--text);
  font-family: 'Fredoka', ui-rounded, 'SF Pro Rounded', system-ui, sans-serif;
  display: grid;
  place-items: center;
}

.hero {
  width: min(1040px, 100%);
  padding: 48px 32px;
  display: flex;
  align-items: center;
  gap: 56px;
}

.intro { flex: 1; }

h1 {
  margin: 0;
  font-size: clamp(3rem, 8vw, 5.5rem);
  font-weight: 600;
  line-height: 1;
}

.tagline {
  margin: 16px 0 0;
  font-size: clamp(1.15rem, 2.2vw, 1.5rem);
  line-height: 1.4;
  max-width: 28ch;
}

.open {
  display: inline-block;
  margin-top: 28px;
  padding: 14px 36px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--on-accent);
  font-size: 1.35rem;
  font-weight: 600;
  text-decoration: none;
  box-shadow: 0 6px 0 var(--accent-shadow);
  transition: transform 120ms ease, box-shadow 120ms ease;
}

.open:hover { transform: translateY(-2px); box-shadow: 0 8px 0 var(--accent-shadow); }
.open:active { transform: translateY(4px) scale(0.98, 0.94); box-shadow: 0 2px 0 var(--accent-shadow); }
.open:focus-visible { outline: 4px solid var(--text); outline-offset: 4px; }

.note { margin: 20px 0 0; font-size: 1rem; }

/* The drawing: a tablet with a phone in front of it. */
.devices { position: relative; flex: 1.1; aspect-ratio: 1.25; }

.tablet, .phone {
  position: absolute;
  background: var(--screen);
  border: 6px solid var(--bezel);
  border-radius: 22px;
  box-shadow: 0 10px 28px var(--drop);
}

.tablet { left: 0; top: 4%; width: 82%; padding: 14px; }
.phone { right: 0; bottom: 0; width: 34%; padding: 9px; border-radius: 20px; }

.tray {
  display: flex;
  gap: 6px;
  align-items: center;
  height: 38px;
  padding: 0 8px;
  margin-bottom: 12px;
  border: 3px solid var(--stroke);
  border-radius: 12px;
  font-size: 1.2rem;
}

.phone .tray { height: 26px; margin-bottom: 8px; font-size: 0.8rem; border-width: 2px; border-radius: 9px; }

.grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.phone .grid { grid-template-columns: repeat(2, 1fr); gap: 7px; }

.tile {
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  border-radius: 18%;
  font-size: clamp(1.2rem, 3vw, 2rem);
  box-shadow: 0 4px 0 rgba(0, 0, 0, 0.12);
  animation: bob 3.2s ease-in-out infinite;
}

.phone .tile { font-size: clamp(0.9rem, 2vw, 1.3rem); }

.t0 { background: var(--t0); animation-delay: 0s; }
.t1 { background: var(--t1); animation-delay: -0.4s; }
.t2 { background: var(--t2); animation-delay: -0.8s; }
.t3 { background: var(--t3); animation-delay: -1.2s; }
.t4 { background: var(--t4); animation-delay: -1.6s; }
.t5 { background: var(--t5); animation-delay: -2s; }
.t6 { background: var(--t6); animation-delay: -2.4s; }
.t7 { background: var(--t7); animation-delay: -2.8s; }

@keyframes bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}

@media (prefers-reduced-motion: reduce) {
  .tile { animation: none; }
  .open { transition: none; }
}

/* Phones: one column, a full-width button, and the drawing shrinks to a row of tiles. */
@media (max-width: 720px) {
  .hero { flex-direction: column; align-items: stretch; gap: 32px; padding: 40px 16px; text-align: center; }
  .tagline { margin-inline: auto; }
  .open { display: block; }
  .devices { aspect-ratio: auto; }
  .phone, .tablet .tray { display: none; }
  .tablet { position: static; width: 100%; padding: 12px; }
  .tablet .tile:nth-child(n + 5) { display: none; }
}
