/* ==========================================================================
   SC Home · Base
   Reset, tipografía, links, botones, foco y utilidades mínimas.
   ========================================================================== */

/* --- Reset ---------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

* { margin: 0; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: calc(var(--header-h) + var(--space-2));
}

/* Pantallas 2K y más: todo crece un 25% (letra, espacios y contenedor), como si
   el sitio estuviera diseñado para ese ancho. Respeta la letra que eligió el usuario. */
@media (min-width: 160em) {
  html { font-size: 125%; }
}

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-weight: var(--fw-regular);
  font-size: var(--fs-base);
  line-height: var(--lh-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

img, picture, video, svg { display: block; max-width: 100%; }
img { height: auto; }

input, button, textarea, select { font: inherit; color: inherit; }
button { background: none; border: 0; padding: 0; cursor: pointer; }

ul[role="list"], ol[role="list"] { list-style: none; padding: 0; }

p, h1, h2, h3, h4, h5, h6, li, dd, a { overflow-wrap: break-word; }

::selection { background: var(--c-brown); color: var(--c-white); }

/* --- Tipografía ----------------------------------------------------------- */
/* Títulos en Lora (decisión de la clienta, 18/11/2026), en minúsculas y con
   el espaciado natural de la letra. El texto va en Avenir Next. */
h1, h2, h3, h4 {
  font-family: var(--font-serif);
  font-weight: var(--fw-regular);
  line-height: var(--lh-snug);
  letter-spacing: var(--ls-title-sm);
  text-wrap: balance;
}

h1, h2 { letter-spacing: var(--ls-title); }

h1 { font-size: var(--fs-3xl); line-height: var(--lh-tight); }
h2 { font-size: var(--fs-2xl); line-height: var(--lh-tight); }
h3 { font-size: var(--fs-xl); }
h4 { font-size: var(--fs-lg); }

p { text-wrap: pretty; }

strong, b { font-weight: var(--fw-semibold); }

/* Títulos editoriales extra grandes (hero) */
.display {
  font-family: var(--font-serif);
  font-size: var(--fs-display);
  font-weight: var(--fw-regular);
  line-height: var(--lh-tight);
  letter-spacing: var(--ls-title);
}

/* Énfasis dentro de un título: Lora itálica en marrón. Es la combinación de
   la clienta: el título en redonda y una o dos palabras en itálica. */
.display em, h1 em, h2 em, h3 em {
  font-style: italic;
  color: var(--accent);
}
/* Sobre fotos y fondos oscuros o marrones, el marrón no tiene contraste:
   el énfasis queda del mismo color que el título (la itálica alcanza) */
.hero em, .materials em, .section--dark em, .consult em, .cta-band--brown em, .on-dark em {
  color: inherit;
}

/* Acento caligráfico (Merlion Script): solo frases inspiradoras cortas y
   nombres de fragancias y colecciones. Nunca en párrafos ni botones.
   Mínimo 28px (--fs-script) para que se lea. */
.script {
  font-family: var(--font-script);
  font-size: var(--fs-script);
  font-weight: 400;
  line-height: 1.2;
  letter-spacing: 0;
  color: var(--accent);
}

/* Etiqueta chica en mayúsculas sobre los títulos */
.eyebrow {
  display: inline-block;
  font-family: var(--font-sans);
  font-size: var(--fs-xs);
  font-weight: var(--fw-semibold);   /* Demi Bold: etiqueta chica destacada */
  letter-spacing: var(--ls-wider);
  text-transform: uppercase;
  color: var(--text-muted);
}

.lead {
  font-size: var(--fs-md);
  font-weight: var(--fw-regular);
  line-height: 1.6;
  color: var(--text-muted);
  max-width: 38rem;
}

.text-muted { color: var(--text-muted); }

/* --- Links ---------------------------------------------------------------- */
a {
  color: inherit;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
  transition: color var(--dur-fast) var(--ease-out);
}

/* Links dentro de texto corrido */
.prose a { color: var(--accent); }
.prose a:hover { color: var(--c-brown-dark); }

/* --- Foco visible --------------------------------------------------------- */
:focus { outline: none; }

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

.on-dark :focus-visible,
.site-footer :focus-visible { outline-color: var(--c-brown-light); }

/* --- Botones -------------------------------------------------------------- */
.btn {
  --btn-bg: transparent;
  --btn-fg: var(--text);
  --btn-border: transparent;

  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-1);
  min-height: 3rem;                /* 48px: área táctil cómoda */
  padding: 0.875rem var(--space-4);
  border: 1px solid var(--btn-border);
  border-radius: var(--radius-0);
  background: var(--btn-bg);
  color: var(--btn-fg);
  font-family: var(--font-sans);
  font-size: var(--fs-xs);
  font-weight: var(--fw-medium);
  letter-spacing: var(--ls-wider);
  text-transform: uppercase;
  text-decoration: none;
  line-height: 1.2;
  text-align: center;
  cursor: pointer;
  /* Con la letra agrandada el botón se achica de costado en vez de salirse */
  max-width: 100%;
  padding-inline: min(var(--space-4), 8.5vw);
  overflow-wrap: anywhere;
  transition:
    background-color var(--dur-base) var(--ease-out),
    color var(--dur-base) var(--ease-out),
    border-color var(--dur-base) var(--ease-out),
    transform var(--dur-base) var(--ease-out);
}
.btn:active { transform: scale(0.98); }

