/* ============================================================
   MARCO GONZALEZ V. - MG CONSULTING
   Paleta completa:
   Marca:  #21443D | #A1B7AB | #FFFFFF | #033323 | #2A713A
   Nueva:  #F0F0F0 off-white | #004D61 dark teal | #3E5641 forest
   Dark:   #0b1320 base | #555C64 gris estructural
   Contraste minimo objetivo: AA (4.5:1), mayormente AAA
   ============================================================ */

/* ---------- TOKENS: MODO OSCURO ---------- */
:root {
  color-scheme: dark;

  --bg:    #0b1320;
  --bg2:   #0e1724;
  --card:  #111c2b;
  --card2: #16202f;

  --line:         rgba(85, 92, 100, .55);
  --line-solid:   #555C64;
  --border-hover: rgba(161, 183, 171, .65);

  --ink:   #F0F0F0;
  --muted: #A1B7AB;

  --accent:        #A1B7AB;
  --accent-strong: #D7E3DC;
  --on-accent:     #0b1320;
  --grad:          linear-gradient(92deg, #004D61, #3E5641);
  --on-grad:       #FFFFFF;
  --grad-text:     linear-gradient(92deg, #F0F0F0 15%, #A1B7AB 85%);
  --cover:         linear-gradient(90deg, #A1B7AB 0%, #2A713A 45%, #21443D 78%, #033323 100%);

  --tag-bg:       rgba(161, 183, 171, .12);
  --tag-bg-hover: rgba(161, 183, 171, .20);
  --tag-fg:       #A1B7AB;
  --icon-bg:      rgba(0, 77, 97, .30);
  --icon-fg:      #8FD0DE;
  --svc-num:      rgba(161, 183, 171, .22);
  --nav-bg:       rgba(11, 19, 32, .90);
  --chip-bg:      rgba(17, 28, 43, .90);
  --input-bg:     #0e1724;
  --pulse:        rgba(161, 183, 171, .50);

  --shadow:        rgba(0, 0, 0, .50);
  --shadow-strong: rgba(0, 0, 0, .65);
  --particle:      161, 183, 171;
  --hero-overlay:     linear-gradient(180deg, rgba(11,19,32,.92) 0%, rgba(11,19,32,.76) 45%, var(--bg) 100%);
  --portrait-overlay: linear-gradient(180deg, transparent 60%, rgba(11,19,32,.90));

  --font-h: "Sora", system-ui, sans-serif;
  --font-b: "Manrope", system-ui, sans-serif;
  --section-space: 110px;
}

/* ---------- TOKENS: MODO CLARO ---------- */
[data-theme="light"] {
  color-scheme: light;

  --bg:    #F0F0F0;
  --bg2:   #E9E9E6;
  --card:  #FFFFFF;
  --card2: #FAFAFA;

  --line:         #C9C8C0;
  --line-solid:   #B4B3AA;
  --border-hover: rgba(0, 77, 97, .55);

  --ink:   #21443D;
  --muted: #4A6157;

  --accent:        #004D61;
  --accent-strong: #21443D;
  --on-accent:     #FFFFFF;
  --grad:          linear-gradient(92deg, #004D61, #3E5641);
  --on-grad:       #FFFFFF;
  --grad-text:     linear-gradient(92deg, #004D61 15%, #3E5641 85%);
  --cover:         linear-gradient(90deg, #A1B7AB 0%, #2A713A 45%, #21443D 78%, #033323 100%);

  --tag-bg:       rgba(62, 86, 65, .10);
  --tag-bg-hover: rgba(62, 86, 65, .18);
  --tag-fg:       #3E5641;
  --icon-bg:      rgba(0, 77, 97, .10);
  --icon-fg:      #004D61;
  --svc-num:      rgba(0, 77, 97, .20);
  --nav-bg:       rgba(240, 240, 240, .92);
  --chip-bg:      rgba(255, 255, 255, .94);
  --input-bg:     #FAFAFA;
  --pulse:        rgba(0, 77, 97, .45);

  --shadow:        rgba(33, 68, 61, .12);
  --shadow-strong: rgba(33, 68, 61, .22);
  --particle:      62, 86, 65;
  --hero-overlay:     linear-gradient(180deg, rgba(240,240,240,.93) 0%, rgba(240,240,240,.80) 45%, var(--bg) 100%);
  --portrait-overlay: linear-gradient(180deg, transparent 60%, rgba(255,255,255,.90));
}

/* ---------- RESET ---------- */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 92px; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-b);
  line-height: 1.7;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  transition: background-color .4s ease, color .4s ease;
}

::selection { background: var(--accent); color: var(--on-accent); }

::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--line-solid); border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent); }

h1, h2, h3, h4 { font-family: var(--font-h); line-height: 1.15; }
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
.container { max-width: 1180px; margin-inline: auto; padding-inline: 24px; }

/* ---------- JUSTIFICACION GLOBAL DE PARRAFOS ---------- */
.hero-quote,
.sec-lead,
.cv-text p,
.cv-item p,
.svc-card p,
.proj-body p,
.info-card p,
.form-card > p,
.form-note {
  text-align: justify;
  hyphens: none;
  -webkit-hyphens: none;
}

/* ---------- SKIP LINK ---------- */
.skip-link {
  position: absolute; top: -100%; left: 16px;
  padding: 12px 24px; background: var(--accent); color: var(--on-accent);
  font-weight: 700; border-radius: 8px; z-index: 9999; transition: top .3s;
}
.skip-link:focus { top: 16px; }

/* ---------- PROGRESO DE SCROLL ---------- */
#scrollProgress {
  position: fixed; top: 0; left: 0; height: 3px; width: 0;
  background: var(--grad); z-index: 1200; border-radius: 0 4px 4px 0;
}

