@import url("/https:/fonts.googleapis.com/css2?family=Cormorant+Garamond:wght@400;500;600;700&family=EB+Garamond:wght@400;500;600;700&display=swap");

:root {
  --bg: #ffffff;
  --text: #1c1b1f;
  --accent: #4b4fa3;
  --accent-soft: #6a6fc2;
  --muted: #6a6a73;
  --line: #d8d8e2;
  --card: #f6f6fb;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "EB Garamond", "Cormorant Garamond", Garamond, serif;
  line-height: 1.62;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--accent);
}

/* Language switch */
.language-switch {
  display: flex;
  gap: 0.45rem;
  align-items: center;
  flex: 0 0 auto;
}

.lang-btn {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--accent);
  font-family: "EB Garamond", "Cormorant Garamond", Garamond, serif;
  font-size: 0.92rem;
  line-height: 1;
  padding: 0.38rem 0.62rem;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.lang-btn:hover,
.lang-btn:focus,
.lang-btn.active {
  background: var(--accent);
  color: #ffffff;
  border-color: var(--accent);
}

.lang {
  display: none;
}

html[data-lang="en"] .lang-en {
  display: inline;
}

html[data-lang="es"] .lang-es {
  display: inline;
}

html[data-lang="en"] p.lang-en,
html[data-lang="es"] p.lang-es,
html[data-lang="en"] div.lang-en,
html[data-lang="es"] div.lang-es {
  display: block;
}

/* Hero */
.hero {
  padding: 4.2rem 2rem 4rem 2rem;
  border-bottom: 1px solid var(--line);
}

.hero-inner {
  max-width: 1100px;
  margin: 0 auto;
}

.hero-topline {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 2rem;
}

.eyebrow {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  line-height: 1.3;
  flex: 1 1 auto;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.9fr);
  gap: 2.5rem;
  align-items: start;
}

.hero-text {
  padding-top: 0;
  max-width: 44rem;
}

h1 {
  margin: 0;
  font-family: "Cormorant Garamond", "EB Garamond", Garamond, serif;
  font-size: clamp(2.8rem, 6vw, 4.4rem);
  line-height: 0.92;
  color: var(--accent);
  font-weight: 600;
  max-width: 16ch;
  text-wrap: balance;
}

.lead {
  max-width: 42ch;
  font-size: clamp(1.04rem, 2vw, 1.3rem);
  line-height: 1.48;
  margin-top: 1.1rem;
  margin-bottom: 1.8rem;
  text-wrap: pretty;
}

.main-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem;
  margin-top: 1.2rem;
}

.nav-separator {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: "Apple Symbols", "Segoe UI Symbol", "Noto Sans Symbols 2", "Arial Unicode MS", sans-serif;
  font-size: 0.82rem;
  line-height: 1;
  color: var(--accent);
  transform: translateY(-0.02em);
}

.main-nav a {
  color: var(--accent);
  text-decoration: none;
  font-size: 1rem;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease, color 0.2s ease;
}

.main-nav a:hover,
.main-nav a:focus {
  color: var(--accent-soft);
  border-bottom: 1px solid var(--accent-soft);
}

.hero-image {
  max-width: 430px;
  width: 100%;
  margin: 0 0 0 auto;
  padding-top: 0.2rem;
}

.hero-image img {
  border: 1px solid var(--line);
}

.hero-image figcaption {
  margin-top: 0.45rem;
  font-size: 0.82rem;
  line-height: 1.35;
  color: var(--muted);
  text-align: left;
}

/* Site note */
.site-note {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0.85rem 2rem;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.site-note p {
  margin: 0;
  font-size: 0.95rem;
  color: var(--muted);
  font-style: italic;
}

/* Main content */
main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 3.2rem 2rem 5rem 2rem;
}

.content-section {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 1.25rem;
  padding: 2.2rem 0;
  border-bottom: 1px solid var(--line);
  align-items: start;
}

