/* Vitiello Reccia — sito pubblico */
:root {
  --paper: #fff;
  --ink: #111;
  --text: #4a4a47;
  --muted: #7a7a76;
  --line: #e7e7e3;
  --plaster: #f4f4f1;
  --blue: #3f6b8a;
  --rail: 64px;
  --pad: clamp(20px, 4vw, 64px);
  --font: "Manrope", "Helvetica Neue", Helvetica, Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-weight: 300;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
button, input, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}
.skip-link {
  position: fixed; left: 12px; top: -60px; z-index: 200;
  background: var(--ink); color: #fff; padding: 10px 14px; font-size: 14px;
}
.skip-link:focus { top: 12px; }

/* ---------- Barra laterale ---------- */
.rail {
  position: fixed; z-index: 40; inset: 0 auto 0 0; width: var(--rail);
  display: flex; flex-direction: column; align-items: center; justify-content: space-between;
  padding: 26px 0 28px; background: var(--paper); border-right: 1px solid var(--line);
}
.rail-menu { border: 0; background: none; padding: 8px; cursor: pointer; color: var(--ink); line-height: 0; }
.rail-menu:hover { color: var(--blue); }
.rail-brand {
  writing-mode: vertical-rl; transform: rotate(180deg);
  font-size: 13px; font-weight: 500; letter-spacing: .02em; color: var(--ink);
}

/* ---------- Menu a scomparsa ---------- */
.drawer { position: fixed; inset: 0; z-index: 60; }
.drawer-backdrop { position: absolute; inset: 0; background: rgba(17, 17, 17, .28); animation: fade .25s ease; }
.drawer-panel {
  position: absolute; inset: 0 auto 0 0; width: min(440px, 100%);
  background: var(--plaster); padding: 34px clamp(28px, 5vw, 64px);
  display: flex; flex-direction: column; animation: slide .3s cubic-bezier(.2, .7, .2, 1);
}
.drawer-close { align-self: flex-start; border: 0; background: none; padding: 8px; margin-left: -8px; cursor: pointer; line-height: 0; }
.drawer-panel ul { list-style: none; margin: auto 0; padding: 0; }
.drawer-panel li a {
  display: inline-block; font-size: clamp(34px, 5vw, 52px); font-weight: 200;
  letter-spacing: -.045em; line-height: 1.25; transition: color .2s;
}
.drawer-panel li a:hover, .drawer-panel li a[aria-current] { color: var(--blue); }
.drawer-note { margin: 0; font-size: 13px; color: var(--muted); line-height: 1.7; }
@keyframes fade { from { opacity: 0; } }
@keyframes slide { from { transform: translateX(-24px); opacity: 0; } }

.preview-banner {
  position: fixed; z-index: 45; left: var(--rail); right: 0; bottom: 0;
  background: var(--ink); color: #fff; font-size: 13px; padding: 10px var(--pad);
}
.preview-banner a { text-decoration: underline; margin-left: 8px; }

main, .site-footer { margin-left: var(--rail); }

/* ---------- Portfolio ---------- */
.portfolio { padding: 56px var(--pad) 96px; min-height: 80vh; }

.filters { display: grid; gap: 14px; justify-items: center; margin-bottom: clamp(36px, 6vw, 80px); }
.filter-row { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 6px 0; }
.filter-row button {
  position: relative; border: 0; background: none; cursor: pointer; padding: 2px 0;
  color: var(--muted); font-size: 13px; font-weight: 400; transition: color .2s;
}
.filter-row button + button { margin-left: 30px; }
.filter-row button + button::before {
  content: ""; position: absolute; left: -22px; top: 50%; width: 14px; height: 1px; background: var(--line);
}
.filter-row button:hover { color: var(--ink); }
.filter-row button[aria-pressed="true"] { color: var(--ink); }
.filter-row-sub button { font-size: 12px; }
.filter-row-sub button[aria-pressed="true"] { text-decoration: underline; text-underline-offset: 5px; text-decoration-thickness: 1px; }

