/* Web de Marc · decisiones en DESIGN.md */

@font-face {
  font-family: "Hanken Grotesk";
  src: url("../fonts/hanken-grotesk-latin.woff2") format("woff2");
  font-weight: 400 500;
  font-style: normal;
  font-display: swap;
}

:root {
  /* Color: 3 colores + neutros */
  --bg: #111111;
  --surface: #1c1c1c;
  --surface-2: #262626;
  --ink: #f2f2f2;
  --muted: #8f8f8f;
  --accent: #9a7f6a;
  --accent-ink: #111111;
  --bone: #e4e2df;
  --bone-muted: #5c544c;
  --error: #e0786b;

  /* Tipografía */
  --font: "Hanken Grotesk", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --step-small: clamp(0.8125rem, 0.79rem + 0.1vw, 0.875rem);
  --step-body: clamp(1.0625rem, 1rem + 0.25vw, 1.1875rem);
  --step-lead: clamp(1.25rem, 1.1rem + 0.7vw, 1.625rem);
  --step-head: clamp(2rem, 1.3rem + 3.2vw, 4rem);
  --step-display: clamp(3.25rem, 13.2vw, 13rem);

  /* Espaciado, base 4 px */
  --s-1: 4px; --s-2: 8px; --s-3: 12px; --s-4: 16px; --s-5: 24px; --s-6: 32px;
  --s-7: 48px; --s-8: 64px; --s-9: 96px; --s-10: 128px; --s-11: 192px;
  --gutter: clamp(16px, 4vw, 48px);
  --section: clamp(72px, 8vw, 112px);
  --measure: 62ch;

  /* Movimiento */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-press: cubic-bezier(0.23, 1, 0.32, 1);
  --fast: 150ms;
  --accent-hover: #ab917d;
}