.section-label {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  font-family: "Apple Symbols", "Segoe UI Symbol", "Noto Sans Symbols 2", "Arial Unicode MS", sans-serif;
  font-size: 1rem;
  line-height: 1;
  color: var(--accent);
  padding-top: 0.45rem;
  min-width: 28px;
}

.section-body h2 {
  margin-top: 0;
  margin-bottom: 0.95rem;
  font-family: "Cormorant Garamond", "EB Garamond", Garamond, serif;
  font-size: 2.3rem;
  line-height: 1;
  color: var(--accent);
  font-weight: 600;
}

.section-body p {
  font-size: 1.14rem;
  max-width: 820px;
  margin-top: 0;
  margin-bottom: 0.9rem;
}

/* Research interests layout */
.interests-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 360px);
  gap: 1.5rem;
  align-items: start;
}

.interests-text {
  min-width: 0;
}

.interests-image {
  margin: 0;
  width: 100%;
}

.interests-image img {
  width: 100%;
  height: auto;
  display: block;
}

/* Selected projects layout */
.projects-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 360px);
  gap: 1.5rem;
  align-items: start;
}

.projects-text {
  min-width: 0;
}

.projects-image {
  margin: 0;
  width: 100%;
}

.projects-image img {
  width: 100%;
  height: auto;
  display: block;
}

/* Projects subsection title */
.projects-subtitle {
  margin-top: 1.4rem;
  margin-bottom: 0.8rem;
  font-family: "Cormorant Garamond", "EB Garamond", Garamond, serif;
  font-size: 1.5rem;
  line-height: 1.1;
  color: var(--accent);
  font-weight: 600;
}

.projects-subtitle a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.projects-subtitle a:hover,
.projects-subtitle a:focus {
  color: var(--accent-soft);
  border-bottom: 1px solid var(--accent-soft);
}

/* Links inside project cards */
.project-card h3 a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.project-card h3 a:hover,
.project-card h3 a:focus {
  color: var(--accent-soft);
  border-bottom: 1px solid var(--accent-soft);
}

/* Contact section with image on the right */
.contact-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 360px);
  gap: 1.5rem;
  align-items: start;
}

.contact-text {
  min-width: 0;
}

.contact-image {
  margin: 0;
  width: 100%;
}

.contact-image img {
  width: 100%;
  height: auto;
  display: block;
}

/* Project cards */
.project-card {
  background: var(--card);
  border-left: 3px solid var(--accent);
  padding: 1rem 1.2rem;
  margin-bottom: 1rem;
}

.project-card h3 {
  margin-top: 0;
  margin-bottom: 0.45rem;
  font-size: 1.45rem;
  color: var(--accent);
  font-weight: 600;
}

.project-card p {
  margin-bottom: 0;
  font-size: 1.05rem;
}

/* Project card with image */
.project-card-with-image {
  display: grid;
  grid-template-columns: minmax(0, 1fr) clamp(160px, 24vw, 280px);
  gap: 1.2rem;
  align-items: stretch;
}

.project-card-text {
  min-width: 0;
}

.project-card-image {
  margin: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.project-card-image img {
  width: 100%;
  height: 100%;
  max-height: 100%;
  object-fit: contain;
  display: block;
}

/* Visual notes rights */
.site-rights-note {
  margin-top: 0.4rem;
  margin-bottom: 1.2rem;
  font-size: 0.98rem;
  color: var(--muted);
  font-style: italic;
  max-width: 780px;
}

/* Visual archive groups by place */
.visual-archive-group {
  margin-top: 2rem;
}

.visual-archive-group:first-of-type {
  margin-top: 0.5rem;
}

.visual-archive-group .projects-subtitle {
  margin-top: 0;
  margin-bottom: 0.9rem;
}

/* Visual notes grid */
.visual-notes-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.2rem;
  align-items: start;
}

