/* ==========================================================================
   Contadora Montenegro — Sistema de diseño
   Paleta: azul profundo, índigo, violeta y blancos
   ========================================================================== */

:root {
    --ink: #0b1230;
    --navy: #111a52;
    --blue: #3358e6;
    --indigo: #4a3fe0;
    --violet: #7c4df0;
    --violet-soft: #b9a4ff;
    --lavender: #f3f1ff;
    --mist: #f8f9ff;
    --white: #ffffff;
    --line: #e2e5f6;
    --text: #2a3050;
    --muted: #5d6586;

    --grad-brand: linear-gradient(135deg, var(--blue) 0%, var(--violet) 100%);
    --grad-hero: linear-gradient(145deg, #0b1230 0%, #151f66 48%, #3a2a9e 100%);

    --font-display: 'Fraunces', Georgia, 'Times New Roman', serif;
    --font-body: 'Manrope', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;

    --radius-lg: 24px;
    --radius-md: 14px;
    --header-h: 76px;
    --shadow-tint: 0 24px 60px -24px rgba(51, 56, 200, 0.35);
}

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

html {
    scroll-padding-top: var(--header-h);
}

body {
    font-family: var(--font-body);
    font-size: 1rem;
    line-height: 1.65;
    color: var(--text);
    background: var(--white);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

a {
    color: inherit;
}

:focus-visible {
    outline: 3px solid var(--violet);
    outline-offset: 3px;
    border-radius: 6px;
}

.container {
    width: 100%;
    max-width: 1160px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ==========================================================================
   Header
   ========================================================================== */

header {
    position: fixed;
    inset: 0 0 auto 0;
    z-index: 1000;
    height: var(--header-h);
    display: flex;
    align-items: center;
    color: var(--white);
    transition: background-color 0.3s ease, box-shadow 0.3s ease, color 0.3s ease;
}

header.scrolled {
    background: rgba(255, 255, 255, 0.88);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    box-shadow: 0 1px 0 var(--line), 0 12px 32px -20px rgba(30, 40, 120, 0.35);
    color: var(--navy);
}

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

.logo {
    display: inline-flex;
    align-items: center;
    gap: 0.7rem;
    font-family: var(--font-display);
    font-size: 1.4rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    text-decoration: none;
    color: inherit;
}

.logo::before {
    content: '';
    width: 14px;
    height: 14px;
    border-radius: 5px;
    background: var(--grad-brand);
    box-shadow: 0 0 0 4px rgba(124, 77, 240, 0.22);
    transform: rotate(45deg);
}

nav ul {
    display: flex;
    align-items: center;
    list-style: none;
    gap: 0.25rem;
}

nav ul li a {
    position: relative;
    display: block;
    padding: 0.55rem 1rem;
    font-size: 0.95rem;
    font-weight: 600;
    text-decoration: none;
    color: inherit;
    opacity: 0.82;
    border-radius: 999px;
    transition: opacity 0.2s ease, background-color 0.2s ease;
}

nav ul li a:hover {
    opacity: 1;
    background: rgba(124, 77, 240, 0.14);
}

nav ul li a.current {
    opacity: 1;
    background: rgba(124, 77, 240, 0.18);
}

header.scrolled nav ul li a:hover,
header.scrolled nav ul li a.current {
    background: var(--lavender);
    color: var(--indigo);
}

.hamburger {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 44px;
    height: 44px;
    padding: 0 10px;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 12px;
    color: inherit;
    cursor: pointer;
    transition: border-color 0.3s ease;
}

header.scrolled .hamburger {
    border-color: var(--line);
}

.hamburger span {
    display: block;
    height: 2px;
    width: 100%;
    background: currentColor;
    border-radius: 2px;
    transition: transform 0.3s ease, opacity 0.2s ease;
}

.hamburger.active span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
}

.hamburger.active span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* ==========================================================================
   Hero
   ========================================================================== */

#hero {
    position: relative;
    min-height: 100vh;
    min-height: 100svh;
    display: flex;
    align-items: center;
    padding: calc(var(--header-h) + 3rem) 0 5rem;
    color: var(--white);
    background: var(--grad-hero);
    overflow: hidden;
    isolation: isolate;
}

#hero::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: -1;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px);
    background-size: 56px 56px;
    mask-image: radial-gradient(ellipse at 70% 40%, #000 20%, transparent 75%);
    -webkit-mask-image: radial-gradient(ellipse at 70% 40%, #000 20%, transparent 75%);
}

.hero-orb {
    position: absolute;
    z-index: -1;
    border-radius: 50%;
    filter: blur(70px);
    will-change: transform;
}

.orb-1 {
    width: 460px;
    height: 460px;
    top: -120px;
    right: -80px;
    background: rgba(124, 77, 240, 0.55);
}

.orb-2 {
    width: 380px;
    height: 380px;
    bottom: -140px;
    left: -100px;
    background: rgba(51, 88, 230, 0.5);
}

.hero-inner {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
    align-items: center;
    gap: 4rem;
}

.hero-content h1 {
    font-family: var(--font-display);
    font-size: clamp(2.8rem, 6.4vw, 5rem);
    font-weight: 600;
    line-height: 1.04;
    letter-spacing: -0.025em;
    margin-bottom: 1.25rem;
}

.hero-content .subtitle {
    font-size: clamp(1.15rem, 2vw, 1.5rem);
    font-weight: 600;
    color: var(--violet-soft);
    margin-bottom: 0.9rem;
}

.hero-content .description {
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.78);
    max-width: 34rem;
    margin-bottom: 2.4rem;
}

.cta-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1rem 2.1rem;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 700;
    color: var(--white);
    text-decoration: none;
    background: var(--grad-brand);
    border: none;
    border-radius: 999px;
    cursor: pointer;
    box-shadow: 0 14px 30px -10px rgba(91, 72, 235, 0.65);
    transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

.cta-button:hover {
    transform: translateY(-2px);
    filter: brightness(1.08);
    box-shadow: 0 18px 36px -10px rgba(91, 72, 235, 0.8);
}

.cta-button:active {
    transform: translateY(0);
}

#hero .cta-button {
    background: var(--white);
    color: var(--indigo);
    box-shadow: 0 14px 34px -12px rgba(0, 0, 0, 0.5);
}

