/* Escuadra · lo común a todas las páginas: letras, colores, botones, cabecera, pie y barra de desplazamiento. */

@font-face { font-family: "Instrument Serif"; src: url(../fuentes/instrument-serif.woff2) format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Instrument Serif"; src: url(../fuentes/instrument-serif-italic.woff2) format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: Geist; src: url(../fuentes/geist.woff2) format("woff2"); font-weight: 300 750; font-display: swap; }

:root {
  --papel: #f7f2ea;
  --papel-2: #efe7db;
  --tinta: #1f1b16;
  --tinta-2: #554e45;
  --terracota: #b4532f;
  --terracota-texto: #9e4526;
  --terracota-claro: #e08a62;
  --linea: rgb(31 27 22 / 0.14);
  --borde: clamp(18px, 3.4vw, 56px);
  --serif: "Instrument Serif", "Iowan Old Style", Georgia, serif;
  --cabecera: 76px;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: calc(var(--cabecera) + 12px); }
body {
  margin: 0; background: var(--papel); color: var(--tinta);
  font: 400 17px/1.55 Geist, system-ui, -apple-system, "Segoe UI", sans-serif;
  overflow-x: clip; -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--terracota); outline-offset: 3px; border-radius: 6px; }
/* Lo oculto se queda oculto aunque su clase le dé otra caja (grid, flex…). */
[hidden] { display: none !important; }
.sr { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

.boton {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 24px;
  border: 0; border-radius: 999px; background: var(--tinta); color: var(--papel); text-decoration: none; cursor: pointer;
  font: 560 15.5px/1.2 Geist, sans-serif; transition: background-color 0.2s, color 0.2s, transform 0.2s;
}
.boton:hover { background: #000; }
.boton:active { transform: translateY(1px); }
.boton-linea { background: transparent; color: var(--tinta); box-shadow: inset 0 0 0 1.5px var(--tinta); }
.boton-linea:hover { background: var(--tinta); color: var(--papel); }
/* Terracota algo más oscuro bajo letra clara: 5,7:1 de contraste (con el terracota de la marca se quedaba en 4,46:1). */
.boton-acento { background: var(--terracota-texto); }
.boton-acento:hover { background: #82381d; }
.botones { display: flex; flex-wrap: wrap; gap: 12px; }

.antetitulo { margin: 0; font: 500 12px/1.4 Geist, sans-serif; letter-spacing: 0.18em; text-transform: uppercase; }

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

/* Con fondo propio (papel con desenfoque y una línea) para que no se confunda con el texto de la página.
   Sobre la película de la portada va sin fondo (clase «sobre-imagen», la quita js/comun.js al salir de ella). */
.barra {
  position: fixed; z-index: 30; top: 0; left: 0; right: 0; min-height: var(--cabecera);
  display: flex; align-items: center; gap: 30px; padding: 14px var(--borde); color: var(--tinta);
  background: rgb(247 242 234 / 0.92); -webkit-backdrop-filter: blur(14px) saturate(1.3); backdrop-filter: blur(14px) saturate(1.3);
  box-shadow: 0 1px 0 var(--linea), 0 10px 28px -22px rgb(31 27 22 / 0.45);
  transition: background-color 0.35s, box-shadow 0.35s;
}
.barra.sobre-imagen {
  background: linear-gradient(to bottom, rgb(247 242 234 / 0.82), rgb(247 242 234 / 0.5) 60%, rgb(247 242 234 / 0));
  -webkit-backdrop-filter: none; backdrop-filter: none; box-shadow: none;
}
.marca { display: inline-flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; }
.marca svg { flex: none; width: 30px; height: 30px; color: var(--terracota); }
.marca-nombre { font-family: var(--serif); font-size: 30px; line-height: 1; letter-spacing: 0.01em; }
.marca small { font: 500 11px/1 Geist, sans-serif; letter-spacing: 0.18em; text-transform: uppercase; color: var(--tinta-2); }
.menu { display: flex; gap: 26px; margin-left: auto; font-size: 15px; }
.menu a { text-decoration: none; }
.menu a:hover, .menu a[aria-current] { text-decoration: underline; text-underline-offset: 5px; text-decoration-thickness: 1px; }
.barra .boton { min-height: 42px; padding: 0 20px; font-size: 14.5px; }

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

.pie { background: var(--tinta); color: rgb(247 242 234 / 0.74); padding: clamp(56px, 7vw, 96px) var(--borde) 26px; font-size: 15px; }
.pie a { color: #f7f2ea; text-decoration: none; }
.pie a:hover { text-decoration: underline; text-underline-offset: 4px; }
.pie-arriba { display: grid; grid-template-columns: minmax(0, 1.6fr) repeat(3, minmax(0, 1fr)); gap: 36px 48px; padding-bottom: 44px; border-bottom: 1px solid rgb(247 242 234 / 0.14); }
.pie .marca { color: #f7f2ea; }
.pie .marca svg { color: var(--terracota-claro); }
.pie .marca small { color: rgb(247 242 234 / 0.6); }
.pie-lema { max-width: 40ch; margin: 18px 0 22px; line-height: 1.6; }
.pie h2 { margin: 6px 0 16px; font: 500 11.5px/1.3 Geist, sans-serif; letter-spacing: 0.16em; text-transform: uppercase; color: rgb(247 242 234 / 0.5); }
.pie ul { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
/* Redes: solo el icono, sin círculo, como en las otras webs. La zona que se pulsa sigue siendo de 40 px. */
.redes { display: flex !important; flex-wrap: wrap; gap: 6px !important; margin-left: -9px !important; }
.redes a { display: grid; place-items: center; width: 40px; height: 40px; color: rgb(247 242 234 / 0.74); transition: color 0.2s, transform 0.2s; }
.redes a:hover { color: #fff; transform: translateY(-1px); text-decoration: none; }
.redes svg { width: 21px; height: 21px; }
.pie-fin { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 24px; padding: 22px 0; border-bottom: 1px solid rgb(247 242 234 / 0.14); font-size: 14px; }
.pie-legal { display: flex; flex-wrap: wrap; gap: 6px 22px; }
.pie-firma { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px; padding-top: 22px; font-size: 14px; }
.pie-firma a { font-weight: 600; }
.volver-arriba {
  display: inline-flex; align-items: center; gap: 8px; padding: 11px 18px; border: 0; border-radius: 999px; cursor: pointer;
  background: rgb(247 242 234 / 0.1); color: #f7f2ea; font: 500 14px/1 Geist, sans-serif; transition: background-color 0.2s;
}
.volver-arriba:hover { background: rgb(247 242 234 / 0.2); }
.volver-arriba svg { width: 16px; height: 16px; }

/* ---------- Páginas interiores (calculadora, contacto, legales) ---------- */

.interior { padding: calc(var(--cabecera) + clamp(32px, 6vw, 72px)) var(--borde) clamp(56px, 7vw, 100px); }
.interior-cabeza { max-width: 900px; margin-bottom: clamp(28px, 4vw, 48px); }
.interior-cabeza .antetitulo { color: var(--terracota-texto); }
.interior-cabeza h1 { margin: 12px 0 0; font-family: var(--serif); font-weight: 400; font-size: clamp(46px, 6.4vw, 96px); line-height: 0.94; letter-spacing: -0.01em; text-wrap: balance; }
.interior-cabeza h1 em { color: var(--terracota); }
.interior-cabeza p:not(.antetitulo) { max-width: 56ch; margin: 18px 0 0; font-size: 18px; color: var(--tinta-2); }

/* ---------- Barra de desplazamiento (solo la de la página y solo con ratón; en el móvil, la del sistema) ---------- */

@media (hover: hover) and (pointer: fine) {
  @supports not selector(::-webkit-scrollbar) {
    html { scrollbar-color: var(--terracota) var(--papel-2); }
  }
  html::-webkit-scrollbar { width: 13px; height: 13px; }
  html::-webkit-scrollbar-track { background: var(--papel-2); box-shadow: inset 1px 0 0 var(--linea); }
  html::-webkit-scrollbar-thumb { border: 3px solid transparent; border-radius: 999px; background: linear-gradient(180deg, #d9805a, var(--terracota) 55%, #7e3519) padding-box; }
  html::-webkit-scrollbar-thumb:hover { background: linear-gradient(180deg, #b4532f, #6a2c15) padding-box; }
  html::-webkit-scrollbar-corner { background: var(--papel-2); }
}

/* ---------- Móvil ---------- */

@media (max-width: 860px) {
  .menu { display: none; }
  .pie-arriba { grid-template-columns: 1fr 1fr; }
  .pie-marca { grid-column: 1 / -1; }
}
@media (max-width: 760px) {
  :root { --cabecera: 64px; }
  .barra { gap: 12px; padding: 10px var(--borde); }
  .barra.sobre-imagen { padding-top: 14px; padding-bottom: 18px; }
  .barra .boton { margin-left: auto; min-height: 38px; padding: 0 15px; font-size: 13.5px; }
  .marca svg { width: 26px; height: 26px; }
  .marca-nombre { font-size: 26px; }
  .marca small { display: none; }
}
@media (max-width: 520px) {
  .pie-arriba { grid-template-columns: 1fr; }
  .pie-firma { padding-bottom: env(safe-area-inset-bottom); }
}
