/* ─── DESIGN SYSTEM & TOKENS ─────────────────────────────────────── */
:root {
  /* Color palette - Light Mode */
  --white:       #ffffff;
  --bg:          #f9f7f4;
  --bg-alt:      #f0ede8;
  --border:      #e0dbd3;
  --text:        #1a1a1a;
  --text-muted:  #6b6560;
  --accent:      #80141a;
  --accent-hover:#5c0d12;
  --accent-light:rgba(128, 20, 26, 0.06);
  --link:        #80141a;
  --color-ring:  rgba(128, 20, 26, 0.35);
  --glass-bg:    rgba(255, 255, 255, 0.85);
  --glass-border:rgba(224, 219, 211, 0.6);

  /* Discipline colors (Tabla Periódica de las Escuelas) */
  --color-physics:      #80141a;
  --color-math:         #1e5631;
  --color-chem:         #8b2d1a;
  --color-comp:         #3d1a5c;
  --color-engphys:      #155263;

  /* Typography */
  --font-serif: 'Cormorant Garamond', Georgia, serif;
  --font-sans:  'Inter', system-ui, -apple-system, sans-serif;

  /* Type scale */
  --step--2: clamp(2.25rem, 5vw, 3.75rem); /* Hero h1 */
  --step--1: clamp(1.75rem, 4vw, 2.5rem);  /* Section title primary */
  --step-0:  1.35rem;                      /* Section title secondary */
  --step-1:  1.125rem;                     /* Lead paragraph */
  --step-2:  1.0625rem;                    /* Body base (17px) */
  --step-3:  0.875rem;                     /* Prose, cards */
  --step-4:  0.75rem;                      /* Labels, meta */

  /* Line heights */
  --lh-tight:  1.15;
  --lh-normal: 1.65;
  --lh-relaxed: 1.75;

  /* Spacing scale */
  --space-xs:  0.5rem;   /* 8px  */
  --space-sm:  1rem;     /* 16px */
  --space-md:  2rem;     /* 32px */
  --space-lg:  3rem;     /* 48px */
  --space-xl:  5rem;     /* 80px */
  --space-2xl: 8rem;     /* 128px */

  /* Layout */
  --max-width: 1240px;
  --radius:    8px;
  --radius-lg: 14px;
  --gap:       var(--space-lg);

  /* Transitions */
  --ease-out:  cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --dur-fast:  150ms;
  --dur-normal: 250ms;
  --dur-slow:  400ms;
  --dur-reveal: 500ms;

  /* Shadows & Glassmorphism */
  --shadow-sm:  0 1px 3px rgba(0,0,0,0.05);
  --shadow-md:  0 4px 14px rgba(0,0,0,0.08);
  --shadow-lg:  0 12px 32px rgba(0,0,0,0.12);
  --shadow-card-hover: 0 16px 36px rgba(0,0,0,0.12);
}

/* Light Mode Override */
[data-theme="light"] {
  --white:       #ffffff;
  --bg:          #f9f7f4;
  --bg-alt:      #f0ede8;
  --border:      #e0dbd3;
  --text:        #1a1a1a;
  --text-muted:  #6b6560;
  --accent:      #80141a;
  --accent-hover:#5c0d12;
  --accent-light:rgba(128, 20, 26, 0.06);
  --link:        #80141a;
  --color-ring:  rgba(128, 20, 26, 0.35);
  --glass-bg:    rgba(255, 255, 255, 0.85);
  --glass-border:rgba(224, 219, 211, 0.6);

  --color-physics:      #80141a;
  --color-math:         #1e5631;
  --color-chem:         #8b2d1a;
  --color-comp:         #3d1a5c;
  --color-engphys:      #155263;

  --shadow-sm:  0 1px 3px rgba(0,0,0,0.05);
  --shadow-md:  0 4px 14px rgba(0,0,0,0.08);
  --shadow-lg:  0 12px 32px rgba(0,0,0,0.12);
  --shadow-card-hover: 0 16px 36px rgba(0,0,0,0.12);
}

/* Dark Mode Tokens (managed via [data-theme="dark"] attribute) */
[data-theme="dark"] {
  --white:       #1e2022;
  --bg:          #121315;
  --bg-alt:      #1a1c1e;
  --border:      #2d3034;
  --text:        #f0f2f5;
  --text-muted:  #a0a5ad;
  --accent:      #e64d56;
  --accent-hover:#ff6b73;
  --accent-light:rgba(230, 77, 86, 0.12);
  --link:        #ff6b73;
  --color-ring:  rgba(230, 77, 86, 0.4);
  --glass-bg:    rgba(30, 32, 34, 0.85);
  --glass-border:rgba(45, 48, 52, 0.6);

  --color-physics:      #ff6b73;
  --color-math:         #4ade80;
  --color-chem:         #f97316;
  --color-comp:         #c084fc;
  --color-engphys:      #38bdf8;

  --shadow-sm:  0 1px 3px rgba(0,0,0,0.3);
  --shadow-md:  0 4px 14px rgba(0,0,0,0.4);
  --shadow-lg:  0 12px 32px rgba(0,0,0,0.5);
  --shadow-card-hover: 0 16px 36px rgba(0,0,0,0.5);
}

fc-header, fc-footer {
  display: block;
  width: 100%;
}

/* ─── MALLA CURRICULAR COMPONENT (MODERN & SVG INTEGRATED) ──────── */
.malla-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-xs);
  margin-bottom: var(--space-md);
  padding-bottom: var(--space-xs);
  border-bottom: 1px solid var(--border);
}

.malla-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  font-family: var(--font-sans);
  font-size: 0.78rem;
  font-weight: 600;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-alt);
  color: var(--text);
  cursor: pointer;
  transition: all var(--dur-fast) var(--ease-out);
}

.malla-action-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--white);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.malla-action-btn.btn--pdf {
  text-decoration: none;
  background: var(--accent);
  color: var(--white);
  border-color: var(--accent);
}

.malla-action-btn.btn--pdf:hover {
  background: var(--accent-hover);
  color: var(--white);
  border-color: var(--accent-hover);
}

