:root {
  color-scheme: light;
  --bg: #f7f4ec;
  --surface: #ffffff;
  --surface-2: #ece8dc;
  --ink: #141a22;
  --muted: #5f6966;
  --line: rgba(31, 44, 48, 0.15);
  --accent: #d94f24;
  --accent-2: #0f766e;
  --accent-3: #315d8c;
  --shadow: 0 24px 70px rgba(30, 42, 46, 0.12);
  --header: rgba(246, 247, 242, 0.84);
  --header-solid: #f6f7f2;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0f1718;
  --surface: #172122;
  --surface-2: #22302e;
  --ink: #f5f0e8;
  --muted: #aeb9b4;
  --line: rgba(227, 238, 230, 0.16);
  --accent: #ff6d35;
  --accent-2: #67d4c6;
  --accent-3: #9bbcf0;
  --shadow: 0 28px 90px rgba(0, 0, 0, 0.32);
  --header: rgba(15, 23, 24, 0.84);
  --header-solid: #0f1718;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0f1718;
    --surface: #172122;
    --surface-2: #22302e;
    --ink: #f5f0e8;
    --muted: #aeb9b4;
    --line: rgba(227, 238, 230, 0.16);
    --accent: #ff6d35;
    --accent-2: #67d4c6;
    --accent-3: #9bbcf0;
    --shadow: 0 28px 90px rgba(0, 0, 0, 0.32);
    --header: rgba(15, 23, 24, 0.84);
    --header-solid: #0f1718;
  }
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at 84% 8%, color-mix(in srgb, var(--accent) 11%, transparent) 0 260px, transparent 520px),
    radial-gradient(circle at 12% 20%, color-mix(in srgb, var(--accent-2) 11%, transparent) 0 220px, transparent 480px),
    linear-gradient(
      180deg,
      var(--bg) 0%,
      color-mix(in srgb, var(--bg) 86%, var(--surface-2)) 58%,
      var(--bg) 100%
    );
  color: var(--ink);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.55;
}

a {
  color: inherit;
  text-underline-offset: 0.18em;
}

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

.site-header,
.section,
.site-footer {
  width: min(1160px, calc(100% - 40px));
  margin-inline: auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  width: 100%;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 24px;
  margin-inline: 0;
  padding: 12px max(20px, calc((100vw - 1160px) / 2));
  border-bottom: 1px solid var(--line);
  background:
    linear-gradient(90deg, var(--header-solid), var(--header), var(--header-solid)),
    var(--header-solid);
  backdrop-filter: blur(18px);
}

.brand,
.nav,
.actions,
.header-actions,
.tag-list,
.site-footer nav {
  display: flex;
  align-items: center;
}

.brand {
  gap: 10px;
  font-weight: 800;
  text-decoration: none;
}

.brand img {
  width: 40px;
  height: 40px;
  border-radius: 10px;
}

.nav {
  justify-content: center;
  gap: 16px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 720;
}

.nav a,
.site-footer a {
  text-decoration: none;
}

.header-actions {
  justify-content: flex-end;
  gap: 10px;
}

.theme-toggle,
.language-toggle,
.button {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-weight: 760;
  cursor: pointer;
}

.theme-toggle,
.language-toggle {
  width: 42px;
  min-height: 42px;
  display: inline-grid;
  place-items: center;
  padding: 0;
}

.language-toggle {
  font-size: 0.88rem;
  letter-spacing: 0;
}

.theme-symbol {
  font-size: 1.12rem;
  line-height: 1;
}

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

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 18px;
  text-decoration: none;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
}

.button:hover,
.language-toggle:hover,
.theme-toggle:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.button.primary {
  border-color: var(--accent);
  background: var(--accent);
  color: #fffaf0;
  box-shadow: 0 14px 34px color-mix(in srgb, var(--accent) 28%, transparent);
}

.button.primary:hover {
  color: #fffaf0;
  filter: brightness(1.04);
}

.button.compact {
  min-height: 38px;
  padding-inline: 14px;
}

.section {
  padding: 70px 0;
}

.hero {
  min-height: min(690px, calc(100vh - 70px));
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(330px, 0.58fr);
  align-items: center;
  gap: 52px;
  padding-top: 44px;
}

.kicker {
  margin: 0 0 16px;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 850;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 820px;
  margin-bottom: 20px;
  font-size: clamp(3.4rem, 7vw, 6.4rem);
  line-height: 0.93;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 18px;
  font-size: clamp(2.1rem, 4.2vw, 4.5rem);
  line-height: 0.98;
  letter-spacing: 0;
}

h3 {
  margin-bottom: 10px;
  font-size: 1.22rem;
  line-height: 1.18;
}

