/* ==========================================================================
   Anghelo Rengifo — hoja de estilos principal
   Escrita a mano. Sin frameworks.
   ========================================================================== */

/* --------------------------------------------------------------------------
   0. Fuentes autoalojadas
   Instancias estáticas (no variables) recortadas al set de caracteres
   real del sitio: ASCII completo + acentos españoles + símbolos usados.
   -------------------------------------------------------------------------- */

@font-face {
  font-family: 'Bricolage Grotesque';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('../fonts/bricolage-600-normal.woff2') format('woff2');
}

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/inter-400-normal.woff2') format('woff2');
}

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('../fonts/inter-500-normal.woff2') format('woff2');
}

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('../fonts/inter-600-normal.woff2') format('woff2');
}

@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/jbmono-400-normal.woff2') format('woff2');
}

@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('../fonts/jbmono-500-normal.woff2') format('woff2');
}

@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('../fonts/jbmono-700-normal.woff2') format('woff2');
}

/* --------------------------------------------------------------------------
   1. Tokens
   -------------------------------------------------------------------------- */

:root {
  --font-sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-display: "Bricolage Grotesque", "Inter", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Consolas, monospace;

  /* Tema claro (por defecto) */
  --bg: #f5f8f6;
  --bg-alt: #eaf1ec;
  --surface: #ffffff;
  --surface-2: #f1f6f2;
  --line: #d2e2d9;
  --line-strong: #b3c9bb;
  --ink: #0f1a14;
  --ink-2: #37473e;
  --muted: #667a6f;
  --brand: #107a56;
  --brand-strong: #0b5f42;
  --brand-soft: #e2f2e9;
  --brand-glow: rgba(16, 122, 86, 0.22);
  --on-brand: #ffffff;
  --shadow-sm: 0 1px 2px rgba(15, 26, 20, 0.06), 0 1px 1px rgba(15, 26, 20, 0.04);
  --shadow-md: 0 10px 26px -10px rgba(15, 26, 20, 0.18);
  --shadow-lg: 0 24px 60px -28px rgba(15, 26, 20, 0.35);
  --shadow-brand: 0 14px 34px -14px rgba(16, 122, 86, 0.38);

  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 22px;
  --header-h: 68px;
  --ease: cubic-bezier(0.22, 0.72, 0.28, 1);
}

:root[data-theme="dark"] {
  --bg: #070d0a;
  --bg-alt: #0b1310;
  --surface: #0f1814;
  --surface-2: #15211b;
  --line: #21302a;
  --line-strong: #2e4037;
  --ink: #e8f1ec;
  --ink-2: #bacbc1;
  --muted: #87998f;
  --brand: #3ddc97;
  --brand-strong: #6ceab3;
  --brand-soft: #10281e;
  --brand-glow: rgba(61, 220, 151, 0.16);
  --on-brand: #04140d;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 6px 20px -8px rgba(0, 0, 0, 0.6);
  --shadow-lg: 0 24px 60px -28px rgba(0, 0, 0, 0.85);
  --shadow-brand: 0 14px 34px -14px rgba(61, 220, 151, 0.3);
}

/* --------------------------------------------------------------------------
   2. Base
   -------------------------------------------------------------------------- */

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

* { margin: 0; }

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

body {
  background: var(--bg);
  color: var(--ink-2);
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

body.nav-open { overflow: hidden; }

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

img { height: auto; }

a {
  color: var(--brand);
  text-decoration: none;
  transition: color 0.2s var(--ease);
}

a:hover { color: var(--brand-strong); }

button,
input,
textarea,
select {
  font: inherit;
  color: inherit;
}

button { cursor: pointer; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  color: var(--ink);
  line-height: 1.15;
  font-weight: 600;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

p { text-wrap: pretty; }

ul { padding: 0; list-style: none; }

::selection {
  background: var(--brand);
  color: var(--on-brand);
}

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

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

.skip-link {
  position: absolute;
  left: 50%;
  top: 8px;
  transform: translate(-50%, -180%);
  z-index: 200;
  background: var(--brand);
  color: var(--on-brand);
  padding: 0.6rem 1.1rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  transition: transform 0.25s var(--ease);
}

.skip-link:focus-visible {
  transform: translate(-50%, 0);
  color: var(--on-brand);
}

.icon {
  width: 1.25em;
  height: 1.25em;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.icon--solid {
  fill: currentColor;
  stroke: none;
}

/* --------------------------------------------------------------------------
   3. Layout
   -------------------------------------------------------------------------- */

.wrap {
  width: min(1180px, 100% - 2.5rem);
  margin-inline: auto;
}

.section {
  padding-block: clamp(4.5rem, 9vw, 7.5rem);
  position: relative;
}

.section--alt { background: var(--bg-alt); }

.section-head {
  max-width: 62ch;
  margin-bottom: clamp(2.5rem, 5vw, 3.75rem);
}

.section-head--center {
  margin-inline: auto;
  text-align: center;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--brand-strong);
  background: var(--brand-soft);
  border: 1px solid color-mix(in srgb, var(--brand) 22%, transparent);
  padding: 0.4rem 0.85rem 0.4rem 0.65rem;
  border-radius: 999px;
  margin-bottom: 1.1rem;
}

.eyebrow::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--brand);
  flex: none;
}

