:root {
  --bg: #070707;
  --text: #e8e2db;
  --dim: #3e3830;
  --muted: #5a5450;
  --font: 'DM Sans', system-ui, sans-serif;
  --pad: clamp(1.5rem, 5vw, 3.5rem);
}

*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  background: var(--bg);
}

/* Cubre la zona del Dynamic Island / notch en iOS */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: env(safe-area-inset-top);
  background: var(--bg);
  z-index: 9999;
  pointer-events: none;
}

html {
  scroll-behavior: smooth;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-weight: 300;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

/* Film grain */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9998;
  opacity: 0.06;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.88' numOctaves='4' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 200px 200px;
  mix-blend-mode: screen;
}

/* ── NAV ── */
nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem var(--pad);
}

.nav-logo {
  color: var(--text);
  text-decoration: none;
  font-size: 1.8rem;
  font-weight: 400;
  letter-spacing: 0.02em;
  opacity: 1;
  transition: opacity 0.3s ease;
}

.nav-logo:hover {
  opacity: 1;
}

nav.nav-solid {
  background: var(--bg);
  /* Extiende el fondo hacia arriba para cubrir el gap del Dynamic Island */
  box-shadow: 0 -100px 0 100px var(--bg);
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.nav-links {
  display: flex;
  gap: 1.5rem;
}

.lang-toggle {
  position: relative;
  padding-left: 2rem;
  border-left: 1px solid rgba(255,255,255,0.15);
}

.lang-globe-btn {
  background: none;
  border: none;
  color: var(--text);
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  opacity: 0.45;
  transition: opacity 0.3s ease;
}

.lang-globe-btn:hover {
  opacity: 0.85;
}

.lang-globe-btn svg {
  width: 1.2rem;
  height: 1.2rem;
  display: block;
}

.lang-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 0.75rem);
  right: 0;
  background: #111;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 4px;
  overflow: hidden;
  min-width: 7rem;
  z-index: 2000;
}

.lang-dropdown.open {
  display: block;
}

.lang-btn {
  display: block;
  width: 100%;
  background: none;
  border: none;
  color: var(--text);
  font-family: var(--font);
  font-size: 0.9rem;
  font-weight: 300;
  letter-spacing: 0.08em;
  cursor: pointer;
  padding: 0.6rem 1rem;
  text-align: left;
  opacity: 0.5;
  transition: opacity 0.2s ease, background 0.2s ease;
}

.lang-btn:hover {
  opacity: 0.9;
  background: rgba(255,255,255,0.06);
}

.lang-btn.active {
  opacity: 0.95;
}

.nav-links a {
  color: var(--text);
  text-decoration: none;
  font-size: 1.1rem;
  font-weight: 300;
  letter-spacing: 0.02em;
  opacity: 0.65;
  transition: opacity 0.3s ease;
}

.nav-links a:hover,
.nav-links a.active {
  opacity: 0.9;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ── HERO IMAGE ── */
.hero-img-wrap {
  width: 100%;
  max-height: 80vh;
  overflow: hidden;
}

.hero-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 30%;
  display: block;
}

/* ── MAIN / HOME SECTIONS ── */
main {
  padding: 2.5rem var(--pad) 4rem;
}

.home-section {
  margin-bottom: 2rem;
}

.home-section p {
  font-size: 1.1rem;
  font-weight: 300;
  line-height: 1.7;
  opacity: 0.85;
  color: var(--text);
}

.section-heading {
  font-size: 1.1rem;
  font-weight: 300;
  opacity: 0.85;
  margin-bottom: 0.1rem;
}

