/* CrossFit Diagonal · base: tokens, tipografía, botones, rótulos, apariciones.
   Concepto: el plano de Cerdà (manzanas achaflanadas, líneas de 1 px) cruzado por una única línea roja: la Diagonal. */

@font-face {
  font-family: "Bricolage";
  src: url("../fonts/bricolage-latin.woff2") format("woff2");
  font-weight: 200 800; font-stretch: 75% 100%; font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Bricolage";
  src: url("../fonts/bricolage-latin-ext.woff2") format("woff2");
  font-weight: 200 800; font-stretch: 75% 100%; font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Newsreader";
  src: url("../fonts/newsreader-italic-latin.woff2") format("woff2");
  font-style: italic; font-weight: 300 500; font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Newsreader";
  src: url("../fonts/newsreader-italic-latin-ext.woff2") format("woff2");
  font-style: italic; font-weight: 300 500; font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Plex Mono";
  src: url("../fonts/plexmono-latin.woff2") format("woff2");
  font-weight: 500; font-display: swap;
}

:root {
  --ink: #0d0d0c;
  --ink-2: #151513;
  --ink-3: #201f1d;
  --paper: #f0f0ee;
  --stone: #e3e2df;
  --red: #c51020;
  --red-deep: #801020;
  --muted-d: #565553;   /* texto secundario sobre claro (AA) */
  --muted-l: #a8a8a4;   /* texto secundario sobre oscuro (AA) */
  --line-d: rgba(13, 13, 12, .16);
  --line-dd: rgba(13, 13, 12, .38);
  --line-l: rgba(242, 239, 233, .16);
  --line-ll: rgba(242, 239, 233, .34);
  --display: "Bricolage", "Arial Narrow", Impact, sans-serif;
  --text: "Bricolage", system-ui, -apple-system, "Segoe UI", sans-serif;
  --serif: "Newsreader", Georgia, "Times New Roman", serif;
  --mono: "Plex Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  --gut: clamp(16px, 4vw, 56px);
  --header-h: 64px;
  --ease: cubic-bezier(.16, 1, .3, 1);
  --cut: 18px;
  --chamfer: polygon(var(--cut) 0, calc(100% - var(--cut)) 0, 100% var(--cut), 100% calc(100% - var(--cut)),
                     calc(100% - var(--cut)) 100%, var(--cut) 100%, 0 calc(100% - var(--cut)), 0 var(--cut));
  --grid-d: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='72' height='72'%3E%3Cpath d='M20 6h32l14 14v32L52 66H20L6 52V20Z' fill='none' stroke='%230d0d0c' stroke-opacity='.07'/%3E%3C/svg%3E");
  --grid-l: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='72' height='72'%3E%3Cpath d='M20 6h32l14 14v32L52 66H20L6 52V20Z' fill='none' stroke='%23f2efe9' stroke-opacity='.06'/%3E%3C/svg%3E");
}
@media (min-width: 1000px) { :root { --header-h: 76px; --cut: 22px; } }

