/* ==========================================================================
   PARK-TECH GT — Presentación web (estilo cuaderno editorial)
   ========================================================================== */

/* ---------- Fuentes locales ---------- */
@font-face {
  font-family: "Playfair Display";
  src: url("assets/fonts/playfair-display-700.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Playfair Display";
  src: url("assets/fonts/playfair-display-700-italic.woff2") format("woff2");
  font-weight: 700;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("assets/fonts/inter-variable.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("assets/fonts/jetbrains-mono-500.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

/* ---------- Tokens ---------- */
:root {
  --paper: #F5EFE3;
  --paper-2: #FBF7EF;
  --ink: #1C1A17;
  --text: #3A3631;
  --muted: #8A8278;
  --accent: #E0904A;
  --accent-ink: #B86A28;
  --line: #E6DDCC;
  --frame: #1E1E1E;

  --accent-soft: rgba(224, 144, 74, 0.16);
  --accent-wash: rgba(224, 144, 74, 0.07);
  --shadow-frame: 0 34px 60px -34px rgba(60, 40, 15, 0.5), 0 2px 6px rgba(60, 40, 15, 0.08);
  --grain-opacity: 0.06;

  --serif: "Playfair Display", Georgia, "Times New Roman", serif;
  --sans: "Inter", "DM Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", "IBM Plex Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;

  --container: 1200px;
  --pad-y: clamp(4rem, 10vh, 8rem);
  --gutter: clamp(1rem, 4vw, 3rem);
  --dots-space: 0px;

  --noise: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.25  0 0 0 0 0.2  0 0 0 0 0.12  0 0 0 0.55 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");

  color-scheme: light;
}

:root[data-theme="dark"] {
  --paper: #1A1815;
  --paper-2: #23201C;
  --ink: #F2ECE1;
  --text: #D8D0C3;
  --muted: #9A9184;
  --accent: #E0904A;
  --accent-ink: #EBA568;
  --line: #3A342D;
  --frame: #0C0B0A;
  --accent-soft: rgba(224, 144, 74, 0.2);
  --accent-wash: rgba(224, 144, 74, 0.09);
  --shadow-frame: 0 34px 60px -30px rgba(0, 0, 0, 0.7), 0 2px 6px rgba(0, 0, 0, 0.3);
  --grain-opacity: 0.1;
  color-scheme: dark;
}

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

html {
  scroll-behavior: smooth;
  scroll-snap-type: y proximity;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--text);
  font-family: var(--sans);
  font-size: clamp(1.15rem, 1.6vw, 1.6rem);
  line-height: 1.45;
  overflow-x: hidden;
  font-variant-numeric: lining-nums;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background-color .3s ease, color .3s ease;
}

/* grano de papel sobre toda la página */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: var(--noise);
  opacity: var(--grain-opacity);
  z-index: 0;
}

img, svg, video { max-width: 100%; }
strong, b { color: var(--ink); font-weight: 600; }
a { color: inherit; }
code, .mono { font-family: var(--mono); font-size: .88em; font-weight: 500; }
code { color: var(--ink); white-space: nowrap; }
p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

.nowrap { white-space: nowrap; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---------- Secciones ---------- */
main { position: relative; z-index: 1; }

.section {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  padding: var(--pad-y) calc(var(--gutter) + var(--dots-space)) var(--pad-y) var(--gutter);
  scroll-snap-align: start;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.section + .section { border-top: 1px solid var(--line); }

.container { width: 100%; max-width: var(--container); margin: 0 auto; }

.eyebrow {
  font-family: var(--mono);
  font-size: .75rem;
  font-weight: 500;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--accent-ink);
  margin: 0 0 1.25rem;
}

.title {
  font-family: var(--serif);
  font-weight: 700;
  font-size: clamp(3rem, 7vw, 6rem);
  line-height: 1;
  letter-spacing: -.02em;
  color: var(--ink);
  margin: 0 0 1.5rem;
  text-wrap: balance;
}
.title em, .sub em, .quote em { font-style: italic; color: var(--accent); }

.lede {
  max-width: 62ch;
  margin: 0 0 clamp(2rem, 5vh, 3.5rem);
  text-wrap: pretty;
}

.sub {
  font-family: var(--serif);
  font-weight: 700;
  font-size: clamp(1.6rem, 2.4vw, 2.3rem);
  line-height: 1.1;
  letter-spacing: -.01em;
  color: var(--ink);
  margin: 0 0 1rem;
}

.label {
  display: block;
  font-family: var(--mono);
  font-size: .75rem;
  font-weight: 500;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--muted);
}

.small { font-size: clamp(1rem, 1.15vw, 1.2rem); line-height: 1.5; }
.note { font-size: clamp(.92rem, 1vw, 1.05rem); color: var(--muted); line-height: 1.5; max-width: 80ch; }
.note strong { color: var(--text); }

.stack > * + * { margin-top: clamp(1.25rem, 3vh, 2rem); }

/* secciones que deben caber en una pantalla (video, capturas) */
.section.tight { --pad-y: clamp(2rem, 6vh, 4.5rem); }
.head-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem 3rem;
  margin-bottom: clamp(1.5rem, 3.5vh, 2.5rem);
}
.head-row .title, .head-row .lede { margin: 0; }
.head-row .lede { max-width: 34ch; padding-bottom: .5rem; font-size: clamp(1rem, 1.25vw, 1.3rem); }
.video-nb { width: min(100%, calc((100vh - 27rem) * 16 / 9 + 5rem)); margin-inline: auto; }
.block { margin-top: clamp(2.5rem, 6vh, 4.5rem); }

