/* ==========================================================================
   Fundación Tarquinia — sistema visual
   Basado en: Manual de Marca · Grupo Tarquinia · 2025 (v3.0)
   Inspiración layout: Benesse Art Site Naoshima
   Acento: Coral Tarquinia (#E85A4F) · Fundación
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,300;0,400;0,500;0,600;1,300;1,400;1,500&family=Montserrat:wght@300;400;500;600;700&display=swap');

/* IBM Plex Mono — TTFs locales (solo los pesos en uso) */
@font-face { font-family: 'IBM Plex Mono'; font-style: normal; font-weight: 300; src: url('assets/fonts/IBMPlexMono-Light.ttf') format('truetype'); font-display: swap; }
@font-face { font-family: 'IBM Plex Mono'; font-style: normal; font-weight: 400; src: url('assets/fonts/IBMPlexMono-Regular.ttf') format('truetype'); font-display: swap; }
@font-face { font-family: 'IBM Plex Mono'; font-style: normal; font-weight: 500; src: url('assets/fonts/IBMPlexMono-Medium.ttf') format('truetype'); font-display: swap; }

/* ─── TOKENS ─────────────────────────────────────────────────────────── */
:root {
  /* Base institucional */
  --tinta:        #111111;
  --lienzo:       #FFFFFF;
  --hueso:        #F5F2EA;   /* Warm Gray 1 — paper */
  --bruma:        #ECE9E0;
  --gris-medio:   #8C8A82;
  --gris-rule:    rgba(17,17,17,0.12);

  /* Acento Fundación */
  --coral:        #E85A4F;
  --coral-deep:   #C8483F;

  /* Marítimo sutil — luz costera de Concón */
  --mar:          #6B7F86;
  --mar-claro:    #B8C2C4;
  --arena:        #E7DFD0;

  /* Compatibilidad legacy */
  --negro:        var(--tinta);
  --blanco:       var(--lienzo);
  --rojo:         var(--coral);
  --rojo-hover:   var(--coral-deep);
  --gris-claro:   var(--hueso);
  --gris-texto:   #4A4A48;

  /* Tipografías */
  --font-display: 'Cormorant Garamond', 'EB Garamond', Georgia, serif;
  --font-body:    'Montserrat', 'Helvetica Neue', Arial, sans-serif;
  --font-mono:    'IBM Plex Mono', 'SFMono-Regular', Menlo, Consolas, monospace;

  /* Layout */
  --nav-h: 76px;
  --max-w: 1280px;
  --max-w-narrow: 880px;

  /* Movimiento */
  --ease: cubic-bezier(0.2, 0.6, 0.2, 1);
  --transition: 280ms var(--ease);
  --transition-slow: 480ms var(--ease);

  /* Letterspacing */
  --ls-eyebrow: 0.32em;
  --ls-meta:    0.18em;
  --ls-display: -0.01em;

  /* Patrón de puntos del manual */
  --dot-color:        rgba(17,17,17,0.14);
  --dot-color-light:  rgba(255,255,255,0.14);
}

/* ─── RESET ─────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
body {
  font-family: var(--font-body);
  background: var(--lienzo);
  color: var(--tinta);
  font-size: 15px;
  line-height: 1.7;
  font-weight: 400;
  overflow-x: hidden;
}
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; }
::selection { background: var(--coral); color: var(--lienzo); }

/* ─── TIPOGRAFÍA SEMÁNTICA ──────────────────────────────────────────── */
.eyebrow,
.label {
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: var(--ls-eyebrow);
  text-transform: uppercase;
  color: var(--gris-medio);
  display: inline-block;
}
.label-light { color: rgba(255,255,255,0.55); }
.label-coral { color: var(--coral); }

.display-xl {
  font-family: var(--font-display);
  font-size: clamp(56px, 9vw, 132px);
  font-weight: 400;
  line-height: 0.95;
  letter-spacing: var(--ls-display);
}
.display-lg {
  font-family: var(--font-display);
  font-size: clamp(40px, 5.5vw, 80px);
  font-weight: 400;
  line-height: 1.04;
  letter-spacing: var(--ls-display);
}
.display-md {
  font-family: var(--font-display);
  font-size: clamp(28px, 3.4vw, 48px);
  font-weight: 400;
  line-height: 1.15;
}
.display-md em,
.display-lg em,
.display-xl em { font-style: italic; color: var(--coral); font-weight: 400; }

.lead {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(20px, 2vw, 26px);
  line-height: 1.45;
  color: #2B2B2B;
  max-width: 56ch;
}

.body-text {
  font-size: 14.5px;
  font-weight: 400;
  line-height: 1.85;
  color: #2B2B2B;
  max-width: 64ch;
}
.body-text-dark {
  font-size: 14.5px;
  font-weight: 400;
  line-height: 1.85;
  color: rgba(255,255,255,0.7);
  max-width: 64ch;
}

