/* Web de Tamagowoulda. La misma paleta y el mismo relieve que la app:
   contorno azul marino, sombra dura y menta. Sin fuentes externas: en un
   iPhone, ui-rounded es la SF Rounded de la propia app. */

:root {
  --ground: #FFF8EC;
  --surface: #FFFFFF;
  --ink: #1E2A44;
  --muted: #56617A;
  --line: #1E2A44;
  --shadow: #1E2A44;
  --mint: #7FD8BE;
  --mint-strong: #4CC38A;
  --mint-soft: #EAF7F2;
  --sky-top: #FFE3C4;
  --sky-bottom: #CFE9FF;
  --past: #5B8DEF;
  --present: #4CC38A;
  --future: #F5A623;
  --unreal: #9B6BEF;
  --radius: 24px;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ground: #131A29;
    --surface: #1C2539;
    --ink: #EEF2FA;
    --muted: #A9B4CA;
    --line: #8E9DBD;
    --shadow: #060911;
    --mint-soft: #16352C;
    --sky-top: #2A2440;
    --sky-bottom: #17263F;
  }
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font: 17px/1.6 ui-rounded, "SF Pro Rounded", "Hiragino Maru Gothic ProN",
    "Apple SD Gothic Neo", "Nunito", system-ui, -apple-system, "Segoe UI", sans-serif;
}

:lang(ja) body, body:lang(ja) {
  font-family: ui-rounded, "Hiragino Maru Gothic ProN", "Hiragino Sans", "Yu Gothic", system-ui, sans-serif;
  line-height: 1.75;
}
:lang(ko) body, body:lang(ko) {
  font-family: ui-rounded, "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", system-ui, sans-serif;
  line-height: 1.7;
  word-break: keep-all;
}

img { max-width: 100%; display: block; }

a { color: inherit; }

a:focus-visible, button:focus-visible, summary:focus-visible {
  outline: 3px solid var(--mint-strong);
  outline-offset: 3px;
  border-radius: 8px;
}

.wrap { max-width: 1080px; margin: 0 auto; padding-inline: 20px; }

/* ---------- Barra superior ---------- */

.top {
  position: sticky;
  top: 0;
  z-index: 10;
  background: color-mix(in srgb, var(--ground) 88%, transparent);
  backdrop-filter: saturate(1.2) blur(10px);
  -webkit-backdrop-filter: saturate(1.2) blur(10px);
  border-bottom: 2px solid color-mix(in srgb, var(--line) 18%, transparent);
}
.top .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px 20px;
  flex-wrap: wrap;
  padding-block: 12px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-weight: 900;
  font-size: 20px;
}
.brand img {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: 2px solid var(--line);
}
.nav { display: flex; align-items: center; gap: 6px 16px; flex-wrap: wrap; font-weight: 700; font-size: 15px; }
.nav a { text-decoration: none; opacity: .85; }
.nav a:hover { opacity: 1; text-decoration: underline; text-underline-offset: 4px; }
.langs { display: flex; gap: 4px; }
.langs a {
  text-decoration: none;
  padding: 3px 9px;
  border-radius: 999px;
  border: 2px solid transparent;
  font-size: 14px;
}
.langs a[aria-current="true"] { border-color: var(--line); background: var(--surface); }

/* ---------- Portada ---------- */

.hero {
  background: linear-gradient(180deg, var(--sky-top), var(--sky-bottom));
  border-bottom: 3px solid var(--line);
  position: relative;
  /* La mascota, los corazones y los cometas se salen de la caja a propósito:
     aquí se recortan para que la página no se pueda arrastrar a los lados.
     `clip` en vez de `hidden`: no crea una zona con scroll propio. */
  overflow: clip;
}
.hero .wrap {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1.1fr .9fr;
  align-items: center;
  gap: 32px;
  padding-block: 56px 0;
}
.hero-copy { padding-bottom: 56px; }
.app-mark {
  width: 84px;
  height: 84px;
  border-radius: 22px;
  border: 3px solid var(--line);
  box-shadow: 0 5px 0 var(--shadow);
  margin-bottom: 18px;
}
.hero h1 {
  font-size: clamp(40px, 7vw, 64px);
  line-height: 1.02;
  margin: 0 0 8px;
  font-weight: 900;
  letter-spacing: -.02em;
}
.tagline {
  font-size: clamp(21px, 3vw, 26px);
  font-weight: 800;
  margin: 0 0 14px;
  text-wrap: balance;
}
.lede { font-size: 18px; margin: 0 0 24px; max-width: 34em; color: var(--ink); opacity: .88; }
.lede em { font-style: normal; font-weight: 800; background: color-mix(in srgb, var(--mint) 45%, transparent); padding: 0 4px; border-radius: 6px; }

