/*
  Plantita website: the one theme file (Design.mdc: "one theme file per app").
  Colours come from the game: the lavender top bar and nav, the deep plum,
  the green Level button, the honey-yellow sunny shelves and terracotta pots.
  Red is never used (Design.mdc). Every colour is a token below; the dark
  scheme only redefines the tokens.
*/
:root {
  --bg: #fff8ee;
  --bg-lilac: #f4efff;
  --bg-honey: #fff3d6;
  --surface: #ffffff;
  --ink: #2b2140;
  --ink-soft: #5b5270;
  --line: #e9e0f2;
  --lavender: #9a89e5;
  --accent: #5e4bbd;          /* links and focus: 6.4:1 on --bg */
  --plum: #402e66;
  --cta: #2f7d32;             /* the green Level button, darkened for 5.1:1 white text */
  --cta-hover: #266a29;
  --cta-ink: #ffffff;
  --honey: #f2c14e;
  --honey-deep: #8a5a00;      /* honey text on light backgrounds */
  --terracotta: #c8653a;
  --footer-bg: #2b2140;
  --footer-ink: #f3edff;
  --footer-soft: #c9bfe0;
  --shadow: 0 12px 32px rgba(64, 46, 102, 0.14);
  --shadow-soft: 0 4px 14px rgba(64, 46, 102, 0.10);
  --radius: 18px;
  --radius-lg: 28px;
  --wrap: 1120px;
  --gutter: 16px;
  --font: ui-rounded, "SF Pro Rounded", "Nunito", "Varela Round", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1d1628;
    --bg-lilac: #251c34;
    --bg-honey: #2a2216;
    --surface: #2c2240;
    --ink: #f6f0ff;
    --ink-soft: #cfc6e4;
    --line: #3d3256;
    --accent: #c3b5ff;
    --plum: #e6dcff;
    --honey-deep: #f2c14e;
    --footer-bg: #140f1d;
    --shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
    --shadow-soft: 0 4px 14px rgba(0, 0, 0, 0.35);
  }
}

/* ---- Base ------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: 80px; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 1.125rem;          /* 18px: larger body text for older eyes */
  line-height: 1.6;
  overflow-x: hidden;
}
img, svg, picture { display: block; max-width: 100%; }
img { height: auto; }
h1, h2, h3 { line-height: 1.15; color: var(--plum); margin: 0 0 0.5em; letter-spacing: -0.01em; }
h2 { font-size: clamp(1.9rem, 4.2vw, 2.6rem); font-weight: 800; }
h3 { font-size: 1.35rem; font-weight: 800; }
p { margin: 0 0 1em; }
a { color: var(--accent); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 8px; }
ul { margin: 0; padding: 0; list-style: none; }
figure { margin: 0; }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }
@media (min-width: 640px) { :root { --gutter: 28px; } }
.narrow { max-width: 760px; }
.center { text-align: center; margin-left: auto; margin-right: auto; }
.lead { font-size: 1.25rem; color: var(--ink-soft); }
.eyebrow {
  display: inline-block; margin: 0 0 0.75rem; padding: 6px 14px;
  border-radius: 999px; background: var(--bg-honey); color: var(--honey-deep);
  font-weight: 700; font-size: 0.95rem;
}

.skip-link {
  position: absolute; left: 12px; top: -60px; z-index: 100;
  background: var(--surface); color: var(--ink); padding: 12px 18px; border-radius: 12px;
  box-shadow: var(--shadow); font-weight: 700;
}
.skip-link:focus { top: 12px; }

.section { padding: clamp(56px, 9vw, 104px) 0; }

/* ---- Header ----------------------------------------------------------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
  backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--line);
}
@supports not (background: color-mix(in srgb, red 50%, blue)) {
  .site-header { background: var(--bg); }
}
.site-header__inner { display: flex; align-items: center; justify-content: space-between; min-height: 64px; gap: 12px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--plum); font-weight: 800; font-size: 1.3rem; min-height: 48px; }
.brand img { border-radius: 10px; box-shadow: var(--shadow-soft); }
.site-nav { display: flex; gap: 4px; }
.site-nav a {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 12px;
  border-radius: 999px; text-decoration: none; color: var(--ink); font-weight: 700; font-size: 1rem;
  white-space: nowrap;
}
.site-nav a:hover { background: var(--bg-lilac); }
/* Phones: the icon alone is the brand (the hero says "Plantita" right below). */
@media (max-width: 440px) {
  .site-nav a { padding: 0 10px; }
  .brand span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
}