.mono,
.meta {
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 400;
  letter-spacing: 0.04em;
  color: var(--gris-medio);
}
.mono-tinta { color: var(--tinta); }
.mono-light { color: rgba(255,255,255,0.6); }

.coord {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.18em;
  color: var(--gris-medio);
  text-transform: uppercase;
}
.coord-light { color: rgba(255,255,255,0.5); }

/* ─── REGLAS Y LÍNEAS ───────────────────────────────────────────────── */
.rule        { height: 1px; background: var(--gris-rule); border: 0; }
.rule-strong { height: 1px; background: var(--tinta); border: 0; }
.rule-on-dark{ height: 1px; background: rgba(255,255,255,0.18); border: 0; }

.accent-line,
.rule-accent {
  width: 48px;
  height: 2px;
  background: var(--coral);
  border: 0;
  margin: 24px 0;
  display: block;
}
.rule-accent--light { background: rgba(255,255,255,0.85); }
.rule-accent--mar   { background: var(--mar); }
.accent-line.center { margin-left: auto; margin-right: auto; }

.horizonte {
  height: 1px;
  background: linear-gradient(to right,
    transparent 0%,
    var(--mar) 22%,
    var(--mar) 78%,
    transparent 100%);
  border: 0;
  margin: 0;
}

/* ─── NAVEGACIÓN ────────────────────────────────────────────────────── */
.topline {
  height: 2px;
  background: var(--coral);
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 101;
}

.nav {
  position: fixed;
  top: 2px; left: 0; right: 0;
  height: var(--nav-h);
  background: rgba(255,255,255,0.92);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--gris-rule);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 56px;
}
.nav-logo {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 500;
  color: var(--tinta);
  letter-spacing: 0.02em;
  display: flex;
  flex-direction: column;
  line-height: 1;
}
.nav-logo span {
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.22em;
  font-weight: 400;
  color: var(--gris-medio);
  text-transform: uppercase;
  margin-top: 6px;
}
.nav-links {
  display: flex;
  align-items: center;
  gap: 32px;
  list-style: none;
}
.nav-links a {
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: #2B2B2B;
  padding: 6px 0;
  transition: color var(--transition);
  position: relative;
}
.nav-links a:hover { color: var(--tinta); }
.nav-links a.active {
  color: var(--tinta);
  border-bottom: 1px solid var(--coral);
}
.nav-cta {
  background: var(--tinta);
  color: var(--lienzo) !important;
  padding: 10px 22px !important;
  font-size: 10.5px !important;
  letter-spacing: 0.22em !important;
  border: none;
  transition: background var(--transition) !important;
}
.nav-cta:hover { background: var(--coral) !important; }
.nav-cta.active { background: var(--coral); border: none; }

.nav-toggle {
  display: none;
  background: none;
  border: none;
  padding: 4px;
}
.nav-toggle span {
  display: block;
  width: 24px;
  height: 1px;
  background: var(--tinta);
  margin: 6px 0;
  transition: var(--transition);
}

/* ─── PAGE WRAPPER ──────────────────────────────────────────────────── */
.page-content {
  padding-top: calc(var(--nav-h) + 2px);
  min-height: 100vh;
}

/* ─── SECCIONES ─────────────────────────────────────────────────────── */
.section {
  padding: 112px 56px;
  max-width: var(--max-w);
  margin: 0 auto;
}
.section-narrow {
  padding: 96px 56px;
  max-width: var(--max-w-narrow);
  margin: 0 auto;
}
.section-dark {
  background: var(--tinta);
  color: var(--lienzo);
  position: relative;
  overflow: hidden;
}
.section-dark .section { padding: 112px 56px; }
.section-paper { background: var(--hueso); }
.section-bone  { background: var(--bruma); }
.section-light { background: var(--hueso); padding: 96px 0; }
.section-light .section { max-width: var(--max-w); margin: 0 auto; }

.numerador {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.32em;
  color: var(--gris-medio);
  text-transform: uppercase;
  display: block;
  margin-bottom: 14px;
}
.numerador-light { color: rgba(255,255,255,0.5); }
.numerador strong { font-weight: 500; color: var(--tinta); margin-right: 14px; }
.numerador-light strong { color: var(--lienzo); }

