/* Landing de shuggi.app (Sprint LP-1). Paleta y tipografía del manual de marca AMP v1.
   Contraste WCAG medido (ver build.py y el plan): verde texto #3F6B3B con blanco 6.22 y sobre
   crema 6.06; sobre brote 4.60. Bosque #5E9257 y hoja #8AC06B nunca llevan texto de cuerpo.
   Azul marino #2D4373 solo en el punto: es el único acento que no es verde. Oscuro sobre el navy
   de las versiones oscuras de AMP (#1B2A44). */

@font-face {
  font-family: "Quicksand";
  src: url("/fonts/Quicksand-Variable.woff") format("woff");
  font-weight: 300 700;
  font-display: swap;
}
@font-face {
  font-family: "Nunito Sans";
  src: url("/fonts/NunitoSans-Variable-latin.woff") format("woff");
  font-weight: 400 700;
  font-display: swap;
}

:root {
  color-scheme: light dark;
  --bg: #FDFCF8;
  --surface: #FFFFFF;
  --fg: #1F2A1E;
  --muted: #5F665C;
  --heading: #3F6B3B;
  --rule: #E2E6DA;
  --bosque: #5E9257;
  --hoja: #8AC06B;
  --brote: #CFE6A6;
  --dot: #2D4373;
  --btn-bg: #3F6B3B;
  --btn-fg: #FFFFFF;
  --chip-bg: #F2F7E8;
  --band-bg: #3F6B3B;
  --band-fg: #FDFCF8;
  --band-muted: #E3EEDC;
  --alert: #B42318;
  --phone: #1F2A1E;
  --scrim: rgba(31, 42, 30, 0.55);
  --display: "Quicksand", "Nunito Sans", system-ui, sans-serif;
  --body: "Nunito Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --radius-l: 2rem;
  --radius-m: 1.25rem;
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1B2A44;
    --surface: #22324F;
    --fg: #FBF8EF;
    --muted: #B6C2D3;
    --heading: #CFE6A6;
    --rule: #2E4166;
    --dot: #CFE6A6;
    --btn-bg: #CFE6A6;
    --btn-fg: #1B2A44;
    --chip-bg: #24365A;
    --band-bg: #24365A;
    --band-fg: #FBF8EF;
    --band-muted: #C9D3E0;
    --alert: #FFB4A9;
    --phone: #0F1A2E;
    --scrim: rgba(8, 14, 26, 0.7);
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 1.0625rem/1.65 var(--body);
  overflow-x: hidden;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--heading); text-underline-offset: 0.18em; }
h1, h2, h3 { font-family: var(--display); color: var(--heading); margin: 0; text-wrap: balance; }
h2 { font-size: clamp(1.7rem, 1.2rem + 2vw, 2.6rem); line-height: 1.15; letter-spacing: -0.015em; font-weight: 700; }
h3 { font-size: 1.2rem; line-height: 1.3; font-weight: 700; }
p { margin: 0 0 1rem; }
:focus-visible { outline: 3px solid var(--bosque); outline-offset: 3px; border-radius: 6px; }

.wrap { width: min(72rem, 100% - 2.5rem); margin-inline: auto; }
.skip { position: absolute; left: -999px; top: 0; }
.skip:focus { left: 1rem; top: 1rem; z-index: 10; background: var(--surface); padding: 0.6rem 1rem; }

/* The navy dot: the brand's signature, used only as the full stop of two headlines. */
.dot { color: var(--dot); }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 3rem; padding: 0.75rem 1.5rem;
  border-radius: 999px; border: 2px solid transparent;
  font: 700 1rem/1 var(--display); text-decoration: none; cursor: pointer;
  transition: transform 160ms var(--ease-out), background-color 160ms var(--ease-out);
}
.btn:active { transform: scale(0.97); }
.btn--primary { background: var(--btn-bg); color: var(--btn-fg); }
.btn--ghost { border-color: currentColor; color: var(--heading); background: transparent; }
.btn--small { min-height: 2.75rem; padding: 0.5rem 1.15rem; font-size: 0.95rem; }
.btn--block { width: 100%; }
@media (hover: hover) {
  .btn--primary:hover { background: color-mix(in srgb, var(--btn-bg) 88%, var(--fg)); }
  .btn--ghost:hover { background: var(--chip-bg); }
}
.actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1.75rem; }
.actions--center { justify-content: center; }

