/* Federico Quinto Architettura e Restauro — foglio di stile */

@font-face { font-family: "EB Garamond"; src: url("fonts/eb-garamond-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "EB Garamond"; src: url("fonts/eb-garamond-latin-400-italic.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "EB Garamond"; src: url("fonts/eb-garamond-latin-500-normal.woff2") format("woff2"); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: "EB Garamond"; src: url("fonts/eb-garamond-latin-500-italic.woff2") format("woff2"); font-weight: 500; font-style: italic; font-display: swap; }
@font-face { font-family: "Inter"; src: url("fonts/inter-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Inter"; src: url("fonts/inter-latin-500-normal.woff2") format("woff2"); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: "Inter"; src: url("fonts/inter-latin-600-normal.woff2") format("woff2"); font-weight: 600; font-style: normal; font-display: swap; }

:root {
  --bg: #fbfaf7;
  --ink: #171614;
  --ink-2: #3a3834;
  --muted: #74706a;
  --line: #e3dfd7;
  --soft: #f1eee8;
  --serif: "EB Garamond", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --wrap: 1320px;
  --gut: clamp(16px, 4vw, 48px);
  --header-h: 76px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--sans); font-size: 16px; line-height: 1.6;
  text-rendering: optimizeLegibility; -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 0.2em; }
a:hover { text-decoration-color: var(--muted); }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
::selection { background: var(--ink); color: var(--bg); }

.skip { position: absolute; left: -9999px; top: 0; background: var(--ink); color: var(--bg); padding: 10px 14px; z-index: 100; }
.skip:focus { left: 12px; top: 12px; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gut); }

/* ---------- Tipografia ---------- */
h1, h2, h3, h4 { font-family: var(--serif); font-weight: 400; line-height: 1.08; margin: 0; letter-spacing: -0.01em; text-wrap: balance; }
h1 { font-size: clamp(2.5rem, 6.2vw, 5.4rem); }
h2 { font-size: clamp(1.9rem, 3.6vw, 3rem); }
h3 { font-size: clamp(1.35rem, 2vw, 1.7rem); line-height: 1.2; }
p { margin: 0 0 1em; }
.lead { font-family: var(--serif); font-size: clamp(1.3rem, 2.1vw, 1.75rem); line-height: 1.4; color: var(--ink-2); text-wrap: pretty; }
.eyebrow { font-family: var(--sans); font-size: 0.72rem; font-weight: 500; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); margin: 0 0 1.1rem; }
.prose { max-width: 68ch; }
.prose p { color: var(--ink-2); }
.prose h3 { margin: 2.2rem 0 0.8rem; }
.muted { color: var(--muted); }

/* ---------- Header ---------- */
.site-header { position: sticky; top: 0; z-index: 50; background: var(--bg); background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: saturate(1.2) blur(10px); -webkit-backdrop-filter: saturate(1.2) blur(10px); border-bottom: 1px solid transparent; transition: border-color .2s; }
.site-header.scrolled { border-bottom-color: var(--line); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; height: var(--header-h); gap: 24px; }
.brand { display: flex; align-items: center; gap: 14px; text-decoration: none; color: var(--ink); }
.brand .logo-mark { width: 58px; height: auto; flex: none; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-name { font-family: var(--serif); font-size: 1.3rem; }
.brand-sub { font-size: 0.64rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); }

.nav { display: flex; align-items: center; gap: clamp(16px, 2.2vw, 34px); }
.nav a { font-size: 0.86rem; text-decoration: none; color: var(--ink-2); padding: 6px 0; border-bottom: 1px solid transparent; }
.nav a:hover { color: var(--ink); border-bottom-color: var(--ink); }
.nav a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--ink); }
.nav .lang { font-size: 0.74rem; letter-spacing: 0.1em; color: var(--muted); border: 1px solid var(--line); padding: 4px 9px; border-radius: 2px; }
.nav .lang:hover { border-color: var(--ink); color: var(--ink); }
.menu-btn { display: none; background: none; border: 0; padding: 10px; margin-right: -10px; cursor: pointer; color: var(--ink); }
.menu-btn span { display: block; width: 24px; height: 1.5px; background: currentColor; margin: 6px 0; transition: transform .25s, opacity .2s; }

