:root {
  --bg: #ebe4d8;
  --surface: #f5efe4;
  --surface-2: #f9f5ec;
  --text: #244b46;
  --text-soft: #516660;
  --accent: #0d6b5b;
  --accent-2: #0f7a67;
  --line: rgba(36, 75, 70, 0.12);
  --white: #ffffff;
  --shadow: 0 16px 40px rgba(16, 44, 41, 0.08);
  --radius-xl: 36px;
  --radius-lg: 24px;
  --radius-md: 18px;
  --maxw: 1180px;
  --sidebar-w: 64px;
  --sidebar-gap: 24px;
  --sidebar-offset: calc(var(--sidebar-w) + var(--sidebar-gap) + 22px);
}

/* Dark mode */

[data-theme="dark"] {
  --bg: #0f1720;
  --surface: #111827;
  --surface-2: #1f2937;
  --text: #f3f4f6;
  --text-soft: #9ca3af;
  --accent: #10b981;
  --accent-2: #34d399;
  --line: rgba(148, 163, 184, 0.4);
  --white: #ffffff;
  --shadow: 0 18px 40px rgba(0, 0, 0, 0.6);
}

/* Reset */

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
}

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

a {
  color: inherit;
  text-decoration: none;
}

.page-shell {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 20px 20px 40px;
  transition: padding-left 0.2s ease;
}

/* Cuando el header ya está lateral, reservamos espacio en toda la página */
@media (min-width: 981px) {
  body.has-side-header .page-shell {
    padding-left: var(--sidebar-offset);
  }
}

/* Header */

.topbar {
  position: sticky;
  top: 16px;
  z-index: 30;
  margin: 0 auto 32px;
  padding: 10px 14px;
  border: 1px solid rgba(255, 255, 255, 0.45);
  background: rgba(248, 243, 233, 0.78);
  backdrop-filter: blur(16px);
  border-radius: 999px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  box-shadow: var(--shadow);
}

[data-theme="dark"] .topbar {
  border-color: rgba(15, 23, 42, 0.9);
  background: rgba(17, 24, 39, 0.9);
}

/* Estado lateral persistente */
.topbar-side {
  position: fixed;
  top: 24px;
  left: 24px;
  right: auto;
  bottom: auto;
  width: var(--sidebar-w);
  height: auto;
  margin: 0;
  padding: 12px 10px;
  border-radius: 32px;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  z-index: 100;
}

/* Marca reducida en lateral */
.topbar-side .brand {
  display: none;
}

/* Navegación normal horizontal */
.main-nav {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.main-nav a {
  padding: 10px 16px;
  border-radius: 999px;
  color: var(--text-soft);
  transition: 0.25s ease;
  font-size: 0.95rem;
}

.main-nav a:hover {
  background: rgba(13, 107, 91, 0.08);
  color: var(--text);
}

/* Ocultar nav de texto al pasar a lateral */
.topbar-side .main-nav {
  display: none;
}

/* Navegación por iconos */
.nav-icons {
  display: none;
  flex-direction: column;
  gap: 10px;
  align-items: center;
  width: 100%;
}

.topbar-side .nav-icons {
  display: flex;
}

.nav-icon-btn {
  position: relative;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text-soft);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: 0.2s ease;
  font-size: 18px;
  box-shadow: none;
}

.nav-icon-btn:hover {
  background: var(--surface-2);
  color: var(--text);
}

.nav-icon-btn span.nav-tooltip {
  position: absolute;
  left: 48px;
  top: 50%;
  transform: translateY(-50%);
  background: var(--surface-2);
  color: var(--text);
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 0.8rem;
  white-space: nowrap;
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transition: 0.15s ease;
}

.nav-icon-btn:hover span.nav-tooltip,
.nav-icon-btn:focus-visible span.nav-tooltip {
  opacity: 1;
}

.brand {
  font-weight: 700;
  letter-spacing: -0.02em;
  font-size: 1rem;
}

/* Botón theme */
.theme-toggle {
  min-width: 46px;
  height: 46px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  cursor: pointer;
  transition: 0.25s ease;
  box-shadow: var(--shadow);
  font-size: 0.9rem;
}

.theme-toggle:hover {
  transform: translateY(-1px);
  background: var(--surface-2);
}

.topbar-side .theme-toggle {
  min-width: 40px;
  width: 40px;
  height: 40px;
  padding: 0;
}

.theme-toggle-light,
.theme-toggle-dark {
  display: inline-block;
}

[data-theme="light"] .theme-toggle-light {
  display: none;
}

[data-theme="light"] .theme-toggle-dark {
  display: inline-block;
}

[data-theme="dark"] .theme-toggle-dark {
  display: none;
}