/* Header */
.top { position: sticky; top: 0; z-index: 5; background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--rule); }
.top__row { display: flex; align-items: center; gap: 1.5rem; min-height: 4.5rem; }
.top__brand img { width: 9.5rem; }
.top__nav { display: flex; gap: 1.5rem; margin-left: auto; }
.top__nav a { color: var(--muted); font: 600 0.95rem var(--display); text-decoration: none; }
.top__nav a:hover { color: var(--heading); }
@media (max-width: 47.99rem) { .top__nav { display: none; } .top .btn { margin-left: auto; } .top__brand img { width: 8rem; } }

/* Hero */
.hero { padding: clamp(2.5rem, 6vw, 5rem) 0 clamp(3rem, 7vw, 6rem); }
.hero__grid { display: grid; gap: 3rem; align-items: center; }
@media (min-width: 56rem) { .hero__grid { grid-template-columns: 1.05fr 0.95fr; } }
.slogan {
  font: 700 0.85rem/1.4 var(--display); font-variant-caps: all-small-caps; letter-spacing: 0.12em;
  /* Verde texto, not bosque: bosque on crema is 3.57 and the slogan is not large text. */
  color: var(--heading); margin-bottom: 1rem; font-size: 1.35rem;
}
.hero__title { font-size: clamp(2.4rem, 1.4rem + 4.2vw, 4.4rem); line-height: 1.04; letter-spacing: -0.025em; max-width: 13ch; }
.hero__lead { font-size: 1.2rem; color: var(--muted); max-width: 34rem; margin-top: 1.5rem; }

.hero__art { position: relative; margin: 0; display: grid; place-items: center; min-height: 30rem; }
.orbs { position: absolute; inset: 0; }
.orb { position: absolute; border-radius: 50%; }
.orb--hoja { width: 78%; aspect-ratio: 1; background: var(--hoja); right: 0; top: 4%; }
.orb--bosque { width: 58%; aspect-ratio: 1; background: var(--bosque); left: 2%; bottom: 0; }
.orb--brote { width: 34%; aspect-ratio: 1; background: var(--brote); left: 14%; top: 0; }
/* Five circles of mixed sizes, never the isotipo's three: the manual forbids recreating or
   reordering it, so the composition must not read as a distorted logo. */
.orb--sm { width: 16%; left: auto; top: auto; right: 4%; bottom: 6%; }
.orb--xs { width: 9%; right: auto; top: auto; left: 0; bottom: 42%; }
.phone {
  position: relative; width: min(17rem, 70%);
  border: 0.6rem solid var(--phone); border-radius: 2.6rem; overflow: hidden;
  background: var(--brote); aspect-ratio: 540 / 1200;
  box-shadow: 0 2rem 3rem -1.5rem rgba(31, 42, 30, 0.45);
}
.phone img { width: 100%; height: 100%; object-fit: cover; }
.hero__art figcaption { position: absolute; bottom: -1.75rem; right: 0; font-size: 0.8rem; color: var(--muted); }

/* Why */
.why { padding: clamp(3.5rem, 8vw, 6.5rem) 0; background: var(--chip-bg); }
.why__grid { display: grid; gap: 2.5rem; align-items: center; }
@media (min-width: 56rem) { .why__grid { grid-template-columns: 0.8fr 1.2fr; gap: 4rem; } }
.why__text { max-width: 40rem; }
.why__text h2 { margin-bottom: 1.25rem; }
.source { font-size: 0.85rem; color: var(--muted); margin-top: 1.5rem; }
.plates { display: flex; gap: clamp(0.75rem, 2vw, 1.25rem); justify-content: center; }
.plate { width: clamp(4.5rem, 12vw, 7.5rem); aspect-ratio: 1; border-radius: 50%; }
.plate--full { background: var(--hoja); box-shadow: inset 0 0 0 clamp(0.6rem, 1.4vw, 0.9rem) var(--brote); }
.plate--empty { border: 3px dashed var(--bosque); }

/* How */
.how { padding: clamp(3.5rem, 8vw, 6.5rem) 0; }
.how h2 { max-width: 22ch; }
.steps { list-style: none; padding: 0; margin: 2.5rem 0 0; display: grid; gap: 2rem; }
@media (min-width: 48rem) { .steps { grid-template-columns: repeat(3, 1fr); gap: 2.5rem; } }
.step__n {
  display: grid; place-items: center; width: 3rem; height: 3rem; border-radius: 50%;
  background: var(--brote); color: #3F6B3B; font: 700 1.25rem var(--display); margin-bottom: 1rem;
}
.step h3 { margin-bottom: 0.5rem; }
.step p { color: var(--muted); }

