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

:root {
  --ink: #1a1a1a;
  --ink-muted: #5a5a5a;
  --ink-faint: #9a9a9a;
  --rule: #e2e2e2;
  --surface: #fafaf8;
  --panel: #ffffff;
  --accent: #c0392b;
  --accent-light: #f5ece9;
  --data-blue: #1a3a5c;
  --sidebar-w: 290px;
  --nav-h: 52px;
  --tag-bg: #f2f2f0;
  --tag-color: #5a5a5a;
  --card-bg: #ffffff;
  --prose-color: #3a3a3a;
}

html[data-theme="dark"] {
  --ink: #f0f0ee;
  --ink-muted: #a0a09e;
  --ink-faint: #585856;
  --rule: #2e2e2c;
  --surface: #141412;
  --panel: #1c1c1a;
  --accent: #e05a4a;
  --accent-light: #2a1a18;
  --data-blue: #7ab3d8;
  --tag-bg: #282826;
  --tag-color: #a0a09e;
  --card-bg: #1c1c1a;
  --prose-color: #c0c0be;
}

html { font-size: 17px; scroll-behavior: smooth; }
body {
  background: var(--surface);
  color: var(--ink);
  font-family: 'DM Sans', sans-serif;
  font-weight: 300;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  transition: background 0.25s, color 0.25s;
}

/* NAV */
nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  background: var(--panel);
  border-bottom: 1px solid var(--rule);
  height: var(--nav-h);
  display: flex; align-items: center;
  padding: 0 2rem; gap: 1.5rem;
  transition: background 0.25s, border-color 0.25s;
}
.nav-brand {
  font-family: 'Playfair Display', serif;
  font-size: 1.05rem; font-weight: 600;
  color: var(--ink); text-decoration: none; white-space: nowrap;
}
.nav-brand span { color: var(--accent); }
.nav-links { display: flex; gap: 1.25rem; margin-left: auto; list-style: none; align-items: center; }
.nav-links a {
  color: var(--ink-muted); text-decoration: none;
  font-size: 0.75rem; font-weight: 400;
  letter-spacing: 0.09em; text-transform: uppercase; transition: color 0.2s;
}
.nav-links a:hover { color: var(--accent); }
.nav-controls {
  display: flex; align-items: center; gap: 0.5rem;
  padding-left: 1rem; border-left: 1px solid var(--rule);
}
.lang-toggle { display: flex; border: 1px solid var(--rule); border-radius: 2px; overflow: hidden; }
.lang-btn {
  background: none; border: none;
  padding: 0.22rem 0.6rem;
  font-family: 'DM Sans', sans-serif; font-size: 0.7rem; font-weight: 500;
  letter-spacing: 0.08em; text-transform: uppercase;
  color: #a0a09e; cursor: pointer; transition: background 0.15s, color 0.15s;
}
.lang-btn.active { background: var(--accent); color: #fff; }
.theme-btn {
  background: none; border: 1px solid var(--rule); border-radius: 2px;
  width: 30px; height: 26px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.85rem; transition: border-color 0.2s;
}
.theme-btn:hover { border-color: var(--accent); }
.nav-p {
  color: #a0a09e
}

/* LAYOUT */
.page-wrapper { display: flex; min-height: 100vh; padding-top: var(--nav-h); }

/* SIDEBAR */
aside {
  width: var(--sidebar-w); flex-shrink: 0;
  background: var(--panel); border-right: 1px solid var(--rule);
  position: sticky; top: var(--nav-h);
  height: calc(100vh - var(--nav-h)); overflow-y: auto;
  padding: 2.25rem 1.75rem;
  display: flex; flex-direction: column; gap: 1.75rem;
  transition: background 0.25s, border-color 0.25s;
}
.profile-block { text-align: center; }
.profile-img-wrap {
  width: 96px; height: 96px; border-radius: 50%; overflow: hidden;
  margin: 0 auto 0.9rem; border: 2px solid var(--rule);
}
.profile-img-wrap img { width: 100%; height: 100%; object-fit: cover; }
.profile-name { font-family: 'Playfair Display', serif; font-size: 1.2rem; font-weight: 600; }
.profile-name em { color: var(--accent); font-style: normal; }
.profile-title { font-size: 0.8rem; color: var(--ink-muted); letter-spacing: 0.1em; text-transform: uppercase; margin-top: 0.25rem; }
.profile-location { font-size: 0.85rem; color: var(--ink-faint); margin-top: 0.4rem; }
.status-badge {
  display: inline-flex; align-items: center; gap: 0.4rem;
  font-size: 0.73rem; color: #4caf50;
  background: rgba(76,175,80,0.1); padding: 0.18rem 0.55rem;
  border-radius: 2px; font-weight: 500; margin-top: 0.6rem;
  border: 1px solid rgba(76,175,80,0.2);
}
.status-dot { width: 5px; height: 5px; background: #4caf50; border-radius: 50%; animation: pulse-g 2.5s infinite; }
@keyframes pulse-g { 0%,100%{opacity:1} 50%{opacity:0.3} }
.sidebar-divider { height: 1px; background: var(--rule); border: none; }
.data-row { display: flex; flex-direction: column; gap: 0.7rem; }
.data-item label { display: block; font-size: 0.7rem; font-weight: 500; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-faint); margin-bottom: 0.15rem; }
.data-item span { font-size: 0.9rem; color: var(--ink); }
.data-item a { color: var(--data-blue); text-decoration: none; font-size: 0.9rem; }
.data-item a:hover { text-decoration: underline; }
.skills-block h4 { font-size: 0.7rem; font-weight: 500; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-faint); margin-bottom: 0.65rem; }
.skill-tags { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.skill-tag { font-size: 0.8rem; padding: 0.18rem 0.5rem; border: 1px solid var(--rule); border-radius: 2px; color: var(--tag-color); background: var(--tag-bg); font-weight: 400; }
.skill-tag.primary { background: var(--accent-light); border-color: var(--accent); color: var(--accent); font-weight: 500; }

/* MAIN */
main { flex: 1; max-width: 820px; padding: 3rem 3.5rem; }

/* HERO */
.hero { padding-bottom: 2.75rem; border-bottom: 1px solid var(--rule); margin-bottom: 2.75rem; }
.hero-eyebrow {
  font-size: 0.75rem; font-weight: 500; letter-spacing: 0.15em; text-transform: uppercase;
  color: var(--accent); margin-bottom: 0.9rem;
  display: flex; align-items: center; gap: 0.5rem;
}
.hero-eyebrow::before { content: ''; display: inline-block; width: 22px; height: 1px; background: var(--accent); }
.hero-heading { font-family: 'Playfair Display', serif; font-size: 2.9rem; font-weight: 500; line-height: 1.1; letter-spacing: -0.01em; margin-bottom: 1.25rem; color: var(--ink); }
.hero-heading span { color: var(--accent); }
.hero-lead { font-size: 1.1rem; line-height: 1.8; color: var(--ink-muted); max-width: 580px; }

/* SECTION */
.section { margin-bottom: 2.75rem; }
.section-header { display: flex; align-items: baseline; gap: 1rem; margin-bottom: 1.35rem; padding-bottom: 0.65rem; border-bottom: 1px solid var(--rule); }
.section-title { font-family: 'Playfair Display', serif; font-size: 1.2rem; font-weight: 500; color: var(--ink); }
.section-count { font-size: 0.75rem; color: var(--ink-faint); }

/* STATS GRID */
.card-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 1px; background: var(--rule); border: 1px solid var(--rule); }
.card { background: var(--card-bg); padding: 1.3rem 1.2rem; transition: background 0.25s; }
.card-label { font-size: 0.7rem; font-weight: 500; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-faint); margin-bottom: 0.4rem; }
.card-value { font-family: 'Playfair Display', serif; font-size: 1.35rem; font-weight: 400; color: var(--ink); line-height: 1; margin-bottom: 0.25rem; }
.card-sub { font-size: 0.85rem; color: var(--ink-muted); }