/* Hero visual (decorativo) */

.hero-visual {
    position: relative;
    justify-self: center;
    width: 100%;
    max-width: 460px;
    aspect-ratio: 1 / 0.92;
}

.visual-panel {
    position: absolute;
    inset: 8% 6% 6% 6%;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    gap: 1.5rem;
    padding: 2rem;
    background: linear-gradient(160deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.05));
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 28px;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: 0 40px 80px -30px rgba(5, 8, 40, 0.8);
}

.visual-bars {
    flex: 1;
    display: flex;
    align-items: flex-end;
    gap: 0.9rem;
}

.visual-bars span {
    flex: 1;
    height: var(--h);
    border-radius: 10px 10px 4px 4px;
    background: linear-gradient(180deg, #ffffff 0%, var(--violet-soft) 100%);
    opacity: 0.92;
    transform-origin: bottom;
    animation: grow 1.1s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.visual-bars span:nth-child(odd) {
    background: linear-gradient(180deg, #8fb0ff 0%, var(--blue) 100%);
}

.visual-bars span:nth-child(2) { animation-delay: 0.08s; }
.visual-bars span:nth-child(3) { animation-delay: 0.16s; }
.visual-bars span:nth-child(4) { animation-delay: 0.24s; }
.visual-bars span:nth-child(5) { animation-delay: 0.32s; }
.visual-bars span:nth-child(6) { animation-delay: 0.4s; }

@keyframes grow {
    from { transform: scaleY(0); }
    to   { transform: scaleY(1); }
}

.visual-lines {
    display: grid;
    gap: 0.6rem;
}

.visual-lines i {
    display: block;
    height: 8px;
    border-radius: 99px;
    background: rgba(255, 255, 255, 0.22);
}

.visual-lines i:nth-child(1) { width: 78%; }
.visual-lines i:nth-child(2) { width: 56%; }
.visual-lines i:nth-child(3) { width: 38%; }

.visual-chip {
    position: absolute;
    display: grid;
    place-items: center;
    width: 64px;
    height: 64px;
    font-size: 1.5rem;
    color: var(--indigo);
    background: var(--white);
    border-radius: 18px;
    box-shadow: 0 20px 40px -14px rgba(5, 8, 40, 0.7);
}

.chip-a { top: 0; right: 4%; }
.chip-b { bottom: 18%; left: -2%; color: var(--violet); }
.chip-c { bottom: 0; right: 14%; color: var(--blue); }

/* Entrada del hero (un único momento orquestado) */

.hero-content > * {
    animation: rise 0.9s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.hero-content .subtitle    { animation-delay: 0.12s; }
.hero-content .description { animation-delay: 0.24s; }
.hero-content .cta-button  { animation-delay: 0.36s; }

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

/* ==========================================================================
   Secciones
   ========================================================================== */

#services,
#about,
#contact {
    padding: 6.5rem 0;
}

.section-title {
    font-family: var(--font-display);
    font-size: clamp(2rem, 4vw, 2.9rem);
    font-weight: 600;
    line-height: 1.15;
    letter-spacing: -0.02em;
    text-align: center;
    color: var(--navy);
    margin-bottom: 3.5rem;
}

.section-title::after {
    content: '';
    display: block;
    width: 64px;
    height: 4px;
    margin: 1.1rem auto 0;
    border-radius: 99px;
    background: var(--grad-brand);
}

/* ---------- Servicios: panel tipo libro contable ---------- */

#services {
    background: var(--mist);
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1px;
    background: var(--line);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-tint);
}

.service-card {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 2.4rem 2.2rem 2.6rem;
    background: var(--white);
    transition: background-color 0.3s ease;
}

.service-card::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 3px;
    background: var(--grad-brand);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.35s ease;
}

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

