/* Modo noche (por defecto): tinta cálida plana, sin manchas ni vidrio */
:root {
  color-scheme: dark;
  --bg: #16131a;
  --surface: #1e1a24;
  --surface-card: #1e1a24;
  --surface-raised: #252030;
  --surface-border: rgba(255, 255, 255, 0.1);
  --border-strong: rgba(255, 255, 255, 0.22);
  --rule: rgba(255, 255, 255, 0.08);
  --chip-bg: rgba(255, 255, 255, 0.06);
  --ink: #ffffff;
  --ink-body: rgba(255, 248, 255, 0.86);
  --ink-soft: rgba(255, 248, 255, 0.68);
  --ink-muted: var(--ink-body);
  --accent: #e0a1f5;          /* acento para texto */
  --accent-gold: #f4a261;     /* dorado para texto */
  --accent-fill: #e0a1f5;     /* acento para rellenos y degradados */
  --accent-gold-fill: #f4a261;
  --on-accent: #120e1a;       /* texto sobre rellenos de acento */
  --title-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
  --shadow-soft: 0 24px 48px rgba(0, 0, 0, 0.35);
  --ok-bg: rgba(34, 197, 94, 0.16);
  --ok-ink: #86efac;
  --err-bg: rgba(239, 68, 68, 0.14);
  --err-ink: #fca5a5;
  --radius: 28px;
}

/* Modo día: papel crema con tinta oscura */
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f6f1ea;
  --surface: #fffcf8;
  --surface-card: #fffcf8;
  --surface-raised: #ffffff;
  --surface-border: rgba(27, 23, 32, 0.12);
  --border-strong: rgba(27, 23, 32, 0.24);
  --rule: rgba(27, 23, 32, 0.1);
  --chip-bg: rgba(27, 23, 32, 0.04);
  --ink: #1b1720;
  --ink-body: #3a3340;
  --ink-soft: #5f5766;
  --accent: #8a3fb0;
  --accent-gold: #a8521a;
  --on-accent: #1b1720;
  --title-shadow: none;
  --shadow-soft: 0 18px 40px rgba(60, 40, 70, 0.14);
  --ok-bg: rgba(34, 197, 94, 0.12);
  --ok-ink: #166534;
  --err-bg: rgba(239, 68, 68, 0.1);
  --err-ink: #b91c1c;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink-muted);
  background: var(--bg);
  font-family: Outfit, Inter, system-ui, -apple-system, sans-serif;
  line-height: 1.6;
  min-height: 100vh;
}

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