/* PROSE */
.prose p { font-size: 1rem; line-height: 1.85; color: var(--prose-color); margin-bottom: 0.9rem; }
.prose p:last-child { margin-bottom: 0; }

/* DISCIPLINES */
.discipline-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--rule); border: 1px solid var(--rule); }
.discipline-cell { background: var(--card-bg); padding: 0.9rem 1.1rem; font-size: 0.95rem; color: var(--ink-muted); display: flex; align-items: center; gap: 0.5rem; transition: background 0.25s; }
.discipline-cell::before { content: ''; width: 4px; height: 4px; background: var(--accent); border-radius: 50%; flex-shrink: 0; }

/* PROJECTS */
.project-cards { display: flex; flex-direction: column; gap: 1px; background: var(--rule); border: 1px solid var(--rule); }
.project-card { background: var(--card-bg); padding: 1.35rem 1.5rem; transition: background 0.25s; }
.project-card-header { display: flex; align-items: baseline; gap: 0.75rem; margin-bottom: 0.5rem; flex-wrap: wrap; }
.project-card-name { font-size: 1rem; font-weight: 500; color: var(--ink); }
.project-card-tag { font-size: 0.7rem; font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent); background: var(--accent-light); padding: 0.12rem 0.4rem; border-radius: 2px; }
.project-card-desc { font-size: 0.95rem; color: var(--ink-muted); line-height: 1.65; }
.project-card-link { display: inline-flex; align-items: center; gap: 0.3rem; font-size: 0.8rem; font-weight: 500; letter-spacing: 0.06em; text-transform: uppercase; color: var(--data-blue); text-decoration: none; margin-top: 0.65rem; transition: gap 0.2s; }
.project-card-link:hover { gap: 0.5rem; }
.project-placeholder { background: var(--card-bg); padding: 1.35rem 1.5rem; transition: background 0.25s; }
.project-placeholder-inner { border: 1px dashed var(--rule); padding: 1rem 1.25rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.placeholder-label { font-size: 0.9rem; color: var(--ink-faint); font-style: italic; }
.placeholder-badge { font-size: 0.7rem; font-weight: 500; text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-faint); background: var(--tag-bg); padding: 0.12rem 0.4rem; border-radius: 2px; white-space: nowrap; }