.malla-search-box {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.malla-search-icon {
  position: absolute;
  left: 10px;
  color: var(--text-muted);
  pointer-events: none;
}

.malla-search-box input {
  padding: 6px 12px 6px 32px;
  font-family: var(--font-sans);
  font-size: 0.82rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--white);
  color: var(--text);
  width: 220px;
  transition: border-color var(--dur-fast), box-shadow var(--dur-fast);
}

.malla-search-box input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-light);
  outline: none;
}

.malla-accordions-wrap {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.malla-accordion {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: border-color var(--dur-fast), box-shadow var(--dur-fast);
}

.malla-accordion:hover {
  border-color: var(--accent);
}

.malla-accordion summary::-webkit-details-marker {
  display: none;
}

.malla-accordion-header {
  padding: 12px var(--space-md);
  cursor: pointer;
  background: var(--bg-alt);
  display: flex;
  align-items: center;
  justify-content: space-between;
  user-select: none;
  transition: background var(--dur-fast);
}

.malla-accordion-header:hover {
  background: var(--white);
}

.malla-ciclo-title {
  font-family: var(--font-sans);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--accent);
}

.malla-ciclo-badge {
  font-family: var(--font-sans);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--white);
  border: 1px solid var(--border);
  padding: 2px 10px;
  border-radius: 12px;
}

.curso-nombre {
  font-family: var(--font-sans);
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text);
}

.malla-chevron {
  color: var(--text-muted);
  transition: transform var(--dur-fast) var(--ease-out), color var(--dur-fast);
  flex-shrink: 0;
}

.malla-accordion[open] .malla-chevron {
  transform: rotate(180deg);
  color: var(--accent);
}

.malla-accordion-body {
  padding: 12px var(--space-md);
  border-top: 1px solid var(--border);
}

/* ─── FAQ ACCORDION COMPONENT ────────────────────────────────────── */
.faq-accordion-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: var(--space-md);
}

.faq-accordion {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: border-color var(--dur-fast), box-shadow var(--dur-fast);
}

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

.faq-accordion summary::-webkit-details-marker {
  display: none;
}

.faq-summary {
  padding: 14px var(--space-md);
  cursor: pointer;
  background: var(--bg-alt);
  display: flex;
  align-items: center;
  justify-content: space-between;
  user-select: none;
  font-family: var(--font-sans);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  transition: background var(--dur-fast);
}

.faq-summary:hover {
  background: var(--white);
  color: var(--accent);
}

.faq-chevron {
  color: var(--text-muted);
  transition: transform var(--dur-fast) var(--ease-out), color var(--dur-fast);
  flex-shrink: 0;
  margin-left: 12px;
}

.faq-accordion[open] .faq-chevron {
  transform: rotate(180deg);
  color: var(--accent);
}

.faq-content {
  padding: var(--space-md);
  border-top: 1px solid var(--border);
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.65;
}

.faq-content p {
  margin-bottom: 10px;
}

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

.malla-ciclo-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px var(--space-md);
  margin-bottom: 12px;
  box-shadow: var(--shadow-sm);
  transition: border-color var(--dur-fast);
}

.malla-ciclo-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
  padding-bottom: 6px;
  margin-bottom: 8px;
}

.malla-ciclo-header h4 {
  font-family: var(--font-serif);
  font-size: 1.1rem;
  color: var(--accent);
  margin: 0;
}

.malla-ciclo-header span {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--bg-alt);
  padding: 2px 8px;
  border-radius: 10px;
}

.curso-row {
  transition: background var(--dur-fast), opacity var(--dur-fast);
}

.code-cell code {
  color: var(--accent);
  font-weight: 700;
}

.cred-tag {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--accent);
  background: var(--accent-light);
  padding: 2px 6px;
  border-radius: 4px;
}

/* ─── RESET ──────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html {
  scroll-behavior: smooth;
  overflow-x: clip;
  scrollbar-gutter: stable;
}
body {
  overflow-x: clip;
}

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

/* ─── ACCESSIBILITY & FOCUS STYLES (WCAG 2.1 AA) ──────────────────── */
:focus-visible {
  outline: 2px solid var(--accent) !important;
  outline-offset: 3px !important;
  box-shadow: 0 0 0 4px var(--color-ring) !important;
  border-radius: var(--radius);
}

:focus:not(:focus-visible) {
  outline: none;
}

/* Touch Targets Minimum (>=44px x 44px) for standalone interactive controls */
.btn,
.nav-toggle,
.search-input,
.tramite-btn,
.tab-btn {
  min-height: 44px;
}

/* Screen reader only utility class */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: var(--step-2);
  line-height: var(--lh-normal);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: var(--link);
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color var(--dur-fast) var(--ease-out);
}

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

/* ─── HEADER ─────────────────────────────────────────────────────── */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-sm) var(--space-md);
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--glass-border);
  position: sticky;
  top: 0;
  z-index: 100;
  transition: box-shadow var(--dur-normal) var(--ease-out), background var(--dur-normal) var(--ease-out);
}

.header.scrolled {
  box-shadow: var(--shadow-sm);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg-alt);
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--dur-fast) var(--ease-out);
}

.theme-toggle:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-light);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.theme-toggle:active {
  transform: translateY(0) scale(0.96);
}

.theme-toggle svg {
  width: 18px;
  height: 18px;
  stroke-width: 2px;
  transition: transform var(--dur-normal) var(--ease-spring);
}

.theme-toggle:hover svg {
  transform: rotate(15deg) scale(1.1);
}

.logo {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  flex-shrink: 0;
}

.logo img {
  height: 38px !important;
  max-height: 38px !important;
  width: auto !important;
  display: block;
  object-fit: contain;
}

.nav {
  display: flex;
  gap: 2rem;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
}

.nav > a,
.nav-dropdown-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  height: 38px;
  line-height: 1;
  padding: 0 4px;
  font-family: var(--font-sans);
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  background: transparent;
  border: none;
  cursor: pointer;
  position: relative;
  box-sizing: border-box;
  transition: color var(--dur-fast) var(--ease-out);
}

.nav > a::after,
.nav-dropdown-toggle::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 2px;
  right: 2px;
  height: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform var(--dur-normal) var(--ease-out);
}

.nav > a:hover::after,
.nav > a.active::after,
.nav-dropdown:hover .nav-dropdown-toggle::after,
.nav-dropdown.open .nav-dropdown-toggle::after {
  transform: scaleX(1);
  transform-origin: left;
}

