/* Consultoría Administrativa YBIZ - editorial de despacho
   Tokens: papel, carmesí del logo, tinta, piedra (solo decorativa; el texto pequeño usa --stone-text para AA) */
:root {
  --paper: #FBFAF7;
  --paper-2: #F3F0E9;
  --crimson: #B3202A;
  --crimson-deep: #8F1922;
  --ink: #1B1B1B;
  --stone: #8C8478;
  --stone-text: #5F594F;
  --rule: #D9D4C9;

  --serif: "Newsreader", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --sans: "Public Sans", "Segoe UI", system-ui, sans-serif;

  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-io: cubic-bezier(0.77, 0, 0.175, 1);

  --gutter: clamp(20px, 5vw, 72px);
  --maxw: 1360px;
  --nav-h: 68px;
  --radius: 2px; /* un solo sistema: esquinas casi rectas, como impreso */
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
h1, h2, h3, p, ul, ol { margin: 0; }
ul, ol { padding: 0; list-style: none; }
button, input, select, textarea { font: inherit; }
button { color: inherit; }

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

.skip {
  position: absolute; left: var(--gutter); top: -60px; z-index: 100;
  background: var(--ink); color: var(--paper); padding: 10px 16px; text-decoration: none;
}
.skip:focus { top: 8px; }

.wrap { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: var(--gutter); }

/* ---------- Enlace con subrayado que se dibuja ---------- */
.draw {
  position: relative; text-decoration: none; display: inline-block;
}
.draw::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -2px; height: 1px;
  background: currentColor; transform: scaleX(0); transform-origin: right center;
  transition: transform 260ms var(--ease-out);
}
@media (hover: hover) and (pointer: fine) {
  .draw:hover::after { transform: scaleX(1); transform-origin: left center; }
}
.draw:focus-visible::after, .draw.is-on::after { transform: scaleX(1); transform-origin: left center; }
.draw--always::after { transform: scaleX(1); }
.hero__cta .draw { min-height: 44px; display: inline-flex; align-items: center; }
.hero__cta .draw::after { bottom: 8px; }
@media (hover: hover) and (pointer: fine) {
  .draw--always:hover::after { transform: scaleX(0); transform-origin: right center; }
}

