/* La Fenice O.D.V. — registro civico, navy / oro, maiuscole condensate */
:root {
  --notte: #0B1030;
  --notte-2: #070A1F;
  --blu: #0A3F9C;
  --oro: #FFCC00;
  --carta: #F1F2F5;
  --carta-2: #E5E7EE;
  --inchiostro: #0E1124;
  --testo-2: #474C62;
  --su-notte: #C8CFE6;
  --su-notte-2: #8F98BC;
  --su-blu: #DCE4F8;
  --gialla: #F5C400;
  --arancione: #F07D12;
  --rossa: #D62828;

  --display: "Big Shoulders Display", "Archivo Narrow", sans-serif;
  --sans: "Archivo", system-ui, sans-serif;
  --serif: "Source Serif 4", Georgia, serif;

  --max: 1240px;
  --gutter: clamp(20px, 4vw, 40px);
  --sec: clamp(80px, 11vw, 144px);

  --grana: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 .09 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  --retino: radial-gradient(circle at center, currentColor 1.1px, transparent 1.5px);
  --ease: cubic-bezier(.16,1,.3,1);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 96px; scrollbar-color: var(--blu) var(--carta); }
body {
  margin: 0;
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--inchiostro);
  background: var(--carta);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-underline-offset: .22em; text-decoration-thickness: 2px; }
::selection { background: var(--oro); color: var(--notte); }
:focus-visible { outline: 3px solid var(--oro); outline-offset: 3px; }
h1, h2, h3, h4 { margin: 0; text-wrap: balance; }
p { margin: 0; text-wrap: pretty; }

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

.skip { position: absolute; left: 12px; top: -60px; z-index: 50; background: var(--oro); color: var(--notte); padding: 10px 16px; font-weight: 700; }
.skip:focus { top: 12px; }

/* ---------- Bottoni e link ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 52px; padding: 0 28px;
  font: 800 .9rem/1 var(--sans); letter-spacing: .12em; text-transform: uppercase;
  text-decoration: none; border: 0; cursor: pointer;
  transition: background-color .25s var(--ease), color .25s, transform .25s var(--ease);
}
.btn:active { transform: translateY(1px); }
.btn-oro { background: var(--oro); color: var(--notte); }
.btn-oro:hover { background: #fff; }
.btn-notte { background: var(--notte); color: #fff; }
.btn-notte:hover { background: var(--blu); }

.link-rule {
  display: inline-flex; align-items: center; min-height: 52px;
  font: 800 .9rem/1 var(--sans); letter-spacing: .12em; text-transform: uppercase;
  color: #fff; text-decoration: none;
  background: linear-gradient(var(--oro), var(--oro)) 0 calc(100% - 12px) / 100% 2px no-repeat;
  transition: background-size .3s var(--ease);
}
.link-rule:hover { background-size: 100% 6px; }

.link-arrow {
  display: inline-flex; align-items: center; gap: 14px; margin-top: 36px;
  font: 800 .95rem/1 var(--sans); letter-spacing: .1em; text-transform: uppercase;
  color: var(--inchiostro); text-decoration: none;
}
.link-arrow svg { width: 26px; height: 26px; transition: transform .3s var(--ease); }
.link-arrow:hover svg { transform: translateX(6px); }
.link-arrow:hover { color: var(--blu); }
.link-arrow--light { color: #fff; }
.link-arrow--light:hover { color: var(--oro); }

/* ---------- Testata ---------- */