@media (max-width: 900px) {
  :root { --header-h: 64px; }
  .brand .logo-mark { width: 48px; }
  .brand-name { font-size: 1.12rem; }
  .menu-btn { display: block; }
  .nav { position: fixed; inset: var(--header-h) 0 0 0; background: var(--bg); flex-direction: column; align-items: flex-start; gap: 0; padding: 18px var(--gut) 40px; transform: translateY(-8px); opacity: 0; visibility: hidden; transition: opacity .2s, transform .2s, visibility .2s; overflow-y: auto; }
  .nav a { font-family: var(--serif); font-size: 1.9rem; color: var(--ink); padding: 10px 0; border: 0; width: 100%; border-bottom: 1px solid var(--line); }
  .nav a[aria-current="page"] { border-bottom-color: var(--line); font-style: italic; }
  .nav .lang { font-family: var(--sans); font-size: 0.8rem; margin-top: 24px; width: auto; border: 1px solid var(--line); padding: 6px 12px; }
  body.menu-open { overflow: hidden; }
  body.menu-open .site-header { -webkit-backdrop-filter: none; backdrop-filter: none; background: var(--bg); }
  body.menu-open .nav { opacity: 1; transform: none; visibility: visible; }
  body.menu-open .menu-btn span:nth-child(1) { transform: translateY(3.75px) rotate(45deg); }
  body.menu-open .menu-btn span:nth-child(2) { transform: translateY(-3.75px) rotate(-45deg); }
}

/* ---------- Sezioni ---------- */
.section { padding: clamp(64px, 10vw, 140px) 0; }
.section.tight { padding: clamp(40px, 6vw, 80px) 0; }
.section + .section { padding-top: 0; }
.rule { border: 0; border-top: 1px solid var(--line); margin: 0; }
.section-head { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 24px; margin-bottom: clamp(32px, 5vw, 64px); }
.section-head .more { font-size: 0.86rem; white-space: nowrap; }

/* Home hero */
.hero { padding: clamp(40px, 7vw, 110px) 0 clamp(32px, 5vw, 64px); }
.hero h1 { max-width: 14ch; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: clamp(28px, 5vw, 80px); align-items: end; }
.hero-grid .lead { margin: 0; }
.hero-figure { margin: 0; }
.hero-figure img { width: 100%; height: clamp(320px, 72vh, 820px); object-fit: cover; }
.caption, figcaption { font-size: 0.78rem; color: var(--muted); margin-top: 10px; line-height: 1.45; }
@media (max-width: 800px) { .hero-grid { grid-template-columns: 1fr; } .hero-figure img { height: 58vh; } }

/* Due colonne testo */
.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: clamp(24px, 6vw, 96px); }
@media (max-width: 800px) { .split { grid-template-columns: 1fr; } }

/* Competenze */
.services { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-top: 1px solid var(--line); }
.service { padding: 28px 28px 32px 0; border-right: 1px solid var(--line); }
.service + .service { padding-left: 28px; }
.service:last-child { border-right: 0; }
.service .num { font-size: 0.72rem; letter-spacing: 0.1em; color: var(--muted); display: block; margin-bottom: 36px; }
.service h3 { margin-bottom: 12px; }
.service p { font-size: 0.93rem; color: var(--ink-2); margin: 0; }
@media (max-width: 1000px) { .services { grid-template-columns: repeat(2, minmax(0, 1fr)); } .service:nth-child(2) { border-right: 0; } .service:nth-child(3) { padding-left: 0; } .service:nth-child(n+3) { border-top: 1px solid var(--line); } }
@media (max-width: 600px) { .services { grid-template-columns: 1fr; } .service, .service + .service { padding: 24px 0; border-right: 0; } .service + .service { border-top: 1px solid var(--line); } .service .num { margin-bottom: 14px; } }

