/* ===========================
   Estudio Contable Di Pilla
   Corporate Design
   =========================== */

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

:root {
    --primary: #1B2A4A;
    --primary-light: #2D4470;
    --primary-dark: #0F1B33;
    --accent: #C5A55A;
    --accent-light: #D4BA7A;
    --accent-dim: rgba(197, 165, 90, 0.12);
    --bg-main: #F8F9FA;
    --bg-alt: #FFFFFF;
    --bg-dark: #F0F2F5;
    --text-primary: #1A1A2E;
    --text-secondary: #4A4A68;
    --text-light: #7A7A96;
    --border-color: #E2E4E9;
    --border-light: #D0D3DA;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', sans-serif;
    background: var(--bg-main);
    color: var(--text-primary);
    line-height: 1.7;
    overflow-x: hidden;
}

.container {
    max-width: 1140px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ===========================
   Navigation - transparent over hero, solid on scroll
   =========================== */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 999;
    padding: 0;
    transition: background 0.4s ease, box-shadow 0.4s ease, border-color 0.4s ease;
    background: transparent;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.navbar.scrolled {
    background: rgba(255, 255, 255, 0.97);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: 0 1px 24px rgba(27, 42, 74, 0.08);
    border-bottom-color: var(--border-color);
}

.nav-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 64px;
}

.navbar .logo {
    font-family: 'Playfair Display', serif;
    font-size: 22px;
    color: #FFFFFF;
    font-weight: 700;
    letter-spacing: 0.04em;
    transition: color 0.4s ease;
    line-height: 1;
}

.navbar.scrolled .logo {
    color: var(--primary);
}

.nav-links {
    position: fixed;
    top: 0;
    left: -100%;
    display: flex;
    flex-direction: column;
    list-style: none;
    background: var(--primary-dark);
    width: 280px;
    height: 100vh;
    height: 100dvh;
    padding: 80px 32px 40px;
    gap: 0;
    transition: left 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000;
    box-shadow: 4px 0 30px rgba(0, 0, 0, 0.3);
}

.nav-links.active {
    left: 0;
}

.nav-links li {
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.nav-links li:last-child {
    border-bottom: none;
}

.nav-links a {
    display: block;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    font-size: 14px;
    font-weight: 400;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    transition: all 0.25s ease;
    padding: 16px 0;
}

.nav-links a:hover {
    color: var(--accent-light);
    padding-left: 8px;
}

/* Mobile menu overlay */
.nav-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 998;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.35s ease;
}

.nav-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.mobile-menu-btn {
    display: flex;
    flex-direction: column;
    background: transparent;
    border: none;
    cursor: pointer;
    gap: 5px;
    padding: 8px;
    z-index: 1001;
}

.mobile-menu-btn span {
    width: 22px;
    height: 1.5px;
    background: #FFFFFF;
    transition: all 0.3s ease;
    transform-origin: center;
}

.navbar.scrolled .mobile-menu-btn span {
    background: var(--primary);
}

.mobile-menu-btn.active span {
    background: #FFFFFF;
}

.mobile-menu-btn.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.mobile-menu-btn.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-btn.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* ===========================
   Hero Section
   =========================== */
.hero {
    position: relative;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    background: linear-gradient(160deg, #0a1628 0%, var(--primary) 35%, var(--primary-light) 70%, #1B2A4A 100%);
    overflow: hidden;
}

/* Geometric accent - diagonal line */
.hero::before {
    content: '';
    position: absolute;
    top: 0;
    right: -10%;
    width: 1px;
    height: 140%;
    background: linear-gradient(180deg, transparent 0%, rgba(197, 165, 90, 0.2) 30%, rgba(197, 165, 90, 0.08) 70%, transparent 100%);
    transform: rotate(25deg);
    transform-origin: top center;
}

/* Noise texture */
.hero::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
    opacity: 0.03;
    pointer-events: none;
    mix-blend-mode: overlay;
}

.hero-content {
    position: relative;
    z-index: 2;
    padding: 0 24px;
    width: 100%;
    max-width: 800px;
}

.hero-title {
    font-family: 'Playfair Display', serif;
    font-size: 40px;
    color: #FFFFFF;
    font-weight: 700;
    margin-bottom: 24px;
    animation: fadeInDown 0.8s ease;
    letter-spacing: 0.01em;
    line-height: 1.15;
}

.hero-subtitle {
    font-size: 12px;
    color: var(--accent);
    margin-bottom: 20px;
    font-weight: 500;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    animation: fadeInDown 0.8s ease 0.15s both;
}

.hero-description {
    font-size: 15px;
    color: rgba(255, 255, 255, 0.55);
    max-width: 480px;
    margin: 0 auto;
    animation: fadeInDown 0.8s ease 0.3s both;
    font-style: italic;
    line-height: 1.6;
}

/* Scroll indicator - animated vertical hairline */
.scroll-indicator {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2;
}

.scroll-line {
    width: 1px;
    height: 40px;
    background: rgba(255, 255, 255, 0.12);
    position: relative;
    overflow: hidden;
}

