/* =============================================================
   1. Tokens — Arquetipo 01 «Editorial Light Cream», con el coral de Agenda 365
   ============================================================= */
:root {
  --bg:       #f4efe6;
  --bg-2:     #e8dfd0;
  --paper:    #ffffff;
  --ink:      #1d1c22;
  --ink-soft: #2c2b31;
  --ink-mute: #6b6873;
  --accent:   #e8552f;
  --accent-2: #4a5d3a;
  --line:     rgba(29, 28, 34, 0.12);
  --serif: "Fraunces", Georgia, "Times New Roman", serif;
  --sans:  "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --gutter: clamp(18px, 5vw, 64px);
  --radius: 22px;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-soft: cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --shadow: 0 1px 2px rgba(29,28,34,.06), 0 18px 40px rgba(29,28,34,.08);
}

/* =============================================================
   2. Reset & base
   ============================================================= */
*, *::before, *::after { box-sizing: border-box; margin: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 84px; }
body {
  font-family: var(--sans); font-size: 16px; line-height: 1.6; color: var(--ink); background: var(--bg);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; overflow-x: clip; overscroll-behavior-y: none;
}
img, svg { display: block; max-width: 100%; }
img { height: auto; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; }
a { color: inherit; text-decoration: none; }
p { text-wrap: pretty; }
h1, h2, h3 { text-wrap: balance; line-height: 1.05; letter-spacing: -0.02em; }
::selection { background: var(--accent); color: var(--bg); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

/* =============================================================
   3. Utilidades
   ============================================================= */
.skip-link { position: fixed; top: -100px; left: 1rem; padding: .6rem 1rem; background: var(--ink); color: var(--bg); z-index: 9999; border-radius: 8px; font-weight: 600; }
.skip-link:focus { top: 1rem; }
.kicker { font-size: 12px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--accent); margin-bottom: 14px; }
em { font-style: italic; font-family: var(--serif); font-weight: 500; color: var(--accent); }

/* =============================================================
   4. Componentes
   ============================================================= */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 15px 26px; border-radius: 999px; background: var(--ink); color: var(--bg);
  font-weight: 600; font-size: 15px; transition: transform .35s var(--ease-out), background .3s var(--ease-out), box-shadow .35s var(--ease-out);
}
.btn:hover { transform: translateY(-2px); background: var(--accent); box-shadow: 0 14px 30px rgba(232,85,47,.30); }
.btn-small { padding: 10px 18px; font-size: 14px; }
.btn-ghost { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--line); }
.btn-ghost:hover { background: var(--paper); color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--ink); }
.btn-light { background: var(--bg); color: var(--ink); }
.btn-light:hover { background: var(--paper); color: var(--accent); }

/* Nav */
.nav {
  position: fixed; inset: 0 0 auto; z-index: 50; display: flex; align-items: center; gap: 24px;
  padding: calc(14px + env(safe-area-inset-top)) var(--gutter) 14px; transition: background .4s var(--ease-out), box-shadow .4s var(--ease-out);
}
.nav.is-solid { background: rgba(244,239,230,.92); box-shadow: 0 1px 0 var(--line); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); }
.nav-brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 17px; margin-right: auto; }
.nav-brand img { border-radius: 9px; }
.nav-links { display: none; gap: 26px; font-size: 14px; font-weight: 500; color: var(--ink-soft); }
.nav-links a { position: relative; }
.nav-links a::after { content: ""; position: absolute; left: 0; right: 0; bottom: -4px; height: 1.5px; background: var(--accent); transform: scaleX(0); transform-origin: left; transition: transform .4s var(--ease-out); }
.nav-links a:hover::after { transform: scaleX(1); }

