/* Treble Town site styles.
   Palette and feel are taken verbatim from the app repo's ART-DIRECTION.md and
   src/art/palette.ts. Do not invent colours here: change them there first.

   Two hard constraints from the app's Kids Category / COPPA rules, which this site follows
   so the whole brand has one posture:
     - No third-party requests at all. No web fonts, no CDN, no remote images, no analytics.
       Type is the device's own rounded system stack.
     - No cookies and no client-side script. There is no JS on this site.
   Outlines are plum (#3b2a4a), never black. Text contrast stays at 4.5:1 or better. */

:root {
  --ink: #3b2a4a;
  --paper: #fffaf0;
  --cream: #fff4e0;
  --red: #ef5a5a;
  --pink: #ff8fb1;
  --orange: #ffa84a;
  --yellow: #ffd45a;
  --mint: #6fd3b0;
  --sky: #6ec3f0;
  --purple: #9b7be0;
  --wood: #c98b5a;
  --wood-dark: #9a6440;
  --dusk1: #4a3570;
  --dusk2: #8a4f8f;
  --dusk3: #e3829a;

  --surface: var(--paper);
  --surface-2: var(--cream);
  --text: var(--ink);
  /* Muted text is a tint of the plum ink rather than grey, so nothing on the page is neutral
     grey against warm paper. Checked at 4.5:1 on both --paper and --cream. */
  --text-muted: #6a587a;
  --rule: #e7dcc9;
  --card-shadow: 0 2px 0 #efe3cf, 0 10px 24px rgba(59, 42, 74, 0.08);

  --radius: 18px;
  --radius-lg: 26px;
  --measure: 34rem;

  --font: ui-rounded, "SF Pro Rounded", system-ui, -apple-system, "Segoe UI Variable Display",
    "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    /* The brand is a carnival at dusk, so dark mode deepens into the dusk sky rather than
       inverting to grey. Paper surfaces become plum; the candy accents stay as they are. */
    --surface: #2a1d38;
    --surface-2: #35264780;
    --text: #f6ecdf;
    --text-muted: #c3b2d0;
    --rule: #4a3a5c;
    --card-shadow: 0 2px 0 #241530, 0 10px 24px rgba(0, 0, 0, 0.3);
  }
}

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

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

body {
  margin: 0;
  background: var(--surface);
  color: var(--text);
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.65;
  /* The site is read by a parent on a phone as often as on a desktop. */
  -webkit-font-smoothing: antialiased;
}

/* ---------- layout ---------- */

.wrap {
  width: 100%;
  max-width: 62rem;
  margin: 0 auto;
  padding: 0 16px; /* 16px gutter so nothing touches the edge on a phone */
}

main {
  display: block;
}

section {
  padding: clamp(2.25rem, 6vw, 4rem) 0;
}

section + section {
  border-top: 1px solid var(--rule);
}

h1,
h2,
h3 {
  text-wrap: balance;
  line-height: 1.15;
  margin: 0 0 0.6em;
  letter-spacing: -0.01em;
}

h1 {
  font-size: clamp(2.1rem, 7vw, 3.4rem);
  font-weight: 800;
}

h2 {
  font-size: clamp(1.45rem, 4vw, 2rem);
  font-weight: 750;
}

h3 {
  font-size: 1.1rem;
  font-weight: 700;
}

p {
  margin: 0 0 1rem;
  max-width: var(--measure);
}

a {
  color: inherit;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

a:hover {
  text-decoration-color: var(--pink);
}

:focus-visible {
  outline: 3px solid var(--sky);
  outline-offset: 3px;
  border-radius: 6px;
}

/* ---------- hero: the dusk sky with a string-light garland ---------- */

.hero {
  position: relative;
  overflow: hidden;
  background: linear-gradient(170deg, var(--dusk1) 0%, var(--dusk2) 58%, var(--dusk3) 100%);
  color: #fff6ec;
  padding: clamp(2.5rem, 7vw, 4.5rem) 0 clamp(3rem, 8vw, 5rem);
  border-bottom: 3px solid var(--ink);
}

.hero h1,
.hero p {
  color: #fff6ec;
}

.hero .tagline {
  font-size: clamp(1.05rem, 2.6vw, 1.3rem);
  font-weight: 650;
  color: #ffe6c9;
  margin-bottom: 0.35rem;
}

.hero .lead {
  font-size: clamp(1.05rem, 2.4vw, 1.2rem);
  max-width: 30rem;
}

.hero-mark {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 1.4rem;
}

.hero-mark img {
  width: 54px;
  height: 54px;
  border-radius: 14px;
  border: 2.5px solid var(--ink);
  background: var(--dusk1);
}

.hero-mark span {
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: -0.01em;
}

/* String lights. Drawn with CSS only: a swag of bulbs across the top of the sky.
   Decorative, so it is hidden from assistive tech and from reduced-motion users' animation. */
.lights {
  display: flex;
  justify-content: space-between;
  gap: 2px;
  margin-bottom: 1.6rem;
  padding: 0 2px;
}

.lights i {
  display: block;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  border: 2px solid rgba(59, 42, 74, 0.5);
  flex: 0 0 auto;
  opacity: 0.95;
}

/* The bulbs hang on an alternating sag so the wire reads as a swag rather than a ruler. */
.lights i:nth-child(odd) {
  transform: translateY(5px);
}

.lights i:nth-child(6n + 1) { background: var(--yellow); }
.lights i:nth-child(6n + 2) { background: var(--pink); }
.lights i:nth-child(6n + 3) { background: var(--mint); }
.lights i:nth-child(6n + 4) { background: var(--sky); }
.lights i:nth-child(6n + 5) { background: var(--orange); }
.lights i:nth-child(6n + 6) { background: var(--red); }

.status {
  display: inline-block;
  margin-top: 1.5rem;
  padding: 0.5rem 0.95rem;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: var(--yellow);
  color: var(--ink);
  font-weight: 700;
  font-size: 0.95rem;
}

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

.cards {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  margin-top: 1.5rem;
}

.card {
  background: var(--surface-2);
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  padding: 1.1rem 1.15rem 1.2rem;
  box-shadow: var(--card-shadow);
}

.card p:last-child {
  margin-bottom: 0;
}

.card p {
  max-width: none;
  color: var(--text-muted);
}

/* The awning stripe gives each card its booth colour, as the booths do in the app. */
.card {
  position: relative;
  padding-top: 1.5rem;
}

.card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 9px;
  border-radius: 16px 16px 0 0;
  background: repeating-linear-gradient(
    90deg,
    var(--awning, var(--mint)) 0 14px,
    var(--paper) 14px 28px
  );
  border-bottom: 2px solid var(--ink);
}

