/* Wumblies website
   Palette: a pale sky page (the playroom air), plum ink, and the six felt colours of the cast.
   The cast colours only appear where they mean a character: the wordmark letters, the friend tabs and panels. */

:root {
  --sky: #EAF0FA;
  --sky-deep: #D9E4F5;
  --paper: #FBFCFF;
  --ink: #2A2140;
  --ink-soft: #5A5470;
  --line: rgba(42, 33, 64, 0.16);

  --loopy: #7A4CC2;
  --bruno: #E08A1E;
  --pebble: #4F6487;
  --zip: #2F6FD0;
  --rosie: #DD4C78;
  --fern: #5E8F24;

  --action: var(--loopy);
  --action-dark: #5E35A0;

  --font-display: "Grandstander", "Comic Sans MS", system-ui, sans-serif;
  --font-body: "Atkinson Hyperlegible", system-ui, -apple-system, "Segoe UI", sans-serif;

  /* type scale (minor third, 1.2) */
  --step--1: 0.875rem;
  --step-0: 1.0625rem;
  --step-1: 1.275rem;
  --step-2: 1.53rem;
  --step-3: clamp(1.9rem, 1.4rem + 2vw, 2.6rem);
  --step-hero: clamp(3.4rem, 1rem + 13vw, 11rem);

  --page: 1160px;
  --gutter: clamp(16px, 4vw, 40px);
  --radius-soft: 28px;
  --stitch: 2px dashed rgba(255, 255, 255, 0.75);
}

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

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--sky);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--step-0);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }

h1, h2, h3 { font-family: var(--font-display); line-height: 1.1; margin: 0; }
h2 { font-size: var(--step-3); font-weight: 900; letter-spacing: -0.01em; }
h3 { font-size: var(--step-1); font-weight: 800; }
p { margin: 0 0 1em; }

a { color: inherit; }
:focus-visible { outline: 3px solid var(--zip); outline-offset: 3px; border-radius: 6px; }

.skip {
  position: absolute; left: 12px; top: -60px; z-index: 10;
  background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 10px; text-decoration: none;
}
.skip:focus { top: 12px; }

/* ---------------------------------------------------------------- buttons */

.button {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px; padding: 0 26px;
  border: 0; border-radius: 999px;
  background: var(--action); color: #fff;
  font: 800 var(--step-0)/1 var(--font-display);
  text-decoration: none; cursor: pointer;
  box-shadow: inset 0 0 0 4px var(--action), inset 0 0 0 6px rgba(255, 255, 255, 0.55); /* stitched edge */
}
.button:hover { background: var(--action-dark); box-shadow: inset 0 0 0 4px var(--action-dark), inset 0 0 0 6px rgba(255, 255, 255, 0.55); }
.button--small { min-height: 40px; padding: 0 18px; font-size: var(--step--1); }

.link { font-weight: 700; text-underline-offset: 4px; text-decoration-thickness: 2px; }
.link:hover { color: var(--action); }

/* ---------------------------------------------------------------- header */

.site-header {
  max-width: var(--page); margin: 0 auto; padding: 18px var(--gutter);
  display: flex; align-items: center; gap: 24px;
}
.brand {
  font: 900 var(--step-2)/1 var(--font-display);
  color: var(--loopy); text-decoration: none; margin-right: auto;
}
.site-header ul { display: flex; gap: 22px; list-style: none; margin: 0; padding: 0; }
.site-header nav a { text-decoration: none; font-weight: 700; color: var(--ink-soft); }
.site-header nav a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 4px; }
@media (max-width: 720px) { .site-header nav { display: none; } }

/* ---------------------------------------------------------------- hero */

