/* base lenis setup */
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-smooth [data-lenis-prevent] { overscroll-behavior: contain; }
.lenis.lenis-stopped { overflow: hidden; }
.lenis.lenis-smooth iframe { pointer-events: none; }

/* Design System Variables */
:root {
  --bg-color: #FFFFFF;
  --bg-alt: #FAFAFA;
  --text-main: #0A0A0A;
  --text-muted: #6B6B6B;
  --border-color: #E5E5E5;
  --accent-color: #4A4A4A;
  
  --font-main: 'Plus Jakarta Sans', sans-serif;
  
  /* Fluid Typography */
  --fs-hero: clamp(6rem, 8vw + 2rem, 10rem);
  --fs-h1: clamp(3.5rem, 5vw + 1rem, 5.5rem);
  --fs-number: clamp(7.5rem, 10vw + 2rem, 12.5rem);
  --fs-body: clamp(1.125rem, 1vw + 0.5rem, 1.25rem);
  --fs-meta: clamp(0.8125rem, 0.5vw + 0.5rem, 0.875rem);
}

/* Global Reset & Base */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  max-width: 100%;
  overflow-x: hidden;
}

body {
  font-family: var(--font-main);
  background-color: var(--bg-color);
  color: var(--text-main);
  line-height: 1.6;
  font-size: var(--fs-body);
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-wrap: break-word;
  word-wrap: break-word;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color 0.3s ease;
}

a:hover, .accent-hover:hover {
  color: var(--accent-color);
}

/* Layout Grid */
.container {
  width: 100%;
  max-width: 1600px;
  margin: 0 auto;
  padding: 0 5vw;
  padding-left: 5vw !important;
  padding-right: 5vw !important;
}

.grid-12 {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 2rem;
}

.section {
  padding: clamp(5rem, 10vw, 8rem) 0;
}

.section-alt {
  background-color: var(--bg-alt);
}

/* Typography Classes */
.t-hero {
  font-size: var(--fs-hero);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.t-h1 {
  font-size: var(--fs-h1);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin-bottom: 1.5rem;
}

.t-big-number {
  font-size: var(--fs-number);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  color: var(--accent-color);
  margin-bottom: 1rem;
}

.t-body {
  font-size: var(--fs-body);
  color: var(--text-muted);
}

.t-meta {
  font-size: var(--fs-meta);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

.badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border: 1px solid var(--border-color);
  border-radius: 999px;
}

/* Header */
.site-header {
  padding: 2rem 0;
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  background-color: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  z-index: 100;
}
.header-flex {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.logo {
  font-weight: 800;
  font-size: 1.5rem;
  letter-spacing: -0.02em;
}
@keyframes subtleBlink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.2; }
}
.blinking-dot {
  animation: subtleBlink 1.5s infinite ease-in-out;
}

/* Study Card */
.study-card {
  display: block;
  padding: 3rem;
  border: 1px solid var(--border-color);
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  background: var(--bg-color);
  grid-column: span 12;
}
@media(min-width: 768px) {
  .study-card { grid-column: span 6; }
}
@media(min-width: 1024px) {
  .study-card { grid-column: span 4; }
}

.study-card:hover {
  transform: translateY(-5px);
  border-color: var(--accent-color);
  box-shadow: 0 20px 40px rgba(0,0,0,0.05);
}

.study-card-meta {
  display: flex;
  gap: 1rem;
  margin-bottom: 2rem;
}

/* Article Styling */
.article-header {
  padding: 8rem 0 4rem;
  border-bottom: 1px solid var(--border-color);
}

.article-content {
  padding: 4rem 0;
}

