:root {
  color-scheme: light;
  --paper: #f7f6f2;
  --white: #fff;
  --ink: #171714;
  --muted: #55544c;
  --line: #e5e2d9;
  --yellow: #ffce32;
  --pale: #fff5ce;
  --radius: 18px;
  --mono: ui-monospace, "Cascadia Mono", "DejaVu Sans Mono", monospace;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 1rem/1.55 system-ui, sans-serif;
}

h1, h2, h3, h4, p, figure { margin: 0; }
h1, h2, h3, h4 { line-height: 1.14; }
h2 { font-size: clamp(1.65rem, 4vw, 2.35rem); letter-spacing: -.045em; }
h3 { font-size: 1.25rem; letter-spacing: -.025em; }
h4 { font-size: 1rem; }
a { color: inherit; }
button, input { font: inherit; }
button, summary { cursor: pointer; }
section, article { scroll-margin-top: 1.5rem; }
:focus-visible { outline: 3px solid #957000; outline-offset: 3px; }

.wrap { width: min(100% - 3rem, 72rem); margin-inline: auto; }
.sr-only, .skip-link:not(:focus) {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.skip-link:focus {
  position: fixed;
  z-index: 2;
  top: .75rem;
  left: .75rem;
  padding: .75rem 1rem;
  background: var(--yellow);
}

.site-header { background: var(--white); border-bottom: 1px solid var(--line); }
.header-inner, .footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.header-inner { min-height: 4.5rem; padding-block: .75rem; }
.brand, .nav, .actions { display: flex; align-items: center; }
.brand { gap: .65rem; font-weight: 650; white-space: nowrap; text-decoration: none; }
.brand-icon {
  display: grid;
  grid-template-columns: repeat(2, 6px);
  grid-template-rows: repeat(2, 6px);
  place-content: center;
  gap: 1px;
  width: 35px;
  height: 35px;
  border-radius: 9px;
  background: var(--ink);
}
.brand-icon i:first-child, .brand-icon i:last-child { background: var(--yellow); border-radius: 1px; }
.nav { gap: clamp(.85rem, 2.7vw, 1.9rem); flex-wrap: wrap; }
.nav a, .footer-inner a { font-size: .9rem; font-weight: 650; text-decoration: none; }
.nav a:hover, .footer-inner a:hover { text-decoration: underline; text-underline-offset: .22em; }
.nav .nav-action { padding: .45rem .8rem; border-radius: 7px; background: var(--yellow); }

.hero {
  position: relative;
  isolation: isolate;
  display: grid;
  align-items: center;
  min-height: 24rem;
  margin-top: 2rem;
  padding: clamp(2rem, 5.4vw, 4.5rem);
  overflow: hidden;
  border-radius: 24px;
  background: #171714;
  color: var(--white);
}
.hero-copy { position: relative; z-index: 1; width: min(100%, 30rem); }
.eyebrow {
  display: flex;
  align-items: center;
  gap: .6rem;
  color: #f5df96;
  font-size: .83rem;
  font-weight: 700;
  letter-spacing: .105em;
  text-transform: uppercase;
}
.eyebrow span { width: 1rem; height: 2px; background: var(--yellow); }
.hero h1 {
  margin-block: .8rem 1.05rem;
  font-size: clamp(3.2rem, 7.1vw, 5.45rem);
  line-height: .97;
  letter-spacing: -.077em;
}
.hero h1 em { color: var(--yellow); font-style: normal; }
.hero-summary { max-width: 28rem; color: #dbd9d0; font-size: 1.075rem; }
.actions { gap: .65rem; flex-wrap: wrap; margin-top: 1.5rem; }
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.75rem;
  padding: .6rem .95rem;
  border: 1px solid transparent;
  border-radius: 8px;
  font-size: .94rem;
  font-weight: 700;
  text-decoration: none;
}
.primary { background: var(--yellow); color: var(--ink); }
.primary:hover, .nav .nav-action:hover { background: #ffdc67; }
.outline { border-color: #656355; color: #fff; }
.outline:hover { background: #323128; }
.hero :focus-visible { outline-color: var(--yellow); }
.hero-location {
  position: absolute;
  right: 1.75rem;
  bottom: 1.35rem;
  color: #ddd9c6;
  font: .78rem/1.4 var(--mono);
}
.hero-art {
  position: absolute;
  z-index: -1;
  inset: 0 0 0 45%;
  background:
    linear-gradient(90deg, #171714, transparent 36%),
    linear-gradient(0deg, #171714, transparent 27%, transparent 81%, #171714),
    radial-gradient(ellipse at 67% 48%, #534722, transparent 66%),
    repeating-linear-gradient(0deg, transparent 0 31px, #414031 31px 32px),
    repeating-linear-gradient(90deg, #27251b 0 31px, #414031 31px 32px);
}
.signal {
  position: absolute;
  left: 57%;
  top: 51%;
  width: min(29vw, 22rem);
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
}
.signal i {
  position: absolute;
  inset: var(--inset, 0);
  border: 1px solid #ffdb6359;
  border-radius: 50%;
}
.signal i:nth-child(2) { --inset: 9%; }
.signal i:nth-child(3) { --inset: 18%; }
.radio {
  position: absolute;
  left: 56%;
  top: 56%;
  display: grid;
  gap: .75rem;
  width: clamp(7.75rem, 12.5vw, 10.75rem);
  padding: 1rem .85rem .8rem;
  transform: translate(-50%, -50%) rotate(-13deg);
  border: 1px solid #77715c;
  border-radius: 1rem 1rem .85rem .85rem;
  background: linear-gradient(135deg, #555246, #25241e 64%);
  box-shadow: 11px 14px 25px #0a0a07aa, inset 0 1px #8b8470, inset 0 -5px 0 #171713;
}
.radio-antenna, .radio-knob {
  position: absolute;
  bottom: 99%;
  background: linear-gradient(90deg, #211f18, #5c5746 37%, #2e2b21);
  border: 1px solid #686250;
}
.radio-antenna { left: 16%; width: .82rem; height: 5.2rem; border-radius: .45rem .45rem .14rem .14rem; }
.radio-knob { right: 16%; width: 1.5rem; height: .85rem; border-radius: .3rem .3rem 0 0; }
.radio-display {
  display: grid;
  min-height: 5rem;
  align-content: center;
  padding: .5rem .68rem;
  border: 4px solid #1a1914;
  border-radius: .45rem;
  background: linear-gradient(125deg, #ffdf69, #e7a825);
  color: #322509;
  font-family: var(--mono);
  box-shadow: 0 0 1.35rem #ffcc365e, inset 0 0 .45rem #8156047a;
}
.radio-display small { font-size: .55rem; font-weight: 700; white-space: nowrap; }
.radio-display b { font-size: 2.1rem; line-height: 1; }
.radio-speaker {
  height: 2.6rem;
  border-radius: .35rem;
  background: repeating-linear-gradient(#151511 0 3px, #575143 4px, transparent 5px 8px);
  border-inline: 6px solid #333025;
}
.radio-buttons { display: flex; justify-content: center; gap: .5rem; }
.radio-buttons i {
  width: 1.15rem;
  height: .55rem;
  border-radius: .2rem;
  background: #181711;
  box-shadow: inset 0 1px #716857;
}
.radio-buttons i:nth-child(2) { background: #dfa725; }

.section { margin-top: 3.5rem; }
.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.05rem;
}
.section-head p, .example-head p, .log-card > p, .print-card > p {
  margin-top: .4rem;
  color: var(--muted);
}
.data-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: .8rem;
  padding: 0;
  margin: 0;
  list-style: none;
}
.data-grid li, .panel {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
}
.data-grid li { display: flex; flex-direction: column; align-items: start; padding: 1.2rem; }
.data-grid h3 { margin: .8rem 0 .3rem; }
.data-grid p { margin-bottom: .55rem; }
.data-example { margin-top: auto; color: var(--muted); font-size: .88rem; }
.data-icon { position: relative; width: 2.4rem; height: 2.4rem; border-radius: 9px; background: var(--pale); }
.data-icon::before, .data-icon::after { position: absolute; content: ""; }
.pin::before {
  top: 9px;
  left: 12px;
  width: 14px;
  height: 14px;
  border: 2px solid;
  border-radius: 52% 52% 52% 0;
  transform: rotate(-45deg);
}
.pin::after { top: 14px; left: 17px; width: 4px; height: 4px; border-radius: 50%; background: currentColor; }
.target::before { inset: 9px; border: 2px solid; border-radius: 50%; }
.target::after { inset: 16px; border-radius: 50%; background: currentColor; }
.flag::before { top: 9px; left: 11px; width: 2px; height: 20px; background: currentColor; }
.flag::after {
  top: 9px;
  left: 13px;
  width: 14px;
  height: 10px;
  background: currentColor;
  clip-path: polygon(0 0, 100% 0, 73% 50%, 100% 100%, 0 100%);
}
.person::before { top: 8px; left: 15px; width: 8px; height: 8px; border: 2px solid; border-radius: 50%; }
.person::after { top: 18px; left: 10px; width: 18px; height: 10px; border: 2px solid; border-radius: 10px 10px 4px 4px; }

.dispatch-grid, .example-grid, .reference-grid { display: grid; gap: 1rem; }
.dispatch-grid { grid-template-columns: 1.13fr 1fr; align-items: start; }
.flow, .radio-panel, .worked-example, .log-card, .print-card, .practice-card { padding: clamp(1rem, 3vw, 1.65rem); }
.flow h3, .radio-panel h3 { margin-bottom: 1rem; }
.flow-node {
  display: flex;
  align-items: flex-start;
  gap: .8rem;
  padding: .85rem;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #faf9f6;
}
.flow-node p, .radio-steps p { margin-top: .2rem; }
.flow-node a { text-underline-offset: .16em; }
.step-num {
  flex: 0 0 1.65rem;
  display: grid;
  place-items: center;
  width: 1.65rem;
  height: 1.65rem;
  border-radius: 6px;
  background: var(--yellow);
  color: var(--ink);
  font: 750 .85rem/1 var(--mono);
}
.flow-connector { position: relative; width: 1px; height: 1rem; margin-inline: auto; background: #a39e8d; }
.flow-connector::after {
  position: absolute;
  bottom: 1px;
  left: -2px;
  width: 5px;
  height: 5px;
  border-right: 1px solid #a39e8d;
  border-bottom: 1px solid #a39e8d;
  content: "";
  transform: rotate(45deg);
}
.flow-question {
  padding: .55rem .8rem;
  border: 1px solid #ead174;
  border-radius: 8px;
  background: var(--pale);
  font-weight: 750;
  text-align: center;
}
.flow-branches {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .6rem;
  padding-top: 1rem;
}
.flow-branches::before {
  position: absolute;
  inset: 0 25% auto;
  height: 1rem;
  content: "";
  background:
    linear-gradient(#a39e8d, #a39e8d) center top / 1px .5rem no-repeat,
    linear-gradient(#a39e8d, #a39e8d) center center / 100% 1px no-repeat,
    linear-gradient(#a39e8d, #a39e8d) left bottom / 1px .5rem no-repeat,
    linear-gradient(#a39e8d, #a39e8d) right bottom / 1px .5rem no-repeat;
}
.flow-branch { padding: .7rem .75rem; border: 1px solid var(--line); border-radius: 9px; }
.flow-branch p { margin-top: .4rem; }
.choice { display: inline-block; padding: .1rem .48rem; border-radius: 4px; font-size: .85rem; font-weight: 750; }
.positive { background: var(--yellow); }
.neutral { background: #eae8e0; }

.radio-panel { background: #211f19; border-color: #211f19; color: var(--white); }
.radio-steps { display: grid; gap: 1rem; margin: 0; padding: 0; list-style: none; }
.radio-steps li { display: flex; gap: .8rem; }
.radio-steps li + li { padding-top: 1rem; border-top: 1px solid #504b3d; }
.radio-steps p { color: #e1dfd6; }
kbd {
  display: inline-block;
  padding: .1rem .38rem;
  border: 1px solid #e9d892;
  border-radius: 5px;
  background: var(--pale);
  color: #302609;
  font: 700 .88em/1.35 var(--mono);
  white-space: nowrap;
}
.worked-example, .log-card + .log-card { margin-top: 1rem; }
.example-grid { margin-top: 1rem; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.chat { padding: 1rem; border: 1px solid var(--line); border-radius: 12px; background: #f8f7f3; }
.radio-chat { background: #fffbec; }
.chat h4 { margin-bottom: .65rem; }
.chat p { padding: .55rem .65rem; border-radius: 7px; background: var(--white); }
.chat p + p { margin-top: .45rem; }
.chat p strong { display: block; margin-bottom: .12rem; font-size: .87rem; }
.example-wait { margin-top: 1rem; padding-top: .8rem; border-top: 1px solid var(--line); }
summary { min-height: 2.75rem; padding-block: .55rem; font-weight: 700; }
details > p { margin-top: .3rem; }

.reference-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.reference-panel { overflow: hidden; }
.table-controls { padding: .9rem 1rem; border-bottom: 1px solid var(--line); }
.table-controls label { display: block; margin-bottom: .35rem; font-size: .9rem; font-weight: 700; }
.table-controls input {
  width: 100%;
  min-height: 2.75rem;
  padding: .5rem .72rem;
  border: 1px solid #bdb9a9;
  border-radius: 8px;
  color: var(--ink);
}
.empty { padding: 1rem; color: var(--muted); }
table { width: 100%; border-collapse: collapse; text-align: left; }
th, td { padding: .48rem 1rem; border-bottom: 1px solid var(--line); vertical-align: top; }
thead { background: #f4f2eb; }
thead th { font-size: .9rem; font-weight: 750; }
tbody tr:last-child > * { border-bottom: 0; }
.keys-table th:first-child, .bases-table th:first-child { width: 6rem; }
.print-card { margin-top: 1rem; border-color: #ecd780; background: var(--pale); }
.print-card button { margin-top: .8rem; }
.print-heading { display: none; }

.service-log, .queue-figure { margin-top: 1rem; }
.service-log { overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; }
.service-log table { min-width: 35rem; }
.service-log caption { padding: .65rem 1rem; text-align: left; color: var(--muted); }
.scroll-hint { display: none; font-size: .9rem; }
.service-log td:first-child { font-weight: 750; }
.service-log td:nth-child(2), .service-log td:nth-child(3) { white-space: nowrap; }
.notebook {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  padding: 0;
  margin: 0;
  border: 1px solid #d8d9d2;
  border-radius: 10px;
  background:
    repeating-linear-gradient(transparent 0 calc(7mm - 1px), #e0e5de calc(7mm - 1px) 7mm),
    repeating-linear-gradient(90deg, #fffef8 0 calc(7mm - 1px), #e0e5de calc(7mm - 1px) 7mm);
  list-style: none;
}
.notebook li { padding: .85rem .1rem; font: 700 clamp(1.15rem, 5.5vw, 2rem)/1.2 var(--mono); text-align: center; }
.notebook li + li { border-left: 1px solid #b6b9ad; }
.notebook sup { margin-left: .1em; color: #52440f; font-size: .56em; }
figcaption { margin-top: .5rem; color: var(--muted); }

.practice-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .85rem; align-items: start; }
.practice-card > p { margin-top: .55rem; }
.practice-card details { margin-top: .8rem; padding-top: .3rem; border-top: 1px solid var(--line); }
.scope { margin-block: 2rem 3rem; color: var(--muted); }
.site-footer { padding-block: 1.4rem; background: var(--white); border-top: 1px solid var(--line); }
.footer-inner p { font-size: .9rem; color: var(--muted); }

@media (max-width: 52rem) {
  .data-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dispatch-grid { grid-template-columns: 1fr; }
  .hero-art { left: 48%; }
  .signal { width: 15rem; }
}
@media (max-width: 41rem) {
  .wrap { width: calc(100% - 2rem); }
  .header-inner { flex-direction: column; align-items: start; gap: .5rem; }
  .nav { gap: .25rem .65rem; }
  .nav a { display: inline-flex; min-height: 2.75rem; align-items: center; }
  .nav .nav-action { min-height: 2.25rem; }
  .hero { margin-top: 1rem; padding: 1.45rem 1.25rem 3.15rem; min-height: auto; border-radius: 18px; }
  .hero-art { display: none; }
  .hero-location { right: auto; left: 1.25rem; bottom: .85rem; }
  .hero h1 { font-size: clamp(2.8rem, 10.5vw, 4.25rem); }
  .section { margin-top: 2.5rem; }
  .data-grid { gap: .6rem; }
  .data-grid li { padding: .9rem; }
  .example-grid, .reference-grid, .practice-grid { grid-template-columns: 1fr; }
  .reference-grid { gap: 0; }
}
@media (max-width: 39rem) {
  .scroll-hint { display: block; }
}
@media (max-width: 24rem) {
  .flow-branches { grid-template-columns: 1fr; padding-top: .65rem; }
  .flow-branches::before { display: none; }
}
@media print {
  @page { size: letter; margin: 13mm; }
  body { background: #fff; color: #000; font: 11pt/1.3 system-ui, sans-serif; }
  .wrap { width: 100%; max-width: none; }
  .skip-link, .site-header, .site-footer, .hero, #despacho, #bitacoras, #practica, .scope,
  .table-controls, #impresion, #sin-claves, .data-icon, #claves .section-head p, #bases .section-head p { display: none !important; }
  .print-heading { display: block; padding-bottom: 4mm; border-bottom: 1px solid #222; }
  .print-heading p { margin-bottom: 2mm; font-size: 10pt; }
  .print-heading h1 { font-size: 25pt; }
  .section { margin-top: 5mm; }
  .section-head { margin-bottom: 2.5mm; }
  h2 { font-size: 16pt; letter-spacing: 0; }
  .data-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 2mm; }
  .data-grid li { padding: 2mm; border-radius: 2mm; }
  .data-grid h3 { margin: 0 0 1mm; font-size: 11pt; }
  .data-grid p { margin-bottom: 1mm; }
  .data-example { font-size: 9pt; }
  .reference-grid { grid-template-columns: 1fr 1fr; gap: 5mm; }
  .reference-panel { border-radius: 2mm; }
  .reference-panel tr[hidden] { display: table-row !important; }
  th, td { padding: 1.6mm 2.5mm; }
  .keys-table th:first-child, .bases-table th:first-child { width: 16mm; }
  kbd { padding: 0 1mm; border-color: #999; background: #fff; color: #000; }
  .reference-grid, .data-grid { break-inside: avoid; }
}