.hero {
  max-width: var(--page); margin: 0 auto; padding: clamp(12px, 3vw, 40px) var(--gutter) 0;
  text-align: center;
}
.status {
  display: inline-block; margin: 0 0 8px; padding: 4px 14px;
  border: 2px dashed var(--line); border-radius: 999px;
  font-size: var(--step--1); font-weight: 700; color: var(--ink-soft);
}
.wordmark {
  font-size: var(--step-hero); font-weight: 900; letter-spacing: -0.02em; line-height: 0.95;
  filter: url(#felt);
  margin: 0 0 0.12em;
}
.wordmark span {
  display: inline-block; color: var(--c);
  text-shadow: 0 0.04em 0 color-mix(in srgb, var(--c), #000 25%);
}
/* the one orchestrated moment: the letters plop down one after another, like puppets landing */
@media (prefers-reduced-motion: no-preference) {
  .wordmark span { animation: plop 700ms cubic-bezier(.3, 1.6, .5, 1) both; }
  .wordmark span:nth-child(1) { animation-delay: 60ms; }
  .wordmark span:nth-child(2) { animation-delay: 140ms; }
  .wordmark span:nth-child(3) { animation-delay: 220ms; }
  .wordmark span:nth-child(4) { animation-delay: 300ms; }
  .wordmark span:nth-child(5) { animation-delay: 380ms; }
  .wordmark span:nth-child(6) { animation-delay: 460ms; }
  .wordmark span:nth-child(7) { animation-delay: 540ms; }
  .wordmark span:nth-child(8) { animation-delay: 620ms; }
}
@keyframes plop {
  0%   { transform: translateY(-0.5em) scaleY(1.1); opacity: 0; }
  60%  { transform: translateY(0) scale(1.08, 0.88); opacity: 1; }
  100% { transform: none; }
}

.pitch {
  max-width: 34em; margin: 0 auto 26px;
  font-size: var(--step-1); line-height: 1.45; color: var(--ink-soft);
}
.hero-actions { display: flex; gap: 22px; align-items: center; justify-content: center; flex-wrap: wrap; }
.hero-group { width: min(1000px, 100%); margin: clamp(8px, 2vw, 24px) auto -40px; position: relative; z-index: 1; }

/* ---------------------------------------------------------------- sections */

main > section:not(.hero) {
  max-width: var(--page); margin: 0 auto; padding: clamp(56px, 8vw, 104px) var(--gutter) 0;
}
.section-head { max-width: 40em; margin-bottom: 32px; }
.section-head h2 { margin-bottom: 12px; }
.section-head p { color: var(--ink-soft); font-size: var(--step-1); line-height: 1.45; }

/* ---------------------------------------------------------------- friends */

.friends { position: relative; }
.cast-tabs {
  display: grid; grid-template-columns: repeat(6, 1fr); gap: clamp(8px, 1.6vw, 18px);
  margin-bottom: 20px;
}
.cast-tabs button {
  appearance: none; border: 0; background: none; padding: 0; cursor: pointer;
  display: grid; justify-items: center; gap: 8px;
  font: 800 var(--step-0)/1.1 var(--font-display); color: var(--ink-soft);
}
.cast-tabs img {
  width: 100%; max-width: 128px; aspect-ratio: 1; border-radius: 50%;
  outline: 4px solid transparent; outline-offset: 3px;
  transition: outline-color 150ms, transform 150ms;
}
.cast-tabs button:hover img { transform: translateY(-3px); }
.cast-tabs button[aria-selected="true"] { color: var(--ink); text-decoration: underline 3px var(--c); text-underline-offset: 6px; }
.cast-tabs button[aria-selected="true"] img { outline-color: var(--c); }
.cast-tabs button:focus-visible { outline: none; }
.cast-tabs button:focus-visible img { outline: 4px solid var(--ink); }

.cast-panel {
  display: grid; grid-template-columns: minmax(160px, 260px) 1fr; gap: clamp(20px, 4vw, 48px); align-items: center;
  /* the character colour, deepened so white text stays readable on every one of them */
  background: color-mix(in srgb, var(--c) 68%, #1A1030); color: #fff;
  border-radius: var(--radius-soft); padding: clamp(22px, 4vw, 44px);
  outline: var(--stitch); outline-offset: -12px; /* the stitched seam of a felt patch */
}
.cast-panel[hidden] { display: none; }
.cast-panel img { width: 100%; border-radius: 50%; background: rgba(255, 255, 255, 0.15); }
.cast-panel h3 { font-size: var(--step-3); font-weight: 900; }
.cast-panel .trick { font: 800 var(--step-1)/1.2 var(--font-display); opacity: 0.85; margin: 4px 0 14px; }
.cast-panel p { max-width: 34em; }
.cast-panel .height { font-size: var(--step--1); opacity: 0.85; margin: 0; }
@media (prefers-reduced-motion: no-preference) {
  .cast-panel.is-new img { animation: squish 420ms cubic-bezier(.3, 1.5, .5, 1); }
}
@keyframes squish { 0% { transform: scale(0.85, 1.1); } 100% { transform: none; } }

@media (max-width: 640px) {
  .cast-tabs { grid-template-columns: repeat(3, 1fr); }
  .cast-panel { grid-template-columns: 1fr; text-align: left; }
  .cast-panel img { max-width: 120px; }
}

/* ---------------------------------------------------------------- how it plays */

.shot { margin: 0; }
.shot img { border-radius: var(--radius-soft); width: 100%; }
.shot figcaption { margin-top: 10px; font-size: var(--step--1); color: var(--ink-soft); }

.points {
  list-style: none; margin: 40px 0; padding: 0;
  display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(20px, 4vw, 48px);
}
.points h3 { margin-bottom: 8px; }
.points p { color: var(--ink-soft); margin: 0; }
/* the party shot: a big handwritten-feeling caption beside it instead of a small one under it */
.shot--party { display: grid; grid-template-columns: 1fr 2fr; gap: clamp(20px, 4vw, 48px); align-items: center; }
.shot--party figcaption { margin: 0; font: 800 var(--step-2)/1.25 var(--font-display); color: var(--ink); }
@media (max-width: 720px) { .shot--party { grid-template-columns: 1fr; } .shot--party figcaption { order: 2; font-size: var(--step-1); } }
@media (max-width: 820px) { .points { grid-template-columns: 1fr; } }

/* ---------------------------------------------------------------- worlds */

.world-list {
  list-style: none; margin: 0; padding: 0;
  columns: 2 22em; column-gap: clamp(24px, 5vw, 64px);
}
.world-list li {
  break-inside: avoid;
  padding: 12px 0 12px 30px; position: relative;
  border-top: 1px solid var(--line);
  color: var(--ink-soft);
}
.world-list li::before {
  content: ""; position: absolute; left: 0; top: 17px;
  width: 16px; height: 16px; border-radius: 50%; background: var(--w);
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.5);
}
.world-list strong { display: block; color: var(--ink); font: 800 var(--step-0)/1.3 var(--font-display); }

/* ---------------------------------------------------------------- updates */

main > section.updates { padding-bottom: clamp(56px, 8vw, 104px); }
.updates-card {
  background: var(--paper);
  border-radius: var(--radius-soft); padding: clamp(24px, 5vw, 56px);
  border: 2px dashed var(--line);
  max-width: 760px;
}
.updates-card h2 { margin-bottom: 10px; }
.updates-card > p { color: var(--ink-soft); max-width: 32em; }
.signup label { display: block; font-weight: 700; margin-bottom: 8px; }
.signup-row { display: flex; gap: 12px; flex-wrap: wrap; }
.signup input[type="email"] {
  flex: 1 1 240px; min-height: 48px; padding: 0 18px;
  border: 2px solid var(--line); border-radius: 999px; background: #fff;
  font: inherit; color: var(--ink);
}
.signup input[type="email"]:focus-visible { outline: 3px solid var(--zip); outline-offset: 2px; border-color: transparent; }
.signup input[aria-invalid="true"] { border-color: var(--rosie); }
.signup-message { margin: 12px 0 0; min-height: 1.5em; font-weight: 700; }
.signup-message.is-error { color: #B42352; }
.signup-message.is-ok { color: var(--fern); }
.trap { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ---------------------------------------------------------------- footer */

.site-footer {
  width: min(100% - 2 * var(--gutter), var(--page) - 2 * var(--gutter)); margin: 0 auto; padding: 28px 0 40px;
  border-top: 1px solid var(--line);
  display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  font-size: var(--step--1); color: var(--ink-soft);
}
.site-footer p { margin: 0; }
.site-footer { align-items: center; }
.social { display: flex; gap: 8px; margin: 0; padding: 0; list-style: none; }
.social-btn {
  display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 50%;
  background: var(--paper); border: 1px solid var(--line); color: var(--ink-soft);
  font-size: 1.15rem; text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}
.social-btn:hover { background: var(--action); border-color: var(--action); color: #fff; transform: translateY(-3px); }
@media (prefers-reduced-motion: reduce) { .social-btn:hover { transform: none; } }