.role-line {
  max-width: 780px;
  color: var(--ink);
  font-size: clamp(1.12rem, 1.8vw, 1.45rem);
  font-weight: 760;
}

.role-line .role-sub {
  display: block;
  color: var(--accent);
}

.role-line .role-main {
  color: var(--ink);
}

.lead {
  max-width: 720px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: clamp(1.08rem, 1.5vw, 1.28rem);
}

.actions {
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 30px;
}

.actions .button {
  min-width: 160px;
}

.profile-card,
.body-card,
.timeline-card,
.skills-grid article,
.contact-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  background:
    linear-gradient(145deg, color-mix(in srgb, var(--surface) 92%, transparent), color-mix(in srgb, var(--surface-2) 70%, transparent)),
    var(--surface);
  box-shadow: var(--shadow);
}

.profile-card {
  padding: 24px;
}

.profile-mark {
  width: 172px;
  height: 172px;
  display: grid;
  place-items: center;
  margin-bottom: 28px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: color-mix(in srgb, var(--surface) 72%, transparent);
  overflow: hidden;
}

.profile-mark img {
  width: 160px;
  height: 160px;
  border-radius: 20px;
  object-fit: cover;
  object-position: center;
}

dl,
dd {
  margin: 0;
}

.profile-card dl {
  display: grid;
  gap: 18px;
}

.profile-card dt,
.timeline-meta span {
  margin-bottom: 5px;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 850;
  text-transform: uppercase;
}

.profile-card dd,
.body-card p,
.timeline-card p,
.skills-grid li,
.contact-section p {
  color: var(--muted);
}

.profile-card dd {
  font-weight: 700;
}

.split-section,
.contact-section {
  display: grid;
  grid-template-columns: minmax(260px, 0.52fr) minmax(0, 1fr);
  gap: 46px;
  align-items: start;
}

.section-heading {
  max-width: 780px;
}

.compact-heading {
  max-width: 690px;
}

.body-card {
  padding: 30px;
}

.body-card p:last-child {
  margin-bottom: 0;
}

.timeline-section,
.skills-section {
  display: grid;
  gap: 24px;
}

.timeline-card {
  display: grid;
  grid-template-columns: minmax(200px, 0.35fr) minmax(0, 1fr);
  gap: 28px;
  padding: 30px;
}

.timeline-meta {
  border-left: 3px solid var(--accent);
  padding-left: 16px;
}

.timeline-meta span,
.timeline-meta strong {
  display: block;
}

.timeline-meta strong {
  color: var(--ink);
}

.tag-list {
  flex-wrap: wrap;
  gap: 9px;
  margin: 20px 0 0;
  padding: 0;
  list-style: none;
}

.tag-list li {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 10px;
  color: var(--muted);
  background: color-mix(in srgb, var(--surface) 78%, transparent);
  font-size: 0.92rem;
  font-weight: 700;
}

.skills-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.skills-grid article {
  padding: 24px;
}

.skills-grid ul {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.skills-grid li::before {
  content: "✓";
  margin-right: 8px;
  color: var(--accent);
  font-weight: 900;
}

.contact-card {
  display: grid;
  gap: 10px;
  padding: 24px;
}

.contact-card a {
  display: block;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 13px 14px;
  color: var(--ink);
  text-decoration: none;
  font-weight: 760;
}

.contact-card a:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 40px 0 52px;
  color: var(--muted);
}

.site-footer nav {
  gap: 16px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.print-cv,
.language-panel[data-lang-content="es"] {
  display: none;
}

.cv-intro {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(260px, 0.42fr);
  gap: 36px;
  align-items: end;
  padding-bottom: 32px;
}

.cv-intro h1 {
  margin-bottom: 0;
}

.cv-intro p:last-child {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 1.1rem;
  font-weight: 650;
}

.cv-page .print-cv {
  display: block;
  width: min(820px, calc(100% - 40px));
  margin: 0 auto 80px;
  padding: 52px 58px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: #000;
  box-shadow: var(--shadow);
  font-family: "Times New Roman", Times, serif;
  font-size: 10.8pt;
  line-height: 1.28;
}

.cv-page .language-panel[data-lang-content="es"] {
  display: none;
}

:root[data-lang="es"] .language-panel[data-lang-content="en"] {
  display: none;
}

:root[data-lang="es"] .language-panel[data-lang-content="es"] {
  display: block;
}

.print-header {
  text-align: center;
  margin-bottom: 10pt;
}

.print-header h1 {
  margin: 0 0 2pt;
  max-width: none;
  color: #000;
  font-family: "Times New Roman", Times, serif;
  font-size: 20pt;
  font-weight: 700;
  line-height: 1;
  text-align: center;
  text-transform: uppercase;
}

.print-header p {
  margin: 0;
}

.print-contact {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0;
  font-size: 9.2pt;
}

.print-contact > *::after {
  content: "|";
  display: inline-block;
  margin: 0 6pt;
}

.print-contact > *:last-child::after {
  content: "";
  margin: 0;
}

.print-section {
  margin-top: 8.5pt;
  break-inside: avoid;
}

.print-section h2 {
  margin: 0 0 4pt;
  max-width: none;
  border-bottom: 0.75pt solid #000;
  color: #000;
  font-family: "Times New Roman", Times, serif;
  font-size: 10.8pt;
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1.1;
  text-transform: uppercase;
}

.print-section h3 {
  margin: 0;
  color: #000;
  font-family: "Times New Roman", Times, serif;
  font-size: 10.4pt;
  font-weight: 700;
  line-height: 1.15;
}

.print-section p {
  margin: 0 0 2pt;
  color: #000;
}

.print-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12pt;
  align-items: baseline;
}

