/* =========================================================
   PatuApps · sistema de diseño compartido por todas las webs
   Cada app redefine --accent / --accent-soft / --accent-ink.
   ========================================================= */

:root {
  --bg: #fbf8f3;
  --bg-2: #f3eee5;
  --surface: #ffffff;
  --ink: #18201a;
  --ink-2: #4a524c;
  --ink-3: #7c847e;
  --line: rgba(24, 32, 26, 0.09);
  --shadow: 0 1px 2px rgba(24, 32, 26, 0.04), 0 12px 32px -12px rgba(24, 32, 26, 0.18);
  --shadow-lg: 0 2px 4px rgba(24, 32, 26, 0.04), 0 40px 80px -30px rgba(24, 32, 26, 0.35);

  --accent: #ff6b3d;          /* color de PatuApps */
  --accent-soft: #ffe7dc;
  --accent-ink: #b8401a;

  --sun: #ffc53d;
  --sky: #4c9bff;
  --berry: #ff5f8f;
  --leaf: #3fbf5f;

  --radius: 28px;
  --radius-sm: 18px;
  --max: 1180px;
  --gutter: clamp(16px, 4vw, 40px);

  --font-display: "Bricolage Grotesque", ui-rounded, "SF Pro Rounded", system-ui, sans-serif;
  --font-body: "Figtree", system-ui, -apple-system, "PingFang SC", "Segoe UI", sans-serif;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f1311;
    --bg-2: #161b18;
    --surface: #1b211e;
    --ink: #f1f4ef;
    --ink-2: #b9c1bb;
    --ink-3: #87908a;
    --line: rgba(255, 255, 255, 0.09);
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 12px 32px -12px rgba(0, 0, 0, 0.6);
    --shadow-lg: 0 2px 4px rgba(0, 0, 0, 0.3), 0 40px 80px -30px rgba(0, 0, 0, 0.8);
    --accent-soft: #3a2117;
    --accent-ink: #ff9a77;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0f1311; --bg-2: #161b18; --surface: #1b211e;
  --ink: #f1f4ef; --ink-2: #b9c1bb; --ink-3: #87908a; --line: rgba(255,255,255,.09);
  --accent-soft: #3a2117; --accent-ink: #ff9a77; color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
h1, h2, h3 { font-family: var(--font-display); line-height: 1.04; letter-spacing: -0.025em; margin: 0; font-weight: 800; }
p { margin: 0; }

.wrap { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-weight: 700; font-size: 14px; letter-spacing: .02em;
  color: var(--accent-ink); background: var(--accent-soft);
  padding: 6px 14px; border-radius: 999px;
}
.lead { font-size: clamp(18px, 2vw, 21px); color: var(--ink-2); max-width: 38em; }
.section { padding: clamp(72px, 10vw, 140px) 0; }
.section-head { display: grid; gap: 18px; max-width: 760px; margin-bottom: clamp(36px, 5vw, 64px); }
.section-head h2 { font-size: clamp(36px, 5.4vw, 64px); }
.center { text-align: center; margin-left: auto; margin-right: auto; justify-items: center; }
.section-head .eyebrow { justify-self: start; }
.section-head.center .eyebrow { justify-self: center; }

/* ---------- Cabecera ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: saturate(1.6) blur(18px);
  -webkit-backdrop-filter: saturate(1.6) blur(18px);
  border-bottom: 1px solid transparent;
  transition: border-color .3s;
}
.site-header.scrolled { border-bottom-color: var(--line); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; height: 68px; gap: 16px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-family: var(--font-display); font-weight: 800; font-size: 22px; letter-spacing: -0.02em; }
.brand-mark { width: 34px; height: 34px; flex: none; }
.brand small { font-family: var(--font-body); font-weight: 600; font-size: 14px; color: var(--ink-3); letter-spacing: 0; }
.nav { display: flex; align-items: center; gap: 6px; }
.nav a { text-decoration: none; font-weight: 600; font-size: 15px; color: var(--ink-2); padding: 8px 12px; border-radius: 999px; }
.nav a:hover { color: var(--ink); background: var(--bg-2); }
.nav a.btn, .nav a.btn:hover { color: #fff; background: var(--accent); }
.nav .nav-hide { display: none; }
@media (min-width: 760px) { .nav .nav-hide { display: inline-block; } }

/* ---------- Botones ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  font: 700 16px/1 var(--font-body); text-decoration: none; cursor: pointer;
  padding: 16px 24px; border-radius: 999px; border: 0;
  background: var(--accent); color: #fff;
  box-shadow: 0 10px 24px -10px color-mix(in srgb, var(--accent) 80%, transparent);
  transition: transform .2s cubic-bezier(.2,.8,.2,1), box-shadow .2s;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 16px 30px -12px color-mix(in srgb, var(--accent) 85%, transparent); }
.btn:focus-visible, .nav a:focus-visible, .chip:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 55%, transparent); outline-offset: 3px; }
.btn.small { padding: 11px 18px; font-size: 15px; }
.btn.ghost { background: var(--surface); color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--line), var(--shadow); }
.btn.dark { background: var(--ink); color: var(--bg); box-shadow: var(--shadow); }
.btn svg { width: 20px; height: 20px; }

.store-badge {
  display: inline-flex; align-items: center; gap: 12px; text-decoration: none;
  background: #000; color: #fff; padding: 12px 22px 12px 18px; border-radius: 16px;
  box-shadow: var(--shadow);
}
:root[data-theme="dark"] .store-badge { box-shadow: inset 0 0 0 1px rgba(255,255,255,.25); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .store-badge { box-shadow: inset 0 0 0 1px rgba(255,255,255,.25); } }
.store-badge svg { width: 26px; height: 26px; }
.store-badge span { display: grid; line-height: 1.1; text-align: left; }
.store-badge small { font-size: 12px; opacity: .8; font-weight: 500; }
.store-badge strong { font-size: 19px; font-weight: 700; letter-spacing: -0.01em; }

/* ---------- Marco de iPhone ---------- */
.phone {
  --w: 300px;
  position: relative; width: var(--w); aspect-ratio: 1206 / 2622;
  border-radius: calc(var(--w) * 0.16);
  padding: calc(var(--w) * 0.032);
  background: linear-gradient(145deg, #2a2d2b, #0b0c0b 60%, #2a2d2b);
  box-shadow: var(--shadow-lg), inset 0 0 0 1.5px rgba(255,255,255,.12);
  flex: none;
}
.phone::after { /* isla dinámica */
  content: ""; position: absolute; top: calc(var(--w) * 0.058); left: 50%; transform: translateX(-50%);
  width: 30%; height: calc(var(--w) * 0.085); border-radius: 999px; background: #000; z-index: 2;
}
.phone img { width: 100%; height: 100%; object-fit: cover; object-position: top; border-radius: calc(var(--w) * 0.13); background: #f2f3f5; }
.phone.cropped { aspect-ratio: auto; }
.phone.cropped img { height: auto; }

/* ---------- Tarjetas de apps (portada y pie) ---------- */
.app-grid { display: grid; gap: 22px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); }
.app-card {
  --accent: var(--app-accent, var(--accent));
  position: relative; overflow: hidden; display: grid; gap: 18px; align-content: start;
  padding: 28px; border-radius: var(--radius); background: var(--surface);
  box-shadow: var(--shadow); text-decoration: none; min-height: 300px;
  transition: transform .35s cubic-bezier(.2,.8,.2,1), box-shadow .35s;
}
a.app-card:hover { transform: translateY(-6px) rotate(-.4deg); box-shadow: var(--shadow-lg); }
.app-card .app-icon { width: 84px; height: 84px; border-radius: 22px; box-shadow: 0 10px 24px -10px rgba(0,0,0,.35); }
.app-card h3 { font-size: 32px; }
.app-card p { color: var(--ink-2); }
.app-card .meta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: auto; }
.pill { font-size: 13px; font-weight: 700; padding: 5px 11px; border-radius: 999px; background: var(--bg-2); color: var(--ink-2); }
.pill.accent { background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent); }
.app-card .arrow { position: absolute; top: 28px; right: 28px; width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: color-mix(in srgb, var(--accent) 12%, transparent); color: var(--accent); transition: transform .3s; }
a.app-card:hover .arrow { transform: translateX(4px); }
.app-card .glow { position: absolute; right: -60px; bottom: -60px; width: 220px; height: 220px; border-radius: 50%; background: radial-gradient(circle, color-mix(in srgb, var(--accent) 22%, transparent), transparent 70%); pointer-events: none; }
.app-card.placeholder { background: transparent; box-shadow: none; border: 2px dashed var(--line); place-content: center; justify-items: center; text-align: center; color: var(--ink-3); }
.app-card.placeholder .q { width: 84px; height: 84px; border-radius: 22px; display: grid; place-items: center; font: 800 40px var(--font-display); background: var(--bg-2); color: var(--ink-3); }

