/* ==========================================================================
   Sergio Castillo Gutiérrez — landing page
   Índice: 1. Tokens  2. Base  3. Utilidades  4. Botones  5. Cabecera
           6. Hero  7. Secciones  8. Trayectoria  9. Temas  10. Sedes
           11. Galería  12. Preguntas  13. Contacto y formulario
           14. Pie, botón flotante y visor  15. Movimiento e impresión
   ========================================================================== */

/* 1. Tokens ---------------------------------------------------------------- */
:root {
  /* Oro */
  --oro-nucleo: #FFF3B0;   /* solo foco y filetes de brillo */
  --oro-claro: #F2CC5F;    /* hover */
  --oro: #E1BD5A;          /* marca, titulares, botón principal */
  --oro-medio: #9A751C;    /* texto grande, bordes de controles */
  --oro-profundo: #725B29; /* solo bordes y separadores */

  /* Pared y superficies */
  --pared: #1A191F;        /* fondo principal */
  --pared-luz: #272121;    /* secciones iluminadas */
  --halo: #36343B;         /* resplandor, bordes sutiles */
  --mesa: #2F2E33;         /* mesa negra satinada: tarjetas y contacto */

  /* Texto */
  --texto: #F3EFE4;
  --texto-suave: #C9C4B6;
  --error: #FFB8AB;

  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", "URW Palladio L", Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  --ancho: 70rem;
  --margen: clamp(1.25rem, 4vw, 2.5rem);
  --ritmo: clamp(3.5rem, 8vw, 6.5rem);
  --radio: 4px;
}

/* 2. Base ------------------------------------------------------------------ */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 6.5rem; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--pared);
  color: var(--texto);
  font: 1.0625rem/1.65 var(--sans);
}

h1, h2, h3 { font-family: var(--serif); font-weight: 500; line-height: 1.15; margin: 0; text-wrap: balance; }
h2 { font-size: clamp(1.9rem, 4.2vw, 2.75rem); color: var(--oro); letter-spacing: -0.01em; }
h3 { font-size: 1.3rem; line-height: 1.3; }

p { margin: 0 0 1em; max-width: 68ch; }
p:last-child { margin-bottom: 0; }

a { color: var(--oro); text-underline-offset: 0.2em; text-decoration-thickness: 1px; }
a:hover { color: var(--oro-claro); }

img { display: block; max-width: 100%; height: auto; }
ul, ol { margin: 0; padding: 0; }

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

/* 3. Utilidades ------------------------------------------------------------ */
.contenedor { width: 100%; max-width: var(--ancho); margin-inline: auto; padding-inline: var(--margen); }
.contenedor--angosto { max-width: 50rem; }

.solo-lector {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip-path: inset(50%); white-space: nowrap;
}

.saltar {
  position: absolute; left: 1rem; top: -4rem; z-index: 20;
  background: var(--oro); color: var(--pared); padding: 0.6rem 1rem; border-radius: var(--radio);
}
.saltar:focus { top: 1rem; color: var(--pared); }

.lista-limpia { list-style: none; }
.icono {
  width: 1.25em; height: 1.25em; flex: none;
  fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
}

/* 4. Botones --------------------------------------------------------------- */
.boton {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.55rem;
  min-height: 3rem; padding: 0.7rem 1.4rem;
  font: 600 1rem/1.2 var(--sans); text-decoration: none; text-align: center;
  border: 1px solid transparent; border-radius: var(--radio); cursor: pointer;
  transition: background-color 0.15s, border-color 0.15s, color 0.15s;
}
.boton--primario { background: var(--oro); color: var(--pared); }
.boton--primario:hover { background: var(--oro-claro); color: var(--pared); }
.boton--linea { border-color: var(--oro-medio); color: var(--oro); background: transparent; }
.boton--linea:hover { border-color: var(--oro-claro); color: var(--oro-claro); background: rgba(242, 204, 95, 0.08); }
.boton--ancho { width: 100%; }

/* 5. Cabecera -------------------------------------------------------------- */
.cabecera { background: var(--pared); border-bottom: 1px solid var(--halo); z-index: 10; }
.cabecera__fila {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 0.5rem 1.5rem; padding-block: 0.75rem;
}
.cabecera__logo img { width: auto; height: 3.25rem; }
.cabecera__cta { min-height: 2.75rem; padding: 0.5rem 1rem; font-size: 0.95rem; }
@media (max-width: 559px) { .cabecera__cta { display: none; } }