[data-theme="dark"] .theme-toggle-light {
  display: inline-block;
}

/* Layout */

.section {
  padding: 30px 0 42px;
}

.eyebrow,
.section-kicker {
  display: inline-block;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-soft);
  margin-bottom: 12px;
}

.section-head {
  max-width: 760px;
  margin-bottom: 22px;
}

.section-head h2 {
  font-size: clamp(1.9rem, 2vw, 2.7rem);
  line-height: 1.08;
  letter-spacing: -0.04em;
  margin: 0 0 10px;
}

.section-head p {
  margin: 0;
  color: var(--text-soft);
  font-size: 1.02rem;
}

/* Hero */

.hero {
  padding-top: 18px;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.4fr 0.8fr;
  gap: 28px;
  align-items: start;
}

.hero-copy h1 {
  font-size: clamp(2.8rem, 6vw, 5.3rem);
  line-height: 0.95;
  letter-spacing: -0.06em;
  margin: 0 0 18px;
  max-width: 10ch;
}

.lead {
  font-size: 1.14rem;
  color: var(--text-soft);
  max-width: 64ch;
  margin: 0 0 24px;
}

.hero-side p {
  margin-top: 0;
  color: var(--text-soft);
}

.mini-stats {
  list-style: none;
  padding: 0;
  margin: 18px 0 0;
  display: grid;
  gap: 14px;
}

.mini-stats li {
  display: grid;
  gap: 3px;
}

.mini-stats strong {
  font-size: 1.1rem;
  color: var(--text);
}

.mini-stats span {
  color: var(--text-soft);
  font-size: 0.95rem;
}

/* Botones */

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 18px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 50px;
  padding: 0 18px;
  border-radius: 999px;
  font-weight: 600;
  transition: 0.25s ease;
  border: 1px solid transparent;
  cursor: pointer;
}

.btn-primary {
  background: var(--accent);
  color: var(--white);
}

.btn-primary:hover {
  background: var(--accent-2);
  transform: translateY(-1px);
}

.btn-secondary {
  background: transparent;
  border-color: var(--line);
  color: var(--text);
}

.btn-secondary:hover {
  background: rgba(13, 107, 91, 0.06);
  transform: translateY(-1px);
}

/* Grids */

.content-grid {
  display: grid;
  grid-template-columns: 1.3fr 0.8fr;
  gap: 24px;
}

.three-col {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

/* Cards */

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow);
}

.card.soft {
  background: var(--surface-2);
}

.card h3 {
  margin-top: 0;
  margin-bottom: 10px;
  font-size: 1.15rem;
  letter-spacing: -0.03em;
}

.card p:last-child {
  margin-bottom: 0;
}

.check-list {
  margin: 0;
  padding-left: 18px;
}

.check-list li + li {
  margin-top: 10px;
}

.tag {
  display: inline-flex;
  margin-top: 12px;
  background: rgba(13, 107, 91, 0.1);
  color: var(--accent);
  border: 1px solid rgba(13, 107, 91, 0.12);
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 0.92rem;
  font-weight: 600;
}

/* Experiencia */

.section-experiencia {
  position: relative;
  padding-top: 40px;
}

.section-experiencia-inner {
  display: block;
}

.experiencia-main {
  width: 100%;
}

/* Timeline */

.timeline-wrap {
  position: relative;
  margin-top: 28px;
  padding: 18px 0 10px;
}

.timeline-scale {
  display: flex;
  justify-content: space-between;
  font-size: 0.9rem;
  color: var(--text-soft);
  margin: 0 0 14px 0;
  position: relative;
}

.timeline-scale::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 1px;
  background: rgba(36, 75, 70, 0.18);
  z-index: -1;
}

.timeline-scale span {
  background: transparent;
  padding: 0 4px;
}

.timeline-item {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  min-height: 64px;
  background: var(--accent);
  color: var(--white);
  border-radius: 999px;
  padding: 10px 18px;
  margin-bottom: 10px;
  box-shadow: 0 10px 20px rgba(13, 107, 91, 0.18);
  overflow: hidden;
}

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

.timeline-text h3 {
  margin: 0 0 3px;
  font-size: clamp(0.9rem, 1.15vw, 1rem);
  line-height: 1.1;
  letter-spacing: -0.03em;
  overflow-wrap: break-word;
}

.timeline-text p {
  margin: 0;
  opacity: 0.96;
  font-size: clamp(0.7rem, 0.95vw, 0.8rem);
  overflow-wrap: break-word;
}

