/* ==========================================================================
   Portfolio Agustina — UX/UI Designer
   Rediseño: hero/footer oscuros, cuerpo blanco, tipografía serif en títulos
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,400;0,600;1,400&family=DM+Sans:wght@300;500&display=swap');

:root {
  --color-dark: #1A1618;
  --color-bg: #F7F2EE;
  --color-bg-alt: #EDE3EC;
  --color-text: #1A1618;
  --color-text-muted: #746B70;
  --color-accent: #9B7FA6;
  --color-accent-dark: #7E6486;
  --color-border: #E4DCE6;
  --color-neutral: #C4B0C8;
  --color-green: #16A34A;

  --font-serif: 'Cormorant Garamond', Georgia, serif;
  --font-main: 'DM Sans', sans-serif;

  --surface-page: var(--color-bg);
  --surface-soft: var(--color-bg-alt);
  --surface-card: #FFFFFF;
  --text-primary: var(--color-text);
  --text-muted: var(--color-text-muted);
  --border-color: var(--color-border);
  --shadow-soft: 0 10px 30px rgba(0,0,0,0.04);

  --container: 1200px;
  --radius-sm: 8px;
  --radius-md: 24px;
  --radius-full: 999px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --nav-h: 84px;
}

:root[data-theme='dark'] {
  --surface-page: #0F0F12;
  --surface-soft: #18181C;
  --surface-card: #1E1E24;
  --text-primary: #F4F4F5;
  --text-muted: #A1A1AA;
  --border-color: rgba(255,255,255,0.08);
  --color-accent: #C4B0C8;
  --color-primary: #9B7FA6;
  --shadow-glow-accent: 0 0 24px rgba(196,176,200,0.35);
}

/* ---------------------------------- Reset ---------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-main);
  font-weight: 300;
  background: var(--surface-page);
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
  transition: background-color .4s var(--ease), color .4s var(--ease);
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; margin: 0; padding: 0; }
button { font-family: inherit; cursor: pointer; }
h1, h2, h3, h4, p { margin: 0; }

/* ---------------------------------- Tipografía de marca: Cormorant Garamond (titulares) + DM Sans (cuerpo) ---------------------------------- */
h1, h2, h3 {
  font-family: var(--font-serif);
  font-weight: 600;
}

h1 {
  font-size: clamp(2.5rem, 5vw, 4rem);
}

h2 {
  font-size: clamp(1.8rem, 3vw, 2.8rem);
}

h3 {
  font-size: clamp(1.1rem, 2vw, 1.4rem);
}

p {
  font-size: 1rem;
  font-weight: 300;
  line-height: 1.7;
}

.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
}

body.page-fade { animation: pageIn .5s var(--ease); }
body.page-fade-out { opacity: 0; transition: opacity .3s var(--ease); }
@keyframes pageIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---------------------------------- Reveal on scroll ---------------------------------- */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity .7s var(--ease), transform .7s var(--ease);
}
.reveal.in-view { opacity: 1; transform: translateY(0); }

/* Stagger de entrada para grupos de cards/items */
.project-card.reveal:nth-child(2),
.price-card.reveal:nth-child(2),
.process-step.reveal:nth-child(2),
.testimonial-card.reveal:nth-child(2),
.faq-item.reveal:nth-child(2),
.work-card.reveal:nth-child(2) { transition-delay: .1s; }

.project-card.reveal:nth-child(3),
.price-card.reveal:nth-child(3),
.process-step.reveal:nth-child(3),
.testimonial-card.reveal:nth-child(3),
.faq-item.reveal:nth-child(3),
.work-card.reveal:nth-child(3) { transition-delay: .2s; }

.project-card.reveal:nth-child(4),
.price-card.reveal:nth-child(4),
.process-step.reveal:nth-child(4),
.testimonial-card.reveal:nth-child(4),
.faq-item.reveal:nth-child(4),
.work-card.reveal:nth-child(4) { transition-delay: .3s; }