.visual-note-card {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.visual-note-card a {
  display: block;
  text-decoration: none;
  border-bottom: none;
}

.visual-note-card img {
  width: 100%;
  height: auto;
  border: 1px solid var(--line);
}

.visual-note-card figcaption {
  font-size: 0.92rem;
  line-height: 1.35;
  color: var(--muted);
  text-align: left;
}

/* Visual notes preview on homepage */
.visual-preview-layout {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
  gap: 1.5rem;
  align-items: start;
}

.visual-preview-text {
  min-width: 0;
}

.visual-preview-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  align-items: start;
}

.visual-preview-card {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.visual-preview-card a {
  display: block;
  text-decoration: none;
  border-bottom: none;
}

.visual-preview-card img {
  width: 100%;
  height: auto;
  border: 1px solid var(--line);
}

.visual-preview-card figcaption {
  font-size: 0.9rem;
  line-height: 1.35;
  color: var(--muted);
  text-align: left;
}

/* CV button */
.cv-link {
  display: inline-block;
  margin-top: 0.4rem;
  padding: 0.72rem 1.15rem;
  border: 1px solid var(--accent);
  color: var(--accent);
  text-decoration: none;
  transition: background 0.2s ease, color 0.2s ease;
}

.cv-link:hover,
.cv-link:focus {
  background: var(--accent);
  color: #ffffff;
}

/* Contact */
.contact-links a {
  color: var(--accent);
  text-decoration: none;
  margin-right: 1rem;
}

.contact-links a:hover,
.contact-links a:focus {
  text-decoration: underline;
}

/* =========================================================
   CIERRE DEL SITIO: NOTA FINAL + IMAGEN
   Imagen a la izquierda, texto a la derecha
   ========================================================= */

.closing-wrap {
  max-width: 1100px;
  margin: 0 auto;
  padding: 2.4rem 2rem 4rem 2rem;
  border-top: 1px solid var(--line);
}

.closing-wrap .section-body {
  width: 100%;
}

.closing-layout {
  display: grid;
  grid-template-columns: minmax(220px, 0.75fr) minmax(0, 1.25fr);
  gap: 1.5rem;
  align-items: start;
}

.closing-image {
  margin: 0;
  width: 100%;
}

.closing-image img {
  width: 100%;
  max-width: 320px;
  height: auto;
  display: block;
  object-fit: contain;
  border: 1px solid var(--line);
}

.closing-text {
  min-width: 0;
}

.closing-text p {
  margin-top: 0;
  margin-bottom: 0.85rem;
  color: #8b90d8;
  font-style: italic;
  font-size: 1rem;
  line-height: 1.55;
  max-width: 100%;
}

.closing-text strong {
  color: #8b90d8;
  font-style: italic;
  font-weight: 600;
}

/* Tablet */
@media (max-width: 900px) {
  .hero {
    padding: 3.4rem 1.5rem 3rem 1.5rem;
  }

  .hero-topline {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.8rem;
    margin-bottom: 1.5rem;
  }

  .hero-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .hero-text {
    max-width: 100%;
  }

  .hero-image {
    max-width: 420px;
    margin: 0;
    padding-top: 0;
  }

  h1 {
    max-width: 100%;
    font-size: clamp(2.6rem, 8vw, 3.5rem);
  }

  .lead {
    max-width: 46ch;
  }

  .site-note {
    padding: 0.85rem 1.5rem;
  }

  main {
    padding: 2.6rem 1.5rem 4rem 1.5rem;
  }

  .closing-wrap {
    padding: 2rem 1.5rem 3.5rem 1.5rem;
  }

  .closing-layout {
    grid-template-columns: 1fr;
    gap: 1.2rem;
  }

  .closing-image img {
    max-width: 300px;
  }

  .interests-layout {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .interests-image {
    max-width: 420px;
  }

  .projects-layout {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .projects-image {
    max-width: 420px;
  }

  .projects-subtitle {
    font-size: 1.4rem;
    margin-top: 1.2rem;
  }

  .visual-preview-layout {
    grid-template-columns: 1fr;
    gap: 1.2rem;
  }

  .visual-preview-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.9rem;
  }

  .visual-notes-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
  }

  /* Contact responsive: text first, image below */
  .contact-layout {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .contact-image {
    max-width: 420px;
  }

  .content-section {
    grid-template-columns: 20px 1fr;
    gap: 0.9rem;
    padding: 1.8rem 0;
  }

  .section-label {
    font-size: 0.95rem;
    padding-top: 0.35rem;
    min-width: 20px;
  }

  .section-body h2 {
    font-size: 2rem;
  }

  .section-body p {
    font-size: 1.05rem;
  }
}

/* Mobile */
@media (max-width: 640px) {
  .hero {
    padding: 2.6rem 1.2rem 2.3rem 1.2rem;
  }

  .hero-topline {
    gap: 0.7rem;
  }

  .lang-btn {
    font-size: 0.86rem;
    padding: 0.34rem 0.56rem;
  }

  .eyebrow {
    font-size: 0.8rem;
    letter-spacing: 0.06em;
  }

  h1 {
    max-width: 100%;
    font-size: clamp(2.3rem, 10vw, 3rem);
    line-height: 0.96;
  }

  .lead {
    max-width: 100%;
    font-size: 1.02rem;
    margin-top: 1rem;
    margin-bottom: 1.4rem;
  }

  .main-nav {
    gap: 0.5rem;
  }

  .nav-separator {
    font-size: 0.72rem;
  }

  .main-nav a {
    font-size: 0.95rem;
  }

  .hero-image {
    max-width: 100%;
  }

  .hero-image figcaption {
    font-size: 0.82rem;
  }

  .site-note {
    padding: 0.8rem 1.2rem;
  }

  .site-note p {
    font-size: 0.9rem;
  }

  main {
    padding: 2rem 1.2rem 3rem 1.2rem;
  }

  .closing-wrap {
    padding: 1.8rem 1.2rem 3rem 1.2rem;
  }

  .closing-layout {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .closing-image img {
    max-width: 240px;
  }

  .closing-text p {
    font-size: 0.95rem;
  }

  .interests-image {
    max-width: 100%;
  }

  .projects-image {
    max-width: 100%;
  }

  .projects-subtitle {
    font-size: 1.25rem;
    margin-top: 1rem;
    margin-bottom: 0.7rem;
  }

  .project-card-with-image {
    grid-template-columns: 1fr;
  }

  .project-card-image {
    height: auto;
    max-width: 220px;
  }

  .project-card-image img {
    height: auto;
  }

  .visual-preview-grid {
    grid-template-columns: 1fr;
    gap: 0.9rem;
  }

  .visual-preview-card figcaption {
    font-size: 0.88rem;
  }

  .visual-notes-grid {
    grid-template-columns: 1fr;
    gap: 0.9rem;
  }

  .visual-note-card figcaption {
    font-size: 0.88rem;
  }

  /* Contact responsive: full width image below text */
  .contact-image {
    max-width: 100%;
  }

  .content-section {
    grid-template-columns: 18px 1fr;
    gap: 0.75rem;
    padding: 1.4rem 0;
  }

  .section-label {
    font-size: 0.9rem;
    padding-top: 0.3rem;
    min-width: 18px;
  }

  .section-body h2 {
    font-size: 1.7rem;
    margin-bottom: 0.7rem;
  }

  .section-body p,
  .project-card p {
    font-size: 1rem;
  }

  .project-card {
    padding: 0.9rem 1rem;
  }

  .project-card h3 {
    font-size: 1.2rem;
  }

  .cv-link {
    width: 100%;
    text-align: center;
  }

  .contact-links a {
    display: inline-block;
    margin-right: 0.7rem;
    margin-bottom: 0.3rem;
  }
}
