:root {
  --bg: #0a0a0b;
  --bg-elevated: #121214;
  --text: #e8e6e3;
  --text-muted: #8a8680;
  --accent: #ff4d00;
  --accent-soft: rgba(255, 77, 0, 0.15);
  --border: rgba(255, 255, 255, 0.08);
  --font-sans: "Syne", system-ui, sans-serif;
  --font-serif: "Instrument Serif", Georgia, serif;
  --radius: 14px;
  --header-h: 72px;
  /* Misma columna que .section / .hero (evita que el header se vea más ancho) */
  --gutter-x: clamp(1.25rem, 5vw, 4rem);
  /* Misma caja que .section-inner: logo y hamburguesa alineados con el contenido */
  --content-max: 1100px;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 0.5rem);
  overflow-x: hidden;
  max-width: 100%;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-weight: 500;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
  max-width: 100%;
}

main {
  overflow-x: hidden;
  max-width: 100%;
}

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

.grain {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 9998;
  opacity: 0.04;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.cursor-glow {
  pointer-events: none;
  position: fixed;
  width: 420px;
  height: 420px;
  margin: -210px 0 0 -210px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 77, 0, 0.08) 0%, transparent 65%);
  z-index: 0;
  opacity: 0;
  transition: opacity 0.4s ease;
  will-change: transform;
}

/* Evita que el halo fijo ensanche el scroll horizontal en pantallas estrechas */
@media (max-width: 899px) {
  .cursor-glow {
    display: none;
  }
}

body:hover .cursor-glow {
  opacity: 1;
}

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: var(--header-h);
  display: flex;
  flex-direction: column;
  align-items: stretch;
  padding: 0;
  border-bottom: 1px solid transparent;
  transition: background 0.35s var(--ease-out), border-color 0.35s;
  box-sizing: border-box;
  width: 100%;
}

/* Misma geometría que .section (gutter) + .section-inner (max-width centrado) */
.site-header-inner {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  width: 100%;
  max-width: var(--content-max);
  min-width: 0;
  margin-inline: auto;
  padding-left: max(var(--gutter-x), env(safe-area-inset-left, 0px));
  padding-right: max(var(--gutter-x), env(safe-area-inset-right, 0px));
  min-height: 0;
  box-sizing: border-box;
}

.header-end {
  display: flex;
  align-items: center;
  gap: clamp(0.65rem, 2vw, 1.35rem);
  margin-left: auto;
  flex-shrink: 0;
}

.header-social {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.icon-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--border);
  color: var(--text-muted);
  transition: color 0.2s, border-color 0.2s, transform 0.25s var(--ease-out), box-shadow 0.25s;
}

.icon-link:hover {
  color: var(--accent);
  border-color: rgba(255, 77, 0, 0.45);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(255, 77, 0, 0.12);
}

.icon-link--lg {
  width: 44px;
  height: 44px;
}

.icon-svg {
  display: block;
  pointer-events: none;
}

.site-header.is-scrolled {
  background: rgba(10, 10, 11, 0.85);
  backdrop-filter: blur(12px);
  border-bottom-color: var(--border);
}

.logo {
  font-weight: 800;
  font-size: 1.1rem;
  letter-spacing: -0.02em;
  color: var(--text);
  flex-shrink: 0;
}

.logo:hover {
  color: var(--accent);
}

.nav {
  display: none;
  gap: 2rem;
  align-items: center;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.nav a:not(.nav-cta) {
  color: var(--text-muted);
  transition: color 0.2s;
}

.nav a:not(.nav-cta):hover {
  color: var(--text);
}

.nav-cta {
  padding: 0.55rem 1.1rem;
  border-radius: 999px;
  background: var(--accent);
  color: var(--bg) !important;
  transition: transform 0.25s var(--ease-out), box-shadow 0.25s;
}

.nav-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(255, 77, 0, 0.35);
}

@media (min-width: 900px) {
  .nav {
    display: flex;
  }
}