/* En móvil la navegación ocupa su propia fila y se desliza en horizontal */
.cabecera__nav { order: 3; width: calc(100% + var(--margen) * 2); overflow-x: auto; margin-inline: calc(var(--margen) * -1); padding-inline: var(--margen); }
.cabecera__nav ul { display: flex; gap: 1.5rem; list-style: none; white-space: nowrap; }
.cabecera__nav a { display: block; padding: 0.6rem 0; color: var(--texto-suave); text-decoration: none; font-size: 0.95rem; }
.cabecera__nav a:hover { color: var(--oro-claro); }

@media (min-width: 900px) {
  .cabecera { position: sticky; top: 0; }
  .cabecera__fila { flex-wrap: nowrap; }
  .cabecera__nav { order: 0; width: auto; margin: 0 0 0 auto; padding: 0; overflow: visible; }
  .cabecera__logo img { height: 4rem; }
}

/* 6. Hero: la pared con el halo del letrero y, abajo, la mesa satinada ------ */
.hero {
  background:
    radial-gradient(ellipse 60% 70% at 78% 52%, var(--halo) 0%, var(--pared-luz) 42%, transparent 75%),
    var(--pared);
}
.hero__rejilla { display: grid; gap: 2rem; padding-top: clamp(2.5rem, 7vw, 5rem); }

.hero h1 { display: grid; gap: 0.6rem; }
.hero__nombre { font-size: clamp(2.6rem, 9.5vw, 5.25rem); line-height: 1; letter-spacing: -0.02em; color: var(--texto); }
.hero__oficio { font-size: clamp(1.2rem, 3vw, 1.6rem); line-height: 1.3; color: var(--oro); }

/* El subrayado luminoso del letrero: único efecto de brillo de la página */
.neon {
  display: block; width: min(22rem, 70%); height: 4px; margin: 1.6rem 0 1.8rem; border-radius: 2px;
  background: linear-gradient(90deg, var(--oro-medio), var(--oro-claro) 35%, var(--oro-nucleo) 50%, var(--oro-claro) 65%, var(--oro-medio));
  box-shadow: 0 0 14px rgba(242, 204, 95, 0.55), 0 0 42px rgba(225, 189, 90, 0.3);
}

.hero__entrada { font-size: 1.15rem; color: var(--texto); max-width: 34rem; }
.hero__acciones { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1.75rem; }

.hero__retrato { align-self: end; justify-self: center; width: min(72vw, 22rem); }
.hero__retrato img { width: 100%; }

.mesa { background: var(--mesa); border-top: 1px solid var(--oro-profundo); }
.mesa__datos { list-style: none; display: grid; gap: 0.35rem; padding-block: 1.1rem; color: var(--texto-suave); font-size: 0.98rem; }

@media (min-width: 900px) {
  .hero__rejilla { grid-template-columns: minmax(0, 1.25fr) minmax(0, 0.75fr); align-items: end; gap: 3rem; }
  .hero__texto { padding-bottom: clamp(3rem, 6vw, 5rem); }
  .hero__retrato { width: 100%; max-width: 27.5rem; justify-self: end; }
  .mesa__datos { grid-template-columns: repeat(3, auto); justify-content: space-between; gap: 2rem; }
}

/* 7. Secciones ------------------------------------------------------------- */
.seccion { padding-block: var(--ritmo); }
.seccion--iluminada { background: var(--pared-luz); }
.seccion--mesa { background: var(--mesa); border-top: 1px solid var(--oro-profundo); }
.seccion__entrada { margin-top: 1rem; font-size: 1.12rem; color: var(--texto-suave); }

/* 8. Trayectoria: línea de tiempo (orden cronológico real) ------------------ */
.linea { list-style: none; margin-top: 2.75rem; border-left: 1px solid var(--oro-profundo); }
.linea li { position: relative; padding: 0 0 2rem 1.5rem; }
.linea li:last-child { padding-bottom: 0; }
.linea li::before {
  content: ""; position: absolute; left: -5px; top: 0.55rem;
  width: 9px; height: 9px; border-radius: 50%; background: var(--oro);
}
.linea__fecha { margin: 0 0 0.2rem; font-family: var(--serif); font-size: 1.1rem; color: var(--oro); }
.linea h3 { margin-bottom: 0.3rem; }
.linea p { color: var(--texto-suave); }
.linea .linea__fecha { color: var(--oro); }

@media (min-width: 720px) {
  .linea { border-left: 0; }
  .linea li { display: grid; grid-template-columns: 9rem 1fr; gap: 2.5rem; padding-left: 0; }
  .linea li::before { left: calc(9rem + 1.25rem - 5px); }
  .linea li::after {
    content: ""; position: absolute; left: calc(9rem + 1.25rem); top: 0; bottom: 0;
    border-left: 1px solid var(--oro-profundo); z-index: -1;
  }
  .linea li { z-index: 0; }
  .linea__fecha { text-align: right; font-size: 1.2rem; }
}