/* ---------------------------------- Navbar ---------------------------------- */
.navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 26px 5%;
  background: transparent;
  color: #1A1618;
  transition: background-color .3s var(--ease), color .3s var(--ease), box-shadow .3s var(--ease), padding .3s var(--ease);
}
.navbar.is-scrolled {
  background: color-mix(in srgb, var(--surface-page) 90%, transparent);
  backdrop-filter: blur(12px);
  color: var(--text-primary);
  padding: 16px 5%;
  box-shadow: 0 4px 24px rgba(0,0,0,.06);
}
.navbar-logo { font-family: var(--font-serif); font-size: 20px; font-style: italic; }

/* ---------------------------------- Logo AM ---------------------------------- */
.nav-logo {
  text-decoration: none;
}

.logo-am {
  display: flex;
  align-items: center;
  background: transparent;
  border-radius: 0;
  box-shadow: none;
  position: relative;
  padding-bottom: 4px;
  width: auto;
  height: auto;
}

.logo-am::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, #9B7FA6, #C4B0C8);
  border-radius: 99px;
  /* scaleX en vez de animar width: así el navegador solo compone la
     capa (GPU) en vez de recalcular layout en cada frame de la transición */
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s ease;
}

.logo-am:hover::after {
  transform: scaleX(1);
}

.logo-a,
.logo-m {
  font-family: 'DM Sans', sans-serif;
  font-weight: 500;
  font-size: 20px;
  color: #1A1618;
  letter-spacing: -1px;
}

[data-theme="dark"] .logo-a,
[data-theme="dark"] .logo-m {
  color: #FFFFFF;
}
.nav-right { display: flex; align-items: center; gap: 32px; }
.nav-links { display: flex; align-items: center; gap: 28px; }
.nav-links a {
  font-size: 14px;
  font-weight: 500;
  color: inherit;
  opacity: .9;
  position: relative;
}
.nav-links a:hover { opacity: 1; }
.nav-links a.active { opacity: 1; color: var(--color-accent); }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 500;
  padding: 12px 24px;
  border-radius: var(--radius-full);
  border: 1.5px solid currentColor;
  background: transparent;
  color: inherit;
  transition: background .25s var(--ease), color .25s var(--ease), border-color .25s var(--ease), transform .2s var(--ease);
}
.btn:hover { transform: translateY(-2px); }
.btn svg { width: 14px; height: 14px; }

.btn-accent {
  background: var(--color-accent);
  border-color: var(--color-accent);
  color: #fff;
  box-shadow: 0 8px 20px -4px rgba(155, 127, 166, 0.4);
}
[data-theme="dark"] .btn-accent {
  box-shadow: var(--shadow-glow-accent), 0 8px 20px -4px rgba(155, 127, 166, 0.4);
}
[data-theme="dark"] .btn-accent:hover {
  box-shadow: 0 0 32px rgba(196,176,200,0.45), 0 8px 20px -4px rgba(155, 127, 166, 0.4);
}
.btn-accent:hover {
  background: var(--color-accent-dark);
  border-color: var(--color-accent-dark);
  transform: scale(1.02) translateY(-2px);
}