/* ---------- Rejillas ---------- */
.grid-2, .grid-3, .grid-4, .split, .split-even {
  display: grid;
  gap: clamp(1rem, 2.4vw, 2rem);
}
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.split { grid-template-columns: minmax(0, 1.2fr) minmax(0, .8fr); align-items: start; }
.split-even { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; }

/* ---------- Tarjetas ---------- */
.card {
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: clamp(1.25rem, 2.2vw, 2rem);
}
.card .label { margin-bottom: .8rem; }
.quote {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 700;
  font-size: clamp(1.3rem, 1.9vw, 1.85rem);
  line-height: 1.15;
  color: var(--accent);
  margin: 0 0 .75rem;
}
.quote.mono-q {
  font-family: var(--mono);
  font-style: normal;
  font-weight: 500;
  font-size: clamp(1.05rem, 1.4vw, 1.35rem);
  color: var(--accent-ink);
  line-height: 1.35;
}
.card p:not(.quote) { font-size: clamp(1rem, 1.15vw, 1.2rem); line-height: 1.5; }

.chips { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1rem; }
.chip {
  font-family: var(--mono);
  font-size: .9rem;
  padding: .35em .7em;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
  color: var(--ink);
}
.chip b { color: var(--accent-ink); }

/* ---------- Carátula ---------- */
.cover {
  --pad-y: clamp(2rem, 6vh, 5rem);
  text-align: center;
}
.cover .container { display: flex; flex-direction: column; align-items: center; }
.cover .eyebrow { margin-bottom: clamp(1rem, 2.5vh, 1.75rem); }
.crest {
  width: clamp(140px, 23vh, 260px);
  height: auto;
  margin: 0 auto clamp(1rem, 3vh, 2rem);
  filter: drop-shadow(0 18px 28px rgba(60, 40, 15, .22));
}
.cover .kicker {
  font-family: var(--mono);
  font-size: .8rem;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 .75rem;
}
.cover .title { font-size: clamp(3.2rem, 8.5vw, 7.5rem); margin-bottom: 1rem; }
.cover .lede { margin: 0 auto clamp(1.5rem, 4vh, 2.5rem); max-width: 40ch; }

.team {
  list-style: none;
  padding: 0;
  margin: 0;
  width: 100%;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(.75rem, 1.4vw, 1.25rem);
}
.member {
  position: relative;
  text-align: left;
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: clamp(.9rem, 1.6vw, 1.3rem) clamp(.9rem, 1.4vw, 1.2rem);
  overflow: hidden;
}
.member::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--accent);
  opacity: .85;
}
.member-name {
  display: block;
  font-family: var(--serif);
  font-weight: 700;
  font-size: clamp(1.02rem, 1.3vw, 1.35rem);
  line-height: 1.15;
  color: var(--ink);
}
.member-id {
  display: block;
  margin-top: .55rem;
  font-family: var(--mono);
  font-size: .78rem;
  letter-spacing: .12em;
  color: var(--accent-ink);
}
.member-id span { color: var(--muted); }

.cover .meta {
  margin: clamp(1.25rem, 3.5vh, 2rem) 0 0;
  font-family: var(--mono);
  font-size: .75rem;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--muted);
}
.cover .meta span + span::before { content: "·"; margin: 0 .8em; color: var(--accent); }

