/* D2O: built from the client's Figma wireframe (Desktop V1 / Mobile V0).
   Layout grid: 5 equal columns inside a 160px gutter at 1728px. Label = col 1, body = cols 2-4, aside = col 5. */

@font-face {
    font-family: "Geist";
    src: url("../fonts/geist-latin-wght-normal.woff2") format("woff2");
    font-weight: 100 900;
    font-display: swap;
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
    font-family: "Geist";
    src: url("../fonts/geist-latin-ext-wght-normal.woff2") format("woff2");
    font-weight: 100 900;
    font-display: swap;
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
    /* Figma color styles */
    --ink: #363636;            /* Faded Black */
    --ink-soft: #555555;
    --grey-500: #a8a8a8;       /* Medium Grey: image placeholders */
    --grey-200: #e6e6e6;       /* Light Medium Grey */
    --grey-100: #f4f4f4;       /* Light Grey */
    --white: #ffffff;
    --blue-900: #0b1c46;       /* Deepest Blue */
    --aqua-700: #0e7f99;       /* Aquamarine, darkened for AA text */
    --aqua-200: #bfe0ea;       /* Pale Aquamarine: buttons */
    --aqua-100: #e2eff2;       /* Very Pale Aquamarine: hover */
    --placeholder: #6b6b6b;

    --font: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
    --fs-h1: clamp(2rem, 1.4rem + 1.9vw, 3rem);       /* 32 mobile -> 48 */
    --fs-h2: clamp(1.25rem, 1.1rem + .45vw, 1.5rem);  /* 20 -> 24 */
    --fs-p: .875rem;                                  /* 14 */
    --fs-small: .75rem;                               /* 11-12 */

    --gutter: clamp(1rem, 9.26vw - 1rem, 10rem);      /* 16 mobile -> 160 at 1728 */
    --section-y: clamp(3.5rem, 8.7vw, 9.375rem);      /* 56 -> 150 */
    --radius: 6px;
    --ease: cubic-bezier(.16, 1, .3, 1);
    --header-h: 61px;
    --prebar-h: 38px;
}

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

html {
    -webkit-text-size-adjust: 100%;
    scroll-padding-top: calc(var(--header-h) + 1rem);
}