*, *::before, *::after { box-sizing: border-box; }
html {
  -webkit-text-size-adjust: 100%; scroll-behavior: smooth;
  /* Superficies del navegador con la paleta: barra de scroll, cursor de texto, toques */
  scrollbar-color: var(--surface-2) var(--bg);
  -webkit-tap-highlight-color: transparent;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: var(--step-body);
  line-height: 1.5;
  letter-spacing: -0.005em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
h1, h2, h3, p, ul, ol, dl, dd, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; caret-color: var(--accent); }
a, button, input, select, textarea, label { touch-action: manipulation; }
::selection { background: var(--accent); color: var(--accent-ink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
h1, h2, h3 { text-wrap: balance; font-weight: 500; }
p { text-wrap: pretty; }

.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 {
  position: absolute; left: var(--gutter); top: -100px; z-index: 10;
  background: var(--ink); color: var(--bg); padding: var(--s-3) var(--s-4);
}
.skip:focus { top: var(--s-3); }

/* Marcador de contenido pendiente: visible a propósito para que Marc lo encuentre */
.edit { color: var(--accent); font-weight: 500; }

.wrap { width: 100%; max-width: 1440px; margin-inline: auto; padding-inline: var(--gutter); }
.section { padding-block: var(--section); }

.h2 {
  font-size: var(--step-head);
  line-height: 1;
  letter-spacing: -0.03em;
  margin-bottom: var(--s-7);
}
.h3 { font-size: var(--step-lead); line-height: 1.2; letter-spacing: -0.01em; margin-bottom: var(--s-5); }
.label { font-size: var(--step-small); color: var(--muted); font-weight: 400; margin-bottom: var(--s-3); }
.plain li + li { margin-top: var(--s-2); }
.note { color: var(--muted); max-width: var(--measure); }

/* Enlaces y botones: un solo estilo de botón, esquinas rectas */
.link {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.22em;
  transition: text-decoration-color var(--fast) ease, color var(--fast) ease;
}
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px; padding: 0 var(--s-5);
  background: var(--accent); color: var(--accent-ink);
  border: 0; border-radius: 0; cursor: pointer;
  font-weight: 500; text-decoration: none; white-space: nowrap;
  transition: background-color var(--fast) ease, transform 160ms var(--ease-press);
  -webkit-user-select: none; user-select: none;
}
/* Pulsación: el botón cede un poco, como un botón físico */
.btn:active:not(:disabled) { transform: scale(0.97); }
.btn:disabled { opacity: 0.55; cursor: progress; }
.btn--dark { background: var(--accent-ink); color: var(--ink); }

/* Barra superior: solo texto en las esquinas, sin barra fija */
.top {
  position: absolute; inset: 0 0 auto 0; z-index: 2;
  display: flex; justify-content: space-between; align-items: center;
  padding: var(--s-5) var(--gutter);
  font-size: 0.9375rem; color: var(--accent-ink);
}
.top__mark { font-weight: 500; text-decoration: none; font-size: 1.125rem; letter-spacing: -0.02em; }
.top__nav { display: flex; gap: var(--s-5); }
.top__nav a { text-decoration: none; padding-block: var(--s-3); }
.top__cta { text-decoration: underline !important; text-underline-offset: 0.22em; font-weight: 500; }
.top :focus-visible { outline-color: var(--accent-ink); }

/* 1. HERO: campo bronce, titular en dos tintas */
.hero {
  min-height: 100vh; /* taste-skill-ignore: respaldo para navegadores sin svh */
  min-height: 100svh;
  background: var(--accent); color: var(--accent-ink);
  display: flex; flex-direction: column; justify-content: space-between;
  padding: 18svh var(--gutter) var(--s-7);
}
.hero__title {
  font-size: var(--step-display);
  line-height: 0.9;
  letter-spacing: -0.045em;
  font-weight: 500;
}
.line { display: block; overflow: hidden; padding-bottom: 0.08em; margin-bottom: -0.08em; white-space: nowrap; }
.line__in { display: block; color: var(--ink); }
.line--dark .line__in { color: var(--accent-ink); }
.hero__foot {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end;
  gap: var(--s-6); margin-top: var(--s-8);
}
.hero__lede { font-size: var(--step-lead); line-height: 1.3; max-width: 30ch; order: 2; text-align: right; }
.hero__actions { display: flex; align-items: center; gap: var(--s-5); order: 1; }
.hero .link { font-weight: 500; }
.hero :focus-visible { outline-color: var(--accent-ink); }

/* 2. SERVICIOS: lista-buscador */
.svc__row {
  display: flex; justify-content: space-between; align-items: baseline; gap: var(--s-5);
  padding: var(--s-3) var(--s-4); margin-inline: calc(var(--s-4) * -1);
  width: calc(100% + var(--s-6));
  background: none; border: 0; text-align: left; cursor: pointer;
  transition: background-color var(--fast) ease, color var(--fast) ease;
}
.svc__name { font-size: clamp(2.125rem, 1rem + 4.6vw, 4.75rem); line-height: 1.05; letter-spacing: -0.035em; }
.svc__time { font-size: var(--step-small); color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.svc.is-active .svc__row { background: var(--accent); color: var(--accent-ink); }
.svc.is-active .svc__time { color: var(--accent-ink); }
.svc__detail { padding: var(--s-4) 0 var(--s-6); max-width: var(--measure); }
.svc__detail p + p { margin-top: var(--s-2); }
.svc__meta { color: var(--muted); font-size: var(--step-small); }
.js .svc:not(.is-active) .svc__detail { display: none; }
/* Al abrir un servicio, su detalle entra desde arriba en vez de aparecer de golpe */
.js .svc.is-active .svc__detail { animation: detailIn 220ms var(--ease-out) both; }
@keyframes detailIn { from { opacity: 0; transform: translateY(-6px); } }

/* 3. HISTORIA */
.story { background: var(--surface); }
.story__grid { display: grid; gap: var(--s-7); }
.story__title { margin-bottom: 0; }
.story__text { font-size: var(--step-lead); line-height: 1.4; max-width: 46ch; }
.story__text p + p { margin-top: 0.9em; }
.facts { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-5); font-size: 0.9375rem; }
.facts dt { color: var(--muted); }
.story__lists { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-6); font-size: 0.9375rem; }