.cta-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; }
.cta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 15px 24px;
  font-weight: 900;
  font-size: 18px;
  color: #0E2A1C;
  background: var(--mint-strong);
  border: 3px solid var(--line);
  border-radius: 20px;
  box-shadow: 0 6px 0 var(--shadow);
  text-decoration: none;
  transition: transform .06s, box-shadow .06s;
}
.cta:active { transform: translateY(6px); box-shadow: 0 0 0 var(--shadow); }
.cta[aria-disabled="true"] { background: var(--surface); color: var(--ink); cursor: default; }
.cta svg { width: 22px; height: 22px; }
.fine { font-weight: 700; font-size: 15px; opacity: .8; }

/* La escena de la portada: el teléfono, la mascota delante y el fondo que
   se mueve despacio. Todo dibujado aquí, sin librerías ni vídeo. */
.hero-art {
  position: relative;
  align-self: end;
  justify-self: center;
  padding-bottom: 0;
}
.hero-art .phone { position: relative; z-index: 1; animation: float-phone 7s ease-in-out infinite; }
.hero-art .phone img.swap {
  position: absolute;
  inset: 0;
  width: 100%;
  opacity: 0;
  animation: swap-shot 12s ease-in-out infinite;
  animation-delay: var(--d, 0s);
}

/* La mascota: una tira de 16 dibujos que se pasa a saltos, como los
   dibujos animados de toda la vida. Es el mismo arte de la app. */
.pet {
  --s: 150px;
  position: absolute;
  z-index: 2;
  left: calc(var(--s) * -1 + 8px);
  bottom: 2px;
  width: var(--s);
  height: var(--s);
  /* 1600% = los 16 dibujos; el salto de 0% a 100% los recorre uno a uno.
     En porcentajes para no meter variables dentro de los keyframes: los
     Safari antiguos no las sustituyen ahí. */
  background: url(assets/pet-idle.png) 0% 0% / 1600% 100% no-repeat;
  animation: pet-frames 1.6s steps(16, jump-none) infinite,
    float-pet 4.5s ease-in-out infinite;
  filter: drop-shadow(0 8px 10px rgba(30, 42, 68, .22));
}
@keyframes pet-frames {
  from { background-position-x: 0%; }
  to { background-position-x: 100%; }
}
@keyframes float-pet {
  0%, 100% { transform: translateY(0) rotate(-2deg); }
  50% { transform: translateY(-12px) rotate(2deg); }
}
@keyframes float-phone {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}
@keyframes swap-shot {
  0%, 30% { opacity: 0; }
  35%, 62% { opacity: 1; }
  67%, 100% { opacity: 0; }
}

/* Un sol detrás que respira. */
.orb {
  position: absolute;
  z-index: 0;
  left: 50%;
  top: 8%;
  width: 340px;
  height: 340px;
  margin-left: -170px;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 45%, rgba(255, 255, 255, .85), rgba(255, 255, 255, 0) 70%);
  animation: breathe 9s ease-in-out infinite;
}
@keyframes breathe {
  0%, 100% { transform: scale(1); opacity: .9; }
  50% { transform: scale(1.12); opacity: 1; }
}

/* Corazones que suben, como cuando la mascota come. */
.sparks { position: absolute; inset: 0; z-index: 2; pointer-events: none; }
.sparks i {
  position: absolute;
  left: 8%;
  bottom: 14%;
  width: 14px;
  height: 14px;
  background: var(--mint-strong);
  border: 2px solid var(--line);
  border-radius: 50% 50% 50% 4px;
  opacity: 0;
  animation: rise 6.5s ease-out infinite;
  animation-delay: var(--d, 0s);
}
.sparks i:nth-child(2) { left: 22%; background: var(--future); }
.sparks i:nth-child(3) { left: 2%; background: var(--past); width: 11px; height: 11px; }
.sparks i:nth-child(4) { left: 30%; background: var(--unreal); width: 10px; height: 10px; }
.sparks i:nth-child(5) { left: 14%; background: var(--present); }
@keyframes rise {
  0% { opacity: 0; transform: translate(0, 0) scale(.6); }
  12% { opacity: 1; }
  60% { opacity: .9; }
  100% { opacity: 0; transform: translate(26px, -190px) scale(1.1) rotate(18deg); }
}

