/* Kontus mockup, built to the brand guide v1.0.
   The page numbers in the comments are the guide's pages. Rules that come straight from it:
   ink + paper + one red that only means "No cuadra" (11, 12) · no gradients, glows, shadows, rounded corners (12, 7)
   three fonts, one job each (13) · type scale (14) · 12 columns, 8 px steps, rules not boxes (15). */

:root {
  --ink: #0F0F0D;         /* Tinta */
  --ink-up: #1A1A17;      /* Tinta alta: panels on dark */
  --paper: #F2EEE6;       /* Papel */
  --paper-deep: #E8E3D8;  /* Papel hondo */
  --sheet: #FBF9F4;       /* the printed sheet lying on paper, as drawn on page 20 */
  --red: #B92B18;         /* Rojo: "No cuadra" on paper, nothing else */
  --red-on-ink: #FF5C45;  /* Rojo claro: "No cuadra" on ink */
  --pencil: #66635C;      /* Lápiz: secondary text on paper, "sin comprobar" */
  --stone: #A5A198;       /* Piedra: secondary text on ink */
  --rule: #CFC9BA;        /* thin separating lines on paper */
  --rule-ink: #3A3934;    /* thin separating lines on ink */

  --serif: "Ibarra Real Nova", Georgia, serif;                      /* the voice */
  --sans: "Schibsted Grotesk", system-ui, -apple-system, sans-serif; /* the interface */
  --mono: "Spline Sans Mono", ui-monospace, Consolas, monospace;    /* the proof */

  --margin: 64px;
  --ease: cubic-bezier(.2, .7, .2, 1);

  /* the colours a block uses; .ink flips them */
  --bg: var(--paper); --fg: var(--ink); --fg-2: var(--pencil); --line: var(--rule); --no: var(--red);
}
.ink { --bg: var(--ink); --fg: var(--paper); --fg-2: var(--stone); --line: var(--rule-ink); --no: var(--red-on-ink); }

*, *::before, *::after { box-sizing: border-box; }
html { background: var(--paper); -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; font: 400 16px/1.55 var(--sans); color: var(--ink); background: var(--paper); }
h1, h2, h3, p, ol, ul, dl, dd, figure, table { margin: 0; }
ol, ul { padding: 0; list-style: none; }
a { color: inherit; }
em { font: italic 400 1.07em/1 var(--serif); letter-spacing: 0; }   /* the one Ibarra accent per headline */
.num { font-family: var(--mono); font-variant-numeric: tabular-nums; }
:focus-visible { outline: 2px solid currentColor; outline-offset: 3px; }

.ink, .sec { background: var(--bg); color: var(--fg); }
.wrap { width: 100%; max-width: calc(1280px + 2 * var(--margin)); margin-inline: auto; padding-inline: var(--margin); }

/* ---- logo (page 8): symbol + wordmark in Ibarra Real Nova SemiBold capitals. Symbol width = 1.9 x cap height ---- */
.logo { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; color: var(--fg); }
.logo__word { font: 600 24px/1 var(--serif); letter-spacing: .2em; margin-right: -.2em; }
.logo__mark { width: 48px; height: 21.6px; fill: currentColor; flex: none; }   /* sized as drawn on pages 8 and 19 */
.logo--small .logo__word { font-size: 17px; }
.logo--small .logo__mark { width: 36px; height: 16.2px; }

/* ---- verdict marks (page 10): whole = cuadra, cut with red = no cuadra, dashed = sin comprobar ---- */
.mark { width: 28px; height: 12.6px; fill: currentColor; flex: none; }
.mark .red { fill: var(--no); }
.mark .dash { fill: none; stroke: var(--fg-2); stroke-width: 6; stroke-dasharray: 12 8; }
.v { display: inline-flex; align-items: center; gap: 10px; font: italic 400 19px/1.1 var(--serif); color: var(--fg); white-space: nowrap; }
.v--red { color: var(--no); }
.v--red .mark { color: var(--fg); }
.v--pencil, .pencil .v { color: var(--fg-2); }
.v--small { margin-top: 12px; }

/* ---- buttons: ink on paper or paper on ink, square ---- */
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 20px; font: 400 15px/1 var(--sans); text-decoration: none; color: var(--fg); border: 1px solid var(--fg-2); transition: background .2s, color .2s, border-color .2s; white-space: nowrap; }
.btn:hover, .btn--solid { background: var(--fg); color: var(--bg); border-color: var(--fg); }
.btn--solid { min-height: 56px; padding: 0 32px; font-size: 16px; font-weight: 600; }
.btn--solid:hover { background: transparent; color: var(--fg); }