/* ---------- Botones ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 48px; padding: 0 26px; white-space: nowrap;
  background: var(--crimson); color: var(--paper);
  border: 1px solid var(--crimson); border-radius: var(--radius);
  font-family: var(--sans); font-weight: 600; font-size: 0.9375rem; letter-spacing: 0.01em;
  text-decoration: none; cursor: pointer;
  transition: transform 160ms var(--ease-out), background-color 200ms ease, color 200ms ease;
}
.btn:active { transform: scale(0.97); }
@media (hover: hover) and (pointer: fine) { .btn:hover { background: var(--crimson-deep); border-color: var(--crimson-deep); } }
.btn--ghost { background: transparent; color: var(--ink); border-color: var(--ink); }
@media (hover: hover) and (pointer: fine) { .btn--ghost:hover { background: var(--ink); border-color: var(--ink); color: var(--paper); } }
.btn--sm { min-height: 44px; padding: 0 20px; font-size: 0.875rem; }

/* ---------- Navegación ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--paper) 94%, transparent);
  border-bottom: 1px solid var(--rule);
}
@supports (backdrop-filter: blur(1px)) { .nav { backdrop-filter: blur(8px); } }
.nav__in { height: var(--nav-h); display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; min-height: 44px; }
.brand img { height: 40px; width: auto; }
.brand span { font-family: var(--serif); font-size: 1.5rem; font-weight: 500; line-height: 1; letter-spacing: 0.01em; }
.brand span b { display: block; font-family: var(--sans); font-weight: 600; font-size: 0.6875rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--crimson); margin-top: 4px; }
.nav__links { display: none; align-items: center; gap: 36px; }
.nav__links a:not(.btn) { font-size: 0.9375rem; padding: 10px 0; }
.menu-btn {
  width: 48px; height: 48px; display: grid; place-items: center; background: none; border: 1px solid var(--rule);
  border-radius: var(--radius); cursor: pointer; position: relative; transition: transform 160ms var(--ease-out);
}
.menu-btn:active { transform: scale(0.95); }
.menu-btn i { position: absolute; left: 14px; right: 14px; height: 1.5px; background: var(--ink); transition: transform 240ms var(--ease-out); }
.menu-btn i:nth-child(1) { top: 19px; }
.menu-btn i:nth-child(2) { top: 27px; }
.menu-btn[aria-expanded="true"] i:nth-child(1) { transform: translateY(4px) rotate(45deg); }
.menu-btn[aria-expanded="true"] i:nth-child(2) { transform: translateY(-4px) rotate(-45deg); }
.sheet {
  position: fixed; inset: var(--nav-h) 0 0 0; z-index: 49; background: var(--paper);
  padding: 32px var(--gutter) 40px; display: none; flex-direction: column; gap: 4px; overflow-y: auto;
}
.sheet.is-open { display: flex; }
.sheet a:not(.btn) { font-family: var(--serif); font-size: 2rem; line-height: 1.2; padding: 14px 0; border-bottom: 1px solid var(--rule); text-decoration: none; min-height: 56px; }
.sheet .btn { margin-top: 28px; align-self: flex-start; }
@media (min-width: 900px) {
  .nav__links { display: flex; }
  .menu-btn, .sheet { display: none !important; }
}

/* ---------- Hero ---------- */
.hero { padding-block: clamp(36px, 6vh, 72px) clamp(48px, 8vh, 96px); border-bottom: 1px solid var(--rule); }
.hero__grid { display: grid; gap: 48px; }
.hero h1 {
  font-family: var(--serif); font-weight: 350; font-optical-sizing: auto;
  font-size: clamp(2.75rem, 8.4vw, 6.4rem); line-height: 1.02; letter-spacing: -0.03em;
}
.hero h1 em { font-style: italic; color: var(--crimson); font-weight: 300; padding-right: 0.04em; padding-bottom: 0.08em; }
.hero h1 .w { display: inline-block; overflow: hidden; vertical-align: top; padding-bottom: 0.12em; margin-bottom: -0.12em; }
.hero h1 .w > span { display: inline-block; }
.hero__sub { margin-top: 32px; max-width: 34em; font-size: 1.125rem; color: var(--stone-text); }
.hero__cta { margin-top: 36px; display: flex; flex-wrap: wrap; align-items: center; gap: 20px 32px; }

.index { display: none; border-top: 1px solid var(--ink); padding-top: 14px; }
.index h2 { font-size: 0.875rem; font-weight: 600; letter-spacing: 0.2em; text-transform: uppercase; color: var(--stone-text); padding-bottom: 8px; }
.index li { border-bottom: 1px solid var(--rule); }
.index a {
  display: grid; grid-template-columns: 3.1em 1fr; align-items: baseline; gap: 4px; min-height: 44px; padding: 9px 0;
  text-decoration: none; transition: transform 220ms var(--ease-out), color 200ms ease;
}
.index a .n { font-family: var(--serif); font-style: italic; color: var(--stone-text); font-size: 1.0625rem; }
.index a .t { font-family: var(--serif); font-size: 1.1875rem; line-height: 1.25; }
@media (hover: hover) and (pointer: fine) {
  .index a:hover { transform: translateX(6px); color: var(--crimson); }
  .index a:hover .n { color: var(--crimson); }
}
@media (min-width: 1000px) {
  .index { display: block; }
  .hero__grid { grid-template-columns: minmax(0, 1fr) minmax(280px, 340px); gap: clamp(48px, 6vw, 112px); align-items: end; }
}

/* ---------- Secciones ---------- */
.sec { padding-block: clamp(72px, 12vh, 150px); }
h2.title {
  font-family: var(--serif); font-weight: 350; font-size: clamp(2.25rem, 5vw, 4rem); line-height: 1.06; letter-spacing: -0.025em;
}
h2.title em { font-style: italic; color: var(--crimson); font-weight: 300; padding-bottom: 0.08em; padding-right: 0.03em; }
.lede { margin-top: 24px; max-width: 30em; color: var(--stone-text); font-size: 1.0625rem; }