.grid {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(8px, 1.2vw, 18px); max-width: 1320px; margin: 0 auto;
}
.tile { position: relative; display: block; aspect-ratio: 4 / 3; overflow: hidden; background: var(--paper); }
.tile-art { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; }
.tile-art img { width: 100%; height: 100%; transition: transform .9s cubic-bezier(.2, .7, .2, 1); }
.tile-fill img { object-fit: cover; }
.tile-draw { padding: 11%; }
.tile-draw img { object-fit: contain; mix-blend-mode: multiply; }
.tile:hover .tile-art img, .tile:focus-visible .tile-art img { transform: scale(1.035); }
.tile-empty { padding: 10%; text-align: center; font-size: 18px; font-weight: 300; letter-spacing: -.02em; color: var(--muted); }

.tile-label {
  position: absolute; left: 6%; bottom: 6%; max-width: 88%;
  background: rgba(255, 255, 255, .94); padding: 12px 16px 13px;
  opacity: 0; transform: translateY(6px); transition: opacity .25s, transform .25s;
  pointer-events: none;
}
.tile-label small { display: block; font-size: 11px; font-weight: 400; color: var(--muted); margin-bottom: 2px; }
.tile-label strong { display: block; font-size: 14px; font-weight: 500; line-height: 1.3; letter-spacing: -.01em; }
.tile:hover .tile-label, .tile:focus-visible .tile-label { opacity: 1; transform: none; }
@media (hover: none) {
  .tile-label { opacity: 1; transform: none; left: 0; bottom: 0; max-width: 100%; right: 0; padding: 10px 12px; }
}
.tile[hidden] { display: none !important; }
.filter-empty, .empty { text-align: center; color: var(--muted); padding: 80px 0; }
.empty a { text-decoration: underline; text-underline-offset: 4px; }


/* Etichetta che segue il cursore (solo con mouse) */
.tile-tip {
  position: fixed; left: 0; top: 0; z-index: 90; pointer-events: none;
  max-width: min(420px, calc(100vw - 24px)); padding: 16px 22px 18px;
  background: #fff; box-shadow: 0 8px 30px rgba(0, 0, 0, .13), 0 1px 3px rgba(0, 0, 0, .06);
  opacity: 0; transition: opacity .18s ease; will-change: transform;
}
.tile-tip.is-on { opacity: 1; }
.tile-tip small { display: block; font-size: 13px; font-weight: 300; color: var(--muted); line-height: 1.4; margin-bottom: 4px; }
.tile-tip strong { display: block; font-size: clamp(17px, 1.5vw, 21px); font-weight: 300; letter-spacing: -.02em; line-height: 1.25; color: var(--ink); }
@media (hover: hover) and (pointer: fine) {
  .tile:hover .tile-label { opacity: 0; }
}

/* ---------- Scheda progetto ---------- */
.project { padding: 72px var(--pad) 0; }
.project-head { max-width: 1320px; margin: 0 auto; }
.project h1 {
  margin: 0; max-width: 20em; font-size: clamp(30px, 4.2vw, 58px); font-weight: 300;
  line-height: 1.05; letter-spacing: -.045em; text-wrap: balance;
}
.project-sub { margin: 14px 0 0; font-size: clamp(16px, 1.5vw, 20px); color: var(--muted); letter-spacing: -.01em; }
.draft-flag { display: inline-block; margin: 18px 0 0; padding: 6px 12px; background: var(--plaster); font-size: 13px; }