.nav > a:hover,
.nav > a.active,
.nav-dropdown-toggle:hover,
.nav-dropdown:hover .nav-dropdown-toggle,
.nav-dropdown.open .nav-dropdown-toggle {
  color: var(--accent);
}

.nav-dropdown {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.nav-dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 210px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: var(--space-sm) 0;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: opacity var(--dur-normal) var(--ease-out),
              visibility var(--dur-normal) var(--ease-out),
              transform var(--dur-normal) var(--ease-out);
  z-index: 200;
}

/* Align dropdown to the right for items on the right edge of header */
.nav-dropdown:last-child .nav-dropdown-menu,
.nav-dropdown-menu--right {
  left: auto;
  right: 0;
}

.nav-dropdown:hover .nav-dropdown-menu,
.nav-dropdown:focus-within .nav-dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.nav-dropdown-menu a {
  display: block;
  padding: var(--space-xs) var(--space-lg);
  color: var(--text);
  text-decoration: none;
  font-size: var(--step-3);
  font-weight: 400;
  white-space: nowrap;
  transition: background var(--dur-fast), color var(--dur-fast);
}

.nav-dropdown-menu a:hover {
  background: var(--bg-alt);
  color: var(--accent);
}

.nav-dropdown-divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: var(--space-xs) 0;
}

.nav-dropdown-icon {
  transition: transform var(--dur-fast) var(--ease-out);
}

.nav-dropdown:hover .nav-dropdown-icon {
  transform: rotate(180deg);
}

.nav-toggle { display: none; }

/* Mobile dropdown (inside .nav.open) */
@media (max-width: 720px) {
  .nav-dropdown-menu {
    position: static;
    opacity: 1;
    visibility: visible;
    transform: none;
    box-shadow: none;
    border: none;
    border-radius: 0;
    background: transparent;
    padding: var(--space-xs) 0 var(--space-xs) var(--space-md);
    display: none;
  }
  .nav-dropdown.open .nav-dropdown-menu {
    display: block;
  }
  .nav-dropdown.open .nav-dropdown-icon {
    transform: rotate(180deg);
  }
}
.hero {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: var(--space-2xl) var(--space-md) var(--space-xl);
  border-bottom: 1px solid var(--border);
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  grid-template-rows: auto auto;
  grid-template-areas:
    "content image"
    "actions image";
  align-items: start;
  gap: 0 var(--space-xl);
}

.hero-content { grid-area: content; }
.hero-image   { grid-area: image; }
.hero-actions {
  grid-area: actions;
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  padding-top: var(--space-lg);
}

.hero-image-wrapper {
  border-radius: 12px;
  overflow: hidden;
  aspect-ratio: 4 / 3;
  background: var(--bg-alt);
}

.hero-image-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 12px;
}

.hero h1 {
  font-family: var(--font-serif);
  font-size: var(--step--2);
  font-weight: 700;
  line-height: var(--lh-tight);
  color: var(--accent);
  max-width: 720px;
  margin-bottom: var(--space-md);
  letter-spacing: -0.02em;
}

.hero p {
  font-size: var(--step-1);
  color: var(--text-muted);
  max-width: 560px;
  line-height: var(--lh-relaxed);
}

.hero-label {
  font-size: var(--step-4);
  color: var(--text-muted);
  margin-bottom: var(--space-sm);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.hero-label a { color: var(--text-muted); }

/* ─── BUTTONS ────────────────────────────────────────────────────── */
.btn {
  display: inline-block;
  background: var(--accent);
  color: var(--white);
  font-family: var(--font-sans);
  font-size: var(--step-3);
  font-weight: 600;
  padding: 0.75rem 1.75rem;
  border-radius: var(--radius);
  text-decoration: none;
  transition: background var(--dur-fast) var(--ease-out),
              transform var(--dur-fast) var(--ease-out),
              box-shadow var(--dur-fast) var(--ease-out);
  border: 1px solid transparent;
}

.btn:hover {
  background: var(--accent-hover);
  color: var(--white);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn:active { transform: translateY(0); }

.btn--outline {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--accent);
}

.btn--outline:hover {
  border-color: var(--accent);
  background: transparent;
  color: var(--accent-hover);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

/* ─── SECTIONS ───────────────────────────────────────────────────── */
.section {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: var(--space-xl) var(--space-md);
  border-bottom: 1px solid var(--border);
  transition: opacity var(--dur-reveal) var(--ease-out),
              transform var(--dur-reveal) var(--ease-out);
}


.section.visible {
  opacity: 1;
  transform: translateY(0);
}

.section--alt {
  background: var(--bg-alt);
  max-width: 100%;
  border-bottom: 1px solid var(--border);
  padding: var(--space-xl) var(--space-md);
}

.section--alt.dense { padding: var(--space-2xl) var(--space-md); }

.section--alt .inner {
  max-width: var(--max-width);
  margin-left: auto;
  margin-right: auto;
}

.section-title {
  font-family: var(--font-serif);
  font-size: var(--step--1);
  font-weight: 700;
  color: var(--accent);
  margin-bottom: var(--space-sm);
  letter-spacing: -0.01em;
}

.section-title--sm { font-size: var(--step-0); }

.section-desc {
  color: var(--text-muted);
  font-size: var(--step-3);
  margin-bottom: var(--space-lg);
  max-width: 560px;
  line-height: var(--lh-relaxed);
}

.section-desc.text-center {
  margin-left: auto;
  margin-right: auto;
  text-align: center;
}

/* ─── REVEAL GRID (stagger) ──────────────────────────────────────── */
.reveal-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--gap);
}

.reveal-grid > * {
  transition: opacity var(--dur-reveal) var(--ease-out),
              transform var(--dur-reveal) var(--ease-out);
}


.reveal-grid.visible > * { opacity: 1; transform: translateY(0); }