.print-date {
  color: #000;
  font-style: italic;
  text-align: right;
  white-space: nowrap;
}

.print-cv ul {
  margin: 3pt 0 0 14pt;
  padding: 0;
}

.print-cv li {
  margin: 1.5pt 0;
  padding-left: 1pt;
}

.print-skills p {
  margin-bottom: 2.5pt;
}

@media (max-width: 900px) {
  .site-header {
    grid-template-columns: 1fr auto;
  }

  .nav {
    display: none;
  }

  .hero,
  .split-section,
  .contact-section,
  .cv-intro,
  .timeline-card {
    grid-template-columns: 1fr;
  }

  .skills-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .section,
  .site-footer {
    width: min(100% - 28px, 1160px);
  }

  .brand span,
  .button.compact {
    display: none;
  }

  .section {
    padding: 60px 0;
  }

  h1 {
    font-size: 3.35rem;
  }

  .actions .button {
    width: 100%;
  }

  .skills-grid {
    grid-template-columns: 1fr;
  }

  .site-footer {
    flex-direction: column;
  }

  .site-footer nav {
    justify-content: flex-start;
  }

  .cv-page .print-cv {
    width: min(100% - 28px, 820px);
    padding: 30px 24px;
  }
}

@media print {
  @page {
    size: A4;
    margin: 15mm 17mm;
  }

  body > :not(.print-cv) {
    display: none !important;
  }

  html,
  body {
    background: #fff;
    color: #000;
    font-family: "Times New Roman", Times, serif;
    font-size: 10.2pt;
    line-height: 1.24;
  }

  a {
    color: #000;
    text-decoration: none;
  }

  .print-cv {
    display: none;
    width: 100%;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .print-cv[data-lang-content="en"] {
    display: block;
  }

  :root[data-lang="es"] .print-cv[data-lang-content="en"] {
    display: none;
  }

  :root[data-lang="es"] .print-cv[data-lang-content="es"] {
    display: block;
  }

  .print-header {
    text-align: center;
    margin-bottom: 10pt;
  }

  .print-header h1 {
    margin: 0 0 2pt;
    max-width: none;
    color: #000;
    font-family: "Times New Roman", Times, serif;
    font-size: 20pt;
    font-weight: 700;
    line-height: 1;
    text-align: center;
    text-transform: uppercase;
  }

  .print-header p {
    margin: 0;
  }

  .print-contact {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0;
    font-size: 9.2pt;
  }

  .print-contact > *::after {
    content: "|";
    display: inline-block;
    margin: 0 6pt;
  }

  .print-contact > *:last-child::after {
    content: "";
    margin: 0;
  }

  .print-section {
    margin-top: 8.5pt;
    break-inside: avoid;
  }

  .print-section h2 {
    margin: 0 0 4pt;
    max-width: none;
    border-bottom: 0.75pt solid #000;
    color: #000;
    font-family: "Times New Roman", Times, serif;
    font-size: 10.8pt;
    font-weight: 700;
    letter-spacing: 0.04em;
    line-height: 1.1;
    text-transform: uppercase;
  }

  .print-section h3 {
    margin: 0;
    color: #000;
    font-family: "Times New Roman", Times, serif;
    font-size: 10.4pt;
    font-weight: 700;
    line-height: 1.15;
  }

  .print-section p {
    margin: 0 0 2pt;
    color: #000;
  }

  .print-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12pt;
    align-items: baseline;
  }

  .print-date {
    color: #000;
    font-style: italic;
    text-align: right;
    white-space: nowrap;
  }

  .print-cv ul {
    margin: 3pt 0 0 14pt;
    padding: 0;
  }

  .print-cv li {
    margin: 1.5pt 0;
    padding-left: 1pt;
  }

  .print-skills p {
    margin-bottom: 2.5pt;
  }
}
