/* nanara.co — sistema de diseño "Pórtico" */

:root {
  --bg: #FBF6EE;
  --surface: #FFFFFF;
  --surface-2: #F4EDE0;
  --text: #1A1F3D;
  --text-2: #5A5489;
  --border: rgba(45, 53, 97, 0.16);
  --indigo: #2D3561;
  --lavender: #9B8FD9;
  --gold: #F5C97B;
  --gold-text: #1A1F3D;
  --hero-bg: #1A1F3D;
  --hero-text: #F2EFE6;
  --hero-text-2: #B9B2E3;
  --logo: #2D3561;
  --link: #2D3561;
}

:root[data-theme="dark"] {
  --bg: #0F1228;
  --surface: #1A1F3D;
  --surface-2: #161A36;
  --text: #F2EFE6;
  --text-2: #B9B2E3;
  --border: #34396B;
  --logo: #F2EFE6;
  --link: #B9B2E3;
}

/* Fallback sin JavaScript: respeta el tema del sistema */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]):not([data-theme="dark"]) {
    --bg: #0F1228;
    --surface: #1A1F3D;
    --surface-2: #161A36;
    --text: #F2EFE6;
    --text-2: #B9B2E3;
    --border: #34396B;
    --logo: #F2EFE6;
    --link: #B9B2E3;
  }
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: 'Outfit', system-ui, -apple-system, sans-serif;
  font-size: 17px;
  line-height: 1.7;
  background: var(--bg);
  color: var(--text);
  transition: background-color 0.3s ease, color 0.3s ease;
}

.container { max-width: 1000px; margin: 0 auto; padding: 0 24px; }

a { color: var(--link); }

h1, h2, h3 { line-height: 1.25; font-weight: 600; }

/* ---------- Header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.site-header nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 14px;
  padding-bottom: 14px;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-weight: 600;
  font-size: 22px;
  color: var(--text);
}

.nav-links { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }

.nav-links a {
  text-decoration: none;
  color: var(--text-2);
  font-size: 15px;
  font-weight: 500;
}

.nav-links a:hover { color: var(--text); }

.lang-switch {
  border: 1px solid var(--border);
  border-radius: 99px;
  padding: 3px 14px;
  font-size: 13px;
}

.theme-btn {
  background: none;
  border: 1px solid var(--border);
  border-radius: 99px;
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-2);
}

.theme-btn:hover { color: var(--gold); border-color: var(--gold); }

.icon-sun { display: none; }
.icon-moon { display: block; }
:root[data-theme="dark"] .icon-sun { display: block; }
:root[data-theme="dark"] .icon-moon { display: none; }

/* ---------- Logo animado ---------- */

.logo .arc {
  fill: none;
  stroke: var(--logo);
  stroke-width: 8;
  stroke-linecap: round;
  stroke-dasharray: 130;
  stroke-dashoffset: 130;
  animation: draw 0.9s ease forwards;
}

.logo .a2 { animation-delay: 0.2s; }
.logo .a3 { animation-delay: 0.4s; }

.logo .dot {
  fill: var(--gold);
  animation: float 3.5s ease-in-out 1.2s infinite;
  transform-box: fill-box;
  transform-origin: center;
}

.brand:hover .dot { animation: glow 0.9s ease-in-out infinite alternate; }

@keyframes draw { to { stroke-dashoffset: 0; } }

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}

@keyframes glow {
  from { transform: scale(1); }
  to { transform: scale(1.35); }
}

/* ---------- Hero ---------- */

.hero {
  position: relative;
  overflow: hidden;
  background: var(--hero-bg);
  color: var(--hero-text);
  padding: 88px 0 96px;
}

.hero .eyebrow {
  margin: 0 0 12px;
  font-size: 14px;
  letter-spacing: 2.5px;
  color: var(--lavender);
  text-transform: lowercase;
}

.hero h1 {
  margin: 0;
  font-size: clamp(34px, 5.5vw, 52px);
  max-width: 560px;
  color: var(--hero-text);
}

.hero .sub {
  margin: 18px 0 0;
  font-size: 19px;
  color: var(--hero-text-2);
  max-width: 540px;
}

.star {
  position: absolute;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--gold);
  opacity: 0.35;
  animation: twinkle 4.5s ease-in-out infinite;
}

.star.s2 { width: 3px; height: 3px; animation-delay: 1.4s; }
.star.s3 { animation-delay: 2.6s; }
.star.s4 { width: 3px; height: 3px; animation-delay: 3.3s; }

@keyframes twinkle {
  0%, 100% { opacity: 0.2; transform: scale(1); }
  50% { opacity: 0.9; transform: scale(1.4); }
}

/* ---------- Botones ---------- */

.btn {
  display: inline-block;
  margin-top: 28px;
  background: var(--gold);
  color: var(--gold-text);
  font-weight: 500;
  font-size: 16px;
  text-decoration: none;
  border-radius: 99px;
  padding: 13px 30px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(245, 201, 123, 0.35);
}

.btn-outline {
  background: none;
  border: 1px solid var(--border);
  color: var(--text);
}

.btn-outline:hover { box-shadow: none; border-color: var(--gold); }

/* ---------- Secciones ---------- */

