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

:root {
    --bg: #ffffff;
    --ink: #1a1714;
    --muted: #a4aa84;
    --accent: #a289b0;
    --accent-light: #f2e9f5;
    --line: rgba(164, 170, 132, 0.12);
    --serif: "Cormorant Garamond", Georgia, serif;
    --sans: "DM Sans", sans-serif;
}

html {
    scroll-behavior: smooth;
}

body {
    background: var(--bg);
    color: var(--ink);
    font-family: var(--sans);
    font-weight: 300;
    line-height: 1.6;
    overflow-x: hidden;
    padding-top: 5rem;
}

/* ── NAV ── */
nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.4rem 4rem;
    background: var(--bg);
    border-bottom: 1px solid transparent;
    transition: border-color 0.3s;
}

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

.nav-logo {
    font-family: var(--serif);
    font-size: 1.15rem;
    font-weight: 300;
    letter-spacing: 0.02em;
    color: var(--ink);
    text-decoration: none;
}

.nav-logo img {
    width: 200px;
}

.nav-toggle {
    display: none;
    border: none;
    background: transparent;
    cursor: pointer;
    width: 2.5rem;
    height: 2.2rem;
    padding: 0;
    position: relative;
    z-index: 101;
    align-items: center;
    justify-content: center;
}

.nav-toggle span {
    position: absolute;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--ink);
    border-radius: 2px;
    transition:
        transform 0.25s ease,
        opacity 0.25s ease,
        top 0.25s ease;
}

.nav-toggle span:nth-child(1) {
    top: 0.4rem;
}

.nav-toggle span:nth-child(2) {
    top: 0.95rem;
}

.nav-toggle span:nth-child(3) {
    top: 1.5rem;
}

.nav-toggle span:nth-child(1),
.nav-toggle span:nth-child(3) {
    transform-origin: center;
}

.nav-links {
    display: flex;
    gap: 2.5rem;
    list-style: none;
}

.nav-links a {
    font-size: 0.78rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--muted);
    text-decoration: none;
    transition: color 0.2s;
}

.nav-links a:hover {
    color: var(--ink);
}

/* ── HERO ── */
#hero {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: center;
    padding: 0 4rem;
    gap: 4rem;
    padding-top: 6rem;
}

.hero-text {
    max-width: 540px;
}

.hero-label {
    font-size: 0.72rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 1.8rem;
    opacity: 0;
    animation: fadeUp 0.8s 0.2s forwards;
}

.hero-title {
    font-family: var(--serif);
    font-size: clamp(3rem, 5vw, 5.5rem);
    font-weight: 300;
    line-height: 1.05;
    letter-spacing: -0.01em;
    margin-bottom: 1.8rem;
    opacity: 0;
    animation: fadeUp 0.8s 0.4s forwards;
    width: min(100%, 640px);
}

.hero-title em {
    font-style: italic;
    color: var(--accent);
}

.hero-subtitle {
    font-size: 0.95rem;
    color: var(--muted);
    line-height: 1.75;
    max-width: 640px;
    margin-bottom: 2.8rem;
    opacity: 0;
    animation: fadeUp 0.8s 0.6s forwards;
}

.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 0.8rem;
    background: var(--ink);
    color: var(--bg);
    padding: 0.9rem 2rem;
    font-family: var(--sans);
    font-size: 0.78rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    text-decoration: none;
    transition:
        background 0.25s,
        gap 0.25s;
    opacity: 0;
    animation: fadeUp 0.8s 0.8s forwards;
}

.btn-primary:hover {
    background: var(--accent);
    gap: 1.2rem;
}

.btn-primary svg {
    width: 14px;
    height: 14px;
}

.hero-visual {
    position: relative;
    width: 100%;
    max-width: 100%;
    height: 85vh;
    opacity: 0;
    animation: fadeIn 1.2s 0.5s forwards;
}

.hero-visual-card {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    background: var(--accent-light);
    overflow: hidden;
}

/* Doctor photo — fills the card, anchored to face */
.hero-visual-card > img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 15%;
    display: block;
}

/* Subtle vignette at the bottom so the stat badge stays readable */
.hero-visual-card::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to bottom,
        transparent 55%,
        rgba(26, 23, 20, 0.35) 100%
    );
    pointer-events: none;
}

.hero-visual-inner {
    display: none;
    /* placeholder no longer needed */
}

.hero-stat {
    position: absolute;
    bottom: 2rem;
    right: 2rem;
    text-align: right;
    z-index: 2;
    /* above the vignette overlay */
}

.hero-stat-number {
    font-family: var(--serif);
    font-size: 3rem;
    font-weight: 300;
    color: #fff;
    line-height: 1;
}

