/* ==========================================================================
   Tesselle — playtesselle.com
   Pure CSS. No build step, no dependencies. Mirrors the app's title screen:
   drifting pastel blobs, small rising tiles, the tile-as-T wordmark.
   ========================================================================== */

:root {
  /* brand palette (PuzzleLibrary.brandPalette) */
  --blue-deep:  #6B8BD6;
  --blue:       #9FBDEB;
  --pink:       #F2AEAE;
  --yellow:     #F7E3A1;
  --frame:      #171717;

  --ink:        #1C1C1E;
  --muted:      color-mix(in oklab, var(--ink) 58%, transparent);
  --line:       color-mix(in oklab, var(--ink) 12%, transparent);
  --card:       color-mix(in oklab, white 55%, transparent);
  --tile:       rgba(255, 255, 255, 0.45);
  --base:       var(--blue);

  --measure: 64ch;
  --gutter: clamp(1.25rem, 5vw, 3rem);
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --blue-deep:  #3A4F8F;
    --blue:       #4E6797;
    --pink:       #8F5F66;
    --yellow:     #8F834F;
    --ink:        #F4F4F6;
    --muted:      color-mix(in oklab, var(--ink) 62%, transparent);
    --line:       color-mix(in oklab, var(--ink) 16%, transparent);
    --card:       color-mix(in oklab, black 28%, transparent);
    --tile:       rgba(255, 255, 255, 0.14);
    --base:       #2D3B63;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100svh;
  font-family: var(--font);
  font-size: clamp(1rem, 0.95rem + 0.25vw, 1.125rem);
  line-height: 1.65;
  color: var(--ink);
  background: var(--base);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* --------------------------------------------------------------------------
   Ambient background: fixed-color blobs that wander, like DreamyBackground
   -------------------------------------------------------------------------- */

.sky, .tiles { position: fixed; inset: 0; pointer-events: none; z-index: 0; overflow: hidden; }

.blob {
  position: absolute;
  width: 70vmax; height: 70vmax;
  border-radius: 50%;
  filter: blur(40px);
  opacity: 0.9;
  animation: drift var(--dur, 70s) ease-in-out infinite alternate;
  animation-delay: var(--delay, 0s);
  will-change: transform;
}
.blob--1 { left: -25vmax; top: -30vmax; background: radial-gradient(closest-side, var(--blue-deep), transparent); --dur: 72s; }
.blob--2 { right: -30vmax; top: -15vmax; background: radial-gradient(closest-side, var(--pink), transparent); --dur: 84s; --delay: -20s; }
.blob--3 { right: -20vmax; bottom: -35vmax; background: radial-gradient(closest-side, var(--yellow), transparent); --dur: 66s; --delay: -40s; }
.blob--4 { left: -30vmax; bottom: -25vmax; background: radial-gradient(closest-side, var(--pink), transparent); --dur: 90s; --delay: -10s; opacity: 0.8; }
.blob--5 { left: 20vmax; top: 25vmax; width: 45vmax; height: 45vmax; background: radial-gradient(closest-side, rgba(255,255,255,0.9), transparent); --dur: 60s; --delay: -30s; opacity: 0.8; }

@keyframes drift {
  0%   { transform: translate(0, 0) scale(1); }
  33%  { transform: translate(14vmax, 8vmax) scale(1.15); }
  66%  { transform: translate(-6vmax, 16vmax) scale(0.9); }
  100% { transform: translate(10vmax, -10vmax) scale(1.1); }
}

/* small white tiles rising, confetti in slow motion */
.tile {
  position: absolute;
  bottom: -6vh;
  left: var(--x);
  width: var(--s); height: var(--s);
  border-radius: 28%;
  background: var(--tile);
  animation: rise var(--dur) linear infinite;
  animation-delay: var(--delay);
  will-change: transform;
}
@keyframes rise {
  from { transform: translateY(0) rotate(0deg); }
  to   { transform: translateY(-118vh) rotate(var(--spin, 200deg)); }
}

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

/* --------------------------------------------------------------------------
   Page
   -------------------------------------------------------------------------- */

.page {
  position: relative; z-index: 1;
  min-height: 100svh;
  display: flex; flex-direction: column;
  padding: var(--gutter);
}

.masthead { display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.masthead a { color: var(--ink); text-decoration: none; font-weight: 600; }
.masthead nav a { font-weight: 500; color: var(--muted); }
.masthead nav a:hover { color: var(--ink); }

main { flex: 1; display: flex; flex-direction: column; justify-content: center; }

/* wordmark: the tile stands in for the T, tilted and tucked over the rest of the word */
.wordmark {
  /* Centre the tile on the line rather than on the baseline: baseline placement of an inline SVG
     differs between WebKit and Blink, centring does not. */
  display: inline-flex; align-items: center; gap: 0;
  margin: 0;
  font-weight: 600;
  letter-spacing: 0.01em;
  line-height: 1;
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
}
.wordmark__tile {
  /* viewBox carries a 12-unit margin on each side so the tilted corners aren't clipped;
     the box is 134/110 of the tile, hence the slightly larger size and tighter margin. */
  width: 1.49em; height: 1.49em;
  margin: 0 -0.2em 0 -0.14em;
  overflow: visible;
  transform: translateY(0.08em);   /* a touch low, like the app's card hanging below the baseline */
  filter: drop-shadow(0 0.08em 0.18em rgba(0,0,0,0.18));
  flex: none;
}
.wordmark--hero { font-size: clamp(3rem, 11vw, 6rem); }
.wordmark--small { font-size: 1.35rem; }

.hero { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 0; }
/* the tagline is the wordmark's subtitle; the pill and lede sit apart below */
.hero .tagline { margin: 0.9rem 0 0; font-size: clamp(1.1rem, 2.4vw, 1.4rem); color: var(--muted); }
.hero .pill { margin-top: clamp(3rem, 14vmin, 8rem); }  /* 8rem on desktop, ~3rem on a phone */
.hero .lede { margin: 1rem 0 0; max-width: 40ch; font-size: clamp(1rem, 1.9vw, 1.2rem); }

.pill {
  display: inline-block; margin: 0;
  padding: 0.35rem 0.9rem;
  border-radius: 999px;
  background: var(--card);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  font-size: 0.85rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--muted);
}

/* privacy page */
.prose { max-width: var(--measure); margin: 1.5rem auto 0; width: 100%; }
.prose .card {
  background: var(--card);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-radius: 24px;
  padding: clamp(1.25rem, 4vw, 2.5rem);
  box-shadow: 0 10px 30px rgba(0,0,0,0.08);
}
.prose h1 { font-size: clamp(2rem, 5vw, 2.75rem); line-height: 1.1; margin: 0 0 0.25rem; }
.prose .meta { color: var(--muted); margin: 0 0 1.5rem; }
.prose h2 { font-size: 1.2rem; margin: 1.75rem 0 0.5rem; }
.prose p, .prose li { margin: 0.5rem 0; }
.prose a { color: inherit; }
.prose ul { padding-left: 1.25rem; }

.footer {
  margin-top: 2rem;
  display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; justify-content: space-between;
  font-size: 0.9rem; color: var(--muted);
}
.footer a { color: inherit; }
.footer p { margin: 0; }