/* ---- small text ---- */
.label { font: 400 13px/1.45 var(--mono); color: var(--fg-2); margin-bottom: 24px; }
.caption { font: 400 13px/1.45 var(--sans); color: var(--fg-2); }
.lead { font-size: 18px; line-height: 1.5; color: var(--fg-2); max-width: 54ch; }

/* ---- HERO: the hero is the sum, laid out like a page of an accounts book ---- */
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.hero__pin { position: relative; display: flex; flex-direction: column; }
.hero__lines { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; display: none; }
.nav { position: relative; display: flex; align-items: center; gap: 32px; padding-block: clamp(16px, 3svh, 32px); }
.nav__id { display: flex; align-items: center; gap: 24px; }
.nav__tag { font: italic 400 17px/1.2 var(--serif); color: var(--fg-2); }   /* who it is for, beside the name */
.nav__links { display: flex; gap: 32px; margin-left: auto; font-size: 15px; }
.nav__links a { text-decoration: none; color: var(--fg-2); transition: color .2s; }
.nav__links a:hover { color: var(--fg); }

.sky { display: none; }                      /* the wallets' sky exists only while the scene runs */

/* the ledger: the entries, the two bars of the symbol, then the result line. One bar's height between the bars,
   as in the symbol (page 7) */
.ledger { --bar: clamp(14px, 1.6vw, 20px); padding-top: 48px; padding-bottom: clamp(20px, 4svh, 40px); }
.ledger__rows { display: flex; align-items: flex-end; gap: 6px; margin-bottom: 10px; font-size: 12px; line-height: 1.4; color: var(--fg-2); }
.ledger__rows li { display: flex; flex-direction: column; flex: 1 1 0; min-width: 0; }   /* page.js makes each entry as wide as its segment */
.ledger__rows b { font-weight: 400; color: var(--fg); }
.ledger__rows .net { display: block; }   /* wide screens: wallet, network, amount on three lines, so a narrow entry never breaks mid-name */
.bar { display: flex; gap: 6px; height: var(--bar); }
.bar i { display: block; background: var(--fg); transform-origin: 0 0; will-change: transform; }
.bar--top i { flex: 0 1 auto; }
.bar--bottom { position: relative; margin-top: var(--bar); }
.bar--bottom i { position: relative; flex: 1; }
.scene .bar--bottom::before { content: ""; position: absolute; inset: 0; border: 1px dashed var(--fg-2); }   /* "sin comprobar" until the network fills it */

/* the result line: the headline on the left, the total with its double rule on the right. The headline follows the
   screen's height as well as its width, never above the guide's largest size (Display 96, page 14) */
.ledger__sum { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px 32px; padding-top: clamp(14px, 2.6svh, 28px); }
h1 { font: 600 clamp(44px, min(6.2vw, 11svh), 96px)/.95 var(--sans); letter-spacing: -.035em; }
h1 .line { display: inline-block; overflow: hidden; padding-bottom: .12em; margin-bottom: -.12em; vertical-align: bottom; }
h1 .line > span { display: block; }
.ledger__total { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; padding-bottom: .1em; }
.total { font-size: clamp(21px, 2.4vw, 32px); line-height: 1.2; white-space: nowrap; }
.verdict { font: italic 400 21px/1.2 var(--serif); white-space: nowrap; }
.ledger__foot { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-top: clamp(14px, 2.6svh, 28px); }
.ledger__foot .lead { max-width: 46ch; }
.ledger__foot .caption { font-family: var(--mono); font-size: 12px; white-space: nowrap; }

/* the double rule: only under a proven total (pages 14, 16). It draws from the left. */
.rule2 { position: relative; display: inline-block; padding-bottom: 12px; }
.rule2::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 7px; border-block: 2px solid currentColor; transform: scaleX(var(--rule, 1)); transform-origin: 0 50%; }

/* with script and motion allowed, the hero is a tall scene: it stays on screen while the sum builds (page.js) */
.scene .hero { height: 260svh; }
.scene .hero__pin { position: sticky; top: 0; height: 100svh; overflow: hidden; }
.scene .hero__lines { display: block; }
.scene .sky { display: block; flex: 1; min-height: 0; }
.scene .ledger { padding-top: 0; }
@media (prefers-reduced-motion: no-preference) {
  .js [data-rise] { opacity: 0; animation: appear .9s var(--ease) forwards; animation-delay: calc(120ms + var(--i) * 110ms); }   /* the words appear in place; nothing slides */
  @keyframes appear { to { opacity: 1; } }
}

