/* Gabriel Arnau Vendrell — portafolio
   Tokens: papel claro, tinta azul marino, un único acento verde. */

@font-face {
  font-family: "IBM Plex Sans";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/ibm-plex-sans-latin-400-normal.woff2") format("woff2");
}
@font-face {
  font-family: "IBM Plex Sans";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("fonts/ibm-plex-sans-latin-500-normal.woff2") format("woff2");
}
@font-face {
  font-family: "IBM Plex Sans";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("fonts/ibm-plex-sans-latin-600-normal.woff2") format("woff2");
}
@font-face {
  font-family: "IBM Plex Serif";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("fonts/ibm-plex-serif-latin-500-normal.woff2") format("woff2");
}

:root {
  --paper: #f7f8fa;
  --surface: #ffffff;
  --ink: #102a43;
  --ink-2: #486581;
  --ink-3: #627d98;
  --rule: #d9e2ec;
  --rule-strong: #bcccdc;
  --accent: #0e7c66;
  --accent-strong: #0a5e4d;
  --accent-tint: #e3f1ec;
  --tint: #edf1f6;
  --warn: #c24e3a;
  --warn-tint: #f8e3df;

  --font-sans: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-serif: "IBM Plex Serif", Georgia, "Times New Roman", serif;

  --container: 1120px;
  --gutter: clamp(20px, 5vw, 40px);
  --header-h: 64px;
  --radius: 8px;
  --shadow-lift: 0 18px 36px -18px rgba(16, 42, 67, 0.35);
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 16px);
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 1.0625rem;
  line-height: 1.6;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

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

h1,
h2,
h3,
p,
ul,
ol,
dl,
dd,
figure {
  margin: 0;
}

ul[role="list"],
ol[role="list"] {
  list-style: none;
  padding: 0;
}

a {
  color: var(--accent-strong);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

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

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: 16px;
  top: -100px;
  z-index: 100;
  padding: 10px 16px;
  background: var(--ink);
  color: #fff;
  border-radius: 6px;
  text-decoration: none;
  font-weight: 500;
}

.skip-link:focus {
  top: 12px;
  color: #fff;
}

.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* ---------- Barra de progreso ---------- */

.progress {
  position: fixed;
  inset: 0 0 auto 0;
  height: 3px;
  z-index: 60;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: 0 50%;
  pointer-events: none;
}

/* ---------- Cabecera ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(247, 248, 250, 0.88);
  -webkit-backdrop-filter: saturate(160%) blur(10px);
  backdrop-filter: saturate(160%) blur(10px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease;
}

.site-header.is-scrolled {
  border-bottom-color: var(--rule);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  height: var(--header-h);
}

.wordmark {
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: 1.125rem;
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
}

.wordmark:hover {
  color: var(--ink);
}

.header-tools {
  display: flex;
  align-items: center;
  gap: 8px;
}

.site-nav ul {
  display: flex;
  gap: 4px;
}

.site-nav a {
  display: block;
  padding: 8px 12px;
  border-radius: 6px;
  color: var(--ink-2);
  font-size: 0.9375rem;
  font-weight: 500;
  text-decoration: none;
  transition: color 0.15s ease, background-color 0.15s ease;
}

.site-nav a:hover {
  color: var(--ink);
  background: var(--tint);
}

.site-nav a[aria-current] {
  color: var(--ink);
  box-shadow: inset 0 -2px 0 var(--accent);
  border-radius: 6px 6px 0 0;
}

.lang-switch {
  display: flex;
  align-items: center;
  margin-left: 8px;
  padding-left: 16px;
  border-left: 1px solid var(--rule);
  font-size: 0.875rem;
  font-weight: 500;
}

.lang-switch a,
.lang-switch span {
  padding: 6px 6px;
  line-height: 1;
}

.lang-switch a {
  color: var(--ink-3);
  text-decoration: none;
}

.lang-switch a:hover {
  color: var(--ink);
}

.lang-switch span[aria-current] {
  color: var(--ink);
  font-weight: 600;
}

.nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--rule);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
}

.nav-toggle svg {
  width: 20px;
  height: 20px;
}

.nav-toggle .icon-close {
  display: none;
}

.nav-toggle[aria-expanded="true"] .icon-open {
  display: none;
}

.nav-toggle[aria-expanded="true"] .icon-close {
  display: block;
}

@media (max-width: 899px) {
  .js .nav-toggle {
    display: inline-flex;
  }

  .js .site-nav {
    position: absolute;
    top: var(--header-h);
    left: 0;
    right: 0;
    display: none;
    background: var(--surface);
    border-bottom: 1px solid var(--rule);
    box-shadow: 0 16px 24px -20px rgba(16, 42, 67, 0.4);
  }

  .js .site-nav.is-open {
    display: block;
  }

  .js .site-nav ul {
    flex-direction: column;
    gap: 0;
    padding: 8px var(--gutter) 16px;
  }

  .js .site-nav a {
    padding: 14px 4px;
    border-bottom: 1px solid var(--rule);
    border-radius: 0;
    font-size: 1rem;
  }

  .js .site-nav li:last-child a {
    border-bottom: 0;
  }

  .js .site-nav a[aria-current] {
    box-shadow: inset 3px 0 0 var(--accent);
    padding-left: 14px;
  }

  .no-js-hide {
    display: none;
  }

  html:not(.js) .site-nav ul {
    flex-wrap: wrap;
  }

  html:not(.js) .header-inner {
    height: auto;
    padding-block: 12px;
    flex-wrap: wrap;
  }

  .lang-switch {
    margin-left: 0;
    padding-left: 0;
    border-left: 0;
  }
}

/* ---------- Botones ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 12px 22px;
  border: 1px solid transparent;
  border-radius: 6px;
  font: inherit;
  font-size: 1rem;
  font-weight: 500;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.btn svg {
  width: 18px;
  height: 18px;
  flex: none;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}

.btn-primary:hover {
  background: var(--accent-strong);
  color: #fff;
}

.btn-secondary {
  background: var(--surface);
  border-color: var(--rule-strong);
  color: var(--ink);
}

.btn-secondary:hover {
  border-color: var(--ink);
  color: var(--ink);
}

.btn-group {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

/* ---------- Hero ---------- */

