/* ==========================================================================
   Saora — hoja de estilos única
   Todos los colores, tipografías y espacios se definen en :root.
   ========================================================================== */

:root {
  /* Color (paleta definida por el propietario) */
  --ivory: #F5F3ED;
  --white: #FFFFFF;
  --ink: #202420;
  --ink-soft: #4A524B;          /* texto secundario: 6.9:1 sobre marfil */
  --green: #234B3C;             /* 8.8:1 sobre marfil · blanco sobre verde 9.8:1 */
  --green-deep: #1A3A2E;
  --sage: #B8C7AE;              /* decorativo sobre marfil · texto sobre verde 5.5:1 */
  --sage-wash: #E3E7DA;
  --sage-light: #D5DFCD;        /* texto secundario sobre verde: 7.6:1 */
  --terracotta: #B9684F;        /* solo detalles y gráficos (3.7:1 sobre marfil) */
  --terracotta-ink: #94503B;    /* terracota para texto pequeño: 5.4:1 sobre marfil */
  --line: #DBDAD4;
  --line-strong: #B9BAB2;

  /* Tipografía: una serif editorial y una sans legible */
  --serif: "Brygada 1918", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: "Schibsted Grotesk", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  --step--1: 0.875rem;
  --step-0: 1.0625rem;
  --step-1: 1.25rem;
  --step-2: clamp(1.45rem, 1.2rem + 0.9vw, 1.85rem);
  --step-3: clamp(2rem, 1.35rem + 2.4vw, 3.25rem);
  --step-4: clamp(2.6rem, 1.5rem + 4.4vw, 4.85rem);

  /* Espacio */
  --s1: 0.5rem;
  --s2: 0.75rem;
  --s3: 1rem;
  --s4: 1.5rem;
  --s5: 2rem;
  --s6: 3rem;
  --s7: clamp(3rem, 6vw, 4.5rem);
  --s8: clamp(4.5rem, 10vw, 8.5rem);

  /* Retícula */
  --wrap: 1200px;
  --gutter: clamp(1rem, 4vw, 2.5rem);
  --col-gap: clamp(1rem, 2.5vw, 2rem);
  --radius: 10px;
  --header-h: 72px;

  color-scheme: light;
}

/* ---------- Base ---------- */

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: calc(var(--header-h) + 1rem);
  scrollbar-color: var(--line-strong) var(--ivory);
}

body {
  margin: 0;
  background: var(--ivory);
  color: var(--ink);
  font-family: var(--sans);
  font-size: var(--step-0);
  line-height: 1.6;
  caret-color: var(--green);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

::selection { background: var(--sage); color: var(--ink); }

h1, h2, h3, h4 { margin: 0; font-weight: 500; text-wrap: balance; }
p, ul, ol, dl, dd, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
img, svg { display: block; max-width: 100%; }
p { text-wrap: pretty; }

a {
  color: var(--green);
  text-decoration-line: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.22em;
  text-decoration-color: var(--terracotta);
}
a:hover { text-decoration-thickness: 2px; }

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

main:focus { outline: none; }

.wrap {
  width: 100%;
  max-width: calc(var(--wrap) + 2 * var(--gutter));
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--col-gap);
}

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

.skip-link {
  position: absolute;
  left: var(--gutter);
  top: -100px;
  z-index: 100;
  background: var(--green);
  color: var(--white);
  padding: var(--s2) var(--s3);
  border-radius: 999px;
  font-weight: 600;
  text-decoration: none;
}
.skip-link:focus { top: 12px; }

.icon {
  width: 1.25rem;
  height: 1.25rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: none;
}

.flush-top { padding-top: 0; }
.mt-4 { margin-top: var(--s4); }
.mt-5 { margin-top: var(--s5); }
.mt-6 { margin-top: var(--s6); }

/* ---------- Tipografía ---------- */

.display {
  font-family: var(--serif);
  font-size: var(--step-4);
  font-weight: 500;
  line-height: 1.03;
  letter-spacing: -0.022em;
}
.display em, .h-lg em { font-style: italic; color: var(--green); }

.h-lg {
  font-family: var(--serif);
  font-size: var(--step-3);
  line-height: 1.08;
  letter-spacing: -0.015em;
}

.h-md {
  font-family: var(--serif);
  font-size: var(--step-2);
  line-height: 1.2;
  letter-spacing: -0.005em;
}

.h-sm {
  font-family: var(--sans);
  font-size: var(--step-0);
  font-weight: 650;
  line-height: 1.35;
}

.lead {
  font-size: var(--step-1);
  line-height: 1.5;
  color: var(--ink-soft);
  max-width: 36ch;
}

.prose { max-width: 62ch; }
.prose > * + * { margin-top: var(--s3); }
.prose p { color: var(--ink-soft); }
.prose strong { color: var(--ink); font-weight: 600; }

