:root {
    --ink: #233735;
    --ink-soft: #536563;
    --teal: #174b4b;
    --teal-dark: #123a3d;
    --sage: #e6eeea;
    --sage-deep: #cadbd2;
    --cream: #f8f6f1;
    --paper: #fffefa;
    --ochre: #bd8450;
    --line: #dce4df;
    --font-body: 'DM Sans', sans-serif;
    --font-display: 'DM Serif Display', Georgia, serif;
    --shadow: 0 18px 55px rgba(31, 58, 53, 0.09);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: 90px; }
body { background: var(--paper); color: var(--ink); font-family: var(--font-body); font-size: 16px; line-height: 1.7; }
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }
button, input, textarea { font: inherit; }
:focus-visible { outline: 3px solid var(--ochre); outline-offset: 4px; }
.container { width: min(100% - 3rem, 1160px); margin-inline: auto; }
.section { padding-block: 6.5rem; }
.section-title { max-width: 720px; margin: 0 auto 3rem; color: var(--teal-dark); font-family: var(--font-display); font-size: clamp(2.2rem, 4vw, 3.2rem); font-weight: 400; line-height: 1.12; text-align: center; }
.bg-light { background: var(--cream); }

/* Navegación */
.navbar { position: fixed; inset: 0 0 auto; z-index: 1000; display: flex; min-height: 78px; align-items: center; justify-content: space-between; gap: 2rem; padding: 0.75rem max(5vw, calc((100vw - 1160px) / 2)); border-bottom: 1px solid rgba(220, 228, 223, 0.75); background: rgba(255, 254, 250, 0.94); backdrop-filter: blur(16px); }
.logo { display: flex; align-items: center; gap: 0.95rem; color: var(--teal-dark); }
.logo-mark { display: block; width: 64px; height: 64px; flex: 0 0 64px; overflow: hidden; border: 1px solid var(--line); border-radius: 10px; background: white; }
.logo-mark img { width: 100%; height: 100%; object-fit: contain; }
.logo-name { display: flex; flex-direction: column; font-size: 1.2rem; font-weight: 700; letter-spacing: -0.025em; line-height: 1.15; }
.logo-name span { margin-top: 0.35rem; color: var(--ink-soft); font-size: 0.72rem; font-weight: 500; letter-spacing: 0.045em; }
.nav-links { display: flex; align-items: center; gap: clamp(1.2rem, 2.5vw, 2.1rem); }
.nav-links a { color: var(--ink-soft); font-size: 0.87rem; font-weight: 600; transition: color 180ms ease, background 180ms ease; }
.nav-links a:hover { color: var(--teal); }
.nav-links .cta-nav { padding: 0.72rem 1.2rem; border-radius: 999px; background: var(--teal); color: white; }
.nav-links .cta-nav:hover { background: var(--teal-dark); color: white; }
.burger { display: none; cursor: pointer; border: 1px solid var(--line); background: transparent; padding: 0.55rem; border-radius: 10px; }
.burger div { width: 22px; height: 2px; margin: 4px; border-radius: 3px; background: var(--teal-dark); transition: transform 180ms ease, opacity 180ms ease; }
.burger.toggle .line1 { transform: translateY(6px) rotate(-45deg); }
.burger.toggle .line2 { opacity: 0; }
.burger.toggle .line3 { transform: translateY(-6px) rotate(45deg); }

