/* Roca Huasteca. Palette from the place: limestone, cave shade, spring water, and a rope in rosa mexicano. */
:root {
  --caliza: #D9DAD1;
  --caliza-clara: #EBECE5;
  --caliza-honda: #C3C6BA;
  --sombra: #17201E;
  --sombra-2: #223230;
  --gris: #555E59;
  --cuerda: #E0156F;
  --cuerda-honda: #A80D52;
  --agua: #0E8F86;
  --acero: #8F9690;

  --gutter: clamp(48px, 8vw, 132px);   /* the rope hangs in the middle of this */
  --edge: clamp(18px, 4.5vw, 72px);
  --rope-x: calc(var(--gutter) / 2);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--caliza);
  color: var(--sombra);
  font-family: "Archivo", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 1.0625rem;
  line-height: 1.55;
  font-stretch: 100%;
}
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration-color: var(--cuerda); text-decoration-thickness: 2px; text-underline-offset: 3px; }
a:hover { color: var(--cuerda-honda); }
:focus-visible { outline: 3px solid var(--cuerda); outline-offset: 3px; border-radius: 2px; }
h1, h2, h3, p, ul, ol, dl, dd, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }

.skip { position: absolute; left: -999px; top: 8px; background: var(--caliza-clara); padding: 8px 14px; z-index: 50; }
.skip:focus { left: 8px; }