.hero {
  padding-block: clamp(48px, 8vw, 104px) clamp(56px, 9vw, 112px);
}

.hero-grid {
  display: grid;
  gap: clamp(40px, 6vw, 80px);
  align-items: center;
}

@media (min-width: 900px) {
  .hero-grid {
    grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr);
  }
}

.hero-role {
  font-size: 1rem;
  font-weight: 500;
  color: var(--accent-strong);
  margin-bottom: 12px;
}

.hero h1 {
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: clamp(2.5rem, 1.6rem + 3.6vw, 4.25rem);
  line-height: 1.05;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.hero-statement {
  margin-top: clamp(24px, 3vw, 36px);
  padding-left: 20px;
  border-left: 2px solid var(--accent);
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: clamp(1.25rem, 1.05rem + 0.8vw, 1.625rem);
  line-height: 1.4;
  color: var(--ink);
  max-width: 34ch;
}

.hero-lead {
  margin-top: 20px;
  color: var(--ink-2);
  max-width: 54ch;
}

.hero .btn-group {
  margin-top: 32px;
}

.hero-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  margin-top: 20px;
  font-size: 0.9375rem;
}

.hero-links a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--ink-2);
  text-decoration: none;
}

.hero-links a:hover {
  color: var(--ink);
  text-decoration: underline;
}

.hero-links svg {
  width: 18px;
  height: 18px;
}

/* Ficha del hero: foto y cifras clave, como el resumen de un informe anual */

.profile-card {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  overflow: hidden;
  max-width: 400px;
  width: 100%;
  justify-self: center;
}

@media (min-width: 900px) {
  .profile-card {
    justify-self: end;
  }
}

.profile-card picture,
.profile-card img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  object-position: 50% 30%;
}

.profile-card img {
  height: auto;
}

.figures {
  padding: 20px 24px 22px;
  border-top: 1px solid var(--rule);
}

.figures-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 8px;
}

.figures dl > div {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding-block: 7px;
  font-size: 0.9375rem;
}

.figures dt {
  display: flex;
  flex: 1 1 auto;
  align-items: baseline;
  gap: 8px;
  color: var(--ink-2);
  white-space: nowrap;
}

.figures dt::after {
  content: "";
  flex: 1 1 auto;
  min-width: 16px;
  border-bottom: 1px dotted var(--rule-strong);
  transform: translateY(-4px);
}

.figures dd {
  font-weight: 600;
  color: var(--ink);
  text-align: right;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

/* ---------- Secciones con columna de margen ---------- */

.section {
  padding-block: clamp(64px, 9vw, 112px);
  border-top: 1px solid var(--rule);
}

.section-grid {
  display: grid;
  gap: 24px 48px;
}

@media (min-width: 900px) {
  .section-grid {
    grid-template-columns: 240px minmax(0, 1fr);
  }

  .section-head {
    position: sticky;
    top: calc(var(--header-h) + 32px);
    align-self: start;
  }
}

.section-head h2 {
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: clamp(1.75rem, 1.4rem + 1.2vw, 2.25rem);
  line-height: 1.15;
  letter-spacing: -0.01em;
}

.section-head p {
  margin-top: 12px;
  color: var(--ink-2);
  font-size: 0.9375rem;
  max-width: 32ch;
}

.prose p + p {
  margin-top: 1em;
}

.prose p {
  max-width: 66ch;
}

/* ---------- Trayectoria ---------- */

.timeline-grid {
  display: grid;
  gap: 40px 48px;
  margin-top: 56px;
}

@media (min-width: 760px) {
  .timeline-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.timeline h3 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--ink);
  padding-bottom: 12px;
  border-bottom: 2px solid var(--ink);
}