.card:nth-child(4n + 1) { --awning: var(--mint); }
.card:nth-child(4n + 2) { --awning: var(--sky); }
.card:nth-child(4n + 3) { --awning: var(--orange); }
.card:nth-child(4n + 4) { --awning: var(--pink); }

/* ---------- art ----------
   Images come from the app repo's approved packs (public/art/watercolor and public/art/clay).
   Both packs are final and are being A/B tested in the app, so the site shows both rather than
   picking a winner. Do not add generated art here: those two folders are the only approved art. */

.art-pair {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr));
  margin-top: 1.5rem;
}

figure {
  margin: 0;
}

figure img {
  display: block;
  width: 100%;
  height: auto;
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  box-shadow: var(--card-shadow);
  background: var(--surface-2);
}

figcaption {
  margin-top: 0.6rem;
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text-muted);
}

/* The plush row. Transparent PNGs, so they sit on the page with no frame. */
.plush {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  align-items: flex-end;
  margin-top: 1.25rem;
}

.plush img {
  width: clamp(76px, 18vw, 116px);
  height: auto;
  display: block;
}

/* ---------- plain lists ---------- */

.ticks {
  list-style: none;
  padding: 0;
  margin: 1rem 0 0;
  max-width: var(--measure);
}

.ticks li {
  position: relative;
  padding-left: 1.75rem;
  margin-bottom: 0.6rem;
}

/* A ticket stub rather than a checkmark, to match the app's reward. */
.ticks li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 15px;
  height: 10px;
  border: 2px solid var(--ink);
  border-radius: 3px;
  background: var(--yellow);
}

/* ---------- price ---------- */

.price {
  background: var(--surface-2);
  border: 2px solid var(--ink);
  border-radius: var(--radius-lg);
  padding: 1.3rem 1.4rem;
  max-width: var(--measure);
  box-shadow: var(--card-shadow);
}

.price strong {
  font-size: 1.15rem;
}

.price p:last-child {
  margin-bottom: 0;
}

/* ---------- legal pages ---------- */

.legal {
  padding: clamp(2rem, 5vw, 3.25rem) 0 1rem;
}

.legal h1 {
  font-size: clamp(1.8rem, 5vw, 2.6rem);
}

.legal .updated {
  color: var(--text-muted);
  font-weight: 650;
  margin-bottom: 2rem;
}

.legal h2 {
  font-size: 1.25rem;
  margin-top: 2.25rem;
}

.legal h3 {
  margin-top: 1.5rem;
}

.legal p,
.legal li {
  max-width: 40rem;
}

.legal ul {
  padding-left: 1.2rem;
}

.legal li {
  margin-bottom: 0.5rem;
}

/* A short summary box at the top of each legal page, so a parent gets the answer
   before the detail. The detail below is what governs. */
.summary {
  background: var(--surface-2);
  border: 2px solid var(--ink);
  border-left-width: 9px;
  border-radius: var(--radius);
  padding: 1.1rem 1.2rem;
  margin: 0 0 2rem;
  max-width: 40rem;
}

.summary p:last-child {
  margin-bottom: 0;
}

.toplink {
  display: inline-block;
  padding: 1rem 0 0;
  font-weight: 700;
}

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

footer {
  border-top: 3px solid var(--ink);
  background: var(--surface-2);
  padding: 2rem 0 2.5rem;
  margin-top: 2rem;
}

footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 1.5rem;
  margin-bottom: 1rem;
  font-weight: 700;
}

footer p {
  color: var(--text-muted);
  font-size: 0.95rem;
  max-width: 40rem;
}

footer p:last-child {
  margin-bottom: 0;
}

/* ---------- 404 ---------- */

.center {
  min-height: 70vh;
  display: flex;
  align-items: center;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