/* ---------- Botones y enlaces de acción ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 50px;
  padding: 0 1.5rem;
  border-radius: 999px;
  border: 1.5px solid transparent;
  font-family: var(--sans);
  font-size: 1rem;
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
  transition: background-color .2s ease, color .2s ease, border-color .2s ease;
}
.btn-primary { background: var(--green); color: var(--white); }
.btn-primary:hover { background: var(--green-deep); }
.btn-secondary { background: transparent; color: var(--green); border-color: var(--green); }
.btn-secondary:hover { background: var(--sage-wash); }
.btn-light { background: var(--ivory); color: var(--green); }
.btn-light:hover { background: var(--white); }
.btn-small { min-height: 42px; padding: 0 1.15rem; font-size: 0.9375rem; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .6; cursor: progress; }

.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 44px;
  font-weight: 600;
  color: var(--green);
  text-decoration: none;
}
.link-arrow .icon { transition: transform .25s cubic-bezier(.16,1,.3,1); }
.link-arrow:hover .icon { transform: translateX(4px); }
.link-arrow:hover span { text-decoration: underline; text-decoration-color: var(--terracotta); text-underline-offset: .22em; }

.actions { display: flex; flex-wrap: wrap; gap: var(--s2); }

/* ---------- Cabecera ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--ivory);
  border-bottom: 1px solid transparent;
  transition: border-color .2s ease;
}
.site-header.is-scrolled { border-bottom-color: var(--line); }

.header-inner {
  display: flex;
  align-items: center;
  gap: var(--s5);
  min-height: var(--header-h);
}

.brand { color: var(--ink); text-decoration: none; display: inline-flex; border-radius: 6px; }
.logo { display: inline-flex; align-items: center; gap: 0.5rem; }
.logo-mark { width: 28px; height: 28px; color: var(--green); }
.logo-word {
  font-family: var(--serif);
  font-size: 1.6rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1;
}

.nav-desktop { margin-left: auto; }
.nav-list { display: flex; gap: var(--s5); }
.nav-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-size: 0.9875rem;
  font-weight: 500;
  color: var(--ink-soft);
  text-decoration: none;
  position: relative;
}
.nav-link:hover { color: var(--ink); }
.nav-link[aria-current="page"] { color: var(--ink); }
.nav-link[aria-current="page"]::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 6px;
  height: 2px;
  background: var(--terracotta);
  border-radius: 2px;
}

.menu-toggle {
  display: none;
  align-items: center;
  gap: 0.4rem;
  min-height: 44px;
  padding: 0 0.85rem;
  margin-left: var(--s1);
  border: 1.5px solid var(--line-strong);
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
  font: 600 0.9375rem var(--sans);
  cursor: pointer;
}
.menu-toggle .i-close { display: none; }
.menu-toggle[aria-expanded="true"] .i-open { display: none; }
.menu-toggle[aria-expanded="true"] .i-close { display: inline; }

.menu-panel {
  position: absolute;
  left: 0; right: 0; top: 100%;
  background: var(--ivory);
  border-bottom: 1px solid var(--line);
  padding-block: var(--s2) var(--s5);
  max-height: calc(100vh - var(--header-h));
  overflow-y: auto;
}
.menu-list { margin-bottom: var(--s4); }
.menu-list li + li { border-top: 1px solid var(--line); }
.menu-link {
  display: flex;
  align-items: center;
  min-height: 60px;
  font-family: var(--serif);
  font-size: 1.5rem;
  color: var(--ink);
  text-decoration: none;
}
.menu-link[aria-current="page"] { color: var(--green); text-decoration: underline; text-decoration-color: var(--terracotta); text-decoration-thickness: 2px; text-underline-offset: .25em; }

@media (max-width: 880px) {
  .nav-desktop { display: none; }
  .menu-toggle { display: inline-flex; }
  .header-cta { margin-left: auto; }
}
@media (max-width: 400px) {
  .header-cta { display: none; }
  .menu-toggle { margin-left: auto; }
}
@media (min-width: 881px) {
  .menu-panel { display: none !important; }
}

/* ---------- Secciones ---------- */

.section { padding-block: var(--s8); }
.section-tight { padding-block: var(--s7); }

.section-head {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--col-gap);
  row-gap: var(--s3);
  align-items: end;
  margin-bottom: var(--s6);
}
.section-head > h2 { grid-column: 1 / 7; }
.section-head > p { grid-column: 8 / 13; color: var(--ink-soft); max-width: 44ch; }

/* Banda de borde de carta: separa capítulos */
.neatline {
  height: 9px;
  border-block: 1px solid var(--ink);
  background: repeating-linear-gradient(90deg, var(--green) 0 32px, transparent 32px 64px) center / 100% 5px no-repeat;
}

/* ---------- Hero ---------- */

.hero { padding-block: clamp(2rem, 5vw, 4rem) clamp(3rem, 7vw, 6rem); }
.hero-grid { align-items: center; row-gap: var(--s6); }
.hero-copy { grid-column: 1 / 6; }
.hero-copy .lead { margin-top: var(--s4); }
.hero-copy .actions { margin-top: var(--s5); }
.hero-visual { grid-column: 6 / 13; }

/* ---------- Carta (ilustración principal) ---------- */