.section { padding: 72px 0; }

.section-label {
  margin: 0 0 20px;
  font-size: 14px;
  letter-spacing: 2.5px;
  color: var(--text-2);
}

/* ---------- Tarjeta de app ---------- */

.app-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 26px 28px;
  transition: transform 0.25s ease, border-color 0.25s ease;
}

.app-card:hover { transform: translateY(-3px); border-color: var(--lavender); }

.app-card-main {
  display: flex;
  gap: 20px;
  align-items: center;
  flex-wrap: wrap;
}

.app-icon {
  width: 76px;
  height: 76px;
  border-radius: 18px;
  flex-shrink: 0;
}

.app-icon.bob { animation: float 5s ease-in-out 1s infinite; }

.app-card h3 { margin: 0; font-size: 22px; }

.app-card .app-desc { margin: 4px 0 0; color: var(--text-2); font-size: 16px; max-width: 480px; }

.app-card-info { flex: 1; min-width: 240px; }

.badges { display: flex; flex-direction: column; gap: 8px; align-items: flex-end; }

.badge {
  font-size: 13px;
  font-weight: 500;
  border-radius: 99px;
  padding: 4px 14px;
  background: var(--surface-2);
  color: var(--text-2);
  white-space: nowrap;
}

.badge-gold { background: rgba(245, 201, 123, 0.18); color: #B07F2E; }

:root[data-theme="dark"] .badge-gold { color: var(--gold); }

.app-card-legal {
  border-top: 1px solid var(--border);
  margin-top: 20px;
  padding-top: 16px;
  display: flex;
  gap: 22px;
  flex-wrap: wrap;
  font-size: 14px;
}

.app-card-legal a { color: var(--text-2); text-decoration: none; }
.app-card-legal a:hover { color: var(--text); text-decoration: underline; }

/* ---------- Grid de valores / features ---------- */

.grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 18px;
}

.value-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px;
}

.value-card h3 { margin: 0 0 8px; font-size: 18px; }
.value-card p { margin: 0; color: var(--text-2); font-size: 15px; }

.value-card .v-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: rgba(155, 143, 217, 0.16);
  color: var(--lavender);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
}

/* ---------- Página de app (NomiNest) ---------- */

.app-hero {
  background: var(--hero-bg);
  color: var(--hero-text);
  padding: 72px 0;
  position: relative;
  overflow: hidden;
}

.app-hero .container { display: flex; gap: 32px; align-items: center; flex-wrap: wrap; }

.app-hero .app-icon { width: 110px; height: 110px; border-radius: 26px; }

.app-hero h1 { margin: 0; font-size: clamp(30px, 4.5vw, 42px); color: var(--hero-text); }
.app-hero .sub { margin: 10px 0 0; color: var(--hero-text-2); font-size: 18px; max-width: 520px; }

.app-icon-enter { animation: settle 0.9s cubic-bezier(0.34, 1.56, 0.64, 1) both; }

@keyframes settle {
  from { transform: translateY(-26px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* ---------- Artículos legales ---------- */

.legal { max-width: 760px; margin: 0 auto; padding: 56px 24px 80px; }

.legal h1 { font-size: 32px; margin-bottom: 4px; }

.legal .legal-meta { color: var(--text-2); font-size: 14px; margin-bottom: 36px; }

.legal h2 { font-size: 22px; margin-top: 44px; }

.legal table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
  margin: 16px 0;
}

.legal th, .legal td {
  border: 1px solid var(--border);
  padding: 8px 12px;
  text-align: left;
  vertical-align: top;
}

.legal th { background: var(--surface-2); font-weight: 500; }

.legal .notice {
  background: var(--surface-2);
  border-left: 4px solid var(--gold);
  padding: 14px 18px;
  font-size: 15px;
  color: var(--text-2);
  margin-bottom: 32px;
}

.legal ul, .legal ol { padding-left: 24px; }
.legal li { margin: 6px 0; }

/* ---------- Footer ---------- */

.site-footer {
  border-top: 1px solid var(--border);
  background: var(--surface-2);
  padding: 44px 0 28px;
  margin-top: 40px;
}

.footer-grid {
  display: flex;
  justify-content: space-between;
  gap: 32px;
  flex-wrap: wrap;
}

.footer-grid h4 { margin: 0 0 10px; font-size: 15px; }

.footer-grid p, .footer-grid a { font-size: 14px; color: var(--text-2); }

.footer-links { display: flex; flex-direction: column; gap: 6px; }
.footer-links a { text-decoration: none; }
.footer-links a:hover { text-decoration: underline; color: var(--text); }

.copyright {
  text-align: center;
  font-size: 13px;
  color: var(--text-2);
  margin-top: 36px;
}

/* ---------- Animación de aparición al hacer scroll ---------- */

.reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.7s ease, transform 0.7s ease; }
.reveal.visible { opacity: 1; transform: translateY(0); }

/* ---------- Accesibilidad: sin animaciones si el usuario lo pide ---------- */

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

@media (max-width: 720px) {
  .hero { padding: 56px 0 64px; }
  .section { padding: 48px 0; }
  .badges { align-items: flex-start; flex-direction: row; }
}
