/* =============================================================================
   Stream Pets marketing site: styles
   -----------------------------------------------------------------------------
   Design idea: "game-table felt". Dark green felt (like a board game table)
   for the hero, gallery and pricing; a cool off-white paper for reading
   sections. The bright meeple colors (sunflower, coral, sky) are the only
   accents, used for buttons, the featured tier and the pets themselves.

   ORGANIZATION
     1. Fonts and tokens (colors, type scale, spacing)
     2. Base elements
     3. Layout helpers (wrap, bands)
     4. Buttons
     5. Header
     6. Hero and live demo
     7. Sections: perks, gallery, steps, options, quotes, pricing, add-ons
     8. Request form
     9. Footer
    10. Motion and accessibility preferences
   ============================================================================= */


/* ---------- 1. Fonts and tokens ---------------------------------------------- */

/* Fredoka (variable weight 300-700): rounded and friendly, the same face the
   pet widgets use for name tags, so the site and the product feel related. */
@font-face {
  font-family: "Fredoka";
  src: url("/fonts/fredoka-var.woff2") format("woff2");
  font-weight: 300 700;
  font-display: swap;
}
/* Atkinson Hyperlegible: very readable body text, clearly different from
   Fredoka so headings and paragraphs don't blur together. */
@font-face {
  font-family: "Atkinson Hyperlegible";
  src: url("/fonts/atkinson-hyperlegible-latin-400-normal.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Atkinson Hyperlegible";
  src: url("/fonts/atkinson-hyperlegible-latin-400-italic.woff2") format("woff2");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "Atkinson Hyperlegible";
  src: url("/fonts/atkinson-hyperlegible-latin-700-normal.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
}

:root {
  /* Palette */
  --felt: #143a36;        /* table felt: hero, gallery, pricing */
  --felt-deep: #0e2a27;   /* darker felt: header, footer, demo frame */
  --felt-line: #2b5a53;   /* borders on felt */
  --paper: #f3f6f2;       /* reading sections (cool, not cream) */
  --mint: #dcefe6;        /* options section, soft */
  --ink: #1d2321;         /* body text on paper */
  --ink-soft: #4a5753;    /* secondary text on paper */
  --chalk: #eef5f1;       /* text on felt */
  --chalk-soft: #b6cdc6;  /* secondary text on felt */
  --sun: #f2c230;         /* primary action */
  --sun-deep: #7a5a10;    /* text on sun, outlines */
  --coral: #e2433d;       /* errors, the "live" badge */
  --sky: #2f8fdb;         /* links on paper */

  /* Type scale: a classic 1.25 ratio from an 18px base. */
  --t-sm: 0.889rem;   /* 16px */
  --t-base: 1.125rem; /* 18px */
  --t-md: 1.406rem;   /* ~22.5px */
  --t-lg: 1.758rem;   /* ~28px */
  --t-xl: 2.197rem;   /* ~35px */
  --t-xxl: clamp(2.4rem, 5.2vw, 3.9rem); /* hero headline */

  --font-display: "Fredoka", "Trebuchet MS", sans-serif;
  --font-body: "Atkinson Hyperlegible", "Segoe UI", system-ui, sans-serif;

  /* Spacing and shape. Radii differ on purpose: big soft corners on the
     stream frame and tiers, small ones on inputs and chips. */
  --space: clamp(4rem, 9vw, 7rem);  /* vertical padding of each band */
  --r-big: 22px;
  --r-mid: 12px;
  --r-small: 8px;
}


/* ---------- 2. Base ---------------------------------------------------------- */

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font: 400 var(--t-base)/1.6 var(--font-body);
  color: var(--ink);
  background: var(--paper);
}
img { max-width: 100%; display: block; }
h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.12;
  margin: 0 0 0.6em;
  letter-spacing: -0.01em;
}
h2 { font-size: var(--t-xl); }
h3 { font-size: var(--t-md); }
p { margin: 0 0 1em; }
a { color: var(--sky); text-underline-offset: 0.18em; }
code {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 0.95em;
  padding: 0.05em 0.35em;
  border-radius: 6px;
  background: rgba(20, 58, 54, 0.1);
}

