/* The front door (index.html only), on top of base.css and its tokens.
   Layout: a cobalt band with the headline, Mar standing on the mission card and
   six science stickers floating round her; then white sections: the floating
   toy, the four steps of a mission on a rail that fills as you scroll, the
   crew, your missions, and a dark panel for parents.
   Motion: everything moves only under .lp-motion, which assets/landing.js adds
   when the visitor has not asked for reduced motion. Without it, or without
   script, the page is complete and still. */

.lp-wrap { max-width: 1120px; margin: 0 auto; padding-left: max(20px, env(safe-area-inset-left, 0px)); padding-right: max(20px, env(safe-area-inset-right, 0px)); }
.lp-top { min-height: 56px; margin: 0 auto; padding-top: 8px; padding-bottom: 8px; } /* auto: centred with the page, as .lp-wrap is */

/* ---------- The band ---------- */
.lp-hero { position: relative; overflow: hidden; padding-bottom: 44px; background: var(--lead); color: #ffffff; }
.lp-hero-in { display: grid; grid-template-areas: "text" "stage" "card"; padding-top: 20px; }
.lp-hero-text { grid-area: text; }
.lp-hero h1 { margin: 0 0 12px; font-size: 36px; line-height: 1.08; font-weight: 700; letter-spacing: -0.01em; text-wrap: balance; color: #ffffff; }
.lp-lead { margin: 0; max-width: 36ch; font-size: 17px; line-height: 1.5; color: #dfe6ff; }

.lp-stage { grid-area: stage; position: relative; height: 270px; margin-top: 8px; }
.lp-stage .hero-char { right: auto; left: 50%; bottom: 0; height: 100%; max-width: none; translate: -50% 0; }
/* Three layers, so the motions never fight: .sticker moves with scroll and pointer (landing.js),
   .sticker-float drifts on its own rhythm, the img pops in and does its trick when tapped. */
.sticker { position: absolute; display: block; width: 58px; will-change: transform; cursor: pointer; -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
.sticker-float { display: block; }
.sticker img { display: block; width: 100%; height: auto; -webkit-user-drag: none; user-select: none; }
.s-planta img { transform-origin: 50% 100%; } /* it grows from its pot */
.s-barco img { transform-origin: 50% 85%; }   /* it rocks on its keel */
.lp-stage .hero-char { pointer-events: auto; cursor: pointer; -webkit-tap-highlight-color: transparent; } /* tap Mar: she waves again */
.s-iman { left: 0; top: 6%; width: 54px; }
.s-matraz { left: 4%; top: 38%; width: 46px; }
.s-barco { left: 0; top: 70%; width: 70px; }
.s-cohete { right: 2%; top: 2%; width: 56px; }
.s-cristal { right: 0; top: 36%; width: 56px; }
.s-planta { right: 4%; top: 66%; width: 50px; }

/* The next-mission card: white on the band, raised on a darker blue edge. Its own component,
   not base.css's blue .hero repainted; home.js finds it by [data-next-mission]. */
.next-card { grid-area: card; position: relative; z-index: 1; margin: 0; padding: 20px; border-radius: 24px; background: #ffffff; color: var(--ink); box-shadow: 0 6px 0 var(--lead-edge); }
.next-card h2 { margin: 0 0 6px; font-size: 24px; line-height: 1.2; text-wrap: balance; color: var(--ink); }
.next-card .meta2 { margin: 0 0 14px; font-size: 15px; font-weight: 500; color: var(--ink-2); }
.next-card .segs { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 4px; width: 150px; margin: 0 0 20px; }
.next-card .segs i { height: 8px; border-radius: 4px; background: var(--line); transition: background-color var(--t-mid) var(--ease); }
.next-card .segs i.on { background: var(--lead); }
.lp-wave { position: absolute; left: 0; bottom: -1px; width: 100%; height: 44px; fill: var(--page); }

/* ---------- Sections ---------- */
.lp main > .lp-wrap > section, .lp-yours { margin-top: 56px; }
.lp-head h2, .lp-xmas h2, .lp-parents h2 { margin: 0 0 8px; font-size: 28px; line-height: 1.15; font-weight: 700; text-wrap: balance; }
.lp-head p { max-width: 52ch; margin: 0 0 20px; font-size: 17px; line-height: 1.5; color: var(--ink-2); }

/* ---------- The floating toy ---------- */
.toy { display: grid; gap: 18px; }
.toy-tank { position: relative; height: 220px; border: 3px solid var(--ink); border-top: 0; border-radius: 0 0 24px 24px; background: var(--page); }
.toy-water { position: absolute; left: 0; right: 0; bottom: 0; height: 58%; border-radius: 0 0 21px 21px; background: var(--water); box-shadow: inset 0 3px 0 var(--lead); } /* the line is the water's surface */
.toy-clay { position: absolute; left: 50%; top: 0; width: 120px; height: 60px; overflow: visible; transform: translate(-50%, var(--y, -80px)); }
.toy-clay g { display: none; fill: var(--clay); stroke: var(--ink); stroke-width: 3; stroke-linejoin: round; }
.toy-clay[data-shape="bola"] .clay-bola, .toy-clay[data-shape="cuenco"] .clay-cuenco, .toy-clay[data-shape="barco"] .clay-barco { display: inline; }
.toy-clay[data-shape="none"] { visibility: hidden; }
.toy-shapes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.toy-pick { min-height: 52px; padding: 0 8px; border: 2px solid var(--line-2); border-radius: 16px; background: #ffffff; color: var(--ink); font: inherit; font-size: 16px; cursor: pointer; touch-action: manipulation; }
.toy-pick[aria-pressed="true"] { border: 3px solid var(--ink); background: var(--yellow-soft); font-weight: 700; }
.toy-msg { min-height: 4.2em; margin: 14px 0 6px; font-size: 16px; line-height: 1.4; }
.toy-bars p { display: grid; grid-template-columns: 8.5em minmax(0, 1fr) 3.5em; align-items: center; gap: 10px; margin: 0 0 8px; font-size: 14px; color: var(--ink-2); }
.toy-bars i { position: relative; display: block; height: 12px; overflow: hidden; border-radius: 6px; background: var(--quiet); }
.toy-bars i::after { content: ""; position: absolute; inset: 0; border-radius: 6px; background: var(--ink); transform: scaleX(var(--v, 0)); transform-origin: left; }
.toy-bars i.toy-holds::after { background: var(--lead); }
.toy-bars b { color: var(--ink); text-align: right; font-variant-numeric: tabular-nums; }
.toy .next-q { margin-top: 14px; }

/* ---------- The four steps ---------- */
.steps { --p: 1; position: relative; display: grid; gap: 32px; margin: 0; padding: 0; list-style: none; }
/* The rail runs from the first circle to the last; landing.js measures --rail (where the last step starts).
   Without it, the rail runs the full list. */
.steps::before, .steps::after { content: ""; position: absolute; left: 20px; top: 22px; width: 4px; height: var(--rail, calc(100% - 44px)); border-radius: 2px; background: var(--line); }
.steps::after { background: var(--lead); transform: scaleY(var(--p)); transform-origin: top; }
.step { position: relative; display: grid; gap: 10px; padding-left: 62px; }
/* .step .step-n, not .step-n: the number is a <p> inside .step-text, whose grey 16px text would win. */
.step .step-n { position: absolute; left: 0; top: 0; z-index: 1; display: flex; align-items: center; justify-content: center; width: 44px; height: 44px; margin: 0; border-radius: 50%; background: var(--lead); color: #ffffff; font-family: var(--font-display); font-size: 18px; font-weight: 700; box-shadow: 0 4px 0 var(--lead-edge); }
.step-art { height: 170px; }
.step-art img { height: 100%; width: auto; }
.step-art .sprite { height: 100%; }
.step-art .sprite img { height: 100%; }
.step-text h3 { margin: 0 0 4px; font-size: 22px; line-height: 1.2; }
.step-text p { max-width: 46ch; margin: 0; font-size: 16px; line-height: 1.5; color: var(--ink-2); }
.step-home .step-art { height: 190px; }

/* ---------- The crew ---------- */
.crew { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin: 0; padding: 0; list-style: none; }
.mate { position: relative; min-width: 0; }
.mate-btn { display: flex; flex-direction: column; align-items: center; width: 100%; padding: 0 0 12px; border: 2px solid var(--line); border-radius: 20px; background: #ffffff; color: var(--ink); font: inherit; box-shadow: 0 4px 0 var(--line); cursor: pointer; touch-action: manipulation; }
.mate-btn:active { transform: translateY(2px); box-shadow: 0 2px 0 var(--line); }
.mate-btn[aria-pressed="true"] { border-color: var(--sci-edge); box-shadow: 0 4px 0 var(--sci-edge); }
.mate-pic { position: relative; display: block; width: 100%; height: 176px; margin-bottom: 10px; overflow: hidden; border-radius: 18px 18px 0 0; background: color-mix(in srgb, var(--sci) 24%, #ffffff); }
.mate-pic img { position: absolute; left: 50%; bottom: 0; height: 94%; width: auto; translate: -50% 0; }
.mate-pic .pose-hi { opacity: 0; }
.mate-btn[aria-pressed="true"] .pose-hi { opacity: 1; }
.mate-btn[aria-pressed="true"] .pose-obj { opacity: 0; }
.mate-name { font-size: 17px; font-weight: 700; line-height: 1.3; }
.mate-sci { font-size: 13px; color: var(--ink-2); }
/* What a scientist says floats over the card below, so a tap never moves the page. */
.mate-say { position: absolute; left: 4px; right: 4px; top: calc(100% + 4px); z-index: 2; margin: 0; font-size: 14px; line-height: 1.4; }
.mate-say:empty { display: none; }
.mate-say:not(:empty) { padding: 10px 12px; border: 2px solid var(--sci-edge); border-radius: 4px 16px 16px 16px; background: #ffffff; box-shadow: 0 8px 20px rgb(18 23 43 / 0.16); }

/* ---------- Yours, Christmas, parents ---------- */
.lp-yours section { margin-bottom: 28px; }
/* With no side card (the Christmas card is back once its page is published), missions and
   the collection share the row instead of leaving the right column empty. */
@media (min-width: 1000px) {
  .lp-yours > :only-child { grid-column: 1 / -1; display: grid; grid-template-columns: 420px minmax(0, 1fr); gap: 32px; align-items: start; }
}
.lp-xmas { padding: 20px; border-radius: 24px; background: var(--quiet); }
.lp-xmas h2 { font-size: 22px; }
.lp-xmas p { margin: 0 0 16px; font-size: 16px; line-height: 1.5; color: var(--ink-2); }
.lp-xmas .next-q { background: #ffffff; }
.lp-parents { margin-top: 56px; padding: 24px 20px; border-radius: 24px; background: var(--ink); color: #ffffff; }
.promises { display: grid; gap: 12px; margin: 0 0 18px; padding: 0; list-style: none; }
.promises li { font-size: 16px; line-height: 1.5; color: #d5d9e6; }
.promises strong { color: #ffffff; }
.lp-parents .next-q { border-color: #ffffff; color: #ffffff; }
.lp-parents .next-q:hover { color: var(--yellow); border-color: var(--yellow); }
.lp-parents :focus-visible { outline-color: var(--yellow); }
/* The one filled button in the panel: a parent's way into the dashboard. */
.lp-account { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; margin-top: 24px; padding-top: 22px; border-top: 1px solid rgb(255 255 255 / 0.18); }
.lp-account p { flex: 1 1 260px; margin: 0; font-size: 15px; line-height: 1.5; color: rgb(255 255 255 / 0.82); }
.lp > .foot { margin-top: 40px; padding-bottom: 32px; }

/* ---------- Wider screens ---------- */
@media (min-width: 640px) {
  .crew { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .toy { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; gap: 28px; }
  .step { grid-template-columns: 200px minmax(0, 1fr); align-items: center; gap: 20px; }
  .step-art { display: flex; justify-content: center; }
}
@media (min-width: 900px) {
  .lp-hero { padding-bottom: 64px; }
  .lp-hero-in { grid-template-columns: minmax(0, 1fr) minmax(0, 0.9fr); grid-template-areas: "text stage" "card stage"; column-gap: 32px; align-items: end; padding-top: 48px; }
  .lp-hero h1 { font-size: 60px; }
  .lp-lead { margin-bottom: 28px; font-size: 19px; }
  .next-card { max-width: 440px; align-self: start; }
  .lp-stage { height: 470px; margin: 0; }
  .sticker { width: 84px; }
  .s-iman { width: 78px; } .s-matraz { width: 64px; } .s-barco { width: 100px; } .s-cohete { width: 80px; } .s-cristal { width: 80px; } .s-planta { width: 72px; }
  .lp main > .lp-wrap > section, .lp-yours { margin-top: 88px; }
  .lp-head h2, .lp-parents h2 { font-size: 34px; }
  .crew { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  /* The four steps side by side, the rail running through their numbers left to right. */
  .steps { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 28px; margin-top: 8px; }
  .step { grid-template-columns: none; align-items: start; align-content: start; gap: 14px; padding: 64px 0 0; } /* align-content: a longer text never pushes its neighbours' titles down */
  .step .step-n { top: 0; left: 0; }
  .step-art { height: 190px; justify-content: flex-start; }
  .step-home .step-art { height: 190px; }
  /* Without the script: four equal columns 28px apart put the last circle 75% + 21px along. */
  .steps::before, .steps::after { top: 20px; left: 22px; width: var(--rail, calc(75% + 21px)); height: 4px; }
  .steps::after { transform: scaleX(var(--p)); transform-origin: left; }
  .lp-parents { padding: 36px 40px; }
  .lp-parents .next-q { max-width: 440px; }
  .promises { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 32px; }
}

/* ---------- Motion (only when allowed) ---------- */
.lp-motion [data-reveal] { opacity: 0; transform: translateY(18px); transition: opacity var(--t-slow) var(--ease), transform var(--t-slow) var(--ease); }
.lp-motion [data-reveal].is-in { opacity: 1; transform: none; }
/* landing.js's safety net: the observer never reported, so everything shows at once, still. */
/* .lp-motion.lp-shown: both classes, so these outrank every motion rule below, wherever they sit. */
.lp-motion.lp-shown [data-reveal], .lp-motion.lp-shown .sticker img, .lp-motion.lp-shown .lp-stage .hero-char { opacity: 1; transform: none; transition: none; animation: none; }
.lp-motion.lp-shown .steps .step .step-n { background: var(--lead); color: #ffffff; box-shadow: 0 4px 0 var(--lead-edge); transition: none; }
.lp-motion .crew .mate:nth-child(2) { transition-delay: 60ms; }
.lp-motion .crew .mate:nth-child(3) { transition-delay: 120ms; }
.lp-motion .crew .mate:nth-child(4) { transition-delay: 180ms; }
.lp-motion .crew .mate:nth-child(5) { transition-delay: 240ms; }
.lp-motion .crew .mate:nth-child(6) { transition-delay: 300ms; }
/* The band comes alive: Mar rises in, the stickers pop in round her one after another, then each
   drifts on its own rhythm (own length, sway and start), so they never move in step. */
.lp-motion .lp-stage .hero-char { animation: lp-arrive 640ms var(--ease) both; }
.lp-motion .sticker img { animation: lp-pop 620ms var(--ease) calc(360ms + var(--i, 0) * 90ms) both; } /* the site's one easing; the pop is in the keyframes */
.lp-motion .sticker-float { animation: lp-drift var(--dur, 4s) ease-in-out var(--wait, 0s) infinite; }
.s-iman    { --i: 0; } .s-iman .sticker-float    { --dur: 3.8s; --rot: 6deg; --dx: -3px; --wait: -0.4s; }
.s-cohete  { --i: 1; } .s-cohete .sticker-float  { --dur: 3.2s; --rot: 4deg; --dx: 4px;  --wait: -1.9s; }
.s-matraz  { --i: 2; } .s-matraz .sticker-float  { --dur: 4.6s; --rot: 5deg; --dx: 2px;  --wait: -2.6s; }
.s-cristal { --i: 3; } .s-cristal .sticker-float { --dur: 5.2s; --rot: 3deg; --dx: -2px; --wait: -1.1s; }
.s-barco   { --i: 4; } .s-barco .sticker-float   { --dur: 4.2s; --rot: 7deg; --dx: 3px;  --wait: -3.3s; }
.s-planta  { --i: 5; } .s-planta .sticker-float  { --dur: 4.9s; --rot: 3deg; --dx: -3px; --wait: -0.8s; }
@keyframes lp-arrive { from { opacity: 0; transform: translateY(28px) scale(0.96); } to { opacity: 1; transform: none; } }
@keyframes lp-pop { from { opacity: 0; transform: scale(0.2) rotate(-24deg); } 65% { opacity: 1; transform: scale(1.07) rotate(3deg); } to { opacity: 1; transform: none; } }
@keyframes lp-drift {
  0%, 100% { transform: translate(0, 0) rotate(calc(var(--rot, 3deg) * -1)); }
  50% { transform: translate(var(--dx, 0px), -9px) rotate(var(--rot, 3deg)); }
}
.lp-motion .toy-clay.is-moving { transition: transform var(--t-slow) var(--ease); }
.lp-motion .toy-clay.is-afloat g { animation: lp-float 2.4s var(--ease) infinite alternate; }
@keyframes lp-float { from { transform: translateY(-1.5px); } to { transform: translateY(1.5px); } }
.lp-motion .toy-bars i::after { transition: transform var(--t-slow) var(--ease); }
.lp-motion .steps .step-n { transition: background-color var(--t-mid) var(--ease), box-shadow var(--t-mid) var(--ease), color var(--t-mid) var(--ease); }
.lp-motion .steps .step:not(.is-on) .step-n { background: #ffffff; color: var(--ink-2); box-shadow: 0 0 0 3px var(--line) inset; }
.lp-motion .mate-pic img { transition: opacity var(--t-mid) var(--ease), transform var(--t-mid) var(--ease); }
.lp-motion .mate-btn[aria-pressed="true"] .pose-hi { animation: sn-pop var(--t-mid) var(--ease) both; }
.lp-motion .mate-say:not(:empty) { animation: sn-rise var(--t-mid) var(--ease) both; }
