/* Hopli · web. Colores y medidas salen de brand/tokens/tokens.json. */

@font-face { font-family: "Onest"; src: url("/fonts/Onest-400.ttf") format("truetype"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Onest"; src: url("/fonts/Onest-600.ttf") format("truetype"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Syne"; src: url("/fonts/Syne-800.ttf") format("truetype"); font-weight: 800; font-display: swap; }
@font-face { font-family: "Geist Mono"; src: url("/fonts/GeistMono-500.ttf") format("truetype"); font-weight: 500; font-display: swap; }

:root {
  color-scheme: dark;
  --bg: #05080F;
  --surface: #0B1327;
  --surface-raised: #121C38;
  --glass: rgba(12, 19, 38, 0.74);
  --line: rgba(168, 196, 255, 0.13);
  --line-strong: rgba(168, 196, 255, 0.26);
  --text: #EEF3FF;
  --text-muted: #9AA9CA;
  --primary: #7CC8FF;
  --on-primary: #07102A;
  --highlight: #FFB547;
  --success: #5EE0AA;
  --celeste: #7CC8FF;
  --lilac: #BCA8FF;
  --amber: #FFB547;
  --rose: #FF8FB1;
  --aura: conic-gradient(from 0deg, #7CC8FF, #BCA8FF, #FFB547, #FF8FB1, #7CC8FF);

  --r-sm: 10px; --r-md: 14px; --r-lg: 22px; --r-xl: 30px;
  --ease-land: cubic-bezier(.2, .8, .2, 1);
  --fade: 150ms;

  --font-display: "Syne", system-ui, sans-serif;
  --font-body: "Onest", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --wrap: 1080px;
  --gutter: clamp(20px, 5vw, 40px);
}

@media (prefers-color-scheme: light) {
  :root {
    color-scheme: light;
    --bg: #F4F7FD;
    --surface: #FFFFFF;
    --surface-raised: #FFFFFF;
    --glass: rgba(255, 255, 255, 0.78);
    --line: rgba(26, 111, 186, 0.14);
    --line-strong: rgba(26, 111, 186, 0.28);
    --text: #0B1327;
    --text-muted: #4A5878;
    --primary: #1A6FBA;
    --on-primary: #FFFFFF;
    --highlight: #A35C00; /* ámbar legible como texto sobre claro (token warning) */
    --success: #0E7F53;
  }
}

/* Logo: variante oscura o clara según el tema */
.logo-light { display: none; }
@media (prefers-color-scheme: light) {
  .logo-dark { display: none; }
  .logo-light { display: block; }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 1.0625rem/1.6 var(--font-body);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
img, svg { display: block; max-width: 100%; }
a { color: var(--primary); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 3px; border-radius: 4px; }

.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gutter); }

.skip { position: absolute; left: -999px; top: 8px; background: var(--primary); color: var(--on-primary); padding: 8px 14px; border-radius: var(--r-sm); z-index: 10; }
.skip:focus { left: 8px; }

.label {
  font: 500 0.72rem/1 var(--font-mono);
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* ---------- Encabezado ---------- */
.site-header { border-bottom: 1px solid var(--line); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; min-height: 72px; gap: 16px; }
.brand { display: inline-flex; }
.brand img { height: 36px; width: auto; }
.lang { display: flex; gap: 4px; padding: 3px; border: 1px solid var(--line-strong); border-radius: 999px; font: 500 0.78rem/1 var(--font-mono); letter-spacing: 0.06em; }
.lang a, .lang span { padding: 8px 12px; border-radius: 999px; text-decoration: none; min-width: 40px; text-align: center; }
.lang a { color: var(--text-muted); }
.lang a:hover { color: var(--text); }
.lang [aria-current] { background: var(--primary); color: var(--on-primary); }

/* ---------- Héroe ---------- */
.hero { padding: clamp(48px, 10vw, 112px) 0 clamp(40px, 8vw, 88px); }
.hero .wrap { display: grid; gap: 48px; align-items: center; }
h1.display, .display {
  font: 800 clamp(2.4rem, 8vw, 4.4rem)/1.04 var(--font-display);
  letter-spacing: -0.02em;
  margin: 0 0 20px;
  text-wrap: balance;
}
.lead { font-size: clamp(1.1rem, 2.6vw, 1.3rem); color: var(--text-muted); max-width: 34em; margin: 0 0 28px; text-wrap: pretty; }
.soon { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.soon .label { color: var(--highlight); margin-right: 4px; }
.pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 16px; border: 1px dashed var(--line-strong); border-radius: 999px;
  color: var(--text-muted); font-weight: 600; font-size: 0.92rem;
}

/* Orbe de Rumbo */
.orb-stage { display: grid; place-items: center; min-height: 260px; }
.orb { position: relative; width: min(60vw, 280px); aspect-ratio: 1; }
.orb::before, .orb::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: var(--aura); }
.orb::before { filter: blur(34px); opacity: 0.55; transform: scale(1.15); animation: breathe 4s ease-in-out infinite; }
.orb::after { animation: breathe 4s ease-in-out infinite, spin 40s linear infinite; mask: radial-gradient(circle, #000 62%, transparent 63%); -webkit-mask: radial-gradient(circle, #000 62%, transparent 63%); }
.orb-core { position: absolute; inset: 14%; border-radius: 50%; background: var(--bg); z-index: 1; display: grid; place-items: center; }
.orb-core .label { color: var(--text); letter-spacing: 0.16em; }
@keyframes breathe { 0%, 100% { scale: 0.94; } 50% { scale: 1.06; } }
@keyframes spin { to { rotate: 360deg; } }

@media (min-width: 860px) {
  .hero .wrap { grid-template-columns: 1.15fr 0.85fr; }
}

/* Entrada suave de la portada */
.hero .copy > * { animation: rise 360ms var(--ease-land) both; }
.hero .copy > :nth-child(2) { animation-delay: 60ms; }
.hero .copy > :nth-child(3) { animation-delay: 120ms; }
@keyframes rise { from { opacity: 0; translate: 0 12px; } }

/* ---------- Secciones ---------- */
section { padding: clamp(40px, 7vw, 80px) 0; }
h2.title { font: 800 clamp(1.7rem, 5vw, 2.5rem)/1.1 var(--font-display); letter-spacing: -0.01em; margin: 12px 0 0; text-wrap: balance; }
.section-head { margin-bottom: 36px; max-width: 36em; }

.features { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; }
@media (min-width: 720px) { .features { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 720px) { .features li:first-child { grid-column: 1 / -1; } }
.features li {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: 28px 26px;
}
.features .num { color: var(--primary); }
.features h3 { font: 600 1.2rem/1.3 var(--font-body); margin: 14px 0 8px; }
.features p { margin: 0; color: var(--text-muted); max-width: 40em; }

/* Privacidad */
.privacy { background: var(--surface); border-block: 1px solid var(--line); }
.privacy ul { list-style: none; padding: 0; margin: 0 0 28px; display: grid; gap: 14px; max-width: 40em; }
.privacy li { display: grid; grid-template-columns: 22px 1fr; gap: 12px; }
.privacy li::before { content: ""; width: 10px; height: 10px; margin-top: 0.6em; border-radius: 50%; background: var(--success); }
.link-arrow { font-weight: 600; }

/* ---------- Pie ---------- */
.site-footer { border-top: 1px solid var(--line); padding: 40px 0 56px; color: var(--text-muted); font-size: 0.95rem; }
.site-footer .wrap { display: grid; gap: 28px; }
.footer-links { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px 24px; }
.footer-links a { color: var(--text); }
.footer-contact { display: grid; gap: 4px; }
.footer-contact a { color: var(--primary); }
.coords { font: 500 0.78rem/1 var(--font-mono); letter-spacing: 0.06em; color: var(--text-muted); }
@media (min-width: 760px) { .site-footer .wrap { grid-template-columns: 1fr 1fr auto; align-items: start; } }

.copyright { margin: 0 0 8px; }

/* Textos por idioma en la plantilla legal (una sola plantilla, sin marcadores extra) */
html:lang(es) .only-en, html:lang(en) .only-es { display: none; }

/* ---------- Páginas legales ---------- */
.legal { padding: clamp(32px, 6vw, 72px) 0 clamp(40px, 8vw, 96px); }
.legal .wrap { max-width: calc(70ch + var(--gutter) * 2); }
.prose { font-size: 1.0625rem; line-height: 1.7; overflow-wrap: anywhere; }
.prose h1 { font: 800 clamp(2rem, 6vw, 3rem)/1.1 var(--font-display); letter-spacing: -0.015em; margin: 0 0 24px; text-wrap: balance; }
.prose h2 { font: 600 1.45rem/1.3 var(--font-body); margin: 2.4em 0 0.6em; padding-top: 1.2em; border-top: 1px solid var(--line); scroll-margin-top: 16px; }
.prose h3 { font: 600 1.1rem/1.4 var(--font-body); margin: 1.8em 0 0.4em; }
.prose p, .prose ul, .prose ol { margin: 0 0 1em; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li { margin-bottom: 0.4em; }
.prose li::marker { color: var(--text-muted); }
.prose strong { font-weight: 600; }
.prose blockquote { margin: 1.4em 0; padding: 4px 0 4px 18px; border-left: 3px solid var(--highlight); color: var(--text-muted); }
.prose code { font: 500 0.88em var(--font-mono); background: var(--surface-raised); border: 1px solid var(--line); border-radius: 6px; padding: 1px 6px; }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 2em 0; }
.prose nav { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: 16px 20px; margin: 0 0 2em; font-size: 0.95rem; }
.prose nav ul, .prose nav ol { margin: 0; }
/* Tablas: desplazamiento horizontal propio. La plantilla las envuelve si el build agrega .table-wrap;
   si no, se vuelven desplazables por sí solas. */
.prose table { display: block; max-width: 100%; overflow-x: auto; border-collapse: collapse; margin: 1.4em 0; font-size: 0.95rem; -webkit-overflow-scrolling: touch; }
.prose th, .prose td { padding: 10px 14px; border: 1px solid var(--line-strong); text-align: left; vertical-align: top; min-width: 120px; }
.prose th { background: var(--surface); font-weight: 600; }
.prose td { background: transparent; }
.legal-meta { margin-bottom: 20px; }

/* ---------- Movimiento reducido ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .orb::before, .orb::after { animation: none; }
  .hero .copy > * { animation: fade var(--fade) linear both; translate: none; }
  @keyframes fade { from { opacity: 0; } }
}