/* Servicios */
.services__grid { display: grid; gap: 40px; }
@media (min-width: 1000px) {
  .services__grid { grid-template-columns: minmax(280px, 0.8fr) minmax(0, 1.7fr); gap: clamp(48px, 7vw, 128px); }
  .services__head { position: sticky; top: calc(var(--nav-h) + 40px); align-self: start; }
}
.acc { border-top: 1px solid var(--ink); }
.acc__item { border-bottom: 1px solid var(--rule); }
.acc__btn {
  width: 100%; display: grid; grid-template-columns: 3.2rem 1fr 44px; align-items: center; gap: 8px 12px;
  padding: 24px 0; min-height: 76px; background: none; border: 0; text-align: left; cursor: pointer;
}
.acc__n { font-family: var(--serif); font-style: italic; font-weight: 300; font-size: 1.75rem; color: var(--stone); line-height: 1; transition: color 240ms ease; }
.acc__t { font-family: var(--serif); font-size: clamp(1.375rem, 2.6vw, 2rem); line-height: 1.15; letter-spacing: -0.015em; transition: transform 260ms var(--ease-out), color 200ms ease; }
.acc__plus { position: relative; width: 44px; height: 44px; }
.acc__plus::before, .acc__plus::after {
  content: ""; position: absolute; left: 12px; right: 12px; top: 50%; height: 1.5px; margin-top: -0.75px; background: var(--ink);
  transition: transform 300ms var(--ease-out), background-color 200ms ease;
}
.acc__plus::after { transform: rotate(90deg); }
.acc__btn[aria-expanded="true"] .acc__plus::after { transform: rotate(0deg); }
.acc__btn[aria-expanded="true"] .acc__n { color: var(--crimson); }
.acc__btn[aria-expanded="true"] .acc__plus::before,
.acc__btn[aria-expanded="true"] .acc__plus::after { background: var(--crimson); }
@media (hover: hover) and (pointer: fine) {
  .acc__btn:hover .acc__t { transform: translateX(6px); color: var(--crimson); }
}
.acc__panel { height: 0; overflow: hidden; }
.acc__panel[hidden] { display: none; }
.acc__body { padding: 0 44px 32px calc(3.2rem + 12px); max-width: 44em; }
.acc__body p { color: var(--stone-text); font-size: 1.0625rem; }
@media (max-width: 560px) { .acc__body { padding: 0 0 28px 0; } .acc__btn { grid-template-columns: 2.4rem 1fr 44px; } }

/* Cómo trabajamos: línea sticky que avanza con el scroll */
.process { padding-block: clamp(72px, 12vh, 150px); }
.process__head { margin-bottom: 56px; }
.steps { position: relative; padding-left: 40px; }
.steps__list { display: grid; gap: 0; }
.steps__line, .steps__prog { position: absolute; left: 9px; top: 6px; bottom: 6px; width: 1px; }
.steps__line { background: var(--rule); }
.steps__prog { background: var(--crimson); width: 2px; left: 8.5px; transform-origin: top center; transform: scaleY(0); }
.step { position: relative; padding-bottom: 44px; }
.step:last-child { padding-bottom: 0; }
.step::before {
  content: ""; position: absolute; left: -40px; top: 9px; width: 19px; height: 19px; border-radius: 50%;
  background: var(--paper); border: 1px solid var(--stone); transition: background-color 260ms ease, border-color 260ms ease;
}
.step.is-on::before { background: var(--crimson); border-color: var(--crimson); }
.step__n { font-family: var(--serif); font-style: italic; font-weight: 300; font-size: 1.25rem; color: var(--stone-text); }
.step h3 { font-family: var(--serif); font-weight: 400; font-size: clamp(1.75rem, 3.4vw, 2.5rem); line-height: 1.1; letter-spacing: -0.02em; margin-top: 4px; }
.step p { margin-top: 12px; color: var(--stone-text); max-width: 26em; }
.js .step { opacity: 0.55; transition: opacity 300ms ease; }
.js .step.is-on { opacity: 1; }

