/* =========================================================
   Gerardo Ureta — personal site
   Academic rigor. Executive relevance.
   ========================================================= */

.toggle-section {
  display: none;
}
.toggle-section.active {
  display: block;
}

/* ===== Skip link (keyboard accessibility) ===== */
.skip-link {
  position: absolute;
  top: -100px;
  left: 12px;
  z-index: 1000;
  background: var(--surface-dark);
  color: var(--on-dark) !important;
  padding: 10px 18px;
  border-radius: var(--radius-control);
  font-weight: 700;
  font-size: var(--fs-body-sm);
  transition: top 0.15s ease;
}
.skip-link:focus {
  top: 12px;
}

/* ===== Language switcher (in nav) ===== */
.nav-lang-switch {
  font: inherit;
  font-weight: 700;
  font-size: var(--fs-label);
  letter-spacing: 0.04em;
  color: var(--text-secondary);
  background: none;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px 12px;
  cursor: pointer;
}
.nav-lang-switch:hover { border-color: var(--blue-700); color: var(--blue-900); }

/* ===== Footer maintenance note ===== */
.footer-maintenance-note {
  max-width: 560px;
  margin: 10px auto 0;
  font-size: var(--fs-label);
  opacity: 0.75;
}

:root {
  --bg: #F7F8FA;
  --bg-alt: #FFFFFF;
  --text: #111827;
  --text-secondary: #4B5563;
  --blue-900: #173B67;
  --blue-700: #2F5F8F;
  --accent: #0E7490;
  --border: #D9DEE7;
  --shadow: 0 1px 2px rgba(17, 24, 39, 0.04), 0 4px 14px rgba(17, 24, 39, 0.04);
  --radius: 14px;
  --radius-control: 10px;
  --max-width: 1200px;
  --content-width: 860px;
  --fs-tag: 0.72rem;
  --fs-label: 0.8rem;
  --fs-body-sm: 0.9rem;
  /* Fixed navy surface that never inverts in dark mode — for elements carrying light text */
  --surface-dark: #173B67;
  --on-dark: #fff;
  --on-dark-secondary: #c7d5e6;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1115;
    --bg-alt: #15181d;
    --text: #e8eaee;
    --text-secondary: #a2a9b4;
    --blue-900: #cfe0f5;
    --blue-700: #9db9d9;
    --accent: #4fd1e0;
    --border: #2a2f38;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 4px 14px rgba(0, 0, 0, 0.35);
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text-secondary);
  background: var(--bg);
  line-height: 1.65;
  font-size: 17px;
  -webkit-font-smoothing: antialiased;
  overflow-wrap: break-word;
  word-break: break-word;
}

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

h1, h2, h3, h4 { color: var(--text); font-weight: 700; letter-spacing: -0.01em; }
h1 { font-size: clamp(2.4rem, 5vw, 4.2rem); line-height: 1.08; margin: 0; }
h2 { font-size: clamp(1.7rem, 3.2vw, 2.3rem); line-height: 1.2; margin: 0 0 14px; }
h3 { font-size: 1.3rem; line-height: 1.3; margin: 0 0 8px; }
h4 { font-size: 1rem; margin: 0 0 6px; }
p { margin: 0 0 14px; }
p:last-child { margin-bottom: 0; }

a { color: var(--blue-700); text-decoration: none; }
a:hover { color: var(--accent); }

.container { max-width: var(--max-width); margin: 0 auto; padding: 0 24px; }
.content { max-width: var(--content-width); }

section { padding: 88px 0; position: relative; }
section + section { border-top: none; }
section + section::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: min(100% - 48px, var(--max-width));
  border-top: 1px solid var(--border);
}
section.impact-band::before { content: none; }

@media (max-width: 700px) {
  section { padding: 56px 0; }
  .container { padding: 0 18px; }
}
@media (max-width: 400px) {
  section { padding: 44px 0; }
  body { font-size: 16px; }
}

.eyebrow {
  display: block;
  font-size: var(--fs-label);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  margin: 0 0 12px;
}

.lede {
  font-size: 1.1rem;
  color: var(--text-secondary);
  max-width: 62ch;
}

.bullets { padding-left: 18px; font-size: var(--fs-body-sm); }

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