.section-head h2 {
  font-size: clamp(1.9rem, 4.4vw, 2.85rem);
  margin-bottom: 1rem;
}

.section-head p {
  color: var(--muted);
  font-size: 1.02rem;
}

/* --------------------------------------------------------------------------
   4. Botones y chips
   -------------------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  padding: 0.8rem 1.4rem;
  border: 1px solid transparent;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.95rem;
  line-height: 1.2;
  white-space: nowrap;
  transition: transform 0.2s var(--ease), background-color 0.2s var(--ease),
    border-color 0.2s var(--ease), color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}

.btn:active { transform: translateY(1px); }

.btn .icon { width: 1.1em; height: 1.1em; }

.btn--primary {
  background: var(--brand);
  color: var(--on-brand);
  box-shadow: 0 10px 24px -12px var(--brand-glow);
}

.btn--primary:hover {
  background: var(--brand-strong);
  color: var(--on-brand);
  box-shadow: 0 14px 30px -12px var(--brand-glow);
}

.btn--ghost {
  border-color: var(--line-strong);
  color: var(--ink);
  background: transparent;
}

.btn--ghost:hover {
  border-color: var(--brand);
  color: var(--brand);
  background: var(--brand-soft);
}

.btn--block { width: 100%; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink-2);
  font-size: 0.83rem;
  font-family: var(--font-mono);
  letter-spacing: -0.01em;
}

/* --------------------------------------------------------------------------
   5. Barra de progreso + header
   -------------------------------------------------------------------------- */

.progress-rail {
  position: fixed;
  inset: 0 0 auto 0;
  height: 2px;
  z-index: 120;
  background: transparent;
  pointer-events: none;
}

.progress-rail__fill {
  height: 100%;
  width: 0;
  background: var(--brand);
  transform-origin: left;
}

.header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 110;
  height: var(--header-h);
  display: flex;
  align-items: center;
  border-bottom: 1px solid transparent;
  transform: translateY(0);
  transition: background-color 0.3s var(--ease), border-color 0.3s var(--ease),
    backdrop-filter 0.3s var(--ease), transform 0.35s var(--ease);
}

.header.is-stuck {
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(14px) saturate(1.4);
  -webkit-backdrop-filter: blur(14px) saturate(1.4);
  border-bottom-color: var(--line);
}

.header.is-hidden { transform: translateY(-100%); }
body.nav-open .header.is-hidden { transform: translateY(0); }

.header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  width: min(1180px, 100% - 2.5rem);
  margin-inline: auto;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  color: var(--ink);
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.02em;
}

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

.brand__mark {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: var(--brand);
  color: var(--on-brand);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.brand__text { font-size: 1rem; }
.brand__text span { color: var(--muted); font-weight: 400; }

.nav { position: relative; display: flex; align-items: center; gap: 0.25rem; }

.nav__pill {
  position: absolute;
  z-index: -1;
  left: 0;
  top: 50%;
  height: 30px;
  width: 0;
  transform: translateY(-50%);
  background: var(--brand-soft);
  border-radius: 8px;
  opacity: 0;
  transition: left 0.35s var(--ease), width 0.35s var(--ease), opacity 0.25s var(--ease);
}

.nav__pill.is-ready { opacity: 1; }

.nav a {
  position: relative;
  padding: 0.5rem 0.8rem;
  border-radius: 8px;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 500;
}

.nav a::after {
  content: "";
  position: absolute;
  left: 0.8rem;
  right: 0.8rem;
  bottom: 0.15rem;
  height: 1.5px;
  background: var(--brand);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.28s var(--ease);
}

/* Los iconos del menú solo se muestran en la versión móvil */
.nav a .icon { display: none; }

.nav a:hover { color: var(--ink); }
.nav a.is-active { color: var(--ink); }
.nav a.is-active::after { transform: scaleX(1); }

.header__actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.icon-btn {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-2);
  border-radius: 10px;
  transition: color 0.2s var(--ease), border-color 0.2s var(--ease),
    background-color 0.2s var(--ease);
}

.icon-btn:hover {
  color: var(--brand);
  border-color: var(--brand);
}

.theme-toggle .icon-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
:root[data-theme="dark"] .theme-toggle .icon-moon { display: none; }

.nav-toggle { display: none; }

.nav-toggle__bars {
  width: 18px;
  height: 12px;
  position: relative;
}

.nav-toggle__bars span {
  position: absolute;
  left: 0;
  width: 100%;
  height: 1.8px;
  border-radius: 2px;
  background: currentColor;
  transition: transform 0.3s var(--ease), opacity 0.2s var(--ease);
}