/* Portada */
.hero { position: relative; min-height: min(790px, 100svh); overflow: hidden; padding: 9rem 0 5.5rem; background: radial-gradient(ellipse at 79% 47%, #e7efea 0, #e7efea 23%, transparent 23.2%), var(--cream); }
.hero::before { position: absolute; top: -8rem; right: -6rem; width: 29rem; height: 29rem; border: 1px solid rgba(23, 75, 75, 0.11); border-radius: 50%; content: ''; }
.hero-inner { position: relative; display: grid; width: min(100% - 3rem, 1160px); min-height: 570px; grid-template-columns: 1.05fr 0.95fr; align-items: center; gap: clamp(3rem, 8vw, 7rem); margin-inline: auto; }
.hero-content { max-width: 590px; padding-block: 2rem; }
.eyebrow { margin-bottom: 1.25rem; color: var(--teal); font-size: 0.76rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; }
.hero h1 { margin-bottom: 1.35rem; color: var(--teal-dark); font-family: var(--font-display); font-size: clamp(3.2rem, 6.1vw, 5.4rem); font-weight: 400; letter-spacing: -0.035em; line-height: 0.99; }
.hero h1 em { color: var(--teal); font-weight: 400; }
.hero-content > p:not(.eyebrow) { max-width: 490px; color: var(--ink-soft); font-size: 1.1rem; line-height: 1.8; }
.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 1.3rem 1.8rem; margin-top: 2rem; }
.btn-primary { display: inline-flex; min-height: 52px; align-items: center; justify-content: center; padding: 0.8rem 1.45rem; border: 1px solid var(--teal); border-radius: 999px; background: var(--teal); color: white; font-size: 0.92rem; font-weight: 700; transition: transform 180ms ease, background 180ms ease, box-shadow 180ms ease; }
.btn-primary:hover { transform: translateY(-2px); background: var(--teal-dark); box-shadow: 0 10px 25px rgba(18, 58, 61, 0.18); }
.btn-primary:disabled { cursor: wait; opacity: 0.65; transform: none; }
.text-link { color: var(--teal); font-size: 0.92rem; font-weight: 700; }
.text-link span { padding-left: 0.25rem; transition: padding 180ms ease; }
.text-link:hover span { padding-left: 0.55rem; }
.hero-visual { position: relative; width: min(100%, 440px); justify-self: end; }
.hero-visual::before { position: absolute; inset: 1.3rem -1.3rem -1.3rem 1.3rem; z-index: 0; border: 1px solid rgba(23, 75, 75, 0.2); border-radius: 48% 48% 22px 22px; content: ''; }
.hero-visual > img { position: relative; z-index: 1; width: 100%; aspect-ratio: 0.82; border-radius: 48% 48% 18px 18px; object-fit: cover; object-position: center 34%; box-shadow: var(--shadow); }
.hero-note { position: absolute; right: -2.25rem; bottom: 2.2rem; z-index: 2; display: flex; align-items: center; gap: 0.85rem; max-width: 290px; padding: 1rem 1.25rem; border: 1px solid rgba(220, 228, 223, 0.8); border-radius: 14px; background: var(--paper); box-shadow: var(--shadow); color: var(--ink); font-size: 0.8rem; font-weight: 600; line-height: 1.45; }
.hero-note-mark { color: var(--ochre); font-size: 1.7rem; }

/* Perfil */
.about-grid { display: grid; grid-template-columns: 1.1fr 0.9fr; align-items: center; gap: clamp(2rem, 6vw, 5rem); }
.about-gallery { min-width: 0; }
.gallery-viewport { position: relative; overflow: hidden; aspect-ratio: 1 / 1; border-radius: 18px; background: var(--sage); box-shadow: var(--shadow); isolation: isolate; }
.gallery-slide { position: absolute; inset: 0; z-index: 0; margin: 0; opacity: 0; visibility: hidden; transition: opacity 850ms ease, visibility 0s linear 850ms; }
.gallery-slide.is-active { z-index: 1; opacity: 1; visibility: visible; transition-delay: 0s; }
.gallery-slide img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center; }
.gallery-slide--bg3 img { object-position: center 70%; }
.gallery-slide::after { position: absolute; inset: 30% 0 0; z-index: 1; background: linear-gradient(180deg, transparent, rgba(18, 58, 61, 0.82)); content: ''; pointer-events: none; }
.image-caption { position: absolute; inset: auto 0 0; z-index: 2; display: grid; gap: 0.25rem; padding: 3rem 1.35rem 1.25rem; }
.image-caption strong { color: white; font-size: 1rem; }
.image-caption span { max-width: 38rem; color: rgba(255, 255, 255, 0.9); font-size: 0.84rem; line-height: 1.5; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; clip-path: inset(50%); border: 0; }
.about-text .eyebrow { margin-bottom: 0.7rem; }
.about-text h2 { margin-bottom: 1.3rem; color: var(--teal-dark); font-family: var(--font-display); font-size: clamp(2.3rem, 4vw, 3.3rem); font-weight: 400; line-height: 1.1; }
.about-text p { margin-top: 1rem; color: var(--ink-soft); }

/* Formación */
#cv { background: var(--cream); }
.cv-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2rem; }
.cv-column { padding: clamp(1.5rem, 3vw, 2.5rem); border: 1px solid var(--line); border-radius: 18px; background: var(--paper); }
.cv-column h3 { margin-bottom: 1.7rem; padding-bottom: 1rem; border-bottom: 1px solid var(--line); color: var(--teal); font-size: 1rem; font-weight: 700; letter-spacing: 0.02em; }
.cv-item { position: relative; margin-left: 0.2rem; padding: 0 0 1.6rem 1.25rem; border-left: 1px solid var(--sage-deep); }
.cv-item:last-child { padding-bottom: 0; border-color: transparent; }
.cv-item::before { position: absolute; top: 0.42rem; left: -5px; width: 9px; height: 9px; border-radius: 50%; background: var(--ochre); content: ''; }
.cv-item h4 { color: var(--ink); font-size: 1rem; font-weight: 700; line-height: 1.4; }
.cv-item .date { display: inline-block; margin-top: 0.35rem; color: var(--teal); font-size: 0.78rem; font-weight: 700; }
.cv-item p { margin-top: 0.3rem; color: var(--ink-soft); font-size: 0.9rem; }