.menu-toggle {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 7px;
  width: 44px;
  height: 44px;
  border: none;
  background: transparent;
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
  overflow: hidden;
  border-radius: 6px;
}

.menu-toggle span {
  display: block;
  height: 2px;
  width: 24px;
  background: var(--text);
  transition: transform 0.3s var(--ease-out);
}

.menu-toggle[aria-expanded="true"] span:first-child {
  transform: translateY(4.5px) rotate(45deg);
}

.menu-toggle[aria-expanded="true"] span:last-child {
  transform: translateY(-4.5px) rotate(-45deg);
}

@media (min-width: 900px) {
  .menu-toggle {
    display: none;
  }
}

.mobile-nav {
  position: fixed;
  top: var(--header-offset, var(--header-h));
  left: 0;
  right: 0;
  z-index: 99;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0;
  padding: 0;
  box-sizing: border-box;
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border);
  font-weight: 700;
  font-size: 1.25rem;
}

.mobile-nav-inner {
  width: 100%;
  max-width: min(var(--content-max), 100%);
  min-width: 0;
  margin-inline: auto;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 1.5rem max(var(--gutter-x), env(safe-area-inset-left, 0px)) 1.5rem max(var(--gutter-x), env(safe-area-inset-right, 0px));
}

.mobile-nav[hidden] {
  display: none !important;
}

.mobile-nav:not([hidden]) {
  display: flex;
}

.mobile-nav a {
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--border);
}

.mobile-nav-inner > a:last-of-type {
  border-bottom: none;
}

.mobile-nav-social {
  display: flex;
  justify-content: center;
  gap: 0.75rem;
  padding-top: 1.25rem;
  margin-top: 0.5rem;
  border-top: 1px solid var(--border);
}

.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-top: calc(var(--header-h) + 2rem);
  padding-bottom: 4rem;
  padding-left: max(var(--gutter-x), env(safe-area-inset-left, 0px));
  padding-right: max(var(--gutter-x), env(safe-area-inset-right, 0px));
  max-width: 1240px;
  margin: 0 auto;
  box-sizing: border-box;
  overflow-x: hidden;
}

.hero-layout {
  display: grid;
  gap: 2rem;
  width: 100%;
  align-items: center;
}

.hero-copy {
  position: relative;
  min-width: 0;
}

.hero-photo {
  margin: 0;
  width: 100%;
  max-width: 340px;
}

/* Marco tipo LinkedIn «Open to work» (#057642) */
.hero-photo-frame {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  border: 3px solid #057642;
  background: linear-gradient(165deg, var(--bg-elevated), #101014);
  box-shadow: 0 28px 56px rgba(0, 0, 0, 0.4);
}

.hero-photo-img {
  display: block;
  width: 100%;
  height: auto;
  max-height: min(560px, 75vh);
  object-fit: cover;
  object-position: center 20%;
}

.hero-photo-otw {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  margin: 0;
  padding: 0.45rem 0.65rem 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #057642;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.hero-photo-otw__text {
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #fff;
}

@media (min-width: 960px) {
  .hero-layout {
    grid-template-columns: 1fr min(300px, 32vw);
    gap: 2.5rem 3.5rem;
  }

  .hero-photo {
    max-width: none;
    justify-self: end;
  }
}

@media (max-width: 959px) {
  .hero-layout {
    grid-template-columns: 1fr;
    justify-items: center;
  }

  .hero-photo {
    max-width: min(280px, 72vw);
  }
}

.hero-bg {
  position: absolute;
  inset: -20% -30% auto -30%;
  height: 70%;
  background: radial-gradient(ellipse 80% 60% at 50% 0%, var(--accent-soft), transparent 55%);
  pointer-events: none;
}

.hero-title {
  margin: 0;
  font-weight: 800;
  font-size: clamp(2.1rem, 6.5vw, 3.75rem);
  line-height: 1.02;
  letter-spacing: -0.04em;
}

.hero-title .line {
  display: block;
  overflow: hidden;
}

.hero-title .line-inner {
  display: block;
  will-change: transform;
}

.hero-title .line-accent {
  font-family: var(--font-serif);
  font-weight: 400;
  font-style: italic;
  color: var(--text-muted);
  font-size: 1em;
}

.hero-role {
  margin: 1.5rem 0 0;
  font-size: clamp(1rem, 2vw, 1.15rem);
  color: var(--text-muted);
  max-width: 36ch;
}

.hero-lead {
  margin: 2rem 0 0;
  font-size: clamp(1rem, 2.2vw, 1.2rem);
  max-width: 52ch;
  color: var(--text-muted);
  font-weight: 500;
}

.hero-lead strong {
  color: var(--text);
  font-weight: 700;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
  margin-top: 2.5rem;
}

.hero-social {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 1rem 1.75rem;
  font-family: inherit;
  font-weight: 700;
  font-size: 0.9rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  transition: transform 0.25s var(--ease-out), box-shadow 0.25s, background 0.25s;
}

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

.btn-primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 16px 40px rgba(255, 77, 0, 0.4);
}