.site-header {
  position: fixed;
  top: 18px;
  left: 50%;
  z-index: 20;
  display: flex;
  width: min(1180px, calc(100% - 32px));
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  border: 1px solid var(--surface-border);
  border-radius: 999px;
  background: var(--surface);
  transform: translateX(-50%);
  transition: top 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.site-header.is-scrolled {
  top: 10px;
  border-color: var(--border-strong);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
}

.brand,
.nav,
.hero__actions,
.metrics,
.contact__links,
.footer {
  display: flex;
  align-items: center;
}

.brand {
  gap: 12px;
  font-weight: 800;
  font-size: 1.1rem;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.brand__mark {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border-radius: 50%;
  color: var(--on-accent);
  background: linear-gradient(135deg, var(--accent-fill), var(--accent-gold-fill));
  font-family: "Playfair Display", Georgia, serif;
  font-weight: 800;
  font-size: 1.2rem;
  box-shadow: 0 0 20px rgba(224, 161, 245, 0.5);
}

.nav {
  gap: 8px;
}

.nav a {
  padding: 10px 18px;
  border-radius: 999px;
  color: var(--ink-body);
  font-size: 0.95rem;
  font-weight: 700;
  transition: all 0.25s ease;
}

.nav a:hover {
  color: var(--ink);
  background: rgba(224, 161, 245, 0.2);
  transform: translateY(-1px);
}

.menu-toggle {
  display: none;
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 50%;
  background: var(--accent-fill);
}

.menu-toggle span {
  display: block;
  width: 18px;
  height: 2px;
  margin: 5px auto;
  background: #120e1a;
}

.hero,
.section {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

.hero {
  display: grid;
  min-height: 100vh;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 56px;
  align-items: center;
  padding: 148px 0 86px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 16px;
  padding: 6px 16px;
  border-radius: 999px;
  background: rgba(224, 161, 245, 0.12);
  border: 1px solid rgba(224, 161, 245, 0.3);
  color: var(--accent);
  font-size: 0.92rem;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.sector-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 24px;
}

.sector-pill {
  font-size: 0.85rem;
  font-weight: 700;
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--chip-bg);
  border: 1px solid var(--surface-border);
  color: var(--ink-body);
  transition: all 0.25s ease;
}

.sector-pill:hover {
  border-color: var(--accent);
  background: rgba(224, 161, 245, 0.2);
  color: var(--ink);
  transform: translateY(-2px);
}

.sector-pill--gold {
  border-color: rgba(244, 162, 97, 0.4);
  color: var(--accent-gold);
}

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

h1,
h2 {
  font-family: "Playfair Display", Georgia, serif;
  letter-spacing: -0.035em;
  line-height: 1.08;
  color: var(--ink);
}

h1 {
  max-width: 820px;
  margin-bottom: 22px;
  font-size: clamp(3.2rem, 7.5vw, 6.8rem);
  text-shadow: var(--title-shadow);
}

h2 {
  max-width: 840px;
  margin-bottom: 0;
  font-size: clamp(2.75rem, 5.5vw, 4.8rem);
}

h3 {
  margin-bottom: 16px;
  font-size: 1.55rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.hero__lead {
  max-width: 640px;
  color: var(--ink-body);
  font-size: clamp(1.08rem, 2vw, 1.25rem);
  line-height: 1.7;
}

.hero__actions {
  flex-wrap: wrap;
  gap: 14px;
  margin: 34px 0;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 54px;
  padding: 0 28px;
  border-radius: 999px;
  font-weight: 800;
  font-size: 1.02rem;
  transition: all 0.3s ease;
  cursor: pointer;
}

.button--primary {
  color: var(--on-accent);
  background: linear-gradient(135deg, var(--accent-fill), var(--accent-gold-fill));
  box-shadow: 0 16px 40px rgba(224, 161, 245, 0.35);
}

.button--primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 22px 50px rgba(224, 161, 245, 0.5);
}

.button--secondary {
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--ink);
}

.button--secondary:hover {
  border-color: var(--accent);
  background: rgba(224, 161, 245, 0.2);
  transform: translateY(-3px);
}

.metrics {
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 10px;
}

.metrics div {
  position: relative;
  overflow: hidden;
  min-width: 150px;
  padding: 20px 22px;
  border: 1px solid var(--surface-border);
  border-radius: 22px;
  background: var(--surface);
  transform: translateY(0);
  transition: all 0.3s ease;
}

.metrics div::before {
  position: absolute;
  top: -35%;
  left: -45%;
  width: 90%;
  height: 170%;
  content: "";
  background: linear-gradient(115deg, transparent 0 35%, rgba(255, 255, 255, 0.18) 48%, transparent 62% 100%);
  transform: translateX(-120%) rotate(8deg);
  transition: transform 0.7s ease;
}

.metrics div::after {
  position: absolute;
  right: 16px;
  top: 16px;
  width: 8px;
  height: 8px;
  content: "";
  border-radius: 50%;
  background: var(--accent-fill);
  box-shadow: 0 0 0 6px rgba(224, 161, 245, 0.15), 0 0 28px rgba(224, 161, 245, 0.8);
  animation: pulse-dot 2.4s ease-in-out infinite;
}

.metrics div:hover {
  border-color: var(--accent);
  background: var(--surface-raised);
  box-shadow: 0 18px 46px rgba(0, 0, 0, 0.4), 0 0 25px rgba(224, 161, 245, 0.25);
  transform: translateY(-6px);
}

.metrics dt {
  position: relative;
  z-index: 1;
  font-size: 1.7rem;
  font-weight: 900;
  color: var(--accent);
  text-shadow: none;
}

.metrics dd {
  position: relative;
  z-index: 1;
  margin: 0;
  color: var(--ink-body);
  font-size: 0.92rem;
  font-weight: 600;
}

.hero__visual {
  position: relative;
  min-height: 580px;
  perspective: 1200px;
}

.portrait-card {
  position: relative;
  overflow: hidden;
  height: 100%;
  min-height: 560px;
  border: 1px solid var(--surface-border);
  border-radius: 44px;
  background: var(--surface);
  box-shadow: var(--shadow-soft);
  transition: transform 0.35s ease, box-shadow 0.35s ease;
}

.portrait-card:hover {
  box-shadow: 0 32px 90px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(224, 161, 245, 0.35);
  transform: translateY(-8px);
}

.portrait-card__photo {
  display: block;
  width: 100%;
  height: 74%;
  object-fit: cover;
  object-position: center top;
  transition: transform 0.7s ease, filter 0.7s ease;
}

.portrait-card:hover .portrait-card__photo {
  transform: scale(1.05);
}

.portrait-card__body {
  position: relative;
  z-index: 3;
  padding: 28px 32px;
  background: var(--surface);
}

.portrait-card__body p {
  color: var(--accent);
  font-weight: 800;
  font-size: 0.92rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 6px;
}

.portrait-card__body strong {
  display: block;
  font-size: 1.4rem;
  line-height: 1.3;
  color: var(--ink);
}

.floating-note {
  position: absolute;
  z-index: 4;
  padding: 14px 22px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 999px;
  color: var(--on-accent);
  background: linear-gradient(135deg, var(--accent-fill), var(--accent-gold-fill));
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.22);
  font-weight: 900;
  font-size: 0.95rem;
  animation: note-float 4.8s ease-in-out infinite;
}