/* Visible keyboard focus everywhere (sunflower ring reads on felt and paper). */
:focus-visible {
  outline: 3px solid var(--sun);
  outline-offset: 3px;
  border-radius: 4px;
}

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip {
  position: absolute; left: 1rem; top: -4rem; z-index: 50;
  background: var(--sun); color: var(--ink); padding: 0.6rem 1rem; border-radius: var(--r-small);
}
.skip:focus { top: 1rem; }


/* ---------- 3. Layout helpers ------------------------------------------------ */

.wrap { width: min(1180px, 100% - 2.5rem); margin-inline: auto; }

/* A "band" is one full-width section. The modifier sets its surface. */
.band { padding-block: var(--space); }
.band--paper { background: var(--paper); }
.band--mint { background: var(--mint); }
.band--felt {
  color: var(--chalk);
  /* Felt texture: two very faint offset dot grids over the base color. */
  background:
    radial-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1.2px) 0 0 / 5px 5px,
    radial-gradient(rgba(0, 0, 0, 0.06) 1px, transparent 1.2px) 2px 3px / 7px 7px,
    var(--felt);
}
.band--felt a:not(.btn) { color: var(--sun); }
.band--felt code { background: rgba(255, 255, 255, 0.1); }

.section-lede { max-width: 62ch; font-size: var(--t-md); line-height: 1.5; margin-bottom: 2.5rem; }
.band--felt .section-lede { color: var(--chalk-soft); }