body {
    margin: 0;
    font-family: var(--font);
    font-size: var(--fs-p);
    line-height: 1.15;
    color: var(--ink);
    background: var(--white);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

body.is-menu-open { overflow: hidden; }

[hidden] { display: none !important; }
img { display: block; max-width: 100%; }
p, h1, h2, h3, dl, dd, ul { margin: 0; }
ul { padding: 0; list-style: none; }
a { color: inherit; text-underline-offset: .2em; text-decoration-thickness: 1px; }
button { font: inherit; color: inherit; }

::selection { background: var(--aqua-200); color: var(--blue-900); }

:focus-visible {
    outline: 2px solid var(--blue-900);
    outline-offset: 3px;
    border-radius: 2px;
}
.section--blue :focus-visible, .hero :focus-visible { outline-color: var(--white); }

.sr-only {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip-link {
    position: absolute; left: 1rem; top: -4rem; z-index: 100;
    padding: .75rem 1rem; background: var(--blue-900); color: var(--white);
    border-radius: var(--radius);
}
.skip-link:focus { top: 1rem; }

/* Type (Figma text styles: H1 48/100, H2 24/100 -1%, P 14/115) */

.h1 {
    font-size: var(--fs-h1);
    font-weight: 700;
    line-height: 1;
    letter-spacing: -.01em;
    text-wrap: balance;
}
.h2 {
    font-size: var(--fs-h2);
    font-weight: 700;
    line-height: 1.05;
    letter-spacing: -.01em;
    text-wrap: pretty;
}
.text-muted { color: var(--ink-soft); }

/* Layout */

.wrap {
    width: 100%;
    max-width: 1728px;
    margin-inline: auto;
    padding-inline: var(--gutter);
}

.section { padding-block: var(--section-y); }
.section--grey { background: var(--grey-100); }
.section--blue { background: var(--blue-900); color: var(--white); }

.row {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    align-items: start;
    row-gap: 1.5rem;
}
.row__label {
    grid-column: 1;
    font-size: var(--fs-p);
    font-weight: 400;
    line-height: 1.15;
    letter-spacing: 0;
}
.row__body { grid-column: 2 / 5; max-width: 52.25rem; }
.row__wide { grid-column: 2 / 6; }
.row__link { grid-column: 5; justify-self: end; }

.row__body > .h2 + .expand { margin-top: 1.5rem; }

@media (max-width: 1023px) {
    .row { grid-template-columns: minmax(0, 1fr); }
    .row__label, .row__body, .row__wide, .row__link { grid-column: 1; }
    .row__link { justify-self: start; }
}

/* Buttons and links */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    min-height: 2.25rem;
    padding: .5rem .75rem;
    border: 0;
    border-radius: 3px;
    background: var(--aqua-200);
    color: var(--ink);
    font-size: var(--fs-p);
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    transition: background-color .25s var(--ease);
}
.btn:hover { background: #a9d4e1; }
.btn:disabled { opacity: .6; cursor: progress; }
.btn--small { min-height: 1.75rem; padding: .375rem .5rem; font-size: var(--fs-small); }

.link-arrow {
    display: inline-flex;
    align-items: center;
    gap: .375rem;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
}
.link-arrow .icon { width: 1rem; height: 1rem; transition: transform .3s var(--ease); }
.link-arrow:hover .icon { transform: translateX(3px); }

.icon { width: 1.25rem; height: 1.25rem; flex: none; }

.icon-btn {
    display: inline-grid;
    place-items: center;
    width: 2.75rem;
    height: 2.75rem;
    margin: -.75rem -.75rem 0 0;
    padding: 0;
    border: 0;
    background: none;
    cursor: pointer;
}
.icon-btn .icon { width: 1.5rem; height: 1.5rem; transition: transform .35s var(--ease); }
.icon-btn[aria-expanded="true"] .icon { transform: rotate(45deg); }

/* Media placeholders: the wireframe's grey blocks until the client uploads photos */

.media--empty { background: var(--grey-500); }

/* Header */

.site-header {
    position: sticky;
    top: calc(-1 * var(--prebar-h));
    z-index: 50;
}

.prebar {
    background: var(--grey-100);
    font-size: var(--fs-small);
}
.prebar__inner {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 1rem;
    min-height: var(--prebar-h);
}
.prebar__hours { text-decoration: none; }
.prebar__hours:hover { text-decoration: underline; }
.prebar__booking { justify-self: end; }
.prebar__booking a { font-weight: 700; text-decoration: none; }

.menu {
    background: var(--white);
    border-bottom: 1px solid transparent;
    transition: border-color .3s;
}
.is-scrolled .menu { border-bottom-color: var(--grey-200); }
.menu__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: var(--header-h);
}

.brand {
    font-size: 1.125rem;
    font-weight: 700;
    letter-spacing: -.01em;
    text-decoration: none;
}

.menu__nav {
    display: flex;
    align-items: center;
    gap: clamp(1rem, 1.6vw, 1.75rem);
}
.menu__nav > a:not(.btn) { text-decoration: none; }
.menu__nav > a:not(.btn):hover,
.menu__nav > a[aria-current="page"] { text-decoration: underline; }

.menu__toggle {
    display: none;
    width: 2.75rem;
    height: 2.75rem;
    margin-right: -.625rem;
    padding: 0;
    border: 0;
    background: none;
    cursor: pointer;
}
.menu__toggle .icon--close { display: none; }

@media (max-width: 1023px) {
    .prebar__inner { grid-template-columns: 1fr; justify-items: center; }
    .prebar__address, .prebar__hours { display: none; }
    .prebar__booking { justify-self: center; }

    .menu__toggle { display: inline-grid; place-items: center; position: relative; z-index: 2; }
    .is-menu-open .menu__toggle .icon--menu { display: none; }
    .is-menu-open .menu__toggle .icon--close { display: block; }

    .menu__nav {
        position: fixed;
        inset: 0;
        z-index: 1;
        flex-direction: column;
        align-items: flex-start;
        justify-content: center;
        gap: .25rem;
        padding: var(--header-h) var(--gutter) 2rem;
        background: var(--aqua-100);
        clip-path: inset(0 0 100% 0);
        visibility: hidden;
        transition: clip-path .55s var(--ease), visibility 0s .55s;
    }
    .is-menu-open .menu__nav {
        clip-path: inset(0 0 0 0);
        visibility: visible;
        transition: clip-path .55s var(--ease), visibility 0s;
    }
    .menu__nav > a:not(.btn) { font-size: 2rem; font-weight: 700; line-height: 1.2; }
    .menu__nav .btn { margin-top: 1.5rem; min-height: 2.75rem; padding-inline: 1rem; font-size: var(--fs-p); background: var(--aqua-200); }
    .is-menu-open .brand { position: relative; z-index: 2; }
}

/* Hero */

.hero {
    position: relative;
    display: grid;
    min-height: clamp(26rem, 48.7vw, 52.5rem);
    color: var(--white);
    overflow: hidden;
}
.hero__media {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}
img.hero__media + .hero__inner::before {
    /* scrim so the white title stays readable on any photo */
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background: linear-gradient(90deg, rgb(11 28 70 / .45), rgb(11 28 70 / 0) 65%);
}
.hero__inner {
    position: relative;
    z-index: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    gap: 2rem;
}
.hero__title { max-width: 14em; }
.hero__cta { display: none; }

@media (max-width: 767px) {
    .hero { min-height: min(34rem, 82svh); }
    .hero--home .hero__inner { justify-content: flex-end; padding-block: 2rem; }
    .hero--home .hero__title { margin-bottom: auto; margin-top: auto; }
    .hero__cta { display: inline-flex; }
    img.hero__media + .hero__inner::before { background: linear-gradient(0deg, rgb(11 28 70 / .5), rgb(11 28 70 / .1)); }
}

/* Horizontal scrollers on phones (cards, team, photo pairs) */

@media (max-width: 767px) {
    .scroller {
        display: flex !important;
        gap: .625rem;
        margin-inline: calc(-1 * var(--gutter));
        padding-inline: var(--gutter);
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        scroll-padding-inline: var(--gutter);
        scrollbar-width: none;
    }
    .scroller::-webkit-scrollbar { display: none; }
    .scroller > * { flex: 0 0 78%; scroll-snap-align: start; }
}

/* Split images */

.split-images {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2px;
    background: var(--white);
}
.split-images__item {
    width: 100%;
    aspect-ratio: 864 / 657;
    object-fit: cover;
}
@media (max-width: 767px) {
    .split-images.scroller { margin: 0; padding: 0; gap: 2px; scroll-padding-inline: 0; }
    .split-images.scroller > * { flex-basis: 100%; }
}

/* Cards (services, method) */

.cards { display: grid; gap: .625rem; }
.cards--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cards--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.card {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 2rem;
    height: 100%;
    min-height: 18.5rem;
    padding: .9375rem;
    border-radius: var(--radius);
    background: var(--white);
    text-decoration: none;
    transition: background-color .3s var(--ease);
}
a.card:hover { background: var(--aqua-100); }
.card__text { max-width: 17.5rem; line-height: 1.2; }

@media (max-width: 1279px) {
    .cards--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 1023px) {
    .cards--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* Team */

.team {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: .625rem;
}
.member {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    aspect-ratio: 270 / 330;
    padding: .9375rem;
    border-radius: var(--radius);
    overflow: hidden;
    color: var(--white);
    text-decoration: none;
    isolation: isolate;
}
.member__photo {
    position: absolute;
    inset: 0;
    z-index: -2;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .8s var(--ease);
}
.member::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background: linear-gradient(180deg, rgb(0 0 0 / .35), rgb(0 0 0 / 0) 35%, rgb(0 0 0 / 0) 70%, rgb(0 0 0 / .4));
    transition: background-color .4s var(--ease);
}
.member:hover::after { background-color: rgb(14 127 153 / .45); }
.member:hover .member__photo { transform: scale(1.03); }
.member__head { display: grid; gap: .25rem; }
.member__prefix { font-size: var(--fs-small); }

@media (max-width: 1279px) {
    .team { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 1023px) {
    .team { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Expandable text (Chi siamo +) */

.expand { display: grid; gap: 1em; max-width: 65ch; font-size: 1rem; line-height: 1.5; }

/* Services: tabs + accordion */

.tabs {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: .625rem;
    margin-bottom: clamp(2rem, 3.5vw, 3.5rem);
}
.tab {
    min-height: 2.25rem;
    padding: .5rem .75rem;
    border: 1px solid transparent;
    border-radius: 3px;
    background: var(--white);
    font-size: var(--fs-small);
    cursor: pointer;
    transition: background-color .25s var(--ease);
}
.tab:hover { background: var(--aqua-100); }
.tab[aria-selected="true"] { background: var(--aqua-100); border-color: var(--aqua-200); }

.accordion { display: grid; gap: .75rem; }
.accordion__item {
    border-radius: 4px;
    background: var(--white);
}
.accordion__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    min-height: 3.25rem;
    padding: .75rem .9375rem;
    list-style: none;
    cursor: pointer;
}
.accordion__head::-webkit-details-marker { display: none; }
.accordion__head .icon { transition: transform .35s var(--ease); }
.accordion__item[open] .accordion__head .icon { transform: rotate(45deg); }
.accordion__head:hover h3 { text-decoration: underline; text-decoration-thickness: 1px; }
.accordion__body {
    display: grid;
    gap: 1em;
    max-width: 65ch;
    padding: 0 .9375rem 1.5rem;
    font-size: 1rem;
    line-height: 1.5;
}
.accordion__img { max-width: 24rem; border-radius: var(--radius); }
.accordion__item:target { outline: 2px solid var(--aqua-200); }

/* Technology blocks: image and text alternate */

.tech__item {
    display: grid;
    grid-template-columns: 1fr 1fr;
    min-height: clamp(20rem, 29vw, 31.5rem);
}
.tech__media { width: 100%; height: 100%; min-height: 20rem; object-fit: cover; }
.tech__text {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 2.5rem;
    padding: 3rem clamp(1rem, 8.7vw, 9.375rem);
    background: var(--grey-100);
}
.tech__text p { max-width: 22rem; line-height: 1.2; }
.tech__text p + p { margin-top: -1.5rem; }
.tech__item:nth-child(even) .tech__media { order: 2; }
.tech__item:nth-child(even) .tech__text { background: var(--white); }

@media (max-width: 767px) {
    .tech__item { grid-template-columns: 1fr; }
    .tech__item:nth-child(even) .tech__media { order: 0; }
    .tech__media { aspect-ratio: 4 / 3; min-height: 0; }
    .tech__text { padding: 2.5rem var(--gutter); gap: 1.5rem; }
    .tech__text p + p { margin-top: -.5rem; }
}

/* Contact form */

.form {
    display: grid;
    gap: .9375rem;
    margin-top: clamp(2.5rem, 4vw, 4.5rem);
}
.form__note { justify-self: end; margin-bottom: -.25rem; font-size: var(--fs-small); color: var(--placeholder); }
.field { position: relative; }
.input {
    display: block;
    width: 100%;
    min-height: 2.25rem;
    padding: .5rem .9375rem;
    border: 1px solid transparent;
    border-radius: var(--radius);
    background: var(--grey-100);
    color: var(--ink);
    font: inherit;
    font-size: max(16px, var(--fs-p)); /* 16px avoids iOS zoom on focus */
    line-height: 1.25;
    appearance: none;
    transition: border-color .2s, background-color .2s;
}
@media (min-width: 768px) { .input { font-size: var(--fs-p); } }
.input::placeholder { color: var(--placeholder); opacity: 1; }
.input:hover { border-color: var(--grey-200); }
.input:focus { outline: none; border-color: var(--blue-900); background: var(--white); }
.input--area { min-height: 7rem; resize: vertical; }
select.input:invalid, select.input:has(option[value=""]:checked) { color: var(--placeholder); }
select.input option { color: var(--ink); }
.field--select .icon {
    position: absolute;
    right: .75rem;
    top: .55rem;
    width: 1.125rem;
    height: 1.125rem;
    pointer-events: none;
    color: var(--placeholder);
}
.input[type="number"]::-webkit-inner-spin-button { appearance: none; }
.input.is-invalid { border-color: #b3261e; background: #fdf3f2; }
.invalid-feedback { margin-top: .375rem; font-size: var(--fs-small); color: #b3261e; }

.field--check {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: .625rem;
    align-items: start;
    margin-top: .25rem;
    line-height: 1.35;
}
.field--check input {
    width: 1.125rem;
    height: 1.125rem;
    margin: 0;
    accent-color: var(--blue-900);
}
.field--check .invalid-feedback { grid-column: 2; margin-top: 0; }
.form__hint { font-size: var(--fs-small); color: var(--placeholder); line-height: 1.35; }
.form__actions { margin-top: .25rem; }
.form__status { padding: .9375rem; border-radius: var(--radius); line-height: 1.35; }
.form__status--ok { background: var(--aqua-100); }
.form__status--error { background: #fdf3f2; color: #8c1d18; }

.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* Contatti */

.info {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1.5rem;
}
.info dt {
    margin-bottom: .375rem;
    font-size: .6875rem;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--ink-soft);
}
.info dd { line-height: 1.3; }
.info a { text-decoration: none; }
.info a:hover { text-decoration: underline; }
@media (max-width: 1023px) { .info { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 479px) { .info { grid-template-columns: 1fr; } }

.map { position: relative; background: var(--grey-200); }
.map__placeholder { min-height: clamp(18rem, 18.7vw, 20.25rem); display: grid; }
.map__inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1.5rem; }
.map__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 1.5rem; }
.map iframe { display: block; width: 100%; height: clamp(22rem, 30vw, 32rem); border: 0; }

/* Professionista */

.profile__grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: var(--gutter);
    row-gap: clamp(2.5rem, 4.5vw, 5rem);
}
.profile__head { grid-column: 1; display: grid; gap: .5rem; }
.profile__prefix { font-size: var(--fs-small); }
.profile__meta { grid-column: 2; display: grid; align-content: start; gap: .125rem; padding-top: .25rem; }
.profile__photo {
    grid-column: 1;
    width: min(100%, 23.625rem);
    aspect-ratio: 378 / 453;
    object-fit: cover;
    border-radius: var(--radius);
}
.profile__bio {
    grid-column: 2;
    display: grid;
    align-content: start;
    gap: 1em;
    max-width: 65ch;
    font-size: 1rem;
    line-height: 1.5;
}
@media (max-width: 1023px) {
    .profile__grid { grid-template-columns: 1fr; row-gap: 1.5rem; }
    .profile__head, .profile__meta, .profile__photo, .profile__bio { grid-column: 1; }
    .profile__photo { width: 100%; max-width: 28rem; }
}

/* Footer */

.site-footer {
    padding-block: 2.25rem 1.5rem;
    background: var(--grey-100);
    font-size: var(--fs-small);
    line-height: 1.35;
}
.site-footer__grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    align-items: start;
    gap: 1.5rem 0;
}
.site-footer__grid a { text-decoration: none; }
.site-footer__grid a:hover { text-decoration: underline; }
.site-footer__legal { color: var(--ink-soft); }
@media (max-width: 1023px) {
    .site-footer__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.25rem 1rem; }
    .site-footer__grid .brand { grid-column: 1 / -1; }
}

.site-footer__credit {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-top: 2.4rem;
    padding-top: 2.4rem;
    border-top: 1px solid var(--grey-200);
    font-size: .8rem;
    color: var(--ink-soft);
    text-decoration: none;
    opacity: .85;
    transition: opacity .2s;
}
.site-footer__credit:hover { opacity: 1; }
.site-footer__credit img { height: 16px; width: auto; }

/* 404 */

.not-found { min-height: 50vh; display: grid; align-content: center; gap: 1.5rem; }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
