/* Free Intelligence — papel cemento, tinta, rosa riso. */
:root {
  --paper: #ecede8;
  --paper-2: #e2e4dd;
  --ink: #111311;
  --ink-2: #3a3e39;
  --grey: #5f645d;
  --rule: #c6cac2;
  --pink: #ff4f9a;
  --pink-soft: #ffd3e6;
  --pink-ink: #b0145a;
  --ok: #1f7a4a;
  --display: "Anybody", "Arial Narrow", sans-serif;
  --body: "Hanken Grotesk", system-ui, sans-serif;
  --mono: "Martian Mono", ui-monospace, monospace;
  --gutter: clamp(16px, 4vw, 48px);
  --max: 1240px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #121411; --paper-2: #1a1d19; --ink: #eceee8; --ink-2: #c2c6bf; --grey: #8d9289;
    --rule: #2f332e; --pink-soft: #3b1527; --pink-ink: #ff86b9; --ok: #5fd39a; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #121411; --paper-2: #1a1d19; --ink: #eceee8; --ink-2: #c2c6bf; --grey: #8d9289;
  --rule: #2f332e; --pink-soft: #3b1527; --pink-ink: #ff86b9; --ok: #5fd39a; color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font: 400 17px/1.55 var(--body); font-feature-settings: "ss01";
  -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--pink-ink); }
:focus-visible { outline: 2px solid var(--pink); outline-offset: 3px; border-radius: 2px; }
::selection { background: var(--pink); color: #111311; }
code, pre, kbd { font-family: var(--mono); font-size: .82em; }
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }
.mono { font-family: var(--mono); font-size: 12px; letter-spacing: .02em; }
.muted { color: var(--grey); }

/* cabecera */
.top { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 22px 0; }
.mark { font: 800 22px/1 var(--display); font-stretch: 125%; letter-spacing: -.02em; text-decoration: none; display: inline-flex; align-items: baseline; gap: 2px; }
.mark i { font-style: normal; color: var(--pink); }
.nav { display: flex; gap: 22px; font: 500 15px var(--body); }
.nav a { text-decoration: none; }
.nav a[aria-current="page"] { text-decoration: underline; text-decoration-color: var(--pink); text-decoration-thickness: 3px; }

/* portada */
.hero { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: clamp(28px, 5vw, 72px); align-items: end; padding: clamp(36px, 7vw, 96px) 0 clamp(40px, 6vw, 80px); }
.hero h1 {
  margin: 0; font: 760 clamp(46px, 8.4vw, 124px)/.88 var(--display); font-stretch: 66%;
  letter-spacing: .012em; text-transform: uppercase;
}
.hero h1 .wide { font-stretch: 150%; letter-spacing: -.02em; }
.hero h1 mark { background: none; color: inherit; position: relative; white-space: nowrap; isolation: isolate; }
.hero h1 mark::before { content: ""; position: absolute; inset: 52% -.06em 4% -.04em; background: var(--pink); z-index: -1; mix-blend-mode: multiply; transform: skewX(-8deg); }
.hero .lede { margin: 28px 0 0; max-width: 34ch; font-size: 19px; color: var(--ink-2); }

/* el vale */
.voucher {
  position: relative; background: var(--paper-2); border: 1.5px dashed var(--ink); padding: 26px 24px 22px;
  transform: rotate(-1.4deg);
}
.voucher::before, .voucher::after { content: ""; position: absolute; top: 50%; width: 22px; height: 22px; border-radius: 50%; background: var(--paper); border: 1.5px dashed var(--ink); transform: translateY(-50%); }
.voucher::before { left: -12px; clip-path: inset(0 0 0 50%); }
.voucher::after { right: -12px; clip-path: inset(0 50% 0 0); }
.voucher .label { display: flex; justify-content: space-between; font: 500 11px var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--grey); }
.voucher .key { margin: 18px 0 6px; font: 500 clamp(17px, 2vw, 22px) var(--mono); letter-spacing: .02em; overflow-wrap: anywhere; }
.voucher .key span { color: var(--grey); }
.voucher p { margin: 14px 0 0; font-size: 15px; }
.stamp {
  position: absolute; right: 18px; bottom: -22px; padding: 8px 12px 7px; border: 2.5px solid var(--pink-ink); color: var(--pink-ink);
  font: 800 13px/1 var(--display); font-stretch: 140%; letter-spacing: .06em; text-transform: uppercase; transform: rotate(6deg);
  background: color-mix(in srgb, var(--paper) 70%, transparent);
}