.timeline-item {
  padding-block: 20px;
  border-bottom: 1px solid var(--rule);
}

.timeline-item time,
.timeline-item .when {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--accent-strong);
  font-variant-numeric: tabular-nums;
}

.timeline-item h4 {
  margin: 4px 0 0;
  font-size: 1.0625rem;
  font-weight: 600;
  line-height: 1.35;
}

.timeline-item .where {
  color: var(--ink-2);
  font-size: 0.9375rem;
}

.timeline-item ul {
  margin-top: 10px;
  padding-left: 1.1em;
  color: var(--ink-2);
  font-size: 0.9375rem;
}

.timeline-item li + li {
  margin-top: 6px;
}

.timeline-item li::marker {
  color: var(--rule-strong);
}

/* ---------- Proyectos ---------- */

.projects {
  display: grid;
  gap: 24px;
}

.projects > li {
  display: flex;
}

.projects .project-card {
  flex: 1;
}

@media (min-width: 900px) {
  .section-grid--wide .section-head {
    display: contents;
  }

  .section-grid--wide .section-head p {
    margin-top: 0;
    align-self: end;
    max-width: 56ch;
    font-size: 1rem;
  }

  .section-grid--wide .projects {
    grid-column: 1 / -1;
    margin-top: 24px;
  }
}