/* Servicios */
.services-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.25rem; }
.card { min-height: 230px; padding: 2rem; border: 1px solid var(--line); border-radius: 16px; background: var(--paper); transition: transform 200ms ease, box-shadow 200ms ease, border-color 200ms ease; }
.card::before { display: block; width: 38px; height: 3px; margin-bottom: 1.5rem; border-radius: 5px; background: var(--ochre); content: ''; }
.card:hover { transform: translateY(-5px); border-color: var(--sage-deep); box-shadow: var(--shadow); }
.card h3 { margin-bottom: 0.75rem; color: var(--teal-dark); font-family: var(--font-display); font-size: 1.45rem; font-weight: 400; line-height: 1.2; }
.card p { color: var(--ink-soft); font-size: 0.93rem; }

/* Artículos */
.articles-section { background: var(--sage); }
.articles-heading { display: flex; align-items: end; justify-content: space-between; gap: 2rem; margin-bottom: 2.25rem; }
.articles-heading .eyebrow { margin-bottom: 0.55rem; }
.articles-heading .section-title { max-width: 740px; margin: 0; font-size: clamp(2rem, 3.5vw, 2.8rem); text-align: left; }
.articles-controls { display: flex; flex: 0 0 auto; gap: 0.65rem; }
.article-arrow { display: grid; width: 46px; height: 46px; place-items: center; border: 1px solid var(--line); border-radius: 50%; background: var(--paper); color: var(--teal); cursor: pointer; font-size: 1.2rem; transition: background 180ms ease, color 180ms ease, opacity 180ms ease; }
.article-arrow:hover:not(:disabled) { background: var(--teal); color: white; }
.article-arrow:disabled { cursor: default; opacity: 0.42; }
.articles-carousel { display: flex; gap: 1.25rem; overflow-x: auto; padding: 0.25rem 0.2rem 1rem; scroll-behavior: smooth; scroll-snap-type: x mandatory; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.articles-carousel::-webkit-scrollbar { display: none; }
.article-card { display: flex; min-width: 0; min-height: 300px; flex: 0 0 calc((100% - 2.5rem) / 3); flex-direction: column; align-items: flex-start; justify-content: space-between; gap: 1.7rem; padding: 1.7rem; border: 1px solid rgba(220, 228, 223, 0.9); border-radius: 16px; background: var(--paper); box-shadow: 0 10px 28px rgba(31, 58, 53, 0.05); scroll-snap-align: start; transition: transform 180ms ease, box-shadow 180ms ease; }
.article-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.article-source { display: inline-flex; margin-bottom: 1rem; color: var(--teal); font-size: 0.7rem; font-weight: 700; letter-spacing: 0.07em; line-height: 1.5; text-transform: uppercase; }
.article-card h3 { margin-bottom: 0.75rem; color: var(--teal-dark); font-family: var(--font-display); font-size: 1.35rem; font-weight: 400; line-height: 1.25; }
.article-card p { color: var(--ink-soft); font-size: 0.87rem; line-height: 1.65; }
.article-card a { display: inline-flex; align-items: center; gap: 0.35rem; color: var(--teal); font-size: 0.84rem; font-weight: 700; text-underline-offset: 3px; }
.article-card a:hover { text-decoration: underline; }

/* Testimonios */
.testimonials-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.4rem; }
.testimonial-card { padding: 2rem; border: 1px solid var(--line); border-radius: 16px; background: var(--paper); }
.testimonial-card p { color: var(--ink); font-family: var(--font-display); font-size: 1.3rem; line-height: 1.5; }
.testimonial-card span { display: block; margin-top: 1.1rem; color: var(--ink-soft); font-size: 0.82rem; font-weight: 600; }