.chart-svg { width: 100%; height: auto; }
.c-water { fill: var(--white); }
.c-grid path { fill: none; stroke: var(--green); stroke-opacity: .1; stroke-width: .75; }
.c-contour-outer { fill: none; stroke: var(--green); stroke-opacity: .45; stroke-dasharray: 3 4; stroke-width: 1; vector-effect: non-scaling-stroke; }
.c-band-1 { fill: var(--sage); fill-opacity: .3; stroke: var(--green); stroke-opacity: .3; stroke-width: .75; vector-effect: non-scaling-stroke; }
.c-band-2 { fill: var(--sage); fill-opacity: .55; stroke: var(--green); stroke-opacity: .45; stroke-width: .75; vector-effect: non-scaling-stroke; }
.c-land { fill: var(--ivory); stroke: var(--green); stroke-width: 1.4; }
.c-relief { fill: none; stroke: var(--green); stroke-opacity: .6; stroke-width: 1; stroke-dasharray: 5 3; vector-effect: non-scaling-stroke; }
.c-rocks path { fill: none; stroke: var(--ink); stroke-opacity: .35; stroke-width: 1; }

.seg {
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-dasharray: 1.5 6;
  transition: stroke-width .35s cubic-bezier(.16,1,.3,1), opacity .35s ease;
}
.seg-retorno { stroke: var(--terracotta); }
.seg-circular { stroke: var(--green); }
.route-arrows path { fill: none; stroke: var(--green); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; transition: opacity .35s ease; }

.c-water-label { font-family: var(--serif); font-style: italic; font-size: 14px; letter-spacing: .04em; fill: var(--green); }

.buoy {
  fill: var(--terracotta);
  stroke: var(--white);
  stroke-width: 1.5;
  transform-box: fill-box;
  transform-origin: center;
  transition: transform .35s cubic-bezier(.16,1,.3,1);
}

.parcel { fill: var(--white); stroke: var(--ink); stroke-width: 1.25; }
.parcel-sage { fill: var(--sage); }
.parcel-terra { fill: var(--terracotta); }

.stations circle { fill: var(--white); stroke: var(--ink); stroke-width: 1.5; }
.stations .dot { fill: var(--ink); stroke: none; }
.c-place text { font-family: var(--serif); font-size: 16px; fill: var(--ink); letter-spacing: .01em; }
/* Halo de carta náutica: el texto enmascara las líneas que cruza */
.c-place text, .c-water-label, .c-rose text, .c-scale text { paint-order: stroke; stroke: var(--white); stroke-width: 5px; stroke-linejoin: round; }

.c-cartouche rect { fill: var(--white); stroke: var(--ink); stroke-width: .75; }
.c-cartouche-title { font-family: var(--serif); font-size: 16px; font-weight: 600; fill: var(--ink); }
.c-cartouche-sub { font-family: var(--sans); font-size: 11px; letter-spacing: .06em; text-transform: uppercase; fill: var(--ink-soft); }

.c-scale-bar { stroke: var(--ink); stroke-width: 5; }
.c-scale-fill { stroke: var(--white); stroke-width: 3; }
.c-scale text { font-family: var(--sans); font-size: 10px; letter-spacing: .04em; fill: var(--ink-soft); }

.c-rose circle { fill: none; stroke: var(--ink); stroke-width: .75; }
.c-rose .inner { stroke-opacity: .5; }
.c-rose .needle-n { fill: var(--ink); }
.c-rose .needle-s { fill: var(--white); stroke: var(--ink); stroke-width: .75; }
.c-rose text { font-family: var(--serif); font-size: 11px; font-weight: 600; fill: var(--ink); }

.c-neat { fill: none; stroke: var(--ink); stroke-width: 1; }
.c-neat-ladder { fill: none; stroke: var(--green); stroke-width: 5; stroke-dasharray: 24 24; }

/* Estado de la leyenda: el tramo enfocado se resalta, el resto descansa */
.chart[data-focus] .seg { opacity: .28; }
.chart[data-focus] .route-arrows path { opacity: .35; }
.chart[data-focus="retorno"] .seg-retorno,
.chart[data-focus="circular"] .seg-circular { opacity: 1; stroke-width: 3.2; stroke-dasharray: none; }
.chart[data-focus="registro"] .buoy { transform: scale(1.7); }

.chart-caption {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: var(--s2) var(--s4);
  margin-top: var(--s3);
  align-items: start;
}
.chart-note { grid-column: 1 / -1; font-size: var(--step--1); color: var(--ink-soft); max-width: 60ch; }
.legend { display: flex; flex-wrap: wrap; gap: 0 var(--s4); }
.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  min-height: 44px;
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--ink);
  text-decoration: none;
}
.legend-item:hover span, .legend-item:focus-visible span { text-decoration: underline; text-decoration-color: var(--terracotta); text-underline-offset: .22em; }
.legend-key { width: 28px; height: 12px; flex: none; }
.k-retorno { stroke: var(--terracotta); stroke-width: 3; stroke-linecap: round; }
.k-circular { stroke: var(--green); stroke-width: 3; stroke-linecap: round; }
.k-registro { fill: var(--terracotta); }