.btn-ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-ghost:hover {
  border-color: var(--text-muted);
  transform: translateY(-2px);
}

.section {
  position: relative;
  padding-top: clamp(4rem, 12vw, 8rem);
  padding-bottom: clamp(4rem, 12vw, 8rem);
  padding-left: max(var(--gutter-x), env(safe-area-inset-left, 0px));
  padding-right: max(var(--gutter-x), env(safe-area-inset-right, 0px));
  box-sizing: border-box;
}

.section-inner {
  max-width: var(--content-max);
  margin: 0 auto;
  width: 100%;
  min-width: 0;
}

.section-title {
  margin: 0 0 2.5rem;
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 800;
  letter-spacing: -0.03em;
}

.section-title-sub {
  margin-top: 3rem;
  font-size: clamp(1.25rem, 3vw, 1.65rem);
  color: var(--text-muted);
}

.about-grid {
  display: grid;
  gap: 3rem;
}

@media (min-width: 800px) {
  .about-grid {
    grid-template-columns: 1fr 280px;
    gap: 4rem;
  }
}

.about-text p {
  margin: 0 0 1.25rem;
  font-size: 1.05rem;
  color: var(--text-muted);
  max-width: 60ch;
}

.about-text p:last-child {
  margin-bottom: 0;
}

.about-closing {
  color: var(--text) !important;
  font-weight: 600;
}

.about-meta {
  padding: 1.5rem;
  border-radius: var(--radius);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  align-self: start;
}

.about-meta dl {
  margin: 0;
}

.about-meta dt {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--accent);
  margin-top: 1.25rem;
}

.meta-dt-icon {
  flex-shrink: 0;
  opacity: 0.9;
  color: var(--accent);
}

.about-meta dt:first-child {
  margin-top: 0;
}

.about-meta dd {
  margin: 0.35rem 0 0;
  font-size: 0.95rem;
  color: var(--text-muted);
}

.chip-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.chip-list li {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 1.05rem 0.55rem 0.85rem;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text-muted);
  transition: border-color 0.2s, color 0.2s, background 0.2s;
}

.chip-list li:hover {
  border-color: var(--accent);
  color: var(--text);
}

.chip-icon {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  object-fit: contain;
}

.chip-icon--mono {
  filter: invert(1) brightness(1.1) opacity(0.78);
}

.chip-list li:hover .chip-icon--mono {
  filter: invert(63%) sepia(55%) saturate(5966%) hue-rotate(1deg) brightness(102%) contrast(104%);
  opacity: 1;
}

.chip-icon--svg {
  color: var(--text-muted);
}

.chip-list li:hover .chip-icon--svg {
  color: var(--accent);
}

.chip-icons-pair {
  display: inline-flex;
  align-items: center;
  gap: 0.12rem;
}

.chip-icons-pair .chip-icon {
  width: 20px;
  height: 20px;
}

.chip-list__duo {
  padding-left: 0.65rem;
}

.stack-chart-details {
  margin-top: 2.25rem;
  width: 100%;
  max-width: 100%;
}