.service-card:hover::after {
    transform: scaleX(1);
}

.service-card i {
    display: grid;
    place-items: center;
    width: 56px;
    height: 56px;
    margin-bottom: 1.5rem;
    font-size: 1.3rem;
    color: var(--white);
    background: var(--grad-brand);
    border-radius: 16px;
    box-shadow: 0 12px 24px -10px rgba(91, 72, 235, 0.7);
}

.service-card h3 {
    font-family: var(--font-display);
    font-size: 1.4rem;
    font-weight: 600;
    line-height: 1.25;
    letter-spacing: -0.01em;
    color: var(--navy);
    margin-bottom: 0.7rem;
}

.service-card p {
    color: var(--muted);
    font-size: 0.98rem;
    line-height: 1.75;
}

/* ---------- Sobre mí ---------- */

#about {
    background: var(--white);
}

.about-content {
    display: grid;
    grid-template-columns: 1.15fr 0.85fr;
    align-items: center;
    gap: 5rem;
}

.about-text h3 {
    font-family: var(--font-display);
    font-size: clamp(1.7rem, 3vw, 2.2rem);
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: -0.015em;
    color: var(--navy);
    margin-bottom: 1.4rem;
}

.about-text p {
    max-width: 38rem;
    color: var(--muted);
    font-size: 1.08rem;
    line-height: 1.8;
    margin-bottom: 1.25rem;
}

.credentials {
    display: grid;
    gap: 0.8rem;
    margin-top: 2.2rem;
    max-width: 30rem;
}

.credential-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.95rem 1.2rem;
    font-weight: 600;
    color: var(--navy);
    background: var(--lavender);
    border: 1px solid transparent;
    border-radius: var(--radius-md);
    transition: border-color 0.25s ease, background-color 0.25s ease;
}

.credential-item:hover {
    background: var(--white);
    border-color: var(--violet-soft);
}

.credential-item i {
    display: grid;
    place-items: center;
    flex: none;
    width: 38px;
    height: 38px;
    font-size: 1rem;
    color: var(--indigo);
    background: var(--white);
    border-radius: 11px;
    box-shadow: 0 6px 14px -8px rgba(74, 63, 224, 0.6);
}