/* ---- sections ---- */
.sec { position: relative; padding-block: clamp(96px, 11vw, 160px); }
/* the rules are drawn lines (not borders) so they can grow from the left when they come on screen (see the end) */
.sec::before { content: ""; position: absolute; top: 0; left: 0; right: 0; border-top: 1px solid var(--line); }
h2 { font: 600 clamp(36px, 4.4vw, 56px)/1 var(--sans); letter-spacing: -.03em; max-width: 18ch; text-wrap: balance; }
h2 + .lead { margin-top: 24px; }
h3 { font: 600 21px/1.3 var(--sans); letter-spacing: -.01em; }
.display { font: 600 clamp(44px, 7vw, 96px)/.95 var(--sans); letter-spacing: -.035em; max-width: 14ch; text-wrap: balance; }
.num-serif { font-variant-numeric: lining-nums; }
s { text-decoration-thickness: 1px; }

/* 01 pairs */
.pairs, .fixes { position: relative; margin-top: 64px; }
.pairs::before, .fixes::before { content: ""; position: absolute; top: 0; left: 0; right: 0; border-top: 1px solid var(--fg); }
.pairs li, .fixes li { position: relative; }
.pairs li::after, .fixes li::after { content: ""; position: absolute; bottom: 0; left: 0; right: 0; border-top: 1px solid var(--line); }
.pairs li { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 3fr) minmax(0, 4fr); align-items: center; gap: 24px; padding: 20px 0; }
.route { font: 600 21px/1.3 var(--sans); letter-spacing: -.01em; }
.to { color: var(--fg-2); font-weight: 400; padding-inline: 6px; }
.pairs b { font-weight: 400; font-size: 15px; }
.pairs .v { justify-self: end; }
.pairs .pencil .route { color: var(--fg-2); }
.pairs + .caption { margin-top: 24px; }

/* 02 one case's time log: one line across the page, the time above it, the entry below. The columns touch, so their
   lines join into one */