.floating-note--1 { top: 19%; left: -28px; }
.floating-note--2 { right: -20px; bottom: 20%; animation-delay: -1.8s; }
.floating-note--3 { top: 6%; right: 8%; animation-delay: -0.9s; }
/* La nota 4 va en el borde izquierdo de la foto, no sobre el texto de la tarjeta */
.floating-note--4 { left: -28px; top: 50%; animation-delay: -2.5s; }

@keyframes note-float {
  0%, 100% { transform: translate3d(0, 0, 0); }
  50% { transform: translate3d(0, -10px, 0); }
}

@keyframes pulse-dot {
  0%, 100% { transform: scale(1); opacity: 0.85; }
  50% { transform: scale(1.35); opacity: 1; }
}

.section {
  padding: 104px 0;
  border-top: 1px solid var(--rule);
}

.section__heading {
  margin-bottom: 40px;
}

.about__grid,
.services__grid,
.projects__grid {
  display: grid;
  gap: 24px;
}

.about__grid {
  grid-template-columns: 1.3fr 0.7fr;
}

.card,
.service-card,
.contact__panel {
  border: 1px solid var(--surface-border);
  border-radius: var(--radius);
  background: var(--surface-card);
}

.card {
  padding: 40px;
}

.card--large p,
.service-card p,
.contact__panel p {
  color: var(--ink-body);
  font-size: 1.1rem;
  line-height: 1.75;
}

.check-list {
  display: grid;
  gap: 16px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.check-list li {
  padding-left: 32px;
  position: relative;
  font-size: 1.08rem;
  font-weight: 600;
  color: var(--ink);
}

.check-list li::before {
  position: absolute;
  left: 0;
  content: "✓";
  color: var(--accent-gold);
  font-weight: 900;
  font-size: 1.2rem;
}

.services__grid {
  grid-template-columns: repeat(3, 1fr);
}

.service-card {
  padding: 36px;
  transition: all 0.3s ease;
}

.service-card:hover {
  border-color: var(--accent);
  box-shadow: 0 25px 70px rgba(0, 0, 0, 0.5), 0 0 25px rgba(224, 161, 245, 0.2);
  transform: translateY(-8px);
}

.service-card span {
  display: inline-grid;
  width: 48px;
  height: 48px;
  place-items: center;
  margin-bottom: 28px;
  border-radius: 50%;
  color: var(--on-accent);
  background: linear-gradient(135deg, var(--accent-fill), var(--accent-gold-fill));
  font-weight: 900;
  font-size: 1.1rem;
  box-shadow: 0 0 20px rgba(224, 161, 245, 0.4);
}

.projects__grid {
  grid-template-columns: repeat(3, 1fr);
}

.project-card {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--surface-border);
  border-radius: 30px;
  background: var(--surface-card);
  cursor: pointer;
  transition: transform 0.35s ease, box-shadow 0.35s ease, border-color 0.35s ease;
}

