/* Pernigotto & Partners – layout from SITO.pdf */

:root {
    --navy-950: #041a3a;
    --navy-900: #0a2a57;
    --sky: #4f7dbd;
    --gold: #c9a55c;
    --white: #ffffff;
    --soft: rgba(255, 255, 255, .86);
    --line: rgba(255, 255, 255, .85);
    --header-h: 84px;
    --serif: 'Libre Baskerville', Georgia, 'Times New Roman', serif;
    --sans: 'Barlow Semi Condensed', 'Arial Narrow', 'Segoe UI', sans-serif;
    --script: 'Great Vibes', 'Brush Script MT', cursive;
    --gutter: clamp(20px, 6vw, 90px);
    --ease: cubic-bezier(.2, .7, .2, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: var(--header-h); }

body {
    margin: 0;
    font-family: var(--sans);
    font-weight: 300;
    font-size: 18px;
    line-height: 1.6;
    color: var(--white);
    background: var(--navy-900);
    -webkit-font-smoothing: antialiased;
}
body.locked { overflow: hidden; }

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
strong { font-weight: 600; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }

.visually-hidden {
    position: absolute; width: 1px; height: 1px; overflow: hidden;
    clip: rect(0 0 0 0); white-space: nowrap;
}

.kicker {
    margin: 0;
    font-size: clamp(13px, 1.3vw, 18px);
    font-weight: 400;
    letter-spacing: .32em;
    text-transform: uppercase;
}

/* ---------- header ---------- */

.site-header {
    position: fixed;
    inset: 0 0 auto;
    z-index: 50;
    height: var(--header-h);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-inline: var(--gutter);
    background: linear-gradient(90deg, var(--navy-950), var(--navy-900));
    box-shadow: 0 2px 18px rgba(0, 0, 0, .25);
}

.brand img { width: 150px; height: auto; }

.site-nav { display: flex; align-items: center; gap: clamp(28px, 6vw, 90px); }

.site-nav > a, .has-menu > a {
    font-size: 21px;
    font-weight: 400;
    transition: opacity .25s;
}
.site-nav a.active { font-weight: 600; }
.site-nav > a:hover, .has-menu > a:hover { opacity: .75; }

.has-menu { position: relative; }
.submenu {
    position: absolute;
    top: calc(100% + 18px);
    left: -18px;
    width: 300px;
    margin: 0;
    padding: 14px 18px;
    list-style: none;
    background: rgba(10, 42, 87, .96);
    box-shadow: 0 16px 40px rgba(0, 0, 0, .35);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px);
    transition: opacity .25s, transform .25s, visibility .25s;
}
/* hover bridge between link and menu */
.submenu::before { content: ''; position: absolute; left: 0; right: 0; top: -18px; height: 18px; }
.has-menu:hover .submenu, .has-menu:focus-within .submenu { opacity: 1; visibility: visible; transform: none; }
.submenu li { position: relative; margin: 6px 0; padding-left: 16px; font-size: 15px; line-height: 1.25; }
.submenu li::before { content: '•'; position: absolute; left: 0; top: 0; }
.submenu button { all: unset; cursor: pointer; color: var(--soft); }
.submenu button:hover, .submenu button:focus-visible { color: var(--white); font-weight: 600; }

.nav-toggle {
    display: none;
    width: 44px; height: 44px;
    padding: 10px;
    border: 0; background: none; cursor: pointer;
}
.nav-toggle span { display: block; height: 2px; margin: 5px 0; background: var(--white); transition: transform .3s, opacity .3s; }

/* ---------- home ---------- */

.hero {
    position: relative;
    min-height: 100vh;
    min-height: 100svh;
    padding: calc(var(--header-h) + clamp(40px, 8vh, 90px)) var(--gutter) clamp(50px, 9vh, 110px);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    background: url('2.jpg') center / cover no-repeat;
    overflow: hidden;
}

.hero-frame {
    position: relative;
    padding-left: clamp(30px, 5vw, 70px);
}
/* top-left corner bracket */
.hero-frame::before {
    content: '';
    position: absolute;
    left: 0; top: .7em;
    width: clamp(90px, 11vw, 160px);
    height: calc(100% - 3.2em);
    border-top: 2px solid var(--white);
    border-left: 2px solid var(--white);
}
.hero-kicker { padding-left: clamp(90px, 12vw, 180px); font-size: clamp(14px, 1.8vw, 26px); }

.hero-title {
    margin: clamp(30px, 5vw, 70px) 0 clamp(24px, 3.5vw, 44px);
    font-family: var(--serif);
    font-weight: 400;
    font-size: clamp(38px, 6.6vw, 100px);
    line-height: .9;
    text-transform: uppercase;
    color: var(--navy-950);
}
.hero-motto {
    margin: 0;
    font-size: clamp(18px, 2.3vw, 33px);
    font-weight: 600;
    line-height: 1.25;
    text-shadow: 0 1px 12px rgba(10, 40, 80, .35);
}

