/* ─────────────────────────────────────────────────────────────────────────── */
/* VARIABLES                                                                    */
/* ─────────────────────────────────────────────────────────────────────────── */

:root {
  /* Color */
  --bg:           #fafafa;
  --fg:           #0a0a0a;
  --fg-soft:      #666666;
  --border:       #e5e5e5;
  --accent:       #0a0a0a;
  --ink:          #0e0e0e;
  --paper:        #f4f2ee;

  /* Typography */
  --sans:         'Geist Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --mono:         'DM Mono', monospace;

  /* Layout */
  --col:          clamp(320px, 90vw, 720px);
  --pad:          clamp(1rem, 4vw, 2.5rem);
  --gap:          2rem;

  /* Timing */
  --ease:         cubic-bezier(0.2, 0, 0.8, 1);
}


/* ─────────────────────────────────────────────────────────────────────────── */
/* RESET                                                                        */
/* ─────────────────────────────────────────────────────────────────────────── */

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--mono);
  font-weight: 400;
  line-height: 1.6;
}

a {
  color: inherit;
  text-decoration: none;
  transition: opacity 0.2s var(--ease);
}

a:hover {
  text-decoration: underline;
  text-underline-offset: 4px;
  opacity: 0.7;
}

::selection {
  background: var(--fg);
  color: var(--bg);
}

::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: var(--bg);
}

::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--fg-soft);
}

/* ─────────────────────────────────────────────────────────────────────────── */
/* HEADER / NAV                                                                 */
/* ─────────────────────────────────────────────────────────────────────────── */

header {
  position: sticky;
  top: 0;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  z-index: 100;
  backdrop-filter: blur(4px);
  background-color: rgba(250, 250, 250, 0.95);
}

.header-content {
  max-width: var(--col);
  margin: 0 auto;
  padding: 1.2rem var(--pad);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 2rem;
}

.header-info {
  display: flex;
  gap: 1.5rem;
  align-items: baseline;
  font-size: 0.875rem;
}

.header-name {
  font-weight: 600;
  letter-spacing: -0.3px;
}

.header-role {
  color: var(--fg-soft);
  font-size: 0.8125rem;
}

.header-menu {
  background: none;
  border: 1px solid var(--border);
  padding: 0.4rem 0.8rem;
  cursor: pointer;
  font-family: var(--sans);
  font-size: 0.875rem;
  color: var(--fg);
  border-radius: 3px;
  transition: all 0.2s var(--ease);
}

.header-menu:hover {
  background: var(--fg);
  color: var(--bg);
}

/* ─────────────────────────────────────────────────────────────────────────── */
/* MAIN / LAYOUT                                                                */
/* ─────────────────────────────────────────────────────────────────────────── */

main {
  max-width: var(--col);
  margin: 0 auto;
  padding: 0 var(--pad);
}

/* ─────────────────────────────────────────────────────────────────────────── */
/* SECTIONS                                                                     */
/* ─────────────────────────────────────────────────────────────────────────── */

section {
  padding: var(--gap) 0;
  border-bottom: 1px solid var(--border);
}

section:last-of-type {
  border-bottom: none;
}

.section-header {
  display: flex;
  gap: 1rem;
  align-items: baseline;
  margin-bottom: 1.5rem;
}

.section-label {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--fg-soft);
  min-width: 4rem;
}

/* ─────────────────────────────────────────────────────────────────────────── */
/* HERO                                                                         */
/* ─────────────────────────────────────────────────────────────────────────── */

.section--hero {
  padding-top: 3rem;
}

.hero-title {
  font-size: clamp(2rem, 6vw, 3.5rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin-bottom: 1.2rem;
}

.hero-title em {
  font-style: italic;
  font-weight: 400;
}

.hero-desc {
  font-size: 0.95rem;
  color: var(--fg-soft);
  line-height: 1.8;
  max-width: 50ch;
}

.education-img {
  width: 100%;
}

/* ─────────────────────────────────────────────────────────────────────────── */
/* RATIONALE / ABOUT                                                            */
/* ─────────────────────────────────────────────────────────────────────────── */

.rationale-lead {
  font-size: 1rem;
  font-weight: 500;
  line-height: 1.8;
  max-width: 60ch;
  margin-bottom: 1.8rem;
}

.rationale-lead sup {
  font-family: var(--mono);
  font-size: 0.7em;
  color: var(--fg-soft);
}

.footnotes {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
  margin: 2rem 0;
}

.fn {
  display: grid;
  grid-template-columns: 2rem 1fr;
  gap: 0.75rem;
  align-items: start;
}

.fn-n {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--fg-soft);
  font-weight: 500;
}

.fn p {
  font-size: 0.875rem;
  color: var(--fg-soft);
  line-height: 1.7;
}

.fn strong {
  font-weight: 600;
  color: var(--fg);
}