.about-image {
    position: relative;
    justify-self: center;
    width: 100%;
    max-width: 380px;
}

.about-image::before {
    content: '';
    position: absolute;
    inset: 22px -22px -22px 22px;
    border-radius: 32px;
    background: var(--grad-brand);
    opacity: 0.22;
}

.about-image .placeholder {
    position: relative;
    display: grid;
    place-items: center;
    aspect-ratio: 4 / 5;
    border-radius: 32px;
    background:
        radial-gradient(circle at 30% 20%, rgba(255, 255, 255, 0.28), transparent 45%),
        linear-gradient(155deg, var(--blue) 0%, var(--indigo) 50%, var(--violet) 100%);
    box-shadow: var(--shadow-tint);
    overflow: hidden;
}

.about-image .placeholder::before,
.about-image .placeholder::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.22);
}

.about-image .placeholder::before {
    width: 120%;
    aspect-ratio: 1;
    bottom: -62%;
    left: -10%;
}

.about-image .placeholder::after {
    width: 70%;
    aspect-ratio: 1;
    top: -28%;
    right: -22%;
}

.about-image .placeholder i {
    position: relative;
    font-size: 6.5rem;
    color: rgba(255, 255, 255, 0.92);
}

/* ---------- Contacto ---------- */

#contact {
    position: relative;
    color: var(--white);
    background: var(--grad-hero);
    overflow: hidden;
    isolation: isolate;
}

#contact::before {
    content: '';
    position: absolute;
    z-index: -1;
    width: 520px;
    height: 520px;
    top: -200px;
    left: -160px;
    border-radius: 50%;
    background: rgba(124, 77, 240, 0.4);
    filter: blur(90px);
}

#contact .section-title {
    color: var(--white);
}

.contact-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: start;
    gap: 4rem;
}

.contact-info h3 {
    font-family: var(--font-display);
    font-size: clamp(1.7rem, 3vw, 2.2rem);
    font-weight: 600;
    letter-spacing: -0.015em;
    margin-bottom: 1.2rem;
}

.contact-info > p {
    max-width: 34rem;
    color: rgba(255, 255, 255, 0.78);
    font-size: 1.08rem;
    line-height: 1.8;
    margin-bottom: 2rem;
}

.contact-methods {
    display: grid;
    gap: 1rem;
}

.contact-method {
    display: flex;
    align-items: center;
    gap: 1.1rem;
    padding: 1.1rem 1.3rem;
    text-decoration: none;
    color: var(--white);
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 18px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: transform 0.25s ease, background-color 0.25s ease, border-color 0.25s ease;
}

.contact-method:hover {
    transform: translateX(6px);
    background: rgba(255, 255, 255, 0.14);
    border-color: rgba(185, 164, 255, 0.6);
}

.contact-method i {
    display: grid;
    place-items: center;
    flex: none;
    width: 52px;
    height: 52px;
    font-size: 1.35rem;
    color: var(--white);
    border-radius: 15px;
}

.contact-method.whatsapp i { background: #1fb457; }
.contact-method.phone i    { background: var(--blue); }
.contact-method.email i    { background: var(--violet); }

.contact-method .text {
    min-width: 0;
    flex: 1;
}

.contact-method .text h4 {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--violet-soft);
    margin-bottom: 0.1rem;
}

.contact-method .text p {
    margin: 0;
    font-size: 1.02rem;
    font-weight: 600;
    color: var(--white);
    overflow-wrap: anywhere;
}

.contact-form {
    padding: 2.6rem;
    color: var(--text);
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: 0 40px 80px -30px rgba(3, 6, 36, 0.75);
}

.contact-form h3 {
    font-family: var(--font-display);
    font-size: 1.8rem;
    font-weight: 600;
    letter-spacing: -0.015em;
    color: var(--navy);
    margin-bottom: 1.8rem;
}

.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.45rem;
    font-size: 0.92rem;
    font-weight: 700;
    color: var(--navy);
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.9rem 1rem;
    font-family: inherit;
    font-size: 1rem;
    color: var(--text);
    background: var(--mist);
    border: 1.5px solid var(--line);
    border-radius: 12px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.form-group input:hover,