/* Card progetti */
.grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(28px, 3vw, 44px) clamp(16px, 2.4vw, 32px); }
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 1000px) { .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .grid, .grid.two { grid-template-columns: 1fr; } }
.card { text-decoration: none; color: inherit; display: block; }
.card .ph { overflow: hidden; background: var(--soft); aspect-ratio: 4 / 3; }
.card .ph img { width: 100%; height: 100%; object-fit: cover; transition: transform .7s cubic-bezier(.2,.7,.2,1), filter .4s; }
.card:hover .ph img { transform: scale(1.03); }
.card .meta { font-size: 0.72rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); margin: 16px 0 6px; display: flex; gap: 10px; flex-wrap: wrap; }
.card h3 { font-size: clamp(1.3rem, 1.8vw, 1.6rem); }
.card .place { font-size: 0.9rem; color: var(--ink-2); margin-top: 4px; }
.card.feature { grid-column: span 2; }
.card.feature .ph { aspect-ratio: 16 / 10; }
@media (max-width: 600px) { .card.feature { grid-column: auto; } .card.feature .ph { aspect-ratio: 4 / 3; } }
.card[hidden] { display: none; }

/* Filtri */
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 40px; }
.filters button { font: inherit; font-size: 0.82rem; background: transparent; color: var(--ink-2); border: 1px solid var(--line); padding: 7px 14px; border-radius: 999px; cursor: pointer; }
.filters button:hover { border-color: var(--ink); color: var(--ink); }
.filters button[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }

/* Committenti */
.clients { list-style: none; margin: 0; padding: 0; columns: 2; column-gap: clamp(24px, 6vw, 96px); }
.clients li { break-inside: avoid; padding: 14px 0; border-top: 1px solid var(--line); font-family: var(--serif); font-size: 1.2rem; line-height: 1.3; }
@media (max-width: 700px) { .clients { columns: 1; } }