/* ---------- Pie ---------- */
.site-footer { padding: 56px 0 40px; border-top: 1px solid var(--line); color: var(--ink-3); font-size: 15px; }
.site-footer .cols { display: grid; gap: 32px; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); margin-bottom: 40px; }
.site-footer h4 { margin: 0 0 12px; font-size: 14px; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-2); }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.site-footer a { text-decoration: none; color: var(--ink-2); }
.site-footer a:hover { color: var(--ink); }
.site-footer .bottom { display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; }

/* ---------- Animación al aparecer ---------- */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity .8s cubic-bezier(.2,.8,.2,1), transform .8s cubic-bezier(.2,.8,.2,1); }
.reveal.in { opacity: 1; transform: none; }
.reveal.d1 { transition-delay: .08s; } .reveal.d2 { transition-delay: .16s; } .reveal.d3 { transition-delay: .24s; }

@keyframes float { 0%,100% { transform: translateY(0) rotate(var(--r, 0deg)); } 50% { transform: translateY(-14px) rotate(calc(var(--r, 0deg) + 6deg)); } }
@keyframes marquee { to { transform: translateX(-50%); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
  html { scroll-behavior: auto; }
}

/* ---------- Páginas de texto (privacidad, soporte) ---------- */
.doc { max-width: 760px; margin: 0 auto; padding: clamp(48px, 8vw, 96px) var(--gutter); }
.doc h1 { font-size: clamp(38px, 6vw, 58px); margin: 16px 0 12px; }
.doc .updated { color: var(--ink-3); font-size: 15px; margin-bottom: 36px; }
.doc h2 { font-size: 26px; margin: 44px 0 12px; }
.doc p, .doc li { color: var(--ink-2); }
.doc p + p { margin-top: 12px; }
.doc ul { padding-left: 1.2em; display: grid; gap: 8px; }
.doc .card { background: var(--surface); border-radius: var(--radius-sm); padding: 22px 24px; box-shadow: var(--shadow); margin: 20px 0; }
.doc details { background: var(--surface); border-radius: var(--radius-sm); padding: 18px 22px; box-shadow: var(--shadow); margin: 12px 0; }
.doc summary { cursor: pointer; font-weight: 700; color: var(--ink); }
.doc details p { margin-top: 10px; }
