:root {
  --bg: #0a0a09;
  --bg-2: #11110e;
  --paper: #eee6d8;
  --ink: #10100d;
  --muted: #9b9385;
  --line: rgba(238, 230, 216, 0.16);
  --line-dark: rgba(16, 16, 13, 0.15);
  --gold: #c7a057;
  --green: #35483d;
  --rust: #8d4f3d;
  --white: #fff8ea;
  --max: 1180px;
  --header: 76px;
  --mouse-x: 50vw;
  --mouse-y: 50vh;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--white);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
  overflow-x: hidden;
}

body.menu-open {
  overflow: hidden;
}

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

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea {
  font: inherit;
}

.skip-link,
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

.skip-link:focus {
  z-index: 999;
  width: auto;
  height: auto;
  margin: 1rem;
  padding: 0.75rem 1rem;
  clip: auto;
  background: var(--gold);
  color: var(--ink);
}

.wrap {
  width: min(calc(100% - 40px), var(--max));
  margin: 0 auto;
}

.cursor-light {
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background: radial-gradient(circle at var(--mouse-x) var(--mouse-y), rgba(199, 160, 87, 0.18), transparent 28rem);
}

.visual-system {
  position: fixed;
  inset: 0;
  z-index: -3;
  pointer-events: none;
  background:
    linear-gradient(rgba(238, 230, 216, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(238, 230, 216, 0.05) 1px, transparent 1px),
    radial-gradient(circle at 70% 12%, rgba(53, 72, 61, 0.45), transparent 34rem),
    linear-gradient(135deg, var(--bg), #15110f 58%, #0f1713);
  background-size: 72px 72px, 72px 72px, auto, auto;
}

.visual-system span {
  position: absolute;
  border: 1px solid rgba(238, 230, 216, 0.16);
  animation: drift 18s ease-in-out infinite;
}

.visual-system span:nth-child(1) {
  width: 28vw;
  height: 28vw;
  top: 14vh;
  right: -8vw;
  transform: rotate(12deg);
}

.visual-system span:nth-child(2) {
  width: 18vw;
  height: 42vw;
  bottom: -18vw;
  left: 8vw;
  transform: rotate(-18deg);
  animation-delay: -6s;
}

.visual-system span:nth-child(3) {
  width: 1px;
  height: 80vh;
  top: 10vh;
  left: 50%;
  background: rgba(199, 160, 87, 0.2);
  animation-delay: -10s;
}

.visual-system span:nth-child(4) {
  width: 44vw;
  height: 1px;
  top: 62vh;
  right: 8vw;
  background: rgba(199, 160, 87, 0.18);
  animation-delay: -3s;
}

@keyframes drift {
  0%,
  100% {
    translate: 0 0;
  }
  50% {
    translate: 18px -16px;
  }
}

.site-header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 100;
  height: var(--header);
  transition: background 220ms ease, border-color 220ms ease, backdrop-filter 220ms ease;
}

.site-header.is-scrolled {
  background: rgba(10, 10, 9, 0.86);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(18px);
}

.nav {
  width: min(calc(100% - 32px), 1360px);
  height: 100%;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 1.1rem;
}

.brand {
  width: 156px;
  flex: 0 0 auto;
}

.brand img,
.footer img,
.portrait-placeholder img {
  filter: invert(1);
}

.menu {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 1.35rem;
  color: rgba(255, 248, 234, 0.72);
  font-size: 0.78rem;
  font-weight: 820;
  text-transform: uppercase;
}

.menu a:hover,
.menu a:focus-visible {
  color: var(--white);
}

.nav-tools {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.language-switch {
  display: grid;
  grid-template-columns: repeat(2, 42px);
  border: 1px solid rgba(255, 248, 234, 0.24);
}

.language-switch button,
.menu-toggle {
  border: 0;
  background: transparent;
  color: rgba(255, 248, 234, 0.74);
  cursor: pointer;
}

.language-switch button {
  min-height: 38px;
  font-weight: 860;
}

.language-switch button.is-active {
  background: var(--white);
  color: var(--ink);
}

.nav-cta,
.button {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  padding: 0.82rem 1rem;
  font-size: 0.79rem;
  font-weight: 860;
  text-transform: uppercase;
  cursor: pointer;
}

.nav-cta {
  border-color: rgba(255, 248, 234, 0.24);
  color: var(--white);
}

.button:hover,
.button:focus-visible,
.nav-cta:hover,
.nav-cta:focus-visible,
.social-rail a:hover,
.social-rail a:focus-visible {
  transform: translateY(-1px);
}

.primary {
  background: var(--gold);
  border-color: var(--gold);
  color: var(--ink);
}

.secondary {
  background: var(--white);
  border-color: var(--white);
  color: var(--ink);
}

.ghost {
  border-color: rgba(255, 248, 234, 0.28);
  color: var(--white);
}

.secondary-dark {
  border-color: rgba(16, 16, 13, 0.38);
  color: var(--ink);
}

.menu-toggle {
  display: none;
  width: 44px;
  height: 44px;
  margin-left: auto;
  border: 1px solid rgba(255, 248, 234, 0.24);
}

.menu-toggle span:not(.sr-only) {
  display: block;
  width: 18px;
  height: 1px;
  margin: 5px auto;
  background: var(--white);
}

.social-rail {
  position: fixed;
  z-index: 50;
  left: 22px;
  bottom: 26px;
  display: grid;
  gap: 0.5rem;
}

.social-rail a,
.floating-whatsapp {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 248, 234, 0.18);
  background: rgba(10, 10, 9, 0.62);
  color: var(--white);
  font-size: 0.72rem;
  font-weight: 900;
  backdrop-filter: blur(16px);
}

.floating-whatsapp {
  position: fixed;
  z-index: 80;
  right: 20px;
  bottom: 22px;
  background: var(--gold);
  color: var(--ink);
}

.hero {
  min-height: 100svh;
  display: grid;
  align-items: center;
  padding: 130px 0 74px;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 390px;
  gap: 5rem;
  align-items: center;
}

.kicker {
  margin: 0 0 1rem;
  color: var(--gold);
  font-size: 0.75rem;
  font-weight: 900;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 400;
  letter-spacing: 0;
}

h1 {
  margin: 0;
  max-width: 920px;
  font-size: clamp(4rem, 11vw, 10rem);
  line-height: 0.83;
}

h2 {
  margin: 0;
  font-size: clamp(2.25rem, 5.4vw, 5.15rem);
  line-height: 0.97;
}

h3 {
  margin: 0;
  font-size: clamp(2rem, 4vw, 4rem);
  line-height: 0.98;
}

.role {
  margin: 1.2rem 0 0;
  color: rgba(255, 248, 234, 0.9);
  font-size: clamp(1rem, 2vw, 1.5rem);
}

.lead {
  max-width: 680px;
  margin: 1.2rem 0 0;
  color: rgba(255, 248, 234, 0.72);
  font-size: clamp(1rem, 1.4vw, 1.2rem);
}

.hero-actions,
.contact-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 2rem;
}