.reveal-grid.visible > *:nth-child(1)  { transition-delay: 0ms; }
.reveal-grid.visible > *:nth-child(2)  { transition-delay: 80ms; }
.reveal-grid.visible > *:nth-child(3)  { transition-delay: 160ms; }
.reveal-grid.visible > *:nth-child(4)  { transition-delay: 240ms; }
.reveal-grid.visible > *:nth-child(5)  { transition-delay: 320ms; }
.reveal-grid.visible > *:nth-child(6)  { transition-delay: 400ms; }
.reveal-grid.visible > *:nth-child(7)  { transition-delay: 480ms; }
.reveal-grid.visible > *:nth-child(8)  { transition-delay: 560ms; }

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

/* ─── PROSE ──────────────────────────────────────────────────────── */
.prose {
  max-width: 680px;
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.prose p {
  font-size: var(--step-3);
  color: var(--text);
  line-height: var(--lh-relaxed);
}

.prose p:first-of-type::first-letter {
  font-family: var(--font-serif);
  font-size: 3.5em;
  font-weight: 700;
  color: var(--accent);
  float: left;
  line-height: 0.85;
  margin: 0.05em 0.1em 0 0;
  padding-top: 0.02em;
}

@media (max-width: 600px) {
  .prose p:first-of-type::first-letter { float: none; font-size: inherit; }
}

/* ─── ABOUT GRID ─────────────────────────────────────────────────── */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-2xl);
  align-items: start;
}

.about-image {
  border-radius: var(--radius-lg);
  overflow: hidden;
  aspect-ratio: 4 / 3;
  background: var(--bg-alt);
}

.about-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* ─── CARDS GRID (generic) ───────────────────────────────────────── */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--gap);
  margin-top: var(--space-lg);
}

.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--gap);
  margin-top: var(--space-lg);
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--gap);
  margin-top: var(--space-lg);
}

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

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

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

.card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-md);
  text-decoration: none;
  color: var(--text);
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  transition: transform var(--dur-normal) var(--ease-out),
              box-shadow var(--dur-normal) var(--ease-out);
}

.card:hover {
  transform: translateY(-2px) scale(1.01);
  box-shadow: var(--shadow-card-hover);
}

.card h3 {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: var(--space-xs);
}

.card p {
  font-size: var(--step-3);
  color: var(--text-muted);
  line-height: var(--lh-relaxed);
}

/* ─── ESCUELAS GRID (Tabla Periódica de las Escuelas) ────────────── */
.escuelas-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: var(--space-md);
  margin-top: var(--space-lg);
}

.escuelas-grid > *:nth-child(1),
.escuelas-grid > *:nth-child(2) {
  grid-column: span 3;
}

.escuelas-grid > *:nth-child(3),
.escuelas-grid > *:nth-child(4),
.escuelas-grid > *:nth-child(5) {
  grid-column: span 2;
}

.escuela-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent); /* fallback, overridden by data-discipline */
  border-radius: var(--radius-lg);
  padding: var(--space-md);
  text-decoration: none;
  color: var(--text);
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  transition: transform var(--dur-normal) var(--ease-out),
              box-shadow var(--dur-normal) var(--ease-out),
              border-color var(--dur-normal) var(--ease-out);
}

.escuela-card:hover {
  transform: translateY(-2px) scale(1.01);
  box-shadow: var(--shadow-card-hover);
  border-color: var(--border);
}

.escuela-card[data-discipline="physics"]   { border-left-color: var(--color-physics); }
.escuela-card[data-discipline="math"]      { border-left-color: var(--color-math); }
.escuela-card[data-discipline="chem"]      { border-left-color: var(--color-chem); }
.escuela-card[data-discipline="comp"]      { border-left-color: var(--color-comp); }
.escuela-card[data-discipline="engphys"]   { border-left-color: var(--color-engphys); }

.escuela-card[data-discipline="physics"] .escuela-num { background: var(--color-physics); color: var(--white); }
.escuela-card[data-discipline="math"] .escuela-num    { background: var(--color-math); color: var(--white); }
.escuela-card[data-discipline="chem"] .escuela-num    { background: var(--color-chem); color: var(--white); }
.escuela-card[data-discipline="comp"] .escuela-num    { background: var(--color-comp); color: var(--white); }
.escuela-card[data-discipline="engphys"] .escuela-num { background: var(--color-engphys); color: var(--white); }

.escuela-card .escuela-num {
  display: inline-block;
  font-size: var(--step-4);
  font-weight: 600;
  color: var(--text-muted);
  background: var(--bg-alt);
  padding: 2px 8px;
  border-radius: 4px;
  width: fit-content;
  letter-spacing: 0.04em;
}

.escuela-card strong {
  font-family: var(--font-serif);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--accent);
  line-height: 1.3;
}

.escuela-card .escuela-areas {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
  margin-top: var(--space-xs);
}

.escuela-card .escuela-area {
  font-size: 0.7rem;
  color: var(--text-muted);
  background: var(--bg-alt);
  padding: 2px 8px;
  border-radius: 3px;
  white-space: nowrap;
  letter-spacing: 0.02em;
}

/* ─── CAMPUS PHOTO SEPARATOR ─────────────────────────────────────── */
.campus-photo {
  width: 100%;
  height: var(--space-2xl);
  overflow: hidden;
  background: var(--bg-alt);
}

.campus-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 60%;
  display: block;
  filter: brightness(0.88);
}

/* ─── SCIENTISTS ─────────────────────────────────────────────────── */
.scientists {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--gap);
  margin-top: var(--space-lg);
}

.scientist {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--space-md);
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  transition: transform var(--dur-normal) var(--ease-out),
              box-shadow var(--dur-normal) var(--ease-out);
}

.scientist:hover {
  transform: translateY(-2px) scale(1.01);
  box-shadow: var(--shadow-card-hover);
}

.scientist-photo {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--border);
}

.scientist-country {
  font-size: var(--step-4);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  font-weight: 600;
}

.scientist strong {
  font-family: var(--font-serif);
  font-size: 1rem;
  color: var(--accent);
}

.scientist p {
  font-size: var(--step-3);
  color: var(--text-muted);
  line-height: var(--lh-relaxed);
}

.link-more {
  display: inline-block;
  margin-top: var(--space-md);
  font-size: var(--step-3);
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
  transition: color var(--dur-fast) var(--ease-out);
}

.link-more:hover { color: var(--accent-hover); text-decoration: underline; }

/* ─── CONTACTS ───────────────────────────────────────────────────── */
.contacts {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-top: var(--space-lg);
}

