/* ============================================================
   Amalia Miralles — Sistema visual 2026
   Editorial · cálido · estratégico
   ============================================================ */

/* ---------- Tokens ---------- */
:root {
  /* Color — night ink + warm bone + deepened raspberry */
  --ink:        #16141d;
  --ink-soft:   #211d29;
  --ink-card:   #241f2e;
  --ink-line:   rgba(244, 238, 228, 0.14);

  --paper:      #f5efe5;   /* warm bone — base light bg */
  --paper-2:    #ede4d6;   /* alt warm section */
  --cream:      #fbf8f2;   /* cards / lifted surfaces */

  --text:       #1d1a24;
  --text-soft:  #5d5763;
  --text-faint: #8b8590;
  --invert:     #f5efe5;
  --invert-soft:#c8c1bb;

  --accent:      #d12c6a;  /* brand magenta (intermedio) */
  --accent-deep: #9c1d4b;
  --accent-bright:#e85a8c; /* hover / links on dark */
  --accent-soft: #f3cdda;  /* soft blush fills */
  --accent-wash: #fbe7ef;

  --line:      rgba(29, 26, 36, 0.13);
  --line-2:    rgba(29, 26, 36, 0.08);

  /* Type */
  --font-display: 'Newsreader', Georgia, serif;
  --font-body:    'Hanken Grotesk', system-ui, sans-serif;
  --head-weight:    500;
  --head-transform: none;
  --head-spacing:   -0.012em;

  /* Rhythm */
  --wrap:    1180px;
  --wrap-narrow: 760px;
  --gutter:  clamp(20px, 5vw, 64px);
  --section: clamp(76px, 9vw, 132px);
  --radius:  3px;
  --radius-lg: 6px;

  --shadow-card: 0 1px 2px rgba(29,26,36,.04), 0 18px 40px -28px rgba(29,26,36,.35);
  --shadow-lift: 0 2px 4px rgba(29,26,36,.05), 0 30px 60px -34px rgba(29,26,36,.45);

  --ease: cubic-bezier(.22,.61,.36,1);

  --btn-on-accent: #fff; /* texto sobre botones de acento (tweakable) */
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  background: var(--paper);
  color: var(--text);
  font-size: 17px;
  line-height: 1.62;
  font-weight: 380;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }

/* ---------- Type scale ---------- */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: var(--head-weight);
  text-transform: var(--head-transform);
  letter-spacing: var(--head-spacing);
  line-height: 1.04;
  margin: 0;
  color: var(--text);
  text-wrap: balance;
}
.display-xl { font-size: clamp(2.9rem, 6.6vw, 5.4rem); line-height: 0.98; }
.display-l  { font-size: clamp(2.3rem, 4.6vw, 3.8rem); }
.display-m  { font-size: clamp(1.8rem, 3vw, 2.7rem); }
.display-s  { font-size: clamp(1.35rem, 2.1vw, 1.7rem); line-height: 1.12; }
.heads-caps-fix { } /* hook */

/* Headings honoring tweak transform: when uppercased, tighten tracking gracefully */
:root.heads-versales { --head-transform: uppercase; --head-spacing: 0.045em; --head-weight: 600; }

em, .ital { font-style: italic; }
.serif-ital { font-family: var(--font-display); font-style: italic; font-weight: 400; }

.eyebrow {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  gap: 0.7em;
}
.eyebrow::before {
  content: "";
  width: 26px; height: 1px;
  background: var(--accent);
  opacity: 0.55;
}
.eyebrow.no-rule::before { display: none; }
.eyebrow.on-dark { color: var(--accent-bright); }

.lead {
  font-size: clamp(1.08rem, 1.5vw, 1.28rem);
  line-height: 1.55;
  color: var(--text-soft);
  font-weight: 380;
}
.muted { color: var(--text-soft); }
.measure { max-width: 62ch; }
.measure-s { max-width: 46ch; }

/* ---------- Layout ---------- */
.page-hero { padding-top: clamp(122px, 13vw, 172px); padding-bottom: clamp(36px, 5vw, 64px); }
.wrap { max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gutter); }
.wrap-narrow { max-width: var(--wrap-narrow); margin-inline: auto; padding-inline: var(--gutter); }
.section { padding-block: var(--section); }
.section-tight { padding-block: clamp(48px, 6vw, 84px); }

.on-ink { background: var(--ink); color: var(--invert); }
.on-ink h1, .on-ink h2, .on-ink h3, .on-ink h4 { color: var(--invert); }
.on-ink .muted { color: var(--invert-soft); }
.on-ink .lead { color: var(--invert-soft); }
.on-paper2 { background: var(--paper-2); }