.article-content h2, .article-content h3 {
  color: var(--text-main);
  margin: 3rem 0 1.5rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.article-content h2 { font-size: clamp(2rem, 3vw, 2.5rem); }
.article-content h3 { font-size: clamp(1.5rem, 2vw, 1.75rem); }

.article-content p {
  margin-bottom: 1.5rem;
  max-width: 800px;
}

.exec-summary {
  background-color: var(--bg-alt);
  border-left: 4px solid var(--accent-color);
  padding: 2rem 3rem;
  margin: 3rem 0;
  font-size: clamp(1.25rem, 2vw, 1.5rem);
  font-weight: 500;
  color: var(--text-main);
  max-width: 1000px;
}

.fuentes-section {
  margin-top: 5rem;
  padding-top: 3rem;
}
.fuentes-list {
  list-style: none;
}
.fuentes-list li {
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px dashed var(--border-color);
}

/* Animations */
.reveal-text {
  clip-path: polygon(0 0, 100% 0, 100% 100%, 0% 100%);
}

/* Scroll to Top Button */
.scroll-to-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 50px;
  height: 50px;
  background-color: var(--bg-color);
  color: var(--text-main);
  border: 1px solid var(--border-color);
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 99;
  box-shadow: 0 10px 20px rgba(0,0,0,0.1);
}

.scroll-to-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.scroll-to-top:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 30px rgba(0,0,0,0.15);
}

/* FAQ Accordion */
.faq-container {
  max-width: 800px;
  margin: 0 auto;
}

.faq-item {
  border-bottom: 1px solid var(--border-color);
}

.faq-item:last-child {
  border-bottom: none;
}

.faq-question {
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  padding: 1.5rem 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  color: var(--text-main);
  font-family: inherit;
  font-size: 1.125rem;
  font-weight: 500;
  transition: color 0.2s;
}

.faq-question:hover {
  color: var(--accent-color);
}

.faq-icon {
  width: 24px;
  height: 24px;
  position: relative;
  flex-shrink: 0;
  margin-left: 1rem;
}

.faq-icon::before, .faq-icon::after {
  content: '';
  position: absolute;
  background-color: currentColor;
  transition: transform 0.3s ease;
}

.faq-icon::before {
  top: 11px;
  left: 4px;
  right: 4px;
  height: 2px;
}

.faq-icon::after {
  top: 4px;
  bottom: 4px;
  left: 11px;
  width: 2px;
}

.faq-item.active .faq-icon::after {
  transform: rotate(90deg);
}

.faq-item.active .faq-icon::before {
  transform: rotate(180deg);
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.faq-answer-inner {
  padding-bottom: 1.5rem;
  color: var(--text-muted);
  line-height: 1.6;
}

/* Responsive Utilities */
.header-nav-container {
  display: flex;
  align-items: center;
  gap: 2rem;
  flex: 1;
  justify-content: flex-end;
}
.search-input {
  padding: 0.5rem 1rem;
  border: 1px solid var(--border-color);
  border-radius: 999px;
  outline: none;
  font-family: inherit;
  font-size: 0.875rem;
  width: 250px;
}
.nav-links {
  display: flex;
  gap: 2rem;
}
.slider-controls-container {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 3rem;
}

.hamburger-menu {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-main);
  padding: 0.5rem;
  margin-right: -0.5rem;
}

@media (max-width: 768px) {
  .hamburger-menu {
    display: block;
  }
  .header-flex {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem 0;
  }
  .header-nav-container {
    display: none;
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    flex: none;
    gap: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
  }
  .header-nav-container.active {
    display: flex;
  }
  .search-container, .search-input {
    width: 100% !important;
  }
  .nav-links {
    width: 100%;
    flex-direction: column;
    gap: 0;
  }
  .nav-links a {
    display: block;
    padding: 1rem 0;
    border-bottom: 1px solid var(--border-color);
  }
  .nav-links a:last-child {
    border-bottom: none;
  }
  .slider-controls-container {
    flex-direction: column;
    align-items: flex-start;
    gap: 1.5rem;
  }
  .section {
    padding: clamp(3rem, 8vw, 5rem) 0;
  }
  .t-hero {
    font-size: clamp(3rem, 12vw, 4rem);
  }
  .t-big-number {
    font-size: clamp(4rem, 15vw, 6rem);
  }
  .study-card {
    padding: 1.5rem;
  }
  .slide-item {
    flex: 0 0 100% !important;
  }
  
  /* Article specific mobile adjustments */
  .container {
    padding: 0 1.5rem;
    padding-left: 1.5rem !important;
    padding-right: 1.5rem !important;
  }
  .article-header {
    padding: 4rem 0 2rem;
  }
  .article-content {
    padding: 2rem 0;
  }
  .exec-summary {
    padding: 1.5rem;
    margin: 2rem 0;
  }
  .dato-destacado-box {
    margin: 2rem 0;
    padding: 2rem 1rem;
  }
}