.motion-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 44px;
  padding: 0 0.25rem;
  border: 0;
  background: none;
  color: var(--ink-soft);
  font: 500 0.875rem var(--sans);
  cursor: pointer;
}
.motion-toggle:hover { color: var(--ink); }
.motion-toggle .icon { width: 1rem; height: 1rem; }
.motion-toggle .i-play { display: none; }
.motion-toggle[aria-pressed="true"] .i-pause { display: none; }
.motion-toggle[aria-pressed="true"] .i-play { display: inline; }

/* ---------- Inicio: propuesta ---------- */

.intro-grid { row-gap: var(--s5); }
.intro-grid > h2 { grid-column: 1 / 6; }
.intro-body { grid-column: 7 / 13; }
.intro-body .prose p:first-child { font-size: var(--step-1); line-height: 1.55; color: var(--ink); }

.notes {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--s5);
  margin-top: var(--s6);
  padding-top: var(--s5);
  border-top: 1px solid var(--ink);
}
.notes dt { font-family: var(--serif); font-size: var(--step-1); font-style: italic; color: var(--green); margin-bottom: var(--s1); }
.notes dd { color: var(--ink-soft); font-size: 0.9875rem; }

/* ---------- Áreas (tabla de almanaque) ---------- */

.area-rows { border-bottom: 1px solid var(--line-strong); }
.area-row {
  position: relative;
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr) minmax(0, 1.25fr) auto;
  gap: var(--s5);
  align-items: center;
  padding-block: var(--s5);
  border-top: 1px solid var(--line-strong);
}
.area-row h3 a { color: var(--ink); text-decoration: none; }
.area-row h3 a::after { content: ""; position: absolute; inset: 0; }
.area-row h3 a:focus-visible { outline: none; }
.area-row:has(a:focus-visible) { outline: 2px solid var(--green); outline-offset: 4px; border-radius: 4px; }
.area-row p { color: var(--ink-soft); }
.area-row .go { display: inline-flex; align-items: center; gap: .4rem; font-weight: 600; color: var(--green); white-space: nowrap; }
.area-row .go .icon { transition: transform .25s cubic-bezier(.16,1,.3,1); }
.area-row:hover .go .icon { transform: translateX(4px); }
.area-row:hover h3 a { text-decoration: underline; text-decoration-color: var(--terracotta); text-decoration-thickness: 1.5px; text-underline-offset: .2em; }

.mini { width: 112px; height: auto; }
.mini .m-route { fill: none; stroke: var(--green); stroke-width: 1.5; stroke-dasharray: 1.2 4.5; stroke-linecap: round; }
.mini .m-land { fill: var(--sage); fill-opacity: .55; stroke: var(--green); stroke-width: 1; }
.mini .m-hl { fill: none; stroke: var(--terracotta); stroke-width: 3; stroke-linecap: round; }
.mini .m-hl-green { stroke: var(--green); }
.mini .m-buoy { fill: var(--terracotta); stroke: var(--white); stroke-width: 1.2; }
.mini .m-frame { fill: var(--white); stroke: var(--ink); stroke-width: 1; }

/* ---------- Curva de marea (proceso) ---------- */

.tide { margin-top: var(--s3); }
.tide-svg { width: 100%; height: auto; }
.tide-wave { fill: none; stroke: var(--green); stroke-width: 2; }
.tide-level { fill: none; stroke: var(--green); stroke-opacity: .18; stroke-width: 1; stroke-dasharray: 2 5; }
.tide-return { fill: none; stroke: var(--terracotta); stroke-width: 1.5; stroke-dasharray: 4 5; }
.tide-arrow { fill: var(--terracotta); }
.tide-station circle { fill: var(--white); stroke: var(--green); stroke-width: 2; }
.tide-station text { font-family: var(--sans); font-size: 13px; font-weight: 650; fill: var(--green); }
.tide-note { font-family: var(--serif); font-style: italic; font-size: 16px; fill: var(--terracotta-ink); }

.steps-row {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: var(--col-gap);
  counter-reset: paso;
  margin-top: var(--s4);
}
.steps-row li { counter-increment: paso; }
.steps-row h3 { font-family: var(--serif); font-size: var(--step-1); line-height: 1.25; margin-bottom: var(--s1); }
.steps-row h3::before { content: counter(paso) ". "; color: var(--terracotta-ink); font-family: var(--sans); font-size: .95rem; font-weight: 650; }
.steps-row p { font-size: 0.9375rem; color: var(--ink-soft); }
.process-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s3); margin-top: var(--s6); padding-top: var(--s4); border-top: 1px solid var(--line); }
.process-foot p { color: var(--ink-soft); font-size: 0.9375rem; max-width: 60ch; }

/* ---------- Trazabilidad ---------- */

.trace-grid { row-gap: var(--s6); align-items: start; }
.trace-copy { grid-column: 1 / 6; }
.trace-copy .h-lg { margin-bottom: var(--s4); }
.trace-sheet { grid-column: 7 / 13; }

.ticks { margin-top: var(--s4); display: grid; gap: var(--s2); }
.ticks li { display: grid; grid-template-columns: 14px 1fr; gap: var(--s2); align-items: baseline; color: var(--ink-soft); }
.ticks li::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--terracotta); transform: translateY(-1px); }
.ticks strong { color: var(--ink); font-weight: 600; }

