:root {
  --bg: #f3f1ec;
  --bg-elev: #ffffff;
  --surface: #fbfaf7;
  --surface-2: #e9e6df;
  --text: #0e0e10;
  --muted: #6b6a66;
  --sep: rgba(14, 14, 16, .14);
  --glass: rgba(243, 241, 236, .86);
  --glass-border: rgba(14, 14, 16, .08);
  --accent: #d92a20;
  --pink: #ff3b30;
  --orange: #ff3b30;
  --green: #ff3b30;
  --shadow: 0 0 0 1px rgba(14, 14, 16, .1);
  --radius: 14px;
  --spring: cubic-bezier(.22, .8, .12, 1);
  color-scheme: light;
}

*, *::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-family: "Archivo", system-ui, sans-serif;
  font-size: 17px; line-height: 1.5; letter-spacing: -.01em;
  -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
img, svg { display: block; max-width: 100%; }
.wrap { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 20px; }

/* language switch: elements tagged data-l only show for the active language */
html[data-lang="es"] [data-l="en"], html[data-lang="en"] [data-l="es"] { display: none !important; }

/* scroll progress */
.progress { position: fixed; inset: 0 0 auto 0; height: 3px; z-index: 60; transform-origin: 0 50%; transform: scaleX(0);
  background: linear-gradient(90deg, var(--accent), var(--pink), var(--orange)); }

/* glass nav */
.nav { position: sticky; top: 0; z-index: 50; transition: background .3s, border-color .3s; border-bottom: 1px solid transparent; }
.nav.scrolled { background: var(--glass); border-color: var(--sep);
  -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px); }
.nav-in { display: flex; align-items: center; gap: 16px; height: 64px; }
.brand { display: flex; align-items: center; gap: 12px; color: var(--text); font-stretch: 118%; font-weight: 800; letter-spacing: .02em; font-size: 17px; }
.brand:hover { text-decoration: none; }
.brand img { width: 34px; height: 34px; }
.nav-links { display: flex; gap: 22px; margin-left: auto; font-size: 15px; }
.nav-links a { color: var(--muted); }
.nav-links a:hover { color: var(--text); text-decoration: none; }

/* iOS segmented control */
.seg { position: relative; display: inline-grid; grid-auto-flow: column; grid-auto-columns: 1fr; padding: 2px;
  background: var(--surface-2); border-radius: 9px; font-size: 13px; font-weight: 600; }
.seg button { position: relative; z-index: 1; border: 0; background: none; color: var(--text); font: inherit;
  padding: 5px 12px; cursor: pointer; border-radius: 7px; min-width: 40px; }
.seg .thumb { position: absolute; top: 2px; bottom: 2px; left: 2px; border-radius: 7px; background: var(--bg-elev);
  box-shadow: 0 3px 8px rgba(0,0,0,.12), 0 3px 1px rgba(0,0,0,.04); transition: transform .35s var(--spring); }

/* buttons */
.btn { display: inline-flex; align-items: center; gap: 8px; height: 50px; padding: 0 24px; border-radius: 999px;
  font-weight: 600; font-size: 17px; border: 0; cursor: pointer; transition: transform .25s var(--spring), opacity .2s; }
.btn:hover { text-decoration: none; }
.btn:active { transform: scale(.96); }
.btn-primary { background: var(--text); color: var(--bg); }
.btn-ghost { background: var(--surface-2); color: var(--text); }

/* reveal on scroll */
.reveal { opacity: 0; transform: translateY(28px) scale(.98); transition: opacity .9s var(--spring), transform .9s var(--spring); }
.reveal.in { opacity: 1; transform: none; }

/* footer */
.foot { border-top: 1px solid var(--sep); margin-top: 96px; padding: 36px 0 48px; color: var(--muted); font-size: 14px; }
.foot-in { display: flex; flex-wrap: wrap; gap: 16px 28px; align-items: center; }
.foot-links { display: flex; flex-wrap: wrap; gap: 8px 22px; margin-left: auto; }
.foot-links a { color: var(--muted); }

/* toast */
.toast { position: fixed; left: 50%; bottom: 32px; z-index: 70; transform: translate(-50%, 30px); opacity: 0;
  background: var(--glass); -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border); box-shadow: var(--shadow); padding: 12px 20px; border-radius: 999px;
  font-weight: 600; font-size: 15px; transition: all .45s var(--spring); pointer-events: none; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 720px) {
  .nav-links { display: none; }
  .seg { margin-left: auto; }
  .foot-links { margin-left: 0; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
}