@media (min-width: 1000px) {
  .process--pin { height: calc(640px + 55vh); padding-block: clamp(72px, 12vh, 140px) 0; position: relative; }
  .process--pin .pin { position: sticky; top: calc(var(--nav-h) + 8vh); }
  .process--pin .process__head { margin-bottom: clamp(32px, 6vh, 64px); }
  .process--pin .steps { padding: 44px 0 0; }
  .process--pin .steps__list { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 40px; }
  .process--pin .steps__line, .process--pin .steps__prog { left: 0; right: 0; top: 9px; bottom: auto; width: auto; height: 1px; }
  .process--pin .steps__prog { height: 2px; top: 8.5px; transform-origin: left center; transform: scaleX(0); }
  .process--pin .step { padding-bottom: 0; }
  .process--pin .step::before { left: 0; top: -44px; margin-top: 0; }
  .process--pin .step { padding-top: 0; }
}
/* sin movimiento: lista simple, todo visible, sin sticky */
@media (prefers-reduced-motion: reduce) {
  .process--pin { height: auto !important; padding-block: clamp(72px, 12vh, 150px) !important; }
  .process--pin .pin { position: static !important; height: auto !important; }
  .js .step { opacity: 1 !important; }
}

/* Contacto */
.contact { background: var(--paper-2); border-top: 1px solid var(--rule); }
.contact__grid { display: grid; gap: 56px; }
@media (min-width: 1000px) { .contact__grid { grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: clamp(48px, 7vw, 120px); } }
.channels { margin-top: 40px; display: grid; gap: 28px; }
.channel dt { font-size: 0.875rem; font-weight: 600; letter-spacing: 0.18em; text-transform: uppercase; color: var(--stone-text); }
.channel dd { margin: 6px 0 0; font-family: var(--serif); font-size: clamp(1.5rem, 3vw, 2rem); line-height: 1.2; letter-spacing: -0.01em; word-break: break-word; }
.channel dd small { display: block; margin-top: 10px; font-family: var(--sans); font-size: 0.9375rem; color: var(--stone-text); }
.channel .btn { margin-top: 14px; }

.form { display: grid; gap: 22px; }
.field { display: grid; gap: 8px; }
.field label { font-size: 0.875rem; font-weight: 600; }
.field label small { font-weight: 400; color: var(--stone-text); }
.field input, .field textarea {
  width: 100%; font: inherit; font-size: 1rem; color: var(--ink); background: var(--paper);
  border: 1px solid #8C8478; border-radius: var(--radius); padding: 13px 14px; min-height: 48px;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}
.field textarea { min-height: 148px; resize: vertical; }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--crimson); box-shadow: 0 0 0 3px rgba(179, 32, 42, 0.18); }
.field.has-error input, .field.has-error textarea { border-color: var(--crimson); }
.err { color: var(--crimson-deep); font-size: 0.875rem; font-weight: 500; min-height: 0; }
.err:empty { display: none; }
.form__pair { display: grid; gap: 22px; }
@media (min-width: 640px) { .form__pair { grid-template-columns: 1fr 1fr; } }
.consent { display: grid; grid-template-columns: 24px 1fr; gap: 12px; align-items: start; font-size: 0.9375rem; color: var(--stone-text); }
.consent input { width: 22px; height: 22px; margin: 2px 0 0; accent-color: var(--crimson); }
.consent a { color: var(--ink); }
.form__foot { display: flex; flex-wrap: wrap; gap: 16px 24px; align-items: center; }
.form__status { font-size: 0.9375rem; color: var(--stone-text); max-width: 32em; }
.form__status:empty { display: none; }
.form__status a { color: var(--crimson-deep); }