.hero-script {
    position: relative;
    align-self: flex-end;
    margin: 40px 0 0;
    padding-right: clamp(110px, 12vw, 180px);
    font-family: var(--script);
    font-size: clamp(34px, 4.6vw, 64px);
    line-height: 1;
}
/* bottom-right corner bracket */
.hero-script::after {
    content: '';
    position: absolute;
    right: 0; bottom: .15em;
    width: clamp(80px, 9vw, 135px);
    height: clamp(120px, 20vh, 280px);
    border-right: 2px solid var(--white);
    border-bottom: 2px solid var(--white);
}

/* ---------- chi siamo ---------- */

.about {
    display: grid;
    grid-template-columns: 44% 56%;
    min-height: 100vh;
    background: var(--navy-900);
}
.about-text {
    grid-column: 1;
    grid-row: 1;
    position: relative;
    z-index: 1;
    align-self: center;
    width: calc(100% + 15vw);
    padding: clamp(60px, 10vh, 120px) 0 clamp(60px, 10vh, 120px) var(--gutter);
}
.about-text p:not(.kicker) {
    margin: 0 0 1.6em;
    max-width: 58ch;
    font-size: clamp(16px, 1.45vw, 21px);
    text-align: justify;
    hyphens: auto;
}
.about-photo {
    grid-column: 2;
    grid-row: 1;
    background:
        linear-gradient(rgba(12, 45, 92, .6), rgba(12, 45, 92, .6)),
        url('assets/chi-siamo.jpg') 70% center / cover no-repeat;
    filter: saturate(.35);
}

.kicker-line, .kicker-line-after { display: flex; align-items: center; gap: 26px; }
.kicker-line::before, .kicker-line-after::after {
    content: '';
    flex: none;
    width: clamp(50px, 6vw, 110px);
    height: 2px;
    background: var(--line);
}
.about-text .kicker-line-after { justify-content: flex-end; max-width: 58ch; margin-top: 2.4em; }

.gold-title {
    margin: 24px 0 26px;
    font-family: var(--serif);
    font-weight: 400;
    font-size: clamp(34px, 3.8vw, 56px);
    line-height: 1.1;
    text-transform: uppercase;
    color: var(--gold);
}

/* ---------- servizi ---------- */

.services {
    padding-top: clamp(70px, 10vw, 130px);
    background:
        linear-gradient(var(--sky), var(--sky)) top / 100% 58% no-repeat,
        linear-gradient(rgba(12, 45, 92, .15), rgba(4, 26, 58, .35) 80%, var(--navy-950)),
        url('8.jpg') center bottom / cover no-repeat;
}

.tiles {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: clamp(12px, 1.2vw, 18px);
    width: min(1200px, 100% - 2 * var(--gutter));
    margin-inline: auto;
}

.tile-body { display: none; }
/* centre a lone tile on the last row */
.tile:last-child:nth-child(3n+1) { grid-column: 2; }