.stack-chart-summary {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.85rem 1.1rem;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  transition: border-color 0.2s, color 0.2s, background 0.2s;
  user-select: none;
}

.stack-chart-summary::-webkit-details-marker {
  display: none;
}

.stack-chart-summary::after {
  content: "";
  flex-shrink: 0;
  width: 0.55rem;
  height: 0.55rem;
  border-right: 2px solid var(--accent);
  border-bottom: 2px solid var(--accent);
  transform: rotate(45deg);
  margin-top: -0.2rem;
  opacity: 0.85;
  transition: transform 0.25s var(--ease-out);
}

.stack-chart-details[open] .stack-chart-summary::after {
  transform: rotate(-135deg);
  margin-top: 0.15rem;
}

.stack-chart-summary:hover {
  border-color: rgba(255, 77, 0, 0.35);
  color: var(--text);
}

.stack-chart-summary-text--open {
  display: none;
}

.stack-chart-details[open] .stack-chart-summary-text--open {
  display: inline;
}

.stack-chart-details[open] .stack-chart-summary-text--closed {
  display: none;
}

.stack-chart-card {
  margin-top: 1rem;
  padding: 1.5rem clamp(1.1rem, 3vw, 1.75rem);
  border-radius: var(--radius);
  background: linear-gradient(145deg, var(--bg-elevated) 0%, rgba(18, 18, 20, 0.92) 100%);
  border: 1px solid var(--border);
  box-shadow: 0 0 0 1px rgba(255, 77, 0, 0.06), 0 24px 48px rgba(0, 0, 0, 0.35);
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
}

.stack-chart-card--chart-only {
  padding: 0.85rem clamp(0.85rem, 2.5vw, 1.25rem) 1rem;
}

.stack-chart-canvas-wrap {
  position: relative;
  width: 100%;
  max-width: 100%;
  margin: 0;
  padding: 0;
  min-height: 400px;
  height: 640px;
  overflow: hidden;
  min-width: 0;
}

.stack-chart-canvas-wrap canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
}

.projects-intro {
  margin: -1.5rem 0 2.25rem;
  max-width: 52ch;
  color: var(--text-muted);
  font-size: 1.05rem;
}

.project-grid {
  display: grid;
  gap: 1.25rem;
  align-items: stretch;
  width: 100%;
  min-width: 0;
}

@media (min-width: 700px) {
  .project-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.project-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  min-width: 0;
  padding: 1.5rem 1.6rem;
  border-radius: var(--radius);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  transition: border-color 0.3s, transform 0.35s var(--ease-out);
  overflow-wrap: anywhere;
  word-break: break-word;
}

.project-card:hover {
  border-color: rgba(255, 77, 0, 0.35);
  transform: translateY(-4px);
}

.project-card-head {
  display: grid;
  grid-template-columns: 4rem minmax(0, 1fr);
  align-items: start;
  gap: 0.65rem 0.85rem;
  margin-bottom: 0.35rem;
  min-height: 48px;
}

.project-card-head .project-title {
  margin: 0;
  padding-top: 0.15rem;
  min-width: 0;
  line-height: 1.2;
  align-self: start;
}

.project-favicon {
  width: 40px;
  height: 40px;
  padding: 6px;
  border-radius: 10px;
  object-fit: contain;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  flex-shrink: 0;
  justify-self: center;
  align-self: start;
}

.project-card-head .project-favicon {
  margin: 0;
}

/* Logo horizontal oficial (cartadigitalizada.es/logo.png) */
.project-favicon--carta {
  width: 100%;
  max-width: 100%;
  height: 44px;
  max-height: 44px;
  padding: 4px 6px;
  object-fit: contain;
  object-position: center;
  justify-self: stretch;
  align-self: start;
  background: rgba(255, 255, 255, 0.06);
}

.project-favicon--n8n {
  filter: brightness(0) invert(0.92);
}