/* ===== Header ===== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(247, 248, 250, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}
@media (prefers-color-scheme: dark) {
  .site-header { background: rgba(15, 17, 21, 0.92); }
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}
.logo {
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.02em;
  color: var(--text);
  text-transform: uppercase;
}
.logo:hover { color: var(--blue-700); }

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 36px;
  height: 36px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}
.nav-toggle span {
  display: block;
  height: 2px;
  width: 100%;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.2s ease, opacity 0.2s ease;
}
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.site-nav { display: flex; align-items: center; gap: 28px; font-size: 0.9rem; }
.site-nav a { color: var(--text-secondary); font-weight: 500; }
.site-nav a:hover { color: var(--blue-900); }
.nav-cv {
  padding: 8px 16px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text) !important;
  font-weight: 600;
}
.nav-cv:hover { border-color: var(--blue-700); }

.nav-whatsapp {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text-secondary) !important;
  font-weight: 600;
}
.nav-whatsapp:hover { border-color: var(--blue-700); color: var(--blue-700) !important; }
.nav-whatsapp svg { width: 15px; height: 15px; flex-shrink: 0; }

@media (max-width: 860px) {
  .nav-toggle { display: flex; }
  .site-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--bg-alt);
    border-bottom: 1px solid var(--border);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.25s ease;
  }
  .site-nav.open { max-height: 420px; }
  .site-nav a { padding: 14px 24px; border-top: 1px solid var(--border); }
  .nav-cv { border-radius: 0; text-align: center; }
  .nav-whatsapp { border-radius: 0; justify-content: center; }
  .nav-lang-switch { border-radius: 0; text-align: center; border-left: none; border-right: none; }
}

/* ===== Footer WhatsApp link ===== */
.footer-whatsapp {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  font-weight: 600;
  color: var(--text) !important;
}
.footer-whatsapp svg { width: 15px; height: 15px; flex-shrink: 0; }
.footer-whatsapp:hover { color: var(--blue-700) !important; }

/* ===== Hero ===== */
.hero { padding: 64px 0 48px; border-top: none; }
@media (max-width: 700px) {
  .hero { padding: 40px 0 32px; }
}
.hero-grid {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 44px;
  align-items: center;
}
.hero-photo {
  width: 156px;
  height: 156px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--border);
}
h1.hero-name {
  color: var(--blue-900);
  font-size: clamp(1.8rem, 3.4vw, 2.8rem);
}
.hero-descriptor {
  font-size: clamp(1.2rem, 2.4vw, 1.5rem);
  color: var(--text);
  font-weight: 600;
  line-height: 1.35;
  margin: 14px 0 10px;
}
.hero-descriptor span { display: block; }
.hero-summary {
  font-size: 1.08rem;
  color: var(--text-secondary);
  max-width: 60ch;
  margin: 0 0 10px;
}
.hero-domains {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: 0.01em;
  margin: 0 0 26px;
}
.hero-ctas { display: flex; flex-wrap: wrap; gap: 12px; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 12px 22px;
  border-radius: var(--radius-control);
  font-size: 0.92rem;
  font-weight: 600;
  border: 1px solid transparent;
  transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn-outline { border-color: var(--border); color: var(--text); }
.btn-outline:hover { border-color: var(--blue-700); color: var(--blue-700); }
.btn-text { color: var(--text-secondary); padding-left: 4px; padding-right: 4px; }
.btn-text:hover { color: var(--blue-700); }

@media (max-width: 700px) {
  .hero-grid { grid-template-columns: 1fr; text-align: left; }
  .hero-photo { width: 112px; height: 112px; }
}

/* ===== Two dimensions ===== */
.dimensions-header { max-width: 620px; margin: 0 auto 48px; text-align: center; }
.dimensions-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.dimension {
  background: var(--bg-alt);
  padding: 40px clamp(24px, 4vw, 44px);
}
.dimension h3 { font-size: 1.4rem; }
.dimension .dim-tag {
  display: block;
  font-size: var(--fs-tag);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--blue-700);
  margin-bottom: 10px;
}
.dimension ul {
  margin: 16px 0 20px;
  padding-left: 18px;
  font-size: var(--fs-body-sm);
}
.dimension li { margin-bottom: 6px; }
.dimension .btn-text { font-weight: 700; }

@media (max-width: 780px) {
  .dimensions-grid { grid-template-columns: 1fr; }
}

/* ===== Value proposition ===== */
.focus-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px 32px;
  margin-top: 40px;
}
.focus-item { border-top: 2px solid var(--blue-900); padding-top: 16px; }
.focus-item h3 { color: var(--blue-900); font-size: 1.02rem; margin: 0 0 6px; }
.focus-item p { font-size: var(--fs-body-sm); margin: 0; }

