/* Atrapa la alegría · Joaquinas & Ramonas
   Tokens mirror the brand's own site. Fonts are self-hosted (SIL OFL, see /assets/fonts/OFL.txt). */

@font-face {
  font-family: 'Montserrat';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url(/assets/fonts/montserrat-latin-wght.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Nunito';
  font-style: normal;
  font-weight: 200 1000;
  font-display: swap;
  src: url(/assets/fonts/nunito-latin-wght.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* Metric-matched Arial fallbacks, so the swap doesn't shift the layout */
@font-face {
  font-family: 'Montserrat Fallback';
  font-weight: 100 600;
  src: local('Arial'), local('ArialMT');
  size-adjust: 118.14%;
  ascent-override: 81.93%;
  descent-override: 21.25%;
  line-gap-override: 0%;
}
@font-face {
  font-family: 'Montserrat Fallback';
  font-weight: 700 900;
  src: local('Arial Bold'), local('Arial-BoldMT');
  size-adjust: 109.82%;
  ascent-override: 88.15%;
  descent-override: 22.86%;
  line-gap-override: 0%;
}
@font-face {
  font-family: 'Nunito Fallback';
  src: local('Arial'), local('ArialMT');
  size-adjust: 100.3%;
  ascent-override: 100.8%;
  descent-override: 35.19%;
  line-gap-override: 0%;
}

:root {
  --magenta: #E4256E;
  --magenta-deep: #C81B5C;
  --magenta-ink: #A8154C;
  --green: #078D46;
  --green-ink: #067A3C;
  --orange: #E6781E;
  --golden: #E9BF0B;
  --golden-ink: #806400;
  --teal: #08929D;
  --teal-deep: #056B73;
  --purple: #7F347B;
  --blue: #37387B;
  --navy: #202046;
  --muted: #5A5A7E;
  --wa: #25D366;

  --bg: #FCFCFC;
  --paper: #FFFDF8;
  --warm: #F4F3F0;
  --line: #E8E6E3;
  --tint-pink: #FDF2F6;
  --tint-green: #F1F9F5;
  --tint-golden: #FAF8EF;
  --tint-teal: #F1F8F9;
  --tint-blue: #F2F2F8;
  --tint-orange: #FDF5EE;
  --tint-purple: #F8F1F7;

  --font-display: 'Montserrat', 'Montserrat Fallback', sans-serif;
  --font-body: 'Nunito', 'Nunito Fallback', sans-serif;
  --shadow-soft: 0 1px 0 rgba(32, 32, 70, 0.05), 0 24px 48px -28px rgba(32, 32, 70, 0.28);
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-pop: cubic-bezier(0.34, 1.56, 0.64, 1);
  --gutter: 16px;
  /* hand-drawn rounded-rect outline for cards */
  --crayon-box: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100' preserveAspectRatio='none'%3E%3Cpath d='M9 2.2C30 1.4 70 1.6 91.4 2.6c4.2.4 6.2 3.2 6.3 7.4.8 25 .6 55-.4 80.6-.3 4.4-3.1 6.9-7.4 7-23 .9-58 .8-80.6-.3-4.1-.3-6.6-3-6.8-7.1C1.6 66 1.7 33 2.6 9.4 2.9 5.3 5 2.6 9 2.2z' fill='none' stroke='%23202046' stroke-opacity='.22' stroke-width='1.6' vector-effect='non-scaling-stroke' stroke-linecap='round'/%3E%3C/svg%3E");
}

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

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

body {
  margin: 0;
  background-color: var(--bg);
  /* faint paper grain */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.13 0 0 0 0 0.13 0 0 0 0 0.27 0 0 0 .035 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  color: var(--navy);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }
a { color: inherit; }
button { font: inherit; color: inherit; }

.wrap {
  width: min(1180px, 100% - 2 * var(--gutter) - env(safe-area-inset-left, 0px) - env(safe-area-inset-right, 0px));
  margin-inline: auto;
}

.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: 16px; top: -60px; z-index: 50;
  background: var(--navy); color: #fff; padding: 10px 16px; border-radius: 999px;
  text-decoration: none; font-weight: 700; transition: top .2s;
}
.skip:focus { top: 12px; }

:focus-visible { outline: 3px solid var(--magenta-deep); outline-offset: 3px; border-radius: 8px; }

/* ---------- Header ---------- */

.site-header { position: relative; z-index: 5; }
.header-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-block: 22px; }

.wordmark {
  text-decoration: none;
  font-family: var(--font-display);
  font-weight: 300;
  font-size: clamp(14px, 2.2vw, 19px);
  letter-spacing: 0.16em;
  white-space: nowrap;
}
.wordmark--small { font-size: 14px; }
.wordmark .ch { display: inline-block; transition: transform .35s var(--ease-out); }

.header-link {
  font-family: var(--font-display); font-weight: 600; font-size: 14px;
  text-decoration: none; color: var(--navy);
  min-height: 44px; display: inline-flex; align-items: center; gap: 6px;
  padding: 0 18px; border-radius: 999px; border: 1.5px solid var(--line);
  background: rgba(255, 255, 255, .7);
  transition: border-color .2s, color .2s, background .2s;
}

/* ---------- Hero ---------- */

.hero { position: relative; padding-bottom: 56px; }

.hero-copy { text-align: center; padding-top: clamp(8px, 3vw, 28px); position: relative; z-index: 2; }

.greeting {
  margin: 0 0 8px;
  font-family: var(--font-display);
  font-weight: 200;
  font-size: clamp(16px, 2.4vw, 24px);
  letter-spacing: 0.22em;
  color: var(--green-ink);
  animation: rise .9s var(--ease-out) both;
}

h1 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(44px, 8.4vw, 104px);
  line-height: 0.98;
  letter-spacing: -0.035em;
  color: var(--navy);
  text-wrap: balance;
  animation: rise .9s .08s var(--ease-out) both;
}