.project-title {
  margin: 0 0 0.5rem;
  font-size: 1.1rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.project-desc {
  margin: 0 0 1rem;
  flex: 1;
  font-size: 0.92rem;
  color: var(--text-muted);
  line-height: 1.55;
}

.project-desc strong {
  color: var(--text);
  font-weight: 700;
}

.project-tags {
  list-style: none;
  margin: 0 0 1.25rem;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.project-tags li {
  padding: 0.35rem 0.65rem;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-muted);
}

.project-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: auto;
}

.project-actions .btn {
  width: 100%;
  justify-content: center;
}

.btn-sm {
  padding: 0.65rem 1.15rem;
  font-size: 0.72rem;
}

.timeline {
  list-style: none;
  margin: 0;
  padding: 0;
  position: relative;
  border-left: 1px solid var(--border);
  margin-left: 0.5rem;
}

.timeline-item {
  position: relative;
  padding: 0 0 2.5rem 2rem;
}

.timeline-item:last-child {
  padding-bottom: 0;
}

.timeline-dot {
  position: absolute;
  left: -0.5rem;
  top: 0.35rem;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--bg), 0 0 0 5px var(--border);
}

.timeline-card {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 1.1rem;
  padding: 1.5rem 1.75rem;
  border-radius: var(--radius);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  transition: border-color 0.3s, transform 0.35s var(--ease-out);
}

.timeline-card:hover {
  border-color: rgba(255, 77, 0, 0.35);
  transform: translateX(6px);
}

.timeline-brand {
  flex-shrink: 0;
  width: 56px;
  height: 56px;
  margin: 0;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  overflow: hidden;
}

.timeline-brand--light {
  background: #fff;
  border-color: rgba(0, 0, 0, 0.1);
}

.timeline-brand--dentsu {
  width: 76px;
  height: 92px;
  padding: 0.45rem 0.35rem;
}

.timeline-brand--dentsu .timeline-brand-img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.timeline-brand--kumobe {
  width: min(168px, 46vw);
  height: 52px;
  padding: 0.4rem 0.65rem;
}

.timeline-brand--kumobe .timeline-brand-img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  object-fit: contain;
}

.timeline-brand-img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
}

.timeline-card-main {
  flex: 1;
  min-width: 0;
}

.timeline-card h3 {
  margin: 0 0 0.35rem;
  font-size: 1.15rem;
  font-weight: 800;
}

.timeline-role {
  margin: 0;
  color: var(--accent);
  font-weight: 700;
  font-size: 0.95rem;
}

.timeline-dates {
  margin: 0.5rem 0 0;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.timeline-note {
  margin: 0.75rem 0 0;
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.55;
}

.timeline-note strong {
  color: var(--text);
  font-weight: 650;
}

@media (max-width: 480px) {
  .timeline-card {
    flex-direction: column;
    align-items: stretch;
  }

  .timeline-brand,
  .timeline-brand--dentsu,
  .timeline-brand--kumobe {
    align-self: flex-start;
  }
}


.two-col {
  display: grid;
  gap: 3rem;
}

@media (min-width: 800px) {
  .two-col {
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
  }
}

.edu-card {
  padding: 1.75rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-elevated);
}

.edu-card h3 {
  margin: 0 0 0.5rem;
  font-size: 1.2rem;
}

.edu-card p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.edu-dates {
  margin-top: 1rem !important;
  font-size: 0.85rem !important;
  color: var(--text) !important;
  font-weight: 600;
}

.cert-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.cert-list li {
  padding: 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.95rem;
  position: relative;
  padding-left: 1.25rem;
}

.cert-list li a {
  display: block;
  padding: 0.85rem 0;
  color: var(--text-muted);
  transition: color 0.2s, padding-left 0.25s var(--ease-out);
}

.cert-list li a:hover {
  color: var(--text);
  padding-left: 0.25rem;
}

.cert-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}

.cert-list li:last-child {
  border-bottom: none;
}

.contact {
  padding-bottom: clamp(5rem, 15vw, 10rem);
}

.contact-inner {
  text-align: center;
}