@media (min-width: 1000px) {
  .projects {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.project-card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.project-card:hover,
.project-card:focus-within {
  transform: translateY(-4px);
  border-color: var(--accent);
  box-shadow: var(--shadow-lift);
}

.project-media {
  background: var(--tint);
  border-bottom: 1px solid var(--rule);
  overflow: hidden;
}

.project-media svg {
  width: 100%;
  height: auto;
  transition: transform 0.4s ease;
}

.project-card:hover .project-media svg {
  transform: scale(1.03);
}

.project-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 22px 24px 24px;
}

.project-body h3 {
  font-size: 1.1875rem;
  font-weight: 600;
  line-height: 1.3;
}

.project-body p {
  margin-top: 10px;
  color: var(--ink-2);
  font-size: 0.9688rem;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}

.tags li {
  padding: 3px 10px;
  border-radius: 4px;
  background: var(--tint);
  color: var(--ink);
  font-size: 0.8125rem;
  font-weight: 500;
}

.project-status {
  margin-top: auto;
  padding-top: 18px;
  font-size: 0.875rem;
  color: var(--ink-3);
}

@media (min-width: 620px) and (max-width: 999px) {
  .project-card {
    flex-direction: row;
  }

  .project-media {
    flex: 0 0 44%;
    border-bottom: 0;
    border-right: 1px solid var(--rule);
    display: flex;
    align-items: center;
  }
}

/* Ilustraciones */

.illu .paper {
  fill: #fff;
  stroke: var(--rule-strong);
  stroke-width: 1.5;
}

.illu .paper-back {
  fill: #f8fafc;
  stroke: var(--rule-strong);
  stroke-width: 1.5;
}

.illu .fold {
  fill: var(--tint);
  stroke: var(--rule-strong);
  stroke-width: 1.5;
  stroke-linejoin: round;
}

.illu .bar {
  fill: #d4dde7;
}

.illu .bar-dark {
  fill: #9fb3c8;
}

.illu .bar-ink {
  fill: var(--ink);
}

.illu .bar-accent {
  fill: var(--accent);
}

.illu .fill-accent-tint {
  fill: var(--accent-tint);
}

.illu .fill-warn-tint {
  fill: var(--warn-tint);
}

.illu .fill-warn {
  fill: var(--warn);
}

.illu .fill-tint {
  fill: var(--tint);
}

.illu .fill-ink {
  fill: var(--ink);
}

.illu .fill-accent {
  fill: var(--accent);
}

.illu .fill-white {
  fill: #fff;
}

.illu .stroke-accent {
  fill: none;
  stroke: var(--accent);
  stroke-width: 2;
  stroke-linecap: round;
}

.illu .wire {
  fill: none;
  stroke: var(--ink-3);
  stroke-width: 1.75;
  stroke-dasharray: 4 4;
}

.illu .wire-solid {
  fill: none;
  stroke: var(--ink-3);
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.illu .stroke-white {
  fill: none;
  stroke: #fff;
  stroke-width: 2.25;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.illu .rule {
  stroke: var(--rule-strong);
  stroke-width: 1.25;
}

.illu .rule-ink {
  stroke: var(--ink);
  stroke-width: 1.5;
}

.illu .dash {
  stroke: var(--accent);
  stroke-width: 1.5;
  stroke-dasharray: 5 4;
}

.illu text {
  font-family: var(--font-sans);
  font-weight: 600;
}

.illu .t-white {
  fill: #fff;
  font-size: 10px;
}

.illu .t-ink {
  fill: var(--ink);
  font-size: 12px;
}

.illu .t-muted {
  fill: var(--ink-2);
  font-size: 10px;
  font-weight: 500;
}

.illu .t-warn {
  fill: var(--warn);
  font-size: 10px;
}

.illu .t-big {
  fill: var(--accent);
  font-size: 30px;
  font-weight: 500;
}

/* ---------- Habilidades ---------- */

.skills {
  display: grid;
  gap: 40px 48px;
}

@media (min-width: 760px) {
  .skills {
    grid-template-columns: 1fr 1fr;
  }
}

.skill-group h3 {
  font-size: 1rem;
  font-weight: 600;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--ink);
}

.skill-group li {
  padding-block: 11px;
  border-bottom: 1px solid var(--rule);
  color: var(--ink);
  font-size: 0.9688rem;
}

.skill-group li span {
  color: var(--ink-2);
}

.levels > div {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding-block: 11px;
  border-bottom: 1px solid var(--rule);
  font-size: 0.9688rem;
}

.levels dd {
  font-weight: 600;
  color: var(--ink);
}

/* ---------- Certificados ---------- */

.ledger {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9688rem;
}

.ledger thead th {
  padding: 0 16px 12px 0;
  border-bottom: 2px solid var(--ink);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--ink);
  text-align: left;
}

.ledger td,
.ledger tbody th {
  padding: 16px 16px 16px 0;
  border-bottom: 1px solid var(--rule);
  vertical-align: top;
  text-align: left;
}

.ledger tbody th {
  font-weight: 600;
  color: var(--ink);
}

.ledger .year {
  width: 88px;
  color: var(--accent-strong);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

.ledger .issuer {
  color: var(--ink-2);
  white-space: nowrap;
}

.ledger .note {
  display: block;
  margin-top: 2px;
  font-weight: 400;
  font-size: 0.875rem;
  color: var(--ink-2);
}

@media (max-width: 619px) {
  .ledger thead {
    display: none;
  }

  .ledger tr {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 2px 16px;
    padding-block: 14px;
    border-bottom: 1px solid var(--rule);
  }

  .ledger td,
  .ledger tbody th {
    padding: 0;
    border: 0;
  }

  .ledger .year {
    grid-row: span 2;
    width: auto;
  }

  .ledger .issuer {
    white-space: normal;
  }
}

/* ---------- Contacto ---------- */

.contact-title {
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: clamp(2rem, 1.5rem + 2vw, 3rem);
  line-height: 1.1;
  letter-spacing: -0.015em;
}

.contact-text {
  margin-top: 16px;
  color: var(--ink-2);
  max-width: 56ch;
}

.contact .btn-group {
  margin-top: 28px;
}

.contact-details {
  display: grid;
  gap: 0;
  margin-top: 40px;
  max-width: 640px;
}

.contact-details > div {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 16px;
  padding-block: 14px;
  border-bottom: 1px solid var(--rule);
  font-size: 0.9688rem;
}

.contact-details > div:first-child {
  border-top: 1px solid var(--rule);
}

.contact-details dt {
  color: var(--ink-2);
}

.contact-details dd {
  color: var(--ink);
  overflow-wrap: anywhere;
}

.copy-status {
  min-height: 1.5em;
  margin-top: 10px;
  font-size: 0.875rem;
  color: var(--accent-strong);
}

/* ---------- Pie ---------- */

.site-footer {
  padding-block: 32px 40px;
  border-top: 1px solid var(--rule);
  color: var(--ink-3);
  font-size: 0.875rem;
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px 24px;
}

.footer-inner nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
}

.site-footer a {
  color: var(--ink-2);
}

/* ---------- 404 ---------- */

.notfound {
  min-height: 70vh;
  display: grid;
  align-content: center;
  gap: 16px;
  padding-block: 80px;
}

.notfound h1 {
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: clamp(2rem, 1.5rem + 2vw, 3rem);
  line-height: 1.1;
}

.notfound p {
  color: var(--ink-2);
  max-width: 56ch;
}

/* ---------- Movimiento reducido ---------- */

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }

  .project-card:hover,
  .project-card:focus-within {
    transform: none;
  }

  .project-card:hover .project-media svg {
    transform: none;
  }
}

/* ---------- Impresión ---------- */

@media print {
  .progress,
  .site-header,
  .nav-toggle,
  .btn-group,
  .skip-link {
    display: none !important;
  }

  body {
    background: #fff;
  }

  .section {
    padding-block: 24px;
  }

  .project-card {
    break-inside: avoid;
  }
}