.portrait-card {
  position: relative;
}

.portrait-card::before {
  content: "";
  position: absolute;
  inset: -18px;
  border: 1px solid rgba(255, 248, 234, 0.16);
  transform: rotate(3deg);
}

.portrait-placeholder {
  position: relative;
  min-height: 520px;
  display: grid;
  place-items: center;
  padding: 2rem;
  border: 1px solid rgba(255, 248, 234, 0.2);
  background:
    linear-gradient(135deg, rgba(199, 160, 87, 0.2), transparent 35%),
    repeating-linear-gradient(90deg, rgba(255, 248, 234, 0.08) 0 1px, transparent 1px 22px),
    rgba(255, 248, 234, 0.04);
}

.portrait-placeholder img {
  width: 250px;
  opacity: 0.75;
}

.portrait-placeholder span {
  position: absolute;
  left: 1rem;
  bottom: 1rem;
  color: rgba(255, 248, 234, 0.56);
  font-size: 0.75rem;
  font-weight: 860;
  text-transform: uppercase;
}

.quick-stats {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border: 1px solid rgba(255, 248, 234, 0.16);
  background: rgba(10, 10, 9, 0.7);
}

.quick-stats span {
  padding: 1rem;
  border-right: 1px solid rgba(255, 248, 234, 0.12);
}

.quick-stats span:last-child {
  border-right: 0;
}

.quick-stats strong {
  display: block;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 2rem;
  font-weight: 400;
}

.quick-stats small {
  color: rgba(255, 248, 234, 0.58);
  font-size: 0.7rem;
  font-weight: 900;
  text-transform: uppercase;
}

.profile-section,
.topics-section {
  padding: 110px 0;
  background: var(--paper);
  color: var(--ink);
}

.profile-grid,
.projects-grid,
.contact-grid {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 4.5rem;
  align-items: start;
}

.profile-copy {
  border-left: 1px solid var(--line-dark);
  padding-left: 2rem;
  font-size: 1.06rem;
}

.profile-copy p {
  color: #5f594f;
}

.engage-section,
.projects-section {
  padding: 110px 0;
  background: var(--bg-2);
}

.section-title.compact {
  max-width: 720px;
  margin-bottom: 2rem;
}

.engage-tabs {
  display: grid;
  grid-template-columns: 0.82fr 1.18fr;
  border: 1px solid var(--line);
}

.tab-list {
  display: grid;
  border-right: 1px solid var(--line);
}

.tab-list button {
  display: grid;
  grid-template-columns: 52px 1fr;
  align-items: center;
  min-height: 118px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: rgba(255, 248, 234, 0.62);
  text-align: left;
  cursor: pointer;
}

.tab-list button:last-child {
  border-bottom: 0;
}

.tab-list button.is-active {
  background: rgba(255, 248, 234, 0.06);
  color: var(--white);
}

.tab-list span {
  color: var(--gold);
  justify-self: center;
  font-size: 0.78rem;
  font-weight: 900;
}