.hero-stat-label {
    font-size: 0.7rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.75);
}

/* ── DIVIDER ── */
.divider {
    height: 1px;
    background: var(--line);
    margin: 0 4rem;
}

/* ── CHI SONO ── */
#chi-sono {
    padding: 8rem 4rem;
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 6rem;
    align-items: start;
}

.section-tag {
    font-size: 0.7rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--accent);
    position: sticky;
    top: 7rem;
}

.section-body h2 {
    font-family: var(--serif);
    font-size: clamp(2rem, 3.5vw, 3.2rem);
    font-weight: 300;
    line-height: 1.2;
    margin-bottom: 2rem;
}

.section-body p {
    font-size: 0.95rem;
    color: var(--muted);
    line-height: 1.85;
    max-width: 560px;
    margin-bottom: 1.2rem;
}

.credentials {
    display: flex;
    gap: 2rem;
    margin-top: 3rem;
    flex-wrap: wrap;
}

.credential-item {
    border-top: 1px solid var(--line);
    padding-top: 1rem;
    flex: 1;
    min-width: 150px;
}

.credential-item strong {
    display: block;
    font-family: var(--serif);
    font-size: 1.4rem;
    font-weight: 300;
    color: var(--ink);
    margin-bottom: 0.2rem;
}

.credential-item span {
    font-size: 0.72rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--muted);
}

/* ── SERVIZI ── */
#servizi {
    padding: 8rem 4rem;
    background: var(--accent);
    color: var(--bg);
}

#servizi .section-tag {
    color: var(--accent-light);
    margin-bottom: 4rem;
    display: block;
}

.servizi-header {
    gap: 4rem;
    align-items: end;
    margin-bottom: 5rem;
}

.servizi-header h2 {
    font-family: var(--serif);
    font-size: clamp(2rem, 3.5vw, 3.2rem);
    font-weight: 300;
    line-height: 1.2;
    color: var(--bg);
}

.servizi-header p {
    font-size: 0.9rem;
    color: rgba(245, 242, 238, 0.5);
    line-height: 1.8;
    align-self: end;
}

.servizi-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0;
    border-top: 1px solid rgba(245, 242, 238, 0.12);
}

.servizio-card {
    padding: 2.5rem;
    border-right: 1px solid rgba(245, 242, 238, 0.12);
    transition: background 0.3s;
    cursor: default;
}

.servizio-card:last-child {
    border-right: none;
}

.servizio-card:hover {
    background: rgba(245, 242, 238, 0.04);
}

.servizio-num {
    font-family: var(--serif);
    font-size: 0.9rem;
    color: var(--accent);
    margin-bottom: 1.5rem;
    display: block;
}

.servizio-card h3 {
    font-family: var(--serif);
    font-size: 1.4rem;
    font-weight: 300;
    color: var(--bg);
    margin-bottom: 1rem;
    line-height: 1.3;
}

.servizio-card p {
    font-size: 0.85rem;
    color: rgba(245, 242, 238, 0.75);
    line-height: 1.75;
}

#servizi .servizio-card ul {
    margin: 1rem 0 0;
    padding-left: 1rem;
    list-style: none;
}

#servizi .servizio-card li {
    font-size: 0.85rem;
    color: rgba(245, 242, 238, 0.75);
    line-height: 1.75;
    margin-bottom: 0.4rem;
    position: relative;
    padding-left: 0.2rem;
}

#servizi .servizio-card li::before {
    content: "•";
    color: var(--accent-light);
    margin-right: 0.65rem;
}

/* ── CONTATTI ── */
#contatti {
    padding: 8rem 4rem;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6rem;
    align-items: center;
}

#contatti h2 {
    font-family: var(--serif);
    font-size: clamp(2.5rem, 4vw, 4rem);
    font-weight: 300;
    line-height: 1.1;
    margin-bottom: 1.5rem;
}

#contatti p {
    font-size: 0.9rem;
    color: var(--muted);
    line-height: 1.8;
    margin-bottom: 2.5rem;
}

.contact-links {
    display: flex;
    flex-direction: column;
    gap: 0;
    border-top: 1px solid var(--line);
}

.contact-link {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.2rem 0;
    border-bottom: 1px solid var(--line);
    text-decoration: none;
    color: var(--ink);
    transition: padding-left 0.25s;
}

.contact-link:hover {
    padding-left: 0.5rem;
    color: var(--accent);
}

.contact-link-label {
    font-size: 0.72rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 0.2rem;
    display: block;
}

.contact-link-value {
    font-family: var(--serif);
    font-size: 1.1rem;
    font-weight: 300;
}

.contact-arrow {
    font-size: 1.2rem;
    transition: transform 0.25s;
}