.btn-outline-light { border-color: rgba(255,255,255,.5); color: #fff; }
.btn-outline-light:hover { background: #fff; color: var(--color-dark); border-color: #fff; }

.btn-dark { background: var(--color-dark); border-color: var(--color-dark); color: #fff; }
.btn-dark:hover { background: #0D0B0C; border-color: #0D0B0C; }

.btn-outline-dark { border-color: var(--border-color); color: var(--text-primary); }
.btn-outline-dark:hover { background: var(--text-primary); color: var(--surface-page); border-color: var(--text-primary); }

/* Ghost: usado en el botón secundario del hero */
.btn-ghost {
  background: transparent;
  border-color: var(--border-color);
  color: var(--text-primary);
}
.btn-ghost:hover { border-color: var(--color-accent); color: var(--color-accent); }
[data-theme="dark"] .btn-ghost { border-color: rgba(255,255,255,0.15); }

/* Nav CTA: secundario/enlace, sin relleno sólido, para no competir con el CTA del hero */
.nav-cta { background: transparent; border-color: var(--border-color); color: var(--text-primary); }
.nav-cta:hover { background: transparent; border-color: var(--color-accent); color: var(--color-accent); }

.theme-toggle {
  width: 38px; height: 38px;
  border-radius: 50%;
  border: 1px solid currentColor;
  opacity: .5;
  background: transparent;
  color: inherit;
  display: flex; align-items: center; justify-content: center;
  transition: opacity .25s var(--ease), transform .25s var(--ease);
}
.theme-toggle:hover { opacity: 1; transform: scale(1.06); }
.theme-toggle svg { width: 17px; height: 17px; }
.theme-toggle .icon-moon { display: none; }
:root[data-theme='dark'] .theme-toggle .icon-sun { display: none; }
:root[data-theme='dark'] .theme-toggle .icon-moon { display: block; }

.nav-toggle {
  display: none;
  width: 38px; height: 38px;
  border: none; background: transparent; color: inherit;
  flex-direction: column; gap: 5px; align-items: center; justify-content: center;
}
.nav-toggle span { width: 22px; height: 2px; background: currentColor; transition: transform .3s var(--ease), opacity .3s var(--ease); }
.nav-toggle.is-open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.is-open span:nth-child(2) { opacity: 0; }
.nav-toggle.is-open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.nav-menu-mobile {
  position: fixed; inset: 0;
  background: var(--color-dark);
  color: #F7F2EE;
  z-index: 480;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 32px;
  opacity: 0; pointer-events: none;
  transform: translateY(-16px);
  transition: opacity .3s var(--ease), transform .3s var(--ease);
}
.nav-menu-mobile.is-open { opacity: 1; pointer-events: auto; transform: translateY(0); }
.nav-menu-mobile a { font-size: 22px; font-weight: 500; }
/* El overlay del menú mobile siempre es oscuro (en los dos temas), así que
   su botón no puede heredar var(--text-primary)/var(--border-color) —
   en light mode esas variables son oscuras y el botón queda invisible. */
.nav-menu-mobile .nav-cta {
  color: #F7F2EE;
  border-color: rgba(255,255,255,0.3);
}
.nav-menu-mobile .nav-cta:hover {
  color: var(--color-accent);
  border-color: var(--color-accent);
}

/* ---------------------------------- Hero (dark) ---------------------------------- */
.hero-dark {
  position: relative;
  background: var(--color-bg);
  overflow: hidden;
  color: #1A1618;
  padding: calc(var(--nav-h) + 60px) 0 90px;
}

.hero-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.hero-dark::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 140px;
  background: linear-gradient(to bottom, transparent, var(--color-bg));
  pointer-events: none;
  z-index: 2;
}

.hero-dark > *:not(.hero-bg) {
  position: relative;
  z-index: 1;
}

.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.5;
  /* El blur es caro de pintar; promoverlo a su propia capa evita que
     el navegador lo vuelva a pintar cada vez que cambia algo alrededor
     (el canvas del dot grid, el hover de un botón, etc). */
  will-change: transform;
  transform: translateZ(0);
}

.blob-1 {
  width: 500px;
  height: 500px;
  background: #9B7FA6;
  top: -100px;
  left: -150px;
}

.blob-2 {
  width: 400px;
  height: 400px;
  background: #C4B0C8;
  top: 100px;
  right: -100px;
}

.blob-3 {
  width: 300px;
  height: 300px;
  background: #EDE3EC;
  bottom: -50px;
  left: 30%;
}

[data-theme="dark"] .hero-dark { background: rgba(15,15,18,0.92); }
[data-theme="dark"] .hero-dark::after { display: none; }
[data-theme="dark"] .blob { display: none; }
[data-theme="dark"] .hero-dark h1 {
  color: #FFFFFF;
}
[data-theme="dark"] .hero-dark p {
  color: #D4D4D8;
}
[data-theme="dark"] .hero-avatar {
  border-color: rgba(255,255,255,0.10);
  box-shadow: 0 0 50px rgba(155,127,166,0.18);
}

/* Fondo general del dark mode: body y secciones (semitransparente para que se vea el dot grid) */
[data-theme="dark"] body {
  background-color: #0F0F12;
}
[data-theme="dark"] section {
  background-color: rgba(15,15,18,0.92);
}
[data-theme="dark"] .section-alt {
  background-color: rgba(24,24,28,0.92);
}

/* Cards en dark mode: tono más claro que el fondo para dar profundidad,
   con borde blanco muy sutil (o violeta tenue al hacer hover, ver .card:hover) */
[data-theme="dark"] .card,
[data-theme="dark"] .project-card {
  background-color: #1E1E24;
  border-color: rgba(255,255,255,0.08);
}

/* Violeta más luminoso en dark mode: tags y links */
[data-theme="dark"] .project-tags span {
  background: rgba(196,176,200,0.15) !important;
  color: #EDE3EC !important;
  border: 1px solid rgba(196,176,200,0.35) !important;
}
[data-theme="dark"] section a:not(.btn) {
  color: #C4B0C8 !important;
}

.hero-inner {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 48px;
  align-items: center;
}
.hero-avatar {
  width: 180px; height: 180px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  border: 1px solid rgba(255,255,255,.15);
}
.hero-avatar img { width: 100%; height: 100%; object-fit: cover; object-position: center 20%; }
.badge-disponible {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255,255,255,0.7);
  color: #413539;
  border: 1px solid var(--border-color);
  padding: 6px 16px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 20px;
}

.badge-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #22C55E;
  box-shadow: 0 0 6px rgba(34,197,94,0.6);
  animation: pulse 2s ease-in-out infinite;
}