.rainbow-word { position: relative; display: inline-block; white-space: nowrap; }
.rainbow-word .ch { display: inline-block; animation: letter-bob 3.6s ease-in-out infinite; animation-delay: calc(var(--i) * 0.12s); }
.swoosh {
  position: absolute; left: 2%; right: 2%; bottom: -0.16em; width: 96%; height: 0.24em;
  overflow: visible; pointer-events: none;
}
.swoosh path {
  fill: none; stroke: var(--magenta); stroke-width: 5; stroke-linecap: round; opacity: .85;
  vector-effect: non-scaling-stroke;
  stroke-dasharray: 320; stroke-dashoffset: 320;
  animation: draw .8s .55s var(--ease-out) forwards;
}
.swoosh path + path { stroke-width: 3; opacity: .6; animation-delay: .7s; }

.lead {
  max-width: 600px;
  margin: 22px auto 30px;
  font-size: clamp(17px, 2vw, 20px);
  color: var(--muted);
  text-wrap: pretty;
  animation: rise .9s .16s var(--ease-out) both;
}

.deco {
  position: absolute; z-index: 1; pointer-events: none; user-select: none; height: auto;
  animation: float 7s ease-in-out infinite;
}
.deco--heart { width: clamp(54px, 7vw, 96px); left: max(16px, 6vw); top: 40px; rotate: -12deg; }
.deco--bubbles { width: clamp(70px, 9vw, 130px); right: max(10px, 5vw); top: 10px; animation-delay: -2.4s; }
.deco--wand { width: clamp(30px, 3.4vw, 50px); right: 8vw; top: 250px; rotate: 14deg; animation-delay: -4s; }

/* ---------- Stage ---------- */

.stage {
  position: relative;
  height: min(clamp(480px, 74vh, 660px), calc(100vh - 16px)); /* browsers without svh */
  height: min(clamp(480px, 74svh, 660px), calc(100svh - 16px));
  border-radius: 32px;
  background:
    radial-gradient(120% 80% at 50% 110%, rgba(228, 37, 110, 0.05), transparent 60%),
    radial-gradient(60% 50% at 10% 0%, rgba(8, 146, 157, 0.05), transparent 70%),
    var(--paper);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
  isolation: isolate;
  animation: rise 1s .22s var(--ease-out) both;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
}
.stage[data-state="ready"], .stage[data-state="playing"] { touch-action: none; cursor: grab; }
.stage[data-state="playing"]:active { cursor: grabbing; }

.stage-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }

.stage-hint {
  text-align: center; color: var(--navy); opacity: .82;
  font-size: clamp(17px, 2vw, 20px); line-height: 1.5;
  margin: 20px auto 0; max-width: 720px; text-wrap: pretty;
}
@media (pointer: fine) { .hint-silent { display: none; } }

/* HUD */

.hud {
  position: absolute; z-index: 3; top: 14px; left: 14px; right: 14px;
  display: flex; align-items: center; gap: 8px;
  pointer-events: none;
  opacity: 0; transform: translateY(-6px); visibility: hidden;
  transition: opacity .4s, transform .4s var(--ease-out), visibility 0s .4s;
}
.stage:is([data-state="ready"], [data-state="playing"], [data-state="paused"], [data-state="ending"], [data-state="ended"]) .hud {
  opacity: 1; transform: none; visibility: visible; transition-delay: 0s;
}