/* Cursor (solo con ratón) */
.cursor { position: fixed; inset: 0; pointer-events: none; z-index: 100; opacity: 0; transition: opacity .25s var(--ease-out); display: none; }
.cursor.is-ready { opacity: 1; }
.cursor-dot, .cursor-ring { position: fixed; top: 0; left: 0; border-radius: 50%; }
.cursor-dot { width: 6px; height: 6px; margin: -3px 0 0 -3px; background: var(--accent); }
.cursor-ring { width: 38px; height: 38px; margin: -19px 0 0 -19px; border: 1.5px solid var(--ink); mix-blend-mode: difference; border-color: #fff; transition: width .3s var(--ease-out), height .3s var(--ease-out), margin .3s var(--ease-out); }
.cursor.is-hover .cursor-ring { width: 64px; height: 64px; margin: -32px 0 0 -32px; }
@media (hover: hover) and (pointer: fine) { .cursor { display: block; } }

/* =============================================================
   6. Secciones
   ============================================================= */
section { padding: clamp(72px, 11vw, 140px) var(--gutter); position: relative; }
.section-head { max-width: 760px; margin-bottom: clamp(36px, 6vw, 64px); }
.section-head h2, .manifesto h2, .price-card h2, .final h2 { font-family: var(--serif); font-weight: 500; font-size: clamp(32px, 5.2vw, 60px); }

/* Hero */
.hero { min-height: 100svh; display: grid; gap: 48px; align-items: center; padding-top: calc(120px + env(safe-area-inset-top)); overflow: clip; }
.hero-mesh { position: absolute; inset: -20% -10% auto; height: 120%; z-index: -1;
  background: radial-gradient(40% 40% at 78% 30%, rgba(232,85,47,.22), transparent 70%), radial-gradient(35% 35% at 12% 70%, rgba(74,93,58,.14), transparent 70%), radial-gradient(30% 30% at 60% 85%, rgba(232,85,47,.10), transparent 70%);
  animation: meshDrift 18s var(--ease-soft) infinite alternate; }
@keyframes meshDrift { to { transform: translate3d(-3%, 4%, 0) scale(1.06); } }
.hero-title { font-family: var(--serif); font-weight: 600; font-size: clamp(46px, 9vw, 112px); line-height: .98; letter-spacing: -.035em; }
.hero-title em { font-weight: 500; }
.hero-sub { font-size: clamp(17px, 2vw, 20px); color: var(--ink-soft); max-width: 520px; margin: 24px 0 32px; }
.hero-ctas { display: flex; flex-wrap: wrap; gap: 12px; }
.hero-note { font-size: 13px; color: var(--ink-mute); margin-top: 14px; }
.split-word { display: inline-block; }

/* Teléfono del hero */
.hero-visual { position: relative; justify-self: center; width: min(340px, 86vw); }
.phone { position: relative; width: 100%; aspect-ratio: 9 / 19; border-radius: 46px; background: #f6f5f1; border: 11px solid var(--ink); box-shadow: 0 50px 90px rgba(29,28,34,.25), 0 0 0 1px rgba(29,28,34,.2); overflow: hidden; }
.phone-notch { position: absolute; top: 8px; left: 50%; width: 92px; height: 24px; margin-left: -46px; border-radius: 20px; background: var(--ink); z-index: 3; }
.app { padding: 46px 16px 16px; font-size: 12px; }
.app-date { font-weight: 800; font-size: 21px; line-height: 1.1; letter-spacing: -.02em; }
.app-sub { color: var(--ink-mute); margin: 2px 0 10px; }
.app-chips { display: flex; gap: 8px; }
.chip { flex: 1; background: var(--paper); border-radius: 12px; padding: 7px 10px; border-top: 3px solid var(--c); box-shadow: var(--shadow); font-size: 10.5px; color: var(--ink-mute); }
.chip b { display: block; font-size: 19px; color: var(--ink); line-height: 1.1; }
.app-sec { font-size: 10px; font-weight: 800; letter-spacing: .1em; color: var(--ink-mute); margin: 14px 0 6px; }
.app-item { display: flex; gap: 10px; align-items: center; background: var(--paper); border-radius: 12px; padding: 8px 10px; margin-bottom: 6px; border-left: 4px solid var(--c); box-shadow: 0 1px 2px rgba(0,0,0,.05); }
.app-item .t { font-weight: 800; width: 36px; }
.app-item .ck { width: 18px; height: 18px; border-radius: 6px; border: 2px solid #ddd8cc; display: grid; place-items: center; font-size: 10px; color: #fff; font-weight: 900; }
.app-item.done .ck { background: #1f9d63; border-color: #1f9d63; }
.app-item.done b { text-decoration: line-through; color: var(--ink-mute); }
.app-item b { display: block; font-size: 12.5px; }
.app-item small { color: var(--ink-mute); font-size: 10px; }
.app-habits { display: flex; gap: 6px; flex-wrap: wrap; }
.app-habits span { padding: 6px 10px; border-radius: 999px; background: var(--paper); font-weight: 700; font-size: 10.5px; box-shadow: 0 1px 2px rgba(0,0,0,.06); }
.app-habits span.on { background: var(--c); color: #fff; }
.notif { position: absolute; top: 40px; left: 10px; right: 10px; z-index: 4; display: flex; gap: 10px; align-items: center; padding: 10px; border-radius: 18px; background: rgba(255,255,255,.96); box-shadow: 0 16px 34px rgba(29,28,34,.22); animation: notifDrop 7s var(--ease-out) 1.2s infinite; transform: translateY(-160%); }
.notif img { border-radius: 9px; }
.notif small { display: block; font-size: 9.5px; font-weight: 700; color: var(--ink-mute); }
.notif b { display: block; font-size: 13px; }
.notif span { font-size: 11px; }
@keyframes notifDrop { 0% { transform: translateY(-160%); } 10%, 62% { transform: translateY(0); } 72%, 100% { transform: translateY(-160%); } }
.float { position: absolute; display: grid; grid-template-columns: auto 1fr; column-gap: 10px; align-items: center; background: var(--paper); border-radius: 18px; padding: 12px 16px; box-shadow: var(--shadow); font-size: 13px; }
.float span { grid-row: span 2; font-size: 24px; }
.float b { font-size: 16px; }
.float small { color: var(--ink-mute); }
.float-a { left: -34px; bottom: 22%; }
.float-b { right: -30px; top: 30%; }

/* Ticker */
.ticker { overflow: hidden; border-block: 1px solid var(--line); background: var(--paper); padding: 18px 0; }
.ticker-track { display: flex; gap: 48px; width: max-content; animation: ticker 40s linear infinite; font-family: var(--serif); font-style: italic; font-size: clamp(20px, 2.6vw, 30px); color: var(--ink-soft); white-space: nowrap; }
.ticker-track span::after { content: "✦"; margin-left: 48px; font-style: normal; color: var(--accent); font-size: .7em; }
@keyframes ticker { to { transform: translateX(-50%); } }

/* Manifiesto */
.manifesto { display: grid; gap: 24px; max-width: 1100px; }
.manifesto-num { font-family: var(--serif); font-size: 15px; color: var(--accent); font-weight: 700; }
.manifesto h2 { font-size: clamp(28px, 4.2vw, 50px); margin-bottom: 22px; }
.manifesto p { font-size: 18px; color: var(--ink-soft); max-width: 640px; }

/* Bento */
.bento { display: grid; gap: 16px; grid-template-columns: 1fr; }
.card { position: relative; background: var(--paper); border-radius: var(--radius); padding: 26px; box-shadow: var(--shadow); transition: transform .5s var(--ease-out), box-shadow .5s var(--ease-out); transform-style: preserve-3d; will-change: transform; }
.card:hover { box-shadow: 0 1px 2px rgba(29,28,34,.06), 0 28px 60px rgba(232,85,47,.22); }
.card-kicker { font-size: 11px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--accent); margin-bottom: 10px; }
.card h3 { font-family: var(--serif); font-weight: 600; font-size: clamp(22px, 2.4vw, 30px); margin-bottom: 10px; }
.card p { color: var(--ink-mute); font-size: 15px; }
.card-foot { margin-top: 14px; font-weight: 600; color: var(--ink) !important; }
.year-grid { display: grid; grid-template-columns: repeat(26, 1fr); gap: 4px; margin-top: 22px; }
.year-grid i { aspect-ratio: 1; border-radius: 3px; background: var(--bg-2); transition: background .5s var(--ease-out), transform .5s var(--ease-out); }
.habit-demo { display: grid; gap: 8px; margin-top: 16px; }
.habit-row { display: grid; grid-template-columns: 1fr repeat(7, 18px); gap: 5px; align-items: center; font-size: 13px; font-weight: 600; }
.habit-row span { display: flex; align-items: center; gap: 6px; }
.habit-row span::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--c); }
.habit-row i { aspect-ratio: 1; border-radius: 5px; background: var(--bg-2); }
.habit-row i.on { background: var(--accent); }
.card-notif { background: var(--ink); color: var(--bg); }
.card-notif p { color: rgba(244,239,230,.7); }
.pend-demo { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 14px; font-size: 13px; font-weight: 600; }
.pend-demo .from { color: var(--ink-mute); text-decoration: line-through; }
.pend-demo .task { background: var(--bg); border-radius: 10px; padding: 6px 10px; border-left: 4px solid var(--accent); }
.pend-demo .to { color: var(--accent); }
.goal-bar { height: 10px; border-radius: 999px; background: var(--bg-2); margin-top: 18px; overflow: hidden; }
.goal-bar i { display: block; height: 100%; border-radius: 999px; background: var(--accent-2); }
.card-count h3 { font-size: clamp(40px, 5vw, 64px); }
.card-count .count { color: var(--accent); font-variant-numeric: tabular-nums; }
.moods { font-size: 28px; letter-spacing: 6px; margin-top: 10px; color: var(--ink) !important; }

/* Un día */
.day-track { display: grid; grid-auto-flow: column; grid-auto-columns: min(82%, 360px); gap: 16px; overflow-x: auto; overflow-y: visible; scroll-snap-type: x mandatory; padding: 6px 2px 18px; scrollbar-width: thin; }
.moment { scroll-snap-align: start; background: var(--paper); border-radius: var(--radius); padding: 28px; box-shadow: var(--shadow); }
.moment-time { font-family: var(--serif); font-style: italic; font-size: 40px; color: var(--accent); line-height: 1; margin-bottom: 14px; }
.moment h3 { font-family: var(--serif); font-weight: 600; font-size: 24px; margin-bottom: 8px; }
.moment p { color: var(--ink-mute); }

/* Comparativa */
.table-wrap { overflow-x: auto; background: var(--paper); border-radius: var(--radius); box-shadow: var(--shadow); }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { padding: 13px 10px; text-align: center; border-bottom: 1px solid var(--line); }
thead th { font-size: 11px !important; letter-spacing: .04em !important; }
@media (min-width: 720px) { table { font-size: 15px; } th, td { padding: 16px 20px; } thead th { font-size: 13px !important; letter-spacing: .08em !important; } }
th[scope="row"] { text-align: left; font-weight: 500; }
thead th { font-size: 13px; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-mute); }
thead th:last-child, td:last-child { color: var(--accent); font-weight: 700; }
tbody tr:last-child th, tbody tr:last-child td { border-bottom: 0; }

/* Precio */
.pricing { display: grid; place-items: center; }
.price-card { width: min(560px, 100%); text-align: center; background: var(--paper); border-radius: 32px; padding: clamp(32px, 6vw, 56px); box-shadow: var(--shadow); }
.price { font-size: 17px; color: var(--ink-mute); margin: 18px 0 22px; }
.price span { display: block; font-family: var(--serif); font-size: 64px; font-weight: 700; color: var(--ink); line-height: 1.05; }
.price-list { list-style: none; padding: 0; text-align: left; display: grid; gap: 10px; margin: 0 auto 28px; max-width: 360px; }
.price-list li { padding-left: 30px; position: relative; }
.price-list li::before { content: "✓"; position: absolute; left: 0; color: var(--accent); font-weight: 800; }

/* Preguntas */
.faq-list { display: grid; gap: 12px; max-width: 820px; }
.faq details { background: var(--paper); border-radius: 18px; box-shadow: var(--shadow); padding: 4px 22px; }
.faq summary { cursor: pointer; list-style: none; padding: 18px 0; font-weight: 600; font-size: 17px; display: flex; justify-content: space-between; gap: 16px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-family: var(--serif); font-size: 26px; line-height: 1; color: var(--accent); transition: transform .3s var(--ease-out); }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { padding-bottom: 18px; color: var(--ink-mute); }

/* CTA final */
.final { text-align: center; background: var(--ink); color: var(--bg); overflow: clip; }
.final-mesh { position: absolute; inset: 0; background: radial-gradient(45% 60% at 30% 30%, rgba(232,85,47,.45), transparent 70%), radial-gradient(40% 55% at 75% 75%, rgba(74,93,58,.35), transparent 70%); animation: meshDrift 16s var(--ease-soft) infinite alternate; }
.final-content { position: relative; display: grid; justify-items: center; gap: 26px; }
.final-content img { border-radius: 24px; box-shadow: 0 20px 50px rgba(0,0,0,.35); }
.final h2 { color: var(--bg); }
.final h2 em { color: #ffb59d; }

.footer { display: grid; gap: 6px; padding: 32px var(--gutter) calc(32px + env(safe-area-inset-bottom)); font-size: 14px; color: var(--ink-mute); border-top: 1px solid var(--line); }
.footer a:hover { color: var(--accent); }

/* =============================================================
   7. Efectos — aparición al hacer scroll (con red de seguridad)
   ============================================================= */
.js [data-reveal] { opacity: 0; transform: translateY(28px); transition: opacity .9s var(--ease-out), transform .9s var(--ease-out); }
.js [data-reveal].is-revealed { opacity: 1; transform: none; }
/* Defensa: un elemento con split nunca se queda invisible */
.reveal[data-split], [data-reveal][data-split] { opacity: 1; transform: none; }

/* =============================================================
   8. Responsive (móvil primero)
   ============================================================= */
@media (min-width: 540px) {
  .bento { grid-template-columns: repeat(2, 1fr); }
  .card-year { grid-column: span 2; }
}
@media (min-width: 720px) {
  .manifesto { grid-template-columns: 80px 1fr; }
}
@media (min-width: 960px) {
  .nav-links { display: flex; }
  .hero { grid-template-columns: 1.1fr .9fr; }
  .hero-visual { justify-self: end; margin-right: 40px; }
  .bento { grid-template-columns: repeat(4, 1fr); grid-auto-rows: minmax(210px, auto); }
  .card-year { grid-column: span 2; grid-row: span 2; }
  .card-habits { grid-column: span 2; }
  .card-notif { grid-row: span 2; }
  .day-track { grid-auto-columns: calc((100% - 48px) / 4); overflow-x: visible; }
}
@media (min-width: 1280px) {
  .hero { padding-left: calc(var(--gutter) + 2vw); }
}
@media (max-width: 539px) {
  .float-a { left: -10px; bottom: 16%; }
  .float-b { right: -10px; top: 26%; }
}

/* =============================================================
   9. Movimiento reducido: solo lo intrusivo
   ============================================================= */
@media (prefers-reduced-motion: reduce) {
  .notif { animation: none; transform: none; }
  .hero-mesh, .final-mesh { animation: none; }
}