[data-theme="dark"] .badge-disponible {
  background: #1E1E24;
  border-color: rgba(255,255,255,0.08);
  color: #F4F4F5;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}
.hero-dark h1 {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: clamp(38px, 5vw, 64px);
  line-height: 1.1;
  margin-bottom: 22px;
  animation: fadeInUp 0.9s ease forwards;
}
.hero-dark p {
  font-size: 16px;
  line-height: 1.7;
  color: #1A1618;
  max-width: 600px;
  margin-bottom: 28px;
}
.hero-title-only h1 { margin-bottom: 0; }

/* ---------------------------------- Section helpers ---------------------------------- */
section { padding: 100px 0; }
.section-alt { background: rgba(237,227,236,0.92); }

.section-tag {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-primary);
  margin-bottom: 48px;
}
.section-tag .arrow { color: var(--color-accent); flex-shrink: 0; }
.section-tag.plain::before { content: none; }

.section-label {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(26px, 3.2vw, 40px);
  color: var(--text-primary);
  margin-bottom: 48px;
}

/* ---------------------------------- Cards genéricas ---------------------------------- */
.card {
  background: var(--surface-card);
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  padding: 32px;
  box-shadow: var(--shadow-soft);
  transition: transform .3s var(--ease), border-color .3s var(--ease), box-shadow .3s var(--ease);
}
.card:hover { transform: translateY(-4px); border-color: var(--color-accent); box-shadow: 0 16px 40px -20px rgba(155,127,166,.3); }
[data-theme="dark"] .card { box-shadow: none; }

/* ---------------------------------- Sección: qué puede hacer una web ---------------------------------- */
.what-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
.what-card h4 { font-size: 17px; font-weight: 500; margin-bottom: 10px; }
.what-card p { font-size: 14px; color: var(--text-muted); line-height: 1.6; }
.what-num {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--color-accent) 12%, transparent);
  color: var(--color-accent);
  display: flex; align-items: center; justify-content: center;
  font-weight: 500; font-size: 13px;
  margin-bottom: 20px;
}