.nav-toggle__bars span:nth-child(1) { top: 0; }
.nav-toggle__bars span:nth-child(2) { top: 5px; }
.nav-toggle__bars span:nth-child(3) { top: 10px; }

body.nav-open .nav-toggle__bars span:nth-child(1) { transform: translateY(5px) rotate(45deg); }
body.nav-open .nav-toggle__bars span:nth-child(2) { opacity: 0; }
body.nav-open .nav-toggle__bars span:nth-child(3) { transform: translateY(-5px) rotate(-45deg); }

/* --------------------------------------------------------------------------
   6. Hero
   -------------------------------------------------------------------------- */

.hero {
  position: relative;
  padding-top: calc(var(--header-h) + clamp(3rem, 8vw, 6rem));
  padding-bottom: clamp(3.5rem, 7vw, 6rem);
  overflow: hidden;
  background:
    radial-gradient(620px circle at 88% -10%, var(--brand-glow), transparent 62%),
    radial-gradient(480px circle at -8% 100%, var(--brand-glow), transparent 60%);
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle at 1px 1px, var(--line-strong) 1px, transparent 0);
  background-size: 32px 32px;
  opacity: 0.55;
  mask-image: linear-gradient(to bottom, black, transparent 72%);
  -webkit-mask-image: linear-gradient(to bottom, black, transparent 72%);
  pointer-events: none;
}

.hero__inner {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: center;
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.4rem 0.9rem 0.4rem 0.6rem;
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 999px;
  font-size: 0.82rem;
  font-family: var(--font-mono);
  color: var(--ink-2);
  box-shadow: var(--shadow-sm);
}

.status__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--brand);
  box-shadow: 0 0 0 0 var(--brand-glow);
  animation: pulse 2.4s infinite;
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--brand) 55%, transparent); }
  70% { box-shadow: 0 0 0 7px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}

.hero h1 {
  font-size: clamp(2.6rem, 6.4vw, 4.4rem);
  margin: 1.4rem 0 0.5rem;
  letter-spacing: -0.035em;
}

.hero__role {
  font-family: var(--font-mono);
  font-size: clamp(1rem, 2.4vw, 1.25rem);
  color: var(--ink);
  min-height: 1.8em;
  margin-bottom: 1.2rem;
}

.typed-text { color: var(--brand); }

.caret {
  display: inline-block;
  width: 2px;
  height: 1.05em;
  vertical-align: text-bottom;
  background: var(--brand);
  margin-left: 2px;
  animation: blink 1s step-end infinite;
}

@keyframes blink { 50% { opacity: 0; } }

.hero__lead {
  font-size: 1.06rem;
  color: var(--muted);
  max-width: 52ch;
  margin-bottom: 2rem;
}

.hero__cta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 2.25rem;
}

.hero__socials {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.hero__socials .icon-btn { border-radius: 999px; }

.hero__portrait {
  position: relative;
  justify-self: center;
  width: min(100%, 380px);
}

.hero__portrait img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-lg);
}

.hero__portrait::before {
  content: "";
  position: absolute;
  inset: 18px -18px -18px 18px;
  border: 1.5px solid var(--brand);
  border-radius: var(--radius-lg);
  opacity: 0.45;
  z-index: -1;
}

.hero__badge {
  position: absolute;
  left: -22px;
  bottom: 28px;
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.7rem 1rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
}

.hero__badge strong {
  display: block;
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--ink);
  font-size: 1.35rem;
  line-height: 1;
}

.hero__badge span {
  font-size: 0.78rem;
  color: var(--muted);
  font-family: var(--font-mono);
}

.hero__badge .icon {
  width: 1.5rem;
  height: 1.5rem;
  color: var(--brand);
}

.tilt-hint {
  position: absolute;
  left: 50%;
  bottom: -14px;
  transform: translate(-50%, 100%);
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.5rem 1rem 0.5rem 0.8rem;
  border: 0;
  border-radius: 999px;
  background: var(--brand);
  color: var(--on-brand);
  font-family: var(--font-mono);
  font-size: 0.76rem;
  white-space: nowrap;
  box-shadow: var(--shadow-brand);
  opacity: 1;
  transition: opacity 0.4s var(--ease), transform 0.4s var(--ease);
}

.tilt-hint[hidden] { display: none; }

.tilt-hint.is-done {
  opacity: 0;
  transform: translate(-50%, 100%) scale(0.85);
}

.tilt-hint .icon {
  width: 1rem;
  height: 1rem;
  animation: tiltWiggle 1.6s ease-in-out infinite;
}

@keyframes tiltWiggle {
  0%, 100% { transform: rotate(0deg); }
  25% { transform: rotate(-18deg); }
  75% { transform: rotate(18deg); }
}

@media (prefers-reduced-motion: reduce) {
  .tilt-hint .icon { animation: none; }
}