.contact-title {
  margin-bottom: 1rem;
}

.contact-lead {
  margin: 0 auto 1rem;
  max-width: 42ch;
  color: var(--text-muted);
  font-size: 1.1rem;
}

.contact-arrow-cue {
  display: flex;
  justify-content: center;
  margin: 0 auto 1.75rem;
  color: var(--accent);
}

.contact-arrow-cue__svg {
  display: block;
  animation: contact-arrow-bounce 1.35s ease-in-out infinite;
}

@keyframes contact-arrow-bounce {
  0%,
  100% {
    transform: translateY(0);
    opacity: 0.75;
  }

  50% {
    transform: translateY(10px);
    opacity: 1;
  }
}

.contact-actions {
  display: flex;
  justify-content: center;
  margin-bottom: 1.75rem;
}

.contact-links {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  align-items: center;
}

.contact-big {
  font-size: clamp(1rem, 3vw, 1.35rem);
  font-weight: 700;
  padding: 0.5rem 0;
  position: relative;
  transition: color 0.2s;
}

.contact-big--row {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  width: 100%;
  max-width: 36rem;
  margin-left: auto;
  margin-right: auto;
  text-align: left;
}

.contact-big__icon {
  flex-shrink: 0;
  color: var(--text-muted);
  transition: color 0.2s;
}

.contact-big:hover .contact-big__icon {
  color: var(--accent);
}

.contact-big::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0.25rem;
  width: 100%;
  height: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.45s var(--ease-out);
}

.contact-big:hover {
  color: var(--accent);
}

.contact-big:hover::after {
  transform: scaleX(1);
  transform-origin: left;
}

.site-footer {
  padding-top: 2rem;
  padding-bottom: 2rem;
  padding-left: max(var(--gutter-x), env(safe-area-inset-left, 0px));
  padding-right: max(var(--gutter-x), env(safe-area-inset-right, 0px));
  border-top: 1px solid var(--border);
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-muted);
  box-sizing: border-box;
}

.site-footer p {
  margin: 0;
}

/* Anclas: no quedar bajo el header fijo */
#sobre-mi,
#stack,
#proyectos,
#experiencia,
#educacion,
#contacto {
  scroll-margin-top: calc(var(--header-h) + 0.75rem);
}