/* ---------------------------------- Proyectos ---------------------------------- */
.filters { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 48px; }
.filter-pill {
  font-size: 13px; font-weight: 500;
  padding: 10px 18px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  background: transparent;
  transition: all .25s var(--ease);
}
.filter-pill.active, .filter-pill:hover { border-color: var(--color-accent); color: var(--color-accent); background: color-mix(in srgb, var(--color-accent) 8%, transparent); }

#proyectos .btn-accent { margin-bottom: 48px; }

.project-list { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.project-card {
  width: 100%;
  max-width: 100%;
  border-radius: var(--radius-md);
  overflow: hidden;
  cursor: pointer;
  transition: transform .3s var(--ease), box-shadow .3s var(--ease);
}
.project-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 40px rgba(0,0,0,0.12);
}
.project-media { border-radius: var(--radius-md); overflow: hidden; margin-bottom: 28px; aspect-ratio: 16/9; }
.project-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s var(--ease); }
.project-card:hover .project-media img { transform: scale(1.05); }
.project-card > *:not(.project-media) { padding-left: 24px; padding-right: 24px; }
.project-tags { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 10px; }
.project-tags span {
  font-size: 12px; font-weight: 500;
  color: var(--color-accent);
  background: color-mix(in srgb, var(--color-accent) 10%, transparent);
  padding: 6px 14px; border-radius: var(--radius-full);
}
.project-card h3 { font-family: var(--font-serif); font-style: italic; font-weight: 400; font-size: 30px; margin-bottom: 8px; }
.project-card > p { font-size: 15px; color: var(--text-muted); line-height: 1.65; max-width: 640px; margin-bottom: 16px; }
.project-links { display: flex; flex-wrap: wrap; gap: 16px; padding-bottom: 24px; }
.project-links a { font-size: 14px; font-weight: 500; color: var(--color-accent); text-decoration: underline; text-underline-offset: 4px; }

/* ---------------------------------- Precios ---------------------------------- */
.pricing-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; margin-bottom: 40px; }
.price-card { display: flex; flex-direction: column; position: relative; }
.price-card-featured { border-color: var(--color-accent); background: color-mix(in srgb, var(--color-accent) 5%, var(--surface-card)); }
.price-featured-badge {
  position: absolute;
  top: -14px;
  left: 32px;
  background: var(--color-accent);
  color: #fff;
  font-size: 12px;
  font-weight: 500;
  padding: 5px 14px;
  border-radius: var(--radius-full);
}
.price-card h3 { font-size: 24px; font-weight: 600; margin-bottom: 8px; }
.price-card .price-sub { font-size: 16px; color: var(--text-muted); margin-bottom: 24px; }
.price-features { display: flex; flex-direction: column; gap: 14px; margin-bottom: 28px; }
.price-features li { display: flex; align-items: flex-start; gap: 10px; font-size: 16px; }
.price-features svg { width: 18px; height: 18px; flex-shrink: 0; color: var(--color-accent); margin-top: 2px; }
.price-amount { font-family: var(--font-serif); font-style: italic; font-size: 34px; margin-bottom: 24px; }
.price-card .btn { margin-top: auto; align-self: flex-start; }

.pricing-cta {
  background: var(--surface-soft);
  border-radius: var(--radius-md);
  padding: 36px;
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 20px;
}
.pricing-cta h4 { font-size: 20px; font-weight: 500; margin-bottom: 6px; }
.pricing-cta p { font-size: 16px; color: var(--text-muted); }

/* ---------------------------------- Proceso ---------------------------------- */
.process-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 32px; }
.process-num { font-family: var(--font-serif); font-style: italic; font-size: 30px; color: var(--color-accent); margin-bottom: 14px; }
.process-step h4 { font-size: 17px; font-weight: 500; margin-bottom: 8px; }
.process-step p { font-size: 14px; color: var(--text-muted); line-height: 1.6; }