.contact-link:hover .contact-arrow {
    transform: translate(4px, -4px);
}

.contact-form-side {
    background: var(--accent-light);
    padding: 3rem;
}

.form-title {
    font-family: var(--serif);
    font-size: 1.5rem;
    font-weight: 300;
    margin-bottom: 2rem;
}

.contact-form-side iframe {
    width: 100%;
    height: 600px;
    border: none;
    border-radius: 8px;
}

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

.form-group label {
    display: block;
    font-size: 0.7rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 0.5rem;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    background: transparent;
    border: none;
    border-bottom: 1px solid var(--line);
    padding: 0.6rem 0;
    font-family: var(--sans);
    font-size: 0.9rem;
    color: var(--ink);
    outline: none;
    transition: border-color 0.2s;
    appearance: none;
    -webkit-appearance: none;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    border-color: var(--accent);
}

.form-group textarea {
    resize: none;
    height: 80px;
}

.btn-submit {
    width: 100%;
    background: var(--ink);
    color: var(--bg);
    border: none;
    padding: 1rem;
    font-family: var(--sans);
    font-size: 0.78rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    cursor: pointer;
    margin-top: 0.5rem;
    transition: background 0.25s;
}

.btn-submit:hover {
    background: var(--accent);
}

/* ── FOOTER ── */
footer {
    padding: 2.5rem 4rem;
    border-top: 1px solid var(--line);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

footer p {
    font-size: 0.75rem;
    color: var(--muted);
    letter-spacing: 0.04em;
}

footer a {
    font-size: 0.75rem;
    color: var(--muted);
    text-decoration: none;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    transition: color 0.2s;
}

footer a:hover {
    color: var(--ink);
}

/* ── ANIMATIONS ── */
@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.reveal {
    opacity: 0;
    transform: translateY(24px);
    transition:
        opacity 0.7s ease,
        transform 0.7s ease;
}

.reveal.visible {
    opacity: 1;
    transform: none;
}

/* ── MOBILE ── */
@media (max-width: 900px) {
    nav {
        padding: 1.2rem 1.5rem;
    }

    .nav-links {
        gap: 1.5rem;
    }

    #hero {
        grid-template-columns: 1fr;
        padding: 6rem 1.5rem 3rem;
        min-height: auto;
    }

    .hero-visual {
        width: 100%;
        max-width: 100%;
        height: 55vw;
        min-height: 280px;
        max-height: 480px;
    }

    #chi-sono {
        grid-template-columns: 1fr;
        padding: 5rem 1.5rem;
        gap: 2rem;
    }

    .section-tag {
        position: static;
    }

    section[id] {
        scroll-margin-top: 6.5rem;
    }

    #servizi {
        padding: 5rem 1.5rem;
    }

    .servizi-header {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        margin-bottom: 3rem;
    }

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

    .servizio-card {
        border-right: none;
        border-bottom: 1px solid rgba(245, 242, 238, 0.12);
    }

    #contatti {
        grid-template-columns: 1fr;
        padding: 5rem 1.5rem;
        gap: 3rem;
    }

    .contact-form-side {
        padding: 1.5rem;
    }

    .contact-form-side iframe {
        height: 400px;
    }

    .nav-logo img {
        width: 150px;
    }

    .divider {
        margin: 0 1.5rem;
    }

    footer {
        padding: 2rem 1.5rem;
        flex-direction: column;
        gap: 0.8rem;
        text-align: center;
    }
}

@media (max-width: 768px) {
    .nav-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .nav-links {
        position: absolute;
        top: 100%;
        right: 1.5rem;
        left: 1.5rem;
        background: var(--bg);
        flex-direction: column;
        align-items: flex-end;
        gap: 0;
        overflow: hidden;
        max-height: 0;
        padding: 0 1rem;
        border-radius: 0 0 18px 18px;
        box-shadow: 0 18px 60px rgba(0, 0, 0, 0.08);
        transition: max-height 0.28s ease;
        z-index: 99;
    }

    .nav-links.open {
        max-height: 260px;
    }

    .nav-links li {
        width: 100%;
    }

    .nav-links a {
        display: block;
        width: 100%;
        padding: 1rem 0;
        font-size: 0.9rem;
        color: var(--ink);
    }

    .nav-links a:hover {
        color: var(--accent);
    }

    .nav-toggle.open span:nth-child(1) {
        top: 0.95rem;
        transform: rotate(45deg);
    }

    .nav-toggle.open span:nth-child(2) {
        opacity: 0;
    }

    .nav-toggle.open span:nth-child(3) {
        top: 0.95rem;
        transform: rotate(-45deg);
    }
}