.project-body {
  max-width: 1320px; margin: clamp(28px, 4vw, 52px) auto 0;
  display: grid; grid-template-columns: minmax(0, 1fr) 230px; gap: clamp(32px, 7vw, 120px); align-items: start;
}
.project-text { max-width: 70ch; font-size: 15.5px; color: var(--text); }
.project-text p { margin: 0 0 1.1em; }
.project-text h3 { margin: 1.8em 0 .5em; font-size: 15.5px; font-weight: 600; color: #2b2b29; }
.project-text h3:first-child { margin-top: 0; }
.project-text a, .prose a { text-decoration: underline; text-underline-offset: 3px; }
.project-text strong { font-weight: 600; color: #2b2b29; }

.project-facts { margin: 0; display: grid; gap: 20px; }
.project-facts dt { font-size: 13px; color: var(--muted); }
.project-facts dd { margin: 2px 0 0; font-size: 17px; letter-spacing: -.01em; }

.project-hero, .gallery { max-width: 1320px; margin-left: auto; margin-right: auto; }
.project-hero { margin-top: clamp(36px, 5vw, 72px); }
.project-hero figure { margin: 0; }
.project-hero img { width: 100%; max-height: 86vh; object-fit: cover; }
.gallery { display: flex; flex-wrap: wrap; gap: clamp(8px, 1vw, 14px); margin-top: clamp(8px, 1vw, 14px); }
.gallery figure { margin: 0; flex: var(--r) 1 calc(var(--r) * 260px); min-width: 0; }
.gallery img { width: 100%; height: auto; background: var(--plaster); }
figure a { display: block; cursor: zoom-in; }

.project-nav {
  max-width: 1320px; margin: clamp(56px, 8vw, 110px) auto 0; padding: 28px 0 56px;
  border-top: 1px solid var(--line);
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 24px;
}
.project-nav a { display: flex; align-items: center; gap: 16px; color: var(--ink); transition: color .2s; }
.project-nav a:hover { color: var(--blue); }
.project-nav small { display: block; font-size: 12px; color: var(--muted); }
.project-nav span { font-size: 14px; line-height: 1.35; display: block; }
.pn-next { justify-self: end; text-align: right; }
.pn-prev span, .pn-next span { max-width: 26ch; }

/* ---------- Visore immagini ---------- */
.lightbox { position: fixed; inset: 0; z-index: 100; background: rgba(255, 255, 255, .985); display: flex; flex-direction: column; animation: fade .2s ease; }
.lb-stage { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; padding: 56px 72px 12px; }
.lb-stage img { max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; }
.lb-caption { text-align: center; font-size: 13px; color: var(--muted); padding: 0 24px 22px; min-height: 40px; }
.lb-btn { position: absolute; border: 0; background: none; cursor: pointer; padding: 14px; line-height: 0; color: var(--ink); }
.lb-btn:hover { color: var(--blue); }
.lb-close { top: 8px; right: 8px; }
.lb-prev { left: 8px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 8px; top: 50%; transform: translateY(-50%); }
.lb-count { position: absolute; left: 22px; top: 20px; font-size: 12px; color: var(--muted); }

/* ---------- Pagine di testo ---------- */
.text-page { padding: 88px var(--pad) 96px; max-width: calc(1320px + var(--pad) * 2); }
.statement { margin: 0 0 clamp(40px, 7vw, 96px); max-width: 17em; font-size: clamp(34px, 5.4vw, 78px); font-weight: 200; line-height: 1.02; letter-spacing: -.055em; text-wrap: balance; }
.text-columns { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: clamp(32px, 7vw, 120px); align-items: start; }
.prose { max-width: 62ch; font-size: 17px; line-height: 1.7; color: var(--text); }
.prose p { margin: 0 0 1.2em; }
.lead { margin: 0 0 24px; font-size: 19px; line-height: 1.5; letter-spacing: -.01em; }
.areas h2 { margin: 0 0 14px; font-size: 13px; font-weight: 400; color: var(--muted); }
.areas ul, .contact-info ul { list-style: none; margin: 0; padding: 0; }
.areas li { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding: 14px 0; border-top: 1px solid var(--line); font-size: 20px; letter-spacing: -.02em; }
.areas li:last-child { border-bottom: 1px solid var(--line); }
.areas li a:hover { color: var(--blue); }
.areas li span { font-size: 13px; color: var(--muted); letter-spacing: 0; }
.contact-info li { padding: 6px 0; font-size: 18px; }
.contact-info a { border-bottom: 1px solid var(--line); transition: border-color .2s; }
.contact-info a:hover { border-color: var(--ink); }

.contact-form { display: grid; gap: 18px; max-width: 520px; }
.contact-form label { display: grid; gap: 6px; font-size: 13px; color: var(--muted); }
.contact-form input:not([type="checkbox"]), .contact-form textarea {
  width: 100%; border: 0; border-bottom: 1px solid #cfcfca; background: none; padding: 8px 0 10px;
  font-size: 17px; color: var(--ink); border-radius: 0; transition: border-color .2s;
}
.contact-form textarea { resize: vertical; min-height: 130px; }
.contact-form input:focus, .contact-form textarea:focus { outline: none; border-color: var(--ink); }
.contact-form .check { display: flex; gap: 10px; align-items: flex-start; line-height: 1.45; }
.contact-form .check input { margin-top: 3px; accent-color: var(--ink); }
.contact-form .hp { position: absolute; left: -9999px; }
.contact-form button {
  justify-self: start; border: 1px solid var(--ink); background: var(--ink); color: #fff;
  padding: 13px 26px; font-size: 14px; font-weight: 400; cursor: pointer; transition: background .2s, color .2s;
}
.contact-form button:hover { background: var(--paper); color: var(--ink); }
.notice { margin: 0 0 22px; padding: 14px 16px; font-size: 14px; }
.notice-ok { background: #eef4ee; }
.notice-error { background: #f8ecea; }

/* ---------- Piè di pagina ---------- */
.site-footer { background: #111; color: #d9d9d4; padding: clamp(44px, 6vw, 80px) var(--pad) 28px; }
.footer-grid { max-width: 1320px; margin: 0 auto; display: grid; grid-template-columns: 1.3fr 1fr 1fr 1fr; gap: 40px; }
.site-footer h2 { margin: 0 0 16px; font-size: 17px; font-weight: 300; color: #fff; }
.site-footer p, .site-footer li { font-size: 14px; line-height: 1.75; margin: 0; }
.site-footer p { max-width: 30ch; color: #b9b9b4; }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer a { transition: color .2s; }
.site-footer a:hover { color: #fff; text-decoration: underline; text-underline-offset: 4px; }
.footer-mark { justify-self: end; font-size: clamp(20px, 2.4vw, 34px); font-weight: 500; line-height: 1; letter-spacing: .08em; text-transform: uppercase; color: #fff; text-align: right; }
.footer-bottom { max-width: 1320px; margin: clamp(40px, 6vw, 72px) auto 0; padding-top: 18px; border-top: 1px solid #2a2a28; display: flex; justify-content: space-between; gap: 16px; font-size: 12px; color: #8f8f8a; }
.footer-bottom a:hover { color: #fff; }

/* ---------- Mobile ---------- */
@media (max-width: 960px) {
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-mark { justify-self: start; text-align: left; grid-column: 1 / -1; }
}
@media (max-width: 800px) {
  :root { --rail: 0px; }
  .filter-row { gap: 6px 22px; }
  .filter-row button + button { margin-left: 0; }
  .filter-row button + button::before { display: none; }
  .rail {
    inset: 0 0 auto 0; width: auto; height: 56px; flex-direction: row-reverse; padding: 0 14px 0 var(--pad);
    border-right: 0; border-bottom: 1px solid var(--line);
  }
  .rail-brand { writing-mode: horizontal-tb; transform: none; font-size: 15px; }
  main { padding-top: 56px; }
  .project, .portfolio, .text-page { padding-top: 84px; }
  .portfolio { padding-top: 84px; }
  .project-body, .text-columns { grid-template-columns: 1fr; }
  .project-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .project-nav { grid-template-columns: 1fr auto 1fr; }
  .project-nav span { display: none; }
  .project-nav small { display: none; }
  .lb-stage { padding: 56px 12px 12px; }
  .lb-prev, .lb-next { top: auto; bottom: 10px; transform: none; }
  .preview-banner { left: 0; }
}
@media (max-width: 520px) {
  .grid { grid-template-columns: 1fr; }
  .gallery figure { flex-basis: 100%; }
  .footer-grid { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* Badge premio concorso */
.award { display: inline-block; font-size: 10.5px; font-weight: 500; letter-spacing: .12em; text-transform: uppercase; line-height: 1; padding: 6px 9px; background: #111; color: #fff; }
.tile > .award { position: absolute; top: 10px; left: 10px; z-index: 2; }
.award-lg { font-size: 11.5px; padding: 7px 11px; margin-bottom: 14px; }