/* Pie */
.foot { border-top: 1px solid var(--ink); padding-block: 56px 40px; }
.foot__grid { display: grid; gap: 40px; }
.foot__logo { display: inline-flex; align-items: center; gap: 14px; text-decoration: none; }
.foot__logo img { width: 52px; height: auto; }
.foot__logo span { font-family: var(--serif); font-size: 1.75rem; line-height: 1; }
.foot__logo span b { display: block; white-space: nowrap; margin-top: 5px; font-family: var(--sans); font-weight: 600; font-size: 0.6875rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--crimson); }
.foot__legal { font-family: var(--serif); font-size: 1.25rem; line-height: 1.3; letter-spacing: -0.005em; }
.foot__meta { margin-top: 10px; color: var(--stone-text); font-size: 0.9375rem; }
.foot__links { display: grid; gap: 4px; font-size: 0.9375rem; align-content: start; }
.foot__links a { padding: 10px 0; min-height: 44px; display: inline-flex; align-items: center; width: fit-content; }
.foot__small { margin-top: 48px; padding-top: 20px; border-top: 1px solid var(--rule); color: var(--stone-text); font-size: 0.875rem; }
@media (min-width: 900px) { .foot__grid { grid-template-columns: 300px 1fr auto; gap: 64px; align-items: start; } }

/* Aviso de privacidad */
.doc { padding-block: clamp(56px, 10vh, 120px); }
.doc .wrap > * { max-width: 46em; }
.doc h1 { font-family: var(--serif); font-weight: 350; font-size: clamp(2.5rem, 6vw, 4.5rem); line-height: 1.05; letter-spacing: -0.03em; }
.doc__who { margin-top: 20px; font-family: var(--serif); font-size: 1.375rem; color: var(--stone-text); }
.doc__body { margin-top: 48px; padding: 28px 0; border-block: 1px solid var(--ink); font-size: 1.125rem; }
.doc__back { margin-top: 36px; }

/* ---------- Estados iniciales de entrada (solo con JS y sin reduced motion) ---------- */
.js .hero h1 .w > span { transform: translateY(105%); }
@media (prefers-reduced-motion: reduce) {
  .js .hero h1 .w > span { transform: none; }
    .draw::after, .btn, .index a, .acc__t, .menu-btn, .menu-btn i { transition-duration: 1ms; }
}

/* Folio de servicios: ocho renglones, el activo en carmesí */
.folio { display: none; width: min(100%, 260px); height: auto; margin-top: 40px; overflow: visible; }
@media (min-width: 1000px) { .folio { display: block; } }
.folio rect { fill: none; stroke: var(--rule); stroke-width: 1; }
.folio .f-sheet { fill: var(--paper); stroke: var(--ink); }
.folio line { stroke: var(--stone); stroke-width: 1.5; stroke-linecap: round; stroke-dasharray: 1; stroke-dashoffset: 0; transition: stroke 220ms ease, stroke-width 220ms ease; }
.folio .f-head { stroke: var(--ink); stroke-width: 3; }
.folio .f-line.is-active { stroke: var(--crimson); stroke-width: 3; }

/* Colofón: datos de la empresa */
.colophon { margin-top: clamp(56px, 9vh, 112px); padding-top: 20px; border-top: 1px solid var(--ink); }
.colophon h3 { font-family: var(--serif); font-weight: 400; font-size: 1.5rem; letter-spacing: -0.01em; }
.colophon dl { margin: 24px 0 0; display: grid; gap: 20px 40px; }
.colophon dt { font-size: 0.875rem; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase; color: var(--stone-text); }
.colophon dd { margin: 4px 0 0; font-family: var(--serif); font-size: 1.1875rem; line-height: 1.3; word-break: break-word; }
@media (min-width: 700px) { .colophon dl { grid-template-columns: repeat(2, minmax(0, 1fr)); } .colophon dl > div:first-child { grid-column: 1 / -1; } }
@media (min-width: 1000px) { .colophon dl { grid-template-columns: repeat(5, minmax(0, auto)); justify-content: space-between; } }

.folio--hero { display: block; width: auto; height: 188px; margin-top: 36px; }
@media (min-width: 1000px) { .folio--hero { display: none; } }