.contact-item {
  padding: var(--space-md) var(--space-lg);
  background: var(--white);
  border-bottom: 1px solid var(--border);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.contact-label {
  font-size: var(--step-4);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  font-weight: 600;
}

.contact-item a {
  font-size: var(--step-3);
  color: var(--link);
  word-break: break-all;
}

/* ─── STAGES ─────────────────────────────────────────────────────── */
.stages {
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
  margin-top: var(--space-lg);
}

.stage-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s ease;
}

.stage-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.08);
}

.stage-header {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: 1.25rem 1.75rem;
  background: linear-gradient(135deg, var(--accent) 0%, #153252 100%);
}

.stage-num {
  font-family: var(--font-serif);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--white);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.25);
  line-height: 1;
  flex-shrink: 0;
}

.stage-header h3 {
  font-family: var(--font-serif);
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--white);
  margin: 0;
}

.stage-body { display: flex; flex-direction: column; }

.stage-body .step {
  border-bottom: 1px solid var(--border);
  border-left: 3px solid transparent;
  padding: 1.25rem 1.75rem;
  display: flex;
  gap: var(--space-md);
  align-items: flex-start;
  transition: background-color 0.2s ease, padding-left 0.25s ease, border-left-color 0.2s ease;
}

.stage-body .step:hover {
  background: rgba(26, 58, 92, 0.025);
  border-left-color: var(--accent);
  padding-left: 2rem;
}

.stage-body .step:last-child { border-bottom: none; }

.step-content { display: flex; flex-direction: column; gap: var(--space-xs); }

.step-content strong {
  font-size: var(--step-3);
  font-weight: 600;
  color: var(--text);
}

.step-content p { font-size: var(--step-3); color: var(--text-muted); line-height: 1.6; }

/* ─── ERROR LIST ─────────────────────────────────────────────────── */
.error-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: var(--space-lg);
  max-width: 760px;
  margin-left: auto;
  margin-right: auto;
}

.error-item {
  display: flex;
  align-items: flex-start;
  gap: var(--space-md);
  padding: 1.25rem 1.5rem;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s ease, border-color 0.2s ease;
}

.error-item:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
  border-color: rgba(192, 57, 43, 0.3);
}

.error-icon {
  font-size: 0.75rem;
  font-weight: 700;
  color: #c0392b;
  background: #fdecea;
  border: 1px solid rgba(192, 57, 43, 0.2);
  border-radius: 50%;
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 2px;
}

.error-item strong {
  display: block;
  font-size: var(--step-3);
  color: var(--text);
  margin-bottom: var(--space-xs);
}

.error-item p {
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin: 0;
}

/* ─── STEPS ──────────────────────────────────────────────────────── */
.steps {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-top: var(--space-lg);
  max-width: 720px;
}

.step {
  display: flex;
  align-items: flex-start;
  gap: var(--space-lg);
  padding: var(--space-md) var(--space-lg);
  background: var(--white);
  border-bottom: 1px solid var(--border);
}

.step:last-child { border-bottom: none; }

.step-num {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--accent);
  background: var(--bg-alt);
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  flex-shrink: 0;
}

.step-content { display: flex; flex-direction: column; gap: var(--space-xs); }

.step-content strong {
  font-size: var(--step-3);
  font-weight: 600;
  color: var(--text);
}

.step-content p { font-size: var(--step-3); color: var(--text-muted); }

/* ─── CHECKLIST ──────────────────────────────────────────────────── */
.checklist {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--space-md) var(--space-lg);
  background: var(--white);
  max-width: 480px;
  margin-top: var(--space-lg);
}

.checklist-title {
  font-size: var(--step-4);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
  font-weight: 600;
  margin-bottom: var(--space-md);
}

.checklist ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.checklist li {
  font-size: var(--step-3);
  padding-left: 1.5rem;
  position: relative;
}

.checklist li::before {
  content: '—';
  position: absolute;
  left: 0;
  color: var(--text-muted);
}

/* ─── NOTICE ─────────────────────────────────────────────────────── */
.notice {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius);
  padding: var(--space-md) var(--space-lg);
  font-size: var(--step-3);
  color: var(--text);
  max-width: 640px;
  margin-top: var(--space-lg);
  line-height: var(--lh-relaxed);
}

.notice strong {
  color: var(--accent);
}

/* ─── STATS ──────────────────────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-xl);
  text-align: center;
  max-width: 900px;
  margin: 0 auto;
}

.stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.stat-number {
  font-family: var(--font-serif);
  font-size: 3.5rem;
  font-weight: 700;
  color: var(--accent);
  line-height: 1;
}

.stat-label {
  font-size: var(--step-4);
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-top: var(--space-xs);
  letter-spacing: 0.08em;
}

@media (max-width: 768px) {
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-lg);
  }
  .stat-number {
    font-size: 2.75rem;
  }
}

@media (max-width: 480px) {
  .stats-grid {
    grid-template-columns: 1fr;
    gap: var(--space-md);
  }
}

/* ─── TABLE ──────────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; margin-top: var(--space-lg); }

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--step-3);
}

.table th {
  text-align: left;
  font-size: var(--step-4);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
  font-weight: 600;
  padding: var(--space-xs) var(--space-sm);
  border-bottom: 2px solid var(--border);
  vertical-align: middle;
}

.table td {
  padding: var(--space-xs) var(--space-sm);
  border-bottom: 1px solid var(--border);
  color: var(--text);
  text-align: left;
  vertical-align: middle;
}

.table .col-center {
  text-align: center !important;
}

.table .col-right {
  text-align: right !important;
}

.table tr:last-child td { border-bottom: none; }
.table tr:hover td { background: var(--bg-alt); }

/* ─── FOOTER ─────────────────────────────────────────────────────── */
.footer {
  background: var(--bg-alt);
  border-top: 1px solid var(--border);
  padding: var(--space-xl) 0 var(--space-md);
}

.footer-grid {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-md) var(--space-lg);
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1.2fr;
  gap: var(--space-xl);
}

.footer-logo {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 8px;
  letter-spacing: -0.01em;
}

.footer-brand p {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.5;
  max-width: 360px;
}

.footer-brand p.footer-verify {
  font-size: 0.78rem;
  opacity: 0.8;
  margin-top: 6px;
  line-height: 1.4;
}