@media (max-width: 860px) {
  .focus-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
  .focus-grid { grid-template-columns: 1fr; }
}

/* ===== Impact numbers ===== */
.impact-band {
  background: var(--surface-dark);
  border-top: none;
  padding: 48px 0;
  max-width: var(--max-width);
  margin: 0 auto;
  border-radius: var(--radius);
}
.impact-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  text-align: center;
}
.impact-number { font-size: clamp(1.7rem, 3.4vw, 2.5rem); font-weight: 800; color: var(--on-dark); }
.impact-label { font-size: var(--fs-label); color: var(--on-dark-secondary); margin-top: 6px; }
@media (max-width: 700px) {
  .impact-grid { grid-template-columns: repeat(2, 1fr); gap: 32px 20px; }
}

/* ===== Cards (used sparingly) ===== */
.card {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px clamp(20px, 3vw, 32px);
  transition: border-color 0.2s ease, transform 0.2s ease;
}
.card:hover { border-color: var(--blue-700); transform: translateY(-2px); }
.card h3 { font-size: 1rem; margin: 0 0 6px; }

.cases-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
  margin-top: 40px;
}
.case-domain {
  display: inline-block;
  font-size: var(--fs-tag);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent);
  margin-bottom: 10px;
}
.case-field { font-size: var(--fs-tag); font-weight: 700; color: var(--text); margin-top: 14px; }
.case-value { font-size: var(--fs-body-sm); margin: 2px 0 0; }

/* ===== Section subgroups ===== */
.subsection { margin-top: 48px; }
.subsection:first-of-type { margin-top: 0; }
.subsection h3 { font-size: 1.1rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--blue-900); }

/* ===== Experience ===== */
.job {
  padding: 26px 0;
  border-top: 1px solid var(--border);
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 24px;
}
.job:first-child { border-top: none; padding-top: 0; }
.job-meta .role { font-weight: 700; color: var(--text); font-size: 1.02rem; margin-bottom: 2px; }
.job-meta .org { color: var(--blue-700); font-size: var(--fs-body-sm); margin-bottom: 4px; }
.job-meta .period { color: var(--text-secondary); font-size: var(--fs-label); }
.job-body h4 { font-size: var(--fs-tag); text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-secondary); margin: 14px 0 6px; }
.job-body h4:first-child { margin-top: 0; }
.job-body p { font-size: var(--fs-body-sm); margin: 0; }
.job-body ul { margin: 0; padding-left: 18px; font-size: var(--fs-body-sm); }
.job-body li { margin-bottom: 6px; }
.job-body li:last-child { margin-bottom: 0; }
.experience__note { font-size: var(--fs-body-sm); color: var(--text-secondary); margin-top: 24px; }
.experience__note a { font-weight: 600; }

@media (max-width: 700px) {
  .job { grid-template-columns: 1fr; gap: 8px; }
}

/* ===== Publications ===== */
.pub-group { margin-top: 32px; }
.pub-group:first-of-type { margin-top: 0; }
.pub-group-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: var(--fs-label);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-secondary);
  margin-bottom: 16px;
}
.pub {
  padding: 18px 0;
  border-top: 1px solid var(--border);
}
.pub:first-child { border-top: none; padding-top: 0; }
.pub-title { font-weight: 700; color: var(--text); font-size: 0.98rem; }
.pub-meta { font-size: var(--fs-body-sm); color: var(--text-secondary); margin-top: 4px; }
.pub-meta a { font-weight: 600; }
.pub-abstract { font-size: var(--fs-body-sm); color: var(--text-secondary); margin-top: 10px; max-width: 68ch; }

.status {
  display: inline-block;
  font-size: var(--fs-tag);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 3px 10px;
  border-radius: 999px;
}
.status-published { background: rgba(14, 116, 144, 0.1); color: var(--accent); }
.status-review { background: rgba(75, 85, 99, 0.1); color: var(--text-secondary); }

/* ===== Timeline (education) ===== */
.timeline { border-left: 2px solid var(--border); margin-top: 8px; }
.timeline-item { position: relative; padding: 0 0 26px 26px; }
.timeline-item:last-child { padding-bottom: 0; }
.timeline-item::before {
  content: "";
  position: absolute;
  left: -6px;
  top: 4px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--blue-900);
}
.timeline-item .degree { font-weight: 700; color: var(--text); font-size: 0.98rem; }
.timeline-item .school { color: var(--blue-700); font-size: var(--fs-body-sm); margin-top: 1px; }
.timeline-item .year { color: var(--text-secondary); font-size: var(--fs-label); margin-top: 2px; }
.timeline-item .note { font-size: var(--fs-body-sm); margin-top: 4px; }