.notas { display: grid; gap: 2rem; margin-top: 3rem; padding-top: 2.25rem; border-top: 1px solid var(--halo); }
.notas h3 { margin-bottom: 0.6rem; color: var(--oro); font-size: 1.15rem; }
.notas ul { list-style: none; color: var(--texto-suave); }
.notas li + li { margin-top: 0.5rem; }
@media (min-width: 720px) { .notas { grid-template-columns: 1fr 1fr; gap: 3rem; } }

/* 9. Temas: filas, no tarjetas --------------------------------------------- */
.temas { margin-top: 2.5rem; border-bottom: 1px solid var(--oro-profundo); }
.tema { display: grid; gap: 1rem; padding-block: 1.75rem; border-top: 1px solid var(--oro-profundo); }
.tema h3 { font-size: 1.5rem; color: var(--texto); }
.tema__cuerpo p { color: var(--texto-suave); }
.tema__cuerpo .tema__formato { color: var(--texto); font-size: 0.98rem; }
.tema .boton { justify-self: start; }

@media (min-width: 900px) {
  .tema { grid-template-columns: 19rem minmax(0, 1fr) auto; gap: 2.5rem; align-items: start; }
  .tema .boton { justify-self: end; }
}

.proximos { margin-top: 3rem; padding: 1.5rem 1.75rem; background: var(--mesa); border-left: 3px solid var(--oro); border-radius: 0 var(--radio) var(--radio) 0; }
.proximos h3 { margin-bottom: 0.4rem; color: var(--oro); }
.proximos__lista { list-style: none; margin-top: 0.75rem; }
.proximos__fecha { margin-bottom: 0.1rem; font-family: var(--serif); color: var(--oro); }

/* 10. Sedes ---------------------------------------------------------------- */
.sedes { display: grid; gap: 2.5rem; margin-top: 2.5rem; }
.sedes h3 { margin-bottom: 0.9rem; color: var(--oro); font-size: 1.2rem; }
.sedes li { padding: 0.65rem 0; border-top: 1px solid var(--halo); }
.sedes li:last-child { border-bottom: 1px solid var(--halo); }
.sedes p { color: var(--texto-suave); }
.sedes .sedes__casas { margin-top: 2.25rem; }
@media (min-width: 900px) { .sedes { grid-template-columns: 1fr 1fr; gap: 4.5rem; } }

/* 11. Galería -------------------------------------------------------------- */
.galeria { list-style: none; display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.6rem; margin-top: 2.5rem; }
.galeria__grande { grid-column: span 2; }
@media (max-width: 899px) {
  .galeria li:last-child { grid-column: span 2; }
  .galeria li:last-child img { aspect-ratio: 16 / 9; }
}
.galeria a { display: block; height: 100%; overflow: hidden; border-radius: var(--radio); background: var(--pared); }
.galeria img { width: 100%; height: 100%; aspect-ratio: 4 / 3; object-fit: cover; transition: opacity 0.15s; }
.galeria a:hover img { opacity: 0.85; }
.galeria a:focus-visible { outline-offset: 2px; }

@media (min-width: 900px) {
  .galeria { grid-template-columns: repeat(3, 1fr); gap: 0.75rem; }
  .galeria__grande { grid-row: span 2; }
}

/* 12. Preguntas ------------------------------------------------------------ */
.pregunta { border-top: 1px solid var(--oro-profundo); }
.pregunta:first-of-type { margin-top: 2.25rem; }
.pregunta:last-of-type { border-bottom: 1px solid var(--oro-profundo); }
.pregunta summary {
  display: flex; justify-content: space-between; align-items: baseline; gap: 1.5rem;
  padding: 1.15rem 0; cursor: pointer; list-style: none;
  font-family: var(--serif); font-size: 1.25rem; line-height: 1.35;
}
.pregunta summary::-webkit-details-marker { display: none; }
.pregunta summary::after { content: "+"; flex: none; font-family: var(--sans); font-size: 1.4rem; line-height: 1; color: var(--oro); }
.pregunta[open] summary::after { content: "–"; }
.pregunta summary:hover { color: var(--oro-claro); }
.pregunta p { padding-bottom: 1.4rem; color: var(--texto-suave); }

/* 13. Contacto y formulario ------------------------------------------------ */
.contacto { display: grid; gap: 2.5rem; }
.contacto__intro > p { margin-top: 1rem; font-size: 1.12rem; }
.contacto__intro h3 { margin: 2rem 0 0.75rem; font-size: 1.1rem; color: var(--oro); }
.contacto__vias { margin-top: 1.75rem; display: grid; gap: 0.25rem; }
.contacto__vias a, .redes a { display: inline-flex; align-items: center; gap: 0.6rem; min-height: 2.75rem; overflow-wrap: anywhere; }
.redes { list-style: none; display: flex; flex-wrap: wrap; gap: 0.25rem 1.75rem; }