.sheet {
  background: var(--white);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  padding: clamp(1.25rem, 3vw, 2rem);
}
/* Registro ilustrativo: tabla de almanaque sobre el papel, sin caja */
.almanac { border-block: 1px solid var(--ink); padding-block: var(--s4); }
.almanac-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s2); margin-bottom: var(--s1); }
.almanac-head h3 { font-family: var(--serif); font-size: var(--step-1); }
.almanac-foot { margin-top: var(--s4); padding-top: var(--s3); border-top: 1px solid var(--line); font-family: var(--serif); font-style: italic; font-size: 0.9375rem; color: var(--ink-soft); }
.sheet-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s2); margin-bottom: var(--s1); }
.sheet-head h3 { font-family: var(--serif); font-size: var(--step-1); }
.tag {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .3rem .7rem;
  border: 1px solid var(--terracotta);
  border-radius: 999px;
  color: var(--terracotta-ink);
  font-size: 0.8125rem;
  font-weight: 650;
  line-height: 1.2;
}
.sheet-meta { font-size: 0.875rem; color: var(--ink-soft); font-variant-numeric: tabular-nums; margin-bottom: var(--s4); }

.table-scroll { overflow-x: auto; }
.log { width: 100%; border-collapse: collapse; font-size: 0.9375rem; font-variant-numeric: tabular-nums; min-width: 440px; }
.log caption { text-align: left; }
.log th { text-align: left; font-size: 0.8125rem; font-weight: 650; color: var(--ink-soft); padding: 0 var(--s2) var(--s2) 0; border-bottom: 1px solid var(--ink); }
.log td { padding: var(--s2) var(--s2) var(--s2) 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.log tr:last-child td { border-bottom: 0; }
.state { display: inline-flex; align-items: center; gap: .45rem; white-space: nowrap; }
.state::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--line-strong); flex: none; }
.state-go::before { background: var(--green); }
.state-check::before { background: var(--sage); box-shadow: inset 0 0 0 1px var(--green); }
.state-mark::before { background: var(--terracotta); }
.sheet-foot { margin-top: var(--s4); padding-top: var(--s3); border-top: 1px solid var(--line); font-size: 0.8125rem; color: var(--ink-soft); }

/* ---------- Preguntas frecuentes ---------- */

.faq-grid { row-gap: var(--s5); }
.faq-grid > .faq-head { grid-column: 1 / 5; }
.faq-grid > .faq-list { grid-column: 6 / 13; }
.faq-head p { margin-top: var(--s3); color: var(--ink-soft); max-width: 32ch; }
.faq-list { border-bottom: 1px solid var(--line-strong); }
.faq-item { border-top: 1px solid var(--line-strong); }
.faq-item summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s3);
  min-height: 64px;
  padding-block: var(--s3);
  font-family: var(--serif);
  font-size: var(--step-1);
  line-height: 1.3;
  cursor: pointer;
  list-style: none;
  border-radius: 4px;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary:hover { color: var(--green); }
.faq-icon { width: 22px; height: 22px; flex: none; stroke: var(--green); stroke-width: 1.75; fill: none; stroke-linecap: round; }
.faq-icon .v { transition: transform .3s cubic-bezier(.16,1,.3,1); transform-origin: center; transform-box: fill-box; }
.faq-item[open] .faq-icon .v { transform: scaleY(0); }
.faq-answer { padding-bottom: var(--s4); color: var(--ink-soft); max-width: 62ch; }
.faq-answer > * + * { margin-top: var(--s2); }

/* ---------- Cierre ---------- */

.closing {
  position: relative;
  overflow: hidden;
  background: var(--green);
  color: var(--ivory);
}
.closing-contours {
  position: absolute;
  right: -6%;
  top: 50%;
  width: min(760px, 90%);
  transform: translateY(-50%);
  pointer-events: none;
}
.closing-contours use, .closing-contours path { fill: none; stroke: var(--sage); stroke-opacity: .28; stroke-width: 1; vector-effect: non-scaling-stroke; }
.closing-contours .k { stroke-dasharray: 3 5; }
.closing-inner { position: relative; }
.closing h2 { font-family: var(--serif); font-size: var(--step-4); line-height: 1.04; letter-spacing: -0.02em; max-width: 14ch; }
.closing p { margin-top: var(--s4); color: var(--sage-light); font-size: var(--step-1); max-width: 40ch; }
.closing .actions { margin-top: var(--s5); }
.closing :focus-visible { outline-color: var(--sage); }

/* ---------- Pie ---------- */