.dato-destacado-box {
  margin: 4rem 0;
  padding: 4rem;
  background-color: var(--bg-alt);
  border-radius: 24px;
  text-align: center;
}

/* Article Lists */
.article-content ul, .article-content ol {
  margin-left: 1.5rem;
  margin-bottom: 1.5rem;
}
.article-content li {
  margin-bottom: 0.5rem;
}

.slide-item {
  transition: opacity 0.5s ease;
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* Custom Markdown Charts */
.custom-chart-container {
  background-color: var(--bg-alt);
  padding: 2.5rem;
  border-radius: 16px;
  margin: 4rem 0;
  border: 1px solid var(--border-color);
}

.chart-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 2rem;
  color: var(--text-main);
  letter-spacing: -0.01em;
}

.chart-bars-wrapper {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.chart-row {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.chart-label {
  width: 30%;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-muted);
  line-height: 1.2;
}

.chart-bar-track {
  flex: 1;
  height: 24px;
  background-color: var(--border-color);
  border-radius: 12px;
  overflow: hidden;
}

.chart-bar-fill {
  height: 100%;
  background-color: var(--accent-color);
  border-radius: 12px;
  width: 0; /* Will be animated */
}

.chart-value {
  width: 80px;
  text-align: right;
}

@media (max-width: 768px) {
  .chart-row {
    flex-wrap: wrap;
    gap: 0.5rem;
  }
  .chart-label {
    width: 100%;
  }
  .chart-bar-track {
    width: calc(100% - 90px);
    flex: none;
  }
  .custom-chart-container {
    padding: 1.5rem;
  }
}

/* Search Component */
.search-container {
  position: relative;
  flex: 1;
  max-width: 420px;
  margin: 0 2rem 0 5rem;
}

.search-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  min-width: 280px;
}

.search-icon {
  position: absolute;
  left: 1rem;
  color: var(--text-muted);
  pointer-events: none;
  transition: color 0.3s ease;
}

.search-input {
  width: 100%;
  padding: 0.75rem 1rem 0.75rem 2.5rem;
  border-radius: 999px;
  border: 1px solid var(--border-color);
  background: var(--bg-color);
  color: var(--text-main);
  outline: none;
  font-size: 0.75rem;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 2px 5px rgba(0,0,0,0.02);
}

.search-input:focus {
  border-color: var(--accent-color);
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.search-input:focus + .search-icon,
.search-input-wrapper:focus-within .search-icon {
  color: var(--accent-color);
}

.search-results-dropdown {
  position: absolute;
  top: calc(100% + 0.5rem);
  left: 0;
  right: 0;
  background: var(--bg-color);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  display: none;
  flex-direction: column;
  box-shadow: 0 10px 25px rgba(0,0,0,0.1);
  overflow: hidden;
  z-index: 10;
  max-height: 400px;
  overflow-y: auto;
}

.search-result-item {
  padding: 1rem;
  border-bottom: 1px solid var(--border-color);
  text-decoration: none;
  transition: background-color 0.2s ease;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.search-result-item:last-child {
  border-bottom: none;
}

.search-result-item:hover {
  background-color: rgba(0,0,0,0.02);
}

.search-result-title {
  color: var(--text-main);
  font-weight: 500;
  font-size: 0.875rem;
  line-height: 1.3;
}

.search-result-meta {
  color: var(--text-muted);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

@media (max-width: 768px) {
  .search-container {
    margin: 1.5rem 0 0 0;
    max-width: 100%;
    width: 100%;
  }
  .search-input-wrapper {
    min-width: 0;
  }
}

/* Premium Vertical Timeline */
.tl-section {
  background-color: var(--bg-alt);
  overflow-x: hidden;
}

.tl-hero {
  padding: 8rem 0 5rem;
  text-align: center;
}

.tl-wrapper {
  position: relative;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 2rem 8rem;
}

/* Central vertical rail */
.tl-rail {
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--border-color);
  transform: translateX(-50%);
  transform-origin: top;
  z-index: 0;
}

/* Year node */
.tl-year-node {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 3rem 0 1.5rem;
  z-index: 10;
}

.tl-year-dot {
  width: 48px;
  height: 48px;
  background: var(--text-main);
  border-radius: 50%;
  z-index: 2;
  flex-shrink: 0;
}

.tl-year-label {
  position: absolute;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--bg-color);
  z-index: 3;
  user-select: none;
}

/* Card row: alternating left/right */
.tl-card-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  position: relative;
  margin: 1rem 0;
  z-index: 5;
}