.timeline-date.inline {
  display: block;
  font-size: clamp(0.7rem, 1vw, 0.8rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: 2px;
  opacity: 0.98;
}

/* Proporciones 2014–2026 */

.item-1 {
  margin-left: 83.33%;
  width: 13.33%;
}

.item-2 {
  margin-left: 58.33%;
  width: 25%;
}

.item-3 {
  margin-left: 35.33%;
  width: 27.5%;
}

.item-4 {
  margin-left: 23%;
  width: 15.66%;
}

.item-5 {
  margin-left: 7.5%;
  width: 17%;
}

.item-6 {
  margin-left: 0%;
  width: 11.33%;
}

.experiencia-cta {
  margin-top: 18px;
}

/* Recursos */

#recursos .card .btn {
  margin-top: 10px;
}

/* Contacto */

.contact-section {
  padding-bottom: 20px;
}

.contact-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 32px;
  padding: 28px;
  box-shadow: var(--shadow);
}

.contact-panel-header {
  max-width: 760px;
  margin-bottom: 18px;
}

.contact-panel-header h3 {
  margin: 6px 0 0;
  font-size: clamp(1.35rem, 2vw, 2rem);
  line-height: 1.12;
  letter-spacing: -0.04em;
}

.contact-actions-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.contact-box {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 50px;
  padding: 0 18px;
  border-radius: 999px;
  border: 1px solid var(--line);
  transition: 0.25s ease;
  width: auto;
  box-shadow: none;
  flex: 0 0 auto;
}

.contact-box:hover {
  transform: translateY(-1px);
}

.contact-box-label,
.contact-box small {
  display: none;
}

.contact-box strong {
  font-size: 1rem;
  line-height: 1;
  letter-spacing: -0.02em;
  margin: 0;
  white-space: nowrap;
}

.contact-box-solid {
  background: var(--accent);
  color: var(--white);
  border-color: transparent;
}

.contact-box-solid:hover {
  background: var(--accent-2);
}

.contact-box-outline {
  background: transparent;
  color: var(--text);
}

.contact-box-outline:hover {
  background: rgba(13, 107, 91, 0.06);
}

/* Footer */

.footer {
  padding: 22px 0 8px;
  color: var(--text-soft);
  font-size: 0.94rem;
}

.footer p {
  margin: 0;
}

/* Responsive */

@media (max-width: 1180px) {
  .topbar-side {
    left: 16px;
  }

  body.has-side-header .page-shell {
    padding-left: calc(var(--sidebar-w) + 28px);
  }
}

@media (max-width: 980px) {
  .hero-grid,
  .content-grid,
  .three-col {
    grid-template-columns: 1fr;
  }

  .hero-copy h1 {
    max-width: 100%;
  }

  .topbar,
  .topbar-side {
    position: sticky;
    top: 16px;
    left: auto;
    width: auto;
    height: auto;
    margin: 0 auto 32px;
    padding: 10px 14px;
    border-radius: 999px;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
  }

  .topbar-side .brand {
    display: inline-block;
  }

  .nav-icons,
  .topbar-side .nav-icons {
    display: none !important;
  }

  .main-nav,
  .topbar-side .main-nav {
    display: flex;
  }

  body.has-side-header .page-shell {
    padding-left: 20px;
  }

  .section-experiencia {
    padding-top: 30px;
  }

  .timeline-item {
    padding: 10px 16px;
    min-height: 64px;
  }

  .timeline-scale {
    margin: 0 0 12px 0;
    font-size: 0.82rem;
  }

  .contact-panel {
    padding: 24px;
  }
}

@media (max-width: 760px) {
  .page-shell,
  body.has-side-header .page-shell {
    padding: 14px 14px 32px;
  }

  .topbar,
  .topbar-side {
    position: static;
    border-radius: 24px;
    padding: 14px;
    flex-direction: column;
    gap: 12px;
    align-items: flex-start;
  }

  .nav-icons,
  .topbar-side .nav-icons {
    display: none !important;
  }

  .main-nav,
  .topbar-side .main-nav {
    width: 100%;
    gap: 6px;
    flex-wrap: wrap;
  }

  .main-nav a,
  .topbar-side .main-nav a {
    padding: 8px 12px;
    font-size: 0.92rem;
  }

  .hero-copy h1 {
    font-size: clamp(2.4rem, 12vw, 4rem);
  }

  .lead {
    font-size: 1rem;
  }

  .timeline-item {
    padding: 9px 14px;
  }

  .timeline-text h3 {
    font-size: 0.92rem;
  }

  .timeline-text p {
    font-size: 0.78rem;
  }

  .timeline-date.inline {
    font-size: 0.82rem;
  }

  .contact-panel {
    padding: 22px;
    border-radius: 24px;
  }

  .contact-actions-grid {
    gap: 10px;
  }

  .contact-box {
    min-height: 46px;
    padding: 0 16px;
  }

  .contact-box strong {
    font-size: 0.95rem;
  }
}
