/* Calendario de ecografías: look «papel recortado» (el mismo de los reels de @babyfacereveal).
   Cada .paper es texto normal sobre un ::before con borde rasgado (filtro SVG #pp0-2 de index.html) y sombra;
   .boil cambia de filtro cada ~0,13 s (stop-motion) y .jig tiembla «a doses». */
:root {
    --wall: #f7dde5;
    --wall2: #f1cfd9;
    --kraft: #c8995f;
    --kraft-d: #9c7040;
    --cream: #fff8ec;
    --ink: #4a2e1a;
    --ink-soft: #7a5638;
    --pink: #ff9ec4;
    --pink-d: #e0709f;
    --rose: #ef6f8e;
    --green: #86b86b;
    --sepia: #3a2a20;
    --done: #b9a58f;
    --r: 4px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    min-height: 100vh;
    color: var(--ink);
    font: 500 16px/1.5 'Nunito', system-ui, -apple-system, sans-serif;
    background-color: var(--wall);
    background-image:
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='360' height='360'%3E%3Cfilter id='m'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.018 0.07' numOctaves='3' seed='7'/%3E%3CfeColorMatrix values='0 0 0 0 0.45 0 0 0 0 0.22 0 0 0 0 0.25 0 0 0 1.2 -0.5'/%3E%3C/filter%3E%3Crect width='360' height='360' filter='url(%23m)' opacity='0.35'/%3E%3C/svg%3E");
    overflow-x: hidden;
}
/* grano de papel por encima de todo */
body::after {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 50;
    opacity: .5;
    mix-blend-mode: multiply;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' seed='3'/%3E%3CfeColorMatrix values='0 0 0 0 0.25 0 0 0 0 0.14 0 0 0 0 0.06 0 0 0 0.55 -0.2'/%3E%3C/filter%3E%3Crect width='220' height='220' filter='url(%23g)'/%3E%3C/svg%3E");
}

h1, h2, h3, .display { font-family: 'Fredoka', 'Nunito', system-ui, sans-serif; font-weight: 600; letter-spacing: -.01em; margin: 0; }
p { margin: 0; }
a { color: inherit; }
button { font: inherit; color: inherit; }

.wrap { width: 100%; max-width: 560px; margin: 0 auto; padding: 18px 16px 48px; }