.site-footer { padding-block: var(--s6) var(--s5); border-top: 1px solid var(--line); }
.foot-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: var(--s5) var(--col-gap); }
.foot-brand { grid-column: 1 / 6; }
.foot-brand p { margin-top: var(--s3); color: var(--ink-soft); font-size: 0.9375rem; max-width: 36ch; }
.foot-nav { grid-column: 7 / 10; }
.foot-nav ul { display: grid; gap: .1rem; }
.foot-link { display: inline-flex; align-items: center; min-height: 40px; color: var(--ink-soft); text-decoration: none; font-size: 0.9375rem; }
.foot-link:hover { color: var(--ink); text-decoration: underline; text-decoration-color: var(--terracotta); }
.foot-link[aria-current="page"] { color: var(--ink); font-weight: 600; }
.foot-contact { grid-column: 10 / 13; display: grid; gap: var(--s2); font-size: 0.9375rem; }
.foot-contact span, .channel-list span { display: block; font-size: .8125rem; color: var(--ink-soft); }
.foot-legal { grid-column: 1 / -1; padding-top: var(--s4); border-top: 1px solid var(--line); font-size: 0.8125rem; color: var(--ink-soft); }

/* ---------- Páginas interiores ---------- */

.page-head { padding-block: clamp(2.5rem, 7vw, 6rem) clamp(2rem, 5vw, 4rem); }
.page-head-grid { row-gap: var(--s4); align-items: end; }
.page-head h1 { grid-column: 1 / 9; }
.page-head .lead { grid-column: 1 / 8; max-width: 52ch; }
.page-head-aside { grid-column: 9 / 13; grid-row: 1 / span 2; align-self: end; }

.toc { border-top: 1px solid var(--ink); }
.toc li { border-bottom: 1px solid var(--line); }
.toc a { display: flex; align-items: center; gap: var(--s2); min-height: 52px; color: var(--ink); text-decoration: none; font-weight: 500; }
.toc a:hover span { text-decoration: underline; text-decoration-color: var(--terracotta); text-underline-offset: .22em; }
.toc .legend-key { width: 24px; }

.notice {
  display: grid;
  grid-template-columns: 22px 1fr;
  gap: var(--s2);
  padding-top: var(--s3);
  border-top: 1px solid var(--line-strong);
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.0625rem;
  color: var(--ink-soft);
  max-width: 70ch;
}
.notice .icon { color: var(--green); margin-top: .15rem; }

/* Soluciones */
.area-block { padding-block: var(--s7); border-top: 1px solid var(--line-strong); }
.area-block:last-of-type { border-bottom: 1px solid var(--line-strong); }
.area-grid { row-gap: var(--s5); align-items: start; }
.area-title { grid-column: 1 / 6; position: sticky; top: calc(var(--header-h) + var(--s4)); }
.area-title .mini { width: 168px; margin-bottom: var(--s4); }
.area-title p { margin-top: var(--s3); color: var(--ink-soft); max-width: 34ch; }
.area-facets { grid-column: 7 / 13; display: grid; gap: var(--s5); }
.facet { display: grid; grid-template-columns: 9.5rem minmax(0, 1fr); gap: var(--s3); padding-top: var(--s3); border-top: 1px solid var(--line); }
.facet:first-child { border-top: 0; padding-top: 0; }
.facet h3 { font-family: var(--sans); font-size: 0.9375rem; font-weight: 650; color: var(--green); }
.facet p { color: var(--ink-soft); }
.facet ul { display: grid; gap: .35rem; margin-top: var(--s2); }
.facet li { display: grid; grid-template-columns: 14px 1fr; gap: var(--s1); color: var(--ink-soft); }
.facet li::before { content: ""; width: 6px; height: 6px; margin-top: .6em; border-radius: 50%; background: var(--terracotta); }

.connect-grid { row-gap: var(--s5); align-items: center; }
.connect-grid > .connect-copy { grid-column: 1 / 6; }
.connect-grid > .connect-visual { grid-column: 7 / 13; }
.connect-copy .h-lg { margin-bottom: var(--s4); }

/* Cómo funciona */
.howto-grid { row-gap: var(--s6); align-items: start; }
.staff-wrap { grid-column: 1 / 4; position: sticky; top: calc(var(--header-h) + var(--s5)); }
.steps-col { grid-column: 5 / 13; }

.staff { position: relative; padding-left: 34px; }
.staff::before {
  content: "";
  position: absolute;
  left: 0; top: 4px; bottom: 4px;
  width: 22px;
  border: 1px solid var(--ink);
  background:
    repeating-linear-gradient(180deg, var(--ink) 0 1px, transparent 1px 12px) right / 9px 100% no-repeat,
    repeating-linear-gradient(180deg, var(--ink) 0 1.5px, transparent 1.5px 60px) right / 16px 100% no-repeat,
    var(--white);
}
.staff-title { font-family: var(--serif); font-style: italic; color: var(--green); font-size: 1.0625rem; margin-bottom: var(--s3); }
.staff ol { display: grid; gap: .1rem; }
.staff a {
  position: relative;
  display: grid;
  grid-template-columns: 1.6rem 1fr;
  align-items: center;
  min-height: 52px;
  color: var(--ink-soft);
  text-decoration: none;
  font-size: 0.9375rem;
  font-weight: 500;
  line-height: 1.3;
}
.staff a::before {
  content: "";
  position: absolute;
  left: -34px; top: 50%;
  width: 22px; height: 0;
  border-top: 2px solid transparent;
  transform: translateY(-50%);
  transition: border-color .3s ease;
}
.staff .n { font-variant-numeric: tabular-nums; font-weight: 650; color: var(--ink-soft); }
.staff a:hover { color: var(--ink); }
.staff a[aria-current="step"] { color: var(--ink); font-weight: 650; }
.staff a[aria-current="step"] .n { color: var(--terracotta-ink); }
.staff a[aria-current="step"]::before { border-top: 3px solid var(--terracotta); }
.staff a.is-next::before { border-top: 2px dashed var(--terracotta); }
.staff a.is-next .next-hint { display: inline; }
.next-hint { display: none; grid-column: 2; font-size: .8125rem; font-weight: 500; color: var(--terracotta-ink); }