.tab-list strong {
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.55rem, 3vw, 2.7rem);
  font-weight: 400;
}

.tab-panels {
  position: relative;
  min-height: 472px;
}

.tab-panel {
  position: absolute;
  inset: 0;
  display: grid;
  align-content: center;
  gap: 1.2rem;
  padding: clamp(1.5rem, 4vw, 4rem);
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: opacity 220ms ease, transform 220ms ease;
}

.tab-panel.is-active {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.tab-panel p {
  max-width: 680px;
  margin: 0;
  color: rgba(255, 248, 234, 0.68);
  font-size: 1.05rem;
}

.tab-panel a {
  justify-self: start;
  color: var(--gold);
  font-weight: 900;
  text-transform: uppercase;
  font-size: 0.82rem;
}

.topic-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
}

.topic-cloud span {
  border: 1px solid var(--line-dark);
  padding: 0.88rem 1rem;
  color: #504a42;
  font-size: clamp(1rem, 2vw, 1.8rem);
  font-family: Georgia, "Times New Roman", serif;
  background: rgba(255, 255, 255, 0.24);
}

.project-list {
  display: grid;
  border-top: 1px solid var(--line);
}

.project-list a {
  min-height: 86px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 1rem;
  align-items: center;
  border-bottom: 1px solid var(--line);
}

.project-list strong {
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.45rem, 3vw, 2.5rem);
  font-weight: 400;
}

.project-list span {
  color: rgba(255, 248, 234, 0.56);
  font-size: 0.75rem;
  font-weight: 900;
  text-transform: uppercase;
}

.contact-section {
  padding: 110px 0;
  background: var(--paper);
  color: var(--ink);
}

.contact-section p {
  color: #5f594f;
  font-size: 1.04rem;
}

.contact-form {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  padding: 1rem;
  border: 1px solid var(--line-dark);
  background: rgba(255, 255, 255, 0.25);
}

.contact-form label {
  display: grid;
  gap: 0.4rem;
}

.contact-form span {
  color: #625b51;
  font-size: 0.76rem;
  font-weight: 900;
  text-transform: uppercase;
}

.contact-form input,
.contact-form select,
.contact-form textarea {
  width: 100%;
  border: 1px solid rgba(16, 16, 13, 0.22);
  background: rgba(255, 255, 255, 0.45);
  color: var(--ink);
  padding: 0.9rem;
  outline: none;
}

.contact-form input:focus,
.contact-form select:focus,
.contact-form textarea:focus {
  border-color: var(--gold);
}

.wide {
  grid-column: 1 / -1;
}

.footer {
  padding: 56px 0;
  background: var(--bg);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
}

.footer img {
  width: 220px;
  margin-bottom: 1rem;
}

.footer p,
.footer a {
  color: rgba(255, 248, 234, 0.66);
}

.footer-links {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.8rem 1.4rem;
}

.lang-es,
html[lang="es"] .lang-en {
  display: none;
}

html[lang="es"] .lang-es {
  display: inline;
}

@media (max-width: 980px) {
  .menu-toggle {
    display: block;
  }

  .menu {
    position: fixed;
    inset: var(--header) 0 auto;
    display: none;
    margin: 0;
    padding: 1rem 20px 1.4rem;
    background: rgba(10, 10, 9, 0.97);
    border-top: 1px solid var(--line);
  }

  .menu.is-open {
    display: grid;
  }

  .nav-cta,
  .social-rail {
    display: none;
  }

  .hero-grid,
  .profile-grid,
  .projects-grid,
  .contact-grid,
  .footer-grid {
    grid-template-columns: 1fr;
  }

  .portrait-card {
    max-width: 460px;
  }

  .profile-copy {
    border-left: 0;
    padding-left: 0;
  }

  .engage-tabs {
    grid-template-columns: 1fr;
  }

  .tab-list {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
}

@media (max-width: 640px) {
  :root {
    --header: 68px;
  }

  .wrap {
    width: min(calc(100% - 28px), var(--max));
  }

  .brand {
    width: 132px;
  }

  .hero {
    padding: 112px 0 64px;
  }

  h1 {
    font-size: clamp(3.4rem, 18vw, 5.4rem);
  }

  .hero-grid {
    gap: 3rem;
  }

  .hero-actions,
  .contact-buttons {
    display: grid;
  }

  .button {
    width: 100%;
  }

  .portrait-placeholder {
    min-height: 360px;
  }

  .quick-stats,
  .contact-form,
  .footer-links {
    grid-template-columns: 1fr;
  }

  .quick-stats span {
    border-right: 0;
    border-bottom: 1px solid rgba(255, 248, 234, 0.12);
  }

  .profile-section,
  .engage-section,
  .topics-section,
  .projects-section,
  .contact-section {
    padding: 76px 0;
  }

  .tab-list button {
    min-height: 94px;
  }

  .tab-panels {
    min-height: 500px;
  }

  .project-list a {
    grid-template-columns: 1fr;
    gap: 0.2rem;
    padding: 1rem 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition: none !important;
    animation: none !important;
  }
}