.fn-ref {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--fg-soft);
  font-style: italic;
  margin-top: 1rem;
}

/* ─────────────────────────────────────────────────────────────────────────── */
/* ENTRY LIST                                                                   */
/* ─────────────────────────────────────────────────────────────────────────── */

.entry-list {
  display: flex;
  flex-direction: column;
}

.entry {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1.5rem;
  padding: 1rem 0;
  border-bottom: 1px solid var(--border);
}

.entry:first-child {
  border-top: 1px solid var(--border);
}

.entry-left {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  flex: 1;
}

.entry-org {
  font-weight: 500;
  font-size: 0.95rem;
}

.entry-role {
  font-size: 0.8125rem;
  color: var(--fg-soft);
}

.entry-date {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--fg-soft);
  white-space: nowrap;
  flex-shrink: 0;
}

/* ─────────────────────────────────────────────────────────────────────────── */
/* CONTACT                                                                      */
/* ─────────────────────────────────────────────────────────────────────────── */

.contact-intro {
  font-size: 1rem;
  font-weight: 500;
  line-height: 1.8;
  max-width: 60ch;
  margin-bottom: 2rem;
}

.contact-intro a {
  text-decoration: underline;
  text-underline-offset: 4px;
}

.contact-links {
  display: flex;
  flex-direction: column;
}

.contact-row {
  display: flex;
  gap: 2rem;
  align-items: baseline;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.875rem;
}

.contact-row:first-child {
  border-top: 1px solid var(--border);
}

.contact-platform {
  color: var(--fg-soft);
  min-width: 5rem;
  font-family: var(--mono);
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

/* ─────────────────────────────────────────────────────────────────────────── */
/* FOOTER                                                                       */
/* ─────────────────────────────────────────────────────────────────────────── */

footer {
  max-width: var(--col);
  margin: 0 auto;
  padding: var(--gap) var(--pad);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: 0.75rem;
  color: var(--fg-soft);
  border-top: 1px solid var(--border);
}

/* ─────────────────────────────────────────────────────────────────────────── */
/* MENU MODAL                                                                    */
/* ─────────────────────────────────────────────────────────────────────────── */

.menu-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.3);
  display: none;
  z-index: 999;
  opacity: 0;
  transition: opacity 0.3s var(--ease);
}

.menu-modal.active {
  display: flex;
  opacity: 1;
}

.menu-modal-content {
  display: flex;
  width: 100%;
  height: 100%;
  margin-left: auto;
  animation: slideInRight 0.3s var(--ease);
}

@keyframes slideInRight {
  from {
    transform: translateX(100%);
  }
  to {
    transform: translateX(0);
  }
}

.menu-modal.closing .menu-modal-content {
  animation: slideOutRight 0.3s var(--ease);
}

@keyframes slideOutRight {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(100%);
  }
}

.menu-section {
  flex: 1;
  padding: 2rem;
  background: white;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  border-right: 1px solid var(--border);
}

.menu-section:last-child {
  border-right: none;
}

.menu-section.left {
  background: #8a92a8;
  color: white;
  flex: 0.6;
  border-right: 1px solid #7a8298;
}

.menu-section h4 {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--fg-soft);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 0 0 1.5rem 0;
}

.menu-section.left h4 {
  color: rgba(255, 255, 255, 0.6);
}

.menu-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 12px;
  cursor: pointer;
  border-radius: 4px;
  transition: all 0.2s var(--ease);
  text-decoration: none;
  color: inherit;
  font-size: 0.95rem;
}

.menu-item:hover {
  background: rgba(0, 0, 0, 0.05);
}

.menu-section.left .menu-item:hover {
  background: rgba(255, 255, 255, 0.1);
}

.menu-item input[type="radio"] {
  width: 16px;
  height: 16px;
  cursor: pointer;
  accent-color: var(--accent);
  margin: 0;
  flex-shrink: 0;
}

.menu-item.active {
  background: #c6d96f;
}

.menu-item.active span {
  color: #1a1a1a;
  font-weight: 500;
}

.menu-item span {
  color: var(--fg);
  font-weight: 400;
}

.menu-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: white;
  margin: 0 0 2rem 0;
}

.menu-close {
  position: absolute;
  top: 2rem;
  right: 2rem;
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: var(--fg-soft);
  transition: color 0.2s var(--ease);
  z-index: 1000;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  font-weight: 500;
}

.menu-close:hover {
  color: var(--fg);
  background: var(--border);
}

/* ─── Ticker Superior ─── */
.ticker {
  background: var(--ink);
  color: var(--paper);
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  padding: 7px 0;
  overflow: hidden;
  white-space: nowrap;
  position: sticky;
  top: 0;
  z-index: 105;
  border-bottom: 1px solid var(--ink);
}