/* Contacto */
.contact-wrapper { display: grid; grid-template-columns: 1.05fr 0.95fr; gap: clamp(2.5rem, 7vw, 6rem); align-items: start; }
.contact-form { display: grid; gap: 0.55rem; }
.contact-form label { margin-top: 0.35rem; color: var(--ink); font-size: 0.86rem; font-weight: 700; }
.contact-form input, .contact-form textarea { width: 100%; padding: 0.85rem 1rem; border: 1px solid var(--line); border-radius: 9px; background: var(--paper); color: var(--ink); font-family: inherit; }
.contact-form input:focus, .contact-form textarea:focus { border-color: var(--teal); outline: 2px solid rgba(23, 75, 75, 0.14); }
.contact-form textarea { resize: vertical; }
.contact-form .btn-primary { justify-self: start; margin-top: 0.5rem; cursor: pointer; }
.contact-info { padding: 2rem; border-radius: 16px; background: var(--sage); }
.contact-info p + p { margin-top: 1rem; }
.contact-info strong { display: block; color: var(--teal-dark); font-size: 0.78rem; letter-spacing: 0.045em; text-transform: uppercase; }
.contact-info a { color: var(--teal); text-decoration: underline; text-decoration-color: rgba(23, 75, 75, 0.35); text-underline-offset: 3px; }
.contact-info a:hover { text-decoration-color: currentColor; }
.form-status { min-height: 1.5em; margin-top: 0.3rem; color: var(--teal); font-size: 0.85rem; }
.form-status.is-error { color: #a12622; }
.form-trap { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* Pie */
footer { padding: 2rem 1.5rem; background: var(--teal-dark); color: rgba(255, 255, 255, 0.85); text-align: center; font-size: 0.83rem; }

@media (max-width: 900px) {
    .navbar { padding-inline: 1.5rem; }
    .hero-inner { gap: 3rem; }
    .hero-note { right: -1rem; }
    .article-card { flex-basis: calc((100% - 1.25rem) / 2); }
}

@media (max-width: 768px) {
    html { scroll-padding-top: 76px; }
    .navbar { min-height: 70px; padding-inline: 1.25rem; }
    .logo-name { font-size: 1.05rem; }
    .logo-name span { font-size: 0.65rem; }
    .logo-mark { width: 54px; height: 54px; flex-basis: 54px; }
    .burger { display: block; }
    .nav-links { position: absolute; top: 100%; right: 0; display: none; width: min(88vw, 370px); min-height: calc(100svh - 70px); flex-direction: column; align-items: stretch; gap: 0.2rem; padding: 1.25rem; border-top: 1px solid var(--line); background: var(--paper); box-shadow: 0 16px 28px rgba(31, 58, 53, 0.1); }
    .nav-links.nav-active { display: flex; }
    .nav-links li a { display: block; padding: 0.85rem 1rem; border-radius: 9px; }
    .nav-links .cta-nav { margin-top: 0.5rem; text-align: center; }
    .hero { min-height: auto; padding: 7rem 0 4rem; background: radial-gradient(ellipse at 78% 62%, #e7efea 0, #e7efea 25%, transparent 25.2%), var(--cream); }
    .hero-inner { grid-template-columns: 1fr; gap: 3.5rem; }
    .hero-content { max-width: 620px; padding: 1rem 0 0; }
    .hero h1 { font-size: clamp(3rem, 11vw, 4.6rem); }
    .hero-content > p:not(.eyebrow) { font-size: 1rem; }
    .hero-visual { width: min(83%, 410px); justify-self: center; }
    .hero-note { right: -1rem; bottom: 1.25rem; }
    .section { padding-block: 4.5rem; }
    .about-grid { grid-template-columns: 1fr; gap: 2.5rem; }
    .about-gallery { max-width: 640px; }
    .cv-grid { grid-template-columns: 1fr; }
    .services-grid { grid-template-columns: 1fr; }
    .card { min-height: auto; }
    .articles-heading { align-items: flex-start; flex-direction: column; gap: 1.25rem; }
    .article-card { min-height: 280px; flex-basis: 86%; }
    .contact-wrapper { grid-template-columns: 1fr; gap: 2rem; }
}

@media (max-width: 520px) {
    .container, .hero-inner { width: min(100% - 2rem, 1160px); }
    .hero { padding-top: 6.5rem; }
    .hero h1 { font-size: clamp(2.75rem, 12vw, 3.7rem); }
    .hero-actions { align-items: flex-start; flex-direction: column; gap: 1rem; }
    .hero-visual { width: 82%; }
    .hero-note { right: -1.2rem; max-width: 245px; padding: 0.8rem 0.95rem; font-size: 0.72rem; }
    .section-title { margin-bottom: 2rem; }
    .testimonials-grid { grid-template-columns: 1fr; }
    .cv-column, .contact-info { padding: 1.4rem; }
}

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