.tl-card-row.left  { direction: rtl; }
.tl-card-row.right { direction: ltr; }

.tl-card {
  direction: ltr;
  padding: 0 2.5rem;
  position: relative;
}

/* Horizontal connector from card to rail */
.tl-card-connector {
  position: absolute;
  top: 50%;
  height: 2px;
  background: var(--border-color);
  width: 2.5rem;
  z-index: 1;
}

.tl-card-row.left  .tl-card-connector { right: 0; }
.tl-card-row.right .tl-card-connector { left: 0; }

/* Small dot on the rail where connector meets */
.tl-card-dot {
  position: absolute;
  top: 50%;
  width: 14px;
  height: 14px;
  background: var(--bg-color);
  border: 3px solid var(--text-main);
  border-radius: 50%;
  transform: translateY(-50%);
  z-index: 4;
}

.tl-card-row.left  .tl-card-dot { right: -7px; }
.tl-card-row.right .tl-card-dot { left: -7px; }

/* Card inner */
.tl-card-inner {
  background: var(--bg-color);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.tl-card-inner:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.06);
}

.tl-card-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.tl-card-date {
  font-weight: 700;
  color: var(--text-muted);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.tl-card-title {
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.4;
  color: var(--text-main);
  margin: 0;
}

.tl-card-title a {
  color: inherit;
  text-decoration: none;
}

.tl-card-title a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.tl-card-cta {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.2s ease;
  align-self: flex-start;
}

.tl-card-inner:hover .tl-card-cta {
  color: var(--text-main);
}

/* End cap */
.tl-end-cap {
  position: relative;
  display: flex;
  justify-content: center;
  padding-top: 3rem;
  z-index: 5;
}

.tl-end-dot {
  width: 20px;
  height: 20px;
  background: var(--border-color);
  border-radius: 50%;
}

@media (max-width: 768px) {
  .tl-rail { left: 24px; }
  .tl-year-node { justify-content: flex-start; padding-left: 0; }
  .tl-year-dot { width: 36px; height: 36px; }

  .tl-card-row {
    grid-template-columns: 1fr;
    padding-left: 52px;
    direction: ltr;
  }

  .tl-card-row.left { direction: ltr; }

  .tl-card { padding: 0; }

  .tl-card-connector {
    width: 28px;
    left: -28px !important;
    right: auto !important;
  }
  .tl-card-dot {
    left: -35px !important;
    right: auto !important;
  }
  .tl-end-cap { justify-content: flex-start; padding-left: 16px; }
}



.parallax-orb {
  position: absolute;
  border-radius: 50%;
  background: radial-gradient(circle at center, rgba(100, 200, 255, 0.1) 0%, rgba(100, 200, 255, 0) 70%);
  z-index: 0;
  pointer-events: none;
}

.orb-1 {
  width: 40vw;
  height: 40vw;
  top: 10%;
  left: 10%;
  background: radial-gradient(circle at center, rgba(160, 100, 255, 0.08) 0%, rgba(160, 100, 255, 0) 70%);
}

.orb-2 {
  width: 60vw;
  height: 60vw;
  bottom: -10%;
  right: 20%;
  background: radial-gradient(circle at center, rgba(100, 255, 200, 0.06) 0%, rgba(100, 255, 200, 0) 70%);
}

.orb-3 {
  width: 30vw;
  height: 30vw;
  top: 40%;
  right: -5%;
}