.footer-brand p.footer-official {
  font-size: 0.82rem;
  margin-top: 8px;
}

.footer-brand a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
  font-weight: 500;
  transition: color var(--dur-fast);
}

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

.footer-nav {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.footer-nav h4 {
  font-family: var(--font-sans);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 6px;
}

.footer-nav ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.footer-nav a {
  display: inline-block;
  font-size: 0.85rem;
  color: var(--text-muted);
  text-decoration: none;
  transition: color var(--dur-fast) var(--ease-out), transform var(--dur-fast) var(--ease-out);
}

.footer-nav a:hover {
  color: var(--accent);
  transform: translateX(3px);
}

.footer-bottom {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: var(--space-md) var(--space-md) 0;
  border-top: 1px solid var(--border);
  font-size: 0.8rem;
  color: var(--text-muted);
  text-align: center;
}

/* ─── HERO SIMPLE (páginas internas sin imagen) ──────────────────── */
.hero--simple {
  display: block;
  padding: var(--space-2xl) var(--space-md) var(--space-xl);
  max-width: var(--max-width);
  margin: 0 auto;
  border-bottom: 1px solid var(--border);
  text-align: center;
}

.hero--simple .hero-content {
  max-width: 640px;
  margin: 0 auto;
}

.hero--simple h1 {
  max-width: 680px;
  margin: 0 auto var(--space-md) auto;
  font-family: var(--font-serif);
  font-size: var(--step--1);
  font-weight: 700;
  color: var(--accent);
  letter-spacing: -0.02em;
  line-height: var(--lh-tight);
}

.hero--simple p {
  max-width: 560px;
  margin: 0 auto;
  font-size: var(--step-1);
  color: var(--text-muted);
  line-height: var(--lh-relaxed);
}

.hero--simple .hero-label {
  font-size: var(--step-4);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-bottom: var(--space-sm);
}

.hero--simple .hero-label a { color: var(--text-muted); text-decoration: none; }
.hero--simple .hero-label a:hover { color: var(--accent); }

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--accent-light);
  color: var(--accent);
  font-size: var(--step-4);
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 4px 14px;
  border-radius: 99px;
  margin-bottom: var(--space-sm);
}

.sc {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: var(--space-xl) var(--space-md);
  border-bottom: 1px solid var(--border);
  text-align: center;
}
.sc--alt {
  background: var(--bg-alt);
  border-bottom: 1px solid var(--border);
  padding: var(--space-xl) var(--space-md);
  text-align: center;
}
.sc--alt .sc-inner {
  max-width: var(--max-width);
  margin: 0 auto;
}
.sc .section-title,
.sc--alt .section-title { text-align: center; margin-bottom: var(--space-xs); }
.sc .section-desc,
.sc--alt .section-desc {
  text-align: center;
  margin-left: auto;
  margin-right: auto;
}

.sec-num {
  display: inline-block;
  font-family: var(--font-serif);
  font-size: var(--step-4);
  font-weight: 600;
  color: var(--accent);
  opacity: 0.7;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 4px;
}

.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 500ms cubic-bezier(0.16,1,0.3,1),
              transform 500ms cubic-bezier(0.16,1,0.3,1);
}
.reveal.visible { opacity: 1; transform: none; }

/* ─── RESPONSIVE ─────────────────────────────────────────────────── */
@media (max-width: 860px) {
  .hero {
    grid-template-columns: 1fr;
    grid-template-areas:
      "content"
      "image"
      "actions";
    gap: var(--space-lg) 0;
  }
  .hero-image { aspect-ratio: 16 / 9; }
  .about-grid { grid-template-columns: 1fr; }
  .about-image { aspect-ratio: 16 / 7; }
  .campus-photo { height: var(--space-xl); }
  .escuelas-grid {
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  }
  .escuelas-grid > * {
    grid-column: auto;
  }
}

@media (max-width: 720px) {
  .nav { display: none; }
  .nav.open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--white);
    border-bottom: 1px solid var(--border);
    padding: var(--space-md);
    gap: var(--space-md);
    z-index: 1000;
    box-shadow: var(--shadow-lg);
  }
  .nav-toggle { display: block; }
  .hero { padding: var(--space-xl) var(--space-sm) var(--space-lg); }
  .section { padding: var(--space-lg) var(--space-sm); }
  .section--alt { padding: var(--space-lg) var(--space-sm); }
  .section--alt.dense { padding: var(--space-xl) var(--space-sm); }
  .contacts { grid-template-columns: 1fr; }
  .contact-item { border-right: none; }
  .footer-grid { grid-template-columns: 1fr; gap: var(--space-lg); }
  .stage-header { padding: var(--space-md) var(--space-md); }
  .stage-body .step { padding: var(--space-md) var(--space-md); }
  .step { padding: var(--space-md) var(--space-md); gap: var(--space-md); }
}

@media (max-width: 600px) {
  .hero { gap: var(--space-md) 0; }
  .hero h1 { font-size: var(--step--1); }
  .hero p { font-size: var(--step-2); }
  .section-title { font-size: var(--step-0); }
  .escuelas-grid { grid-template-columns: 1fr; }
  .scientists { grid-template-columns: 1fr; }
  .grid { grid-template-columns: 1fr; }
}

/* ─── GLOBAL COMPONENTS (FAQ, TRÁMITES, CIENTÍFICOS) ───────────── */

/* FAQ */
.faq-list {
  max-width: 800px;
  margin: var(--space-lg) auto 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  text-align: left;
}
.faq-item {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-md) var(--space-lg);
}
.faq-question {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: var(--space-xs);
}
.faq-answer {
  font-size: var(--step-3);
  color: var(--text-muted);
  line-height: var(--lh-relaxed);
}

/* CIENTÍFICOS */
.area-block {
  margin-top: var(--space-xl);
}
.area-title {
  font-family: var(--font-serif);
  color: var(--accent);
  border-bottom: 2px solid var(--border);
  padding-bottom: var(--space-xs);
  margin-bottom: var(--space-md);
  font-size: 1.6rem;
}
.profile-grid {
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
}
.profile-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  display: flex;
  gap: var(--space-lg);
  align-items: start;
  text-align: left;
}
.profile-info {
  flex: 1;
}