/* ---------- the rope ---------- */
.page { position: relative; }
.rope {
  position: absolute;
  left: calc(var(--rope-x) - 3.5px);
  top: 150px;
  bottom: 0;
  width: 7px;
  border-radius: 4px;
  z-index: 3;
  background:
    repeating-linear-gradient(-58deg,
      var(--cuerda) 0 7px, var(--cuerda-honda) 7px 9px,
      var(--cuerda) 9px 16px, #F7B9D5 16px 17.5px);
  box-shadow: inset -2px 0 0 rgba(0, 0, 0, .2);
  transform-origin: top;
  animation: drop 1.5s cubic-bezier(.22, .8, .24, 1) .15s both;
}
@keyframes drop { from { transform: scaleY(0); } to { transform: scaleY(1); } }

/* ---------- hero: inside the cave, looking out ---------- */
.hero {
  position: relative;
  min-height: 100svh;
  background: var(--sombra);
  color: var(--caliza-clara);
  overflow: hidden;
  display: grid;
  grid-template-rows: auto 1fr auto;
  padding: 0 var(--edge) clamp(22px, 4vh, 44px) var(--gutter);
}
.mouth, .mouth-rim {
  position: absolute;
  top: 0; right: 0;
  width: min(62vw, 980px);
  height: 92%;
  clip-path: polygon(34% 0, 100% 0, 100% 100%, 86% 97%, 71% 99%, 60% 92%, 49% 95%, 38% 86%, 31% 88%, 22% 76%, 26% 66%, 15% 57%, 18% 46%, 9% 37%, 16% 28%, 12% 18%, 24% 12%, 27% 4%);
}
.mouth-rim {
  background: var(--sombra-2);
  transform: translate(-26px, 16px) scale(1.03);
  transform-origin: top right;
}
.mouth-img { width: 100%; height: 100%; object-fit: cover; object-position: 12% 40%; transform: scaleX(-1); }
.mouth .slot { width: 100%; height: 100%; }

.top {
  position: relative; z-index: 4;
  display: flex; align-items: center; gap: clamp(14px, 3vw, 40px);
  padding: 22px 0;
  font-size: .95rem;
}
.top .brand {
  font-stretch: 68%; font-weight: 800; font-size: 1.5rem; letter-spacing: .005em;
  text-decoration: none; margin-right: auto;
}
.top ul { display: flex; gap: clamp(14px, 2.4vw, 30px); background: rgba(23, 32, 30, .72); padding: 7px 18px; border-radius: 99px; }
.top a { text-decoration: none; }
.top ul a { color: var(--caliza-clara); }
.top a:hover { color: #fff; text-decoration: underline; text-decoration-color: var(--cuerda); }
.top .lang { border: 1.5px solid currentColor; padding: 6px 14px; border-radius: 99px; background: rgba(23, 32, 30, .72); }

.anchor {
  position: absolute; z-index: 4;
  left: calc(var(--rope-x) - 26px);
  top: 84px;
  width: 52px;
}

.hero-text { position: relative; z-index: 4; align-self: end; max-width: 46rem; padding-bottom: clamp(20px, 5vh, 56px); }
h1 {
  font-stretch: 62%;
  font-weight: 800;
  font-size: clamp(3.6rem, 11.5vw, 10.5rem);
  line-height: .86;
  letter-spacing: -.012em;
  text-wrap: balance;
  max-width: 7.2em;
}
.lede { margin-top: clamp(18px, 3vh, 30px); font-size: clamp(1.05rem, 1.5vw, 1.3rem); line-height: 1.45; max-width: 34rem; color: #D3D6CE; }
.cta-row { margin-top: clamp(20px, 3.4vh, 34px); display: flex; flex-wrap: wrap; align-items: center; gap: 14px 26px; }

.btn {
  display: inline-block;
  background: var(--cuerda); color: #fff;
  font: inherit; font-weight: 700; font-stretch: 88%; font-size: 1.08rem;
  padding: 15px 24px; border: 0; border-radius: 6px;
  text-decoration: none; cursor: pointer;
}
.btn:hover { background: var(--cuerda-honda); color: #fff; }
.btn.ghost { background: transparent; color: var(--sombra); box-shadow: inset 0 0 0 2px var(--sombra); }
.btn.ghost:hover { background: var(--sombra); color: var(--caliza-clara); }
.quiet { font-weight: 600; }
.hero .quiet:hover { color: #fff; }

.hero-facts {
  position: relative; z-index: 4;
  display: flex; flex-wrap: wrap; gap: 14px clamp(22px, 4vw, 56px);
  border-top: 1px solid rgba(235, 236, 229, .28);
  padding-top: 18px;
}
.hero-facts dt { font-size: .82rem; color: #A9B0A9; }
.hero-facts dd { font-stretch: 75%; font-weight: 700; font-size: 1.32rem; line-height: 1.2; }

/* ---------- sections hang off the rope ---------- */
main { position: relative; }
.pitch {
  position: relative;
  padding: clamp(64px, 10vw, 132px) var(--edge) 0 var(--gutter);
}
.pitch:last-child { padding-bottom: clamp(64px, 9vw, 120px); }
.bolt {
  position: absolute; z-index: 4;
  left: calc(var(--rope-x) - 13px);
  top: calc(clamp(64px, 10vw, 132px) + .55em);
  width: 26px; height: 26px; border-radius: 50%;
  border: 5px solid var(--acero);
  box-shadow: 0 0 0 1.5px rgba(23, 32, 30, .35), inset 0 0 0 1.5px rgba(23, 32, 30, .35);
}
h2 {
  font-stretch: 64%; font-weight: 800;
  font-size: clamp(2.3rem, 5.6vw, 4.6rem);
  line-height: .95; letter-spacing: -.008em;
  max-width: 16em; text-wrap: balance;
}
h3 { font-stretch: 80%; font-weight: 700; font-size: 1.42rem; line-height: 1.15; }
.intro { margin-top: 20px; max-width: 40rem; font-size: 1.16rem; line-height: 1.5; }
.note {
  margin-top: 18px; max-width: 38rem;
  padding-left: 14px; border-left: 3px solid var(--agua);
  font-size: .98rem; color: #2E3A37;
}

/* ---------- outings ---------- */
.outing { margin-top: clamp(40px, 6vw, 80px); }
.outing-photos { display: grid; grid-template-columns: 2fr 1fr; gap: 10px; }
.outing.flip .outing-photos { grid-template-columns: 1fr 2fr; }
.outing.flip .ph-main { order: 2; }
.outing-photos > * { width: 100%; height: clamp(220px, 33vw, 470px); object-fit: cover; }
.outing-photos img, .gear-photos img, .guide-photo { border-radius: 3px; }
.outing-text {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  column-gap: clamp(24px, 5vw, 72px);
  margin-top: clamp(20px, 2.6vw, 34px);
}
.outing-text > * { grid-column: 1; max-width: 36rem; }
.outing-text > p { margin-top: 12px; }
.outing-text > .specs { grid-column: 2; grid-row: 1 / span 3; align-self: start; border-top: 2px solid var(--sombra); }
.specs > div { display: grid; grid-template-columns: 7.2rem 1fr; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--caliza-honda); }
.specs dt { font-size: .92rem; color: var(--gris); padding-top: 2px; }
.specs dd { font-weight: 500; }

/* ---------- safety ---------- */
.system {
  display: grid; grid-template-columns: minmax(260px, .9fr) minmax(0, 1.1fr);
  gap: clamp(24px, 5vw, 72px); align-items: start;
  margin-top: clamp(32px, 5vw, 60px);
}
.diagram { background: var(--caliza-clara); border-radius: 3px; padding: 10px; position: sticky; top: 16px; }
.diagram svg { display: block; width: 100%; height: auto; }
.diagram .rock { fill: var(--caliza-honda); }
.diagram .crack { fill: none; stroke: #A9AD9F; stroke-width: 2; stroke-linecap: round; }
.diagram .ground { fill: var(--acero); }
.diagram .steel { fill: #6F7670; }
.diagram .sling { fill: none; stroke: var(--sombra); stroke-width: 4; stroke-linecap: round; }
.diagram .biner { fill: none; stroke: #6F7670; stroke-width: 4; }
.diagram .line, .diagram .slack { fill: none; stroke: var(--cuerda); stroke-width: 5; stroke-linecap: round; }
.diagram .person path { fill: none; stroke: var(--sombra); stroke-width: 7; stroke-linecap: round; stroke-linejoin: round; }
.diagram .person circle { fill: var(--sombra); }
.diagram .helmet { fill: var(--agua); }
.diagram .tag circle { fill: var(--sombra); }
.diagram .tag text { fill: #fff; font: 800 19px "Archivo", sans-serif; text-anchor: middle; }

.parts { counter-reset: part; display: grid; gap: 26px; }
.parts li { counter-increment: part; display: grid; grid-template-columns: 38px 1fr; column-gap: 16px; }
.parts li::before {
  content: counter(part);
  grid-row: 1 / span 2;
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--sombra); color: #fff;
  font-weight: 800; font-size: 1.05rem; display: grid; place-items: center;
}
.parts p { margin-top: 6px; max-width: 34rem; }

.gear-photos { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-top: clamp(40px, 6vw, 76px); }
.gear-photos > * { aspect-ratio: 4 / 5; width: 100%; object-fit: cover; min-height: 0; }
.checks {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(24px, 5vw, 72px); align-items: start;
  margin-top: clamp(32px, 4.5vw, 60px);
}
.ticks, .plain { margin-top: 12px; display: grid; gap: 9px; max-width: 34rem; }
.ticks li, .plain li { position: relative; padding-left: 30px; }
.ticks li::before {
  content: ""; position: absolute; left: 2px; top: .38em;
  width: 15px; height: 8px; border-left: 3px solid var(--agua); border-bottom: 3px solid var(--agua);
  transform: rotate(-45deg);
}
.plain li::before { content: ""; position: absolute; left: 5px; top: .62em; width: 10px; height: 3px; background: var(--acero); }

/* ---------- the day ---------- */
.tabs { display: inline-flex; margin-top: 28px; border: 2px solid var(--sombra); border-radius: 6px; overflow: hidden; }
.tabs button {
  font: inherit; font-weight: 700; font-stretch: 88%;
  padding: 11px 20px; border: 0; background: transparent; color: var(--sombra); cursor: pointer;
}
.tabs button[aria-selected="true"] { background: var(--sombra); color: var(--caliza-clara); }
.tabs button:focus-visible { outline-offset: -4px; }
.day { margin-top: 30px; max-width: 44rem; }
.day li { display: grid; grid-template-columns: 5.4rem 1fr; gap: 18px; padding: 15px 0; border-bottom: 1px solid var(--caliza-honda); align-items: baseline; }
.day li:first-child { border-top: 2px solid var(--sombra); }
.day time { font-stretch: 68%; font-weight: 800; font-size: 1.75rem; line-height: 1; font-variant-numeric: tabular-nums; }
.day .big p { font-weight: 700; font-size: 1.14rem; }
.day .big time { color: var(--cuerda-honda); }

/* ---------- getting here ---------- */
.routes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(22px, 3.4vw, 48px); margin-top: clamp(30px, 5vw, 56px); }
.route > p { margin-top: 16px; font-size: .98rem; }
.legs { margin-top: 16px; border-left: 4px solid var(--sombra); padding-left: 18px; display: grid; gap: 4px; }
.legs li { position: relative; }
.legs li:not(.leg)::before {
  content: ""; position: absolute; left: -29px; top: .34em;
  width: 18px; height: 18px; border-radius: 50%; background: var(--caliza); border: 4px solid var(--sombra);
}
.legs b { display: block; font-stretch: 82%; font-size: 1.12rem; }
.legs span { display: block; font-size: .93rem; color: var(--gris); }
.legs .leg { padding: 12px 0; font-weight: 600; color: var(--agua); }
.local { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(22px, 4vw, 60px); margin-top: clamp(36px, 5vw, 64px); padding: clamp(20px, 3vw, 36px); background: var(--caliza-clara); border-radius: 3px; }
.local p { margin-top: 10px; max-width: 34rem; }

/* ---------- lists ---------- */
.lists { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(22px, 3.4vw, 48px); margin-top: clamp(28px, 4vw, 48px); }

/* ---------- guide ---------- */
.guide { display: grid; grid-template-columns: minmax(180px, 300px) minmax(0, 1fr); gap: clamp(22px, 4vw, 56px); align-items: start; margin-top: clamp(28px, 4vw, 48px); }
.guide-photo { aspect-ratio: 4 / 5; width: 100%; object-fit: cover; }
.guide p { margin-top: 12px; max-width: 36rem; }

/* ---------- faq ---------- */
.faq { margin-top: 28px; max-width: 46rem; border-top: 2px solid var(--sombra); }
.faq details { border-bottom: 1px solid var(--caliza-honda); }
.faq summary {
  cursor: pointer; list-style: none; padding: 16px 40px 16px 0; position: relative;
  font-stretch: 84%; font-weight: 700; font-size: 1.2rem;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 6px; top: 10px; font-size: 1.7rem; font-weight: 400; color: var(--cuerda-honda); }
.faq details[open] summary::after { content: "\2212"; }
.faq details p { padding: 0 0 18px; max-width: 38rem; }

/* ---------- tie in ---------- */
.tie-in { z-index: 4; margin-top: clamp(64px, 10vw, 132px); padding-top: clamp(56px, 8vw, 100px); background: var(--caliza-clara); }
.knot { position: absolute; z-index: 5; left: calc(var(--rope-x) - 28px); top: -6px; width: 56px; background: transparent; }
.request { margin-top: 30px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px 22px; max-width: 52rem; }
.request label { display: grid; gap: 6px; font-weight: 600; font-size: .95rem; }
.request input:not([type=radio]), .request textarea {
  font: inherit; font-weight: 400; font-size: 1.05rem; color: var(--sombra);
  padding: 12px 13px; border: 2px solid var(--sombra); border-radius: 5px; background: #fff; width: 100%; min-height: 50px;
}
.request fieldset { grid-column: 1 / -1; border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 10px; }
.request legend { font-weight: 600; font-size: .95rem; padding: 0; margin-bottom: 8px; }
.request .wide { grid-column: 1 / -1; }
.pick { position: relative; display: block !important; }
.pick input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.pick span { display: block; padding: 11px 16px; border: 2px solid var(--sombra); border-radius: 5px; font-weight: 600; font-size: 1rem; background: transparent; }
.pick input:checked + span { background: var(--sombra); color: var(--caliza-clara); }
.pick input:focus-visible + span { outline: 3px solid var(--cuerda); outline-offset: 3px; }
.request .btn { grid-column: 1 / -1; justify-self: start; }
.form-error { grid-column: 1 / -1; color: var(--cuerda-honda); font-weight: 700; }
.fallback { margin-top: 22px; max-width: 52rem; padding: 18px; border: 2px dashed var(--cuerda); border-radius: 5px; }
.fallback pre { white-space: pre-wrap; font: inherit; margin: 12px 0 14px; padding: 14px; background: #fff; border-radius: 4px; }
.contact { margin-top: clamp(40px, 6vw, 72px); display: flex; flex-wrap: wrap; gap: 18px clamp(26px, 5vw, 64px); border-top: 2px solid var(--sombra); padding-top: 20px; }
.contact dt { font-size: .85rem; color: var(--gris); }
.contact dd { font-stretch: 82%; font-weight: 700; font-size: 1.22rem; }

/* ---------- footer ---------- */
.foot { background: var(--sombra); color: #B9BFB8; padding: clamp(36px, 6vw, 64px) var(--edge) clamp(72px, 9vw, 96px) var(--gutter); font-size: .95rem; }
.foot-name { font-stretch: 66%; font-weight: 800; font-size: 2.1rem; color: var(--caliza-clara); line-height: 1; margin-bottom: 8px; }
.foot .credits { font-size: .82rem; margin-top: 16px; }
.foot ul.credits { margin-top: 4px; display: flex; flex-wrap: wrap; gap: 2px 18px; }
.foot a:hover { color: #fff; }

/* ---------- photo slots (draft only) ---------- */
.slot {
  display: grid; place-content: center; text-align: center; gap: 4px; padding: 16px;
  min-height: 150px;
  background:
    repeating-linear-gradient(135deg, transparent 0 11px, rgba(23, 32, 30, .07) 11px 12px),
    var(--caliza-honda);
  border-radius: 3px; color: var(--sombra);
}
.slot span { font-stretch: 78%; font-weight: 800; font-size: 1.1rem; }
.slot small { font-size: .88rem; color: #3D4743; max-width: 22ch; }

/* ---------- draft markers ---------- */
.tbc { border-bottom: 3px solid rgba(224, 21, 111, .5); }
.hero .tbc, .foot .tbc { border-bottom-color: rgba(224, 21, 111, .85); }
.tbc.ping { outline: 3px solid var(--cuerda); outline-offset: 4px; }
.draft {
  position: fixed; z-index: 40; right: 12px; bottom: 12px; max-width: min(430px, calc(100vw - 24px));
  background: #fff; color: var(--sombra); border: 2px solid var(--sombra); border-radius: 8px;
  font-size: .9rem; box-shadow: 0 6px 0 rgba(23, 32, 30, .18);
}
.draft summary { cursor: pointer; padding: 10px 14px; list-style: none; display: flex; flex-wrap: wrap; gap: 2px 10px; align-items: baseline; }
.draft summary::-webkit-details-marker { display: none; }
.draft summary b { color: var(--cuerda-honda); }
.draft-body { padding: 0 14px 14px; max-height: 56vh; overflow: auto; }
.draft-body p { margin: 8px 0 6px; font-weight: 600; }
.draft-body ol { list-style: decimal; padding-left: 20px; display: grid; gap: 5px; }
.draft-body ul { list-style: disc; padding-left: 20px; display: grid; gap: 4px; }

@media (min-width: 901px) { h1 { max-width: 40vw; } }

/* ---------- small screens ---------- */
@media (max-width: 900px) {
  .top ul { display: none; }
  .hero { padding-bottom: 20px; }
  .mouth, .mouth-rim {
    width: 100%; height: 47svh;
    clip-path: polygon(30% 0, 100% 0, 100% 86%, 88% 93%, 74% 88%, 62% 97%, 48% 91%, 38% 99%, 27% 88%, 20% 74%, 24% 58%, 16% 44%, 22% 30%, 17% 16%, 26% 9%);
  }
  .mouth-rim { transform: translate(-12px, 12px) scale(1.02); }
  .hero-text { padding-top: 40svh; }
  .system, .checks, .local, .guide, .outing-text { grid-template-columns: minmax(0, 1fr); }
  .outing-text > .specs { grid-column: 1; grid-row: auto; margin-top: 20px; }
  .gear-photos { grid-template-columns: 1fr 1fr; }
  .diagram { position: static; max-width: 420px; }
  .routes, .lists { grid-template-columns: minmax(0, 1fr); }
  .request { grid-template-columns: minmax(0, 1fr); }
  .guide-photo { max-width: 260px; }
  .specs > div { grid-template-columns: 6rem 1fr; }
  .day li { grid-template-columns: 4.4rem 1fr; gap: 12px; }
  .day time { font-size: 1.5rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .rope { animation: none; }
}

@media print {
  .rope, .bolt, .draft, .anchor, .knot { display: none; }
  .hero { min-height: 0; }
}

/* ---------- gallery (photos the guide sends) ---------- */
.gallery { margin-top: clamp(26px, 4vw, 44px); display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); gap: 10px; }
.gallery figure img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 3px; }
.gallery figcaption { margin-top: 6px; font-size: .92rem; color: var(--gris); }