/* Marquee de tecnologías */
.marquee {
  position: relative;
  margin-top: clamp(3rem, 6vw, 4.5rem);
  padding-block: 1.1rem;
  background: var(--brand-soft);
  border-top: 1px solid color-mix(in srgb, var(--brand) 20%, transparent);
  border-bottom: 1px solid color-mix(in srgb, var(--brand) 20%, transparent);
  overflow: hidden;
  mask-image: linear-gradient(90deg, transparent, black 8%, black 92%, transparent);
  -webkit-mask-image: linear-gradient(90deg, transparent, black 8%, black 92%, transparent);
}

.marquee__track {
  display: flex;
  gap: 3rem;
  width: max-content;
  animation: marquee 32s linear infinite;
}

.marquee:hover .marquee__track { animation-play-state: paused; }

.marquee__track span {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: var(--muted);
  white-space: nowrap;
  letter-spacing: 0.02em;
}

@keyframes marquee {
  to { transform: translateX(-50%); }
}

/* --------------------------------------------------------------------------
   7. Sobre mí
   -------------------------------------------------------------------------- */

.about__grid {
  display: grid;
  grid-template-columns: 0.85fr 1.15fr;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: start;
}

.about__media {
  position: sticky;
  top: calc(var(--header-h) + 2rem);
}

.about__media img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
}

.about h3 {
  font-size: clamp(1.3rem, 2.6vw, 1.75rem);
  margin-bottom: 1rem;
}

.about p + p { margin-top: 1rem; }

.about__facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.9rem 1.5rem;
  margin: 2rem 0;
  padding: 1.5rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.about__facts div {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
}

.about__facts dt {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
}

.about__facts dd {
  margin: 0;
  color: var(--ink);
  font-weight: 500;
  font-size: 0.95rem;
  overflow-wrap: anywhere;
}

.about__facts a { color: var(--ink); }
.about__facts a:hover { color: var(--brand); }

.copy-btn {
  border: 0;
  background: none;
  padding: 0;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.78rem;
  font-family: var(--font-mono);
}

.copy-btn:hover { color: var(--brand); }
.copy-btn .icon { width: 0.95rem; height: 0.95rem; }

/* --------------------------------------------------------------------------
   8. Métricas
   -------------------------------------------------------------------------- */

.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  background: var(--surface);
  border: 1px solid color-mix(in srgb, var(--brand) 22%, transparent);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.stat {
  background: var(--brand-soft);
  padding: clamp(1.4rem, 3vw, 2.1rem);
  text-align: center;
}

.stat__num {
  display: block;
  font-family: var(--font-display);
  font-size: clamp(2.1rem, 5vw, 3rem);
  font-weight: 600;
  color: var(--brand-strong);
  letter-spacing: -0.04em;
  line-height: 1;
}

.stat__num sup {
  font-size: 0.45em;
  color: var(--brand);
  top: -0.9em;
  margin-left: 0.05em;
}

.stat__label {
  display: block;
  margin-top: 0.6rem;
  font-size: 0.88rem;
  color: var(--muted);
}

/* --------------------------------------------------------------------------
   9. Habilidades
   -------------------------------------------------------------------------- */

.skills__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.25rem;
}

.skill-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.6rem;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.25s var(--ease), transform 0.25s var(--ease), box-shadow 0.25s var(--ease);
}

.skill-card:hover {
  border-color: var(--brand);
  transform: translateY(-3px);
  box-shadow: var(--shadow-brand);
}

.skill-card__icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  background: var(--brand-soft);
  color: var(--brand);
  margin-bottom: 1.1rem;
}

.skill-card__icon .icon { width: 1.35rem; height: 1.35rem; }

.skill-card h3 {
  font-size: 1.08rem;
  margin-bottom: 0.35rem;
}

.skill-card__level {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--brand);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 1rem;
}

.skill-card ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.skill-card li {
  padding: 0.28rem 0.65rem;
  border-radius: 7px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  font-size: 0.8rem;
  font-family: var(--font-mono);
  color: var(--ink-2);
}

/* --------------------------------------------------------------------------
   10. Trayectoria (timeline)
   -------------------------------------------------------------------------- */

.resume__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(2rem, 5vw, 3.5rem);
}

.resume__col h3 {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 1.15rem;
  margin-bottom: 1.75rem;
}

.resume__col h3 .icon { color: var(--brand); }

.timeline {
  position: relative;
  padding-left: 1.85rem;
  border-left: 1px solid var(--line);
}

.timeline__item { position: relative; padding-bottom: 2.25rem; }
.timeline__item:last-child { padding-bottom: 0; }

.timeline__item::before {
  content: "";
  position: absolute;
  left: calc(-1.85rem - 5px);
  top: 0.55rem;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--brand);
}

.section--alt .timeline__item::before { background: var(--bg-alt); }