.log { --t: clamp(24px, 2.4vw, 32px); --at: calc(var(--t) * 1.2 + 16px); margin-top: 64px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.log li { position: relative; padding-right: 24px; }
.log__t { font-size: var(--t); line-height: 1.2; height: var(--at); }
.log li::before { content: ""; position: absolute; top: var(--at); left: 0; right: 0; border-top: 1px solid var(--fg); }
.log li::after { content: ""; position: absolute; top: calc(var(--at) - 4px); left: 0; height: 9px; border-left: 1px solid var(--fg); }   /* the tick where the entry starts */
.log h3 { margin: 24px 0 8px; }
.log li > p:not(.log__t):not(.v) { color: var(--fg-2); }
.log__note { margin-top: 32px; }
.compare { margin-top: 24px; font-size: 14px; }
.compare div { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 8px 0; border-top: 1px solid var(--line); }
.compare dt { font-family: var(--sans); color: var(--fg-2); }
.compare .rule2 { padding-bottom: 10px; }

/* 03 the Hoja: always paper, never dark (page 20) */
.hoja { display: grid; grid-template-columns: minmax(0, 6fr) minmax(0, 5fr); gap: 24px clamp(48px, 7vw, 96px); align-items: center; }
.sheet { background: var(--sheet); border: 1px solid var(--rule); padding: clamp(24px, 4vw, 48px); }
.sheet__head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.sheet__meta { font-size: 11px; line-height: 1.5; color: var(--pencil); text-align: right; }
.sheet__kicker { margin-top: 48px; font: italic 400 17px/1.2 var(--serif); color: var(--pencil); }
.sheet__title { margin-top: 8px; font: 600 clamp(26px, 3vw, 36px)/1.05 var(--sans); letter-spacing: -.03em; }
.sheet__sub { margin-top: 12px; font-size: 13px; color: var(--pencil); }
.sheet__table { width: 100%; margin-top: 24px; border-collapse: collapse; border-top: 1px solid var(--rule); font-size: 14px; }
.sheet__table thead th { font: 400 12px/1.45 var(--sans); color: var(--pencil); padding: 20px 0 8px; border-bottom: 2px solid var(--ink); }
.sheet__table th { text-align: left; font-weight: 600; }
.sheet__table th + th, .sheet__table td { text-align: right; }
.sheet__table tbody th, .sheet__table td { padding: 12px 0; border-bottom: 1px solid var(--rule); }
.sheet__table td { padding-left: 12px; }
.sheet__table .dim { color: var(--pencil); }
.sheet__table .v { font-size: 17px; vertical-align: middle; }
.frame { margin-top: 24px; padding: 16px; border: 1px dashed var(--fg-2); font-size: 13px; line-height: 1.45; color: var(--fg-2); }   /* the pencil frame: anything provisional */
.frame__t { font: italic 400 17px/1.2 var(--serif); color: var(--fg); margin-bottom: 6px; }
.sheet__foot { display: flex; justify-content: space-between; gap: 16px; margin-top: 64px; padding-top: 12px; border-top: 1px solid var(--rule); font-size: 11px; color: var(--pencil); }
.eq { margin-top: 32px; }
.eq li { position: relative; padding: 0 0 16px 28px; font-size: 18px; line-height: 1.5; }
.eq li::before { content: ""; position: absolute; left: 0; top: .52em; width: 14px; height: 7px; border-block: 2px solid currentColor; }   /* the guide's own equals-sign bullet */

/* 04 statement */
.sec--statement::before { content: none; }
.sec--statement .caption { margin-top: 32px; }

/* 05 fixes */
.fixes li { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 24px; padding: 24px 0; }
.fixes b { display: block; font: 600 21px/1.3 var(--sans); letter-spacing: -.01em; }
.fixes span { display: block; margin-top: 4px; color: var(--fg-2); }
.fix__before b { color: var(--fg-2); font-weight: 400; }

/* 06 never */
.never { margin-top: 64px; display: grid; grid-template-columns: 1fr 1fr; gap: 48px 24px; }
.never li { position: relative; padding-top: 16px; }
.never li::before { content: ""; position: absolute; top: 0; left: 0; right: 0; border-top: 1px solid var(--fg); }
.never p { margin-top: 8px; color: var(--fg-2); max-width: 44ch; }

/* close + footer (ink) */
.cta { padding-top: clamp(96px, 13vw, 200px); }
/* the book's final line: one rule, then the sentence and the button on the same line */
.cta__line { position: relative; display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 24px 48px; padding-top: 32px; }
.cta__line::before { content: ""; position: absolute; top: 0; left: 0; right: 0; border-top: 1px solid var(--fg); }
.cta__t { max-width: none; }
.cta__lead { margin-top: 24px; }
.frame--line { display: inline-block; margin-top: 32px; }
.cta__mail { margin-top: 16px; color: var(--fg-2); }
.cta__mail a { color: var(--fg); }
.footer { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 32px; margin-top: clamp(96px, 12vw, 160px); padding-block: 32px; position: relative; }
.footer::before { content: ""; position: absolute; top: 0; left: var(--margin); right: var(--margin); border-top: 1px solid var(--line); }
.footer nav { display: flex; flex-wrap: wrap; gap: 24px; font-size: 14px; }
.footer nav a { text-decoration: none; color: var(--fg-2); }
.footer nav a:hover { color: var(--fg); }
.footer__tag { margin-left: auto; font: italic 400 21px/1 var(--serif); }

/* once, when things come on screen (page.js adds .in): the rule draws from the left first, then the words appear
   in place. Nothing slides */
@media (prefers-reduced-motion: no-preference) {
  .js .sec::before, .js [data-reveal]::before, .js [data-reveal] > *::before, .js [data-reveal] > *::after, .js .cta__line::before {
    transform: scaleX(0); transform-origin: 0 50%; transition: transform .8s var(--ease); transition-delay: calc(var(--i, 0) * 90ms);
  }
  .js .sec.in::before, .js [data-reveal].in::before, .js [data-reveal].in > *::before, .js [data-reveal].in > *::after, .js .cta__line.in::before { transform: none; }
  .js [data-reveal] > * > *, .js .cta__line > * { opacity: 0; transition: opacity .6s var(--ease); transition-delay: calc(.35s + var(--i, 0) * 90ms); }
  .js [data-reveal].in > * > *, .js .cta__line.in > * { opacity: 1; }
  .js .sec h2, .js .display, .js .sheet { opacity: 0; transition: opacity .8s var(--ease) .15s; }
  .js .sec h2.in, .js .display.in, .js .sheet.in { opacity: 1; }
  .js .rule2.on::after { transform: scaleX(0); transition: transform .9s var(--ease) .3s; }
  .js [data-reveal].in .rule2.on::after, .js .rule2.on.in::after { transform: scaleX(1); }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

/* ---- small screens: side margins 24 px (page 15) ---- */
@media (max-width: 899px) {
  :root { --margin: 24px; }
  .nav__links { display: none; }
  .nav { justify-content: space-between; padding-block: 20px; }
  .nav__id { flex-direction: column; align-items: flex-start; gap: 4px; }
  .nav__tag { font-size: 15px; }
  h1 { font-size: clamp(40px, min(13vw, 8svh), 80px); }
  h1 .line { display: block; }               /* two lines: "Cripto que / cuadra." */
  .ledger__rows { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2px 24px; }
  .ledger__rows li { flex-direction: row; justify-content: space-between; gap: 12px; }
  .ledger__rows .net { display: inline; }
  .ledger__rows .net::before { content: "· "; }
  .ledger__sum { flex-direction: column; align-items: flex-start; }
  .ledger__total { flex-direction: row; flex-wrap: wrap; align-items: baseline; gap: 4px 16px; }
  .ledger__foot { flex-direction: column; align-items: flex-start; gap: 8px; }
  .ledger__foot .lead { font-size: 16px; }
  .pairs li { grid-template-columns: 1fr auto; gap: 8px 16px; }
  .pairs .v { grid-column: 1 / -1; justify-self: start; }
  .log { grid-template-columns: 1fr 1fr; row-gap: 48px; }
  .hoja { grid-template-columns: 1fr; }
  .hoja__text { order: -1; }
  .fixes li, .never { grid-template-columns: 1fr; }
  .footer__tag { margin-left: 0; }
}
@media (max-width: 560px) {
  .scene .ledger__rows { display: none; }   /* phones: while the scene holds the screen, the bars + total tell it; the entries return without the scene */
  /* phones: the time log runs down the page, its line on the left */
  .log { grid-template-columns: 1fr; row-gap: 0; }
  .log li { padding: 0 0 32px 32px; }
  .log__t { height: auto; }
  .log li::before { top: 0; bottom: 0; right: auto; border-top: 0; border-left: 1px solid var(--fg); }
  .log li::after { top: calc(var(--t) * .6); height: 0; width: 16px; border-left: 0; border-top: 1px solid var(--fg); }
  .log h3 { margin-top: 8px; }
  .sheet__table { font-size: 12px; }
  .sheet__table .v { font-size: 15px; gap: 6px; }
  .sheet__table .mark { width: 24px; height: 10.8px; }
  /* phones: the sample sheet fits the screen. Each coin is one line (name, our total, the network's), and its
     result sits under it, so no column is squeezed and nothing scrolls sideways (24 Nov 2026) */
  .hoja { grid-template-columns: minmax(0, 1fr); }
  .sheet { padding: 20px 16px; }
  .sheet__table tr { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; column-gap: 12px; align-items: baseline; border-bottom: 1px solid var(--rule); }
  .sheet__table thead tr { border-bottom: 2px solid var(--ink); }
  .sheet__table thead th { border-bottom: 0; }
  .sheet__table thead th:last-child { display: none; }
  .sheet__table tbody th, .sheet__table td { border-bottom: 0; padding: 12px 0 0; }
  .sheet__table td:last-child { grid-column: 1 / -1; text-align: left; padding: 6px 0 12px; }
  .sheet__meta, .sheet__foot { font-size: 12px; }
  .sheet__foot { flex-wrap: wrap; gap: 4px 16px; }
  .cta__mail { overflow-wrap: anywhere; }
}
@media (max-width: 899px) {   /* phones and tablets (thumbs): every link is at least 44 px tall to tap */
  .footer nav { gap: 0 24px; }
  .footer nav a { display: inline-flex; align-items: center; min-height: 44px; }
  .nav .logo { min-height: 44px; }
}
@media (max-width: 560px) and (prefers-reduced-motion: no-preference) {
  .js .log li::before { transform: scaleY(0); transform-origin: 50% 0; }   /* the phone's line draws downwards */
}
@media (max-width: 400px) {   /* small phones: the name and the button must share one line */
  .nav { gap: 12px; }
  .nav .logo { gap: 8px; }
  .nav .logo__word { font-size: 19px; }
  .nav .logo__mark { width: 36px; height: 16.2px; }
  .nav .btn { padding: 0 14px; font-size: 14px; }
}