.ticker-inner {
  display: inline-block;
  animation: scroll-left 25s linear infinite;
}

.ticker-inner span {
  margin: 0 1.5rem;
}

@keyframes scroll-left {
  from {
    transform: translateX(0);
  }

  to {
    transform: translateX(-50%);
  }
}

/* ─── Navbar Brutalista (Contenedores Fijos con Outline) ─── */
.navbar {
  width: 100%;
  background: var(--ink);
  border-bottom: 1px solid var(--ink);
  position: sticky;
  top: 29px;
  z-index: 100;
}

nav.nav-primary {
  display: flex;
  width: 100%;
}

/* Estilos de Celda Base */
.nav-block {
  flex: 1;
  min-height: 45px;
  display: flex;
  align-items: center;
  background: var(--paper);
  border-right: 1px solid var(--ink);
  padding: 10px 15px;
  position: relative;
  transition: background 0.2s ease, color 0.2s ease;
}

.nav-block:last-child {
  border-right: none;
}

/* Desencadenadores de Texto */
.nav-trigger,
.nav-label {
  font-family: var(--mono);
  font-size: 1rem;
  font-weight: bold;
  color: var(--ink);
  text-transform: lowercase;
  cursor: pointer;
  margin-right: auto;
  transition: color 0.2s ease;
}

/* Efecto Hover para celdas DESPLEGABLES: Fondo negro, texto blanco */
.nav-block-dropdown:hover {
  background: var(--ink);
  color: var(--paper);
}

.nav-block-dropdown:hover .nav-trigger {
  color: var(--paper);
}

/* Efecto especial para que el puntito baje/aparezca mecánicamente al hacer hover */
.nav-block-dropdown:hover::after {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  background: var(--paper);
  border-radius: 50%;
  position: absolute;
  right: 15px;
  top: 50%;
  transform: translateY(-50%);
  animation: dot-drop 0.25s forwards;
}

@keyframes dot-drop {
  0% {
    transform: translateY(-120%);
    opacity: 0;
  }

  100% {
    transform: translateY(-50%);
    opacity: 1;
  }
}


/* ─── Bloques Planos (No Desplegables) ─── */
a.nav-block-flat {
  text-decoration: none;
  font-family: var(--ff-mono);
  font-size: 1rem;
  font-weight: lighter;
  color: var(--ink);
  text-transform: lowercase;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  transition: background 0.2s ease, color 0.2s ease;
}

/* Hover en Bloques Planos: Fondo negro, letras blancas */
a.nav-block-flat:hover {
  background: var(--ink);
  color: var(--paper);
}

/* Efecto Click Activo / Página seleccionada permanente */
a.nav-block-flat:active,
a.nav-block-flat.active {
  background: var(--ink) !important;
  color: var(--paper) !important;
}

/* ─── Menú Desplegable Box (Conserva legibilidad interna) ─── */
.nav-links-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: -1px;
  width: calc(100% + 2px);
  background: var(--paper);
  border: 1px solid var(--ink);
  border-top: none;
  z-index: 1000;
}

.nav-block-dropdown:hover .nav-links-menu {
  display: block;
}

.nav-links-menu a {
  font-family: var(--ff-mono);
  font-size: 1rem;
  color: var(--ink);
  text-decoration: none;
  padding: 12px 15px;
  border-bottom: 1px solid var(--ink);
  display: flex;
  align-items: center;
  gap: 8px;
  transition: background 0.15s ease, color 0.15s ease;
}

.nav-links-menu a:last-child {
  border-bottom: none;
}

.nav-links-menu a:hover {
  background: var(--ink);
  color: var(--paper);
}

.nav-links-menu a.active {
  font-weight: bold;
}

.nav-links-menu a span {
  font-size: 0.75rem;
}

/* ─────────────────────────────────────────────────────────────────────────── */
/* RESPONSIVE                                                                   */
/* ─────────────────────────────────────────────────────────────────────────── */

@media (max-width: 640px) {
  :root {
    --col: 100%;
    --pad: 1rem;
  }

  .header-content {
    flex-direction: column;
    gap: 1rem;
    align-items: flex-start;
  }

  .header-info {
    width: 100%;
    flex-wrap: wrap;
  }

  .entry {
    flex-direction: column;
    gap: 0.5rem;
  }

  .entry-date {
    align-self: flex-start;
  }

  .contact-row {
    flex-direction: column;
    gap: 0.25rem;
  }

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

  .menu-modal-content {
    flex-direction: column;
  }

  .menu-section {
    flex: 1;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }

  .menu-section.left {
    border-right: none;
    border-bottom: 1px solid #7a8298;
  }
}

/* ─── DISEÑO RESPONSIVE ─── */
@media (max-width: 900px) {
  html {
    scroll-padding-top: 0;
  }

  .navbar {
    position: static;
  }
}