.hud-pill {
  display: inline-flex; align-items: center; gap: 8px;
  height: 44px; padding: 0 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  border: 1.5px solid rgba(32, 32, 70, 0.08);
  font-family: var(--font-display); font-weight: 800; font-size: 17px;
  font-variant-numeric: tabular-nums;
}
.hud-rainbow { width: 40px; height: 22px; overflow: visible; }
.hud-rainbow path { fill: none; stroke-width: 2.6; stroke-linecap: round; }
.hud-rainbow .track path { stroke: #E8E6E3; }
.hud-rainbow .band { stroke-dasharray: 1; stroke-dashoffset: 1; transition: stroke-dashoffset .4s var(--ease-out); }
.hud-rainbow.bump { animation: bump .6s var(--ease-pop); }

.hud-sun { padding: 0 8px; }
.sun { width: 34px; height: 34px; overflow: visible; }
.sun .ray { stroke: var(--golden); stroke-width: 2.4; stroke-linecap: round; transition: opacity .6s; }
.sun .ray.is-out { opacity: 0; }
.sun .disc { fill: #FBE79A; stroke: var(--golden); stroke-width: 2.2; transition: fill .8s; }
.sun .eyes-open circle { fill: var(--navy); }
.sun .eyes-sleepy path, .sun .smile, .sun .zzz { fill: none; stroke: var(--navy); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.sun .eyes-sleepy, .sun .zzz { opacity: 0; }
.sun.is-sleepy .disc { fill: #F5B26B; }
.sun.is-sleepy .eyes-open, .sun.is-asleep .eyes-open { opacity: 0; }
.sun.is-sleepy .eyes-sleepy, .sun.is-asleep .eyes-sleepy, .sun.is-asleep .zzz { opacity: 1; }
.sun.is-asleep .disc { fill: #F5B26B; }

.hud-actions { margin-left: auto; display: flex; gap: 8px; pointer-events: auto; }

.icon-btn {
  width: 44px; height: 44px; border-radius: 999px;
  display: grid; place-items: center;
  background: rgba(255, 255, 255, 0.92);
  border: 1.5px solid rgba(32, 32, 70, 0.08);
  color: var(--navy); cursor: pointer;
  transition: transform .15s, border-color .2s, color .2s;
}
.icon-btn:active { transform: scale(.94); }
.icon-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.icon-btn .i-off { display: none; }
.icon-btn[aria-pressed="false"] .i-on { display: none; }
.icon-btn[aria-pressed="false"] .i-off { display: block; }
#btn-pause { display: none; }
.stage:is([data-state="paused"], [data-state="ended"]) .hud-actions { visibility: hidden; }
.stage:is([data-state="ready"], [data-state="playing"]) #btn-pause { display: grid; }

/* Toast: a speech bubble from the dogs */

.toast {
  position: absolute; z-index: 7; left: 50%; top: 72px;
  translate: -50% 0;
  max-width: min(90%, 440px);
  padding: 10px 18px;
  border-radius: 22px;
  background: #fff; color: var(--magenta-deep);
  border: 2.5px solid var(--magenta);
  font-family: var(--font-display); font-weight: 700; font-size: 15px; line-height: 1.35; text-align: center;
  opacity: 0; transform: scale(.9) rotate(-1.5deg);
  transition: opacity .25s, transform .45s var(--ease-pop);
  pointer-events: none;
}
.toast::after {
  content: ''; position: absolute; left: 50%; bottom: -11px; width: 18px; height: 18px;
  background: #fff; border-right: 2.5px solid var(--magenta); border-bottom: 2.5px solid var(--magenta);
  transform: translateX(-50%) rotate(45deg); border-bottom-right-radius: 4px;
}
.toast.is-on { opacity: 1; transform: scale(1) rotate(-1.5deg); }

/* Overlays */

.overlay {
  position: absolute; inset: 0; z-index: 6;
  display: grid; place-items: start center;
  padding: clamp(14px, 3.4vw, 32px) 16px;
  background: linear-gradient(to bottom, rgba(255, 253, 248, 0.86) 0%, rgba(255, 253, 248, 0.7) 55%, rgba(255, 253, 248, 0) 85%);
  overflow-y: auto;
  animation: fade .35s ease both;
}
.overlay[hidden] { display: none; }
/* start/end cards can be taller than the stage: .fit-card (set by main.js) lets the stage grow around them */
.stage.fit-card { height: auto; display: grid; }
.stage.fit-card > .overlay:not([hidden]) { position: relative; inset: auto; overflow: visible; }
#ov-start { background: none; cursor: pointer; }
#ov-start .card { cursor: auto; }
.overlay--end { background: linear-gradient(to bottom, rgba(255, 253, 248, 0.72) 0%, rgba(255, 253, 248, 0) 62%); }

.card {
  width: min(460px, 100%);
  text-align: center;
  background: #fff;
  border-radius: 28px;
  padding: clamp(18px, 3.2vw, 30px);
  border: 1.5px solid rgba(32, 32, 70, 0.07);
  box-shadow: var(--shadow-soft);
  animation: pop .5s var(--ease-out) both;
}
.card--small { width: min(380px, 100%); }
.card--end { width: min(540px, 100%); }
/* room for the blanket picker so each design can be seen */
.card--start:has(.picker:not([hidden])) { width: min(540px, 100%); }

.card-title {
  margin: 4px 0 14px;
  font-family: var(--font-display); font-weight: 800;
  font-size: clamp(25px, 3.6vw, 34px); line-height: 1.08; letter-spacing: -0.02em;
  text-wrap: balance;
}
.card-text { margin: 0 0 16px; color: var(--muted); text-wrap: pretty; }

.eyebrow {
  margin: 0;
  font-family: var(--font-display); font-weight: 600;
  font-size: 12.5px; letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--magenta-deep);
  text-wrap: balance;
}

.howto { list-style: none; margin: 0 0 14px; padding: 0; text-align: left; display: grid; gap: 10px; }
.howto li {
  display: grid; grid-template-columns: 44px 1fr; gap: 12px; align-items: center;
  padding: 8px 12px 8px 8px; border-radius: 16px; background: var(--warm);
  font-size: 15.5px; line-height: 1.4;
}
.howto b { font-weight: 700; }
.howto-short { display: none; }
kbd {
  display: inline-block; min-width: 1.6em; padding: 0 .35em;
  border-radius: 6px; border: 1.5px solid rgba(32, 32, 70, .18); border-bottom-width: 3px;
  font: 700 12px/1.6 var(--font-display); text-align: center; background: #fff;
}
.coop-line { margin: 0 0 16px; font-size: 14px; color: var(--muted); }

.icon { width: 44px; height: 44px; display: block; }
.icon--lg { width: 64px; height: 64px; }
.icon--sm { width: 30px; height: 30px; }

.picker { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; margin: 0 0 18px; }
.picker[hidden] { display: none; }
.swatch-btn {
  position: relative; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 2px;
  min-width: 0; min-height: 48px; padding: 8px 4px 8px;
  border-radius: 14px; border: 2px solid var(--line); background: #fff; cursor: pointer;
  transition: border-color .2s, transform .15s;
}
.swatch-btn[aria-checked="true"] { border-color: var(--magenta); box-shadow: 0 0 0 2px rgba(228, 37, 110, .18); }
.swatch-btn.is-locked { border-style: dashed; cursor: not-allowed; }
.swatch { width: 100%; max-width: 96px; height: auto; aspect-ratio: 84 / 44; display: block; }
.swatch-name { font-family: var(--font-display); font-weight: 700; font-size: 13px; line-height: 1.2; color: var(--navy); margin-top: 2px; }
.swatch-cap { font-size: 11.5px; color: var(--muted); line-height: 1.2; text-wrap: balance; }
.swatch-btn.is-locked .swatch { opacity: .5; }
.swatch-lock { margin-top: auto; padding-top: 4px; /* same baseline on every locked card */ font-family: var(--font-display); font-weight: 700; font-size: 11px; color: var(--magenta-deep); }

.fine { margin: 12px 0 0; font-size: 13.5px; color: var(--muted); }

/* End card */

.end-rainbows { display: flex; justify-content: center; flex-wrap: wrap; gap: 6px; margin: -4px 0 12px; }
.end-rainbows[hidden] { display: none; }
.mini-rainbow { width: 54px; height: auto; animation: pop-in .45s var(--ease-pop) both; }

.haul { list-style: none; margin: 0 0 14px; padding: 10px 6px; display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; background: var(--warm); border-radius: 18px; }
.haul li { display: grid; justify-items: center; gap: 2px; }
.haul .icon { transition: opacity .3s; }
.haul b { font-family: var(--font-display); font-weight: 800; font-size: 18px; line-height: 1.1; }
.haul li[data-kind="corazon"] b { color: #C42A23; }
.haul li[data-kind="sol"] b { color: #A35F00; }
.haul li[data-kind="estrella"] b { color: var(--golden-ink); }
.haul li[data-kind="hoja"] b { color: #0B7425; }
.haul li[data-kind="burbuja"] b { color: #19708F; }
.haul li[data-kind="nota"] b { color: #1E4BA0; }
.haul li.haul-hugs { border-left: 1.5px dashed rgba(32, 32, 70, .15); }
.haul li.is-zero .icon { opacity: .35; }
.haul li.is-zero b { color: var(--muted); }

.end-total { margin: 0 0 14px; font-family: var(--font-display); font-weight: 700; font-size: 14.5px; color: var(--green-ink); }
.end-unlock { display: flex; align-items: center; justify-content: center; gap: 10px; margin: 0 0 16px; padding: 8px 12px; border-radius: 16px; background: var(--tint-pink); }
.end-unlock[hidden] { display: none; }
.end-unlock .swatch { width: 72px; height: 36px; }
.end-unlock p { margin: 0; text-align: left; font-size: 14.5px; line-height: 1.35; }

.postcard { margin: 14px auto 0; display: grid; justify-items: center; gap: 6px; }
.postcard[hidden] { display: none; }
.postcard img { width: min(220px, 70%); height: auto; border-radius: 12px; box-shadow: var(--shadow-soft); }

.end-adults { margin-top: 18px; padding-top: 16px; border-top: 1.5px dashed var(--line); }
.end-adults-eyebrow { margin: 0 0 4px; font-family: var(--font-display); font-weight: 600; font-size: 12px; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
.end-adults-text { margin: 0 0 6px; font-size: 14.5px; color: var(--navy); text-wrap: pretty; }

.text-link {
  display: inline-flex; align-items: center; gap: 4px; min-height: 32px;
  font-weight: 700; font-size: 15px; color: var(--magenta-deep); text-decoration: none;
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 24px;
  border-radius: 999px; border: 2px solid transparent;
  font-family: var(--font-display); font-weight: 700; font-size: 16px;
  text-decoration: none; cursor: pointer;
  transition: transform .15s var(--ease-out), background .2s, box-shadow .2s, color .2s, border-color .2s;
}
.btn:active { transform: scale(.97); }
.btn--primary { background: var(--magenta-deep); color: #fff; box-shadow: 0 10px 22px -10px rgba(228, 37, 110, .65); }
.btn--ghost { background: #fff; color: var(--navy); border-color: var(--line); }
.btn--big { min-height: 58px; padding: 0 44px; font-size: 19px; }
.btn .wa-glyph { width: 20px; height: 20px; fill: currentColor; }

.btn-row { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.btn-row--left { justify-content: flex-start; }

@media (hover: hover) {
  .header-link:hover { border-color: var(--magenta); color: var(--magenta-deep); background: #fff; }
  .wordmark:hover .ch { transform: translateY(-2px); }
  .wordmark:hover .ch:nth-child(even) { transform: translateY(2px); }
  .icon-btn:hover { border-color: var(--magenta); color: var(--magenta-deep); }
  .btn--primary:hover { background: var(--magenta-ink); box-shadow: 0 14px 26px -12px rgba(228, 37, 110, .7); }
  .btn--ghost:hover { border-color: var(--navy); }
  .text-link:hover { text-decoration: underline; text-underline-offset: 3px; }
  .why-card:hover, .service-card:hover { transform: translateY(-4px) rotate(0deg); box-shadow: var(--shadow-soft); }
  .swatch-btn:not(.is-locked):hover { border-color: var(--magenta); }
  .social a:hover { color: var(--magenta-deep); border-color: var(--magenta); }
  .map-app:hover { color: var(--magenta-deep); border-color: var(--magenta); }
  .service-ask:hover { background: #fff; border-color: var(--green); }
}

/* ---------- Sections ---------- */

.divider { display: block; width: min(1180px, 92%); height: 24px; margin: 0 auto; }
.divider path { fill: none; stroke: var(--line); stroke-width: 3; stroke-linecap: round; vector-effect: non-scaling-stroke; }

.why { padding: clamp(48px, 8vw, 96px) 0; }
.why--offscreen { padding-top: 0; }

.section-title {
  margin: 10px 0 14px;
  font-family: var(--font-display); font-weight: 800;
  font-size: clamp(32px, 5vw, 52px); line-height: 1.04; letter-spacing: -0.03em;
  max-width: 820px;
  text-wrap: balance;
}
.accent { color: var(--magenta); }
.section-lead { margin: 0; max-width: 660px; font-size: 18px; color: var(--muted); text-wrap: pretty; }
.section-foot { margin: 28px 0 0; font-size: 16.5px; color: var(--navy); }
.section-foot .text-link { display: inline; }

.why-grid { margin-top: 40px; display: grid; gap: 18px; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.why-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.why-card, .service-card {
  background: var(--crayon-box) center / 100% 100% no-repeat, var(--tint);
  border-radius: 24px;
  padding: 24px 22px 26px;
  transition: transform .35s var(--ease-out), box-shadow .35s;
}
.why-card:nth-child(odd), .service-card:nth-child(odd) { transform: rotate(-0.6deg); }
.why-card:nth-child(even), .service-card:nth-child(even) { transform: rotate(0.5deg); }
.why-card h3 {
  margin: 14px 0 8px;
  font-family: var(--font-display); font-weight: 700; font-size: 20px; line-height: 1.2;
  color: var(--ink); text-wrap: balance;
}
.why-card p { margin: 0; font-size: 15.5px; color: var(--navy); }
.why-card--pink, .service-card--pink { --tint: var(--tint-pink); --ink: var(--magenta-deep); }
.why-card--golden, .service-card--golden { --tint: var(--tint-golden); --ink: var(--golden-ink); }
.why-card--teal, .service-card--teal { --tint: var(--tint-teal); --ink: var(--teal-deep); }
.why-card--blue, .service-card--blue { --tint: var(--tint-blue); --ink: var(--blue); }
.service-card--green { --tint: var(--tint-green); --ink: var(--green-ink); }
.service-card--orange { --tint: var(--tint-orange); --ink: #A3500F; }
.service-card--purple { --tint: var(--tint-purple); --ink: var(--purple); }

/* ---------- Marquee ---------- */

.marquee {
  position: relative;
  background: var(--teal-deep);
  overflow: hidden;
  padding: 22px 0;
}
.marquee::before, .marquee::after {
  content: ''; position: absolute; left: 0; right: 0; height: 9px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='9' viewBox='0 0 120 9'%3E%3Cpath d='M0 4.5c10-4 20-4 30 0s20 4 30 0 20-4 30 0 20 4 30 0' fill='none' stroke='%23E4256E' stroke-width='3' stroke-linecap='round'/%3E%3C/svg%3E") repeat-x;
}
.marquee::before { top: 0; }
.marquee::after { bottom: 0; }
.marquee-track { display: flex; width: max-content; animation: marquee 38s linear infinite; }
.marquee.is-paused .marquee-track { animation-play-state: paused; }
.marquee-list { list-style: none; margin: 0; padding: 0; display: flex; align-items: center; }
.marquee-list li {
  display: flex; align-items: center; white-space: nowrap;
  color: #fff; font-family: var(--font-display); font-weight: 500;
  font-size: clamp(15px, 1.8vw, 19px); letter-spacing: 0.18em; text-transform: uppercase;
}
.marquee-list li::after { content: ''; width: 16px; height: 16px; margin: 0 22px; background: url("/assets/corazon.webp") center / contain no-repeat; }
.marquee-list li:nth-child(even)::after {
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M8 2.2c3.2-.1 5.7 2.4 5.8 5.5.1 3.2-2.4 6-5.6 6.1C5 13.9 2.3 11.4 2.2 8.3 2.1 5.2 4.8 2.3 8 2.2z' fill='%23E9BF0B'/%3E%3C/svg%3E") center / 12px no-repeat;
}
.marquee-toggle {
  position: absolute; right: max(10px, env(safe-area-inset-right, 0px)); top: 50%; translate: 0 -50%; z-index: 2;
  width: 44px; height: 44px; border-radius: 999px; display: grid; place-items: center;
  background: var(--teal-deep); border: 2px solid rgba(233, 191, 11, .7); cursor: pointer;
}
.marquee-toggle svg { width: 20px; height: 20px; fill: none; stroke: var(--golden); stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.marquee-toggle .i-play { display: none; fill: var(--golden); }
.marquee.is-paused .marquee-toggle .i-pause { display: none; }
.marquee.is-paused .marquee-toggle .i-play { display: block; }
.marquee-toggle:focus-visible { outline-color: #fff; }

/* ---------- Services ---------- */

.services { padding: clamp(56px, 8vw, 100px) 0 clamp(24px, 4vw, 48px); scroll-margin-top: 16px; }
.services-grid { list-style: none; margin: 40px 0 0; padding: 0; display: grid; gap: 18px; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.service-card { display: flex; flex-direction: column; padding: 22px 20px 20px; }
.service-card h3 { margin: 0 0 8px; font-family: var(--font-display); font-weight: 800; font-size: 19px; line-height: 1.15; color: var(--navy); text-wrap: balance; }
.service-age {
  align-self: flex-start; margin: 0 0 10px; padding: 3px 10px; border-radius: 999px;
  background: #fff; border: 1.5px solid rgba(32, 32, 70, .1);
  font-family: var(--font-display); font-weight: 700; font-size: 12px; letter-spacing: .02em; color: var(--ink);
}
.service-tagline { margin: 0 0 6px; font-family: var(--font-display); font-weight: 700; font-size: 14.5px; line-height: 1.3; color: var(--ink); }
.service-desc { margin: 0 0 16px; font-size: 14.5px; line-height: 1.5; color: var(--navy); opacity: .85; flex: 1; }
.service-ask {
  display: inline-flex; align-items: center; gap: 8px; align-self: flex-start;
  min-height: 44px; padding: 0 14px 0 10px; border-radius: 999px;
  background: rgba(255, 255, 255, .75); border: 1.5px solid rgba(7, 141, 70, .3);
  font-family: var(--font-display); font-weight: 700; font-size: 13.5px; color: var(--green-ink); text-decoration: none;
  transition: background .2s, border-color .2s;
}
.service-ask .wa-glyph { width: 20px; height: 20px; fill: var(--green); }

/* ---------- Visit ---------- */

.visit { padding: clamp(48px, 8vw, 100px) 0 clamp(56px, 9vw, 110px); scroll-margin-top: 16px; }
.visit-grid { display: grid; grid-template-columns: 1fr 1.05fr; gap: clamp(28px, 5vw, 72px); align-items: center; }

.visit-art { position: relative; aspect-ratio: 520 / 330; max-width: 560px; width: 100%; margin-inline: auto; }
.visit-rainbow { width: 100%; height: auto; }
.visit-dog {
  position: absolute; bottom: 0; width: 46%; aspect-ratio: 320 / 181;
  background-size: 900% 100%; background-repeat: no-repeat;
  animation: boil .3s steps(1, end) infinite;
}
.visit-dog--azul { left: 2%; background-image: url("/assets/perro-azul.webp"); }
.visit-dog--dorado { right: 2%; background-image: url("/assets/perro-dorado.webp"); animation-delay: -.1s; }
.visit-blanket {
  position: absolute; left: 43.5%; width: 13%; bottom: 21%; height: 12%; overflow: visible;
  transform-origin: 50% 0; animation: sway 3s ease-in-out infinite;
}
.visit-blanket path { fill: none; stroke-width: 4.5; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.visit-blanket .s1 { stroke: var(--magenta); }
.visit-blanket .s2 { stroke: var(--golden); }
.visit-blanket .s3 { stroke: var(--teal); }

.facts { list-style: none; margin: 22px 0 0; padding: 0; display: grid; gap: 8px; }
.facts li { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 15.5px; }
.welcome { margin: 18px 0 22px; font-size: 15.5px; color: var(--muted); text-wrap: pretty; }
.cta-note { margin: 10px 0 0; font-size: 14px; color: var(--muted); }

/* map + "cómo llegar" */
.map { margin-top: clamp(36px, 6vw, 64px); border: 2px solid var(--line); border-radius: 24px; background: #fff; overflow: hidden; box-shadow: var(--shadow-soft); }
.map-frame { display: block; width: 100%; height: clamp(260px, 38vw, 420px); border: 0; background: #EEF3EE; }
.map-bar { display: flex; align-items: center; justify-content: space-between; gap: 14px 24px; flex-wrap: wrap; padding: 16px 20px; }
.address { margin: 0; font-size: 15px; color: var(--muted); }
.address b { color: var(--navy); }
.map-apps { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.map-apps-label { font-size: 14px; font-weight: 700; color: var(--navy); margin-right: 2px; }
.map-app {
  display: inline-flex; align-items: center; gap: 7px;
  min-height: 40px; padding: 0 14px 0 11px;
  border-radius: 999px; border: 2px solid var(--line); background: #fff;
  font-family: var(--font-display); font-weight: 700; font-size: 14px; color: var(--navy);
  text-decoration: none;
  transition: transform .15s var(--ease-out), border-color .2s, color .2s;
}
.map-app:active { transform: scale(.97); }
.map-app svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.map-app .dot { fill: currentColor; stroke: none; }

/* ---------- Floating WhatsApp ---------- */

.wa-fab {
  position: fixed; z-index: 40;
  right: max(16px, env(safe-area-inset-right, 0px));
  bottom: max(16px, env(safe-area-inset-bottom, 0px));
  display: inline-flex; align-items: center; gap: 10px;
  min-height: 56px; padding: 6px 20px 6px 6px;
  border-radius: 999px; background: #fff;
  border: 1.5px solid rgba(32, 32, 70, .08); box-shadow: var(--shadow-soft), 0 6px 18px -8px rgba(32, 32, 70, .3);
  font-family: var(--font-display); font-weight: 700; font-size: 15px; color: var(--navy); text-decoration: none;
  transition: opacity .3s, translate .3s var(--ease-out), visibility 0s, padding .3s var(--ease-out);
}
.wa-fab-dot { position: relative; width: 44px; height: 44px; border-radius: 50%; background: var(--wa); display: grid; place-items: center; flex: none; }
.wa-glyph--white { width: 26px; height: 26px; fill: #fff; }
.wa-ring { position: absolute; inset: -5px; width: 54px; height: 54px; overflow: visible; }
.wa-ring path { fill: none; stroke: var(--green); stroke-width: 2; stroke-linecap: round; }
.wa-fab.is-compact { padding: 6px; }
.wa-fab.is-compact .wa-fab-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.wa-fab.is-hidden { opacity: 0; translate: 0 24px; pointer-events: none; visibility: hidden; transition: opacity .3s, translate .3s var(--ease-out), visibility 0s .3s; }
.wa-fab.wiggle { animation: wiggle .6s ease-in-out 1; }

/* ---------- Footer ---------- */

.site-footer { border-top: 1.5px solid var(--line); padding: 28px 0 calc(36px + env(safe-area-inset-bottom, 0px)); }
.footer-row { display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap; }
.social { list-style: none; margin: 0; padding: 0; display: flex; gap: 8px; }
.social a {
  width: 44px; height: 44px; display: grid; place-items: center; border-radius: 999px;
  border: 1.5px solid var(--line); color: var(--navy); transition: color .2s, border-color .2s;
}
.social svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.social .dot, .social .fill { fill: currentColor; stroke: none; }
.legal { margin: 0; font-size: 13.5px; color: var(--muted); }

/* ---------- Motion ---------- */

@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes pop { from { opacity: 0; transform: translateY(10px) scale(.97); } to { opacity: 1; transform: none; } }
@keyframes pop-in { from { opacity: 0; transform: scale(.4) translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-12px); } }
@keyframes float-sm { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }
@keyframes letter-bob { 0%, 100% { transform: translateY(0); } 15% { transform: translateY(-0.06em); } 30% { transform: translateY(0); } }
@keyframes marquee { to { transform: translateX(-50%); } }
@keyframes bump { 0% { transform: scale(1); } 40% { transform: scale(1.35); } 100% { transform: scale(1); } }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes wiggle { 0%, 100% { rotate: 0deg; } 25% { rotate: -5deg; } 50% { rotate: 5deg; } 75% { rotate: -3deg; } }
@keyframes sway { 0%, 100% { rotate: -2deg; } 50% { rotate: 2deg; } }
@keyframes boil {
  0% { background-position: 0% 0; }
  33.333% { background-position: 12.5% 0; }
  66.666% { background-position: 25% 0; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .greeting, h1, .lead, .stage, .overlay, .card, .deco, .rainbow-word .ch, .marquee-track, .visit-dog, .visit-blanket,
  .hud-rainbow.bump, .wa-fab.wiggle, .mini-rainbow, .toast { animation: none; }
  .swoosh path { animation: none; stroke-dashoffset: 0; }
  .why-card, .service-card, .why-card:nth-child(n), .service-card:nth-child(n) { transform: none; transition: none; }
  .marquee-track { flex-wrap: wrap; width: auto; justify-content: center; }
  .marquee-list + .marquee-list { display: none; }
  .marquee-list { flex-wrap: wrap; justify-content: center; row-gap: 6px; padding: 0 56px; }
  .marquee-toggle { display: none; }
}

/* ---------- Responsive ---------- */

@media (max-width: 980px) {
  .why-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .why-grid--3 { grid-template-columns: 1fr; max-width: 560px; }
  .services-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .visit-grid { grid-template-columns: 1fr; }
  .visit-copy { text-align: center; }
  .visit-copy .section-title, .visit-copy .section-lead { margin-inline: auto; }
  .facts { justify-items: center; }
  .btn-row--left { justify-content: center; }
  .deco--wand { display: none; }
  .map-bar { justify-content: center; text-align: center; }
  .map-apps { justify-content: center; }
}

@media (max-width: 640px) {
  body { font-size: 16px; }
  .header-row { padding-block: 14px; }
  .header-link { display: none; }
  .header-row { justify-content: center; }
  .greeting { font-weight: 300; letter-spacing: .14em; }
  .hero { padding-bottom: 40px; }
  .lead { margin: 18px auto 20px; }
  .stage { height: min(clamp(500px, 76vh, 640px), calc(100vh - 16px)); height: min(clamp(500px, 76svh, 640px), calc(100svh - 16px)); border-radius: 24px; }
  .why-grid { grid-template-columns: 1fr; }
  /* on phones the doodles frame the logo, where there's room, instead of covering the title */
  .deco { animation-name: float-sm; }
  .deco--heart { top: -40px; left: max(4px, calc(50% - 168px)); width: 38px; }
  .deco--bubbles { top: -40px; right: max(2px, calc(50% - 170px)); width: 42px; }
  .footer-row { flex-direction: column; text-align: center; }

  /* compact start card so the rainbow, the dogs and the demo stay visible under it */
  .howto { grid-template-columns: repeat(3, 1fr); gap: 6px; }
  .howto li { grid-template-columns: 1fr; justify-items: center; text-align: center; background: none; padding: 4px; font-size: 12.5px; gap: 4px; }
  .howto-short { display: block; font-family: var(--font-display); font-size: 13px; line-height: 1.2; }
  .howto-long { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .eyebrow { letter-spacing: .14em; font-size: 11.5px; }
  #ov-start { background: linear-gradient(to bottom, rgba(255, 253, 248, .9) 0%, rgba(255, 253, 248, .75) 35%, rgba(255, 253, 248, 0) 50%); }
  .coop-line { font-size: 13px; margin-bottom: 12px; }
  .haul b { font-size: 16px; }
}

@media (max-width: 480px) {
  .services-grid { grid-template-columns: 1fr; }
  .picker { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; margin-bottom: 14px; }
  .swatch-btn { padding: 6px 3px; }
  .card--start:has(.picker:not([hidden])) .howto .icon { width: 34px; height: 34px; }
  .card--start:has(.picker:not([hidden])) .card-title { margin-bottom: 8px; }
  .card--start:has(.picker:not([hidden])) .coop-line { margin-bottom: 10px; }
}

@media (max-width: 440px) {
  .overlay { padding: 10px; }
  .card { padding: 16px 14px; border-radius: 22px; }
  .card-title { font-size: 24px; margin-bottom: 10px; }
  .howto { margin-bottom: 10px; }
  .btn--big { min-height: 52px; }
  .fine { margin-top: 8px; }
  .haul { padding: 8px 2px; }
  .icon--sm { width: 26px; height: 26px; }
}

@media (max-width: 399px) {
  .hud { gap: 6px; top: 10px; left: 10px; right: 10px; }
  .hud-pill { padding: 0 10px; gap: 6px; }
  .toast { top: 62px; font-size: 14px; }
}

/* landscape phones: the whole stage on screen, less hero above it */
@media (orientation: landscape) and (max-height: 520px) {
  .greeting, .lead, .deco, .stage-hint { display: none; }
  h1 { font-size: 34px; }
  .hero-copy { padding-bottom: 10px; }
  .stage { height: max(240px, calc(100vh - 16px)); height: max(240px, calc(100svh - 16px)); border-radius: 18px; }
  .howto { grid-template-columns: repeat(3, 1fr); gap: 6px; }
  .howto li { grid-template-columns: 1fr; justify-items: center; text-align: center; background: none; padding: 2px; font-size: 12.5px; gap: 2px; }
  .howto-short { display: block; font-family: var(--font-display); font-size: 13px; }
  .howto-long { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .card { padding: 12px 16px; }
  .card-title { font-size: 22px; margin-bottom: 8px; }
  .coop-line { display: none; }
}

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

.nf {
  min-height: 100vh; min-height: 100svh; display: grid; place-content: center; justify-items: center; gap: 14px;
  padding: 32px var(--gutter); text-align: center;
}
.nf-art { width: min(420px, 86vw); margin-bottom: 8px; }
.nf-title { font-size: clamp(34px, 6vw, 60px); margin: 0; }
.nf-lead { margin: 0 auto 10px; }