.timeline__date {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  color: var(--brand);
  letter-spacing: 0.05em;
  margin-bottom: 0.4rem;
}

.timeline__item h4 {
  font-size: 1.05rem;
  margin-bottom: 0.2rem;
}

.timeline__org {
  font-size: 0.9rem;
  color: var(--muted);
  margin-bottom: 0.7rem;
}

.timeline__item ul {
  display: grid;
  gap: 0.4rem;
}

.timeline__item li {
  position: relative;
  padding-left: 1.1rem;
  font-size: 0.94rem;
}

.timeline__item li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.72em;
  width: 5px;
  height: 1.5px;
  background: var(--brand);
}

/* --------------------------------------------------------------------------
   11. Portafolio
   -------------------------------------------------------------------------- */

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 2.25rem;
}

.filters button {
  padding: 0.45rem 1rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 500;
  transition: all 0.2s var(--ease);
}

.filters button:hover { color: var(--ink); border-color: var(--line-strong); }

.filters button[aria-pressed="true"] {
  background: var(--brand);
  border-color: var(--brand);
  color: var(--on-brand);
}

.work-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.5rem;
}

.work {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform 0.35s var(--ease), border-color 0.35s var(--ease),
    box-shadow 0.35s var(--ease), opacity 0.3s var(--ease);
}

.work.is-hidden {
  display: none;
}

.work.is-entering {
  animation: workIn 0.4s var(--ease) both;
}

@keyframes workIn {
  from { opacity: 0; transform: translateY(14px) scale(0.985); }
  to { opacity: 1; transform: none; }
}

.work:hover {
  transform: translateY(-4px);
  border-color: var(--brand);
  box-shadow: var(--shadow-brand);
}

.work__media {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: var(--surface-2);
}

.work__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  transition: transform 0.6s var(--ease);
}

.work:hover .work__media img { transform: scale(1.05); }

.work__actions {
  position: absolute;
  inset: auto 0.75rem 0.75rem auto;
  display: flex;
  gap: 0.4rem;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.3s var(--ease), transform 0.3s var(--ease);
}

.work:hover .work__actions,
.work:focus-within .work__actions {
  opacity: 1;
  transform: none;
}

.work__actions a,
.work__actions button {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  border: 0;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: blur(8px);
  color: var(--ink);
  box-shadow: var(--shadow-sm);
  transition: background-color 0.2s var(--ease), color 0.2s var(--ease);
}

.work__actions a:hover,
.work__actions button:hover {
  background: var(--brand);
  color: var(--on-brand);
}

.work__body {
  padding: 1.25rem 1.35rem 1.5rem;
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 0.55rem;
}

.work__tag {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--brand);
}

.work__body h3 { font-size: 1.06rem; }

.work__body p {
  font-size: 0.92rem;
  color: var(--muted);
  flex: 1;
}

.work__stack {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.35rem;
}

.work__stack span {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0.15rem 0.45rem;
}

.work__empty {
  grid-column: 1 / -1;
  text-align: center;
  color: var(--muted);
  padding: 3rem 1rem;
}

/* --------------------------------------------------------------------------
   12. Lightbox
   -------------------------------------------------------------------------- */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  padding: clamp(1rem, 4vw, 3rem);
  background: color-mix(in srgb, #000 78%, transparent);
  backdrop-filter: blur(6px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.28s var(--ease), visibility 0.28s var(--ease);
}

.lightbox.is-open { opacity: 1; visibility: visible; }

.lightbox__figure {
  position: relative;
  max-width: min(1100px, 100%);
  max-height: 100%;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  transform: scale(0.97);
  transition: transform 0.28s var(--ease);
}

.lightbox.is-open .lightbox__figure { transform: none; }

.lightbox__figure img {
  max-height: 76vh;
  width: auto;
  margin-inline: auto;
  object-fit: contain;
  border-radius: var(--radius);
  box-shadow: 0 30px 70px -30px rgba(0, 0, 0, 0.9);
}

.lightbox__caption {
  text-align: center;
  color: #e8f1ec;
  font-size: 0.92rem;
}

.lightbox__caption strong {
  display: block;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.05rem;
  color: #fff;
}

.lightbox__btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  border-radius: 50%;
  backdrop-filter: blur(6px);
  transition: background-color 0.2s var(--ease);
}

.lightbox__btn:hover { background: rgba(255, 255, 255, 0.2); }
.lightbox__btn--prev { left: -60px; }
.lightbox__btn--next { right: -60px; }

.lightbox__close {
  position: fixed;
  top: 1.25rem;
  right: 1.25rem;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  border-radius: 50%;
}

.lightbox__close:hover { background: rgba(255, 255, 255, 0.2); }

/* --------------------------------------------------------------------------
   13. Servicios
   -------------------------------------------------------------------------- */

.services__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1px;
  background: var(--brand-soft);
  border: 1px solid color-mix(in srgb, var(--brand) 20%, transparent);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.service {
  position: relative;
  background: var(--bg);
  padding: clamp(1.6rem, 3vw, 2.25rem);
  transition: background-color 0.3s var(--ease);
}