/* ---------------------------------- Testimonios ---------------------------------- */
.testimonial-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; margin-bottom: 48px; }
.testimonial-card p.quote { font-size: 17px; line-height: 1.6; margin-bottom: 24px; }
.testimonial-author { display: flex; flex-direction: column; }
.testimonial-author .name { font-weight: 500; font-size: 15px; }
.testimonial-author .role { font-size: 13px; color: var(--text-muted); }

.section-cta {
  text-align: center;
  background: var(--surface-soft);
  border-radius: var(--radius-md);
  padding: 40px;
}
.section-cta h4 { font-size: 19px; font-weight: 500; margin-bottom: 14px; }
.section-cta a { font-size: 14px; font-weight: 500; color: var(--color-accent); text-decoration: underline; text-underline-offset: 4px; }

/* ---------------------------------- FAQ ---------------------------------- */
.faq-list { border-top: 1px solid var(--border-color); }
.faq-item { border-bottom: 1px solid var(--border-color); }
.faq-question {
  width: 100%;
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  background: none; border: none; color: var(--text-primary);
  text-align: left; padding: 26px 0; font-size: 17px; font-weight: 500;
}
.faq-question .icon { position: relative; width: 20px; height: 20px; flex-shrink: 0; }
.faq-question .icon::before, .faq-question .icon::after {
  content: ''; position: absolute; background: var(--color-accent);
  top: 50%; left: 50%; transform: translate(-50%,-50%);
  transition: transform .3s var(--ease), opacity .3s var(--ease);
}
.faq-question .icon::before { width: 14px; height: 2px; }
.faq-question .icon::after { width: 2px; height: 14px; }
.faq-item.is-open .icon::after { transform: translate(-50%,-50%) rotate(90deg); opacity: 0; }
.faq-answer { max-height: 0; overflow: hidden; transition: max-height .4s var(--ease); }
.faq-answer p { padding-bottom: 24px; font-size: 15px; color: var(--text-muted); max-width: 720px; line-height: 1.6; }

/* ---------------------------------- CTA final (light) ---------------------------------- */
.cta-final { text-align: center; }
.cta-final h2 {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(34px, 5vw, 60px);
  line-height: 1.1;
  margin-bottom: 20px;
}
.cta-final .sub { font-size: 17px; color: var(--text-muted); margin: 0 auto 36px; max-width: 480px; }
.cta-actions { display: flex; align-items: center; justify-content: center; gap: 16px; flex-wrap: wrap; }
.hero-dark .cta-actions { justify-content: flex-start; margin-top: 8px; }