/* ---------- PARTICULAS ---------- */
#particlesCanvas {
  position: fixed; inset: 0; width: 100%; height: 100%;
  pointer-events: none; z-index: 0; opacity: .55;
}

/* ---------- NAVBAR ---------- */
#navbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
  transition: background .35s, box-shadow .35s, border-color .35s;
  border-bottom: 1px solid transparent;
}
#navbar.scrolled {
  background: var(--nav-bg);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-color: var(--line);
  box-shadow: 0 10px 30px var(--shadow);
}
.nav-inner { display: flex; align-items: center; justify-content: space-between; height: 78px; }

.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand-logo { width: 44px; height: 44px; object-fit: contain; }
.brand-logo-sm { width: 38px; height: 38px; }
[data-theme="dark"]  .logo-light { display: none; }
[data-theme="light"] .logo-dark  { display: none; }

/* Linea unica de especialidades (navbar y footer) */
.brand-text {
  font-family: var(--font-h); font-weight: 700; font-size: .84rem;
  display: flex; align-items: center; gap: .35em; flex-wrap: nowrap;
  letter-spacing: .04em; color: var(--ink); line-height: 1.35;
}
.brand-item { white-space: nowrap; }
.brand-separator { margin-left: .25em; }

.nav-links { display: flex; align-items: center; gap: 6px; list-style: none; }
.nav-links a { padding: 9px 15px; border-radius: 10px; font-size: .92rem; font-weight: 500; color: var(--muted); transition: color .25s, background .25s; }
.nav-links a:hover { color: var(--ink); background: var(--tag-bg); }
.nav-links a.active { color: var(--accent); font-weight: 700; }
.nav-links a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.nav-cta { margin-left: 10px; }

.nav-actions { display: flex; align-items: center; gap: 10px; }

.theme-toggle {
  width: 44px; height: 44px; border-radius: 12px;
  border: 1px solid var(--line); background: var(--card);
  color: var(--accent); cursor: pointer;
  display: grid; place-items: center; position: relative; overflow: hidden;
  transition: border-color .3s, transform .3s, background-color .4s;
}
.theme-toggle:hover { border-color: var(--border-hover); transform: scale(1.05); }
.theme-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.theme-toggle .icon-sun, .theme-toggle .icon-moon { position: absolute; transition: opacity .3s, transform .3s; }
[data-theme="dark"]  .icon-sun  { opacity: 1; transform: rotate(0); }
[data-theme="dark"]  .icon-moon { opacity: 0; transform: rotate(90deg); }
[data-theme="light"] .icon-sun  { opacity: 0; transform: rotate(-90deg); }
[data-theme="light"] .icon-moon { opacity: 1; transform: rotate(0); }