.project-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.6), 0 0 30px rgba(224, 161, 245, 0.25);
  border-color: var(--accent);
}

.project-card__image {
  display: block;
  width: 100%;
  height: 320px;
  min-height: 280px;
  object-fit: cover;
  object-position: center top;
  transition: transform 0.5s ease;
}

.project-card:hover .project-card__image {
  transform: scale(1.06);
}

.project-card__content {
  color: var(--ink);
  padding: 28px;
}

.project-card__content p {
  margin-bottom: 8px;
  color: var(--accent);
  font-size: 0.9rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.project-card__content h3 {
  font-size: 1.45rem;
  margin-bottom: 12px;
}

.project-card__content span {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  color: var(--ink-body);
  font-size: 1.02rem;
  line-height: 1.6;
}

.logo-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

.logo-strip span {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 110px;
  padding: 20px 24px;
  border: 1px solid var(--surface-border);
  border-radius: 20px;
  color: var(--on-accent);
  background: linear-gradient(135deg, #ffffff 0%, #f5e8f8 100%);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
  font-size: 1.15rem;
  font-weight: 800;
  text-align: center;
  transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.logo-strip span:hover {
  border-color: var(--accent);
  background: #ffffff;
  box-shadow: 0 22px 50px rgba(224, 161, 245, 0.45), 0 0 0 2px var(--accent);
  transform: translateY(-6px) scale(1.03);
}

.logo-strip img {
  max-height: 60px;
  max-width: 85%;
  width: auto;
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.12));
  transition: transform 0.3s ease;
}

.logo-strip span:hover img {
  transform: scale(1.05);
}

.testimonial blockquote {
  margin: 0 0 20px;
  font-family: "Playfair Display", Georgia, serif;
  font-size: clamp(1.8rem, 3.8vw, 3.2rem);
  line-height: 1.25;
  color: var(--ink);
  font-style: italic;
}

.testimonial p {
  color: var(--accent-gold);
  font-weight: 800;
  font-size: 1.1rem;
}

.contact__panel {
  padding: 56px;
}

.contact-form {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  margin-top: 32px;
}

.contact-form__full {
  grid-column: span 2;
}

.contact-form label {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-weight: 700;
  color: var(--ink);
}

.contact-form input,
.contact-form textarea {
  width: 100%;
  padding: 16px 20px;
  border-radius: 16px;
  border: 1px solid var(--border-strong);
  background: var(--bg);
  color: var(--ink);
  font-family: inherit;
  font-size: 1.05rem;
  transition: border-color 0.25s ease;
}

.contact-form input:focus,
.contact-form textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 18px rgba(224, 161, 245, 0.25);
}

.contact__links {
  gap: 20px;
  flex-wrap: wrap;
  margin-top: 40px;
  padding-top: 32px;
  border-top: 1px solid var(--rule);
}

.contact__links a,
.contact__links span {
  font-weight: 700;
  font-size: 1.05rem;
}

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

.button-cv {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 24px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--accent-fill), var(--accent-gold-fill));
  color: var(--on-accent) !important;
  font-weight: 800;
  box-shadow: 0 10px 30px rgba(224, 161, 245, 0.3);
  transition: all 0.3s ease;
}

.button-cv:hover {
  transform: translateY(-3px);
  box-shadow: 0 16px 40px rgba(224, 161, 245, 0.5);
}

.footer {
  width: min(1180px, calc(100% - 32px));
  margin: 60px auto 40px;
  justify-content: space-between;
  padding-top: 24px;
  border-top: 1px solid var(--rule);
  color: var(--ink-soft);
  font-size: 0.95rem;
}

/* Herramientas y nivel de conocimiento */
.skills__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
  align-items: start;
}

.skills__group {
  padding: 28px 32px;
  border: 1px solid var(--surface-border);
  border-radius: 16px;
  background: var(--surface-card);
}

.skills__group h3 {
  margin-bottom: 8px;
  font-size: 1.15rem;
}

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

.skill {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 0;
  border-top: 1px solid var(--rule);
}

.skill:first-child {
  border-top: 0;
}

