/* ==========================================================================
   Codera — base: tokens, reset, typography, buttons
   Cool ink + brand sky light. Archivo (variable width) / Space Grotesk.
   ========================================================================== */

:root {
  /* surfaces */
  --ink: #07090c;
  --ink-2: #0d1015;
  --ink-3: #131720;
  --ink-4: #1c2230;
  --line: rgba(214, 228, 255, 0.08);
  --line-2: rgba(214, 228, 255, 0.15);
  --glass: rgba(16, 20, 28, 0.62);

  /* text */
  --text: #eef2f8;
  --muted: #a7b0bf;
  --dim: #7f8a9b;

  /* light */
  --sky: #38bdf8;
  --sky-rgb: 56, 189, 248;
  --iris: #818cf8;
  --iris-rgb: 129, 140, 248;
  --accent: var(--sky);
  --accent-rgb: var(--sky-rgb);
  --accent-ink: #03111c;
  --ok: #4ade80;
  --grad: linear-gradient(135deg, var(--sky), var(--iris) 72%);

  /* type */
  --f-sans: "Archivo", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --f-label: "Space Grotesk", ui-sans-serif, system-ui, sans-serif;

  /* spacing scale */
  --s-1: 4px; --s-2: 8px; --s-3: 12px; --s-4: 16px; --s-5: 24px;
  --s-6: 32px; --s-7: 48px; --s-8: 64px; --s-9: 96px; --s-10: 144px;
  --gutter: clamp(16px, 4vw, 56px);
  --max: 1360px;
  --header-h: 76px;
  --r-sm: 12px; --r: 20px; --r-lg: 28px;

  /* z-index scale */
  --z-base: 1; --z-sticky: 10; --z-header: 50; --z-menu: 60; --z-overlay: 80; --z-cursor: 100;

  /* motion — --spring is replaced at runtime by a linear() spring curve */
  --out: cubic-bezier(0.16, 1, 0.3, 1);
  --in-out: cubic-bezier(0.76, 0, 0.24, 1);
  --spring: cubic-bezier(0.34, 1.36, 0.64, 1);
  --t-fast: 180ms;
  --t-base: 320ms;
  --t-slow: 900ms;
}