.btn svg { width: 1.125rem; height: 1.125rem; flex-shrink: 0; transition: transform var(--dur-base) var(--ease-out); }
@media (hover: hover) {
  .btn:hover svg { transform: scale(1.08); }
}

/* Primario: marrón cálido */
.btn--primary {
  --btn-bg: var(--c-brown);
  --btn-fg: var(--c-white);
  --btn-border: var(--c-brown);
}
.btn--primary:hover {
  --btn-bg: var(--c-brown-dark);
  --btn-border: var(--c-brown-dark);
}

/* Secundario: solo borde, se rellena al pasar */
.btn--secondary {
  --btn-fg: var(--text);
  --btn-border: var(--text);
}
.btn--secondary:hover {
  --btn-bg: var(--text);
  --btn-fg: var(--c-white);
}

/* Variantes para fondos oscuros o fotos */
.btn--light {
  --btn-bg: var(--c-white);
  --btn-fg: var(--c-ink);
  --btn-border: var(--c-white);
}
.btn--light:hover {
  --btn-bg: var(--c-cream);
  --btn-border: var(--c-cream);
}

.btn--outline-light {
  --btn-fg: var(--c-white);
  --btn-border: rgba(255, 255, 255, 0.7);
}
.btn--outline-light:hover {
  --btn-bg: var(--c-white);
  --btn-fg: var(--c-ink);
  --btn-border: var(--c-white);
}

.btn--block { width: 100%; }

/* Link con subrayado que se dibuja de izquierda a derecha */
.btn-link,
.link-underline {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  /* 44px de área táctil con el relleno; el subrayado se dibuja en la caja del
     texto (content-box), así queda pegado a las letras y no al borde del área */
  padding-block: 0.75rem;
  min-height: 2.75rem;
  background-origin: content-box;
  background-clip: content-box;
  color: inherit;
  text-decoration: none;
  background-image: linear-gradient(currentColor, currentColor);
  background-repeat: no-repeat;
  background-position: 100% 100%;
  background-size: 0% 1px;
  transition: background-size var(--dur-slow) var(--ease-out);
}
.btn-link:hover,
.link-underline:hover,
.btn-link:focus-visible,
.link-underline:focus-visible {
  background-position: 0% 100%;
  background-size: 100% 1px;
}

/* Dentro de un párrafo el link sigue el alto de la línea */
p .link-underline { display: inline; min-height: 0; padding-block: 0; }

/* El link-botón arranca subrayado y se "re-dibuja" al pasar */
.btn-link {
  font-size: var(--fs-xs);
  font-weight: var(--fw-medium);
  letter-spacing: var(--ls-wider);
  text-transform: uppercase;
  background-size: 100% 1px;
  background-position: 0% 100%;
}
.btn-link:hover {
  animation: link-redraw var(--dur-slow) var(--ease-out);
}
.btn-link .arrow { transition: transform var(--dur-base) var(--ease-out); }
.btn-link:hover .arrow { transform: translateX(4px); }

@keyframes link-redraw {
  0%   { background-size: 100% 1px; background-position: 100% 100%; }
  50%  { background-size: 0% 1px;   background-position: 100% 100%; }
  51%  { background-size: 0% 1px;   background-position: 0% 100%; }
  100% { background-size: 100% 1px; background-position: 0% 100%; }
}

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

.container--narrow {
  max-width: calc(var(--container-narrow) + var(--gutter) * 2);
}

.section { padding-block: var(--section-y); }
.section--alt { background: var(--bg-alt); }
.section--dark { background: var(--bg-dark); color: var(--text-on-dark); }

.stack > * + * { margin-top: var(--stack-gap, var(--space-3)); }

.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;
}

/* Salto al contenido para teclado y lectores de pantalla */
.skip-link {
  position: fixed;
  top: var(--space-1);
  left: var(--space-1);
  z-index: calc(var(--z-header) + 10);
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  padding: var(--space-1) var(--space-2);
  background: var(--c-ink);
  color: var(--c-white);
  font-size: var(--fs-sm);
  text-decoration: none;
  transform: translateY(-200%);
  transition: transform var(--dur-fast) var(--ease-out);
}
.skip-link:focus { transform: none; }

/* Bloquea el scroll del fondo cuando hay un overlay abierto */
body.is-locked { overflow: hidden; }

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

/* Bloques de Proyectos escondidos (mostrarProyectos en js/config.js) */
[data-proyectos][hidden] { display: none !important; }