#menuBtn {
  display: none; background: none; border: 1px solid var(--line);
  border-radius: 10px; width: 44px; height: 44px; cursor: pointer;
  flex-direction: column; align-items: center; justify-content: center; gap: 5px;
  transition: border-color .25s;
}
#menuBtn:hover { border-color: var(--border-hover); }
#menuBtn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.hamburger-line { width: 20px; height: 2px; background: var(--ink); transition: transform .3s, opacity .3s; }
#menuBtn[aria-expanded="true"] .hamburger-line:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
#menuBtn[aria-expanded="true"] .hamburger-line:nth-child(2) { opacity: 0; }
#menuBtn[aria-expanded="true"] .hamburger-line:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

/* ---------- BOTONES ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 14px 26px; border-radius: 14px; font-family: var(--font-h);
  font-weight: 700; font-size: .92rem; cursor: pointer;
  transition: transform .25s, box-shadow .25s, background .25s, border-color .25s;
  border: 1px solid transparent;
}
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.btn-primary {
  background: var(--grad);
  color: var(--on-grad);
  box-shadow: 0 10px 28px rgba(0, 77, 97, .30), inset 0 0 0 1px rgba(255, 255, 255, .16);
}
.btn-primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 16px 36px rgba(0, 77, 97, .40), inset 0 0 0 1px rgba(255, 255, 255, .26);
}
.nav-links a.btn-primary,
.nav-links a.btn-primary:hover {
  color: var(--on-grad);
  background: var(--grad);
  border-color: transparent;
}
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line-solid); }
.btn-ghost:hover { border-color: var(--border-hover); background: var(--tag-bg); transform: translateY(-3px); }
.btn-sm { padding: 10px 20px; font-size: .85rem; border-radius: 11px; }
.btn-full { width: 100%; justify-content: center; }

/* ---------- HERO ---------- */
#inicio { position: relative; padding: 0 0 var(--section-space); background: var(--bg); }

.hero-main { position: relative; overflow: hidden; padding: var(--section-space) 0; }

.hero-bg {
  position: absolute; inset: 0;
  background: url("../assets/images/hero-bg.webp") center/cover no-repeat;
  animation: heroZoom 26s ease-in-out infinite alternate;
}
@keyframes heroZoom { from { transform: scale(1); } to { transform: scale(1.12); } }
.hero-bg::after { content: ""; position: absolute; inset: 0; background: var(--hero-overlay); }

.hero-topo {
  position: absolute; inset: 0; pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='700' height='700' viewBox='0 0 700 700'%3E%3Cg fill='none' stroke='%23A1B7AB' stroke-opacity='0.06' stroke-width='1.3'%3E%3Cpath d='M0 80c90-50 180-50 270 0s180 50 270 0 160-50 160-50'/%3E%3Cpath d='M0 160c90-55 180-55 270 0s180 55 270 0 160-55 160-55'/%3E%3Cpath d='M0 250c90-45 180-45 270 0s180 45 270 0 160-45 160-45'/%3E%3Cpath d='M0 340c90-60 180-60 270 0s180 60 270 0 160-60 160-60'/%3E%3Cpath d='M0 430c90-50 180-50 270 0s180 50 270 0 160-50 160-50'/%3E%3Cpath d='M0 520c90-55 180-55 270 0s180 55 270 0 160-55 160-55'/%3E%3Cpath d='M0 610c90-45 180-45 270 0s180 45 270 0 160-45 160-45'/%3E%3C/g%3E%3C/svg%3E");
}
[data-theme="light"] .hero-topo {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='700' height='700' viewBox='0 0 700 700'%3E%3Cg fill='none' stroke='%233E5641' stroke-opacity='0.08' stroke-width='1.3'%3E%3Cpath d='M0 80c90-50 180-50 270 0s180 50 270 0 160-50 160-50'/%3E%3Cpath d='M0 160c90-55 180-55 270 0s180 55 270 0 160-55 160-55'/%3E%3Cpath d='M0 250c90-45 180-45 270 0s180 45 270 0 160-45 160-45'/%3E%3Cpath d='M0 340c90-60 180-60 270 0s180 60 270 0 160-60 160-60'/%3E%3Cpath d='M0 430c90-50 180-50 270 0s180 50 270 0 160-50 160-50'/%3E%3Cpath d='M0 520c90-55 180-55 270 0s180 55 270 0 160-55 160-55'/%3E%3Cpath d='M0 610c90-45 180-45 270 0s180 45 270 0 160-45 160-45'/%3E%3C/g%3E%3C/svg%3E");
}