/* CTA */
.cta { background: var(--ink); color: var(--bg); }
.cta .wrap { padding-top: clamp(64px, 9vw, 120px); padding-bottom: clamp(64px, 9vw, 120px); display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 40px; align-items: end; }
.cta h2 { max-width: 16ch; }
.cta .eyebrow { color: #a9a49b; }
.cta a { color: var(--bg); }
.cta-links { display: grid; gap: 10px; font-size: 1.05rem; }
.cta-links a { text-decoration: none; border-bottom: 1px solid #55524c; padding-bottom: 10px; display: flex; justify-content: space-between; gap: 16px; }
.cta-links a:hover { border-bottom-color: var(--bg); }
@media (max-width: 800px) { .cta .wrap { grid-template-columns: 1fr; } }

/* Intestazione pagina */
.page-head { padding: clamp(48px, 8vw, 120px) 0 clamp(32px, 5vw, 64px); }
.page-head h1 { max-width: 18ch; }
.page-head .lead { max-width: 46ch; margin-top: 28px; }

/* Scheda progetto */
.project-hero img { width: 100%; max-height: 86vh; object-fit: cover; }
.project-body { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: clamp(28px, 6vw, 96px); padding: clamp(48px, 7vw, 96px) 0; }
@media (max-width: 860px) { .project-body { grid-template-columns: 1fr; } }
.facts { margin: 0; align-self: start; position: sticky; top: calc(var(--header-h) + 24px); }
.facts div { padding: 14px 0; border-top: 1px solid var(--line); }
.facts div:last-child { border-bottom: 1px solid var(--line); }
.facts dt { font-size: 0.7rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); margin-bottom: 4px; }
.facts dd { margin: 0; font-size: 0.95rem; }
@media (max-width: 860px) { .facts { position: static; } }
.status { display: inline-block; font-size: 0.68rem; letter-spacing: 0.1em; text-transform: uppercase; border: 1px solid currentColor; padding: 2px 8px; border-radius: 999px; }

.gallery { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: clamp(20px, 2.4vw, 32px) clamp(12px, 2vw, 28px); padding-bottom: clamp(48px, 8vw, 110px); align-items: start; }
.gallery figure { margin: 0; grid-column: span 6; }
.gallery figure.w { grid-column: span 12; }
.gallery figure.n { grid-column: span 4; }
.gallery figure.m { grid-column: span 8; }
.gallery button { display: block; width: 100%; padding: 0; border: 0; background: var(--soft); cursor: zoom-in; overflow: hidden; aspect-ratio: 3 / 2; }
.gallery figure.n button { aspect-ratio: 4 / 5; }
.gallery figure.m button { aspect-ratio: 16 / 10; }
.gallery figure.sq button { aspect-ratio: 1 / 1; }
.gallery figure.w button { aspect-ratio: auto; }
.gallery img { width: 100%; height: 100%; object-fit: cover; transition: transform .7s cubic-bezier(.2,.7,.2,1); }
.gallery figure.w img { height: auto; }
.gallery button:hover img { transform: scale(1.02); }
.gallery figure.drawing button { background: #fff; }
.gallery figure.drawing img { object-fit: contain; }
@media (max-width: 700px) {
  .gallery figure, .gallery figure.n, .gallery figure.m { grid-column: span 12; }
  .gallery figure button, .gallery figure.n button, .gallery figure.m button { aspect-ratio: 4 / 3; }
  .gallery figure.w button { aspect-ratio: auto; }
}

.pager { display: grid; grid-template-columns: 1fr 1fr; border-top: 1px solid var(--line); }
.pager a { padding: 32px 0; text-decoration: none; display: block; }
.pager a + a { text-align: right; border-left: 1px solid var(--line); padding-left: 24px; }
.pager small { display: block; font-size: 0.7rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
.pager span { font-family: var(--serif); font-size: clamp(1.2rem, 2vw, 1.6rem); }

/* Lightbox */
.lightbox { position: fixed; inset: 0; z-index: 200; background: rgba(15, 14, 13, 0.96); display: none; align-items: center; justify-content: center; padding: 56px 16px 64px; }
.lightbox.open { display: flex; }
.lightbox img { max-width: 100%; max-height: 100%; object-fit: contain; }
.lightbox p { position: absolute; left: 0; right: 0; bottom: 18px; text-align: center; color: #bdb8ae; font-size: 0.82rem; margin: 0; padding: 0 60px; }
.lightbox button { position: absolute; background: none; border: 0; color: #eee; font: 300 2rem/1 var(--sans); padding: 12px 16px; cursor: pointer; }
.lb-close { top: 8px; right: 8px; }
.lb-prev { left: 4px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 4px; top: 50%; transform: translateY(-50%); }

/* Tabelle elenco */
.list { width: 100%; border-collapse: collapse; font-size: 0.93rem; }
.list th { text-align: left; font-weight: 500; font-size: 0.7rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); padding: 0 16px 12px 0; border-bottom: 1px solid var(--ink); }
.list td { padding: 16px 16px 16px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.list td:first-child { white-space: nowrap; color: var(--muted); font-variant-numeric: tabular-nums; width: 1%; }
.list td strong { font-weight: 500; }
.list .sub { display: block; color: var(--muted); font-size: 0.86rem; margin-top: 2px; }
@media (max-width: 700px) {
  .list thead { display: none; }
  .list, .list tbody, .list tr, .list td { display: block; width: 100%; }
  .list tr { padding: 16px 0; border-bottom: 1px solid var(--line); }
  .list td { border: 0; padding: 2px 0; }
  .list td:first-child { width: auto; }
}

/* Studio */
.cols-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(24px, 4vw, 56px); }
@media (max-width: 800px) { .cols-3 { grid-template-columns: 1fr; } }
.cols-3 h3 { margin-bottom: 10px; }
.cols-3 p { color: var(--ink-2); font-size: 0.95rem; }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 16px; padding: 16px 0; border-top: 1px solid var(--line); }
.timeline .y { color: var(--muted); font-size: 0.9rem; font-variant-numeric: tabular-nums; }
.timeline strong { font-weight: 500; display: block; }
.timeline span.d { color: var(--ink-2); font-size: 0.93rem; }
@media (max-width: 560px) { .timeline li { grid-template-columns: 1fr; gap: 2px; } }
.tags { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; padding: 0; margin: 0; }
.tags li { font-size: 0.84rem; border: 1px solid var(--line); padding: 6px 12px; border-radius: 999px; color: var(--ink-2); }

/* Competenze pagina */
.svc-list { border-top: 1px solid var(--ink); }
.svc { display: grid; grid-template-columns: 80px minmax(0, 1fr) minmax(0, 1.4fr); gap: clamp(16px, 4vw, 56px); padding: clamp(28px, 4vw, 48px) 0; border-bottom: 1px solid var(--line); }
.svc .num { color: var(--muted); font-size: 0.8rem; padding-top: 8px; }
.svc ul { margin: 14px 0 0; padding-left: 1.1em; color: var(--ink-2); font-size: 0.93rem; }
.svc ul li { margin: 4px 0; }
.svc p { color: var(--ink-2); margin: 0; }
@media (max-width: 800px) { .svc { grid-template-columns: 1fr; gap: 8px; } .svc .num { padding: 0; } }

/* Contatti */
.contact-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(24px, 4vw, 56px); padding-bottom: clamp(48px, 8vw, 110px); }
@media (max-width: 900px) { .contact-grid { grid-template-columns: 1fr; } }
.contact-block { border-top: 1px solid var(--ink); padding-top: 20px; }
.contact-block h2 { font-size: clamp(1.6rem, 2.4vw, 2.1rem); margin-bottom: 16px; }
.contact-block p, .contact-block address { font-style: normal; color: var(--ink-2); margin: 0 0 8px; }
.contact-block a { text-decoration: none; border-bottom: 1px solid var(--line); }
.contact-block a:hover { border-bottom-color: var(--ink); }
.kv { display: grid; grid-template-columns: 90px minmax(0, 1fr); gap: 6px 12px; margin: 0; font-size: 0.95rem; }
.kv dt { color: var(--muted); font-size: 0.8rem; padding-top: 2px; }
.kv dd { margin: 0; overflow-wrap: anywhere; }

/* Footer */
.site-footer { border-top: 1px solid var(--line); padding: clamp(48px, 6vw, 80px) 0 32px; font-size: 0.88rem; color: var(--ink-2); }
.footer-grid { display: grid; grid-template-columns: minmax(0, 1.3fr) repeat(3, minmax(0, 1fr)); gap: 32px; }
.footer-grid h4 { font-family: var(--sans); font-size: 0.7rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); font-weight: 500; margin-bottom: 12px; }
.footer-grid p { margin: 0 0 6px; }
.footer-grid a { text-decoration: none; }
.footer-grid a:hover { text-decoration: underline; }
.footer-brand .logo-mark { width: 70px; margin-bottom: 14px; }
.footer-bottom { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin-top: 48px; padding-top: 20px; border-top: 1px solid var(--line); font-size: 0.78rem; color: var(--muted); }
.footer-bottom a { color: var(--muted); }
@media (max-width: 900px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .footer-grid { grid-template-columns: 1fr; } }

/* Apparizione morbida */
.reveal { opacity: 0; transform: translateY(14px); transition: opacity .8s ease, transform .8s ease; }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .card .ph img { transition: none; }
}
@media print { .site-header, .cta, .lightbox, .filters { display: none !important; } .reveal { opacity: 1; transform: none; } }

/* Elenchi nel testo */
.prose ul.bul { list-style: none; margin: 0 0 1em; padding: 0; border-top: 1px solid var(--line); }
.prose ul.bul li { padding: 12px 0 12px 22px; border-bottom: 1px solid var(--line); color: var(--ink-2); position: relative; font-size: 0.97rem; }
.prose ul.bul li::before { content: ""; position: absolute; left: 0; top: 1.3em; width: 10px; height: 1px; background: var(--ink); }
.project-body .prose .lead { margin-bottom: 1.4em; color: var(--ink); }