.scroll-hint {
  position: absolute;
  left: 50%;
  bottom: clamp(.75rem, 2.5vh, 1.5rem);
  transform: translateX(-50%);
  font-family: var(--mono);
  font-size: .7rem;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
}
.scroll-hint kbd { font-family: inherit; border: 1px solid var(--line); border-radius: 4px; padding: .1em .45em; background: var(--paper-2); color: var(--ink); }

/* ---------- Marco cuaderno ---------- */
.nb {
  position: relative;
  margin: 0;
  background-color: var(--paper-2);
  background-image: var(--noise);
  background-blend-mode: multiply;
  border-radius: 14px;
  border-top: 10px solid var(--frame);
  box-shadow: var(--shadow-frame);
  padding: clamp(.8rem, 1.5vw, 1.4rem) clamp(.8rem, 1.5vw, 1.4rem) clamp(.8rem, 1.2vw, 1.1rem) clamp(2.4rem, 3.8vw, 3.4rem);
  isolation: isolate;
}
:root[data-theme="dark"] .nb { background-blend-mode: normal; }
/* lomo con sombra interior */
.nb::before {
  content: "";
  position: absolute;
  top: 0; bottom: 0;
  left: clamp(1.75rem, 2.8vw, 2.5rem);
  width: 1px;
  background: var(--line);
  box-shadow: -10px 0 14px -10px rgba(0, 0, 0, .22);
  z-index: -1;
}
/* espiral */
.nb::after {
  content: "";
  position: absolute;
  top: 16px; bottom: 16px;
  left: clamp(.5rem, .9vw, .8rem);
  width: 14px;
  background: radial-gradient(circle at 7px 8px, transparent 2.6px, var(--frame) 3px, var(--frame) 4.6px, transparent 5px) 0 0 / 14px 24px repeat-y;
  opacity: .75;
  z-index: -1;
}
.nb img, .nb video {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: #fff;
}
.nb video { aspect-ratio: 16 / 9; background: #000; object-fit: contain; }
.nb figcaption, .fig-cap {
  margin-top: .9rem;
  font-family: var(--mono);
  font-size: .75rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
  line-height: 1.55;
}
.nb figcaption b, .fig-cap b { color: var(--ink); font-weight: 500; }
.nb .diagram-wrap { background: var(--paper); border: 1px solid var(--line); border-radius: 8px; padding: clamp(.5rem, 1.2vw, 1rem); }

.zoomable { cursor: zoom-in; transition: transform .25s ease, box-shadow .25s ease; }
.zoomable:hover { transform: translateY(-2px); box-shadow: 0 10px 24px -14px rgba(0, 0, 0, .35); }
.zoom-wrap { position: relative; display: block; padding: 0; border: 0; background: none; width: 100%; cursor: zoom-in; border-radius: 6px; }
.zoom-wrap .zoom-tag {
  position: absolute; right: .6rem; top: .6rem;
  font-family: var(--mono); font-size: .65rem; letter-spacing: .14em; text-transform: uppercase;
  background: rgba(28, 26, 23, .82); color: #F5EFE3; padding: .35em .6em; border-radius: 6px;
  opacity: 0; transition: opacity .2s ease;
}
.zoom-wrap:hover .zoom-tag, .zoom-wrap:focus-visible .zoom-tag { opacity: 1; }

.figs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(1.25rem, 2.6vw, 2.25rem); align-items: start; }

.video-bar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-top: .9rem; }
.video-bar figcaption { margin: 0; }