.section--alt .service { background: var(--bg-alt); }

.service:hover { background: var(--surface); }

.service__num {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--brand);
  letter-spacing: 0.1em;
}

.service .icon-wrap {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: var(--brand-soft);
  color: var(--brand);
  margin: 1rem 0 1.1rem;
  transition: background-color 0.3s var(--ease), color 0.3s var(--ease);
}

.service:hover .icon-wrap {
  background: var(--brand);
  color: var(--on-brand);
}

.service .icon-wrap .icon { width: 1.4rem; height: 1.4rem; }

.service h3 {
  font-size: 1.1rem;
  margin-bottom: 0.55rem;
}

.service p {
  font-size: 0.93rem;
  color: var(--muted);
}

/* --------------------------------------------------------------------------
   14. Testimonios
   -------------------------------------------------------------------------- */

.slider { position: relative; }

.slider__viewport {
  position: relative; /* hace de offsetParent para calcular el scroll de cada slide */
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: calc((100% - 3rem) / 3);
  gap: 1.5rem;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  padding-bottom: 0.5rem;
}

.slider__viewport::-webkit-scrollbar { display: none; }

.quote {
  scroll-snap-align: start;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
  box-shadow: var(--shadow-sm);
}

.quote__mark {
  color: var(--brand);
  opacity: 0.35;
  width: 2rem;
  height: 2rem;
}

.quote p {
  font-size: 0.96rem;
  flex: 1;
}

.quote__author {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding-top: 1.1rem;
  border-top: 1px solid var(--line);
}

.quote__author img {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--line);
}

.quote__author strong {
  display: block;
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--ink);
  font-size: 0.98rem;
}

.quote__author span {
  font-size: 0.83rem;
  color: var(--muted);
}

.slider__nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-top: 2rem;
}

.slider__dots { display: flex; gap: 0.45rem; }

.slider__dots button {
  width: 8px;
  height: 8px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--line-strong);
  transition: all 0.25s var(--ease);
}

.slider__dots button[aria-current="true"] {
  width: 26px;
  border-radius: 999px;
  background: var(--brand);
}

/* --------------------------------------------------------------------------
   15. Contacto
   -------------------------------------------------------------------------- */

.contact__grid {
  display: grid;
  grid-template-columns: 0.85fr 1.15fr;
  gap: clamp(1.5rem, 4vw, 3rem);
  align-items: start;
}

.contact__cards { display: grid; gap: 1rem; }

.contact-card {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1.25rem 1.35rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  transition: border-color 0.25s var(--ease), box-shadow 0.25s var(--ease);
}

.contact-card:hover { border-color: var(--brand); box-shadow: var(--shadow-brand); }

.contact-card .icon-wrap {
  width: 40px;
  height: 40px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 11px;
  background: var(--brand-soft);
  color: var(--brand);
}

.contact-card h3 {
  font-size: 0.8rem;
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  font-weight: 500;
  margin-bottom: 0.2rem;
}

.contact-card p,
.contact-card a {
  font-size: 0.98rem;
  color: var(--ink);
  overflow-wrap: anywhere;
}

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

.contact__map {
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line);
  height: 220px;
  filter: grayscale(0.35);
}

.contact__map iframe { width: 100%; height: 100%; border: 0; }

.form-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: clamp(1.5rem, 4vw, 2.5rem);
  box-shadow: var(--shadow-md);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.1rem;
}

.field { display: flex; flex-direction: column; gap: 0.4rem; }
.field--full { grid-column: 1 / -1; }

.field label {
  font-size: 0.82rem;
  font-family: var(--font-mono);
  letter-spacing: 0.04em;
  color: var(--muted);
}

.field input,
.field textarea,
.field select {
  width: 100%;
  padding: 0.8rem 0.95rem;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--ink);
  font-size: 0.95rem;
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}

.field select {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%),
    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 20px) 55%, calc(100% - 14px) 55%;
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
  padding-right: 2.5rem;
}

.field select option {
  background: var(--surface);
  color: var(--ink);
}

.field textarea { resize: vertical; min-height: 130px; }

.field input::placeholder,
.field textarea::placeholder { color: color-mix(in srgb, var(--muted) 75%, transparent); }

.field input:focus,
.field textarea:focus,
.field select:focus {
  outline: 0;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-glow);
}