/* ---------- 4. Buttons ------------------------------------------------------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 0.5em;
  font: 600 var(--t-base)/1 var(--font-display);
  padding: 0.85em 1.35em;
  border-radius: 999px;
  border: 2px solid transparent;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.12s ease, background-color 0.12s ease;
}
.btn:active { transform: translateY(1px); }
/* Sunflower: the main action. A dark bottom edge, like a game piece. */
.btn--sun {
  background: var(--sun); color: #2a1f03;
  box-shadow: 0 3px 0 var(--sun-deep);
}
.btn--sun:hover { background: #f7d257; }
.btn--ghost { color: var(--chalk); border-color: rgba(238, 245, 241, 0.45); }
.btn--ghost:hover { border-color: var(--chalk); }
.btn--line { color: var(--chalk); border-color: var(--felt-line); background: rgba(255, 255, 255, 0.04); }
.btn--line:hover { border-color: var(--sun); }
.btn--small { font-size: var(--t-sm); padding: 0.6em 1em; background: var(--sun); color: #2a1f03; }
.btn--big { font-size: var(--t-md); padding: 0.8em 1.6em; }
.btn[disabled] { opacity: 0.6; cursor: progress; }


/* ---------- 5. Header -------------------------------------------------------- */

.topbar { background: var(--felt-deep); color: var(--chalk); position: sticky; top: 0; z-index: 20; }
.topbar__inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding-block: 0.8rem; }
.brand { display: flex; align-items: center; gap: 0.55rem; color: inherit; text-decoration: none; }
.brand__mark { width: 30px; height: 30px; fill: var(--sun); }
.brand__name { font: 600 var(--t-md)/1 var(--font-display); }
.brand__by { color: var(--chalk-soft); font-size: var(--t-sm); }
.topnav { display: flex; align-items: center; gap: 1.4rem; }
.topnav a { color: var(--chalk); text-decoration: none; font-family: var(--font-display); font-weight: 500; }
.topnav a:hover { color: var(--sun); }
.topnav__cta {
  background: var(--sun); color: #2a1f03 !important;
  padding: 0.5em 1em; border-radius: 999px;
}
.topnav__cta:hover { background: #f7d257; }

@media (max-width: 760px) {
  .brand__by, .topnav a:not(.topnav__cta) { display: none; }
}


/* ---------- 6. Hero and live demo -------------------------------------------- */

.hero {
  color: var(--chalk);
  padding-block: clamp(3rem, 7vw, 5.5rem) clamp(3.5rem, 8vw, 6rem);
  background:
    radial-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1.2px) 0 0 / 5px 5px,
    radial-gradient(900px 500px at 85% 10%, #1f5650 0%, transparent 70%),
    var(--felt);
}
.hero__grid {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
}
.hero h1 { font-size: var(--t-xxl); font-weight: 650; line-height: 1.04; margin-bottom: 0.45em; text-wrap: balance; }
.hero__lede { font-size: var(--t-md); line-height: 1.5; color: var(--chalk-soft); max-width: 34ch; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 0.8rem; margin: 1.8rem 0 1.4rem; }
.hero__works { font-size: var(--t-sm); color: var(--chalk-soft); margin: 0; }
.hero__works strong { color: var(--chalk); }

/* The demo: a stream-shaped screen with the pet canvas along the bottom. */
.demo { margin: 0; }
.demo__screen {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: var(--r-big);
  overflow: hidden;
  border: 6px solid var(--felt-deep);
  box-shadow: 0 24px 60px -24px rgba(0, 0, 0, 0.55);
  /* A pretend game scene behind the pets: dusk sky and rolling hills. */
  background:
    radial-gradient(60% 45% at 20% 100%, #2f6b4d 0 60%, transparent 61%),
    radial-gradient(55% 40% at 78% 100%, #3a7d58 0 60%, transparent 61%),
    radial-gradient(240px 160px at 80% 22%, rgba(255, 226, 140, 0.55), transparent 70%),
    linear-gradient(180deg, #33406e 0%, #6b5b95 45%, #d99a8c 85%, #f2c79a 100%);
}
.demo__live {
  position: absolute; top: 12px; left: 12px; z-index: 2;
  background: var(--coral); color: #fff;
  font: 700 12px/1 var(--font-body);
  padding: 4px 8px; border-radius: 4px;
}
/* The canvas covers the whole screen; pets walk along its bottom edge. */
.demo__canvas { position: absolute; inset: 0; width: 100%; height: 100%; }

.demo__chat { display: flex; gap: 0.5rem; margin-top: 1rem; }
.demo__chat input {
  flex: 1; min-width: 0;
  font: 500 var(--t-base)/1.2 var(--font-display);
  color: var(--chalk);
  background: var(--felt-deep);
  border: 2px solid var(--felt-line);
  border-radius: 999px;
  padding: 0.65em 1em;
}
.demo__chat input::placeholder { color: #86a59d; }
.demo__chips { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.7rem; }
.demo__chips button {
  font: 500 var(--t-sm)/1 var(--font-display);
  color: var(--chalk);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--felt-line);
  border-radius: var(--r-small);
  padding: 0.45em 0.7em;
  cursor: pointer;
}
.demo__chips button:hover { border-color: var(--sun); color: var(--sun); }
.demo__caption { font-size: var(--t-sm); color: var(--chalk-soft); margin-top: 0.8rem; }
.demo__caption b { color: var(--sun); font-weight: 700; }

@media (max-width: 920px) {
  .hero__grid { grid-template-columns: 1fr; }
  .hero__lede { max-width: 48ch; }
}


/* ---------- 7. Sections ------------------------------------------------------ */

/* What you get: a two-column definition list with a rule above each item. */
.perks {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 2.2rem 3.5rem;
  margin: 2rem 0 0;
}
.perk { border-top: 3px solid var(--felt); padding-top: 1rem; }
.perk dt { font: 600 var(--t-md)/1.2 var(--font-display); margin-bottom: 0.4rem; }
.perk dd { margin: 0; color: var(--ink-soft); max-width: 52ch; }
.ast { color: var(--coral); text-decoration: none; margin-left: 0.1em; }
.footnote { margin-top: 2.5rem; font-size: var(--t-sm); color: var(--ink-soft); max-width: 75ch; }
@media (max-width: 720px) { .perks { grid-template-columns: 1fr; } }

/* Gallery: one wide feature shot, then a 2x2 grid. */
.gallery {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 2rem 1.6rem;
}
.shot { margin: 0; }
.shot--wide { grid-column: 1 / -1; }
.shot img, .shot .shot__missing {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  border-radius: var(--r-mid);
  border: 4px solid var(--felt-deep);
  background: var(--felt-deep);
}
.shot--wide img, .shot--wide .shot__missing { aspect-ratio: 16 / 5; }
.shot figcaption { padding-top: 0.9rem; }
.shot h3 { margin-bottom: 0.3rem; }
.shot p { color: var(--chalk-soft); max-width: 60ch; margin: 0; }
/* Shown by site.js when a gallery image file doesn't exist yet. */
.shot__missing {
  display: grid; place-items: center; text-align: center;
  color: var(--chalk-soft);
  font: 500 var(--t-sm)/1.4 var(--font-display);
  padding: 1rem;
  border-style: dashed !important;
  border-color: var(--felt-line) !important;
}
@media (max-width: 720px) {
  .gallery { grid-template-columns: 1fr; }
  .shot--wide img, .shot--wide .shot__missing { aspect-ratio: 16 / 9; }
}

.preview-cta {
  margin-top: 3rem;
  display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; flex-wrap: wrap;
  padding: 1.6rem 1.8rem;
  border-radius: var(--r-big);
  border: 2px dashed var(--felt-line);
}
.preview-cta h3 { margin-bottom: 0.25rem; }
.preview-cta p { margin: 0; color: var(--chalk-soft); max-width: 55ch; }

/* How it works: a real sequence, so numbers are meaningful. The numbers are
   drawn as big meeple-colored discs. */
.steps {
  list-style: none; padding: 0; margin: 2rem 0 0;
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 2rem;
  counter-reset: step;
}
.steps li { counter-increment: step; }
.steps li::before {
  content: counter(step);
  display: grid; place-items: center;
  width: 2.6rem; height: 2.6rem; margin-bottom: 1rem;
  border-radius: 50%;
  font: 600 var(--t-md)/1 var(--font-display);
  color: #fff;
  background: var(--felt);
}
.steps li:nth-child(2)::before { background: var(--sky); }
.steps li:nth-child(3)::before { background: var(--coral); }
.steps li:nth-child(4)::before { background: var(--sun); color: #2a1f03; }
.steps p { color: var(--ink-soft); margin: 0; }
@media (max-width: 900px) { .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 540px) { .steps { grid-template-columns: 1fr; } }

/* Options: three columns of plain lists. */
.options { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2.5rem; }
.optgroup h3 { padding-bottom: 0.5rem; border-bottom: 3px solid var(--felt); }
.optgroup ul { list-style: none; padding: 0; margin: 0; }
.optgroup li { padding: 0.55rem 0 0.55rem 1.5rem; position: relative; border-bottom: 1px solid rgba(20, 58, 54, 0.12); }
/* Small meeple-colored pip as the bullet. */
.optgroup li::before {
  content: ""; position: absolute; left: 0.2rem; top: 1.05rem;
  width: 0.55rem; height: 0.55rem; border-radius: 50%; background: var(--felt);
}
.optgroup:nth-child(2) li::before { background: var(--sky); }
.optgroup:nth-child(3) li::before { background: var(--coral); }
@media (max-width: 900px) { .options { grid-template-columns: 1fr; gap: 2rem; } }

/* Quotes */
.quotes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2rem; }
.quote { margin: 0; padding-left: 1.4rem; border-left: 5px solid var(--sun); }
.quote blockquote { margin: 0 0 0.8rem; }
.quote blockquote p { font: 500 var(--t-lg)/1.3 var(--font-display); margin: 0; }
.quote figcaption { color: var(--ink-soft); }
/* Placeholders are visibly unfinished so they can't go live by accident. */
.quote--placeholder { border-left-style: dashed; opacity: 0.7; }
.quote--placeholder blockquote p { font-size: var(--t-md); font-style: italic; }
@media (max-width: 720px) { .quotes { grid-template-columns: 1fr; } }

/* Pricing tiers. The featured tier is taller and sunflower-edged, so the
   three don't read as identical cards. */
.tiers { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.4rem; align-items: stretch; }
.tier {
  display: flex; flex-direction: column;
  padding: 1.8rem 1.6rem;
  border-radius: var(--r-big);
  border: 2px solid var(--felt-line);
  background: rgba(14, 42, 39, 0.55);
}
.tier h3 { font-size: var(--t-lg); margin-bottom: 0.2rem; }
.tier__price { font: 650 var(--t-xl)/1 var(--font-display); margin: 0.4rem 0 0.6rem; }
.tier__from { font: 400 var(--t-sm)/1 var(--font-body); color: var(--chalk-soft); margin-right: 0.15em; }
.tier__fit { color: var(--chalk-soft); }
.tier ul { padding-left: 1.1rem; margin: 0 0 1.6rem; flex: 1; }
.tier li { margin-bottom: 0.45rem; }
.tier li::marker { color: var(--sun); }
.tier .btn { width: 100%; }
.tier--featured {
  border: 3px solid var(--sun);
  background: var(--felt-deep);
  margin-block: -0.8rem;           /* sits taller than its neighbors */
  padding-block: 2.6rem;
}
.tier__flag {
  align-self: flex-start;
  font: 600 var(--t-sm)/1 var(--font-display);
  color: #2a1f03; background: var(--sun);
  padding: 0.4em 0.75em; border-radius: 999px;
  margin: -0.6rem 0 1rem;
}
@media (max-width: 960px) {
  .tiers { grid-template-columns: 1fr; max-width: 560px; }
  .tier--featured { margin-block: 0; order: -1; }
}

/* Add-ons: a price list, name and price on one line. */
.addons__title { margin-top: 4rem; font-size: var(--t-lg); }
.addons {
  list-style: none; padding: 0; margin: 0;
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 3rem;
}
.addons li {
  display: flex; justify-content: space-between; align-items: baseline; gap: 1rem;
  padding: 0.85rem 0;
  border-bottom: 1px dashed var(--felt-line);
}
.addons strong { display: block; font: 600 var(--t-base)/1.3 var(--font-display); color: var(--chalk); }
.addons span { color: var(--chalk-soft); font-size: var(--t-sm); }
.addons b { font: 600 var(--t-md)/1 var(--font-display); color: var(--sun); white-space: nowrap; }
@media (max-width: 720px) { .addons { grid-template-columns: 1fr; } }


/* ---------- 8. Request form -------------------------------------------------- */

.request { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); gap: clamp(2rem, 5vw, 4.5rem); }
.request__intro p { color: var(--ink-soft); max-width: 40ch; }
.request__alt { font-size: var(--t-sm); }
@media (max-width: 900px) { .request { grid-template-columns: 1fr; } }

.form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.2rem 1.4rem; }
.field { display: flex; flex-direction: column; gap: 0.4rem; min-width: 0; margin: 0; padding: 0; border: 0; }
.field--full { grid-column: 1 / -1; }
.field label, .field legend { font: 600 var(--t-base)/1.3 var(--font-display); padding: 0; }
.field legend { margin-bottom: 0.4rem; }
.opt { font: 400 var(--t-sm)/1 var(--font-body); color: var(--ink-soft); }
.field input[type="text"], .field input[type="email"], .field select, .field textarea {
  font: inherit;
  font-size: var(--t-base);
  color: var(--ink);
  background: #fff;
  border: 2px solid #c7d3ce;
  border-radius: var(--r-small);
  padding: 0.65em 0.8em;
  width: 100%;
}
.field textarea { resize: vertical; min-height: 9rem; line-height: 1.5; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--felt); outline: none; box-shadow: 0 0 0 3px rgba(242, 194, 48, 0.6); }
/* Invalid fields get a coral border once the visitor has tried to send. */
.form.was-validated :invalid { border-color: var(--coral); }
.hint { font-size: var(--t-sm); color: var(--ink-soft); margin: 0; }

.choices { display: flex; flex-wrap: wrap; gap: 0.7rem; }
.choices--grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
.choice {
  display: flex; align-items: center; gap: 0.55rem;
  font: 400 var(--t-base)/1.2 var(--font-body) !important;
  padding: 0.75em 1em;
  border: 2px solid #c7d3ce;
  border-radius: var(--r-small);
  background: #fff;
  cursor: pointer;
}
.choice input { accent-color: var(--felt); width: 1.1rem; height: 1.1rem; margin: 0; }
.choice:has(input:checked) { border-color: var(--felt); background: var(--mint); }

/* Honeypot: off screen, not display:none (some bots skip hidden fields). */
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.form__foot { flex-direction: row; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem; }
.form__status { grid-column: 1 / -1; margin: 0; font-weight: 700; min-height: 1.6em; }
.form__status.is-ok { color: #1d6b3f; }
.form__status.is-error { color: #b3261e; }

@media (max-width: 640px) { .form { grid-template-columns: 1fr; } }


/* ---------- 9. Footer -------------------------------------------------------- */

.footer { background: var(--felt-deep); color: var(--chalk-soft); padding-block: 2.2rem; font-size: var(--t-sm); }
.footer__inner { display: flex; justify-content: space-between; gap: 1rem 2rem; flex-wrap: wrap; }
.footer p { margin: 0; }
.footer a { color: var(--chalk); }


/* ---------- 10. Preferences -------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn { transition: none; }
}