/* CTA band — signature accent section used across pages (Home, Servicios, Sobre mí, Artículo) */
.cta-band { background: var(--accent); color: #fff; text-align: center; }
.cta-band h1, .cta-band h2, .cta-band h3, .cta-band h4 { color: #fff; }
.cta-band .lead, .cta-band .sub, .cta-band p { color: rgba(255,255,255,.88); }

.divider { height: 1px; background: var(--line); border: 0; margin: 0; }

/* ---------- Accesibilidad: foco de teclado + skip link ---------- */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 3px;
}
/* Sobre superficies oscuras, anillo claro para que se vea */
.on-ink :focus-visible,
.cta-band :focus-visible,
.site-footer :focus-visible,
.mobile-drawer :focus-visible,
.site-header[data-on="dark"]:not(.scrolled) :focus-visible {
  outline-color: #fff;
}
/* El botón de acento ya es magenta: su foco usa tinta para contrastar */
.btn-primary:focus-visible, a.nav-cta:focus-visible { outline-color: var(--ink); }

.skip-link {
  position: fixed; top: 12px; left: 12px; z-index: 200;
  background: var(--ink); color: var(--invert);
  padding: 12px 18px; border-radius: var(--radius);
  font-family: var(--font-body); font-weight: 600; font-size: .95rem;
  text-decoration: none;
  transform: translateY(-160%);
  transition: transform .2s var(--ease);
}
.skip-link:focus { transform: none; outline: 2px solid #fff; outline-offset: 2px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 0.6em;
  font-family: var(--font-body);
  font-weight: 600; font-size: 0.95rem;
  letter-spacing: 0.005em;
  padding: 0.92em 1.5em;
  border-radius: var(--radius);
  border: 1px solid transparent;
  transition: transform .25s var(--ease), background .25s var(--ease), color .25s var(--ease), border-color .25s var(--ease);
  line-height: 1;
}
.btn:hover { transform: translateY(-2px); }
.btn .arr { transition: transform .3s var(--ease); }
.btn:hover .arr { transform: translateX(4px); }

.btn-primary { background: var(--accent); color: var(--btn-on-accent); }
.btn-primary:hover { background: var(--accent-deep); }
.btn-dark { background: var(--ink); color: var(--invert); }
.btn-dark:hover { background: var(--ink-soft); }
.btn-ghost { background: transparent; border-color: var(--line); color: var(--text); }
.btn-ghost:hover { border-color: var(--text); background: transparent; }
.btn-ghost.on-dark { border-color: var(--ink-line); color: var(--invert); }
.btn-ghost.on-dark:hover { border-color: var(--invert); }
.btn-light { background: var(--paper); color: var(--ink); }
.btn-light:hover { background: #fff; }

.link-arrow {
  display: inline-flex; align-items: center; gap: 0.45em;
  font-weight: 600; font-size: 0.95rem; color: var(--accent);
  border-bottom: 1px solid transparent;
  transition: gap .25s var(--ease), border-color .25s var(--ease);
}
.link-arrow:hover { gap: 0.75em; border-color: currentColor; }
.on-ink .link-arrow { color: var(--accent-bright); }

/* ---------- Header / Nav ---------- */
.site-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 60;
  transition: background .35s var(--ease), border-color .35s var(--ease), color .35s var(--ease);
  border-bottom: 1px solid transparent;
}
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; height: 78px; }
.site-header.scrolled {
  background: color-mix(in oklab, var(--paper) 86%, transparent);
  backdrop-filter: blur(14px) saturate(1.1);
  border-bottom-color: var(--line);
}
/* Over a dark hero, header text is light until scrolled */
.site-header[data-on="dark"]:not(.scrolled) { color: var(--invert); }
.site-header[data-on="dark"]:not(.scrolled) .wordmark-sub { color: var(--invert-soft); }
.site-header[data-on="dark"]:not(.scrolled) .nav a { color: var(--invert); }
.site-header[data-on="dark"]:not(.scrolled) .nav a:hover { color: #fff; }

.wordmark { display: flex; align-items: baseline; gap: 0.55em; line-height: 1; }
.wordmark .mark {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1.4rem;
  letter-spacing: -0.01em;
}
.wordmark .mark .sur { font-style: italic; font-weight: 400; }
.wordmark-sub {
  font-family: var(--font-body);
  font-size: 0.6rem; letter-spacing: 0.26em; text-transform: uppercase;
  color: var(--text-faint); font-weight: 600;
  align-self: center;
  padding-left: 0.8em; margin-left: 0.2em;
  border-left: 1px solid var(--line);
}
@media (max-width: 720px){ .wordmark-sub { display: none; } }

.nav { display: flex; align-items: center; gap: clamp(18px, 2.4vw, 38px); }
.nav a {
  font-size: 0.93rem; font-weight: 500; color: var(--text);
  position: relative; padding-block: 6px;
  transition: color .2s var(--ease);
}
.nav a::after {
  content:""; position:absolute; left:0; bottom:0; height:1px; width:100%;
  background: currentColor; transform: scaleX(0); transform-origin: left;
  transition: transform .3s var(--ease); opacity:.6;
}
.nav a:hover::after, .nav a.active::after { transform: scaleX(1); }
.nav .nav-cta { margin-left: 4px; }
/* El CTA del header es un botón de acento: su texto debe seguir --btn-on-accent
   (no el color de los enlaces del nav), sea cual sea el estado del header. */
.site-header .nav a.nav-cta,
.site-header[data-on="dark"]:not(.scrolled) .nav a.nav-cta { color: var(--btn-on-accent); }
.nav-toggle { display:none; }

/* ---------- Mobile nav (shared across all pages) ---------- */
.nav-toggle {
  width:42px; height:42px; align-items:center; justify-content:center;
  background:transparent; border:1px solid currentColor; opacity:.85;
  border-radius: var(--radius); color: currentColor;
}
.nav-toggle span { width:18px; height:1.5px; background:currentColor; position:relative; display:block; }
.nav-toggle span::before, .nav-toggle span::after { content:""; position:absolute; left:0; width:18px; height:1.5px; background:currentColor; }
.nav-toggle span::before { top:-5px; } .nav-toggle span::after { top:5px; }

.mobile-drawer {
  position:fixed; inset:0; z-index:80;
  background:var(--ink); color:var(--invert);
  transform:translateY(-100%); transition:transform .4s var(--ease);
  visibility:hidden; pointer-events:none;
  padding: 90px var(--gutter) 40px; display:flex; flex-direction:column; gap:6px;
}
.mobile-drawer.open { transform:none; visibility:visible; pointer-events:auto; }
.mobile-drawer a { font-family:var(--font-display); font-size:1.9rem; color:var(--invert); padding:14px 0; border-bottom:1px solid var(--ink-line); }
.mobile-close { position:absolute; top:24px; right:var(--gutter); background:none; border:none; color:var(--invert); font-size:1.6rem; }
@media (max-width: 860px){ .nav-toggle{ display:flex; } }

@media (max-width: 860px){
  .nav .nav-link { display:none; }
}

/* ---------- Placeholders (photography) ---------- */
.ph {
  position: relative;
  background-color: var(--paper-2);
  background-image: repeating-linear-gradient(
    -45deg,
    transparent 0, transparent 11px,
    rgba(29,26,36,.05) 11px, rgba(29,26,36,.05) 12px
  );
  border: 1px solid var(--line);
  display: grid; place-items: center;
  overflow: hidden;
  color: var(--text-faint);
}
.ph.on-dark {
  background-color: var(--ink-soft);
  background-image: repeating-linear-gradient(
    -45deg, transparent 0, transparent 11px,
    rgba(245,239,229,.06) 11px, rgba(245,239,229,.06) 12px);
  border-color: var(--ink-line);
  color: var(--invert-soft);
}
.ph .ph-label {
  font-family: ui-monospace, 'SF Mono', Menlo, monospace;
  font-size: 0.72rem; letter-spacing: 0.03em;
  text-align: center; padding: 0.6em 1em; line-height: 1.5;
  background: color-mix(in oklab, var(--paper) 78%, transparent);
  border: 1px solid var(--line);
  border-radius: 2px;
  max-width: 80%;
}
.ph.on-dark .ph-label {
  background: color-mix(in oklab, var(--ink) 60%, transparent);
  border-color: var(--ink-line);
}
.ph.round { border-radius: 999px; }

/* ---------- Cards ---------- */
.card {
  background: var(--cream);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: clamp(24px, 2.4vw, 36px);
  transition: transform .35s var(--ease), box-shadow .35s var(--ease), border-color .35s var(--ease);
}
.card.hover:hover { transform: translateY(-4px); box-shadow: var(--shadow-lift); border-color: transparent; }
.card .num {
  font-family: var(--font-display); font-size: 1rem; font-style: italic;
  color: var(--accent); margin-bottom: 1.2em;
}

/* dark feature tiles */
.tile {
  background: var(--ink-card);
  border: 1px solid var(--ink-line);
  border-radius: var(--radius-lg);
  padding: clamp(22px, 2.2vw, 30px);
  color: var(--invert);
  transition: transform .35s var(--ease), background .35s var(--ease);
}
.tile:hover { transform: translateY(-4px); background: #2a2435; }
.tile h3 { color: var(--invert); }
.tile p { color: var(--invert-soft); }

.kicker-num {
  font-family: var(--font-display);
  font-style: italic; font-weight: 400;
  color: var(--accent);
  font-size: 1.1rem;
}

/* ---------- Quote ---------- */
.quote-mark {
  font-family: var(--font-display);
  font-size: 4rem; line-height: 0.6; color: var(--accent);
  display: block; height: 0.5em;
}
.bigquote {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(1.5rem, 2.8vw, 2.25rem);
  line-height: 1.28;
  letter-spacing: -0.01em;
}

/* ---------- Stats / credibility ---------- */
.stat .n {
  font-family: var(--font-display);
  font-size: clamp(2.1rem, 3.4vw, 2.9rem);
  font-weight: 500; line-height: 1; letter-spacing: -0.02em;
}
.stat .l { font-size: 0.92rem; color: var(--text-soft); margin-top: 0.5em; }
.on-ink .stat .n { color: var(--invert); }
.on-ink .stat .l { color: var(--invert-soft); }

/* ---------- Tag / pill ---------- */
.tag {
  display: inline-flex; align-items: center;
  font-size: 0.74rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--accent); background: var(--accent-wash);
  padding: 0.4em 0.75em; border-radius: 999px;
}

/* ---------- Footer ---------- */
.site-footer { background: var(--ink); color: var(--invert); }
/* En móvil, las columnas del footer se apilan (la rejilla va inline en el HTML) */
@media (max-width: 720px){
  .site-footer .grid { grid-template-columns: 1fr !important; gap: 40px !important; }
}
.signature {
  font-family: 'Allura', cursive;
  font-size: clamp(2.4rem, 4vw, 3.4rem);
  line-height: 1; color: var(--invert);
  font-weight: 400;
}
/* Firma real (imagen). Se usa donde Amalia "firma": pie y cierre de Sobre mí.
   .sig-img = versión blanca (fondos oscuros). .sig-img.on-light = versión negra. */
.sig-img {
  display: block; height: auto;
  width: clamp(190px, 22vw, 280px);
  /* por defecto sobre fondo oscuro: la imagen ya es blanca */
}
.sig-img.center { margin-inline: auto; }
.footer-nav a { color: var(--invert-soft); font-size: 0.95rem; transition: color .2s; }
.footer-nav a:hover { color: var(--invert); }
.soc {
  width: 38px; height: 38px; border-radius: 999px;
  border: 1px solid var(--ink-line);
  display: grid; place-items: center; color: var(--invert);
  transition: background .25s var(--ease), border-color .25s var(--ease);
}
.soc:hover { background: var(--accent); border-color: var(--accent); }
.soc svg { width: 17px; height: 17px; }

/* ---------- Reveal animation ----------
   Content is visible by default; .in adds a one-shot entrance keyframe.
   This guarantees content never stays hidden if JS/observer doesn't run. */
.reveal.in { animation: revealIn .72s var(--ease) both; }
@keyframes revealIn {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce){
  .reveal.in { animation: none; }
  html { scroll-behavior: auto; }
}

/* ---------- Utilities ---------- */
.grid { display: grid; gap: clamp(18px, 2vw, 28px); }
.cols-2 { grid-template-columns: repeat(2, 1fr); }
.cols-3 { grid-template-columns: repeat(3, 1fr); }
.cols-4 { grid-template-columns: repeat(4, 1fr); }
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-s { gap: 10px; } .gap-m { gap: 20px; } .gap-l { gap: 36px; }
.stack-s > * + * { margin-top: 0.8rem; }
.stack-m > * + * { margin-top: 1.4rem; }
.stack-l > * + * { margin-top: 2.2rem; }
.center { text-align: center; }
.mx-auto { margin-inline: auto; }
.accent { color: var(--accent); }
.nowrap { white-space: nowrap; }

@media (max-width: 900px){
  .cols-4 { grid-template-columns: repeat(2, 1fr); }
  .cols-3 { grid-template-columns: 1fr; }
  .cols-2 { grid-template-columns: 1fr; }
}