.hero-grid { position: relative; display: grid; grid-template-columns: 1.15fr .85fr; gap: 60px; align-items: center; z-index: 2; }

.hero-eyebrow { animation: slideUp .6s ease .1s both; }
.hero-title   { animation: slideUp .6s ease .25s both; }
.hero-rotate  { animation: slideUp .6s ease .4s both; }
.hero-quote   { animation: slideUp .6s ease .55s both; }
.hero-actions { animation: slideUp .6s ease .7s both; }
.hero-stats   { animation: slideUp .6s ease .85s both; }
@keyframes slideUp { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: translateY(0); } }

.hero-eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 8px 16px; border: 1px solid var(--line); border-radius: 999px;
  background: var(--chip-bg); backdrop-filter: blur(8px);
  font-size: .78rem; letter-spacing: .22em; text-transform: uppercase;
  color: var(--accent); font-weight: 700; margin-bottom: 26px;
}
.pulse-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 0 var(--pulse); animation: pulse 2s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 12px rgba(0,0,0,0); } 100% { box-shadow: 0 0 0 0 rgba(0,0,0,0); } }

/* Titulo ajustado: proporcionado al resto de la pagina */
.hero-title {
  font-size: clamp(1.8rem, 3.4vw, 2.6rem);
  font-weight: 800; letter-spacing: -.015em; margin-bottom: 14px;
  text-wrap: balance;
}
.hero-title .grad { background: var(--grad-text); -webkit-background-clip: text; background-clip: text; color: transparent; }

.hero-rotate { font-family: var(--font-h); font-size: clamp(1.05rem, 2vw, 1.35rem); font-weight: 700; color: var(--accent); margin-bottom: 20px; min-height: 1.8em; }
.hero-rotate span { display: inline-block; animation: fadeWord .5s ease; }
@keyframes fadeWord { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }

.hero-quote { color: var(--muted); font-size: 1.05rem; max-width: 560px; border-left: 3px solid var(--accent); padding-left: 18px; margin-bottom: 34px; font-style: italic; }
.hero-actions { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 52px; }

/* Stats: 3 columnas (experiencia, capacitaciones, sectores) */
.hero-stats { display: grid; grid-template-columns: repeat(3, auto); gap: 32px 48px; width: max-content; }
.stat b { display: block; font-family: var(--font-h); font-size: 2rem; font-weight: 800; color: var(--accent); }
.stat b small { font-size: .95rem; font-weight: 700; letter-spacing: 0; }
/*.stat--text b { font-size: 1.35rem; letter-spacing: .02em; padding-top: .32rem; } */
/*.stat span { font-size: .8rem; color: var(--muted); letter-spacing: .06em; text-transform: uppercase; } */

.hero-portrait { position: relative; justify-self: center; animation: slideUp .8s ease .3s both; }
.portrait-frame {
  position: relative; width: min(380px, 80vw); border-radius: 26px;
  overflow: hidden; border: 1px solid var(--line-solid);
  box-shadow: 0 30px 80px var(--shadow-strong);
}
.portrait-frame::before { content: ""; position: absolute; inset: 0; background: var(--portrait-overlay); z-index: 1; }
.portrait-frame img { width: 100%; aspect-ratio: 4/5; object-fit: cover; }
.portrait-name { position: absolute; left: 20px; right: 20px; bottom: 18px; z-index: 2; }
.portrait-name span {
  display: block; font-size: .82rem; font-weight: 600;
  color: var(--accent); letter-spacing: .02em; line-height: 1.45;
}

/* ---------- ESCALA DE COBERTURA VEGETAL ---------- */
.cover-wrap { margin-top: 16px; width: min(380px, 80vw); }
.cover-strip { height: 6px; border-radius: 99px; background: var(--cover); position: relative; overflow: hidden; }
.cover-strip::after {
  content: ""; position: absolute; top: -2px; width: 3px; height: 10px;
  background: #fff; border-radius: 2px; box-shadow: 0 0 8px rgba(255, 255, 255, .8);
  animation: scan 4s linear infinite;
}
@keyframes scan { from { left: 0; } to { left: 100%; } }
.cover-labels {
  display: flex; justify-content: space-between; margin-top: 6px;
  font-size: .62rem; font-weight: 700; letter-spacing: .14em;
  text-transform: uppercase; color: var(--muted);
}