.scroll-line::before {
    content: '';
    position: absolute;
    top: -100%;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(197, 165, 90, 0.6);
    animation: lineDown 2s ease-in-out infinite;
}

@keyframes lineDown {
    0% { top: -100%; }
    50% { top: 0; }
    100% { top: 100%; }
}

@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-16px); }
    to { opacity: 1; transform: translateY(0); }
}

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

/* ===========================
   Section Styles
   =========================== */
section {
    padding: 80px 0;
    position: relative;
}

.section-header {
    text-align: center;
    margin-bottom: 48px;
}

.section-header h2 {
    font-family: 'Playfair Display', serif;
    font-size: 32px;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 16px;
}

.divider {
    width: 48px;
    height: 2px;
    margin: 0 auto;
    background: var(--accent);
}

/* ===========================
   Servicios Section
   =========================== */
.servicios {
    background: var(--bg-alt);
}

.servicios-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}

.servicio-card {
    background: var(--bg-main);
    padding: 32px 28px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
    position: relative;
}

.servicio-card::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 28px;
    right: 28px;
    height: 2px;
    background: var(--accent);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.4s ease;
}

.servicio-card:hover {
    border-color: var(--border-light);
    box-shadow: 0 8px 32px rgba(27, 42, 74, 0.06);
    transform: translateY(-2px);
}

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

.servicio-icon {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent-dim);
    border-radius: 8px;
    margin-bottom: 20px;
}

.servicio-icon svg {
    width: 22px;
    height: 22px;
    stroke: var(--accent);
    fill: none;
    stroke-width: 1.5;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.servicio-card h3 {
    font-family: 'Inter', sans-serif;
    font-size: 17px;
    color: var(--primary);
    margin-bottom: 10px;
    font-weight: 600;
}

.servicio-card > p {
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 400;
    line-height: 1.65;
    margin-bottom: 14px;
}

.servicio-card ul {
    list-style: none;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.servicio-card ul li {
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 500;
    padding: 4px 12px;
    background: var(--bg-alt);
    border: 1px solid var(--border-color);
    border-radius: 100px;
    letter-spacing: 0.02em;
}

/* ===========================
   Sobre Nosotros Section
   =========================== */
.nosotros {
    background: var(--primary);
    color: #FFFFFF;
}

.nosotros .section-header h2 {
    color: #FFFFFF;
}

.nosotros .divider {
    background: var(--accent);
}

.nosotros-content {
    max-width: 720px;
    margin: 0 auto;
}

.nosotros-text {
    text-align: center;
}

.nosotros-lead {
    font-family: 'Playfair Display', serif;
    font-size: 21px;
    color: #FFFFFF;
    line-height: 1.6;
    margin-bottom: 20px;
    font-weight: 400;
}

.nosotros-text p {
    color: rgba(255, 255, 255, 0.6);
    font-size: 15px;
    font-weight: 300;
    line-height: 1.8;
    margin-bottom: 14px;
}

.nosotros-text p:last-child {
    margin-bottom: 0;
}

/* ===========================
   Por Qué Elegirnos Section
   =========================== */
.elegirnos {
    background: var(--bg-alt);
}

.elegirnos-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}

.elegirnos-card {
    padding: 32px 28px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: var(--bg-main);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.elegirnos-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 3px;
    height: 100%;
    background: var(--accent);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.elegirnos-card:hover {
    border-color: var(--border-light);
    box-shadow: 0 8px 32px rgba(27, 42, 74, 0.06);
}

.elegirnos-card:hover::before {
    opacity: 1;
}

.elegirnos-number {
    font-family: 'Playfair Display', serif;
    font-size: 28px;
    color: var(--accent);
    font-weight: 700;
    margin-bottom: 12px;
    line-height: 1;
}

.elegirnos-card h3 {
    font-size: 15px;
    color: var(--primary);
    margin-bottom: 8px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.elegirnos-card p {
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 400;
    line-height: 1.65;
}

/* ===========================
   FAQ Section
   =========================== */
.faq {
    background: var(--bg-main);
}

.faq-grid {
    display: grid;
    gap: 12px;
    max-width: 720px;
    margin: 0 auto;
}

.faq-item {
    background: var(--bg-alt);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 20px 24px;
    cursor: pointer;
    transition: all 0.25s ease;
}

.faq-item:hover {
    border-color: var(--border-light);
}

.faq-item[open] {
    border-color: var(--accent);
}

.faq-item summary {
    font-size: 15px;
    font-weight: 500;
    color: var(--text-primary);
    cursor: pointer;
    list-style: none;
    padding-right: 32px;
    position: relative;
    line-height: 1.5;
}

.faq-item summary::-webkit-details-marker {
    display: none;
}

.faq-item summary::after {
    content: '+';
    position: absolute;
    right: 0;
    top: 0;
    font-size: 20px;
    color: var(--accent);
    font-weight: 300;
    transition: transform 0.3s ease;
    line-height: 1.5;
}

.faq-item[open] summary::after {
    transform: rotate(45deg);
}

.faq-item p {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border-color);
    color: var(--text-secondary);
    line-height: 1.7;
    font-size: 14px;
    font-weight: 400;
}

/* ===========================
   Contact Section
   =========================== */
.contact {
    background: var(--bg-alt);
}

.contact-content {
    display: grid;
    grid-template-columns: 1fr;
    gap: 30px;
}

.contact-info {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: var(--bg-main);
    transition: all 0.25s ease;
}

.contact-item:hover {
    border-color: var(--accent);
}

.contact-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent-dim);
    border-radius: 8px;
    flex-shrink: 0;
}