.field.has-error input,
.field.has-error textarea,
.field.has-error select { border-color: #d9534f; }

.field__error {
  font-size: 0.78rem;
  color: #d9534f;
  min-height: 1em;
}

:root[data-theme="dark"] .field__error { color: #ff8a85; }
:root[data-theme="dark"] .field.has-error input,
:root[data-theme="dark"] .field.has-error textarea,
:root[data-theme="dark"] .field.has-error select { border-color: #ff8a85; }

.hp {
  position: absolute;
  left: -9999px;
  opacity: 0;
  pointer-events: none;
}

.form-foot {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
  justify-content: space-between;
  margin-top: 0.25rem;
}

.form-note {
  font-size: 0.83rem;
  color: var(--muted);
}

.form-status {
  grid-column: 1 / -1;
  display: none;
  align-items: center;
  gap: 0.6rem;
  padding: 0.85rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.92rem;
}

.form-status.is-visible { display: flex; }

.form-status--ok {
  background: var(--brand-soft);
  color: var(--brand);
  border: 1px solid color-mix(in srgb, var(--brand) 35%, transparent);
}

.form-status--error {
  background: color-mix(in srgb, #d9534f 12%, transparent);
  color: #c9302c;
  border: 1px solid color-mix(in srgb, #d9534f 35%, transparent);
}

:root[data-theme="dark"] .form-status--error { color: #ff8a85; }

.btn[data-loading="true"] {
  pointer-events: none;
  opacity: 0.75;
}

.btn[data-loading="true"] .btn__label::after {
  content: "";
  display: inline-block;
  width: 0.85em;
  height: 0.85em;
  margin-left: 0.5em;
  vertical-align: -0.1em;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* --------------------------------------------------------------------------
   15b. Barra de navegación inferior (solo móvil)
   -------------------------------------------------------------------------- */

.bottom-nav {
  display: none;
  position: fixed;
  inset: auto 0 0 0;
  z-index: 110;
  padding: 0.4rem 0.4rem calc(0.4rem + env(safe-area-inset-bottom, 0px));
  background: color-mix(in srgb, var(--bg) 90%, transparent);
  backdrop-filter: blur(16px) saturate(1.4);
  -webkit-backdrop-filter: blur(16px) saturate(1.4);
  border-top: 1px solid var(--line);
}

.bottom-nav a,
.bottom-nav button {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.2rem;
  padding: 0.35rem 0.2rem;
  border: 0;
  background: none;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.64rem;
  letter-spacing: 0.01em;
  border-radius: 10px;
  transition: color 0.2s var(--ease), background-color 0.2s var(--ease);
}

.bottom-nav .icon { width: 1.3rem; height: 1.3rem; }
.bottom-nav .nav-toggle__bars { margin: 4px 0; }

.bottom-nav a.is-active {
  color: var(--brand-strong);
  background: var(--brand-soft);
}

.bottom-nav a:active,
.bottom-nav button:active { color: var(--brand); }

/* --------------------------------------------------------------------------
   16. Footer + scroll top
   -------------------------------------------------------------------------- */

.footer {
  border-top: 1px solid var(--line);
  padding-block: 3rem 2.25rem;
  background: var(--bg);
}

.footer__inner {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  align-items: center;
  justify-content: space-between;
}

.footer__socials { display: flex; gap: 0.5rem; }
.footer__socials .icon-btn { border-radius: 999px; }

.footer__legal {
  margin-top: 2.25rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  justify-content: space-between;
  font-size: 0.86rem;
  color: var(--muted);
}

.to-top {
  position: fixed;
  right: 1.25rem;
  bottom: calc(var(--bottom-nav-h, 0px) + 4.75rem);
  z-index: 90;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--brand);
  color: var(--on-brand);
  border: 0;
  box-shadow: var(--shadow-md);
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: all 0.3s var(--ease);
}

.to-top.is-visible { opacity: 1; visibility: visible; transform: none; }
.to-top:hover { background: var(--brand-strong); }

.wa-float {
  position: fixed;
  right: 1.25rem;
  bottom: calc(var(--bottom-nav-h, 0px) + 1.25rem);
  z-index: 90;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--line);
  color: #25d366;
  box-shadow: var(--shadow-md);
  transition: transform 0.25s var(--ease);
}

.wa-float:hover { transform: translateY(-2px); color: #25d366; }

/* --------------------------------------------------------------------------
   16b. Brillo que sigue al cursor (spotlight)
   Se activa solo con puntero fino y "hover" real (JS marca .can-spotlight
   en <html>); en táctil o reduced-motion queda simplemente desactivado.
   -------------------------------------------------------------------------- */

.can-spotlight .skill-card,
.can-spotlight .work,
.can-spotlight .service,
.can-spotlight .contact-card,
.can-spotlight .form-card {
  position: relative;
  overflow: hidden;
}

.can-spotlight .skill-card::before,
.can-spotlight .work::before,
.can-spotlight .service::before,
.can-spotlight .contact-card::before,
.can-spotlight .form-card::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  border-radius: inherit;
  background: radial-gradient(220px circle at var(--mx, 50%) var(--my, 50%), var(--brand-glow), transparent 70%);
  opacity: 0;
  transition: opacity 0.4s var(--ease);
  pointer-events: none;
}

.can-spotlight .skill-card:hover::before,
.can-spotlight .work:hover::before,
.can-spotlight .service:hover::before,
.can-spotlight .contact-card:hover::before,
.can-spotlight .form-card:hover::before {
  opacity: 1;
}

.can-spotlight .skill-card > *,
.can-spotlight .work > *,
.can-spotlight .service > *,
.can-spotlight .contact-card > *,
.can-spotlight .form-card > * {
  position: relative;
  z-index: 1;
}

/* --------------------------------------------------------------------------
   16c. Botones magnéticos y tilt del retrato
   -------------------------------------------------------------------------- */

.magnetic { transition: transform 0.25s var(--ease); }

.hero__portrait {
  transition: transform 0.2s var(--ease);
  transform-style: preserve-3d;
  will-change: transform;
}

/* --------------------------------------------------------------------------
   17. Reveal
   -------------------------------------------------------------------------- */

.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.65s var(--ease), transform 0.65s var(--ease);
  transition-delay: var(--d, 0ms);
}

.reveal.is-in { opacity: 1; transform: none; }

/* --------------------------------------------------------------------------
   18. Responsive
   -------------------------------------------------------------------------- */

@media (max-width: 1100px) {
  .slider__viewport { grid-auto-columns: calc((100% - 1.5rem) / 2); }
  .lightbox__btn--prev { left: 0.5rem; }
  .lightbox__btn--next { right: 0.5rem; }
}

@media (max-width: 960px) {
  :root {
    --header-h: 62px;
    --bottom-nav-h: calc(60px + env(safe-area-inset-bottom, 0px));
  }

  body { padding-bottom: var(--bottom-nav-h); }

  .bottom-nav { display: grid; grid-template-columns: repeat(5, 1fr); }

  .nav {
    position: fixed;
    inset: var(--header-h) 0 0 0;
    flex-direction: column;
    justify-content: flex-start;
    align-items: stretch;
    gap: 0;
    padding: 1.5rem 1.25rem 2.5rem;
    background: var(--bg);
    border-top: 1px solid var(--line);
    overflow-y: auto;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: opacity 0.28s var(--ease), transform 0.28s var(--ease), visibility 0.28s;
  }

  body.nav-open .nav { opacity: 1; visibility: visible; transform: none; }

  .nav a {
    padding: 1rem 0.35rem;
    font-size: 1.12rem;
    border-bottom: 1px solid var(--line);
    border-radius: 0;
    display: flex;
    align-items: center;
    gap: 0.85rem;
  }

  .nav a::after { display: none; }
  .nav a .icon { display: block; color: var(--brand); width: 1.05rem; height: 1.05rem; }
  .nav a.is-active { color: var(--brand); }

  .nav-toggle { display: grid; }
  .nav__pill { display: none; }

  .hero__inner { grid-template-columns: 1fr; text-align: left; }

  .hero__portrait {
    grid-row: 1;
    width: min(100%, 260px);
    justify-self: start;
  }

  .hero__portrait::before { inset: 12px -12px -12px 12px; }
  .hero__badge { left: auto; right: -14px; bottom: 18px; padding: 0.55rem 0.8rem; }

  .about__grid { grid-template-columns: 1fr; }
  .about__media { position: static; max-width: 340px; }
  .resume__grid { grid-template-columns: 1fr; }
  .contact__grid { grid-template-columns: 1fr; }
  .contact__grid .form-card { order: -1; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 700px) {
  .wrap, .header__inner { width: min(1180px, 100% - 2rem); }
  .slider__viewport { grid-auto-columns: 100%; }
  .work-grid { grid-template-columns: 1fr; }
  .brand__text span { display: none; }
}

@media (max-width: 560px) {
  .hero__cta { flex-direction: column; align-items: stretch; }
  .hero__cta .btn { width: 100%; }
  .about__facts { grid-template-columns: 1fr; padding: 1.25rem; }
  .form-grid { grid-template-columns: 1fr; }
  .form-foot { flex-direction: column; align-items: stretch; }
  .form-foot .btn { width: 100%; }
  .footer__inner { flex-direction: column; align-items: flex-start; }
  .footer__legal { flex-direction: column; }
  .lightbox__btn { width: 40px; height: 40px; }
  .lightbox__figure img { max-height: 66vh; }
}

@media (max-width: 400px) {
  .stats { grid-template-columns: 1fr; }
}

/* Pantallas anchas: portafolio a 3 columnas fijas */
@media (min-width: 1200px) {
  .work-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* --------------------------------------------------------------------------
   19. Accesibilidad / impresión
   -------------------------------------------------------------------------- */

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

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }

  .reveal { opacity: 1; transform: none; }
  .marquee__track { animation: none; }
}

@media print {
  .header, .to-top, .wa-float, .lightbox, .marquee, .progress-rail,
  .filters, .slider__nav, .contact__map { display: none !important; }
  body { background: #fff; color: #000; }
  .section { padding-block: 1.5rem; page-break-inside: avoid; }
}