.topo-rule {
  height: 14px; width: 132px; margin: 22px 0 0;
  background-repeat: no-repeat; background-size: contain;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='132' height='14' viewBox='0 0 132 14'%3E%3Cg fill='none' stroke='%23A1B7AB' stroke-opacity='.8' stroke-width='1.6' stroke-linecap='round'%3E%3Cpath d='M2 4c22-4 44 4 66 0s44-4 62 0'/%3E%3Cpath d='M2 8c22-4 44 4 66 0s44-4 62 0'/%3E%3Cpath d='M2 12c22-4 44 4 66 0s44-4 62 0'/%3E%3C/g%3E%3C/svg%3E");
}
[data-theme="light"] .topo-rule {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='132' height='14' viewBox='0 0 132 14'%3E%3Cg fill='none' stroke='%233E5641' stroke-opacity='.85' stroke-width='1.6' stroke-linecap='round'%3E%3Cpath d='M2 4c22-4 44 4 66 0s44-4 62 0'/%3E%3Cpath d='M2 8c22-4 44 4 66 0s44-4 62 0'/%3E%3Cpath d='M2 12c22-4 44 4 66 0s44-4 62 0'/%3E%3C/g%3E%3C/svg%3E");
}

.float-chip {
  position: absolute; z-index: 3; display: flex; align-items: center; gap: 8px;
  padding: 10px 16px; border-radius: 12px; background: var(--chip-bg);
  backdrop-filter: blur(10px); border: 1px solid var(--line-solid);
  font-size: .78rem; font-weight: 700; box-shadow: 0 14px 34px var(--shadow);
  animation: float 6s ease-in-out infinite; color: var(--ink);
}
.float-chip svg { color: var(--accent); flex: 0 0 auto; }
.chip-a { top: 8%; left: -14%; }
.chip-b { top: 38%; right: -16%; animation-delay: 1.4s; }
.chip-c { bottom: 14%; left: -10%; animation-delay: 2.6s; }
@keyframes float { 50% { transform: translateY(-12px); } }

/* ---------- MARQUEE ---------- */
.marquee { border-block: 1px solid var(--line); background: var(--bg2); overflow: hidden; padding: 18px 0; position: relative; z-index: 1; }
.marquee-track { display: flex; gap: 56px; width: max-content; animation: marquee 32s linear infinite; }
.marquee:hover .marquee-track { animation-play-state: paused; }
.marquee-track span {
  display: flex; align-items: center; gap: 12px; font-family: var(--font-h);
  font-weight: 600; font-size: .9rem; color: var(--muted);
  letter-spacing: .12em; text-transform: uppercase; white-space: nowrap;
}
.marquee-track span::before {
  content: ""; width: 6px; height: 6px; flex: 0 0 auto;
  background: var(--accent); transform: rotate(45deg); border-radius: 1px;
}
@keyframes marquee { to { transform: translateX(-50%); } }

/* ---------- SECCIONES ---------- */
section { padding: var(--section-space) 0; position: relative; z-index: 1; }
.eyebrow { display: inline-block; font-size: .75rem; font-weight: 700; letter-spacing: .34em; text-transform: uppercase; color: var(--accent); margin-bottom: 14px; }
.sec-title { font-size: clamp(1.8rem, 3.6vw, 2.6rem); font-weight: 800; letter-spacing: -.01em; margin-bottom: 12px; }
.sec-lead {
  color: var(--muted);
  width: 100%;
  max-width: 100%;
  text-align: left;
  overflow-wrap: break-word;
}
.highlight { color: var(--accent); }

/* ---------- CURRICULUM ---------- */
#curriculo { background: var(--bg2); }
.cv-grid { display: grid; grid-template-columns: .9fr 1.1fr; gap: 64px; align-items: start; }
.cv-card { background: var(--card); border: 1px solid var(--line); border-radius: 22px; padding: 34px; position: sticky; top: 110px; transition: background-color .4s, border-color .4s; }
.cv-card h3:not(.cv-section-title) { font-size: 1.25rem; margin-bottom: 12px; }

/* Items sin divisorias internas */
.cv-item { padding: 9px 0; }
.cv-item .yr {
  display: block; font-family: var(--font-h); font-weight: 700;
  font-size: .72rem; letter-spacing: .06em; color: var(--accent);
  margin-bottom: 2px;
}
.cv-item b { display: block; font-size: .95rem; }
.cv-item p { font-size: .85rem; color: var(--muted); }