/* 5. ENCARGOS: el reloj (pico, sticky) */
.clock { background: var(--bg); padding-bottom: var(--section); }
.clock__track { height: 260vh; }
.clock__stage {
  position: sticky; top: 0;
  height: 100vh; /* taste-skill-ignore: respaldo para navegadores sin svh */
  height: 100svh;
  display: flex; flex-direction: column; justify-content: center;
  padding-block: var(--s-7);
}
.clock__title { margin-bottom: var(--s-4); }
.clock__count {
  font-size: clamp(6rem, 30vw, 17rem);
  line-height: 0.85; letter-spacing: -0.05em;
  font-variant-numeric: tabular-nums;
  display: flex; align-items: baseline; gap: 0.06em;
}
.clock__unit { font-size: 0.35em; color: var(--muted); letter-spacing: -0.02em; }
.clock.is-done .clock__num { color: var(--accent); }
.clock__bar { position: relative; height: 6px; margin: var(--s-6) 0 var(--s-5); background: var(--surface-2); overflow: hidden; }
.clock__fill {
  position: absolute; inset: 0; background: var(--accent);
  transform-origin: left center; transform: scaleX(var(--p, 0));
}
.phases { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-5) var(--s-5); }
.phase { position: relative; padding-top: var(--s-3); color: var(--muted); transition: color 250ms ease; }
/* Fase apagada: gris legible (6:1). Encendida: tinta plena y marca bronce */
.phase::before {
  content: ""; position: absolute; top: 0; left: 0; width: 24px; height: 3px;
  background: var(--accent); transform: scaleX(0); transform-origin: left; transition: transform 250ms var(--ease-out);
}
.phase.is-on { color: var(--ink); }
.phase.is-on::before { transform: none; }
.phase__h { font-size: var(--step-small); font-variant-numeric: tabular-nums; }
.phase.is-on .phase__h { color: var(--accent); }
.phase__name { font-size: var(--step-lead); line-height: 1.2; margin: var(--s-1) 0 var(--s-2); }
.phase p { font-size: 0.9375rem; color: var(--muted); max-width: 32ch; }

/* 6. CÓMO TRABAJO: escalera */
.steps { background: var(--surface); }
.stair li + li { margin-top: var(--s-7); }
.stair__line { font-size: clamp(1.75rem, 0.9rem + 3.6vw, 4.25rem); line-height: 1.02; letter-spacing: -0.035em; font-weight: 500; text-wrap: balance; }
.stair__line--accent { color: var(--accent); }
.stair__sub { margin-top: var(--s-3); color: var(--muted); max-width: 40ch; }
.stair li:nth-child(2) { padding-left: 6vw; }
.stair li:nth-child(3) { padding-left: 12vw; }
.stair li:nth-child(4) { padding-left: 18vw; }
.receive { margin-top: var(--s-9); }
.plain--cols { display: grid; gap: var(--s-2) var(--s-6); }
.plain--cols li + li { margin-top: 0; }