/* ---------- Botones ---------- */
.btn {
  display: inline-flex; align-items: center; gap: .6em;
  font-family: var(--mono); font-size: .75rem; font-weight: 500; letter-spacing: .14em; text-transform: uppercase;
  padding: .85em 1.25em; border-radius: 999px;
  background: var(--ink); color: var(--paper);
  border: 1px solid var(--ink); text-decoration: none; cursor: pointer;
  transition: background-color .2s ease, color .2s ease, border-color .2s ease;
}
.btn:hover { background: var(--accent-ink); border-color: var(--accent-ink); color: #fff; }
.btn-ghost { background: transparent; color: var(--ink); }
.btn svg { width: 1.1em; height: 1.1em; }

/* ---------- Tablas ---------- */
.table-wrap {
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: .35rem clamp(.5rem, 1.2vw, 1.1rem);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.table-title { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin: 0 0 .75rem; }

table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: clamp(.95rem, 1.05vw, 1.12rem);
  line-height: 1.38;
}
table.data th {
  font-family: var(--mono);
  font-size: .7rem;
  font-weight: 500;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--muted);
  text-align: left;
  padding: .95rem .8rem .7rem;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
  vertical-align: bottom;
}
table.data td {
  padding: .62rem .8rem;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
table.data tbody tr:last-child td { border-bottom: 0; }
table.data tbody tr { transition: background-color .15s ease; }
table.data tbody tr:hover { background: var(--accent-wash); }
table.data .c { text-align: center; }
table.data td.mono { font-family: var(--mono); font-size: .92em; color: var(--ink); white-space: nowrap; }
table.data td.strong { color: var(--ink); font-weight: 600; }
table.data td.sig { font-family: var(--mono); font-size: .82em; color: var(--text); line-height: 1.5; }
table.data.dense td { padding: .3rem .55rem; }
table.data.dense th { padding: .7rem .55rem .5rem; }
table.data.compact { font-size: clamp(.9rem, .95vw, 1.02rem); }

.bit {
  display: inline-grid; place-items: center;
  min-width: 1.75em; height: 1.75em;
  border-radius: 6px;
  font-family: var(--mono); font-size: .9em; font-weight: 500;
}
.bit.b1 { background: var(--accent-soft); color: var(--accent-ink); font-weight: 600; }
.bit.b0 { color: var(--muted); }

.hex {
  display: inline-grid; place-items: center;
  min-width: 2em; height: 1.75em; padding: 0 .3em;
  border-radius: 5px;
  font-family: var(--mono); font-weight: 600;
  background: var(--frame); color: #FF6B4A;
  letter-spacing: .04em;
}
:root[data-theme="dark"] .hex { background: #000; }
td.sat { color: var(--accent-ink) !important; font-weight: 600; }
td.sat::after { content: " ●"; font-size: .6em; vertical-align: middle; color: var(--accent); }

tr.row-alta { background: var(--accent-wash); }
tr.row-alta td:first-child { box-shadow: inset 3px 0 0 var(--accent); }
tr.row-full td:first-child { box-shadow: inset 3px 0 0 var(--accent); }

.badge {
  display: inline-flex; align-items: center; gap: .5em;
  font-family: var(--mono); font-size: .7rem; letter-spacing: .1em; text-transform: uppercase;
  padding: .35em .75em; border-radius: 999px;
  border: 1px solid var(--line); background: var(--paper);
  color: var(--text); white-space: nowrap;
}
.badge::before { content: ""; width: .55em; height: .55em; border-radius: 50%; background: var(--ink); opacity: .7; }
.badge-pend { color: var(--accent-ink); background: var(--accent-soft); border-color: rgba(224, 144, 74, .4); }
.badge-pend::before { background: var(--accent); opacity: 1; }

/* ---------- Mapas de Karnaugh ---------- */
.kmaps { display: grid; gap: clamp(.75rem, 1.5vw, 1.25rem); }
.kmaps.k4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.kmaps.k3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.kmaps.k2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.k-row-label { display: flex; align-items: center; gap: .75rem; margin: 0 0 .9rem; }
.k-row-label .arrow { font-family: var(--serif); font-style: italic; font-size: 1.6rem; color: var(--accent); line-height: 1; }
.k-row + .k-row { margin-top: clamp(1.5rem, 3.5vh, 2.25rem); }

.kmap {
  margin: 0;
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: .95rem 1rem 1rem;
  display: flex;
  flex-direction: column;
}
.kmap figcaption { display: flex; align-items: baseline; justify-content: space-between; gap: .5rem; margin-bottom: .6rem; }
.kmap-name { font-family: var(--serif); font-weight: 700; font-size: 1.45rem; color: var(--ink); line-height: 1; }
.kmap-dir { font-family: var(--mono); font-size: .66rem; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); text-align: right; }

table.kgrid {
  width: 100%;
  border-collapse: separate;
  border-spacing: 3px;
  table-layout: fixed;
  font-family: var(--mono);
  font-size: clamp(.85rem, .95vw, 1rem);
}
.kgrid th {
  font-weight: 500;
  font-size: .72em;
  color: var(--muted);
  text-align: center;
  padding: .15rem 0;
}
.kgrid thead th:first-child, .kgrid tbody th { width: 3.1em; }
.kgrid .corner { position: relative; height: 2.6em; padding: 0; }
.kgrid .corner::before {
  content: "";
  position: absolute; inset: 2px;
  background: linear-gradient(to top right, transparent calc(50% - .5px), var(--line) 50%, transparent calc(50% + .5px));
}
.kgrid .corner .kc, .kgrid .corner .kr { position: absolute; font-size: .85em; line-height: 1; letter-spacing: 0; }
.kgrid .corner .kc { top: 2px; right: 1px; }
.kgrid .corner .kr { bottom: 2px; left: 1px; }
.kgrid td {
  text-align: center;
  height: 2.3em;
  border-radius: 6px;
  border: 1px solid var(--line);
  color: var(--muted);
  background: var(--paper);
  transition: transform .15s ease;
}
.kgrid td.k1 { background: var(--accent-soft); border-color: rgba(224, 144, 74, .45); color: var(--accent-ink); font-weight: 600; }
.kgrid td.kx { font-style: italic; opacity: .6; border-style: dashed; }
.kmap-eq {
  margin: .85rem 0 0 !important;
  padding-top: .75rem;
  border-top: 1px dashed var(--line);
  font-family: var(--mono);
  font-size: clamp(.78rem, .85vw, .9rem) !important;
  line-height: 1.5 !important;
  color: var(--ink);
  word-break: break-word;
}
.lhs { color: var(--accent-ink); font-weight: 600; }

/* ---------- Ecuaciones ---------- */
.eqs { display: grid; gap: .6rem; }
.eq {
  font-family: var(--mono);
  font-size: clamp(.92rem, 1.05vw, 1.1rem);
  line-height: 1.5;
  color: var(--ink);
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: 8px;
  padding: .7rem 1rem;
  overflow-x: auto;
}
.eq.big { font-size: clamp(1.1rem, 1.6vw, 1.5rem); padding: 1rem 1.25rem; }

/* ---------- Cifras ---------- */
.results { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: clamp(.75rem, 1.4vw, 1.25rem); }
.result {
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: clamp(1rem, 1.8vw, 1.5rem) clamp(1rem, 1.6vw, 1.35rem);
}
.result .num {
  display: block;
  font-family: var(--serif);
  font-weight: 700;
  font-size: clamp(2.6rem, 4.6vw, 4.4rem);
  line-height: 1;
  color: var(--accent);
}
.result .label { margin-top: .75rem; }
.result .unit { font-size: .45em; color: var(--muted); font-style: italic; margin-left: .1em; }

/* ---------- Diagramas SVG ---------- */
.diagram { display: block; width: 100%; height: auto; overflow: visible; }
.diagram .box { fill: var(--paper-2); stroke: var(--ink); stroke-width: 2; stroke-linejoin: round; }
.diagram .box.soft { fill: var(--paper); stroke-dasharray: 6 5; }
.diagram .box.hl { stroke: var(--accent); stroke-width: 2.5; }
.diagram .wire { fill: none; stroke: var(--ink); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.diagram .wire.hl, .diagram .head.hl { stroke: var(--accent); stroke-width: 2.6; }
.diagram .head { fill: none; stroke: var(--ink); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.diagram .dot { fill: var(--ink); }
.diagram .dot.hl { fill: var(--accent); }
.diagram text { font-family: var(--sans); fill: var(--text); }
.diagram .t-k { font-family: var(--mono); font-size: 13px; letter-spacing: .14em; fill: var(--accent-ink); }
.diagram .t-title { font-family: var(--serif); font-weight: 700; font-size: 25px; fill: var(--ink); }
.diagram .t-body { font-size: 17px; fill: var(--ink); font-weight: 600; }
.diagram .t-mono { font-family: var(--mono); font-size: 14px; fill: var(--text); }
.diagram .t-mono.hl { fill: var(--accent-ink); font-weight: 600; }
.diagram .t-small { font-family: var(--mono); font-size: 12px; letter-spacing: .08em; fill: var(--muted); }

.js .reveal .draw { stroke-dasharray: var(--len, none); stroke-dashoffset: var(--len, 0); transition: stroke-dashoffset 1.1s cubic-bezier(.4, .1, .2, 1) .35s; }
.js .reveal.in .draw { stroke-dashoffset: 0; }
.js .reveal .head { opacity: 0; transition: opacity .35s ease 1.25s; }
.js .reveal.in .head { opacity: 1; }

/* ---------- Conclusiones y cierre ---------- */
.conclusions { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(1rem, 2vw, 1.5rem); counter-reset: c; }
.conclusions li {
  counter-increment: c;
  position: relative;
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: clamp(1.25rem, 2.2vw, 2rem) clamp(1.25rem, 2.2vw, 2rem) clamp(1.25rem, 2.2vw, 2rem) clamp(4.2rem, 6vw, 5.5rem);
  font-size: clamp(1.02rem, 1.25vw, 1.3rem);
  line-height: 1.5;
}
.conclusions li::before {
  content: counter(c, decimal-leading-zero);
  position: absolute;
  left: clamp(1.1rem, 2vw, 1.75rem);
  top: clamp(1.05rem, 2vw, 1.75rem);
  font-family: var(--serif);
  font-style: italic;
  font-weight: 700;
  font-size: clamp(1.8rem, 2.6vw, 2.5rem);
  line-height: 1;
  color: var(--accent);
}

.download {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: clamp(1rem, 2vw, 1.5rem);
}
.file-icon { width: 54px; height: 66px; flex: none; }
.file-icon .page { fill: var(--paper); stroke: var(--ink); stroke-width: 2; stroke-linejoin: round; }
.file-icon .fold { fill: none; stroke: var(--ink); stroke-width: 2; stroke-linejoin: round; }
.file-icon .tag { fill: var(--accent); }
.file-icon text { font-family: var(--mono); font-size: 10px; fill: #fff; font-weight: 600; letter-spacing: .04em; }
.file-name { font-family: var(--serif); font-weight: 700; font-size: clamp(1.15rem, 1.6vw, 1.5rem); color: var(--ink); line-height: 1.2; display: block; }
.file-meta { margin-top: .35rem; }

.qa { text-align: center; }
.qa .container { display: flex; flex-direction: column; align-items: center; }
.qa .crest { width: clamp(90px, 13vh, 150px); margin-bottom: clamp(1.25rem, 3vh, 2rem); }
.qa .title { font-size: clamp(3.6rem, 11vw, 9.5rem); margin-bottom: clamp(1.25rem, 3vh, 2rem); }
.qa .team { margin-top: clamp(1.5rem, 4vh, 2.5rem); }
.qa .download { text-align: left; margin-top: clamp(1.5rem, 4vh, 2.5rem); width: min(100%, 760px); }
.thanks { font-family: var(--mono); font-size: .8rem; letter-spacing: .2em; text-transform: uppercase; color: var(--muted); margin: 0; }

/* ---------- Navegación: puntos laterales ---------- */
.dots {
  position: fixed;
  right: clamp(8px, 1.4vw, 26px);
  top: 50%;
  transform: translateY(-50%);
  z-index: 50;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.dots button {
  position: relative;
  display: grid;
  place-items: center;
  width: 26px;
  height: 24px;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
}
.dots button::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--muted);
  opacity: .35;
  transition: width .25s ease, height .25s ease, background-color .25s ease, opacity .25s ease;
}
.dots button:hover::before { opacity: .75; }
.dots button[aria-current="true"]::before { width: 12px; height: 12px; background: var(--accent); opacity: 1; }
.dots .tip {
  position: absolute;
  right: calc(100% + 6px);
  top: 50%;
  transform: translate(6px, -50%);
  white-space: nowrap;
  font-family: var(--mono);
  font-size: .68rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  background: var(--ink);
  color: var(--paper);
  padding: .4em .7em;
  border-radius: 6px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
}
.dots button:hover .tip, .dots button:focus-visible .tip { opacity: 1; transform: translate(0, -50%); }
.dots button:focus-visible { outline: none; }
.dots button:focus-visible::before { outline: 2px solid var(--accent); outline-offset: 3px; }

/* ---------- Barra de progreso ---------- */
.progress {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 3px;
  z-index: 60;
  pointer-events: none;
}
.progress span {
  display: block;
  height: 100%;
  width: 100%;
  background: var(--accent);
  transform-origin: 0 50%;
  transform: scaleX(0);
}

/* ---------- HUD inferior ---------- */
.hud {
  position: fixed;
  left: clamp(8px, 1.4vw, 24px);
  bottom: clamp(8px, 2vh, 20px);
  z-index: 50;
  display: flex;
  align-items: center;
  gap: .75rem;
  font-family: var(--mono);
  font-size: .7rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
}
.hud-count b { color: var(--ink); font-weight: 500; }
.hud button {
  display: grid; place-items: center;
  width: 30px; height: 30px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--paper-2);
  color: var(--ink);
  cursor: pointer;
  padding: 0;
  transition: border-color .2s ease, color .2s ease;
}
.hud button:hover { border-color: var(--accent); color: var(--accent-ink); }
.hud button svg { width: 15px; height: 15px; }
.hud .hud-title { max-width: 26ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- Lightbox ---------- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(18, 16, 13, .93);
  display: none;
}
.lightbox.open { display: block; }
.lb-stage {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
  touch-action: none;
}
.lb-img {
  max-width: 94vw;
  max-height: 82vh;
  border-radius: 6px;
  background: #fff;
  box-shadow: 0 30px 80px rgba(0, 0, 0, .5);
  transform-origin: center center;
  transition: transform .14s ease-out;
  user-select: none;
  -webkit-user-drag: none;
  cursor: zoom-in;
}
.lightbox.zoomed .lb-img { cursor: grab; }
.lightbox.dragging .lb-img { cursor: grabbing; transition: none; }
.lb-cap {
  position: absolute;
  left: 50%;
  bottom: clamp(12px, 3vh, 28px);
  transform: translateX(-50%);
  width: min(92vw, 900px);
  text-align: center;
  font-family: var(--mono);
  font-size: .75rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: #E9E2D6;
  line-height: 1.5;
  pointer-events: none;
}
.lb-hint { display: block; margin-top: .35rem; color: #9A9184; font-size: .65rem; }
.lb-btn {
  position: absolute;
  display: grid; place-items: center;
  width: 46px; height: 46px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, .2);
  background: rgba(30, 28, 24, .7);
  color: #F5EFE3;
  cursor: pointer;
  padding: 0;
  transition: background-color .2s ease, border-color .2s ease;
}
.lb-btn:hover { background: var(--accent-ink); border-color: var(--accent-ink); }
.lb-btn svg { width: 20px; height: 20px; }
.lb-close { top: 18px; right: 18px; }
.lb-prev { left: 18px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 18px; top: 50%; transform: translateY(-50%); }

/* ---------- Animaciones de entrada ---------- */
.js .reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity .6s ease, transform .6s cubic-bezier(.2, .7, .2, 1);
  transition-delay: var(--d, 0s);
}
.js .reveal.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .reveal, .js .reveal.in { opacity: 1; transform: none; transition: none; }
  .js .reveal .draw { stroke-dasharray: none; stroke-dashoffset: 0; transition: none; }
  .js .reveal .head { opacity: 1; transition: none; }
  .zoomable, .zoomable:hover { transition: none; transform: none; }
  .lb-img { transition: none; }
}

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .grid-4, .kmaps.k4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .team { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
  .split, .split-even, .grid-2, .grid-3, .figs, .conclusions { grid-template-columns: minmax(0, 1fr); }
  .kmaps.k3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hud .hud-title { display: none; }
}