.form-group textarea:hover {
    border-color: var(--violet-soft);
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    background: var(--white);
    border-color: var(--indigo);
    box-shadow: 0 0 0 4px rgba(74, 63, 224, 0.15);
}

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

.contact-form .cta-button {
    width: 100%;
    margin-top: 0.4rem;
}

/* ==========================================================================
   Footer
   ========================================================================== */

footer {
    padding: 2rem 0;
    text-align: center;
    font-size: 0.92rem;
    color: rgba(255, 255, 255, 0.72);
    background: var(--ink);
}

/* ==========================================================================
   Botón volver arriba y toast
   ========================================================================== */

#go-top {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 1001;
    display: grid;
    place-items: center;
    width: 50px;
    height: 50px;
    font-size: 1.1rem;
    color: var(--white);
    background: var(--grad-brand);
    border: none;
    border-radius: 16px;
    cursor: pointer;
    box-shadow: 0 14px 30px -10px rgba(91, 72, 235, 0.8);
    opacity: 0;
    visibility: hidden;
    transform: translateY(12px);
    transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s ease;
}

#go-top.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

#go-top:hover {
    transform: translateY(-3px);
}

#toast {
    position: fixed;
    left: 50%;
    bottom: 28px;
    z-index: 1100;
    max-width: calc(100% - 32px);
    padding: 1rem 1.5rem;
    font-weight: 600;
    text-align: center;
    color: var(--white);
    background: var(--navy);
    border-left: 4px solid var(--violet);
    border-radius: 14px;
    box-shadow: 0 24px 50px -16px rgba(5, 8, 40, 0.7);
    opacity: 0;
    visibility: hidden;
    transform: translate(-50%, 20px);
    transition: opacity 0.35s ease, transform 0.35s ease, visibility 0.35s ease;
}

#toast.show {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, 0);
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 1024px) {
    .hero-inner {
        gap: 2.5rem;
    }

    .services-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .about-content,
    .contact-content {
        grid-template-columns: 1fr;
        gap: 3.5rem;
    }

    .about-image {
        max-width: 320px;
    }
}

@media (max-width: 860px) {
    .hero-inner {
        grid-template-columns: 1fr;
    }

    .hero-visual {
        max-width: 380px;
    }
}

@media (max-width: 768px) {
    :root {
        --header-h: 68px;
    }

    .hamburger {
        display: flex;
    }

    nav {
        position: absolute;
        top: calc(100% + 8px);
        left: 16px;
        right: 16px;
        padding: 0.6rem;
        color: var(--navy);
        background: var(--white);
        border: 1px solid var(--line);
        border-radius: 20px;
        box-shadow: 0 30px 60px -20px rgba(20, 30, 110, 0.45);
        opacity: 0;
        visibility: hidden;
        transform: translateY(-8px);
        transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s ease;
    }

    nav.active {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
    }

    nav ul {
        flex-direction: column;
        align-items: stretch;
        gap: 0.15rem;
    }

    nav ul li a {
        padding: 0.95rem 1.1rem;
        border-radius: 12px;
        opacity: 1;
    }

    nav ul li a:hover,
    nav ul li a.current {
        background: var(--lavender);
        color: var(--indigo);
    }

    #services,
    #about,
    #contact {
        padding: 4.5rem 0;
    }

    .section-title {
        margin-bottom: 2.5rem;
    }

    .services-grid {
        grid-template-columns: 1fr;
    }

    .service-card {
        padding: 2rem 1.6rem;
    }

    .contact-form {
        padding: 2rem 1.6rem;
    }

    .container {
        padding: 0 18px;
    }
}

@media (max-width: 480px) {
    .visual-chip {
        width: 52px;
        height: 52px;
        font-size: 1.2rem;
        border-radius: 15px;
    }

    .contact-method {
        padding: 0.9rem 1rem;
    }

    .contact-method i {
        width: 46px;
        height: 46px;
        font-size: 1.2rem;
    }

    #go-top {
        right: 16px;
        bottom: 16px;
    }
}

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