/* ── Papel ─────────────────────────────────────────────── */
.paper { position: relative; isolation: isolate; padding: 18px 18px; }
.paper::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background: var(--pc, var(--cream));
    border-radius: var(--r);
    filter: url(#pp0);
}
.paper.lift::before { filter: url(#pl0); }
.boil::before { animation: boil .4s steps(1) infinite; }
.paper.lift.boil::before { animation-name: boil-lift; }
@keyframes boil { 0% { filter: url(#pp0); } 33% { filter: url(#pp1); } 66% { filter: url(#pp2); } }
@keyframes boil-lift { 0% { filter: url(#pl0); } 33% { filter: url(#pl1); } 66% { filter: url(#pl2); } }

.jig { animation: jig .5s steps(1) infinite; }
@keyframes jig {
    0% { transform: translate(0, 0) rotate(var(--rot, 0deg)); }
    25% { transform: translate(.6px, -.8px) rotate(calc(var(--rot, 0deg) + .4deg)); }
    50% { transform: translate(-.7px, .4px) rotate(calc(var(--rot, 0deg) - .3deg)); }
    75% { transform: translate(.3px, .7px) rotate(calc(var(--rot, 0deg) + .2deg)); }
}

/* tira de papel (títulos, etiquetas) */
.strip {
    display: inline-block;
    position: relative;
    isolation: isolate;
    padding: 6px 14px;
    transform: rotate(var(--rot, -1.5deg));
    font-family: 'Fredoka', sans-serif;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .02em;
}
.strip::before { content: ""; position: absolute; inset: 0; z-index: -1; background: var(--pc, var(--cream)); filter: url(#pp1); }
.strip.pink { --pc: var(--pink); }

/* ── Cabecera ──────────────────────────────────────────── */
.top { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.brand { display: flex; align-items: center; gap: 8px; text-decoration: none; font-family: 'Fredoka', sans-serif; font-weight: 600; font-size: 15px; }
.brand img { width: 26px; height: 26px; border-radius: 50%; }
.langs { display: flex; gap: 6px; }
.lang-chip {
    position: relative; isolation: isolate; border: 0; background: none; cursor: pointer;
    padding: 6px 10px; font-weight: 700; font-size: 13px; min-height: 36px;
    transform: rotate(var(--rot, 0deg));
}
.lang-chip::before { content: ""; position: absolute; inset: 0; z-index: -1; background: var(--cream); filter: url(#pp2); opacity: .7; }
.lang-chip[aria-pressed="true"]::before { background: var(--pink); opacity: 1; }
.lang-chip:nth-child(1) { --rot: -2deg; } .lang-chip:nth-child(2) { --rot: 1.5deg; } .lang-chip:nth-child(3) { --rot: -1deg; }

/* ── Pantallas ─────────────────────────────────────────── */
.screen { display: none; }
.screen.on { display: block; animation: sheet .42s steps(5) both; }
@keyframes sheet {
    0% { opacity: 0; transform: translateY(26px) rotate(1.2deg); }
    60% { opacity: 1; transform: translateY(-4px) rotate(-.4deg); }
    100% { opacity: 1; transform: none; }
}

/* ── Intro ─────────────────────────────────────────────── */
.hero { text-align: center; }
.hero-art { width: 100%; max-width: 360px; height: auto; display: block; margin: 0 auto -6px; overflow: visible; }
.kicker { --pc: var(--pink); font-size: 13px; margin-bottom: 12px; }
.hero h1 { font-size: clamp(30px, 8.5vw, 44px); line-height: 1.05; margin: 6px 0 12px; }
.hero h1 em { font-style: normal; color: var(--pink-d); }
.hero .sub { font-size: 17px; color: var(--ink-soft); max-width: 440px; margin: 0 auto 22px; }
.lang-pick { margin: 0 auto 22px; }
.lang-pick .label { font-size: 13px; font-weight: 700; color: var(--ink-soft); text-transform: uppercase; letter-spacing: .06em; margin-bottom: 8px; }
.lang-pick .langs { justify-content: center; gap: 10px; }
.lang-pick .lang-chip { font-size: 15px; padding: 10px 14px; min-height: 44px; }

/* ── Botones de papel ──────────────────────────────────── */
.btn {
    position: relative; isolation: isolate; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    border: 0; background: none; cursor: pointer; text-decoration: none;
    font-family: 'Fredoka', sans-serif; font-weight: 600; font-size: 18px;
    padding: 14px 26px; min-height: 52px; color: #fff;
    transform: rotate(var(--rot, -1deg));
    transition: transform .12s steps(2);
}
.btn::before { content: ""; position: absolute; inset: 0; z-index: -1; background: var(--rose); filter: url(#pl0); }
.btn:hover { transform: rotate(var(--rot, -1deg)) translateY(-2px); }
.btn:active { transform: rotate(var(--rot, -1deg)) translateY(2px) scale(.98); }
.btn.cream { color: var(--ink); }
.btn.cream::before { background: var(--cream); }
.btn.small { font-size: 15px; padding: 10px 16px; min-height: 44px; }
.btn.block { width: 100%; }
.btn:focus-visible, .lang-chip:focus-visible, .mode:focus-visible { outline: 3px dashed var(--pink-d); outline-offset: 4px; }

.linkish { background: none; border: 0; cursor: pointer; font-weight: 700; color: var(--ink-soft); text-decoration: underline; padding: 10px 4px; }

/* ── Formulario ────────────────────────────────────────── */
.form-card { --rot: .6deg; transform: rotate(var(--rot)); padding: 22px 18px; }
.form-card h2 { font-size: 24px; margin-bottom: 14px; }
.modes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 18px; }
.mode {
    position: relative; isolation: isolate; border: 0; background: none; cursor: pointer;
    padding: 10px 6px; min-height: 64px; font-weight: 700; font-size: 13.5px; line-height: 1.2;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
}
.mode span.ic { font-size: 20px; }
.mode::before { content: ""; position: absolute; inset: 0; z-index: -1; background: #f3e6d3; filter: url(#pp1); }
.mode[aria-pressed="true"]::before { background: var(--pink); }
.mode:nth-child(1) { transform: rotate(-1.5deg); } .mode:nth-child(3) { transform: rotate(1.2deg); }

.field { margin-bottom: 16px; }
.field label, .field .lbl { display: block; font-weight: 800; font-size: 14.5px; margin-bottom: 6px; }
.field input[type="date"], .field input[type="text"] {
    width: 100%; font: 600 17px 'Nunito', sans-serif; color: var(--ink);
    background: #fffdf8; border: 2px dashed #d9bfa0; border-radius: 3px; padding: 12px 12px; min-height: 50px;
}
.field input:focus { outline: none; border-color: var(--pink-d); border-style: solid; }
.stepper { display: flex; gap: 12px; flex-wrap: wrap; }
.step { display: flex; align-items: center; gap: 6px; background: #fffdf8; border: 2px dashed #d9bfa0; border-radius: 3px; padding: 4px; }
.step button { width: 40px; height: 40px; border: 0; background: #f3e6d3; border-radius: 3px; font-size: 22px; font-weight: 800; cursor: pointer; }
.step output { min-width: 34px; text-align: center; font: 700 22px 'Fredoka', sans-serif; }
.step small { padding-right: 8px; font-weight: 700; color: var(--ink-soft); }
.err { color: #b4284f; font-weight: 700; font-size: 14px; min-height: 20px; margin: -6px 0 10px; }

/* ── Resultado ─────────────────────────────────────────── */
.res-head { text-align: center; margin-bottom: 18px; }
.res-head h1 { font-size: clamp(26px, 7.4vw, 36px); line-height: 1.1; margin: 10px 0 6px; }
.res-head .today { font-weight: 800; font-size: 17px; }
.res-head .due { color: var(--ink-soft); font-weight: 600; }

/* barra de embarazo */
.belly { margin: 14px 0 22px; padding: 16px 16px 12px; --rot: -.6deg; transform: rotate(var(--rot)); }
.track { position: relative; height: 22px; margin: 26px 4px 8px; }
.track .bar { position: absolute; inset: 7px 0; background: #ead8c0; border-radius: 6px; }
.track .fill { position: absolute; left: 0; top: 7px; bottom: 7px; background: var(--pink); border-radius: 6px; }
.track .win { position: absolute; top: 3px; bottom: 3px; border: 2px dashed var(--pink-d); border-radius: 6px; background: rgba(255, 158, 196, .3); display: flex; align-items: center; justify-content: center; }
.track .win span { font: 800 10px/1 'Nunito', sans-serif; color: var(--pink-d); letter-spacing: .02em; }
.track .me { position: absolute; top: -22px; transform: translateX(-50%); font-size: 26px; line-height: 1; }
.track-legend { display: flex; justify-content: space-between; font-size: 12px; font-weight: 700; color: var(--ink-soft); }
.track-key { list-style: none; margin: 12px 0 2px; padding: 10px 0 0; border-top: 2px dashed #ead8c0; display: grid; gap: 7px; font-size: 13.5px; font-weight: 700; color: var(--ink-soft); }
.track-key li { display: flex; align-items: center; gap: 9px; }
.track-key li[hidden] { display: none; }
.track-key .k-me { width: 24px; flex: 0 0 24px; text-align: center; font-size: 18px; line-height: 1; }
.track-key .k-win { width: 24px; height: 14px; flex: 0 0 24px; border: 2px dashed var(--pink-d); border-radius: 4px; background: rgba(255, 158, 196, .3); }

/* tamaño semana a semana */
.size { text-align: center; padding: 18px 16px 16px; margin-bottom: 22px; --rot: .8deg; transform: rotate(var(--rot)); }
.size h2 { font-size: 20px; }
.size .hint { font-size: 13px; color: var(--ink-soft); font-weight: 700; }
.fruit-stage { height: 160px; display: flex; align-items: flex-end; justify-content: center; margin: 6px 0 4px; }
.fruit-stage svg { width: auto; height: 100%; max-width: 100%; overflow: visible; }
.fruit-stage .pop { animation: pop .5s steps(6) both; transform-origin: 50% 90%; }
@keyframes pop { 0% { transform: scale(.2) rotate(-12deg); } 50% { transform: scale(1.12) rotate(4deg); } 75% { transform: scale(.96) rotate(-1deg); } 100% { transform: scale(1) rotate(0); } }
.size .wk { font: 700 22px 'Fredoka', sans-serif; }
.size .line { font-weight: 700; color: var(--ink-soft); min-height: 24px; }
input[type="range"] { width: 100%; margin: 14px 0 4px; accent-color: var(--pink-d); height: 32px; }

/* línea de ecos: scroll vertical → recorrido horizontal (sección fija mientras dura) */
.tl-scroll { position: relative; margin: 8px -16px 0; }
.tl-sticky {
    position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden;
    display: flex; flex-direction: column; gap: 6px; padding: 14px 0 12px;
}
.tl-title { text-align: center; margin: 0; }
.tl-viewport { overflow: hidden; flex: 1 1 auto; min-height: 0; display: flex; }
.tl {
    --card: min(72vw, 310px);
    list-style: none; margin: 0; display: flex; gap: 16px; align-items: center;
    height: 100%;
    padding: 26px calc((100vw - var(--card)) / 2) 14px;
    width: max-content; will-change: transform; position: relative;
}
@media (min-width: 592px) { .tl { padding-left: calc((560px - var(--card)) / 2); padding-right: calc((560px - var(--card)) / 2); } }
/* cuerda punteada que une las ecos */
.tl::before { content: ""; position: absolute; left: 0; right: 0; top: 50%; border-top: 3px dashed #c9a987; z-index: -1; }
.eco {
    position: relative; flex: 0 0 var(--card); padding: 30px 20px 18px;
    height: min(100%, calc(var(--card) * 1.55)); min-height: calc(var(--card) * 1.2);
    display: flex; flex-direction: column;
    transform: rotate(var(--rot)) scale(.93); opacity: .72;
    transition: transform .25s steps(3), opacity .25s steps(3);
}
.eco:nth-child(odd) { --rot: -1.4deg; } .eco:nth-child(even) { --rot: 1.2deg; }
.eco.focus { transform: rotate(calc(var(--rot) * .4)) scale(1); opacity: 1; }
.eco.focus::before { filter: url(#pl0); animation: boil-lift .4s steps(1) infinite; }
.eco .dot { position: absolute; left: 50%; top: -1px; margin-left: -12px; width: 24px; height: 24px; border-radius: 50%; background: #e7d3b9; border: 4px solid var(--wall); }
.eco .wkbig { font: 600 58px/1 'Fredoka', sans-serif; letter-spacing: -.02em; margin: 2px 0 8px; color: var(--ink); }
.eco .wkbig small { font-size: 17px; font-weight: 600; margin-left: 4px; color: var(--ink-soft); letter-spacing: 0; }
.eco h3 { font-size: 22px; line-height: 1.15; }
.eco .when { font-weight: 800; font-size: 16px; margin: 6px 0 10px; }
.eco p.desc { font-size: 16px; line-height: 1.45; color: var(--ink-soft); }
.eco .ico { margin-top: auto; align-self: flex-end; font-size: 72px; line-height: 1; transform: rotate(-8deg); filter: drop-shadow(2px 3px 0 rgba(59,36,18,.18)); }
.eco .tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; min-height: 22px; }
.tag { font-size: 11.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; padding: 3px 8px; border-radius: 3px; background: #f0e2cf; }
.tag.now { background: var(--rose); color: #fff; }
.tag.next { background: var(--ink); color: #fff; }
.tag.ideal { background: var(--pink); }
.eco.done { --pc: #f2e9dd; }
.eco.done h3, .eco.done .when, .eco.done .wkbig { color: var(--done); }
.eco.done .dot { background: var(--done); }
.eco.done .dot::after { content: "✓"; position: absolute; inset: 0; display: grid; place-items: center; color: #fff; font-size: 12px; font-weight: 900; }
.eco.now .dot, .eco.next .dot { background: var(--rose); }
.eco.is3d { --pc: #ffe3ee; }
.eco.is3d .wkbig { color: var(--pink-d); }
.eco.is3d .dot { background: var(--pink-d); }
.eco.birth .dot { background: var(--green); }

/* regla de semanas con «tú estás aquí» */
.tl-progress { padding: 0 24px; max-width: 560px; margin: 0 auto; width: 100%; }
.tl-rail { position: relative; height: 10px; background: #ead8c0; border-radius: 6px; margin-top: 28px; }
.tl-rail-fill { position: absolute; left: 0; top: 0; bottom: 0; width: 0; background: var(--ink); border-radius: 6px; }
.tl-rail .tick { position: absolute; top: -3px; width: 16px; height: 16px; margin-left: -8px; border-radius: 50%; background: #e7d3b9; border: 3px solid var(--wall); }
.tl-rail .tick.d3 { background: var(--pink-d); }
.tl-rail .tick.on { background: var(--rose); }
.tl-today { position: absolute; top: -30px; transform: translateX(-50%); font-size: 22px; line-height: 1; }
.tl-hint { text-align: center; font-size: 13px; font-weight: 700; color: var(--ink-soft); margin-top: 8px; }

/* sin «scroll secuestrado»: carrusel normal con el dedo */
.tl-scroll.native { height: auto !important; }
.tl-scroll.native .tl-sticky { position: static; height: auto; padding: 10px 0 20px; }
.tl-scroll.native .tl { height: auto; }
.tl-scroll.native .eco { height: calc(var(--card) * 1.45); }
.tl-scroll.native .tl-viewport { overflow-x: auto; scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.tl-scroll.native .tl-viewport::-webkit-scrollbar { display: none; }
.tl-scroll.native .eco { scroll-snap-align: center; }
.tl-scroll.native .tl { transform: none !important; }

/* CTA 8K */
.cta { margin: 26px 0 22px; padding: 22px 18px 20px; --pc: var(--sepia); color: #fbeee0; text-align: center; --rot: -.8deg; transform: rotate(var(--rot)); }
.cta h2 { font-size: 24px; color: #fff; margin-bottom: 8px; }
.cta p { color: #f0dccb; margin-bottom: 16px; }
.cta .badge { --pc: var(--pink); color: var(--ink); font-size: 14px; margin-bottom: 12px; }
.cta .note { font-size: 13px; color: #d9c2ad; margin: 12px 0 0; }
.cta .ba { display: flex; justify-content: center; gap: 10px; margin: 4px 0 16px; }
.cta .ba figure { margin: 0; width: 42%; max-width: 170px; }
.cta .ba img { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; border: 6px solid #fff8ec; box-shadow: 3px 5px 0 rgba(0,0,0,.25); }
.cta .ba figure:first-child { transform: rotate(-4deg); }
.cta .ba figure:last-child { transform: rotate(3deg); }
.cta .ba figcaption { font-size: 12px; font-weight: 800; margin-top: 6px; text-transform: uppercase; letter-spacing: .05em; color: #f0dccb; }

/* acciones */
/* Aviso por email (opcional, antes de la semana 25) */
.remind { margin: 0 0 22px; padding: 20px 18px; --rot: -.4deg; transform: rotate(var(--rot)); }
.remind h2 { font-size: 21px; margin-bottom: 8px; }
.remind p { color: var(--ink-soft); font-weight: 600; margin-bottom: 14px; }
.remind input[type="email"] {
    width: 100%; font: 600 17px 'Nunito', sans-serif; color: var(--ink);
    background: #fffdf8; border: 2px dashed #d9bfa0; border-radius: 3px; padding: 12px; min-height: 50px; margin-bottom: 12px;
}
.remind input[type="email"]:focus { outline: none; border-color: var(--pink-d); border-style: solid; }
.remind .check { display: flex; gap: 10px; align-items: flex-start; font-size: 13.5px; line-height: 1.45; color: var(--ink-soft); font-weight: 600; margin-bottom: 14px; cursor: pointer; }
.remind .check input { width: 20px; height: 20px; flex: 0 0 20px; margin-top: 1px; accent-color: var(--pink-d); }
.remind .check a { color: var(--ink); font-weight: 800; }
.remind .hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.remind .rem-ok { color: var(--ink); font-weight: 800; margin: 4px 0 0; }
.remind .err { color: #b4284f; font-weight: 700; margin: -4px 0 10px; }
.actions { padding: 18px 16px; --rot: .5deg; transform: rotate(var(--rot)); }
.actions h2 { font-size: 20px; margin-bottom: 12px; }
.actions .row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.actions .row .btn { font-size: 15px; padding: 10px 10px; }
.actions .row .wide { grid-column: 1 / -1; }
.toast { text-align: center; font-weight: 800; color: var(--pink-d); min-height: 22px; margin-top: 8px; }

.disclaimer { font-size: 13px; color: var(--ink-soft); margin: 22px 4px 0; text-align: center; }
.foot { text-align: center; margin-top: 18px; font-size: 14px; font-weight: 700; }
.foot a { color: var(--ink-soft); }

/* sin animaciones si el sistema lo pide */
@media (prefers-reduced-motion: reduce) {
    .boil::before, .paper.lift.boil::before, .jig, .screen.on, .eco, .eco.focus::before, .fruit-stage .pop { animation: none !important; }
    .eco { transition: none; }
}
@media (min-width: 600px) {
    .wrap { padding-top: 28px; }
}