/* Logo sobre recuadro blanco en ambos modos: así los logos oscuros se ven también de noche */
.skill__logo {
  display: grid;
  flex: none;
  width: 36px;
  height: 36px;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--surface-border);
  border-radius: 10px;
  background: #ffffff;
  color: #3a3340;
  font-size: 0.95rem;
  font-weight: 800;
}

.skill__logo img {
  width: 100%;
  height: 100%;
  padding: 5px;
  object-fit: contain;
}

.skill__text {
  display: flex;
  min-width: 0;
  flex: 1;
  flex-direction: column;
  gap: 2px;
}

.skill__name {
  color: var(--ink);
  font-weight: 600;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.skill__meter {
  display: inline-flex;
  flex: none;
  gap: 4px;
}

.skill__meter i {
  width: 14px;
  height: 6px;
  border-radius: 999px;
  background: var(--border-strong);
}

.skill__meter i.is-on {
  background: var(--accent);
}

.skill__label {
  color: var(--ink-soft);
  font-size: 0.88rem;
  font-weight: 500;
  line-height: 1.3;
}

/* ==========================================================
   Movimiento
   Momento principal: "la portada se publica". La foto se revela
   como un post que termina de cargar y las notas se pegan encima
   como stickers. Solo con JS (clase .js): sin JS todo es visible.
   ========================================================== */
:root {
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes rise-in {
  from { opacity: 0; translate: 0 14px; }
}

@keyframes title-in {
  from { opacity: 0; translate: 0 0.3em; clip-path: inset(-20% -5% 100% -5%); }
  to { opacity: 1; translate: 0 0; clip-path: inset(-20% -5% -25% -5%); }
}

@keyframes post-in {
  from { opacity: 0; clip-path: inset(10% 8% 14% 8% round 44px); }
  to { opacity: 1; clip-path: inset(0 0 0 0 round 44px); }
}

@keyframes photo-settle {
  from { scale: 1.12; }
}

@keyframes sticker-in {
  from { opacity: 0; scale: 0.55; rotate: -10deg; }
  55% { opacity: 1; }
  to { opacity: 1; scale: 1; rotate: 0deg; }
}

@keyframes icon-in {
  from { opacity: 0; rotate: -90deg; scale: 0.5; }
}

.js .hero__content > * {
  animation: rise-in 700ms var(--ease-out) both;
}

/* Orden: el nombre primero, luego el resto del texto, la foto y por último las notas */
.js .hero__content > :nth-child(1) { animation-delay: 0ms; }
.js .hero__content > :nth-child(2) { animation-delay: 40ms; }
.js .hero__content > :nth-child(4) { animation-delay: 220ms; }
.js .hero__content > :nth-child(5) { animation-delay: 300ms; }
.js .hero__content > :nth-child(6) { animation-delay: 380ms; }

.js .hero__content > h1 {
  animation: title-in 850ms var(--ease-out) 40ms both;
}

.js .portrait-card {
  animation: post-in 1000ms var(--ease-out) 280ms both;
}

.js .portrait-card__photo {
  animation: photo-settle 1400ms var(--ease-out) 280ms both;
}

/* Las notas se "pegan" una a una y luego flotan suavemente */
.js .floating-note {
  animation:
    sticker-in 560ms var(--ease-out) calc(850ms + var(--i, 0) * 150ms) both,
    note-float 4.8s ease-in-out calc(1450ms + var(--i, 0) * 150ms) infinite;
}

/* Bucles de la portada en pausa cuando no está en pantalla */
.hero.is-paused .floating-note,
.hero.is-paused .metrics div::after {
  animation-play-state: paused;
}

/* Herramientas: las barras de nivel se llenan paso a paso al aparecer */
.skill__meter i {
  transform-origin: left center;
}

.js .skills__group .skill__meter i.is-on {
  transition: scale 450ms var(--ease-out);
  transition-delay: calc(min(var(--row, 0), 6) * 60ms + var(--s, 1) * 80ms);
}

.js .skills__group:not(.is-visible) .skill__meter i.is-on {
  scale: 0 1;
}

/* Cambio de tema: el ícono gira al entrar y el modo nuevo se expande en círculo */
.theme-toggle svg {
  animation: icon-in 380ms var(--ease-out);
}

::view-transition-old(root),
::view-transition-new(root) {
  animation: none;
  mix-blend-mode: normal;
}

/* Cambio de modo día / noche */
body {
  transition: background-color 0.3s ease, color 0.3s ease;
}

.site-header {
  gap: 12px;
}

.nav {
  margin-left: auto;
}

.theme-toggle {
  display: inline-grid;
  flex: none;
  width: 42px;
  height: 42px;
  place-items: center;
  padding: 0;
  border: 1px solid var(--surface-border);
  border-radius: 50%;
  background: var(--surface-raised);
  color: var(--ink);
  cursor: pointer;
  transition: border-color 0.25s ease, color 0.25s ease;
}

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

.theme-toggle:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

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

/* En modo noche se ofrece el sol (pasar a día); en modo día, la luna */
:root[data-theme="light"] .theme-toggle__sun,
:root:not([data-theme="light"]) .theme-toggle__moon {
  display: none;
}

.contact-form input::placeholder,
.contact-form textarea::placeholder {
  color: var(--ink-soft);
  opacity: 1;
}

/* Utilidades de accesibilidad */
.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

/* Botón "Ver más información" de cada proyecto */
.project-card__more {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 18px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--accent);
  font: inherit;
  font-size: 0.92rem;
  font-weight: 800;
  cursor: pointer;
}

.project-card__more:focus-visible,
.project-modal-close-btn:focus-visible,
.menu-toggle:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
  border-radius: 8px;
}