/* ===== Simple grouped lists ===== */
.group-list { margin-top: 6px; }
.group-list + .group-list { margin-top: 24px; }
.group-list h4 { font-size: var(--fs-label); text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-secondary); }
.group-list p { font-size: var(--fs-body-sm); }

/* ===== Contact ===== */
.contact-section { text-align: center; }
.contact-details {
  display: flex;
  justify-content: center;
  gap: 28px;
  flex-wrap: wrap;
  margin-top: 24px;
  font-size: 0.95rem;
}
.contact-details a { color: var(--text); font-weight: 600; }
.contact-details a:hover { color: var(--blue-700); }

/* ===== Research & Academia — additions ===== */
.academia__subhead {
  font-size: var(--fs-label);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
  margin-top: 28px;
}
.academia__agenda-list { margin-top: 10px; }
.academia__contrib-group { margin-top: 20px; }
.academia__finding {
  margin-top: 20px;
  padding: 16px 18px;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: var(--fs-body-sm);
}
.academia__link { font-size: var(--fs-body-sm); color: var(--text-secondary); }

.academia__details {
  margin-top: 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 22px;
  background: var(--bg-alt);
}
.academia__details summary {
  cursor: pointer;
  font-weight: 700;
  color: var(--blue-900);
  list-style: none;
}
.academia__details summary::-webkit-details-marker { display: none; }
.academia__details summary::after { content: ""; }
.academia__details[open] summary { margin-bottom: 18px; }
.academia__details .academia__artifacts { margin-top: 32px; }

/* ===== Traza Urbana — media list ===== */
.media-list {
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: var(--fs-body-sm);
}
.media-list li {
  display: grid;
  grid-template-columns: 104px minmax(0, 1fr);
  gap: 16px;
  padding: 12px 0;
  border-top: 1px solid var(--border);
}
.media-list li:first-child { border-top: none; padding-top: 0; }
.media-list strong { color: var(--text); }
.media-list a { font-weight: 600; }
.media-date {
  font-size: var(--fs-label);
  color: var(--text-secondary);
  white-space: nowrap;
  padding-top: 2px;
}
@media (max-width: 560px) {
  .media-list li { grid-template-columns: minmax(0, 1fr); gap: 2px; }
}

/* ===== Advisory Strategy & Applied Intelligence ===== */
.advisory__subtitle, .academia__subtitle { color: var(--text-secondary); }
.advisory__hero { margin-top: 8px; }
.advisory__ctas {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 20px;
}
.advisory__service-list {
  list-style: none;
  margin: 20px 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}
@media (min-width: 640px) {
  .advisory__service-list { grid-template-columns: repeat(2, 1fr); }
}
.advisory__service-card {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
}
.advisory__service-card h4 { font-size: 0.95rem; margin-bottom: 6px; }
.advisory__service-card p { font-size: var(--fs-body-sm); color: var(--text-secondary); margin: 0; }
.advisory__final-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 44px;
  padding-top: 28px;
  border-top: 1px solid var(--border);
}

/* ===== Methodological toolkit ===== */
/* Two independent columns (flex, not grid) so each flows top-to-bottom on
   its own — a short group in one column isn't held back by a taller one
   next to it in the other column. */
.toolkit-groups {
  display: flex;
  gap: 40px;
  margin-top: 36px;
}
.toolkit-col {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 28px;
}
.toolkit-group h3 {
  font-size: var(--fs-label);
  margin: 0 0 6px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
}
.toolkit-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 10px;
}
@media (max-width: 700px) {
  .toolkit-groups { flex-direction: column; gap: 28px; }
}
.toolkit-chip {
  display: inline-block;
  padding: 8px 16px;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: var(--fs-body-sm);
  font-weight: 600;
  color: var(--blue-900);
  background: var(--bg-alt);
}

/* ===== Footer ===== */
footer {
  text-align: center;
  font-size: var(--fs-label);
  color: var(--text-secondary);
  padding: 32px 24px;
  border-top: 1px solid var(--border);
}

/* ===== Motion ===== */
@media (prefers-reduced-motion: no-preference) {
  .reveal {
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 0.4s ease, transform 0.4s ease;
  }
  .reveal.in-view { opacity: 1; transform: translateY(0); }
}

/* ===== Focus visibility ===== */
a:focus-visible, button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