/* ---------------------------------- Footer (dark) ---------------------------------- */
footer {
  background: var(--color-dark);
  color: rgba(255,255,255,.7);
  padding: 48px 0;
}
.footer-inner { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 20px; }
.footer-logo { font-family: var(--font-serif); font-style: italic; font-size: 18px; color: #F7F2EE; }
.footer-links { display: flex; gap: 26px; flex-wrap: wrap; }
.footer-links a { font-size: 14px; }
.footer-links a:hover { color: #F7F2EE; }
.footer-copy { font-size: 13px; }

/* ---------------------------------- Sobre mí: historia ---------------------------------- */
.history-grid { display: grid; grid-template-columns: 1.2fr 1fr; gap: 56px; align-items: start; }
.history-grid p { font-size: 16px; line-height: 1.75; color: var(--text-primary); margin-bottom: 20px; }
.quote-card {
  background: color-mix(in srgb, var(--color-accent) 8%, var(--surface-card));
  border: 1px solid color-mix(in srgb, var(--color-accent) 20%, transparent);
  border-radius: var(--radius-md);
  padding: 36px;
}
.quote-card p { font-size: 19px; font-weight: 500; line-height: 1.5; color: var(--text-primary); }

/* ---------------------------------- Lo que me define ---------------------------------- */
.define-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px; }
.define-num { font-family: var(--font-serif); font-style: italic; color: var(--color-accent); font-size: 28px; margin-bottom: 14px; }
.define-grid h4 { font-size: 17px; font-weight: 500; margin-bottom: 10px; }
.define-grid p { font-size: 14px; color: var(--text-muted); line-height: 1.6; }

/* ---------------------------------- Formación (timeline) ---------------------------------- */
.timeline { margin-top: 8px; }
.timeline-item { display: grid; grid-template-columns: 90px 24px 1fr; gap: 24px; }
.timeline-item .year { font-weight: 500; font-size: 16px; padding-top: 2px; }
.timeline-item.is-current .year { color: var(--color-accent); }
.timeline-rail { display: flex; flex-direction: column; align-items: center; }
.timeline-dot { width: 13px; height: 13px; border-radius: 50%; border: 2px solid var(--color-accent); background: var(--surface-page); flex-shrink: 0; }
.timeline-item.is-current .timeline-dot { background: var(--color-accent); }
.timeline-line { width: 1px; flex: 1; background: var(--border-color); margin-top: 4px; }
.timeline-item:last-child .timeline-line { display: none; }
.timeline-content { padding-bottom: 40px; }
.timeline-content h4 { font-size: 17px; font-weight: 500; margin-bottom: 6px; }
.timeline-content p { font-size: 14px; color: var(--text-muted); max-width: 600px; line-height: 1.6; }

/* ---------------------------------- Herramientas (marquee) ---------------------------------- */
.marquee-container {
  overflow: hidden;
  position: relative;
  width: 100%;
  margin-bottom: 16px;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
}
.marquee-track {
  display: flex;
  align-items: center;
  gap: 48px;
  width: max-content;
  padding: 4px 0;
  animation: marquee 30s linear infinite;
  will-change: transform;
}
.marquee-container:hover .marquee-track,
.marquee-track:hover { animation-play-state: paused; }
@keyframes marquee {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}
.tool-chip {
  display: flex; align-items: center; gap: 10px;
  background: var(--surface-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  padding: 10px 18px 10px 10px;
  flex-shrink: 0;
}
.tool-chip .tool-icon {
  width: 26px; height: 26px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 500; font-size: 12px; flex-shrink: 0;
}
.tool-chip span { font-size: 13px; font-weight: 500; color: var(--text-primary); white-space: nowrap; }
.tools-subtitle { font-size: 18px; font-weight: 500; margin: 48px 0 20px; }

/* ---------------------------------- Cómo trabajo (about) ---------------------------------- */
.work-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; }
.work-card { position: relative; }
.work-check {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  position: absolute;
  top: 32px;
  left: 32px;
  color: var(--color-accent);
}
.work-check svg { width: 18px; height: 18px; }
.work-card h4 { font-size: 17px; font-weight: 500; margin-bottom: 10px; padding-left: 32px; }
.work-card p { font-size: 14px; color: var(--text-muted); line-height: 1.6; }

/* ---------------------------------- Responsive ---------------------------------- */
@media (max-width: 1024px) {
  .what-grid { grid-template-columns: repeat(2, 1fr); }
  .process-grid { grid-template-columns: repeat(2, 1fr); }
  .define-grid { grid-template-columns: 1fr; }
  .history-grid { grid-template-columns: 1fr; }
}

@media (max-width: 860px) {
  .navbar { padding: 20px 5%; }
  .nav-links { display: none; }
  .nav-right > a.btn.nav-cta { display: none; }
  .nav-right { gap: 12px; }
  .nav-toggle { display: flex; }
  .hero-inner { grid-template-columns: 1fr; text-align: left; }
  .what-grid { grid-template-columns: 1fr; }
  .pricing-grid { grid-template-columns: 1fr; }
  .process-grid { grid-template-columns: 1fr; }
  .testimonial-grid { grid-template-columns: 1fr; }
  .work-grid { grid-template-columns: 1fr; }
  .project-list { grid-template-columns: 1fr; }
  section { padding: 80px 0; }
  .footer-inner { flex-direction: column; align-items: flex-start; text-align: left; }
}

@media (max-width: 560px) {
  :root { --nav-h: 72px; }
  .navbar { padding: 16px 18px; }
  .navbar.is-scrolled { padding: 12px 18px; }
  .nav-right { gap: 8px; }
  .theme-toggle, .nav-toggle { width: 36px; height: 36px; }

  .hero-dark { padding: calc(var(--nav-h) + 44px) 0 64px; }
  .hero-avatar { width: 120px; height: 120px; }
  .hero-dark h1 { font-size: clamp(36px, 12vw, 52px); line-height: 1.04; }
  .hero-dark p { font-size: 15px; line-height: 1.6; }
  .cta-actions { flex-direction: column; align-items: stretch; }
  .cta-actions .btn { width: 100%; justify-content: center; }
  .pricing-cta { flex-direction: column; align-items: flex-start; }
  .pricing-cta .btn { width: 100%; justify-content: center; text-align: center; }
  .timeline-item { grid-template-columns: 64px 20px 1fr; }
  .container { padding: 0 18px; }
  section { padding: 64px 0; }
  .section-tag { align-items: flex-start; gap: 8px; margin-bottom: 32px; font-size: 1.75rem; line-height: 1.15; }
  .card { padding: 24px; border-radius: 18px; }
  .work-check { top: 24px; left: 24px; }
  .project-card > *:not(.project-media) { padding-left: 18px; padding-right: 18px; }
  .project-media { margin-bottom: 20px; }
  .project-card h3 { font-size: 27px; }
  .project-links { flex-direction: column; gap: 10px; }
  .price-card { padding: 24px; }
  .price-card h3 { font-size: 22px; }
  .price-features li { font-size: 14px; line-height: 1.45; }
  .price-amount { font-size: 30px; }
  .footer-links { gap: 18px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ---------------------------------- Loading screen ---------------------------------- */
#loader {
  position: fixed;
  inset: 0;
  background: var(--surface-page);
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}

#loader.hidden {
  opacity: 0;
  visibility: hidden;
}

.loader-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.loader-initials {
  font-family: 'Cormorant Garamond', serif;
  font-size: 48px;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -1px;
  animation: fadeInUp 0.5s ease forwards;
}

.loader-initials span {
  color: #C4B0C8;
}

.loader-line {
  width: 0px;
  height: 2px;
  background: linear-gradient(90deg, var(--color-accent-dark), var(--color-neutral));
  border-radius: 99px;
  animation: expandLine 0.8s ease 0.3s forwards;
}

[data-theme="dark"] #loader {
  background: #1A1618;
}