/* Unica divisoria: entre Trayectoria (experiencia) y Educacion */
.cv-divider { border-top: 1px dashed var(--line); margin: 16px 0 14px; }

.cv-section-title {
  font-family: var(--font-h); font-size: 1.20rem; font-weight: 800;
  letter-spacing: .2em; text-transform: uppercase; color: var(--accent);
  margin: 0 0 6px;
}

.cv-actions { margin-top: 26px; display: flex; gap: 12px; flex-wrap: wrap; }
.cv-text p { color: var(--muted); margin-bottom: 18px; }
.cv-text p strong { color: var(--ink); }
.cv-chips { display: flex; flex-wrap: wrap; gap: 10px; margin: 26px 0 34px; list-style: none; }
.cv-chips li {
  padding: 9px 16px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--card); font-size: .83rem; font-weight: 600; color: var(--muted);
  transition: border-color .25s, color .25s, transform .25s;
}
.cv-chips li:hover { border-color: var(--border-hover); color: var(--ink); transform: translateY(-2px); }
.cv-chips li::before {
  content: ""; display: inline-block; width: 0; height: 0; margin-right: 8px;
  border-left: 6px solid var(--accent);
  border-top: 4px solid transparent;
  border-bottom: 4px solid transparent;
  vertical-align: middle;
}
.cv-cta-group { display: flex; gap: 14px; flex-wrap: wrap; }

/* ---------- SERVICIOS ---------- */
.svc-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; margin-top: 56px; }
.svc-card {
  background: var(--card); border: 1px solid var(--line); border-radius: 20px;
  padding: 34px 30px; position: relative; overflow: hidden;
  transition: transform .35s, border-color .35s, box-shadow .35s, background-color .4s;
}
.svc-card::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 3px; background: var(--grad); transform: scaleX(0); transform-origin: left; transition: transform .4s; }
.svc-card:hover { transform: translateY(-8px); border-color: var(--border-hover); box-shadow: 0 24px 60px var(--shadow); }
.svc-card:hover::before { transform: scaleX(1); }
.svc-icon {
  width: 56px; height: 56px; border-radius: 16px;
  background: var(--icon-bg); border: 1px solid var(--line);
  display: grid; place-items: center; margin-bottom: 22px;
  color: var(--icon-fg); transition: background .3s, transform .3s;
}
.svc-card:hover .svc-icon { background: var(--tag-bg-hover); transform: rotate(-6deg) scale(1.06); }
.svc-card h3 { font-size: 1.08rem; margin-bottom: 10px; }
.svc-card p { font-size: .9rem; color: var(--muted); }
.svc-num { position: absolute; top: 24px; right: 26px; font-family: var(--font-h); font-weight: 800; font-size: 1rem; color: var(--svc-num); }

/* ---------- PROYECTOS ---------- */
#proyectos { background: var(--bg2); }
.proj-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; }
.proj-head-text { min-width: 0; }
.proj-controls { display: flex; gap: 10px; flex-shrink: 0; padding-bottom: 4px; }
.proj-arrow {
  width: 46px; height: 46px; border-radius: 12px;
  border: 1px solid var(--line); background: var(--card);
  color: var(--accent); cursor: pointer;
  display: grid; place-items: center;
  transition: border-color .25s, transform .25s, background-color .4s;
}
.proj-arrow:hover { border-color: var(--border-hover); background: var(--tag-bg); transform: translateY(-2px); }
.proj-arrow:active { transform: translateY(0) scale(.94); }
.proj-arrow:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.proj-carousel { overflow: hidden; margin-top: 56px; }
.proj-grid {
  display: flex; gap: 28px; margin-top: 0;
  transition: transform .75s cubic-bezier(.2, .7, .2, 1);
  will-change: transform;
}
.proj-card {
  background: var(--card); border: 1px solid var(--line); border-radius: 22px;
  overflow: hidden; display: flex; flex-direction: column;
  flex: 0 0 calc((100% - 28px) / 2); min-width: 0;
  transition: transform .35s, box-shadow .35s, border-color .35s, background-color .4s;
}
.proj-card:hover { transform: translateY(-8px); border-color: var(--border-hover); box-shadow: 0 28px 70px var(--shadow-strong); }
.proj-media { position: relative; overflow: hidden; aspect-ratio: 16/10; }
.proj-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .8s cubic-bezier(.2, .7, .2, 1); }
.proj-card:hover .proj-media img { transform: scale(1.08); }
.proj-media::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 55%, rgba(11, 19, 32, .9)); }
.proj-tag-top {
  position: absolute; top: 16px; left: 16px; z-index: 2;
  padding: 7px 14px; border-radius: 999px; background: var(--chip-bg);
  backdrop-filter: blur(8px); border: 1px solid var(--line-solid);
  font-size: .72rem; font-weight: 700; letter-spacing: .14em;
  text-transform: uppercase; color: var(--accent);
}
.proj-body { padding: 28px 30px 30px; display: flex; flex-direction: column; gap: 12px; flex: 1; }
.proj-body h3 { font-size: 1.25rem; }
.proj-body p { font-size: .92rem; color: var(--muted); flex: 1; }
.proj-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.proj-tags span { padding: 6px 12px; border-radius: 8px; background: var(--tag-bg); border: 1px solid var(--line); font-size: .74rem; font-weight: 700; color: var(--tag-fg); }
.proj-link { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; font-size: .88rem; color: var(--accent); margin-top: 6px; transition: gap .25s; }
.proj-link:hover { gap: 14px; }