/* ---------- El cielo de la portada ---------- */

/* Estrellas que parpadean y, de vez en cuando, un cometa. Dibujado con CSS:
   ni imágenes ni vídeo, unos pocos puntos y dos animaciones. */
.sky {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: clip;
}
.sky i {
  position: absolute;
  width: var(--w, 3px);
  height: var(--w, 3px);
  border-radius: 50%;
  background: #FFFDF5;
  box-shadow: 0 0 6px 1px rgba(255, 253, 240, .9);
  opacity: 0;
  animation: twinkle var(--t, 4s) ease-in-out infinite;
  animation-delay: var(--d, 0s);
}
@keyframes twinkle {
  0%, 100% { opacity: .12; transform: scale(.7); }
  50% { opacity: .85; transform: scale(1.3); }
}

/* El cometa: la cabeza es el punto y la cola, un degradado detrás. */
.sky b {
  position: absolute;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 10px 3px rgba(255, 255, 255, .85);
  opacity: 0;
  animation: comet var(--t, 12s) linear infinite;
  animation-delay: var(--d, 0s);
}
.sky b::after {
  content: "";
  position: absolute;
  right: 2px;
  top: 50%;
  width: 150px;
  height: 2px;
  transform-origin: right center;
  transform: translateY(-50%) rotate(-32deg);
  background: linear-gradient(90deg, rgba(255, 255, 255, 0), rgba(255, 253, 240, .9));
  border-radius: 2px;
}
@keyframes comet {
  0% { opacity: 0; transform: translate(0, 0); }
  4% { opacity: 1; }
  34% { opacity: 1; }
  44%, 100% { opacity: 0; transform: translate(760px, 475px); }
}

/* Con el cielo claro brillan menos: de día son destellos, no estrellas de
   noche. El cometa sí se mantiene, que es lo que llama la atención. */