.inline-links {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.inline-links a {
  color: var(--text);
  font-size: 1.1rem;
  font-weight: 300;
  opacity: 0.85;
  text-decoration: underline;
  text-underline-offset: 4px;
  text-decoration-thickness: 1px;
  transition: opacity 0.3s ease;
}

.inline-links a:hover {
  opacity: 1;
}

.sep {
  opacity: 0.4;
  font-size: 1.1rem;
}

.home-section a {
  color: var(--text);
  font-size: 1.1rem;
  font-weight: 300;
  opacity: 0.85;
  text-decoration: none;
  transition: opacity 0.3s ease;
}

.home-section .inline-links a {
  text-decoration: underline;
  text-underline-offset: 4px;
  text-decoration-thickness: 1px;
}

.home-section a:hover {
  opacity: 1;
}

/* ── ARCHIVOS PAGE ── */
.archivos-page {
  padding: 8rem var(--pad) 5rem;
}

/* iOS fix: make the content area a fixed scroll container so it can't
   bleed above the nav into the Dynamic Island / status bar zone */
nav.nav-solid ~ .archivos-page {
  position: fixed;
  top: var(--nav-height, 80px);
  left: 0;
  right: 0;
  bottom: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-top: 2rem;
}

.page-title {
  font-size: clamp(1.8rem, 3vw, 2.8rem);
  font-weight: 300;
  letter-spacing: 0.02em;
  color: var(--text);
  opacity: 0.9;
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.intro-block {
  margin-bottom: 3rem;
}

.intro-block p {
  font-size: 1.1rem;
  font-weight: 300;
  line-height: 1.8;
  opacity: 0.85;
  color: var(--text);
  margin-bottom: 1rem;
}

.section-divider {
  font-size: 1.1rem;
  font-weight: 300;
  color: var(--text);
  opacity: 0.85;
  display: block;
  margin-bottom: 1.5rem;
}

.note {
  margin-bottom: 2.5rem;
}

.note p {
  font-size: 1.1rem;
  font-weight: 300;
  line-height: 1.8;
  opacity: 0.85;
  color: var(--text);
}

.note strong {
  font-weight: 500;
}

/* ── ACCORDION ── */
.accordion {
  border-top: 1px solid rgba(255,255,255,0.12);
}

details {
  border-bottom: 1px solid rgba(255,255,255,0.12);
}

summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem 0;
  font-size: 1.3rem;
  font-weight: 300;
  color: var(--text);
  opacity: 0.85;
  cursor: pointer;
  list-style: none;
  user-select: none;
}

summary::-webkit-details-marker {
  display: none;
}

summary::after {
  content: '+';
  font-size: 1.4rem;
  font-weight: 300;
  opacity: 0.6;
  transition: transform 0.25s ease;
  flex-shrink: 0;
}

details[open] summary::after {
  transform: rotate(45deg);
}

.accordion-body {
  padding: 0.5rem 0 2rem;
}

.accordion-body p {
  font-size: 1.1rem;
  font-weight: 300;
  line-height: 1.8;
  opacity: 0.85;
  color: var(--text);
  margin-bottom: 1rem;
}

.accordion-body ul {
  list-style: none;
  margin: 0.5rem 0 1rem 1rem;
}

.accordion-body ul li {
  font-size: 1.1rem;
  font-weight: 300;
  line-height: 1.8;
  opacity: 0.85;
  color: var(--text);
  padding-left: 1rem;
  position: relative;
}

.accordion-body ul li::before {
  content: '—';
  position: absolute;
  left: 0;
  opacity: 0.4;
}

.intro-block a {
  color: var(--text);
  opacity: 0.85;
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: opacity 0.3s;
}

.intro-block a:hover {
  opacity: 1;
}

.intro-block strong {
  font-weight: 500;
}

.samply-wrap {
  width: 100%;
}

/* ── MOBILE ── */
@media (max-width: 600px) {
  .nav-logo {
    font-size: 1.5rem;
  }

  .nav-links a {
    font-size: 0.9rem;
  }

  .lang-btn {
    font-size: 0.9rem;
  }

  .hero-credentials p {
    font-size: 0.44rem;
    letter-spacing: 0.18em;
  }

  footer {
    flex-direction: column;
    gap: 1.25rem;
  }

  .archivos-page {
    padding-top: 6rem;
  }
}