.tile-btn {
    all: unset;
    box-sizing: border-box;
    display: grid;
    place-items: center;
    width: 100%;
    height: 100%;
    min-height: clamp(130px, 11vw, 160px);
    padding: 18px 22px;
    text-align: center;
    cursor: pointer;
    box-shadow: 0 14px 34px rgba(4, 26, 58, .35);
    transition: transform .35s var(--ease), box-shadow .35s var(--ease), filter .35s;
}
.tile:nth-child(odd) .tile-btn { background: linear-gradient(160deg, #c3cdda, #aab7c9); color: var(--navy-950); }
.tile:nth-child(even) .tile-btn { background: var(--navy-900); color: var(--gold); }
.tile-btn:hover, .tile-btn:focus-visible { transform: translateY(-6px); box-shadow: 0 22px 40px rgba(4, 26, 58, .5); filter: brightness(1.06); }

.tile-title {
    font-family: var(--serif);
    font-size: clamp(17px, 1.75vw, 25px);
    line-height: 1.15;
    max-width: 15ch;
}

.phonebook {
    padding: clamp(160px, 22vw, 300px) var(--gutter) clamp(60px, 8vw, 110px);
    text-align: center;
    font-family: var(--serif);
    text-transform: uppercase;
}
.phonebook ul { list-style: none; margin: 0 0 clamp(30px, 4vw, 50px); padding: 0; }
.phonebook li { margin: .35em 0; font-size: clamp(14px, 1.7vw, 23px); letter-spacing: .12em; }
.phonebook a { color: var(--gold); }
.phonebook a:hover { text-decoration: underline; }
.phonebook-address {
    margin: 0;
    font-family: var(--sans);
    font-size: clamp(16px, 2vw, 27px);
    letter-spacing: .32em;
}

/* ---------- service page ---------- */

.svc-view {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: flex;
    align-items: flex-end;
    overflow-y: auto;
    background: var(--navy-900);
    animation: fade .4s ease both;
}
.sv-bg {
    position: fixed;
    inset: 0;
    background: var(--bg) center / cover no-repeat;
}
.sv-bg::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgba(10, 42, 87, .8) 0%, rgba(10, 42, 87, .45) 60%, rgba(10, 42, 87, .2) 100%);
}
.sv-content {
    position: relative;
    width: min(1100px, 100%);
    padding: 120px var(--gutter) clamp(60px, 12vh, 140px);
    animation: rise .55s .05s var(--ease) both;
}
.sv-head { display: flex; align-items: center; gap: 18px; margin-bottom: 32px; }
.sv-icon {
    flex: none;
    display: grid;
    place-items: center;
    width: clamp(64px, 6vw, 88px);
    height: clamp(64px, 6vw, 88px);
    border: 3px solid #e8e8e8;
    border-radius: 50%;
}
.sv-icon svg { width: 56%; height: 56%; fill: none; stroke: var(--white); stroke-width: 1.3; stroke-linecap: round; stroke-linejoin: round; }
.sv-rule { flex: none; width: clamp(40px, 5vw, 70px); height: 2px; background: var(--line); }
.sv-title {
    margin: 0;
    font-family: var(--serif);
    font-weight: 400;
    font-size: clamp(22px, 2.9vw, 42px);
    line-height: 1.1;
    text-transform: uppercase;
    color: var(--gold);
}
.sv-body { max-width: 62ch; font-size: clamp(16px, 1.5vw, 21px); text-align: justify; hyphens: auto; }
.sv-body p { margin: 0 0 1em; }
.sv-body ul { margin: 0; padding-left: 1.2em; text-align: left; }
.sv-body li { margin-bottom: .4em; }

.sv-arrows {
    position: fixed;
    top: 110px;
    right: clamp(20px, 12vw, 220px);
    z-index: 2;
    display: flex;
    gap: 14px;
}
.sv-arrow, .sv-close {
    width: 48px; height: 48px;
    padding: 0 0 6px;
    border: 0;
    background: none;
    color: var(--white);
    font: 300 52px/1 var(--sans);
    cursor: pointer;
    transition: transform .25s;
}
.sv-arrow:hover { transform: scale(1.15); }
.sv-close {
    position: fixed;
    top: 18px; right: 22px;
    z-index: 3;
    font-size: 36px;
    border: 2px solid rgba(255, 255, 255, .7);
    border-radius: 50%;
    background: rgba(10, 42, 87, .5);
}
.sv-close:hover { transform: rotate(90deg); }

@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes rise { from { opacity: 0; transform: translateY(26px); } to { opacity: 1; transform: none; } }

/* ---------- contatti / team ---------- */

.team { background: var(--navy-900); }

.member {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: clamp(36px, 7vw, 120px);
    padding: clamp(70px, 10vw, 130px) var(--gutter);
    border-top: 1px solid rgba(255, 255, 255, .08);
}
.member-flip .member-side { order: 2; }

.portrait {
    width: clamp(150px, 15vw, 210px);
    height: auto;
    aspect-ratio: 525 / 730;
    object-fit: cover;
    object-position: top;
    border-radius: 26px;
    margin: 0 0 30px clamp(0px, 2.5vw, 40px);
}

.areas-title, .contacts-title {
    margin: 0 0 18px;
    font-family: var(--serif);
    font-weight: 400;
    font-size: clamp(17px, 1.6vw, 22px);
    text-transform: uppercase;
}
.contacts-title { margin-top: 2.2em; font-size: clamp(20px, 2vw, 27px); }