/* Formulario de contacto: avisos, errores y estados */
.form-status {
  margin-top: 16px;
  padding: 14px 20px;
  border-radius: 12px;
  font-weight: 700;
  scroll-margin-top: 120px;
}

.form-status:focus {
  outline: none;
}

.form-status--ok {
  background: var(--ok-bg);
  border: 1px solid rgba(34, 197, 94, 0.45);
  color: var(--ok-ink);
}

.form-status--error {
  background: var(--err-bg);
  border: 1px solid rgba(239, 68, 68, 0.45);
  color: var(--err-ink);
}

.form-error {
  color: var(--err-ink);
  font-weight: 600;
}

.contact-form__optional {
  color: var(--ink-soft);
  font-weight: 500;
}

.contact-form [aria-invalid="true"] {
  border-color: #f87171;
}

.contact-form__trap {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.contact-form button[type="submit"] {
  font: inherit;
  font-weight: 800;
  border: 0;
}

.contact-form button[type="submit"]:disabled {
  cursor: progress;
  opacity: 0.7;
  transform: none;
}

/* Responsive Breakpoints */
@media (max-width: 1024px) {
  .hero {
    grid-template-columns: 1fr;
    padding-top: 130px;
    gap: 40px;
  }
  .about__grid {
    grid-template-columns: 1fr;
  }
  .services__grid,
  .projects__grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .logo-strip {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .nav {
    position: fixed;
    inset: 80px 16px auto;
    flex-direction: column;
    padding: 24px;
    border-radius: 24px;
    background: var(--surface);
    border: 1px solid var(--surface-border);
    display: none;
  }
  .nav.is-open {
    display: flex;
  }
  .menu-toggle {
    display: block;
  }
  .theme-toggle {
    margin-left: auto;
  }
  .services__grid,
  .projects__grid {
    grid-template-columns: 1fr;
  }
  .contact-form {
    grid-template-columns: 1fr;
  }
  .contact-form__full {
    grid-column: span 1;
  }
  .contact__panel {
    padding: 32px 20px;
  }
  /* Las notas flotantes no se salen del margen en pantallas pequeñas */
  .floating-note--1 { top: 12px; left: 12px; }
  .floating-note--2 { right: 12px; bottom: auto; top: 64px; }
  .floating-note--3 { top: auto; right: auto; bottom: 30%; left: 12px; }
  .floating-note--4 { top: auto; left: auto; bottom: calc(30% + 56px); right: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-delay: 0s !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    transition-delay: 0s !important;
  }
  html .project-card:hover,
  html .project-card:hover .project-card__image,
  .portrait-card:hover,
  .portrait-card:hover .portrait-card__photo,
  .service-card:hover,
  .metrics div:hover,
  .logo-strip span:hover,
  .button:hover {
    transform: none !important;
  }
}
