/* Astrolabio. Los colores de los manuscritos astronómicos: lapislázuli, latón y bermellón sobre vitela. */

@font-face { font-family: "Bricolage"; src: url("fonts/bricolage-latin-wght.woff2") format("woff2"); font-weight: 200 800; font-display: swap; }
@font-face { font-family: "Plex"; src: url("fonts/plex-latin-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Plex"; src: url("fonts/plex-latin-500.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Plex"; src: url("fonts/plex-latin-600.woff2") format("woff2"); font-weight: 600; font-display: swap; }

:root {
  --lapis-950: #0b1040;
  --lapis-900: #141d73;
  --lapis-300: #7f8be0;
  --brass-200: #f3dfb4;
  --brass-400: #dcb871;
  --vermilion: #ef5a32;
  --on-lapis: #ffffff;
  --on-lapis-soft: #d5daf6;
  --n-night: #0c262c;
  --n-level: #6fcf97;

  --bg: #f6f2e9;
  --surface: #ece6d8;
  --text: #12163b;
  --muted: #4d5272;
  --line: #d9d2c1;
  --accent: #2a38b4;

  --gutter: clamp(16px, 4vw, 40px);
  --max: 1240px;
  --section: clamp(72px, 10vw, 152px);
  --horizon: clamp(40px, 7vw, 110px);
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --display: "Bricolage", "Plex", system-ui, -apple-system, "Segoe UI", sans-serif;
  --body: "Plex", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0a0e36;
    --surface: #131a54;
    --text: #eef0fb;
    --muted: #aeb5db;
    --line: #262e70;
    --accent: #dcb871;
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 84px; }
body { margin: 0; background: var(--bg); color: var(--text); font: 400 1.0625rem/1.6 var(--body); overflow-x: clip; }
img, svg { display: block; max-width: 100%; }
h1, h2, h3, p, ul, figure { margin: 0; }
h1, h2, h3 { font-family: var(--display); text-wrap: balance; }
p { text-wrap: pretty; }
a { color: var(--accent); text-underline-offset: 3px; }
:focus-visible { outline: 2px solid currentColor; outline-offset: 3px; border-radius: 4px; }

.wrap { width: 100%; max-width: var(--max); margin-inline: auto; padding-inline: var(--gutter); }
.skip { position: absolute; left: -9999px; z-index: 40; background: var(--bg); color: var(--text); padding: 10px 14px; border-radius: 8px; }
.skip:focus { left: var(--gutter); top: 10px; }
.lead { font-size: clamp(1.125rem, 1rem + 0.5vw, 1.375rem); line-height: 1.5; max-width: 34em; }

section:not(.hero, .n-hero) { padding-block: var(--section); }
section > .wrap > h2 { font-size: clamp(1.75rem, 1.4rem + 1.5vw, 2.75rem); font-weight: 600; letter-spacing: -0.02em; line-height: 1.1; margin-bottom: clamp(28px, 4vw, 56px); }

/* Botones y enlaces */
.btn { display: inline-flex; align-items: center; gap: 10px; min-height: 54px; padding: 0 26px; border: 0; border-radius: 12px; background: var(--brass-400); color: var(--lapis-950); font: 600 1.0625rem/1 var(--body); text-decoration: none; cursor: pointer; transition: background 0.2s, transform 0.15s; }
.btn:hover { background: var(--brass-200); }
.btn:active { transform: scale(0.98); }
.btn[disabled] { opacity: 0.7; cursor: progress; }
.btn.teal { background: var(--n-level); color: #06262b; }
.btn.teal:hover { background: #93dfb3; }
.arrow { width: 20px; height: 20px; flex: none; transition: transform 0.25s var(--ease); }
.btn:hover .arrow, .app-card:hover .arrow { transform: translateX(4px); }
.link { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; color: inherit; font-weight: 500; text-decoration: underline; text-underline-offset: 5px; text-decoration-thickness: 1px; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 28px; margin-top: 32px; }

/* Barra superior */
.bar { position: fixed; inset: 0 0 auto; z-index: 30; color: var(--on-lapis); transition: background 0.25s, color 0.25s, box-shadow 0.25s; }
.bar.scrolled { background: var(--lapis-900); }
.app-nivela .bar.scrolled { background: var(--n-night); }
.bar.stuck, .top-solid .bar, .app-nivela .bar.stuck { background: var(--bg); color: var(--text); box-shadow: 0 1px 0 var(--line); }
.top-solid .bar { position: sticky; top: 0; }
.bar-in { display: flex; align-items: center; justify-content: space-between; min-height: 68px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; font: 600 1.1875rem/1 var(--display); letter-spacing: -0.01em; min-height: 44px; }
.brand svg { width: 30px; height: 30px; color: var(--brass-400); }
.bar.stuck .brand svg, .top-solid .bar .brand svg { color: var(--accent); }
.bar nav { display: flex; align-items: center; gap: 2px; }
.bar nav a { color: inherit; text-decoration: none; font-size: 0.9375rem; font-weight: 500; padding: 12px 10px; }
.bar nav a:hover { text-decoration: underline; text-underline-offset: 5px; }
.bar nav .wide { display: none; }
@media (min-width: 560px) { .bar nav .wide { display: inline; } .bar nav { gap: 10px; } }

/* Portada: el cielo y el instrumento */
.hero { position: relative; isolation: isolate; min-height: 100svh; overflow: clip; display: flex; flex-direction: column; justify-content: flex-end; padding: 120px 0 calc(var(--horizon) + 32px); background: var(--lapis-900); color: var(--on-lapis); }
.sky { position: absolute; inset: 0; z-index: -2; }
.stars { position: absolute; inset: -6% 0 -36%; background-size: cover; background-position: center; will-change: transform; }
.s1 { background-image: url("img/cielo-1.svg"); }
.s2 { background-image: url("img/cielo-2.svg"); }
.s3 { background-image: url("img/cielo-3.svg"); }

.instrument { position: absolute; z-index: -1; left: 66%; top: 30%; width: 172vw; aspect-ratio: 1; translate: -50% -50%; -webkit-mask-image: linear-gradient(to bottom, #000 58%, transparent 80%); mask-image: linear-gradient(to bottom, #000 58%, transparent 80%); }
.astro { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; will-change: transform; }
.astro text { font-family: var(--body); font-weight: 500; letter-spacing: 0.02em; }
.limb { color: var(--brass-400); }
.tympan { color: var(--lapis-300); opacity: 0.75; }
.rete { color: var(--brass-200); }
.rete text { fill: currentColor; stroke: none; }
.rule-bar { fill: var(--lapis-950); stroke: var(--brass-200); }
.rule-vanes { fill: var(--brass-400); }
.rule-line { stroke: var(--vermilion); fill: none; }
.rule-pin { fill: var(--brass-400); }

.hero::after { content: ""; position: absolute; inset: 0 0 auto; z-index: -1; height: 140px; background: linear-gradient(var(--lapis-900) 20%, transparent); pointer-events: none; }
.hero-in { position: relative; }
.hero h1 { font-size: clamp(3.5rem, 1.9rem + 8.6vw, 8.75rem); line-height: 0.95; font-weight: 600; letter-spacing: -0.038em; max-width: 7em; }
.hero .lead { margin-top: 24px; color: var(--on-lapis-soft); }
.hero .btn { box-shadow: 0 10px 30px -12px rgba(0, 0, 0, 0.5); }
.sky-note { margin-top: 28px; font-size: 0.875rem; color: var(--on-lapis-soft); }

@media (min-width: 900px) {
  .hero { justify-content: center; padding-bottom: var(--horizon); }
  .instrument { left: 76%; top: 49%; width: max(118vh, 74vw); -webkit-mask-image: linear-gradient(to right, transparent 4%, #000 34%); mask-image: linear-gradient(to right, transparent 4%, #000 34%); }
  .sky-note { position: absolute; bottom: calc(var(--horizon) + 20px); left: 0; right: 0; }
}

.horizon { position: relative; z-index: 2; height: var(--horizon); margin-top: calc(var(--horizon) * -1); background: var(--bg); border-radius: 50% 50% 0 0 / 100% 100% 0 0; }

/* El estudio */
.studio { padding-top: clamp(40px, 6vw, 88px) !important; }
.statement { font: 500 clamp(2.15rem, 1.15rem + 4.3vw, 5.25rem)/1.05 var(--display); letter-spacing: -0.028em; max-width: 19em; text-wrap: pretty; }
html.js .statement .w { color: color-mix(in srgb, var(--text) 20%, transparent); transition: color 0.35s; }
html.js .statement .w.lit { color: var(--text); }
.studio-body { max-width: 36em; margin-top: clamp(32px, 5vw, 72px); color: var(--muted); font-size: clamp(1.0625rem, 1rem + 0.3vw, 1.25rem); line-height: 1.55; }
@media (min-width: 900px) { .studio-body { margin-left: auto; } }

/* Las apps */
.apps { padding-top: 0 !important; }
.app-card { position: relative; display: grid; overflow: hidden; border-radius: 28px; background: var(--n-night); color: #f1f7f7; transition: transform 0.45s var(--ease); }
.app-card:has(.stretch:focus-visible) { outline: 3px solid var(--accent); outline-offset: 4px; }
.app-card:hover { transform: translateY(-4px); }
.app-copy { padding: clamp(28px, 5vw, 72px); display: flex; flex-direction: column; align-items: flex-start; gap: 10px; }
.app-icon { width: 88px; height: 88px; border-radius: 20px; }
.app-copy h3 { font-size: clamp(2.5rem, 1.8rem + 3vw, 4.75rem); line-height: 1; font-weight: 600; letter-spacing: -0.03em; margin-top: 14px; }
.stretch { color: inherit; text-decoration: none; }
.stretch::after { content: ""; position: absolute; inset: 0; z-index: 3; }
.app-kind { font-size: 1.125rem; font-weight: 500; color: var(--n-level); }
.app-copy > p:not(.app-kind, .app-status) { max-width: 30em; color: #cfdfe0; }
.app-status { display: inline-flex; align-items: center; gap: 10px; font-size: 0.9375rem; font-weight: 500; margin-top: 8px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--n-level); }
.app-copy .link { margin-top: 12px; }
.app-copy { padding-bottom: 8px; }
.app-shots { position: relative; height: clamp(340px, 88vw, 460px); }
.apps-next { margin-top: 28px; color: var(--muted); }

.phone { --w: 240px; position: relative; width: var(--w); aspect-ratio: 1080 / 1920; overflow: hidden; border: calc(var(--w) * 0.024) solid #05070f; border-radius: calc(var(--w) * 0.11); background: #05070f; box-shadow: 0 34px 60px -24px rgba(2, 6, 28, 0.65), 0 0 0 1px rgba(255, 255, 255, 0.09); }
.phone img { width: 100%; height: 100%; object-fit: cover; }
.shot { position: absolute; transition: transform 0.6s var(--ease); }
.shot.front { --w: clamp(200px, 56vw, 270px); left: 50%; top: 24px; margin-left: calc(var(--w) / -2); z-index: 2; view-transition-name: nivela-phone; }
.shot.back-a, .shot.back-b { --w: clamp(170px, 46vw, 230px); top: 76px; z-index: 1; }
.shot.back-a { left: 50%; margin-left: calc(var(--w) * -1.28); transform: rotate(-7deg); }
.shot.back-b { left: 50%; margin-left: calc(var(--w) * 0.28); transform: rotate(7deg); }
.app-card:hover .front { transform: translateY(-14px); }
.app-card:hover .back-a { transform: rotate(-10deg) translate(-10px, -4px); }
.app-card:hover .back-b { transform: rotate(10deg) translate(10px, -4px); }
@media (min-width: 900px) {
  .app-card { grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); min-height: 640px; }
  .app-copy { justify-content: center; padding-bottom: clamp(28px, 5vw, 72px); }
  .app-shots { height: auto; }
  .shot.front { --w: 300px; top: 64px; }
  .shot.back-a, .shot.back-b { --w: 250px; top: 130px; }
}

/* Cómo trabajamos */
.how { background: var(--surface); }
.ledger { list-style: none; padding: 0; border-top: 1px solid var(--line); }
.ledger li { display: grid; gap: 8px; padding-block: clamp(22px, 3vw, 40px); border-bottom: 1px solid var(--line); }
.ledger h3 { font-size: clamp(1.5rem, 1.15rem + 1.5vw, 2.5rem); line-height: 1.12; font-weight: 500; letter-spacing: -0.02em; }
.ledger p { color: var(--muted); max-width: 36em; }
@media (min-width: 800px) { .ledger li { grid-template-columns: 1fr 1fr; gap: 48px; align-items: baseline; } }

/* Contacto */
.contact { position: relative; isolation: isolate; overflow: clip; background: var(--lapis-900); color: var(--on-lapis); }
.contact-dial { position: absolute; z-index: -1; right: -48vw; bottom: -40vw; width: 130vw; aspect-ratio: 1; color: var(--brass-400); opacity: 0.32; }
.contact-dial .astro text { fill: currentColor; stroke: none; }
.contact-in { display: grid; gap: 40px; }
.contact h2 { font-size: clamp(3rem, 2rem + 5vw, 6.25rem); font-weight: 600; line-height: 0.98; letter-spacing: -0.035em; }
.contact .lead { margin-top: 20px; color: var(--on-lapis-soft); }
.direct { margin-top: 20px; color: var(--on-lapis-soft); }
.contact a { color: var(--brass-200); }
.form { display: grid; gap: 18px; align-content: start; }
.field label { display: block; font-weight: 500; margin-bottom: 8px; }
.field input, .field textarea { width: 100%; min-height: 52px; padding: 13px 16px; border: 1px solid rgba(255, 255, 255, 0.34); border-radius: 12px; background: rgba(11, 16, 64, 0.55); color: #fff; font: 400 1.0625rem/1.5 var(--body); transition: border-color 0.2s; }
.field textarea { resize: vertical; }
.field input::placeholder { color: #b6bde6; }
.field input:hover, .field textarea:hover { border-color: rgba(255, 255, 255, 0.6); }
.field input:focus-visible, .field textarea:focus-visible { outline: 2px solid var(--brass-400); outline-offset: 1px; border-color: transparent; }
.form .btn { justify-self: start; }
.form-note { font-size: 0.875rem; color: var(--on-lapis-soft); }
.form-status { font-weight: 500; min-height: 1.6em; }
.form-status[data-kind="ok"] { color: var(--n-level); }
.form-status[data-kind="error"] { color: #ffb19b; }
.trap { position: absolute; left: -9999px; }
@media (min-width: 900px) {
  .contact-in { grid-template-columns: 1fr 1fr; gap: 72px; align-items: start; }
  .contact-dial { right: -26vw; left: auto; bottom: -34vw; width: 70vw; }
}

/* Pie */
.foot { background: var(--lapis-950); color: var(--on-lapis-soft); }
.foot-in { display: grid; gap: 28px; padding-block: 48px; }
.foot .brand { color: #fff; }
.foot p { margin-top: 10px; font-size: 0.9375rem; }
.foot ul { list-style: none; padding: 0; display: grid; gap: 2px; }
.foot li a { display: inline-block; padding: 8px 0; color: #fff; text-decoration: none; }
.foot li a:hover { text-decoration: underline; text-underline-offset: 4px; }
.legal { align-self: end; }
@media (min-width: 800px) { .foot-in { grid-template-columns: 1.2fr 1fr auto; } }

/* Nivela */
.n-hero { position: relative; overflow: clip; padding: 112px 0 calc(var(--horizon) + 56px); background: var(--n-night); color: #fff; }
.n-line { position: absolute; left: -100vw; right: -100vw; top: 64%; height: 2px; background: var(--n-level); opacity: 0.75; }
.n-hero-in { position: relative; display: grid; gap: 56px; }
.n-copy { display: flex; flex-direction: column; align-items: flex-start; }
.n-hero h1 { font-size: clamp(3.25rem, 1.9rem + 4.8vw, 6.25rem); line-height: 0.96; font-weight: 600; letter-spacing: -0.036em; margin-top: 26px; }
.n-hero .lead { margin-top: 22px; color: #d4e4e5; }
.promise { margin-top: 14px; font-weight: 500; }
.n-hero .app-status { margin-top: 18px; }
.n-shots { position: relative; height: clamp(420px, 118vw, 560px); }
.n-shots .phone { position: absolute; left: 50%; top: 20px; }
.lead-shot { --w: clamp(220px, 62vw, 300px); margin-left: calc(var(--w) / -2); z-index: 2; view-transition-name: nivela-phone; }
.side { --w: clamp(170px, 46vw, 236px); top: 76px !important; }
.side.left { margin-left: calc(var(--w) * -1.22); rotate: -6deg; }
.side.right { margin-left: calc(var(--w) * 0.22); rotate: 6deg; }
@media (min-width: 960px) {
  .n-hero { padding-top: 96px; }
  .n-hero-in { grid-template-columns: 1fr 1fr; align-items: center; min-height: calc(100svh - 96px - var(--horizon)); }
  .n-shots { height: 680px; }
  .n-line { left: -4vw; }
  .lead-shot { --w: 340px; }
  .side { --w: 270px; top: 110px !important; }
}

.story-grid { display: grid; }
.pin { display: none; }
.step { display: grid; gap: 22px; padding-block: 28px; }
.step h3 { font-size: clamp(1.75rem, 1.35rem + 1.8vw, 3rem); line-height: 1.08; font-weight: 600; letter-spacing: -0.025em; }
.step p { margin-top: 12px; color: var(--muted); max-width: 32em; font-size: clamp(1.0625rem, 1rem + 0.3vw, 1.25rem); line-height: 1.55; }
.inline-shot { --w: min(70vw, 280px); }
@media (min-width: 960px) {
  html.js .story-grid { grid-template-columns: minmax(0, 1fr) 372px; gap: clamp(40px, 7vw, 112px); }
  html.js .pin { display: block; position: sticky; top: calc(50vh - 310px); align-self: start; }
  html.js .inline-shot { display: none; }
  html.js .step { min-height: 76vh; align-content: center; padding-block: 0; opacity: 0.32; transition: opacity 0.4s; }
  html.js .step.on { opacity: 1; }
}
.stack { --w: 348px; }
.stack img { position: absolute; inset: 0; opacity: 0; transition: opacity 0.45s; }
.stack img.on { opacity: 1; }

.more { background: var(--surface); }
.more-grid { list-style: none; padding: 0; display: grid; gap: 34px 48px; }
.more-grid li { border-top: 1px solid var(--line); padding-top: 18px; }
.more-grid h3 { font-size: 1.375rem; font-weight: 600; letter-spacing: -0.012em; line-height: 1.2; }
.more-grid p { margin-top: 8px; color: var(--muted); }
@media (min-width: 640px) { .more-grid { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1000px) { .more-grid { grid-template-columns: repeat(3, 1fr); } }

.n-private { background: var(--n-night); color: #fff; }
.n-private-in { display: grid; gap: 36px; }
.big { font-size: clamp(2.5rem, 1.5rem + 4.6vw, 5.5rem) !important; line-height: 1 !important; font-weight: 500 !important; letter-spacing: -0.03em !important; margin: 0 !important; }
.n-private .lead { color: #d4e4e5; }
.checks { list-style: none; padding: 0; margin: 22px 0 14px; display: grid; gap: 10px; }
.checks li { display: flex; align-items: baseline; gap: 12px; }
.checks li::before { content: ""; flex: none; width: 0.62em; height: 0.32em; border-left: 2px solid var(--n-level); border-bottom: 2px solid var(--n-level); rotate: -45deg; translate: 0 -0.22em; }
@media (min-width: 900px) { .n-private-in { grid-template-columns: 1.15fr 1fr; gap: 72px; align-items: center; } }

.faq-in { display: grid; gap: 8px; }
.faq-list { border-bottom: 1px solid var(--line); }
details { border-top: 1px solid var(--line); }
summary { position: relative; display: flex; align-items: center; min-height: 64px; padding: 16px 44px 16px 0; font-size: 1.1875rem; font-weight: 500; cursor: pointer; list-style: none; }
summary::-webkit-details-marker { display: none; }
summary::after { content: ""; position: absolute; right: 8px; top: 50%; width: 12px; height: 12px; margin-top: -9px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); rotate: 45deg; transition: rotate 0.25s var(--ease), margin 0.25s var(--ease); }
details[open] summary::after { rotate: 225deg; margin-top: -3px; }
details p { padding-bottom: 22px; color: var(--muted); max-width: 40em; }
@media (min-width: 900px) { .faq-in { grid-template-columns: 1fr 1.6fr; gap: 72px; } }

.n-important { background: var(--surface); padding-block: clamp(48px, 6vw, 80px) !important; }
.n-important h2 { font-size: 1.25rem !important; margin-bottom: 10px !important; letter-spacing: -0.01em !important; }
.n-important p { max-width: 50em; }
.n-closing { padding-block: clamp(56px, 7vw, 96px) !important; }
.n-closing-in { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 20px; }
.n-closing p { font: 500 clamp(1.75rem, 1.3rem + 2vw, 3.25rem)/1.1 var(--display); letter-spacing: -0.025em; }

/* Páginas de texto y avisos */
.doc { padding-block: 48px 72px; max-width: 48rem; }
.doc h1 { font-size: clamp(2.25rem, 1.8rem + 2.4vw, 3.5rem); line-height: 1.05; font-weight: 600; letter-spacing: -0.03em; margin-bottom: 12px; }
.doc h2 { font-size: 1.375rem; font-weight: 600; margin: 36px 0 8px; letter-spacing: -0.012em; }
.doc p, .doc li { color: var(--muted); }
.doc p { margin-block: 12px; }
.doc .lead { color: var(--text); font-size: 1.125rem; }
.doc .updated { font-size: 0.875rem; }
.doc ul { padding-left: 22px; }
.doc .legal { font-size: 0.875rem; }
.notice { padding-block: clamp(96px, 16vw, 180px); }
.notice h1 { font-size: clamp(2.75rem, 2rem + 4vw, 5rem); line-height: 1; font-weight: 600; letter-spacing: -0.03em; }
.notice .lead { margin-top: 18px; color: var(--muted); }
.notice p:last-child { margin-top: 16px; }

/* Aparecer al bajar */
html.js .reveal { opacity: 0; transform: translateY(26px); transition: opacity 0.8s var(--ease), transform 0.8s var(--ease); }
html.js .reveal.in { opacity: 1; transform: none; }

/* Entre páginas: el teléfono de la tarjeta se convierte en el de la app */
@view-transition { navigation: auto; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: 0.3s; }
::view-transition-group(nivela-phone) { animation-duration: 0.45s; animation-timing-function: var(--ease); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  html.js .reveal { opacity: 1; transform: none; }
  html.js .statement .w { color: inherit; }
  html.js .step { opacity: 1; }
  @view-transition { navigation: none; }
}