@media (prefers-color-scheme: light) {
  /* Sobre el cielo claro, dorado: blanco sobre blanco no se ve. */
  .sky i {
    background: #FFD98A;
    box-shadow: 0 0 8px 2px rgba(255, 190, 80, .8);
    animation-name: twinkle-day;
  }
  @keyframes twinkle-day {
    0%, 100% { opacity: .1; transform: scale(.7); }
    50% { opacity: .75; transform: scale(1.3); }
  }
  .sky b { background: #FFC45C; box-shadow: 0 0 12px 4px rgba(255, 176, 60, .9); }
  .sky b::after { background: linear-gradient(90deg, rgba(255, 196, 92, 0), rgba(255, 196, 92, .95)); }
}

/* ---------- Teléfono ---------- */

.phone {
  width: min(300px, 72vw);
  aspect-ratio: 1320 / 2868;
  border: 4px solid var(--line);
  border-bottom: 0;
  border-radius: 44px 44px 0 0;
  overflow: hidden;
  background: var(--line);
  box-shadow: 10px 0 0 color-mix(in srgb, var(--shadow) 18%, transparent);
}
.phone img { width: 100%; height: auto; }

.shot .phone {
  width: 100%;
  border-bottom: 4px solid var(--line);
  border-radius: 34px;
  box-shadow: 0 7px 0 var(--shadow);
}

/* ---------- Secciones ---------- */

section { padding-block: 64px; }
section + section { border-top: 2px dashed color-mix(in srgb, var(--line) 22%, transparent); }

.section-head { max-width: 40em; margin-bottom: 28px; }
.eyebrow {
  font-weight: 900;
  font-size: 13px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 6px;
}
h2 {
  font-size: clamp(28px, 4.2vw, 38px);
  line-height: 1.12;
  margin: 0 0 10px;
  font-weight: 900;
  text-wrap: balance;
}
.section-head p { margin: 0; color: var(--muted); font-size: 18px; }

.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.step {
  background: var(--surface);
  border: 3px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 6px 0 var(--shadow);
  padding: 22px 22px 24px;
}
.step .icon {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  border: 2px solid var(--line);
  display: grid;
  place-items: center;
  margin-bottom: 14px;
  color: #fff;
}
.step .icon svg { width: 28px; height: 28px; }
.step h3 { margin: 0 0 6px; font-size: 21px; font-weight: 900; line-height: 1.2; }
.step p { margin: 0; color: var(--muted); }

.shots {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(200px, 1fr);
  gap: 20px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding: 6px 4px 18px;
  margin-inline: -4px;
}
.shot { scroll-snap-align: start; margin: 0; }
.shot figcaption { margin-top: 14px; font-weight: 800; font-size: 16px; text-align: center; }

.chips { display: flex; flex-wrap: wrap; gap: 10px; }
.chip {
  font-weight: 800;
  font-size: 16px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 2px solid var(--line);
  background: var(--surface);
  box-shadow: 0 3px 0 var(--shadow);
}
.chip:nth-child(4n+1) { background: color-mix(in srgb, var(--past) 22%, var(--surface)); }
.chip:nth-child(4n+2) { background: color-mix(in srgb, var(--present) 22%, var(--surface)); }
.chip:nth-child(4n+3) { background: color-mix(in srgb, var(--future) 24%, var(--surface)); }
.chip:nth-child(4n) { background: color-mix(in srgb, var(--unreal) 22%, var(--surface)); }
.count { margin-top: 20px; font-weight: 800; color: var(--muted); font-variant-numeric: tabular-nums; }

.split { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.card {
  background: var(--surface);
  border: 3px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
}
.card h3 { margin: 0 0 8px; font-size: 22px; font-weight: 900; line-height: 1.2; }
.card p { margin: 0; color: var(--muted); }
.card a { font-weight: 800; }
.card.accent { background: var(--mint-soft); box-shadow: 0 6px 0 var(--shadow); }

/* Las cuatro etapas, con el dibujo de cada una dando saltitos. */
.stages {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-top: 18px;
  text-align: center;
}
.stage { margin: 0; }
.stage figcaption { font-weight: 800; font-size: 13px; line-height: 1.25; margin-top: 2px; }
.pet-mini {
  --s: 62px;
  width: var(--s);
  height: var(--s);
  margin: 0 auto;
  background: url(assets/pet-stages.png) calc(var(--i) * 33.3333%) 0 / 400% 100% no-repeat;
  animation: bob 2.6s ease-in-out infinite;
  animation-delay: calc(var(--i) * .22s);
}
@keyframes bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-7px); }
}

/* ---------- Páginas de texto (privacidad, soporte) ---------- */

.doc { max-width: 760px; margin: 0 auto; padding: 48px 20px 64px; }
.doc h1 { font-size: clamp(32px, 5vw, 44px); line-height: 1.1; margin: 0 0 8px; font-weight: 900; }
.doc .meta { color: var(--muted); font-weight: 700; margin: 0 0 28px; }
.doc h2 { font-size: 24px; margin: 36px 0 8px; }
.doc p, .doc li { max-width: 68ch; }
.doc ul { padding-left: 22px; }
.summary {
  background: var(--mint-soft);
  border: 3px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 6px 0 var(--shadow);
  padding: 20px 22px;
  font-weight: 700;
}
.summary p { margin: 0; }
.summary ul { margin: 10px 0 0; }

.contact {
  background: var(--surface);
  border: 3px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 6px 0 var(--shadow);
  padding: 22px;
  margin: 8px 0 12px;
}
.contact .mail { font-size: 22px; font-weight: 900; word-break: break-all; }
.contact .todo { color: #B4441F; font-weight: 800; }

details {
  background: var(--surface);
  border: 2px solid var(--line);
  border-radius: 18px;
  padding: 0 18px;
  margin-bottom: 12px;
}
details[open] { box-shadow: 0 4px 0 var(--shadow); }
summary {
  cursor: pointer;
  font-weight: 800;
  padding-block: 15px;
  list-style: none;
  display: flex;
  justify-content: space-between;
  gap: 12px;
}
summary::-webkit-details-marker { display: none; }
summary::after { content: "+"; font-weight: 900; font-size: 22px; line-height: 1; }
details[open] summary::after { content: "–"; }
details p { margin: 0 0 16px; color: var(--muted); }

/* ---------- Pie ---------- */

footer {
  border-top: 3px solid var(--line);
  background: var(--surface);
  padding-block: 28px;
  font-size: 15px;
}
footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px 24px; }
footer nav { display: flex; flex-wrap: wrap; gap: 8px 18px; font-weight: 700; }