.step { padding-block: var(--s6); border-top: 1px solid var(--line-strong); }
.step:first-child { border-top: 0; padding-top: 0; }
.step-n { display: inline-block; min-width: 1.1em; margin-right: .35em; font-family: var(--sans); font-size: .5em; font-weight: 650; vertical-align: .55em; color: var(--terracotta-ink); font-variant-numeric: tabular-nums; }
.step .prose { margin-top: var(--s4); }
.step-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s5); margin-top: var(--s5); padding-top: var(--s4); border-top: 1px solid var(--line); }
.step-facts h3 { font-size: 0.9375rem; font-weight: 650; color: var(--green); margin-bottom: var(--s2); }
.step-facts ul { display: grid; gap: .4rem; }
.step-facts li { display: grid; grid-template-columns: 14px 1fr; gap: var(--s1); color: var(--ink-soft); font-size: 0.9375rem; }
.step-facts li::before { content: ""; width: 6px; height: 6px; margin-top: .6em; border-radius: 50%; background: var(--terracotta); }
.step-facts p { color: var(--ink-soft); font-size: 0.9375rem; }
.step-next { margin-top: var(--s4); }

.flow { margin-top: var(--s5); }
.flow-svg { width: 100%; height: auto; }
.flow-box { fill: var(--white); stroke: var(--ink); stroke-width: 1; }
.flow-box-hl { fill: var(--sage-wash); stroke: var(--green); }
.flow-line { fill: none; stroke: var(--green); stroke-width: 1.5; }
.flow-arrow { fill: var(--green); }
.flow-text { font-family: var(--sans); font-size: 14px; font-weight: 600; fill: var(--ink); }
.flow-sub { font-family: var(--serif); font-style: italic; font-size: 13px; fill: var(--ink-soft); }
.flow-cap { margin-top: var(--s2); font-size: 0.8125rem; color: var(--ink-soft); }

/* Nosotros */
.essay-grid { row-gap: var(--s5); }
.essay { grid-column: 3 / 11; }
.essay .prose { max-width: 64ch; }
.essay .prose p { font-size: 1.125rem; line-height: 1.7; }
.essay h2 { margin-top: var(--s7); margin-bottom: var(--s4); }
.essay h2:first-child { margin-top: 0; }
.pull {
  margin-block: var(--s7);
  padding-block: var(--s5);
  border-block: 1px solid var(--ink);
  font-family: var(--serif);
  font-style: italic;
  font-size: var(--step-3);
  line-height: 1.15;
  color: var(--green);
  letter-spacing: -0.01em;
}
.principles { display: grid; gap: 0; margin-top: var(--s4); counter-reset: pr; border-bottom: 1px solid var(--line-strong); }
.principles li { counter-increment: pr; display: grid; grid-template-columns: 3rem minmax(0, 1fr); gap: var(--s3); padding-block: var(--s4); border-top: 1px solid var(--line-strong); }
.principles li::before { content: counter(pr); font-family: var(--serif); font-size: var(--step-2); line-height: 1; color: var(--terracotta-ink); }
.principles h3 { font-family: var(--serif); font-size: var(--step-1); margin-bottom: var(--s1); }
.principles p { color: var(--ink-soft); }

/* Contacto */
.contact-grid { row-gap: var(--s6); align-items: start; padding-block: clamp(2.5rem, 6vw, 5rem) var(--s8); }
.contact-copy { grid-column: 1 / 6; }
.contact-copy .lead { margin-top: var(--s4); }
.contact-copy .h-sm { margin-top: var(--s6); margin-bottom: var(--s3); }
.contact-form-wrap { grid-column: 7 / 13; }
.contact-channels { margin-top: var(--s6); }
.channel-list { display: grid; gap: var(--s3); margin-top: var(--s3); }