/* ─── BOTONES ───────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  padding: 16px 30px;
  cursor: pointer;
  transition: var(--transition);
  border: none;
  background: var(--tinta);
  color: var(--lienzo);
}
.btn:hover { background: var(--coral); }
.btn:active { opacity: 0.78; }

.btn-rojo,
.btn-coral { background: var(--coral); color: var(--lienzo); }
.btn-rojo:hover,
.btn-coral:hover { background: var(--coral-deep); }

.btn-outline-blanco,
.btn-outline-light {
  background: transparent;
  color: var(--lienzo);
  border: 1px solid rgba(255,255,255,0.4);
}
.btn-outline-blanco:hover,
.btn-outline-light:hover {
  border-color: var(--lienzo);
  background: rgba(255,255,255,0.06);
}
.btn-outline-negro,
.btn-outline-dark {
  background: transparent;
  color: var(--tinta);
  border: 1px solid var(--gris-rule);
}
.btn-outline-negro:hover,
.btn-outline-dark:hover {
  border-color: var(--tinta);
  background: var(--hueso);
}

.btn-link {
  background: transparent;
  color: var(--tinta);
  padding: 10px 0;
  border: 0;
  border-bottom: 1px solid var(--tinta);
  letter-spacing: 0.18em;
  font-size: 11px;
  font-weight: 500;
  display: inline-flex;
  gap: 12px;
  align-items: center;
  text-transform: uppercase;
}
.btn-link:hover { color: var(--coral); border-color: var(--coral); }
.btn-link-light {
  color: var(--lienzo);
  border-color: rgba(255,255,255,0.6);
}
.btn-link-light:hover { color: var(--coral); border-color: var(--coral); }

.btn-arrow::after { content: '→'; font-size: 14px; line-height: 1; }

/* ─── GRIDS ─────────────────────────────────────────────────────────── */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; align-items: start; }
.grid-2-asym { display: grid; grid-template-columns: 1.2fr 1fr; gap: 64px; align-items: start; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 40px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 32px; }

/* ─── PATRÓN DE PUNTOS (manual §03) ─────────────────────────────────── */
.dots {
  background-image: radial-gradient(circle, var(--dot-color) 1.2px, transparent 1.2px);
  background-size: 12px 12px;
}
.dots-light {
  background-image: radial-gradient(circle, var(--dot-color-light) 1.2px, transparent 1.2px);
  background-size: 12px 12px;
}

/* Reemplaza el viejo t-pattern (texto repetido) por dot pattern */
.t-pattern {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  opacity: 0.7;
  background-image: radial-gradient(circle, rgba(255,255,255,0.05) 1px, transparent 1px);
  background-size: 14px 14px;
}

/* ─── CARDS ─────────────────────────────────────────────────────────── */
.card {
  background: var(--lienzo);
  border: 1px solid var(--gris-rule);
  display: flex;
  flex-direction: column;
  transition: border-color var(--transition);
}
.card:hover { border-color: var(--tinta); }
.card-img {
  width: 100%;
  aspect-ratio: 4/3;
  background: var(--hueso);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}
.card-body { padding: 28px 28px 32px; display: flex; flex-direction: column; gap: 10px; }
.card-meta {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gris-medio);
}
.card-title {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 400;
  line-height: 1.2;
  color: var(--tinta);
}
.card-text {
  font-size: 13px;
  font-weight: 400;
  color: #2B2B2B;
  line-height: 1.7;
}
.card-link {
  margin-top: auto;
  padding-top: 16px;
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--tinta);
  display: inline-flex;
  gap: 10px;
  align-items: center;
  transition: gap var(--transition), color var(--transition);
}
.card:hover .card-link { gap: 16px; color: var(--coral); }
.card-label { font-size: 10.5px; letter-spacing: 0.22em; text-transform: uppercase; color: var(--gris-medio); margin-bottom: 8px; }

/* Imagen monocroma con overlay tipográfico */
.thumb-letter {
  width: 100%;
  aspect-ratio: 4/3;
  background: linear-gradient(140deg, #1F1F1F 0%, #2E2622 60%, #3A2A22 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}
.thumb-letter::before {
  content: attr(data-letter);
  font-family: var(--font-display);
  font-size: clamp(80px, 18vw, 200px);
  font-weight: 300;
  color: rgba(255,255,255,0.06);
  letter-spacing: -0.04em;
  line-height: 1;
}
.thumb-letter::after {
  content: '';
  position: absolute;
  left: 18px; top: 18px;
  width: 32px; height: 1px;
  background: var(--coral);
}
.thumb-letter[data-tone="paper"] {
  background: linear-gradient(140deg, var(--bruma) 0%, var(--hueso) 100%);
}
.thumb-letter[data-tone="paper"]::before { color: rgba(17,17,17,0.06); }
.thumb-letter[data-tone="mar"] {
  background: linear-gradient(160deg, #3A4A4F 0%, #5C6E72 60%, #B8C2C4 100%);
}

/* ─── HERO STAGE ────────────────────────────────────────────────────── */
.stage {
  position: relative;
  min-height: 88vh;
  padding: calc(var(--nav-h) + 96px) 56px 96px;
  background: var(--lienzo);
  overflow: hidden;
}
.stage--ink {
  background: var(--tinta);
  color: var(--lienzo);
}
.stage--paper { background: var(--hueso); }

.stage-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  position: relative;
  z-index: 2;
}

.stage::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 2px; height: 100%;
  background: var(--coral);
  opacity: 0.6;
  z-index: 1;
}
.stage--ink::before { opacity: 0.85; }

.stage::after {
  content: '';
  position: absolute;
  left: 56px; right: 56px;
  bottom: 56px;
  height: 1px;
  background: var(--gris-rule);
  z-index: 1;
}
.stage--ink::after { background: rgba(255,255,255,0.18); }

/* ─── SCROLL REVEAL ─────────────────────────────────────────────────── */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 700ms var(--ease), transform 700ms var(--ease);
}
.reveal.visible {
  opacity: 1;
  transform: none;
}
.reveal-delay-1 { transition-delay: 80ms; }
.reveal-delay-2 { transition-delay: 160ms; }
.reveal-delay-3 { transition-delay: 240ms; }
.reveal-delay-4 { transition-delay: 320ms; }