@media (max-width: 767px) {
  :root { --dots-space: 18px; }
  .dots { right: 2px; gap: 0; }
  .dots button { width: 18px; height: 18px; }
  .dots button::before { width: 6px; height: 6px; }
  .dots button[aria-current="true"]::before { width: 9px; height: 9px; }
  .dots .tip { display: none; }
  .title { font-size: 3rem; }
  .cover .title { font-size: 3.2rem; }
  .qa .title { font-size: 3.6rem; }
  .team { grid-template-columns: minmax(0, 1fr); }
  .scroll-hint { display: none; }
  .download { grid-template-columns: auto minmax(0, 1fr); }
  .download .btn { grid-column: 1 / -1; justify-self: start; }
  .lb-prev, .lb-next { top: auto; bottom: 70px; transform: none; }
  .cover .meta span { display: block; }
  .cover .meta span + span::before { content: none; }
}

@media (max-width: 520px) {
  .grid-4, .kmaps.k4, .kmaps.k3, .kmaps.k2 { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- Impresión ---------- */
@media print {
  .dots, .progress, .hud, .lightbox, .scroll-hint { display: none !important; }
  .js .reveal { opacity: 1; transform: none; }
  .section { min-height: auto; break-inside: avoid-page; }
  body::before { display: none; }
}