.form { display: grid; gap: var(--s4); }
.field { display: grid; gap: .45rem; }
.field label { font-weight: 600; font-size: 0.9875rem; }
.field .opt { font-weight: 400; color: var(--ink-soft); }
.field input, .field textarea {
  width: 100%;
  min-height: 52px;
  padding: .8rem 1rem;
  border: 1.5px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--white);
  color: var(--ink);
  font: inherit;
  font-size: 1rem;
  transition: border-color .2s ease, box-shadow .2s ease;
}
.field textarea { min-height: 168px; resize: vertical; line-height: 1.5; }
.field input:hover, .field textarea:hover { border-color: var(--ink-soft); }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--green); box-shadow: 0 0 0 3px var(--sage-wash); }
.field input::placeholder, .field textarea::placeholder { color: #6B726C; }
.field [aria-invalid="true"] { border-color: var(--terracotta-ink); }
.field-error { display: none; align-items: flex-start; gap: .4rem; font-size: 0.875rem; font-weight: 500; color: var(--terracotta-ink); }
.field-error.is-visible { display: flex; }
.field-error .icon { width: 1rem; height: 1rem; margin-top: .15rem; }
.form-foot { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s3) var(--s4); margin-top: var(--s1); }
.form-foot p { font-size: 0.8125rem; color: var(--ink-soft); max-width: 36ch; }
.form-status { font-size: 0.9375rem; }
.form-status:empty { display: none; }
.form-status.is-error { display: grid; grid-template-columns: 20px 1fr; gap: var(--s2); padding: var(--s3); border: 1px solid var(--terracotta); border-radius: var(--radius); color: var(--ink); background: var(--white); }
.form-status.is-error .icon { color: var(--terracotta-ink); width: 1.1rem; height: 1.1rem; margin-top: .1rem; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.form-success { display: grid; gap: var(--s3); }
.form-success .icon { width: 2rem; height: 2rem; color: var(--green); }
.form-success p { color: var(--ink-soft); }

/* 404 */
.lost-links { display: grid; gap: 0; margin-top: var(--s5); border-top: 1px solid var(--ink); max-width: 520px; }
.lost-links li { border-bottom: 1px solid var(--line); }
.lost-links a { display: flex; justify-content: space-between; align-items: center; min-height: 56px; color: var(--ink); text-decoration: none; font-family: var(--serif); font-size: var(--step-1); }
.lost-links a:hover { color: var(--green); }

/* ---------- Adaptación ---------- */

@media (max-width: 1080px) {
  .area-row { grid-template-columns: 96px minmax(0, 1fr) auto; }
  .area-row p { grid-column: 2 / 4; grid-row: 2; }
  .mini { width: 96px; }
  .area-row .mini { grid-row: 1 / span 2; align-self: start; }
  .steps-row { grid-template-columns: repeat(3, minmax(0, 1fr)); row-gap: var(--s5); }
}

@media (max-width: 880px) {
  .hero-copy, .hero-visual,
  .intro-grid > h2, .intro-body,
  .trace-copy, .trace-sheet,
  .faq-grid > .faq-head, .faq-grid > .faq-list,
  .page-head h1, .page-head .lead, .page-head-aside,
  .area-title, .area-facets,
  .connect-grid > .connect-copy, .connect-grid > .connect-visual,
  .staff-wrap, .steps-col,
  .essay,
  .contact-copy, .contact-form-wrap,
  .section-head > h2, .section-head > p { grid-column: 1 / -1; }
  .page-head-aside { grid-row: auto; }
  .area-title { position: static; }
  .staff-wrap { position: static; }
  .staff ol { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
  .foot-brand { grid-column: 1 / -1; }
  .foot-nav { grid-column: 1 / 7; }
  .foot-contact { grid-column: 7 / 13; }
  .tide { display: none; }
  .steps-row { grid-template-columns: 1fr; gap: 0; border-left: 2px solid var(--green); margin-left: 6px; }
  .steps-row li { position: relative; padding: 0 0 var(--s4) var(--s4); }
  .steps-row li::before { content: ""; position: absolute; left: -8px; top: .4em; width: 14px; height: 14px; border-radius: 50%; background: var(--white); border: 2px solid var(--green); }
}

@media (max-width: 480px) {
  .log { min-width: 0; }
  .log thead { display: none; }
  .log tr { display: grid; grid-template-columns: 5.5rem 1fr; gap: .2rem var(--s2); padding-block: var(--s2); border-bottom: 1px solid var(--line); }
  .log tr:last-child { border-bottom: 0; }
  .log td { display: contents; }
  .log td::before { content: attr(data-label); font-size: .8125rem; font-weight: 650; color: var(--ink-soft); }
}

@media (max-width: 640px) {
  .notes { grid-template-columns: 1fr; }
  .area-row { grid-template-columns: 1fr auto; gap: var(--s2) var(--s3); }
  .area-row .mini { grid-row: auto; grid-column: 1 / -1; width: 88px; }
  .area-row p { grid-column: 1 / -1; grid-row: auto; }
  .area-row .go { grid-column: 2; grid-row: 2; }
  .facet { grid-template-columns: 1fr; gap: var(--s1); }
  .step-facts { grid-template-columns: 1fr; }
  .chart-caption { grid-template-columns: 1fr; }
  .legend { flex-direction: column; }
  .principles li { grid-template-columns: 2.25rem minmax(0, 1fr); }
  .foot-nav, .foot-contact { grid-column: 1 / -1; }
  .closing-contours { opacity: .6; width: 120%; right: -40%; }
  /* En pantallas pequeñas la carta se reduce: sus rótulos crecen para seguir legibles */
  .c-place text { font-size: 20px; }
  .c-water-label { font-size: 17px; }
  .c-cartouche-title { font-size: 18px; }
  .c-cartouche-sub { font-size: 14px; }
  .c-scale text, .c-rose text { font-size: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

@media print {
  .site-header, .closing, .motion-toggle { display: none; }
  body { background: #fff; }
}