/* ---------- CONTACTO ---------- */
.contact-grid { display: grid; grid-template-columns: .85fr 1.15fr; gap: 40px; margin-top: 56px; align-items: start; }
.info-card {
  display: flex; gap: 18px; align-items: flex-start;
  background: var(--card); border: 1px solid var(--line); border-radius: 18px;
  padding: 24px; margin-bottom: 18px;
  transition: transform .3s, border-color .3s, background-color .4s;
}
.info-card:hover { transform: translateX(8px); border-color: var(--border-hover); }
.info-ico { flex: 0 0 50px; height: 50px; border-radius: 14px; background: var(--icon-bg); display: grid; place-items: center; color: var(--icon-fg); }
.info-card b { font-family: var(--font-h); display: block; margin-bottom: 4px; }
.info-card a, .info-card p { color: var(--muted); font-size: .92rem; display: block; transition: color .25s; }
.info-card a:hover { color: var(--accent); }

.form-card { background: var(--card); border: 1px solid var(--line); border-radius: 22px; padding: 40px; transition: background-color .4s, border-color .4s; }
.form-card h3 { font-size: 1.3rem; margin-bottom: 6px; }
.form-card > p { color: var(--muted); font-size: .9rem; margin-bottom: 28px; }
.f-row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.f-group { margin-bottom: 18px; }
.f-group label { display: block; font-size: .78rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; }
.f-group input, .f-group textarea, .f-group select {
  width: 100%; background: var(--input-bg); border: 1px solid var(--line-solid);
  border-radius: 12px; padding: 14px 16px; color: var(--ink);
  font-family: var(--font-b); font-size: .95rem; outline: none;
  transition: border-color .25s, box-shadow .25s, background-color .4s;
}
.f-group input:focus, .f-group textarea:focus, .f-group select:focus {
  border-color: var(--accent); box-shadow: 0 0 0 4px var(--tag-bg);
}
.f-group textarea { resize: vertical; min-height: 130px; }
.form-note { margin-top: 14px; font-size: .8rem; color: var(--muted); }
.hp-field {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* ---------- FOOTER ---------- */
footer { border-top: 1px solid var(--line); background: var(--bg2); padding: 44px 0; position: relative; z-index: 1; }
.foot-inner { display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.foot-inner p { color: var(--muted); font-size: .88rem; }
.foot-social { display: flex; gap: 12px; }
.foot-social a {
  width: 42px; height: 42px; border-radius: 12px; border: 1px solid var(--line-solid);
  display: grid; place-items: center; color: var(--muted); transition: all .25s;
}
.foot-social a:hover { color: var(--on-grad); background: var(--grad); border-color: transparent; transform: translateY(-4px); }
.foot-social a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- UTILIDADES ---------- */
#toTop { 
  position: fixed; right: 26px; bottom: 26px; width: 52px; height: 52px;
  border-radius: 14px; border: none; background: var(--grad); color: var(--on-grad);
  cursor: pointer; opacity: 0; pointer-events: none;
  display: grid; place-items: center;
  transform: translateY(16px); transition: all .35s; z-index: 1100;
  box-shadow: 0 12px 30px rgba(0, 77, 97, .30);
}
#toTop.show { opacity: 1; pointer-events: auto; transform: translateY(0); }
#toTop.near-footer { bottom: 100px; }
#toTop:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }

#toast {
  position: fixed; left: 50%; bottom: 34px; transform: translate(-50%, 80px);
  background: var(--card2); border: 1px solid var(--accent); color: var(--ink);
  padding: 14px 26px; border-radius: 14px; font-size: .9rem; font-weight: 600;
  z-index: 1300; transition: transform .45s cubic-bezier(.2, .9, .3, 1.2);
  box-shadow: 0 20px 50px var(--shadow-strong); max-width: min(92vw, 480px);
  text-align: center;
}
#toast.show { transform: translate(-50%, 0); }