.formulario { display: grid; gap: 1.15rem; padding: clamp(1.25rem, 4vw, 2.25rem); background: var(--pared); border: 1px solid var(--halo); border-radius: var(--radio); }
.formulario__nota, .formulario__privacidad, .campo__ayuda { font-size: 0.92rem; color: var(--texto-suave); max-width: none; margin: 0; }

.campo { display: grid; gap: 0.4rem; }
.campo-doble { display: grid; gap: 1.15rem; }
@media (min-width: 560px) { .campo-doble { grid-template-columns: 1fr 1fr; } }

.campo label { font-weight: 600; font-size: 0.98rem; }
.campo input, .campo select, .campo textarea {
  width: 100%; min-height: 3rem; padding: 0.65rem 0.8rem;
  font: inherit; color: var(--texto); background: var(--mesa);
  border: 1px solid var(--oro-medio); border-radius: var(--radio);
}
.campo textarea { resize: vertical; }
.campo input:hover, .campo select:hover, .campo textarea:hover { border-color: var(--oro); }
.campo [aria-invalid="true"] { border-color: var(--error); border-width: 2px; }
.campo__error { margin: 0; font-size: 0.92rem; font-weight: 600; color: var(--error); }
.campo__error::before { content: "Revisa este campo: "; }

.formulario__estado { padding: 1rem 1.15rem; border: 1px solid var(--oro); border-radius: var(--radio); background: var(--mesa); }
.formulario__estado p { margin-bottom: 0.6rem; }
.formulario__estado--error { border-color: var(--error); }
.formulario__acciones { display: flex; flex-wrap: wrap; gap: 0.5rem 1.25rem; align-items: center; }
.enlace-boton { padding: 0; border: 0; background: none; font: inherit; color: var(--oro); text-decoration: underline; text-underline-offset: 0.2em; cursor: pointer; }
.enlace-boton:hover { color: var(--oro-claro); }

@media (min-width: 900px) {
  .contacto { grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); gap: 4.5rem; align-items: start; }
}

/* 14. Pie, botón flotante y visor ------------------------------------------ */
.pie { padding-block: 2.5rem 6rem; border-top: 1px solid var(--halo); color: var(--texto-suave); font-size: 0.95rem; }
.pie__fila { display: grid; gap: 1rem; }
.pie img { width: auto; height: 3.75rem; }
.pie p { margin: 0; }
@media (min-width: 900px) {
  .pie { padding-bottom: 2.5rem; }
  .pie__fila { grid-template-columns: auto 1fr auto; align-items: center; gap: 2.5rem; }
}

.flotante {
  position: fixed; right: 1rem; bottom: 1rem; z-index: 15;
  display: grid; place-items: center; width: 3.5rem; height: 3.5rem;
  border-radius: 50%; background: var(--oro); color: var(--pared);
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.5);
  transition: opacity 0.2s, visibility 0.2s, background-color 0.15s;
}
.flotante:hover { background: var(--oro-claro); color: var(--pared); }
.flotante .icono { width: 1.6rem; height: 1.6rem; }
.flotante[data-oculto] { opacity: 0; visibility: hidden; }

.visor { max-width: min(96vw, 80rem); max-height: 94vh; padding: 0; border: 1px solid var(--oro-profundo); border-radius: var(--radio); background: var(--pared); color: var(--texto); }
.visor::backdrop { background: rgba(10, 10, 12, 0.88); }
.visor img { max-width: 100%; max-height: calc(94vh - 3.5rem); width: auto; margin-inline: auto; }
.visor form { display: flex; justify-content: flex-end; }
.visor__cerrar { min-height: 2.75rem; padding: 0.5rem 1.1rem; border: 0; background: none; color: var(--oro); font: 600 1rem var(--sans); cursor: pointer; }
.visor__cerrar:hover { color: var(--oro-claro); }

/* 15. Movimiento e impresión ----------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; }
}

@media print {
  .cabecera__nav, .cabecera__cta, .flotante, .formulario, .hero__acciones { display: none; }
  body { background: #fff; color: #000; }
  h2, a, .hero__oficio, .linea__fecha { color: #000; }
}

/* 16. Página legal ---------------------------------------------------------- */
.legal h1 { font-size: clamp(2.2rem, 6vw, 3.2rem); margin-bottom: 0.75rem; }
.legal h2 { font-size: 1.5rem; margin: 2.25rem 0 0.6rem; }
.legal p { color: var(--texto-suave); }