/* TRÁMITES */
.tramites-container {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: var(--space-lg);
  max-width: var(--max-width);
  margin: 0 auto;
  padding: var(--space-md) var(--space-md) var(--space-xl);
  align-items: start;
}
.tramites-sidebar {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-md);
  position: sticky;
  top: 90px;
  max-height: calc(100vh - 120px);
  overflow-y: auto;
  box-shadow: var(--shadow-sm);
}
.search-wrapper {
  position: relative;
  margin-bottom: var(--space-md);
}
.search-wrapper input {
  width: 100%;
  padding: 0.75rem 1rem 0.75rem 2.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-family: var(--font-sans);
  font-size: var(--step-3);
  color: var(--text);
  background: var(--bg);
  transition: border-color var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out), background-color var(--dur-fast) var(--ease-out);
}
.search-wrapper input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(26, 58, 92, 0.15);
  background: var(--white);
}
.search-icon {
  position: absolute;
  left: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}
.tramites-menu {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}
.menu-category {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.category-title {
  font-size: var(--step-4);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  font-weight: 700;
  margin-bottom: 0.25rem;
  padding-left: 0.5rem;
  border-left: 2px solid var(--accent);
}
.menu-item {
  background: transparent;
  border: none;
  text-align: left;
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius);
  font-family: var(--font-sans);
  font-size: var(--step-3);
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--dur-fast) var(--ease-out);
}
.menu-item:hover {
  background: var(--bg-alt);
  color: var(--accent);
}
.menu-item.active {
  background: var(--accent);
  color: var(--white);
  font-weight: 600;
}
.tramites-content {
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
}
.tramite-panel {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  box-shadow: var(--shadow-sm);
}
html.js .tramite-panel {
  display: none;
  animation: panelFadeIn var(--dur-normal) var(--ease-out) forwards;
}
html.js .tramite-panel.active {
  display: block;
}
@keyframes panelFadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
.panel-header {
  border-bottom: 1px solid var(--border);
  padding-bottom: var(--space-sm);
  margin-bottom: var(--space-md);
}
.panel-header h2 {
  font-family: var(--font-serif);
  font-size: 1.8rem;
  color: var(--accent);
  margin-bottom: var(--space-xs);
  line-height: 1.2;
}
.panel-meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
  margin-top: var(--space-xs);
}
.meta-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.75rem;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 50px;
  font-size: var(--step-4);
  font-weight: 600;
  color: var(--text-muted);
}
.meta-badge.cost {
  background: rgba(30, 86, 49, 0.08);
  border-color: rgba(30, 86, 49, 0.2);
  color: var(--color-math);
}
.meta-badge.time {
  background: rgba(21, 82, 99, 0.08);
  border-color: rgba(21, 82, 99, 0.2);
  color: var(--color-engphys);
}
.panel-body h3 {
  font-family: var(--font-serif);
  font-size: 1.3rem;
  color: var(--accent);
  margin: var(--space-md) 0 var(--space-xs);
  border-bottom: 1px solid var(--border);
  padding-bottom: 4px;
}
.panel-body p {
  font-size: var(--step-3);
  color: var(--text);
  line-height: var(--lh-relaxed);
  margin-bottom: var(--space-sm);
}
.panel-body ul, .panel-body ol {
  margin-left: var(--space-md);
  margin-bottom: var(--space-md);
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}
.panel-body li {
  font-size: var(--step-3);
  color: var(--text-muted);
  line-height: var(--lh-relaxed);
}
.panel-body li strong {
  color: var(--text);
}
.remember-box {
  background: rgba(139, 45, 26, 0.05);
  border-left: 4px solid var(--color-chem);
  padding: var(--space-md);
  border-radius: 0 var(--radius) var(--radius) 0;
  margin: var(--space-md) 0;
}
.remember-box h4 {
  font-size: var(--step-3);
  color: var(--color-chem);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: var(--space-xs);
}
.remember-box p {
  margin-bottom: 0;
  font-size: var(--step-3);
  color: var(--text-muted);
  line-height: var(--lh-relaxed);
}
.btn-group {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  margin-top: var(--space-md);
}
.tramite-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.7rem 1.25rem;
  border-radius: var(--radius);
  font-family: var(--font-sans);
  font-size: var(--step-3);
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: all var(--dur-fast) var(--ease-out);
  border: none;
}
.tramite-btn--primary {
  background: var(--accent);
  color: var(--white);
}
.tramite-btn--primary:hover {
  background: var(--accent-hover);
  color: var(--white);
  transform: translateY(-1px);
}
.tramite-btn--secondary {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--accent);
}
.tramite-btn--secondary:hover {
  border-color: var(--accent);
  background: var(--bg);
  transform: translateY(-1px);
}
.option-block {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--space-md);
  background: var(--bg);
  margin-bottom: var(--space-md);
}
.option-title {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  color: var(--accent);
  margin-bottom: var(--space-xs);
  font-weight: 600;
}
.options-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-md);
  margin-top: var(--space-md);
}
@media (min-width: 768px) {
  .options-grid {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  }
}
  @media (max-width: 850px) {
    .tramites-container {
      grid-template-columns: 1fr;
    }
    .tramites-sidebar {
      position: static;
      max-height: none;
      margin-bottom: var(--space-md);
    }
  }