/* ---- Store badges (Apple's and Google's own artwork, unaltered: never recoloured, angled or animated;
   switched by data-app-store / data-google-play on <html>). The App Store badge first, Google's the same
   height, and at least a quarter of that height clear around each (Google's badge guidelines). */
.stores { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 16px 20px; margin: 1.5rem 0 1rem; }
.stores--center { justify-content: center; }
.store-badge { display: inline-flex; flex-direction: column; align-items: center; gap: 6px; text-decoration: none; }
.store-badge img { display: block; height: 48px; width: auto; }
a.store-badge { border-radius: 8px; }
a.store-badge:focus-visible { outline: 3px solid var(--honey); outline-offset: 4px; }
.store-badge--soon span { font-size: 0.9rem; font-weight: 700; color: var(--ink-soft); }
html:not([data-app-store="live"]) .store--apple-live,
html[data-app-store="live"] .store--apple-soon,
html:not([data-google-play="live"]) .store--play-live,
html:not([data-google-play="soon"]) .store--play-soon { display: none; }

/* ---- Hero ------------------------------------------------------------- */
.hero { position: relative; padding: 0 0 clamp(40px, 7vw, 88px); overflow: hidden; }
.hero__inner { display: grid; gap: 28px; }
.hero__art { order: -1; margin: 0 calc(var(--gutter) * -1); }
.hero__art img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; object-position: 50% 78%; }
.hero__text { text-align: center; }
.hero__text .stores { justify-content: center; }
.hero h1 { font-size: clamp(3rem, 9vw, 5rem); font-weight: 900; margin-bottom: 0.2em; }
.hero__lead { font-size: clamp(1.25rem, 2.6vw, 1.5rem); color: var(--ink-soft); max-width: 30ch; margin: 0 auto 0.5rem; }
.hero__note { font-size: 1rem; color: var(--ink-soft); margin: 0; }

@media (min-width: 960px) {
  .hero { padding-top: 56px; }
  .hero::before {   /* a soft sunny glow behind the painting */
    content: ""; position: absolute; z-index: -1; inset: -20% -10% auto auto; width: 70%; height: 120%;
    background: radial-gradient(closest-side, color-mix(in srgb, var(--honey) 30%, transparent), transparent);
    pointer-events: none;
  }
  .hero__inner { grid-template-columns: 5fr 7fr; align-items: center; gap: 48px; }
  .hero__art { order: 0; margin: 0; }
  .hero__art img { aspect-ratio: auto; border-radius: var(--radius-lg); box-shadow: var(--shadow); }
  .hero__text { text-align: left; }
  .hero__text .stores { justify-content: flex-start; }
  .hero__lead { margin-left: 0; }
}

/* ---- Intro ------------------------------------------------------------ */
/* Over Clint's painted plant wall (2026-10-10): the same dusky plum in both themes, so its heading and lead
   are always the light ones (9:1 on the wall); the story card keeps its own colours. On wide screens the
   plants frame the words, with the wall softly deepened behind the text; on phones the painting is a banner
   above the words, never under them. */