/* ---------- Movimiento ---------- */

/* Cada bloque entra al llegar a él. Solo se esconde si el navegador va a
   poder mostrarlo: la clase la pone el script de la página. */
.reveal-on [data-reveal] {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity .55s ease, transform .55s cubic-bezier(.2, .8, .3, 1);
  transition-delay: var(--d, 0s);
}
.reveal-on [data-reveal].seen { opacity: 1; transform: none; }

/* La insignia oficial de Apple. Su guía no deja cambiarla ni ponerle nada
   encima, así que solo se mueve al pasar el ratón. */
.badge {
  display: inline-block;
  line-height: 0;
  border-radius: 9px;
  transition: transform .2s cubic-bezier(.2, .8, .3, 1), filter .2s;
  animation: badge-call 3.6s ease-in-out infinite;
}
.badge img { height: 56px; width: auto; }
.badge:hover { transform: translateY(-3px) scale(1.03); filter: drop-shadow(0 8px 14px rgba(30, 42, 68, .3)); animation: none; }
.badge:active { transform: translateY(0) scale(.99); }
.badge:focus-visible { outline-offset: 5px; }
.badge-small { animation: none; margin-inline-start: 4px; }
/* 40 px de alto y su espacio libre alrededor: lo que pide la guía de Apple. */
.badge-small img { height: 40px; }
@keyframes badge-call {
  0%, 82%, 100% { transform: translateY(0); }
  88% { transform: translateY(-5px); }
  94% { transform: translateY(-2px); }
}
.cta-small {
  padding: 9px 16px;
  font-size: 15px;
  border-width: 2px;
  border-radius: 14px;
  box-shadow: 0 4px 0 var(--shadow);
}
.cta-end { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; margin-top: 36px; }

/* Las tarjetas y las capturas responden al ratón: la web se siente viva. */
.step { transition: transform .25s cubic-bezier(.2, .8, .3, 1), box-shadow .25s; }
.step:hover { transform: translateY(-5px); box-shadow: 0 11px 0 var(--shadow); }
.step .icon { transition: transform .3s; }
.step:hover .icon { animation: wiggle .5s ease-in-out; }
@keyframes wiggle {
  0%, 100% { transform: rotate(0); }
  30% { transform: rotate(-9deg) scale(1.06); }
  65% { transform: rotate(7deg) scale(1.06); }
}
.shot .phone { transition: transform .3s cubic-bezier(.2, .8, .3, 1), box-shadow .3s; }
.shot:hover .phone { transform: translateY(-7px) rotate(-1.2deg); box-shadow: 0 12px 0 var(--shadow); }
.chip { transition: transform .2s; }
.chip:hover { transform: translateY(-3px) rotate(-1deg); }

/* ---------- Móvil ---------- */

@media (max-width: 820px) {
  /* En el móvil la barra ocupa varias líneas: fija se comería la pantalla. */
  .top { position: static; }
  .hero .wrap { grid-template-columns: 1fr; padding-top: 36px; }
  .hero-copy { padding-bottom: 8px; }
  .steps, .split { grid-template-columns: 1fr; }
  .shots { grid-auto-columns: 62%; }
  section { padding-block: 48px; }
  .pet { --s: 112px; left: calc(var(--s) * -1 + 26px); bottom: -4px; }
  .orb { width: 240px; height: 240px; margin-left: -120px; }
  .cta-small { display: none; }
}

@media (max-width: 420px) {
  .stages { grid-template-columns: repeat(2, 1fr); gap: 14px 8px; }
}

@media (prefers-reduced-motion: reduce) {
  .cta { transition: none; }
  .shots { scroll-behavior: auto; }
  /* Quien pide menos movimiento ve la web quieta, pero completa. */
  .reveal-on [data-reveal] { opacity: 1; transform: none; transition: none; }
  .pet, .pet-mini, .orb, .sparks i, .hero-art .phone, .hero-art .phone img.swap,
  .sky i, .sky b, .badge, .step:hover .icon { animation: none; }
  .sky b { display: none; }
  .sky i { opacity: .4; }
  .hero-art .phone img.swap { display: none; }
  .step:hover, .shot:hover .phone, .chip:hover, .badge:hover { transform: none; }
}