[data-theme="dark"] .loader-initials {
  color: #F7F2EE;
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes expandLine {
  from { width: 0px; }
  to { width: 48px; }
}

/* ---------------------------------- Navbar en dark mode ---------------------------------- */
[data-theme="dark"] .navbar {
  background-color: rgba(15,15,18,0.9);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
[data-theme="dark"] .navbar a:not(.btn):not(.active) {
  color: #F4F4F5 !important;
}
[data-theme="dark"] .navbar a:not(.btn):not(.active):hover {
  color: #C4B0C8 !important;
}
[data-theme="dark"] .navbar-logo {
  color: #F4F4F5 !important;
}
[data-theme="dark"] .theme-toggle {
  border-color: rgba(255,255,255,0.08);
  color: #F4F4F5;
}

/* ---------------------------------- Dot grid (dark mode) ---------------------------------- */
#dotGrid {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  z-index: 0 !important;
  pointer-events: none !important;
  opacity: 1 !important;
  transition: opacity 0.3s ease;
  /* Capa propia: sus redibujados no deberían forzar repaint del resto de la página */
  transform: translateZ(0);
}

body > *:not(#dotGrid):not(#loader):not(.navbar) {
  position: relative;
  z-index: 2;
}

nav, header, .navbar {
  z-index: 100 !important;
}