.reveal { opacity: 0; transform: translateY(36px); transition: opacity .8s ease, transform .8s ease; }
.reveal.in { opacity: 1; transform: translateY(0); }
.d1 { transition-delay: .1s; } .d2 { transition-delay: .2s; }
.d3 { transition-delay: .3s; } .d4 { transition-delay: .4s; }

/* ---------- RESPONSIVE ---------- */
@media (max-width: 1024px) {
  .hero-grid { grid-template-columns: 1fr; gap: 70px; }
  .hero-portrait { order: -1; }
  .chip-a { left: 0; } .chip-b { right: 0; } .chip-c { left: 4%; }
  .svc-grid { grid-template-columns: repeat(2, 1fr); }
  .cv-grid, .contact-grid { grid-template-columns: 1fr; }
  .cv-card { position: static; }
}
@media (max-width: 1120px) {
  .brand-text {
    max-width: clamp(180px, 20vw, 240px);
    font-size: clamp(.68rem, .75vw, .82rem);
    flex-wrap: wrap;
    row-gap: 0;
  }
  .nav-links a { padding-inline: 10px; font-size: .86rem; }
  .nav-cta { margin-left: 4px; }
}
@media (max-width: 820px) {
  #menuBtn { display: flex; }
  .brand-text { max-width: 320px; flex-wrap: wrap; row-gap: 0; }
  .nav-links {
    position: fixed; top: 78px; left: 0; right: 0;
    background: var(--nav-bg); backdrop-filter: blur(16px);
    flex-direction: column; align-items: stretch; padding: 20px 24px 28px;
    gap: 8px; border-bottom: 1px solid var(--line);
    transform: translateY(-130%); transition: transform .4s; z-index: 990;
  }
  .nav-links.open { transform: translateY(0); }
  .nav-links a { display: block; padding: 14px; }
  .nav-cta { margin: 10px 0 0; }
}
@media (max-width: 820px) {
  .proj-card { flex-basis: 100%; }
}
@media (max-width: 480px) {
  :root { --section-space: 80px; }
  .brand-text {
    display: flex;
    max-width: 150px;
    font-size: .68rem;
    line-height: 1.15;
    letter-spacing: .02em;
    flex-wrap: wrap;
    row-gap: 0;
  }
  .svc-grid { grid-template-columns: 1fr; }
  .proj-head { flex-direction: column; align-items: flex-start; }
  .proj-controls { padding-bottom: 0; }
  .f-row { grid-template-columns: 1fr; }
  .form-card { padding: 28px 22px; }
  .hero-stats { grid-template-columns: repeat(3, 1fr); width: 100%; gap: 14px; }
  .stat b { font-size: 1.35rem; }
  .stat b small { font-size: .8rem; }
  .stat--text b { font-size: 1rem; padding-top: .2rem; }
  .stat span { font-size: .66rem; }
  .hero-actions { flex-direction: column; }
  .hero-actions .btn { width: 100%; justify-content: center; }
  .cv-cta-group { flex-direction: column; }
  .cv-cta-group .btn { width: 100%; justify-content: center; }
  .foot-inner { flex-direction: column; text-align: center; }
}
@media (max-width: 360px) {
  .container { padding-inline: 16px; }
  .brand-text { max-width: 110px; font-size: .6rem; }
}

/* ---------- MOVIMIENTO REDUCIDO ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; }
  #particlesCanvas { display: none; }
}