.divider { width: 100%; height: 1px; background: var(--gris-rule); }
.divider-dark { width: 100%; height: 1px; background: rgba(255,255,255,0.14); }

/* ─── FOOTER ───────────────────────────────────────────────────────── */
footer {
  background: var(--tinta);
  color: rgba(255,255,255,0.65);
  padding: 80px 56px 36px;
  position: relative;
}
footer::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: var(--coral);
}
.footer-inner {
  max-width: var(--max-w);
  margin: 0 auto;
}
.footer-top {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr 1fr;
  gap: 48px;
  padding-bottom: 56px;
  border-bottom: 1px solid rgba(255,255,255,0.14);
  margin-bottom: 40px;
}
.footer-brand .nav-logo { color: var(--lienzo); font-size: 22px; }
.footer-brand .nav-logo span { color: rgba(255,255,255,0.45); }
.footer-brand p {
  font-size: 13px;
  font-weight: 300;
  line-height: 1.7;
  max-width: 280px;
  margin-top: 18px;
  color: rgba(255,255,255,0.55);
}
.footer-col h4 {
  font-family: var(--font-body);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.45);
  margin-bottom: 22px;
}
.footer-col ul { list-style: none; display: flex; flex-direction: column; gap: 12px; }
.footer-col ul li a {
  font-size: 13px;
  font-weight: 400;
  color: rgba(255,255,255,0.7);
  transition: color var(--transition);
}
.footer-col ul li a:hover { color: var(--coral); }
.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.45);
}
.footer-bottom .footer-coord { color: rgba(255,255,255,0.55); }
.footer-rojo,
.footer-coral { color: var(--coral); }

/* ─── FORMULARIOS ──────────────────────────────────────────────────── */
.form-input,
.form-textarea,
.form-select,
.dona-input {
  width: 100%;
  padding: 16px 18px;
  font-family: var(--font-body);
  font-size: 13.5px;
  font-weight: 400;
  border: 1px solid var(--gris-rule);
  background: var(--lienzo);
  color: var(--tinta);
  outline: none;
  transition: border-color var(--transition);
  -webkit-appearance: none;
}
.form-input:focus,
.form-textarea:focus,
.form-select:focus,
.dona-input:focus {
  border-color: var(--tinta);
}
.form-input::placeholder,
.form-textarea::placeholder { color: var(--gris-medio); }

/* ─── HERO BARS legacy (vacíos para no romper) ─────────────────────── */
.hero-bars { display: none; }

/* ─── RESPONSIVE ───────────────────────────────────────────────────── */
@media (max-width: 980px) {
  .nav { padding: 0 24px; }
  .section, .section-dark .section { padding: 72px 24px; }
  .stage { padding: calc(var(--nav-h) + 64px) 24px 72px; }
  .stage::after { left: 24px; right: 24px; bottom: 32px; }
  .grid-2, .grid-2-asym, .grid-3, .grid-4 { grid-template-columns: 1fr; gap: 32px; }
  .footer-top { grid-template-columns: 1fr 1fr; gap: 32px; padding: 0 0 40px; }
  footer { padding: 56px 24px 32px; }
  .nav-links { display: none; }
  .nav-links.open {
    display: flex;
    flex-direction: column;
    position: fixed;
    top: calc(var(--nav-h) + 2px); left: 0; right: 0;
    background: var(--lienzo);
    padding: 32px 24px 48px;
    gap: 22px;
    border-top: 1px solid var(--gris-rule);
    border-bottom: 1px solid var(--gris-rule);
    align-items: flex-start;
  }
  .nav-toggle { display: block; }
}
@media (max-width: 600px) {
  .footer-top { grid-template-columns: 1fr; }
  .footer-bottom { flex-direction: column; gap: 12px; text-align: center; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
  .reveal { opacity: 1; transform: none; }
}