/* 7. PRECIOS: suelo hueso, el único cambio de fondo */
.price { background: var(--bone); color: var(--accent-ink); min-height: 80vh; display: flex; align-items: center; }
.price .h2 { margin-bottom: var(--s-5); }
.price__intro p { max-width: 40ch; }
.price__grid { display: grid; gap: var(--s-8); }
/* La caja de texto de la cifra gigante sobresale hacia arriba: la etiqueta queda por encima */
.price__from { font-size: var(--step-lead); position: relative; z-index: 1; }
.price__fig {
  font-size: clamp(7.5rem, 34vw, 15rem);
  line-height: 0.85; letter-spacing: -0.05em;
  display: flex; align-items: flex-start; gap: 0.04em; margin: var(--s-2) 0 var(--s-6);
}
.price__cur { font-size: 0.5em; line-height: 1; padding-top: 0.06em; }
.price__list { font-size: 1.125rem; margin-bottom: var(--s-6); }
.price__list li + li { margin-top: var(--s-2); }
.price .edit { color: #6e5a4b; }
.price :focus-visible { outline-color: var(--accent-ink); }

/* 8. CONTACTO */
.contact__grid { display: grid; gap: var(--s-8); }
.contact__title { font-size: clamp(1.75rem, 1.2rem + 2.2vw, 2.75rem); line-height: 1.1; letter-spacing: -0.025em; max-width: 16ch; }
.contact__title .soft { color: var(--muted); display: block; }
.form { display: grid; gap: var(--s-5); max-width: 560px; }
.field label { display: block; font-size: 0.9375rem; margin-bottom: var(--s-2); }
.field input, .field select, .field textarea {
  width: 100%; min-height: 56px; padding: var(--s-3) var(--s-4);
  background: var(--ink); color: var(--accent-ink);
  border: 0; border-radius: 0; box-shadow: inset 0 0 0 2px transparent; /* taste-skill-ignore: anillo de foco de campo de formulario */
  transition: box-shadow var(--fast) ease;
}
.field textarea { resize: vertical; min-height: 140px; }
.field select { -webkit-appearance: none; appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%23111' stroke-width='1.8'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 16px center; padding-right: 44px; }
.field :focus-visible { outline: 0; box-shadow: inset 0 0 0 3px var(--accent); } /* taste-skill-ignore: foco */
.field [aria-invalid="true"] { box-shadow: inset 0 0 0 3px var(--error); } /* taste-skill-ignore: error */
.field__err { color: var(--error); font-size: 0.9375rem; margin-top: var(--s-2); }
.form__legal { font-size: var(--step-small); color: var(--muted); }
.form__legal strong { color: var(--ink); font-weight: 500; }
.field--check { display: grid; grid-template-columns: auto 1fr; column-gap: var(--s-3); align-items: start; }
.field--check input { width: 24px; height: 24px; min-height: 0; margin: 0; accent-color: var(--accent); }
.field--check label { margin: 0; line-height: 1.5; }
.field--check .field__err { grid-column: 1 / -1; }
.form .btn { justify-self: start; min-width: 160px; }
.form__status { min-height: 1.5em; }
.form__status.is-ok { color: var(--ink); }
.form__status.is-err { color: var(--error); }
/* 9. FOOTER */
.foot { background: var(--accent); color: var(--accent-ink); padding-top: var(--s-9); overflow: hidden; }
.foot__row { display: grid; gap: var(--s-7); }
.foot__claim { font-size: var(--step-lead); line-height: 1.3; }
.foot__links { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-3) var(--s-6); align-content: start; }
.foot__links a { padding-block: var(--s-1); }
.foot__legal { display: flex; justify-content: space-between; gap: var(--s-4); margin-top: var(--s-8); font-size: var(--step-small); }
.foot__word {
  font-size: 38vw; line-height: 0.8; letter-spacing: -0.06em; font-weight: 500;
  margin: var(--s-6) 0 -0.12em calc(var(--gutter) - 0.04em);
  color: var(--accent-ink); white-space: nowrap; user-select: none;
}
.foot .edit { color: var(--accent-ink); text-decoration: underline wavy; }
.foot :focus-visible { outline-color: var(--accent-ink); }

/* Hover solo con ratón: en móvil un toque no deja el estado "pegado" */
@media (hover: hover) and (pointer: fine) {
  .link:hover { text-decoration-color: var(--accent); }
  .btn:hover { background: var(--accent-hover); }
  .btn--dark:hover { background: #2a2a2a; }
  .top__nav a:hover { text-decoration: underline; text-underline-offset: 0.22em; }
  .svc:not(.is-active) .svc__row:hover { background: var(--surface); }
}

/* ---------- Tablet y escritorio ---------- */
@media (min-width: 700px) {
  .facts { grid-template-columns: 1fr; gap: var(--s-4); }
  .story__grid { grid-template-columns: minmax(160px, 1fr) 2fr; column-gap: var(--s-8); align-items: start; }
  .story__title { grid-column: 1 / -1; }
  .story__text { grid-column: 2; grid-row: 2; }
  .facts { grid-column: 1; grid-row: 2; }
  .story__lists { grid-column: 2; max-width: 600px; }
  .phases { grid-template-columns: repeat(4, 1fr); }
  .plain--cols { grid-template-columns: 1fr 1fr; }
  .price__grid { grid-template-columns: 1fr 1.6fr; align-items: center; }
  .foot__row { grid-template-columns: 1fr 1fr; }
}

@media (min-width: 1000px) {
  .stair li:nth-child(2) { padding-left: 16.66%; }
  .stair li:nth-child(3) { padding-left: 33.33%; }
  .stair li:nth-child(4) { padding-left: 50%; }
  .receive { max-width: 50%; }

  /* Reloj: contador a la izquierda, fases a la derecha */
  .clock__stage {
    display: grid; grid-template-columns: 1.15fr 1fr; grid-template-rows: auto auto auto;
    column-gap: var(--s-9); align-content: center;
  }
  .clock__title { grid-column: 1; grid-row: 1; }
  .clock__count { grid-column: 1; grid-row: 2; font-size: clamp(10rem, 22vw, 21rem); }
  .clock__bar { grid-column: 1 / -1; grid-row: 3; }
  .phases { grid-column: 2; grid-row: 1 / 3; grid-template-columns: 1fr; align-self: end; gap: var(--s-5); }
}
@media (min-width: 1100px) {
  .contact__grid { grid-template-columns: 1fr minmax(0, 560px); column-gap: var(--s-9); align-items: start; }
}
@media (max-width: 699px) {
  .hide-sm { display: none; }
  .top__nav { gap: var(--s-4); }
  .top__nav a:not(.top__cta) { display: none; }
  .hero { padding-top: 22svh; }
  .hero__title { font-size: 15vw; }
  .hero__lede { text-align: left; order: 1; font-size: 1.125rem; }
  .hero__actions { order: 2; width: 100%; }
  .svc__time { display: none; }
  .clock__count { font-size: 36vw; }
  .clock__stage { padding-block: var(--s-5); }
  .phase p { font-size: 0.875rem; }
  .phase__name { font-size: 1.125rem; }
}

@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

/* ---------- Movimiento (solo con JS y sin reduced motion) ---------- */
@media (prefers-reduced-motion: no-preference) {
  /* Titular enmascarado: cada línea sube desde detrás de su línea base */
  .line__in { animation: rise 900ms var(--ease-out) both; }
  .line:nth-child(2) .line__in { animation-delay: 110ms; }
  .hero__foot { animation: fadeUp 700ms var(--ease-out) 450ms both; }
  @keyframes rise { from { transform: translateY(105%); } to { transform: none; } }
  @keyframes fadeUp { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }

  /* Entradas de sección escalonadas */
  .js [data-in] {
    opacity: 0; transform: translateY(16px);
    transition: opacity 600ms var(--ease-out), transform 600ms var(--ease-out);
    transition-delay: calc(var(--i, 0) * 70ms);
  }
  /* La escalera baja en diagonal: cada paso entra desde la izquierda */
  .js .stair [data-in] { transform: translateX(-24px); }
  .js [data-in].is-in { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .svc.is-active .svc__detail { animation: none; }
  .js [data-in] { transition: opacity 300ms ease; }
  /* El reloj se muestra entero y estático */
  .clock__track { height: auto; }
  .clock__stage { position: static; height: auto; padding-block: var(--section) 0; }
  .phase { color: var(--ink); }
  .phase::before { transform: none; }
}

/* Páginas legales */
.legal__body { max-width: var(--measure); }
.legal__body h2 { font-size: var(--step-lead); margin: var(--s-7) 0 var(--s-3); }
.legal__body p + p { margin-top: var(--s-3); }