.area { margin-bottom: 14px; }
.area summary {
    position: relative;
    padding-left: 36px;
    list-style: none;
    font-size: clamp(16px, 1.35vw, 19px);
    font-weight: 400;
    cursor: pointer;
}
.area summary::-webkit-details-marker { display: none; }
.area summary::before {
    content: '';
    position: absolute;
    left: 0; top: .3em;
    border-left: 17px solid #d6e2ff;
    border-top: 10px solid transparent;
    border-bottom: 10px solid transparent;
    transition: transform .3s var(--ease);
}
.area[open] summary::before { transform: rotate(90deg); }
.area summary:hover { color: #d6e2ff; }
.area ul { margin: 10px 0 18px; padding-left: 58px; font-size: 15px; color: var(--soft); }
.area li { margin-bottom: 6px; }
.area li strong { color: var(--white); }

.member-pre { margin: 0; font-size: clamp(18px, 1.6vw, 23px); text-transform: uppercase; }
.member-name {
    margin: 0 0 12px;
    font-family: var(--serif);
    font-weight: 400;
    font-size: clamp(34px, 3.8vw, 56px);
    line-height: 1.1;
    color: var(--gold);
}
.member-role { margin: 0 0 1.6em; font-size: clamp(17px, 1.6vw, 23px); font-weight: 500; font-style: italic; }
.member-bio { margin: 0 0 1em; font-size: clamp(16px, 1.45vw, 20px); text-align: justify; hyphens: auto; }

.more-link {
    all: unset;
    cursor: pointer;
    margin-top: 10px;
    font-size: 19px;
    font-weight: 600;
    text-transform: uppercase;
}
.more-link span { display: inline-block; margin-left: 6px; font-size: 26px; line-height: 0; transition: transform .25s; }
.more-link:hover span { transform: translateX(4px); }

.contacts { list-style: none; margin: 0; padding: 0; font-size: clamp(15px, 1.35vw, 19px); }
.contacts li { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 12px; overflow-wrap: anywhere; }
.contacts svg { flex: none; width: 22px; height: 22px; margin-top: 2px; fill: var(--white); }
.contacts a:hover, .contacts .u { text-decoration: underline; }

/* ---------- bio page ---------- */

.bio-view {
    position: fixed;
    inset: 0;
    z-index: 100;
    overflow-y: auto;
    background: var(--navy-900);
    animation: fade .4s ease both;
}
.bio-inner {
    padding: clamp(80px, 10vh, 120px) var(--gutter) 70px;
    animation: rise .55s .05s var(--ease) both;
}
.bio-head { display: grid; grid-template-columns: 1fr 1fr; gap: 50px; align-items: end; margin-bottom: 50px; }
.bio-lead { margin: 0; font-size: clamp(16px, 1.4vw, 19px); font-weight: 600; text-align: justify; }
.bio-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 50px; }
.bio-cols h3 { margin: 0 0 12px; font-size: 22px; font-weight: 600; }
.bio-cols p { margin: 0 0 1em; font-size: 16px; text-align: justify; }

/* ---------- footer ---------- */

.site-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
    padding: 26px var(--gutter);
    background: var(--navy-950);
    font-size: 15px;
    color: rgba(255, 255, 255, .65);
}
.site-footer img { width: 110px; height: auto; }
.site-footer p { margin: 0; }

/* ---------- reveal ---------- */

.reveal { opacity: 0; translate: 0 28px; transition: opacity .9s var(--ease), translate .9s var(--ease); transition-delay: var(--d, 0s); }
.reveal.is-visible { opacity: 1; translate: 0 0; }

/* ---------- responsive ---------- */

@media (max-width: 1000px) {
    :root { --header-h: 72px; }
    .brand img { width: 120px; }
    .nav-toggle { display: block; position: relative; z-index: 2; }
    .site-nav {
        position: fixed;
        inset: 0;
        flex-direction: column;
        justify-content: center;
        gap: 26px;
        background: rgba(4, 26, 58, .98);
        opacity: 0;
        visibility: hidden;
        transition: opacity .3s, visibility .3s;
    }
    .site-nav > a, .has-menu > a { font-size: 28px; }
    .submenu { display: none; }
    .nav-open .site-nav { opacity: 1; visibility: visible; }
    .nav-open .nav-toggle span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
    .nav-open .nav-toggle span:nth-child(2) { opacity: 0; }
    .nav-open .nav-toggle span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

    .about { grid-template-columns: 1fr; min-height: 0; }
    .about-text { width: auto; padding-right: var(--gutter); }
    .about-photo { grid-column: 1; grid-row: 2; min-height: 45vh; }
    .member, .bio-head, .bio-cols { grid-template-columns: 1fr; }
    .member-side, .member-flip .member-side { order: 2; }
    .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .tile:last-child:nth-child(3n+1) { grid-column: auto; }
    .tile:last-child:nth-child(odd) { grid-column: 1 / -1; }
    .sv-arrows { top: auto; bottom: 24px; right: 24px; }
}

@media (max-width: 560px) {
    .tiles { grid-template-columns: 1fr; }
    .hero-title { white-space: normal; }
    .tile-btn { min-height: 96px; }
    .hero-frame::before { display: none; }
    .hero-frame { padding-left: 0; }
    .hero-kicker { padding-left: 0; }
    .kicker, .phonebook-address { letter-spacing: .18em; }
    .phonebook li { letter-spacing: .04em; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; }
    html { scroll-behavior: auto; }
    .reveal { opacity: 1; translate: 0 0; }
}