.contact-icon svg {
    width: 18px;
    height: 18px;
    stroke: var(--accent);
    fill: none;
    stroke-width: 1.5;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.contact-details h4 {
    font-size: 13px;
    color: var(--text-light);
    margin-bottom: 2px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.contact-details p {
    color: var(--text-primary);
    font-size: 15px;
    font-weight: 500;
    margin: 0;
}

.contact-details a {
    color: var(--text-primary);
    text-decoration: none;
    transition: color 0.2s ease;
}

.contact-details a:hover {
    color: var(--accent);
}

.map-link {
    display: inline-block;
    margin-top: 4px;
    color: var(--accent) !important;
    font-weight: 500;
    font-size: 12px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.contact-map {
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.contact-map iframe {
    width: 100%;
    display: block;
    min-height: 320px;
    filter: grayscale(20%) contrast(1.05);
}

/* ===========================
   Footer
   =========================== */
footer {
    background: var(--primary-dark);
    padding: 48px 0 28px;
    text-align: center;
}

footer .logo {
    font-family: 'Playfair Display', serif;
    font-size: 28px;
    color: #FFFFFF;
    font-weight: 700;
    margin-bottom: 8px;
}

footer .content > p {
    color: rgba(255, 255, 255, 0.4);
    margin-bottom: 24px;
    font-weight: 400;
    letter-spacing: 0.12em;
    font-size: 12px;
    text-transform: uppercase;
}

footer .bottom-bar {
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: center;
    padding-top: 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    font-size: 13px;
    color: rgba(255, 255, 255, 0.35);
}

footer .copyright {
    font-weight: 300;
    font-size: 12px;
}

/* Site Signature */
.site-signature {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.375rem 0.75rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0.25rem;
    background: rgba(255, 255, 255, 0.03);
    color: rgba(255, 255, 255, 0.4);
    text-decoration: none;
    font-size: 0.75rem;
    white-space: nowrap;
    transition: all 0.2s ease;
}

.site-signature::before {
    content: "\25C6";
    font-size: 0.625rem;
    color: var(--accent);
}

.site-signature:hover {
    color: rgba(255, 255, 255, 0.65);
    border-color: rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.05);
}

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

@media (max-width: 380px) {
    .hero-title {
        font-size: 32px;
    }

    .hero-subtitle {
        font-size: 11px;
        letter-spacing: 0.2em;
    }

    .contact-item {
        flex-direction: column;
        text-align: center;
    }

    .contact-icon {
        margin: 0 auto;
    }
}

/* Tablets and up */
@media (min-width: 769px) {
    .nav-links {
        position: static;
        flex-direction: row;
        background: transparent;
        width: auto;
        height: auto;
        padding: 0;
        gap: 36px;
        box-shadow: none;
        z-index: auto;
    }

    .nav-links li {
        border-bottom: none;
    }

    .nav-links a {
        display: inline;
        color: rgba(255, 255, 255, 0.75);
        font-size: 12px;
        letter-spacing: 0.1em;
        padding: 0;
        position: relative;
    }

    .nav-links a::after {
        content: '';
        position: absolute;
        bottom: -4px;
        left: 0;
        width: 0;
        height: 1px;
        background: var(--accent);
        transition: width 0.3s ease;
    }

    .nav-links a:hover {
        color: #FFFFFF;
        padding-left: 0;
    }

    .nav-links a:hover::after {
        width: 100%;
    }

    .navbar.scrolled .nav-links a {
        color: var(--text-secondary);
    }

    .navbar.scrolled .nav-links a:hover {
        color: var(--primary);
    }

    .mobile-menu-btn {
        display: none;
    }

    .nav-content {
        height: 72px;
    }

    .navbar .logo {
        font-size: 24px;
    }

    .hero-title {
        font-size: 68px;
    }

    .hero-subtitle {
        font-size: 14px;
        letter-spacing: 0.35em;
    }

    .hero-description {
        font-size: 16px;
    }

    .section-header {
        margin-bottom: 60px;
    }

    .section-header h2 {
        font-size: 42px;
    }

    section {
        padding: 100px 0;
    }

    .servicios-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 24px;
    }

    .elegirnos-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 24px;
    }

    .contact-content {
        grid-template-columns: 1fr 1.3fr;
        gap: 40px;
        align-items: start;
    }

    footer .bottom-bar {
        flex-direction: row;
        justify-content: space-between;
    }
}

/* Large screens */
@media (min-width: 1024px) {
    .servicios-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .elegirnos-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}