/* You */
.you { padding: 0 0 clamp(3.5rem, 8vw, 6.5rem); }
.perks { list-style: none; padding: 0; margin: 2.5rem 0 0; display: grid; gap: 2rem 3rem; }
@media (min-width: 48rem) { .perks { grid-template-columns: 1fr 1fr; } }
.perk { display: flex; gap: 1.1rem; align-items: flex-start; }
.perk h3 { margin-bottom: 0.35rem; }
.perk p { color: var(--muted); margin: 0; }
.perk__icon { flex: none; width: 3rem; height: 3rem; border-radius: 50%; background: var(--brote); display: grid; place-items: center; }
.perk__icon svg { width: 1.4rem; height: 1.4rem; fill: none; stroke: #3F6B3B; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
/* Allergens keep their warning colour in every theme (Architecture rule 10). */
.perk--alert .perk__icon { background: #FDECEA; }
.perk--alert .perk__icon svg { stroke: #B42318; }
.perk--alert h3 { color: var(--alert); }

/* Businesses */
.biz { background: var(--band-bg); color: var(--band-fg); padding: clamp(3.5rem, 8vw, 6.5rem) 0; }
.biz h2 { color: var(--band-fg); }
.biz__grid { display: grid; gap: 3rem; align-items: start; }
@media (min-width: 56rem) { .biz__grid { grid-template-columns: 1.1fr 0.9fr; gap: 4rem; } }
.biz__lead { font-size: 1.2rem; margin-top: 1.25rem; color: var(--band-muted); }
.biz__list { padding: 0; list-style: none; margin: 1.75rem 0 0; display: grid; gap: 1rem; }
.biz__list li { padding-left: 1.6rem; position: relative; color: var(--band-muted); }
.biz__list li::before { content: ""; position: absolute; left: 0; top: 0.5em; width: 0.7rem; height: 0.7rem; border-radius: 50%; background: var(--hoja); }
.biz__list strong { color: var(--band-fg); }

.join { background: var(--bg); color: var(--fg); border-radius: var(--radius-l); padding: clamp(1.5rem, 4vw, 2.25rem); }
.join h3 { font-size: 1.45rem; margin-bottom: 0.5rem; }
.join > p { color: var(--muted); }
.join label { display: block; font: 600 0.95rem var(--display); color: var(--fg); margin-top: 1rem; }
.join input, .join select {
  display: block; width: 100%; margin-top: 0.4rem; min-height: 3rem; padding: 0.6rem 0.9rem;
  font: 1rem var(--body); color: var(--fg); background: var(--surface);
  border: 1.5px solid #8A9486; border-radius: 0.85rem;
}
.join input:focus-visible, .join select:focus-visible { outline: 3px solid var(--bosque); outline-offset: 1px; }
.join .btn { margin-top: 1.5rem; }
.join__error { color: var(--alert); font-weight: 600; margin: 1rem 0 0; }
.join__note { font-size: 0.9rem; color: var(--muted); margin: 1rem 0 0; }

/* FAQ */
.faq { padding: clamp(3.5rem, 8vw, 6.5rem) 0; }
.faq__wrap { max-width: 46rem; }
.faq h2 { margin-bottom: 1.5rem; }
.faq details { border-bottom: 1px solid var(--rule); }
.faq summary {
  cursor: pointer; list-style: none; padding: 1.1rem 2.5rem 1.1rem 0; position: relative;
  font: 700 1.1rem/1.4 var(--display); color: var(--fg);
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: ""; position: absolute; right: 0.4rem; top: 50%; width: 0.65rem; height: 0.65rem;
  border-right: 2px solid var(--heading); border-bottom: 2px solid var(--heading);
  transform: translateY(-70%) rotate(45deg); transition: transform 200ms var(--ease-out);
}
.faq details[open] summary::after { transform: translateY(-30%) rotate(-135deg); }
.faq details p { color: var(--muted); padding-right: 2.5rem; }
.faq__more { margin-top: 1.75rem; }

/* Close */
.close { padding: clamp(3.5rem, 9vw, 7rem) 0; background: var(--chip-bg); text-align: center; }
.close__inner h2 { font-size: clamp(1.9rem, 1.3rem + 2.6vw, 3.2rem); max-width: 22ch; margin-inline: auto; }

/* Footer */
.foot { padding: 3rem 0 3.5rem; border-top: 1px solid var(--rule); }
.foot__grid { display: grid; gap: 1.75rem; }
.foot__logo img { width: 10.75rem; }
.foot__links { display: flex; flex-wrap: wrap; gap: 0.6rem 1.5rem; }
.foot__links a { color: var(--muted); font-size: 0.95rem; }
.foot__legal { font-size: 0.85rem; color: var(--muted); margin: 0; }
@media (min-width: 56rem) { .foot__grid { grid-template-columns: auto 1fr; align-items: center; } .foot__legal { grid-column: 1 / -1; } .foot__links { justify-content: flex-end; } }

/* "Muy pronto" — works without JS through :target; landing.js adds Esc, focus and scroll lock. */
.pronto {
  position: fixed; inset: 0; z-index: 20; display: none; place-items: center; padding: 1.25rem;
  background: var(--scrim);
}
.pronto:target, .pronto.is-open { display: grid; }
.pronto__card {
  position: relative; width: min(26rem, 100%); background: var(--bg); border-radius: var(--radius-l);
  padding: 2.5rem 2rem 2rem; text-align: center;
}
.pronto__dot { display: block; width: 0.9rem; height: 0.9rem; border-radius: 50%; background: #2D4373; margin: 0 auto 1.25rem; }
@media (prefers-color-scheme: dark) { .pronto__dot { background: var(--brote); } }
.pronto h2 { font-size: 1.6rem; margin-bottom: 0.75rem; }
.pronto p { color: var(--muted); margin-bottom: 1.5rem; }

/* ---------- Motion (Sprint LP-1, ola 5) ----------
   Two orchestrated moments only: the hero arriving on load, and the three plates when the
   "una de cada tres" section comes into view. Everything else is a direct answer to the
   visitor's action (press, open, close). Only transform and opacity move. */
@media (prefers-reduced-motion: no-preference) {
  .orb, .phone { animation: rise 900ms var(--ease-out) both; }
  .orb--brote { animation-delay: 60ms; }
  .orb--hoja { animation-delay: 120ms; }
  .orb--bosque { animation-delay: 180ms; }
  .orb--sm { animation-delay: 260ms; }
  .orb--xs { animation-delay: 320ms; }
  .phone { animation-name: phone-in; animation-delay: 220ms; animation-duration: 1000ms; }
  .hero__text > * { animation: fade-up 700ms var(--ease-out) both; }
  .hero__text > :nth-child(2) { animation-delay: 70ms; }
  .hero__text > :nth-child(3) { animation-delay: 140ms; }
  .hero__text > :nth-child(4) { animation-delay: 210ms; }

  /* The plates: full ones fill in, the empty one stays empty. landing.js adds .is-seen once. */
  .js .plate--full { transform: scale(0.6); opacity: 0; transition: transform 700ms var(--ease-out), opacity 500ms var(--ease-out); }
  .js .plate--full:nth-child(2) { transition-delay: 120ms; }
  .js .plate--empty { opacity: 0; transition: opacity 600ms var(--ease-out) 420ms; }
  .js .plates.is-seen .plate { transform: none; opacity: 1; }

  /* FAQ answers open by growing, not by jumping (browsers without ::details-content just open). */
  .faq details { interpolate-size: allow-keywords; }
  .faq details::details-content {
    height: 0; overflow: clip;
    transition: height 260ms var(--ease-out), content-visibility 260ms allow-discrete;
  }
  .faq details[open]::details-content { height: auto; }

  /* "Muy pronto": the card settles in from slightly smaller, the scrim fades. */
  .pronto { transition: opacity 200ms var(--ease-out); }
  .pronto__card { transition: transform 260ms var(--ease-out), opacity 200ms var(--ease-out); }
  @starting-style {
    .pronto:target, .pronto.is-open { opacity: 0; }
    .pronto:target .pronto__card, .pronto.is-open .pronto__card { transform: scale(0.94) translateY(8px); opacity: 0; }
  }
}
@keyframes rise { from { transform: scale(0.82); opacity: 0; } }
@keyframes phone-in { from { transform: translateY(2.5rem) rotate(-3deg); opacity: 0; } }
@keyframes fade-up { from { transform: translateY(0.9rem); opacity: 0; } }

@media (prefers-reduced-transparency: reduce) {
  .top { background: var(--bg); backdrop-filter: none; }
}
@media (prefers-contrast: more) {
  .join input, .join select { border-color: var(--fg); }
  .btn--ghost { border-width: 3px; }
}