/* ACCORDION */
.accordion-item { border-bottom: 1px solid var(--rule); }
.accordion-btn { width: 100%; background: none; border: none; padding: 1rem 0; display: flex; align-items: center; justify-content: space-between; cursor: pointer; text-align: left; }
.accordion-btn-label { font-size: 0.98rem; font-weight: 500; color: var(--ink); }
.accordion-icon { width: 18px; height: 18px; border: 1px solid var(--rule); border-radius: 50%; display: flex; align-items: center; justify-content: center; flex-shrink: 0; color: var(--ink-muted); font-size: 0.85rem; transition: border-color 0.2s; }
.accordion-btn:hover .accordion-icon { border-color: var(--accent); }
.accordion-body { overflow: hidden; max-height: 0; transition: max-height 0.35s ease; }
.accordion-body.open { max-height: 700px; }
.accordion-body-inner { padding-bottom: 1.1rem; }
.accordion-body-inner ul { list-style: none; display: flex; flex-direction: column; gap: 0.55rem; }
.accordion-body-inner li { font-size: 0.95rem; color: var(--ink-muted); padding-left: 1.1rem; position: relative; line-height: 1.6; }
.accordion-body-inner li::before { content: '—'; position: absolute; left: 0; color: var(--accent); font-size: 0.8rem; }
.accordion-body-inner p { font-size: 0.95rem; color: var(--ink-muted); line-height: 1.75; }

/* PRINCIPLES */
.principles { display: flex; flex-direction: column; }
.principle-row { display: flex; gap: 1.25rem; padding: 0.85rem 0; border-bottom: 1px solid var(--rule); align-items: flex-start; }
.principle-label { font-size: 0.95rem; font-weight: 500; color: var(--ink); min-width: 185px; flex-shrink: 0; }
.principle-desc { font-size: 0.95rem; color: var(--ink-muted); line-height: 1.6; }

/* PHILOSOPHY */
.philosophy-block { border-left: 3px solid var(--accent); padding: 1.1rem 1.5rem; background: var(--accent-light); margin-top: 0.5rem; transition: background 0.25s; }
.philosophy-block p { font-size: 1rem; line-height: 1.8; color: var(--prose-color); font-style: italic; }

/* CONTACT */
.contact-simple { display: flex; align-items: center; gap: 1.5rem; padding: 1.5rem; background: var(--card-bg); border: 1px solid var(--rule); transition: background 0.25s; }
.contact-email-icon { width: 40px; height: 40px; border-radius: 50%; background: var(--accent-light); display: flex; align-items: center; justify-content: center; flex-shrink: 0; font-size: 1rem; }
.contact-email-label { font-size: 0.7rem; font-weight: 500; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-faint); margin-bottom: 0.2rem; }
.contact-email-addr { font-size: 1.05rem; color: var(--data-blue); text-decoration: none; }
.contact-email-addr:hover { text-decoration: underline; }

/* FOOTER */
footer {display: inline-block!important; border-top: 1px solid var(--rule); margin-top: 3.5rem; padding: 1.4rem 0 0; display: flex; align-items: center; justify-content: space-between; }
footer p { font-size: 0.85rem; color: var(--ink-faint); }
.footer-links { display: flex; gap: 1.2rem; list-style: none; }
.footer-links a { font-size: 0.8rem; color: var(--ink-faint); text-decoration: none; letter-spacing: 0.05em; transition: color 0.2s; }
.footer-links a:hover { color: var(--accent); }

/* LANG VISIBILITY */
.t { display: none; }
html[data-lang="es"] .t-es { display: inline; }
html[data-lang="en"] .t-en { display: inline; }
.tb { display: none; }
html[data-lang="es"] .tb-es { display: block; }
html[data-lang="en"] .tb-en { display: block; }
.tli { display: none; }
html[data-lang="es"] .tli-es { display: list-item; }
html[data-lang="en"] .tli-en { display: list-item; }

/* RESPONSIVE */
@media (max-width: 960px) { .card-grid { grid-template-columns: 1fr 1fr; } main { padding: 2rem 2rem; } .nav-p { display: none; }}
@media (max-width: 820px) {
  .page-wrapper { flex-direction: column; }
  aside { width: 100%; position: static; height: auto; border-right: none; border-bottom: 1px solid var(--rule); }
  main { padding: 2rem 1.5rem; max-width: 100%; }
  .hero-heading { font-size: 2.2rem; }
  .principle-row { flex-direction: column; gap: 0.3rem; }
  .discipline-grid { grid-template-columns: 1fr; }
  
}
@media (max-width: 560px) {
  .nav-links { display: none; }
  nav { padding: 0 1rem; }
  main { padding: 1.5rem 1rem; }
  .card-grid { grid-template-columns: 1fr 1fr; }
}