*, *::before, *::after { box-sizing: border-box; }
html { overflow-x: clip; -webkit-text-size-adjust: 100%; scroll-padding-top: var(--header-h); }
html:not(.lenis) { scroll-behavior: smooth; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font-family: var(--text); font-size: 1rem; line-height: 1.55; font-weight: 400;
  font-optical-sizing: auto; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
img, svg { display: block; max-width: 100%; }
img { height: auto; }
a { color: inherit; }
h1, h2, h3, p, ul, ol, figure, blockquote { margin: 0; }
ul, ol { padding: 0; list-style: none; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--red); outline-offset: 3px; }
::selection { background: var(--red); color: #fff; }

/* Grano fino de papel (todo el documento, por encima de nada interactivo) */
body::after {
  content: ""; position: fixed; inset: 0; z-index: 90; pointer-events: none; opacity: .07; mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 .9 0'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
}

.wrap { width: 100%; max-width: 1480px; margin-inline: auto; padding-inline: var(--gut); }
.skip { position: absolute; left: 12px; top: -60px; z-index: 100; background: var(--red); color: #fff; padding: 12px 16px; }
.skip:focus { top: 12px; }

/* Secciones */
.sec { position: relative; padding-block: clamp(56px, 11vw, 168px); isolation: isolate; }
.sec--paper { background: var(--paper); color: var(--ink); }
.sec--stone { background: var(--stone); color: var(--ink); }
.sec--ink { background: var(--ink); color: var(--paper); }
.sec--paper::before, .sec--stone::before {
  content: ""; position: absolute; inset: 0; z-index: -1; background-image: var(--grid-d);
  -webkit-mask-image: linear-gradient(180deg, transparent, #000 30%, #000 70%, transparent);
  mask-image: linear-gradient(180deg, transparent, #000 30%, #000 70%, transparent);
}

/* Tipografía */
.display, h1, h2 {
  font-family: var(--display); font-weight: 800; font-stretch: 75%; text-transform: uppercase;
  line-height: .9; letter-spacing: -.012em; text-wrap: balance;
}
h1 em, h2 em, .serif {
  font-family: var(--serif); font-style: italic; font-weight: 400; text-transform: none; letter-spacing: -.01em;
}
.sec--paper h2 em, .sec--stone h2 em { color: var(--red); }

/* Rótulo de sección: número · manzana · texto (leyenda de plano) */
.lbl {
  display: flex; align-items: center; gap: 10px; margin-bottom: clamp(22px, 3vw, 40px);
  font-family: var(--mono); font-size: .75rem; letter-spacing: .14em; text-transform: uppercase; color: var(--muted-d);
}
.lbl b { color: var(--red); font-weight: 500; }
.lbl__blk { width: 14px; height: 14px; flex: none; color: currentColor; }
.lbl--light { color: var(--muted-l); }
.lbl--light b { color: #ef4a5c; }

/* Iconos */
.ico { width: 20px; height: 20px; flex: none; }
.ico--arrow { width: 16px; height: 16px; transition: transform .45s var(--ease); }

/* Botones (achaflanados como una manzana) */
.btn {
  --cut: 10px;
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 12px;
  min-height: 52px; padding: 0 22px; text-decoration: none; clip-path: var(--chamfer);
  font-family: var(--mono); font-size: .8rem; letter-spacing: .1em; text-transform: uppercase; font-weight: 500;
  transition: background-color .35s var(--ease), color .35s var(--ease);
}
.btn:hover .ico--arrow { transform: translate(3px, -3px); }
.btn--red { background: var(--red); color: #fff; }
.btn--red:hover { background: #a50d1e; }
.btn--ink { background: var(--ink); color: var(--paper); }
.btn--ink:hover { background: var(--red); }
.btn--ghost { color: var(--paper); background: transparent; }
.btn--ghost::before {
  content: ""; position: absolute; inset: 0; z-index: -1; background: var(--line-ll); clip-path: var(--chamfer);
}
.btn--ghost::after {
  content: ""; position: absolute; inset: 1px; z-index: -1; background: var(--ink); clip-path: var(--chamfer);
  transition: background-color .35s var(--ease);
}
.btn--ghost { isolation: isolate; }
.btn--ghost:hover::after { background: var(--ink-3); }

.link {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px;
  font-family: var(--mono); font-size: .75rem; letter-spacing: .1em; text-transform: uppercase;
}

/* Datos pendientes de confirmar */
.pending { display: inline-flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
.pending small, .pending-link small, .pending-dot {
  display: inline-block; font-family: var(--mono); font-size: .62rem; line-height: 1.3; letter-spacing: .06em;
  text-transform: uppercase; padding: 2px 6px; border: 1px dashed currentColor; color: var(--red-deep);
  font-weight: 500; white-space: nowrap; vertical-align: middle;
}
.sec--ink .pending small, .sec--ink .pending-link small, .sec--ink .pending-dot, .ftr .pending-link small,
.hdr .pending-link small, .rate .pending small { color: #f08a96; }
.pending-link { opacity: .9; cursor: not-allowed; text-decoration: none; }
.pending-link small { margin-left: 8px; }

/* Apariciones: solo con JS; si algo falla, .reveal-all lo muestra todo */
.js [data-reveal] {
  opacity: 0; transform: translate3d(0, 28px, 0);
  transition: opacity 1s var(--ease), transform 1.1s var(--ease); transition-delay: var(--d, 0ms);
}
.js [data-reveal].is-in, .reveal-all [data-reveal] { opacity: 1; transform: none; }
[data-draw] path { stroke-dasharray: 1; stroke-dashoffset: 0; }
.js [data-draw] path { stroke-dashoffset: 1; transition: stroke-dashoffset 1.8s var(--ease) .15s; }
.js [data-draw].is-in path, .reveal-all [data-draw] path { stroke-dashoffset: 0; }

@media (prefers-reduced-motion: reduce) {
  html:not(.lenis) { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; transition-delay: 0ms !important; }
  .js [data-reveal] { opacity: 1; transform: none; }
  .js [data-draw] path { stroke-dashoffset: 0; }
}