.intro {
  --wall: #5e3845;   /* sampled from the painting's plain middle */
  background-color: var(--wall);
  background-image: url("../img/bg/plant-room-1672.jpg");
  background-image:
    radial-gradient(ellipse 36% 64% at 50% 50%, color-mix(in srgb, var(--wall) 86%, transparent), transparent),
    image-set(url("../img/bg/plant-room-1672.webp") type("image/webp"), url("../img/bg/plant-room-1672.jpg") type("image/jpeg"));
  background-size: auto, cover;
  background-position: center;
  background-repeat: no-repeat;
}
.intro h2 { text-align: center; color: #f6f0ff; }
.intro .lead { color: #ece2f7; }
.intro .story { color: var(--ink); }
@media (max-width: 719px) {
  .intro {
    padding-top: calc(56.3vw - 8px);
    background-image: url("../img/bg/plant-room-960.jpg");
    background-image:
      linear-gradient(to bottom, transparent calc(56.3vw - 72px), var(--wall) 56.3vw),
      image-set(url("../img/bg/plant-room-960.webp") type("image/webp"), url("../img/bg/plant-room-960.jpg") type("image/jpeg"));
    background-size: 100% 100%, 100% auto;
    background-position: top;
  }
}
.story {
  margin: 2rem 0 0; padding: 24px 28px; border-radius: var(--radius);
  background: var(--bg-honey); border-left: 6px solid var(--honey);
}
.story p { margin: 0 0 0.75em; }
.story__end { font-weight: 800; color: var(--plum); margin-bottom: 0 !important; }

/* ---- Features --------------------------------------------------------- */
.features .wrap { display: grid; gap: clamp(56px, 8vw, 96px); }
.feature { display: grid; gap: 28px; align-items: center; }
.feature__tag { margin: 0 0 0.4rem; color: var(--honey-deep); font-weight: 800; font-size: 0.95rem; letter-spacing: 0.02em; text-transform: uppercase; }
.feature h3 { font-size: clamp(1.6rem, 3.2vw, 2.1rem); }
.feature__text p:not(.feature__tag) { color: var(--ink-soft); }
.phone { width: min(64vw, 280px); margin: 0 auto; }
.phone img {
  border-radius: 30px; border: 6px solid var(--surface);
  box-shadow: var(--shadow); background: var(--bg-lilac);
}
@media (min-width: 860px) {
  .feature { grid-template-columns: 1fr 280px; gap: 72px; }
  .feature:nth-child(even) { grid-template-columns: 280px 1fr; }
  .feature:nth-child(even) .phone { order: -1; }
  .phone { width: 280px; }
}

/* ---- Games ------------------------------------------------------------ */
.games { background: var(--bg-lilac); }
.game-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; margin-top: 2.5rem; }
.game {
  background: var(--surface); border-radius: var(--radius); padding: 12px 12px 18px;
  box-shadow: var(--shadow-soft); text-align: center;
}
.game img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; object-position: 50% 52%; border-radius: 12px; margin-bottom: 14px; }
.game h3 { font-size: 1.2rem; margin-bottom: 0.3em; }
.game p { font-size: 1rem; color: var(--ink-soft); margin: 0; }
.game:last-child:nth-child(odd) { grid-column: 1 / -1; max-width: calc(50% - 10px); margin: 0 auto; }
@media (min-width: 700px) {
  .game-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .game:last-child:nth-child(odd) { grid-column: auto; max-width: none; margin: 0; }
}
@media (min-width: 1000px) { .game-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); } }

/* ---- Events carousel -------------------------------------------------- */
.carousel { margin-top: 2.5rem; }
.carousel__track {
  position: relative;          /* the cards' offsetLeft is measured from here */
  display: flex; gap: 20px; overflow-x: auto; overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory; scroll-padding: 0 var(--gutter);
  padding: 8px var(--gutter) 24px; margin: 0 calc(var(--gutter) * -1);
  scrollbar-width: none;
}
.carousel__track::-webkit-scrollbar { display: none; }
.carousel__track:focus-visible { outline-offset: -3px; border-radius: var(--radius); }
.carousel[data-fits="true"] .carousel__track { justify-content: center; }
.event-card {
  --event-colour: var(--honey);
  flex: 0 0 min(86%, 470px); scroll-snap-align: center;
  display: flex; flex-direction: column;
  background: var(--surface); border-radius: var(--radius-lg); overflow: hidden;
  box-shadow: var(--shadow); border-top: 6px solid var(--event-colour);
}
.event-card__art { aspect-ratio: 3 / 2; background: var(--bg-lilac); }
.event-card__art img { width: 100%; height: 100%; object-fit: cover; }
.event-card__body { padding: 20px 24px 26px; }
.event-card h3 { font-size: 1.5rem; margin-bottom: 0.3em; }
.event-card p { color: var(--ink-soft); margin: 0; }
.event-card .pill {
  display: inline-block; margin-bottom: 10px; padding: 4px 12px; border-radius: 999px;
  background: var(--bg-honey);
  background: color-mix(in srgb, var(--event-colour) 22%, var(--surface));
  color: var(--ink); font-weight: 800; font-size: 0.9rem;
}
.event-card--loading .bar { display: block; height: 18px; border-radius: 9px; background: var(--bg-lilac); margin-bottom: 12px; }
.event-card--loading .bar--short { width: 60%; }
@media (prefers-reduced-motion: no-preference) {
  .event-card--loading .event-card__art, .event-card--loading .bar { animation: breathe 1.6s ease-in-out infinite; }
}
@keyframes breathe { 50% { opacity: 0.55; } }
.events-empty { text-align: center; color: var(--ink-soft); font-weight: 700; margin: 1rem 0 0; }