/* ——— Móvil y notch (safe area) ——— */
@media (max-width: 639px) {
  :root {
    --header-h: 64px;
    /* Altura real del header fijo: fila de contenido + notch (sin solapar el menú móvil) */
    --header-offset: calc(var(--header-h) + env(safe-area-inset-top, 0px));
  }

  html {
    scroll-padding-top: calc(var(--header-offset) + 0.5rem);
  }

  .site-header {
    padding-top: env(safe-area-inset-top, 0px);
    padding-bottom: 0;
    height: var(--header-offset);
    min-height: 0;
    box-sizing: border-box;
  }

  .header-social {
    display: none;
  }

  .mobile-nav {
    max-height: calc(100dvh - var(--header-offset));
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .mobile-nav-inner {
    padding-bottom: max(1.5rem, env(safe-area-inset-bottom, 0px));
  }

  .mobile-nav a {
    padding: 1rem 0;
    min-height: 48px;
    display: flex;
    align-items: center;
  }

  .hero {
    min-height: 100vh;
    min-height: 100dvh;
    min-height: 100svh;
    padding-top: calc(var(--header-offset) + 1.25rem);
    padding-bottom: max(2rem, env(safe-area-inset-bottom, 0px));
  }

  .hero-copy {
    text-align: center;
  }

  .hero-role,
  .hero-lead {
    margin-left: auto;
    margin-right: auto;
    max-width: 100%;
  }

  .hero-actions {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    max-width: 22rem;
    margin-left: auto;
    margin-right: auto;
    margin-top: 2rem;
  }

  .hero-actions .btn {
    width: 100%;
    min-height: 48px;
    padding: 0.95rem 1.25rem;
  }

  .hero-social {
    justify-content: center;
    width: 100%;
  }

  .hero-photo {
    max-width: min(260px, 78vw);
  }

  .hero-photo-img {
    max-height: min(420px, 58vh);
  }

  #sobre-mi,
  #stack,
  #proyectos,
  #experiencia,
  #educacion,
  #contacto {
    scroll-margin-top: calc(var(--header-offset) + 0.75rem);
  }

  .section {
    padding-top: clamp(2.5rem, 9vw, 3.5rem);
    padding-bottom: clamp(2.5rem, 9vw, 3.5rem);
  }

  .section-title {
    margin-bottom: 1.65rem;
    font-size: clamp(1.4rem, 6.5vw, 1.95rem);
    line-height: 1.15;
  }

  .about-grid {
    gap: 2rem;
  }

  .about-text p {
    font-size: 0.98rem;
    max-width: none;
  }

  .about-meta {
    padding: 1.25rem;
  }

  .chip-list {
    gap: 0.45rem;
  }

  .chip-list li {
    font-size: 0.78rem;
    padding: 0.45rem 0.82rem 0.45rem 0.65rem;
    gap: 0.4rem;
  }

  .chip-icon {
    width: 18px;
    height: 18px;
  }

  .chip-icons-pair .chip-icon {
    width: 16px;
    height: 16px;
  }

  .stack-chart-details {
    margin-top: 1.75rem;
  }

  .stack-chart-summary {
    font-size: 0.8rem;
    padding: 0.75rem 0.85rem;
    line-height: 1.35;
    align-items: center;
  }

  .stack-chart-card--chart-only {
    padding: 0.55rem 0.5rem 0.65rem;
  }

  .stack-chart-canvas-wrap {
    min-height: 240px;
  }

  .projects-intro {
    font-size: 1rem;
    margin-top: -1rem;
  }

  .project-card {
    padding: 1.25rem 1.2rem;
  }

  .project-favicon--carta {
    height: 40px;
    max-height: 40px;
    padding: 3px 5px;
  }

  .project-card-head {
    min-height: 46px;
    grid-template-columns: 3.5rem minmax(0, 1fr);
  }

  .project-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .project-actions .btn {
    width: 100%;
    justify-content: center;
    min-height: 46px;
  }

  .timeline {
    margin-left: 0.35rem;
  }

  .timeline-item {
    padding: 0 0 2rem 1.35rem;
  }

  .timeline-card {
    padding: 1.15rem 1.1rem;
    gap: 0.85rem;
  }

  .timeline-brand--kumobe {
    width: min(200px, 72vw);
    height: auto;
    min-height: 44px;
  }

  .timeline-note {
    font-size: 0.85rem;
  }

  .edu-card {
    padding: 1.35rem 1.2rem;
  }

  .contact {
    padding-bottom: max(3.5rem, env(safe-area-inset-bottom, 0px));
  }

  .contact-lead {
    font-size: 1rem;
    max-width: 100%;
  }

  .contact-big {
    font-size: clamp(0.95rem, 4.2vw, 1.15rem);
    word-break: break-word;
    overflow-wrap: anywhere;
    hyphens: auto;
  }

  .contact-big--row {
    max-width: 100%;
    padding-left: 0.25rem;
    padding-right: 0.25rem;
  }

  .site-footer {
    padding-left: max(1rem, env(safe-area-inset-left, 0px));
    padding-right: max(1rem, env(safe-area-inset-right, 0px));
    padding-bottom: max(1.5rem, env(safe-area-inset-bottom, 0px));
  }
}

@media (max-width: 639px) and (hover: none) {
  .project-card:hover,
  .timeline-card:hover {
    transform: none;
  }
}

@media (max-width: 380px) {
  .hero-title {
    font-size: clamp(1.85rem, 11vw, 2.35rem);
  }

  .chip-list li {
    font-size: 0.74rem;
    padding: 0.4rem 0.7rem 0.4rem 0.55rem;
  }
}

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

  .cursor-glow {
    display: none;
  }

  .contact-arrow-cue__svg {
    animation: none;
  }
}