body.t-ordero { --accent: #2dd4bf; --accent-rgb: 45, 212, 191; --accent-ink: #032420; --grad: linear-gradient(135deg, #5eead4, #14b8a6); }
body.t-payoff { --accent: #ff7a45; --accent-rgb: 255, 122, 69; --accent-ink: #2a0d02; --grad: linear-gradient(135deg, #ffb27a, #f0532b); }

*, *::before, *::after { box-sizing: border-box; }

html {
  background: var(--ink);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: calc(var(--header-h) + 24px);
  overflow-x: clip;
}

body {
  margin: 0;
  background: var(--ink);
  color: var(--text);
  font-family: var(--f-sans);
  font-size: 17px;
  line-height: 1.6;
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: clip;
}

img, svg, canvas, video { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
h1, h2, h3, h4 { margin: 0; font-weight: 600; line-height: 1; letter-spacing: -0.03em; }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
::selection { background: var(--sky); color: var(--accent-ink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 8px; }

.container { width: 100%; max-width: var(--max); margin-inline: auto; padding-inline: var(--gutter); }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

.skip-link {
  position: fixed; top: 12px; left: 12px; z-index: var(--z-cursor);
  padding: 10px 18px; border-radius: 999px; background: var(--sky); color: var(--accent-ink); font-weight: 600;
  transform: translateY(-200%); transition: transform var(--t-base) var(--out);
}
.skip-link:focus { transform: none; }

/* ---------- type ---------- */
.display { font-stretch: 125%; font-weight: 700; letter-spacing: -0.045em; line-height: 0.92; }
.wide { font-stretch: 118%; }
.glow { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.label {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--f-label); font-size: 12.5px; font-weight: 500; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted);
}
.label::before { content: ""; width: 7px; height: 7px; border-radius: 2px; background: var(--accent); box-shadow: 0 0 12px rgba(var(--accent-rgb), 0.8); }
.label.plain::before { display: none; }
.lead { color: var(--muted); font-size: clamp(17px, 1.5vw, 20px); line-height: 1.55; max-width: 580px; }
.lead b, .lead strong { color: var(--text); font-weight: 600; }
.num { font-variant-numeric: tabular-nums; }

.dot-live { position: relative; width: 8px; height: 8px; border-radius: 50%; background: var(--ok); flex: none; }
.dot-live::after { content: ""; position: absolute; inset: 0; border-radius: inherit; background: inherit; animation: ping 2.2s var(--out) infinite; }
@keyframes ping { from { transform: scale(1); opacity: 0.7; } to { transform: scale(3.4); opacity: 0; } }

.chip {
  display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 11px; border-radius: 999px;
  border: 1px solid var(--line-2); font-family: var(--f-label); font-size: 12px; font-weight: 500; color: var(--muted); white-space: nowrap;
}
.chip.live { color: var(--ok); border-color: rgba(74, 222, 128, 0.32); background: rgba(74, 222, 128, 0.06); }
.chip.live::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.chip.hot { color: var(--sky); border-color: rgba(var(--sky-rgb), 0.35); background: rgba(var(--sky-rgb), 0.07); }

/* ---------- buttons ---------- */
.btn {
  --bg: transparent; --fg: var(--text); --bd: var(--line-2); --fill: var(--text); --fg-h: var(--ink);
  position: relative; isolation: isolate; overflow: hidden;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 48px; padding: 0 24px; border-radius: 999px;
  background: var(--bg); color: var(--fg); border: 1px solid var(--bd);
  font-family: var(--f-label); font-size: 15px; font-weight: 500; white-space: nowrap; cursor: pointer;
  transition: color var(--t-base) var(--out), border-color var(--t-base) var(--out), transform 600ms var(--spring);
}
.btn::before {
  content: ""; position: absolute; z-index: -1; inset: 0; border-radius: inherit; background: var(--fill);
  transform: translateY(101%); transition: transform 520ms var(--out);
}
.btn:hover::before { transform: none; }
.btn:hover { color: var(--fg-h); border-color: transparent; }
.btn:active { transform: scale(0.97); }
.btn-primary { --bg: var(--grad); --fg: var(--accent-ink); --bd: transparent; --fill: var(--text); --fg-h: var(--ink); background: var(--grad); box-shadow: 0 10px 40px -12px rgba(var(--accent-rgb), 0.7); }
.btn-sm { min-height: 40px; padding: 0 16px; font-size: 14px; }
.btn-lg { min-height: 58px; padding: 0 30px; font-size: 16px; }
.btn .ico { width: 16px; height: 16px; flex: none; transition: transform 500ms var(--spring); }
.btn:hover .ico { transform: translate(2px, -2px); }

.roll { display: inline-block; height: 1.3em; line-height: 1.3em; overflow: hidden; overflow: clip; }
.roll > span { display: block; transition: transform 520ms var(--out); }
.roll > span::after { content: attr(data-t); display: block; }
/* The span holds two stacked copies of the label, so half its height is one line. */
.btn:hover .roll > span, a:hover .roll > span { transform: translateY(-50%); }

.link {
  display: inline-flex; align-items: center; gap: 8px; font-family: var(--f-label); font-weight: 500; font-size: 15px; color: var(--text);
  background: linear-gradient(currentColor, currentColor) 0 100% / 0 1px no-repeat; padding-bottom: 2px;
  transition: background-size 500ms var(--out), color var(--t-base);
}
.link:hover { background-size: 100% 1px; color: var(--accent); }
.link svg { width: 14px; height: 14px; transition: transform 400ms var(--spring); }
.link:hover svg { transform: translate(3px, -3px); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}