.carousel__controls { display: flex; align-items: center; justify-content: center; gap: 16px; margin-top: 4px; }
.carousel__controls[hidden] { display: none; }
.carousel__btn {
  display: inline-grid; place-items: center; width: 52px; height: 52px; border-radius: 50%;
  border: 2px solid var(--line); background: var(--surface); color: var(--plum); cursor: pointer;
  box-shadow: var(--shadow-soft);
}
.carousel__btn:hover:not(:disabled) { border-color: var(--lavender); }
.carousel__btn:disabled { opacity: 0.4; cursor: default; }
.carousel__dots { display: flex; gap: 4px; }
.carousel__dot {
  width: 44px; height: 44px; border: 0; background: none; padding: 0; cursor: pointer;
  display: inline-grid; place-items: center;
}
.carousel__dot::before {
  content: ""; width: 12px; height: 12px; border-radius: 50%;
  background: var(--line); transition: width 0.2s ease, background-color 0.2s ease;
}
.carousel__dot[aria-current="true"]::before { width: 28px; border-radius: 6px; background: var(--accent); }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* ---- Gentle by design ------------------------------------------------- */
.gentle { background: var(--bg-honey); }
.gentle-grid { display: grid; gap: 18px; margin-top: 2.5rem; }
@media (min-width: 680px) { .gentle-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) { .gentle-grid { grid-template-columns: repeat(3, 1fr); } }
.gentle-item { background: var(--surface); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow-soft); }
.gentle-item__icon {
  width: 48px; height: 48px; padding: 10px; margin-bottom: 14px; border-radius: 14px;
  background: var(--bg-lilac); fill: none; stroke: var(--accent); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}
.gentle-item h3 { font-size: 1.25rem; }
.gentle-item p { color: var(--ink-soft); margin: 0; }

/* ---- Help ------------------------------------------------------------- */
.button {
  display: inline-flex; align-items: center; gap: 10px; min-height: 56px; padding: 0 28px;
  border-radius: 999px; background: var(--cta); color: var(--cta-ink); text-decoration: none;
  font-weight: 800; font-size: 1.15rem; box-shadow: var(--shadow-soft);
}
.button:hover { background: var(--cta-hover); }
.help__address { margin: 14px 0 0; color: var(--ink-soft); font-weight: 700; user-select: all; }
.help__links { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 24px; margin: 18px 0 0; }
.help__links a { display: inline-flex; align-items: center; min-height: 44px; font-weight: 700; }

/* ---- Closing call and footer ------------------------------------------ */
.cta { background: var(--bg-lilac); padding: clamp(48px, 7vw, 80px) 0; text-align: center; border-top: 1px solid var(--line); }
.cta__inner img { margin: 0 auto 14px; border-radius: 18px; box-shadow: var(--shadow-soft); }
.cta h2 { margin-bottom: 0.2em; }
.site-footer { background: var(--footer-bg); color: var(--footer-soft); padding: 40px 0 48px; font-size: 1rem; }
.site-footer__inner { display: grid; gap: 14px; text-align: center; }
.site-footer nav { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 8px; }
.site-footer nav a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 10px; color: var(--footer-ink); font-weight: 700; }
.site-footer p { margin: 0; }
.site-footer__marks { font-size: 0.875rem; }
.site-footer__marks span + span::before { content: " "; }

/* ---- 404 page --------------------------------------------------------- */
.notfound__logo { margin: 0 auto 20px; border-radius: 22px; box-shadow: var(--shadow-soft); }