/* ── RECURSOS & BIBLIOTECA ────────────────────────────────────────── */
.drive-card {
  max-width: 680px;
  margin: var(--space-lg) auto 0;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-lg) var(--space-xl);
  box-shadow: var(--shadow-md);
  text-align: left;
  transition: box-shadow var(--dur-normal) var(--ease-out), transform var(--dur-normal) var(--ease-out);
}
.drive-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); }
.drive-card-head {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-md);
}
.icon-wrap {
  width: 46px; height: 46px;
  background: var(--accent-light);
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.icon-wrap svg { color: var(--accent); }
.drive-card-head h3 {
  font-family: var(--font-serif);
  font-size: var(--step-0);
  font-weight: 700;
  color: var(--text);
  margin: 0;
}
.drive-card-head small {
  display: block;
  font-size: var(--step-4);
  color: var(--text-muted);
  margin-top: 2px;
}
.check-list {
  list-style: none;
  padding: 0; margin: 0 0 var(--space-lg) 0;
  display: flex; flex-direction: column; gap: 12px;
}
.check-list li {
  display: flex; align-items: flex-start; gap: 10px;
  font-size: var(--step-3);
  color: var(--text);
  line-height: var(--lh-normal);
}
.check-list li .chk {
  width: 18px; height: 18px; flex-shrink: 0; margin-top: 1px;
  background: var(--accent-light);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
}
.check-list li .chk svg { color: var(--accent); }
.check-list li strong { color: var(--accent); }
.card-cta {
  text-align: center;
  padding-top: var(--space-sm);
  border-top: 1px solid var(--border);
}
.lib-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--space-lg);
  max-width: 960px;
  margin: var(--space-lg) auto 0;
}
.lib-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  text-align: left;
  box-shadow: var(--shadow-sm);
  display: flex; flex-direction: column;
  transition: box-shadow var(--dur-normal) var(--ease-out), transform var(--dur-normal) var(--ease-out);
  position: relative; overflow: hidden;
}
.lib-card::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: var(--accent);
  transform: scaleX(0); transform-origin: left;
  transition: transform var(--dur-normal) var(--ease-out);
}
.lib-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.lib-card:hover::before { transform: scaleX(1); }
.lib-card-type {
  font-size: var(--step-4); font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--accent); opacity: 0.8;
  margin-bottom: 6px;
}
.lib-card h3 {
  font-family: var(--font-serif);
  font-size: 1.25rem; font-weight: 700;
  color: var(--text); margin: 0 0 var(--space-xs) 0;
  line-height: var(--lh-tight);
}
.lib-card .lib-desc {
  font-size: var(--step-3);
  color: var(--text-muted);
  line-height: var(--lh-relaxed);
  margin-bottom: var(--space-sm);
  flex: 1;
}
.lib-stats {
  display: grid; grid-template-columns: repeat(2, 1fr);
  gap: 8px; margin-bottom: var(--space-sm);
}
.lib-stat {
  background: var(--bg-alt);
  border-radius: var(--radius);
  padding: 10px 12px;
  text-align: center;
}
.lib-stat-val {
  display: block;
  font-family: var(--font-serif);
  font-size: 1.4rem; font-weight: 700;
  color: var(--accent); line-height: 1.1;
}
.lib-stat-label {
  font-size: 0.72rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.04em;
  color: var(--text-muted);
}
.lib-services {
  list-style: none; padding: 0; margin: 0 0 var(--space-sm) 0;
  display: flex; flex-direction: column; gap: 7px;
}
.lib-services li {
  display: flex; align-items: flex-start; gap: 8px;
  font-size: var(--step-4); color: var(--text);
  line-height: var(--lh-normal);
}
.lib-services li::before {
  content: '';
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent); opacity: 0.5;
  margin-top: 5px; flex-shrink: 0;
}
.lib-contact {
  background: var(--bg-alt);
  border-radius: var(--radius);
  padding: 10px 14px;
  font-size: var(--step-4);
  color: var(--text-muted);
  display: flex; flex-direction: column; gap: 3px;
  margin-bottom: var(--space-sm);
}
.lib-contact a { color: var(--accent); text-decoration: none; font-weight: 600; }
.lib-contact a:hover { color: var(--accent-hover); }
.lib-links { display: flex; flex-wrap: wrap; gap: 8px; }
.lib-link-btn {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: var(--step-4); font-weight: 600;
  color: var(--accent); text-decoration: none;
  padding: 6px 14px;
  background: var(--accent-light);
  border-radius: 99px;
  transition: background var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out);
}
.lib-link-btn:hover { background: var(--accent); color: var(--white); }
.lib-link-btn--outline {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
}
.lib-link-btn--outline:hover { background: var(--accent); color: var(--white); border-color: var(--accent); }
.sw-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: var(--space-lg);
  max-width: 960px;
  margin: var(--space-lg) auto 0;
}
.sw-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  text-align: left;
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--dur-normal) var(--ease-out), transform var(--dur-normal) var(--ease-out);
}
.sw-card:hover { box-shadow: var(--shadow-md); transform: translateY(-3px); }
.sw-icon {
  width: 44px; height: 44px;
  background: var(--accent-light);
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: var(--space-sm);
}
.sw-icon svg { color: var(--accent); }
.sw-tag {
  display: inline-block;
  font-size: 0.7rem; font-weight: 600;
  letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--accent); background: var(--accent-light);
  padding: 2px 10px; border-radius: 99px; margin-bottom: 8px;
}
.sw-card h3 {
  font-family: var(--font-serif);
  font-size: var(--step-0); font-weight: 700;
  color: var(--accent); margin-bottom: var(--space-xs);
}
.sw-card p {
  font-size: var(--step-3); color: var(--text-muted);
  line-height: var(--lh-relaxed);
}
@media (max-width: 640px) {
  .drive-card { padding: var(--space-md); }
  .lib-grid { grid-template-columns: 1fr; }
  .sw-grid  { grid-template-columns: 1fr; }
}

.profile-meta {
  font-size: var(--step-4);
  color: var(--text-muted);
  margin-bottom: var(--space-xs);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
}
.profile-name {
  font-family: var(--font-serif);
  font-size: 1.4rem;
  color: var(--accent);
  margin-bottom: 4px;
}
.profile-career {
  font-size: var(--step-3);
  font-weight: 500;
  color: var(--text);
  margin-bottom: var(--space-sm);
}
.profile-details p {
  margin-bottom: var(--space-xs);
  font-size: var(--step-3);
  line-height: var(--lh-relaxed);
}
.profile-achievements {
  margin-top: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  background: var(--bg-alt);
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius) var(--radius) 0;
  font-size: var(--step-3);
}
.profile-achievements strong {
  color: var(--accent);
}
.profile-links {
  margin-top: var(--space-sm);
  display: flex;
  gap: var(--space-md);
  flex-wrap: wrap;
}
.profile-links a {
  font-size: var(--step-4);
  color: var(--link);
  text-decoration: none;
  font-weight: 600;
}
.profile-links a:hover {
  text-decoration: underline;
}
@media (max-width: 720px) {
  .profile-card {
    flex-direction: column;
    gap: var(--space-md);
  }
}