.masthead {
  position: sticky; top: 0; z-index: 30;
  background: var(--notte); color: #fff;
  border-bottom: 1px solid rgba(255,255,255,.1);
}
.masthead .wrap { display: flex; align-items: center; justify-content: space-between; height: 84px; }
.brand { display: flex; align-items: center; gap: 16px; text-decoration: none; color: #fff; }
.brand img { width: 46px; }
.brand-bar { width: 3px; height: 44px; background: #fff; }
.brand-name { font: 900 1.7rem/1 var(--sans); letter-spacing: -.035em; }

.menu { display: flex; align-items: center; gap: clamp(18px, 2.4vw, 34px); }
.menu a:not(.btn) {
  font: 700 .8rem/1 var(--sans); letter-spacing: .12em; text-transform: uppercase;
  text-decoration: none; color: var(--su-notte); padding: 10px 0; position: relative;
}
.menu a:not(.btn)::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: var(--oro);
  transform: scaleX(0); transform-origin: left; transition: transform .3s var(--ease);
}
.menu a:not(.btn):hover { color: #fff; }
.menu a:not(.btn):hover::after { transform: scaleX(1); }
.menu .btn { min-height: 46px; padding: 0 22px; font-size: .8rem; }

.menu-btn { display: none; align-items: center; gap: 12px; background: none; border: 0; color: #fff; font: 800 .8rem/1 var(--sans); letter-spacing: .14em; text-transform: uppercase; cursor: pointer; padding: 12px 0; }
.menu-lines, .menu-lines::before, .menu-lines::after { display: block; width: 24px; height: 2px; background: currentColor; position: relative; transition: transform .3s, background-color .3s; }
.menu-lines::before, .menu-lines::after { content: ""; position: absolute; left: 0; }
.menu-lines::before { top: -7px; } .menu-lines::after { top: 7px; }
.menu-btn[aria-expanded="true"] .menu-lines { background: transparent; }
.menu-btn[aria-expanded="true"] .menu-lines::before { transform: translateY(7px) rotate(45deg); }
.menu-btn[aria-expanded="true"] .menu-lines::after { transform: translateY(-7px) rotate(-45deg); }

/* ---------- Hero ---------- */
.hero {
  position: relative; overflow: hidden;
  background:
    var(--grana),
    var(--notte);
  color: #fff;
}
.hero-grid {
  display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(0, .92fr); align-items: center; gap: 32px;
  min-height: min(calc(100svh - 84px - 108px), 760px);
  padding-top: clamp(40px, 5vw, 64px); padding-bottom: 36px;
}
.hero h1 {
  font: 900 clamp(4rem, 9.6vw, 7.6rem)/.86 var(--display);
  text-transform: uppercase; letter-spacing: -.005em;
}
.hero-lead { margin-top: 30px; max-width: 34ch; font-size: clamp(1.1rem, 1.6vw, 1.3rem); line-height: 1.55; color: var(--su-notte); }
.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 20px 36px; margin-top: 40px; }

/* Palco della fenice: il corpo emerge dal basso, la stella arriva per ultima */
@property --svela { syntax: "<percentage>"; inherits: false; initial-value: 0%; }

.phoenix-stage { position: relative; height: clamp(340px, 36vw, 480px); display: grid; place-items: end center; padding-bottom: 4%; }
.phoenix { position: relative; width: min(78%, 430px); aspect-ratio: 693 / 785; }

.phoenix-body {
  position: absolute; inset: 0; width: 100%; height: 100%;
  -webkit-mask-image: linear-gradient(to top, var(--notte) calc(var(--svela) - 18%), transparent var(--svela));
          mask-image: linear-gradient(to top, var(--notte) calc(var(--svela) - 18%), transparent var(--svela));
  transform: translateY(5%);
  animation: emerge 1.8s .3s cubic-bezier(.5,0,.25,1) forwards;
}
.phoenix-star {
  position: absolute; left: 40.4%; top: .76%; width: 20.06%; height: auto;
  opacity: 0; transform: translateY(-22%) scale(.82);
  animation: stella .9s 2.05s cubic-bezier(.22,1,.36,1) forwards, accende 1.8s 2.15s ease-out forwards;
}

@keyframes emerge { to { --svela: 118%; transform: translateY(0); } }
@keyframes stella { to { opacity: 1; transform: none; } }
@keyframes accende {
  0% { filter: drop-shadow(0 0 0 rgba(255,204,0,0)); }
  35% { filter: drop-shadow(0 0 22px rgba(255,204,0,.75)); }
  100% { filter: drop-shadow(0 0 0 rgba(255,204,0,0)); }
}

/* Indice progetti sotto l'hero */
.hero-index {
  list-style: none; margin-top: 0; margin-bottom: 0;
  display: grid; grid-template-columns: repeat(3, 1fr);
  position: relative; z-index: 2;
}
.hero-index::before { content: ""; position: absolute; left: var(--gutter); right: var(--gutter); top: 0; height: 1px; background: rgba(255,255,255,.16); }
.hero-index li + li { border-left: 1px solid rgba(255,255,255,.16); }
.hero-index a {
  display: flex; flex-direction: column; gap: 8px; padding: 26px 24px 30px;
  font: 800 clamp(1.4rem, 2.4vw, 2rem)/1 var(--display); text-transform: uppercase; letter-spacing: .01em;
  text-decoration: none; color: #fff; transition: color .3s;
}
.hero-index li:first-child a { padding-left: 0; }
.hero-index a span { font: 600 .74rem/1 var(--sans); letter-spacing: .14em; color: var(--su-notte-2); }
.hero-index a:hover { color: var(--oro); }

/* ---------- Titoli con regola ---------- */
.title-rule {
  font: 900 clamp(2.6rem, 5.6vw, 4.6rem)/.9 var(--display); text-transform: uppercase; letter-spacing: -.005em;
  padding-bottom: 22px; margin-bottom: 8px;
  background: linear-gradient(var(--blu), var(--blu)) 0 100% / 100% 6px no-repeat;
}
.serif-lead { font: 500 clamp(1.25rem, 1.9vw, 1.5rem)/1.4 var(--serif); letter-spacing: -.005em; }

/* ---------- Chi siamo ---------- */
.about { padding: var(--sec) 0; background: var(--grana), var(--carta); }
.about-grid { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: clamp(40px, 7vw, 110px); align-items: start; }
.about .title-rule { background-size: 38% 6px; }
.about-text { display: grid; gap: 22px; max-width: 62ch; color: var(--testo-2); }
.about-text .serif-lead { color: var(--inchiostro); }

/* ---------- Progetti ---------- */
.projects { padding-top: var(--sec); background: var(--grana), #fff; }
.title-rule--wide { margin-bottom: clamp(48px, 7vw, 88px); }

.project { padding: clamp(64px, 9vw, 120px) 0; }
.project--visit { padding-top: 0; }
.project-grid { display: grid; grid-template-columns: minmax(0, .82fr) minmax(0, 1.18fr); gap: clamp(36px, 6vw, 90px); align-items: center; }
.project-grid--flip { grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); }
.project h3 { font: 900 clamp(2.6rem, 5vw, 4.2rem)/.9 var(--display); text-transform: uppercase; margin-bottom: 26px; padding-bottom: 18px;
  background: linear-gradient(var(--blu), var(--blu)) 0 100% / 96px 6px no-repeat; }
.project--live h3, .project--allerta h3 { background-image: linear-gradient(var(--oro), var(--oro)); }
.project .serif-lead { max-width: 30ch; }
.project h4 { margin-top: 36px; margin-bottom: 4px; font: 800 .8rem/1 var(--sans); letter-spacing: .14em; text-transform: uppercase; }
.ruled { list-style: none; margin: 0; padding: 0; }
.ruled li { padding: 14px 0 14px 28px; border-bottom: 1px solid var(--carta-2); position: relative; }
.ruled li::before { content: ""; position: absolute; left: 0; top: 26px; width: 12px; height: 2px; background: var(--blu); }

.project-photo { margin: 0; position: relative; }
.project-photo::before {
  content: ""; position: absolute; right: -18px; top: -18px; width: 46%; height: 60%;
  color: var(--blu); background-image: var(--retino); background-size: 8px 8px; opacity: .35;
}
.project-photo picture { position: relative; display: block; }
.project-photo img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; object-position: 42% 50%; }
.project-photo figcaption { margin-top: 12px; font-size: .8rem; color: var(--testo-2); position: relative; }

/* Pontevico Live: notte */
.project--live { background: var(--grana), var(--notte); color: #fff; }
.project--live .ruled li { border-color: rgba(255,255,255,.14); color: var(--su-notte); }
.project--live .ruled li::before { background: var(--oro); }

.project-photo--dark::before { color: var(--oro); opacity: .3; left: -18px; right: auto; top: -18px; }
.project-photo--dark img { object-position: 50% 40%; }
.project-photo--dark figcaption { color: var(--su-notte-2); }

/* AllertaMeteo: blu fenice pieno */
.project--allerta { background: var(--grana), var(--blu); color: #fff; }
.project--allerta .allerta-head { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(32px, 6vw, 90px); align-items: end; }
.allerta-head h3 { margin-bottom: 0; }
.allerta-head .serif-lead { max-width: 40ch; color: var(--su-blu); font-size: clamp(1.1rem, 1.6vw, 1.3rem); }

.levels { display: grid; grid-template-columns: repeat(3, minmax(0, 120px)); gap: 6px; margin-top: clamp(40px, 5vw, 56px); margin-bottom: clamp(40px, 5vw, 56px); }
.lv { display: flex; align-items: center; height: 36px; padding: 0 12px; font: 900 1.05rem/1 var(--display); text-transform: uppercase; letter-spacing: .02em; color: var(--notte); }
.lv-g { background: var(--gialla); }
.lv-a { background: var(--arancione); }
.lv-r { background: var(--rossa); color: #fff; }

.flow { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid rgba(255,255,255,.22); border-bottom: 1px solid rgba(255,255,255,.22); }
.flow li { display: grid; gap: 10px; align-content: start; padding: 30px 28px 34px 0; }
.flow li + li { padding-left: 28px; border-left: 1px solid rgba(255,255,255,.22); }
.flow b { font: 900 2rem/1 var(--display); text-transform: uppercase; }
.flow span { color: var(--su-blu); max-width: 32ch; }

/* ---------- Per gli enti ---------- */
.offer { padding: var(--sec) 0; background: var(--grana), var(--carta); }
.offer-head { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(32px, 6vw, 90px); align-items: end; }
.offer-head .title-rule { background-size: 50% 6px; }
.offer-head p { color: var(--testo-2); max-width: 46ch; font-size: 1.1rem; }
.offer-list { list-style: none; margin: clamp(48px, 6vw, 72px) 0 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 0 clamp(20px, 3vw, 40px); }
.offer-list li { border-top: 3px solid var(--inchiostro); padding-top: 22px; }
.offer-list h3 { font: 600 1.35rem/1.2 var(--serif); margin-bottom: 12px; }
.offer-list p { color: var(--testo-2); font-size: .95rem; }

/* ---------- Chiusura oro ---------- */
.close { background: var(--oro); color: var(--notte); padding: clamp(72px, 9vw, 120px) 0; position: relative; overflow: hidden; }
.close::before {
  content: ""; position: absolute; right: -4%; top: -20%; width: 46%; height: 140%;
  color: rgba(11,16,48,.16); background-image: var(--retino); background-size: 9px 9px;
  -webkit-mask-image: linear-gradient(100deg, transparent 10%, var(--notte) 70%); mask-image: linear-gradient(100deg, transparent 10%, var(--notte) 70%);
}
.close-grid { position: relative; display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, .75fr); gap: clamp(32px, 6vw, 80px); align-items: end; }
.close h2 { font: 900 clamp(3rem, 7vw, 5.8rem)/.86 var(--display); text-transform: uppercase; padding-bottom: 24px; background: linear-gradient(var(--notte), var(--notte)) 0 100% / 40% 6px no-repeat; }
.close-side { display: grid; gap: 22px; justify-items: start; }
.close-side p { font-size: 1.1rem; max-width: 36ch; }
.close-mail { font: 800 1.15rem/1 var(--sans); text-decoration: underline; text-decoration-thickness: 2px; }

/* ---------- Footer ---------- */
.footer { background: var(--notte-2); color: var(--su-notte); padding-top: 72px; font-size: .95rem; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 40px; padding-bottom: 56px; }
.footer-brand { display: flex; align-items: center; gap: 18px; color: #fff; }
.footer-brand img { width: 64px; }
.footer-brand .brand-bar { height: 70px; }
.footer-brand p { font: 900 2rem/1 var(--sans); letter-spacing: -.035em; }
.footer-brand p span { display: block; margin-top: 6px; font: 400 1rem/1.25 var(--sans); letter-spacing: 0; color: var(--su-notte); }
.footer-h { font: 800 .78rem/1 var(--sans); letter-spacing: .16em; text-transform: uppercase; color: var(--oro); margin-bottom: 18px; }
.footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.footer a { text-decoration: none; }
.footer a:hover { color: #fff; text-decoration: underline; }
.footer address { font-style: normal; line-height: 1.8; }
.footer-base { display: flex; justify-content: space-between; gap: 16px; border-top: 1px solid rgba(255,255,255,.1); padding-top: 22px; padding-bottom: 28px; font-size: .8rem; color: var(--su-notte-2); }

/* ---------- Responsive ---------- */
@media (max-width: 1020px) {
  .menu { gap: 18px; }
  .menu a[href="#chi-siamo"] { display: none; }
  .offer-list { grid-template-columns: 1fr 1fr; gap: 36px 32px; }
}
@media (max-width: 860px) {
  .menu-btn { display: inline-flex; }
  .menu {
    position: absolute; top: 84px; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--notte); border-bottom: 1px solid rgba(255,255,255,.12);
    padding: 8px var(--gutter) 24px;
    clip-path: inset(0 0 100% 0); visibility: hidden;
    transition: clip-path .4s var(--ease), visibility 0s .4s;
  }
  .menu.is-open { clip-path: inset(0 0 0 0); visibility: visible; transition: clip-path .4s var(--ease); }
  .menu a:not(.btn) { padding: 18px 0; border-bottom: 1px solid rgba(255,255,255,.1); font-size: .9rem; }
  .menu a[href="#chi-siamo"] { display: block; }
  .menu .btn { margin-top: 20px; }
  .menu a:not(.btn)::after { display: none; }

  .hero-grid { grid-template-columns: 1fr; min-height: 0; gap: 0; padding-top: 28px; }
  .phoenix-stage { order: -1; height: 280px; width: 100%; }
  .phoenix { width: 210px; }
  .phoenix-stage { padding-bottom: 0; }
  .hero-index { grid-template-columns: 1fr; }
  .hero-index li + li { border-left: 0; border-top: 1px solid rgba(255,255,255,.16); }
  .hero-index a, .hero-index li:first-child a { padding: 20px 0; flex-direction: row; justify-content: space-between; align-items: baseline; }

  .about-grid, .project-grid, .project-grid--flip, .allerta-head, .offer-head, .close-grid { grid-template-columns: 1fr; }
  .project-grid--flip .project-photo { order: 2; }
  .flow { grid-template-columns: 1fr; }
  .flow li, .flow li + li { padding: 24px 0; border-left: 0; }
  .flow li + li { border-top: 1px solid rgba(255,255,255,.22); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
}
@media (max-width: 560px) {
  .brand-name { font-size: 1.45rem; }
  .offer-list { grid-template-columns: 1fr; }
  .levels { grid-template-columns: repeat(3, 1fr); }
  .footer-grid { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0s !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