/* ranking */
.section { padding: clamp(48px, 7vw, 96px) 0; border-top: 1.5px solid var(--ink); }
.section-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: end; gap: 18px 32px; margin-bottom: 26px; }
.section h2 { margin: 0; font: 800 clamp(30px, 4.4vw, 56px)/.95 var(--display); font-stretch: 75%; letter-spacing: -.02em; text-transform: uppercase; }
.section .sub { margin: 10px 0 0; color: var(--grey); max-width: 52ch; }
.tabs { display: flex; flex-wrap: wrap; gap: 6px; }
.tabs button {
  font: 500 13px var(--body); color: var(--ink); background: transparent; border: 1.5px solid var(--ink);
  border-radius: 999px; padding: 7px 14px; cursor: pointer;
}
.tabs button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.board { width: 100%; border-collapse: collapse; }
.board th { font: 500 11px var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--grey); text-align: left; padding: 0 10px 10px; border-bottom: 1px solid var(--rule); white-space: nowrap; }
.board td { padding: 14px 10px; border-bottom: 1px solid var(--rule); vertical-align: middle; }
.board tr { transition: background .15s; }
.board tbody tr:hover { background: var(--paper-2); }
.rank { font: 800 30px/1 var(--display); font-stretch: 60%; width: 44px; font-variant-numeric: tabular-nums; }
.board tr:first-child .rank { color: var(--pink-ink); }
.model { display: flex; align-items: center; gap: 14px; min-width: 210px; }
.logo { width: 34px; height: 34px; flex: none; display: grid; place-items: center; border: 1.5px solid var(--ink); border-radius: 50%; }
.logo i { width: 18px; height: 18px; background: var(--ink); -webkit-mask: var(--src) center / contain no-repeat; mask: var(--src) center / contain no-repeat; }
.model b { display: block; font: 700 17px/1.15 var(--body); }
.model small { font: 400 12px var(--mono); color: var(--grey); }
.bar { display: flex; align-items: center; gap: 10px; min-width: 130px; }
.bar .track { flex: 1; height: 8px; background: var(--paper-2); border: 1px solid var(--rule); position: relative; }
.bar .fill { position: absolute; inset: 0 auto 0 0; background: var(--ink); }
.bar.power .fill { background: var(--pink); }
.bar span { font: 500 12px var(--mono); width: 2.6em; text-align: right; font-variant-numeric: tabular-nums; }
.chip { display: inline-block; font: 500 11px var(--mono); padding: 3px 8px; border: 1px solid var(--ink); border-radius: 999px; white-space: nowrap; }
.chip.on { background: var(--pink); border-color: var(--pink); color: #111311; }
.chip.off { border-color: var(--rule); color: var(--grey); }
.num { font: 400 13px var(--mono); white-space: nowrap; font-variant-numeric: tabular-nums; }
.blurb { font-size: 14px; color: var(--ink-2); max-width: 30ch; }
.board-wrap { overflow-x: auto; margin: 0 calc(var(--gutter) * -1); padding: 0 var(--gutter); }

/* uso */
.howto { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); gap: clamp(24px, 4vw, 56px); align-items: start; }
.howto ol { margin: 0; padding: 0; list-style: none; counter-reset: s; }
.howto li { counter-increment: s; display: grid; grid-template-columns: 40px 1fr; padding: 16px 0; border-bottom: 1px solid var(--rule); }
.howto li::before { content: counter(s); font: 800 26px/1 var(--display); font-stretch: 60%; color: var(--pink-ink); }
.howto li b { display: block; }
pre.code {
  margin: 0; background: #161916; color: #e8eae4; padding: 22px 22px; overflow-x: auto; font-size: 13px; line-height: 1.7;
  border-radius: 0; position: relative; border: 1.5px solid #161916;
}
:root[data-theme="dark"] pre.code { background: #0b0c0b; border-color: var(--rule); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) pre.code { background: #0b0c0b; border-color: var(--rule); } }
pre.code .c { color: #8b9087; }
pre.code .s { color: #ffa8cb; }
pre.code .k { color: #ffffff; font-weight: 600; }
.copy {
  position: absolute; top: 10px; right: 10px; font: 500 11px var(--mono); background: transparent; color: #e8eae4;
  border: 1px solid #555a53; padding: 4px 8px; cursor: pointer;
}
.copy:hover { border-color: var(--pink); color: var(--pink); }

.foot { padding: 36px 0 56px; border-top: 1.5px solid var(--ink); display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; font-size: 14px; color: var(--grey); }

/* documentación */
.docs { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: clamp(24px, 5vw, 72px); padding: 32px 0 80px; }
.toc { position: sticky; top: 20px; align-self: start; font-size: 14px; }
.toc p { font: 500 11px var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--grey); margin: 0 0 10px; }
.toc a { display: block; padding: 5px 0 5px 12px; text-decoration: none; border-left: 2px solid var(--rule); }
.toc a.on { border-left-color: var(--pink); font-weight: 600; }
.prose { max-width: 760px; }
.prose h1 { font: 800 clamp(40px, 6vw, 76px)/.9 var(--display); font-stretch: 65%; text-transform: uppercase; letter-spacing: -.03em; margin: 0 0 18px; }
.prose h2 { font: 800 30px/1 var(--display); font-stretch: 80%; text-transform: uppercase; margin: 64px 0 14px; padding-top: 18px; border-top: 1.5px solid var(--ink); scroll-margin-top: 16px; }
.prose h3 { font: 700 18px var(--body); margin: 28px 0 8px; }
.prose p, .prose li { color: var(--ink-2); }
.prose :not(pre) > code { background: var(--paper-2); border: 1px solid var(--rule); padding: 1px 5px; color: var(--ink); }
.prose pre.code { margin: 14px 0 6px; }
.prose table { width: 100%; border-collapse: collapse; font-size: 14px; margin: 12px 0; }
.prose th, .prose td { text-align: left; padding: 9px 8px; border-bottom: 1px solid var(--rule); vertical-align: top; }
.prose th { font: 500 11px var(--mono); text-transform: uppercase; letter-spacing: .06em; color: var(--grey); }
.prose .table-wrap { overflow-x: auto; }
.callout { border-left: 4px solid var(--pink); background: var(--paper-2); padding: 14px 16px; margin: 18px 0; font-size: 15px; }
.langs { display: flex; gap: 0; margin-top: 14px; }
.langs button { font: 500 12px var(--mono); background: transparent; border: 1.5px solid var(--ink); border-right-width: 0; padding: 6px 12px; cursor: pointer; color: var(--ink); }
.langs button:last-child { border-right-width: 1.5px; }
.langs button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.voucher .key { margin-top: 4px; }
.langs + pre.code { margin-top: 0; }

/* panel */
.btn {
  display: inline-flex; align-items: center; gap: 8px; font: 600 14px var(--body); padding: 10px 16px; cursor: pointer;
  background: var(--ink); color: var(--paper); border: 1.5px solid var(--ink); border-radius: 0;
}
.btn:hover { background: var(--pink); color: #111311; border-color: var(--pink); }
.btn.ghost { background: transparent; color: var(--ink); }
.btn.ghost:hover { background: var(--paper-2); color: var(--ink); border-color: var(--ink); }
.btn.danger { background: transparent; color: var(--pink-ink); border-color: var(--pink-ink); }
.btn.danger:hover { background: var(--pink-ink); color: var(--paper); }
.btn.sm { padding: 5px 10px; font-size: 12px; }
.btn:disabled { opacity: .5; cursor: wait; }
.field { display: grid; gap: 6px; }
.field label { font: 500 11px var(--mono); text-transform: uppercase; letter-spacing: .06em; color: var(--grey); }
.field input, .field textarea {
  font: 400 15px var(--body); color: var(--ink); background: var(--paper); border: 1.5px solid var(--ink); border-radius: 0; padding: 10px 12px; width: 100%;
}
.login { min-height: 76vh; display: grid; place-items: center; }
.login-card { width: min(420px, 100%); }
.login-card h1 { font: 800 clamp(40px, 9vw, 64px)/.9 var(--display); font-stretch: 62%; text-transform: uppercase; margin: 0 0 12px; }
.otp { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; margin: 26px 0 14px; }
.otp input { width: 100%; aspect-ratio: 3 / 4; text-align: center; font: 500 26px var(--mono); border: 1.5px solid var(--ink); background: var(--paper); color: var(--ink); border-radius: 0; }
.otp input:focus { outline: none; border-color: var(--pink); box-shadow: 0 0 0 3px var(--pink-soft); }
.err { color: var(--pink-ink); font-size: 14px; min-height: 1.4em; }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border: 1.5px solid var(--ink); margin: 18px 0 40px; }
.stats > div { padding: 16px 18px; border-right: 1px solid var(--rule); }
.stats > div:last-child { border-right: 0; }
.stats b { display: block; font: 800 34px/1 var(--display); font-stretch: 70%; margin-top: 8px; font-variant-numeric: tabular-nums; }
.create { display: grid; gap: 18px; justify-items: start; padding: 20px; background: var(--paper-2); border: 1.5px solid var(--ink); margin-bottom: 26px; }
.create-row { display: grid; grid-template-columns: 1fr 1.4fr; gap: 12px; width: 100%; }
.credit { width: 100%; }
.switch { display: inline-flex; align-items: center; gap: 12px; cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch-ui { width: 42px; height: 24px; border: 1.5px solid var(--ink); border-radius: 999px; position: relative; flex: none; background: var(--paper); transition: background .15s; }
.switch-ui::after { content: ""; position: absolute; top: 3px; left: 3px; width: 15px; height: 15px; border-radius: 50%; background: var(--ink); transition: transform .15s; }
.switch input:checked + .switch-ui { background: var(--pink); border-color: var(--pink); }
.switch input:checked + .switch-ui::after { transform: translateX(18px); background: #111311; }
.switch input:focus-visible + .switch-ui { outline: 2px solid var(--pink); outline-offset: 3px; }
.switch small { display: block; color: var(--grey); font-size: 13px; }
.profiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-top: 14px; }
.profile { cursor: pointer; display: flex; }
.profile input[type=radio] { position: absolute; opacity: 0; width: 1px; height: 1px; }
.profile-card { display: grid; align-content: start; gap: 6px; width: 100%; padding: 14px; border: 1.5px solid var(--rule); background: var(--paper); }
.profile-card b { font-size: 15px; }
.profile-amount { font: 800 26px/1 var(--display); font-stretch: 70%; display: flex; align-items: center; gap: 4px; }
.profile-amount input { width: 90px; font: 800 24px/1 var(--display); font-stretch: 70%; border: 0; border-bottom: 1.5px solid var(--ink); background: transparent; color: var(--ink); padding: 0 2px; }
.profile-card small { font-size: 13px; color: var(--grey); line-height: 1.4; }
.profile input[type=radio]:checked + .profile-card { border-color: var(--ink); box-shadow: inset 0 -4px 0 var(--pink); }
.profile input[type=radio]:focus-visible + .profile-card { outline: 2px solid var(--pink); outline-offset: 2px; }
.keys tr.editor td { background: var(--paper-2); padding: 18px; }
.keys tr.editor:hover { background: none; }
.board tr.group td { border-top: 1.5px solid var(--ink); }
.reveal { border: 2px solid var(--pink); background: var(--pink-soft); padding: 16px 18px; margin-bottom: 24px; }
.reveal code { display: block; font-size: 15px; margin: 8px 0 10px; overflow-wrap: anywhere; color: var(--ink); }
.keys td { font-size: 14px; }
.keys .spend { min-width: 150px; }
.keys input.inline { width: 80px; font: 400 13px var(--mono); padding: 4px 6px; border: 1px solid var(--rule); background: var(--paper); color: var(--ink); }
.state { font: 500 11px var(--mono); }
.state.on { color: var(--ok); }
.state.off { color: var(--pink-ink); }
.actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--ink); color: var(--paper); padding: 10px 16px; font-size: 14px; z-index: 9; }

@media (max-width: 900px) {
  .hero, .howto, .docs { grid-template-columns: 1fr; }
  .voucher { max-width: 460px; }
  .toc { position: static; display: none; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .stats > div:nth-child(2) { border-right: 0; }
  .stats > div:nth-child(-n+2) { border-bottom: 1px solid var(--rule); }
  .create-row { grid-template-columns: 1fr; }
  .profiles { grid-template-columns: 1fr 1fr; }
  .board .hide-sm { display: none; }
}
@media (max-width: 560px) {
  .nav { gap: 14px; font-size: 14px; white-space: nowrap; }
  .nav .hide-xs { display: none; }
  .mark { font-size: 18px; }
  .board .hide-xs { display: none; }
  .model { min-width: 0; gap: 10px; }
  .model small .prov { display: none; }
  .bar { min-width: 84px; }
  .logo { width: 30px; height: 30px; }
  .blurb { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
