:root {
  --paper: #f3ede3;
  --paper-deep: #e9dfd1;
  --ink: #211d1b;
  --muted: #6f665e;
  --wine: #681226;
  --wine-dark: #4b0b18;
  --gold: #ad7c32;
  --sage: #a7a77d;
  --white: #fffdf8;
  --line: rgba(52, 42, 35, .16);
  --shadow: 0 20px 60px rgba(67, 47, 33, .13);
  --radius: 22px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: "DM Sans", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }

.skip-link { position: fixed; top: -100px; left: 20px; z-index: 50; padding: 10px 16px; background: var(--white); }
.skip-link:focus { top: 20px; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  min-height: 84px;
  padding: 14px clamp(20px, 5vw, 76px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  background: rgba(243, 237, 227, .9);
  border-bottom: 1px solid rgba(92, 16, 32, .1);
  backdrop-filter: blur(18px);
}
.brand { display: inline-flex; align-items: center; gap: 13px; text-decoration: none; }
.monogram {
  display: grid;
  width: 48px;
  aspect-ratio: 1;
  place-items: center;
  border-radius: 10px;
  color: white;
  background: var(--wine);
  font-family: "Italiana", serif;
  font-size: 19px;
}
.brand-copy { display: grid; gap: 2px; }
.brand-copy strong { font-family: "Italiana", serif; font-size: clamp(18px, 2vw, 25px); letter-spacing: .01em; }
.brand-copy small { color: var(--wine); text-transform: uppercase; font-size: 9px; letter-spacing: .13em; font-weight: 600; }
nav { display: flex; gap: 28px; }
nav a { position: relative; text-decoration: none; font-size: 13px; font-weight: 600; }
nav a::after { content: ""; position: absolute; right: 0; bottom: -5px; left: 0; height: 1px; background: var(--wine); transform: scaleX(0); transition: transform .2s; }
nav a:hover::after, nav a:focus-visible::after { transform: scaleX(1); }

.hero {
  position: relative;
  min-height: min(760px, calc(100vh - 84px));
  padding: clamp(72px, 10vw, 148px) clamp(20px, 7vw, 110px) 90px;
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(300px, .65fr);
  align-items: center;
  gap: clamp(50px, 9vw, 150px);
  overflow: hidden;
  background:
    linear-gradient(90deg, rgba(243,237,227,.97) 0%, rgba(243,237,227,.90) 48%, rgba(243,237,227,.72) 100%),
    url("assets/palazzo-fruscione-facciata.png") center / cover no-repeat;
}
.hero::before { content: ""; position: absolute; width: 42vw; height: 42vw; min-width: 520px; min-height: 520px; left: -18vw; top: -25vw; border-radius: 50%; border: 1px solid rgba(173, 124, 50, .25); box-shadow: 0 0 0 44px rgba(173, 124, 50, .035), 0 0 0 88px rgba(173, 124, 50, .025); }
.eyebrow { margin: 0 0 20px; color: var(--wine); font-size: 11px; font-weight: 600; letter-spacing: .17em; text-transform: uppercase; }
h1, h2, h3 { font-family: "Italiana", Georgia, serif; font-weight: 400; }
h1 { position: relative; max-width: 860px; margin: 0; font-size: clamp(55px, 7vw, 108px); line-height: .93; letter-spacing: -.035em; }
h1 em { color: var(--wine); font-style: normal; }
.hero-lede { max-width: 620px; margin: 34px 0; color: var(--muted); font-size: clamp(16px, 1.5vw, 20px); line-height: 1.65; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.button { min-height: 50px; padding: 0 21px; border: 1px solid transparent; border-radius: 999px; display: inline-flex; align-items: center; justify-content: center; gap: 24px; text-decoration: none; cursor: pointer; transition: transform .2s, background .2s, color .2s; }
.button:hover { transform: translateY(-2px); }
.button.primary { color: white; background: var(--wine); box-shadow: 0 10px 26px rgba(92, 16, 32, .18); }
.button.primary:hover { background: var(--wine-dark); }
.button.ghost { color: var(--ink); background: transparent; border-color: var(--line); }
.button.ghost:hover { background: rgba(255,255,255,.45); }
.hero-card { position: relative; z-index: 1; padding: 38px; border: 1px solid rgba(92,16,32,.12); border-radius: var(--radius); background: rgba(255,253,248,.76); box-shadow: var(--shadow); backdrop-filter: blur(14px); }
.date-number { float: left; margin-right: 14px; color: var(--wine); font-family: "Italiana", serif; font-size: 70px; line-height: .75; }
.hero-card > div { display: grid; gap: 4px; }
.hero-card > div strong { font-size: 18px; }
.hero-card > div span { color: var(--muted); }
.hero-card hr { margin: 34px 0; border: 0; border-top: 1px solid var(--line); }
.hero-card dl { margin: 0; display: grid; grid-template-columns: repeat(3, 1fr); }
.hero-card dl div { display: grid; gap: 4px; }
.hero-card dt { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .1em; }
.hero-card dd { margin: 0; font-family: "Italiana", serif; font-size: 30px; }
.hero-card p { margin: 30px 0 0; padding-top: 24px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; line-height: 1.7; }
.arch-lines { position: absolute; right: 0; bottom: -2px; left: 0; height: 54px; display: flex; justify-content: center; gap: 5vw; opacity: .18; }
.arch-lines i { display: block; width: 19vw; max-width: 280px; height: 100%; border: 1px solid var(--wine); border-bottom: 0; border-radius: 160px 160px 0 0; }

.visit-section { padding: 105px clamp(20px, 5vw, 76px) 120px; color: white; background: #231f1d; }
.section-heading { max-width: 1450px; margin: 0 auto 50px; display: flex; align-items: end; justify-content: space-between; gap: 40px; }
.section-heading h2, .agenda-intro h2 { margin: 0; font-size: clamp(44px, 5vw, 75px); line-height: 1; }
.section-heading > p { max-width: 500px; margin: 0; color: #bcb2aa; line-height: 1.65; }
.visit-section .eyebrow { color: #c79c5d; }
.floor-tabs { max-width: 1450px; margin: 0 auto; display: grid; grid-template-columns: repeat(4, 1fr); border-bottom: 1px solid rgba(255,255,255,.14); }
.floor-tabs button { position: relative; padding: 18px 6px; border: 0; color: #aaa19b; background: transparent; text-align: left; cursor: pointer; }
.floor-tabs button span { float: right; margin-right: 12px; font-size: 11px; opacity: .65; }
.floor-tabs button::after { content: ""; position: absolute; right: 0; bottom: -1px; left: 0; height: 2px; background: #c79c5d; transform: scaleX(0); transform-origin: left; transition: transform .25s; }
.floor-tabs button[aria-selected="true"] { color: white; }
.floor-tabs button[aria-selected="true"]::after { transform: scaleX(1); }
.map-layout { max-width: 1450px; margin: 34px auto 0; display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(280px, .62fr); gap: 22px; }
.map-card, .floor-index { border-radius: var(--radius); background: #f8f2e9; color: var(--ink); }
.map-card { min-height: 660px; padding: clamp(24px, 3vw, 44px); overflow: hidden; }
.map-topline { display: flex; justify-content: space-between; align-items: start; }
.floor-kicker { color: var(--wine); font-size: 10px; font-weight: 600; letter-spacing: .15em; text-transform: uppercase; }
.map-topline h3 { margin: 2px 0 0; font-size: clamp(35px, 4vw, 58px); }
.map-legend { color: var(--muted); font-size: 11px; }
.map-legend i { display: inline-block; width: 9px; height: 9px; margin-right: 6px; border-radius: 50%; background: var(--gold); }
.palazzo-ribbon { margin-top: 20px; padding: 15px 18px; border: 1px solid rgba(173, 124, 50, .22); border-radius: 14px; display: flex; align-items: center; gap: 18px; background: rgba(233, 223, 209, .58); }
.palazzo-ribbon > div:last-child { display: grid; grid-template-columns: auto 1fr; column-gap: 12px; align-items: baseline; }
.palazzo-ribbon span { color: var(--gold); font-size: 9px; font-weight: 600; letter-spacing: .13em; text-transform: uppercase; }
.palazzo-ribbon strong { font-family: "Italiana", serif; font-size: 18px; font-weight: 400; }
.palazzo-ribbon p { grid-column: 1 / -1; margin: 4px 0 0; color: var(--muted); font-size: 10px; line-height: 1.5; }
.palazzo-arches { display: flex; align-items: end; gap: 4px; flex: 0 0 auto; }
.palazzo-arches i { display: block; width: 18px; height: 30px; border: 1px solid var(--gold); border-bottom-width: 3px; border-radius: 13px 13px 1px 1px; opacity: .75; }
.palazzo-arches i:nth-child(2) { height: 38px; }
.schematic { position: relative; min-height: 390px; margin-top: 14px; border: 1px solid rgba(60,44,35,.12); background: #ede6d9; overflow: hidden; }
.schematic.informative { height: auto; padding: 22px; display: grid; grid-template-columns: repeat(var(--columns), minmax(0, 1fr)); grid-auto-rows: 166px; align-content: center; gap: 14px; background-color: #eee6d9; background-image: linear-gradient(rgba(104,18,38,.035) 1px, transparent 1px), linear-gradient(90deg, rgba(104,18,38,.035) 1px, transparent 1px); background-size: 26px 26px; }
.schematic::before { content: ""; position: absolute; pointer-events: none; opacity: .38; }
.schematic::before { inset: 9%; border: 1px solid #8e8277; }
.schematic.floor-2::before { inset: 5% 8% 1% 4%; border-color: rgba(111, 102, 94, .55); }
.schematic.informative::before { display: none; }
.room { position: absolute; z-index: 2; padding: 9px; border: 1px solid rgba(45,38,31,.42); display: grid; place-items: center; color: #2b2723; background: #a8a77f; cursor: pointer; transition: filter .2s, transform .2s, box-shadow .2s; overflow: hidden; }
.informative .room { position: relative !important; inset: auto !important; width: auto !important; height: auto !important; min-width: 0; padding: 18px; clip-path: none !important; grid-template-columns: auto 1fr auto; place-items: center start; gap: 12px; border-color: rgba(92,16,32,.18); border-radius: 14px; background: rgba(255,253,248,.78); }
.informative .room::before { content: ""; position: absolute; top: 0; right: 0; left: 0; height: 4px; background: var(--wine); opacity: .78; }
.informative .room:hover, .informative .room:focus-visible { background: var(--white); }
.informative .room.active { color: var(--ink); background: #f6ead2; }
.room-mark { width: 45px; height: 58px; display: grid; place-items: center; border: 1px solid rgba(173,124,50,.45); border-radius: 24px 24px 5px 5px; color: var(--wine); background: rgba(233,223,209,.7); font-family: "Italiana", serif; font-size: 17px; }
.room-mark.has-photo, .artist-dialog-portrait, .directory-photo { background-repeat: no-repeat; background-size: 230%; background-position: 92% 58%; }
.portrait-mariconda { background-size: 185% !important; background-position: 80% 40% !important; }
.portrait-spatuzzi { background-size: 185% !important; background-position: 80% 30% !important; }
.portrait-tortorella { background-size: 185% !important; background-position: 82% 30% !important; }
.room-mark.has-photo { border-color: rgba(173,124,50,.58); box-shadow: inset 0 0 0 2px rgba(255,253,248,.5); }
.room-copy { min-width: 0; }
.room-open { align-self: start; color: var(--gold); font-size: 13px; }
.room:hover, .room:focus-visible, .room.active { z-index: 3; filter: brightness(1.07); transform: translateY(-3px); box-shadow: 0 12px 28px rgba(48,35,25,.22); outline: none; }
.room.active { background: var(--gold); color: white; }
.room strong { display: block; font-family: "Italiana", serif; font-size: clamp(12px, 1.15vw, 19px); font-weight: 400; line-height: 1.05; text-align: center; }
.informative .room strong { font-size: clamp(14px, 1.1vw, 18px); text-align: left; line-height: 1.15; }
.room small { margin-top: 5px; font-size: 8px; text-transform: uppercase; letter-spacing: .08em; opacity: .68; }
.informative .room small { display: block; }
.stair-core { position: absolute; z-index: 1; left: 42%; top: 37%; width: 16%; height: 26%; display: grid; place-items: center; color: #786e66; border: 1px dashed #92877e; font-size: 10px; text-transform: uppercase; letter-spacing: .1em; }
.floor-2 .stair-core { left: 41%; top: 39%; width: 15%; height: 27%; background: rgba(248, 242, 233, .7); }
.lift-core { position: absolute; z-index: 1; left: 57%; top: 44%; width: 12%; height: 18%; display: grid; place-items: center; color: #786e66; border: 1px solid #92877e; background: rgba(248, 242, 233, .75); font-size: 8px; text-transform: uppercase; letter-spacing: .08em; }
.map-orientation { display: flex; justify-content: space-between; margin-top: 16px; color: var(--muted); font-size: 11px; }
.floor-index { padding: 30px; }
.index-head { padding-bottom: 20px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .08em; }
.index-head button { padding: 0; border: 0; color: var(--wine); background: none; cursor: pointer; font-weight: 600; }
.floor-index ol { margin: 8px 0 0; padding: 0; list-style: none; }
.floor-index li + li { border-top: 1px solid var(--line); }
.floor-index li button { width: 100%; padding: 15px 0; border: 0; display: grid; grid-template-columns: 28px 1fr auto; align-items: center; gap: 5px; color: var(--ink); background: none; text-align: left; cursor: pointer; }
.floor-index li .num { color: var(--gold); font-size: 10px; }
.floor-index li .name { font-family: "Italiana", serif; font-size: 18px; }
.floor-index li .arrow { opacity: 0; transform: translateX(-5px); transition: .2s; }
.floor-index li button:hover .arrow, .floor-index li button:focus-visible .arrow { opacity: 1; transform: translateX(0); }
.index-note { margin: 25px 0 0; padding: 17px; color: var(--muted); background: var(--paper); border-radius: 12px; font-size: 11px; line-height: 1.55; }

.agenda-section { padding: 120px clamp(20px, 7vw, 110px); display: grid; grid-template-columns: minmax(280px, .75fr) minmax(0, 1.3fr); gap: clamp(50px, 9vw, 140px); background: #e9dfd1; }
.agenda-intro { align-self: start; position: sticky; top: 125px; }
.agenda-intro > p:not(.eyebrow) { max-width: 520px; color: var(--muted); line-height: 1.7; }
.progress-box { max-width: 420px; margin-top: 38px; padding: 22px; border: 1px solid rgba(92,16,32,.14); border-radius: 16px; background: rgba(255,253,248,.45); }
.progress-box > span { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .1em; }
.progress-box > strong { float: right; color: var(--wine); }
.progress-box strong b { font-size: 20px; }
.progress-track { clear: both; height: 4px; margin-top: 17px; border-radius: 8px; background: rgba(92,16,32,.11); overflow: hidden; }
.progress-track i { display: block; width: 0; height: 100%; background: var(--wine); transition: width .35s; }
#resetProgress { margin-top: 12px; padding: 0; border: 0; color: var(--wine); background: none; font-size: 11px; cursor: pointer; }
.p-list { counter-reset: p; border-top: 1px solid rgba(52,42,35,.18); }
.p-card { counter-increment: p; width: 100%; padding: 30px 4px; border: 0; border-bottom: 1px solid rgba(52,42,35,.18); display: grid; grid-template-columns: 48px 1fr auto; align-items: center; gap: 24px; color: var(--ink); background: transparent; text-align: left; cursor: pointer; }
.p-card::before { content: "0" counter(p); color: var(--gold); font-size: 11px; }
.p-card strong { font-family: "Italiana", serif; font-size: clamp(32px, 4vw, 55px); font-weight: 400; }
.p-card .p-meta { display: flex; align-items: center; gap: 18px; }
.p-card small { max-width: 160px; color: var(--muted); line-height: 1.4; }
.p-card .p-dot { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 50%; color: white; background: var(--p-color); transition: transform .2s; }
.p-card:hover .p-dot { transform: rotate(-8deg) scale(1.08); }
.p-card.visited strong::after { content: " ✓"; color: var(--wine); font-family: "DM Sans", sans-serif; font-size: 17px; }

footer { min-height: 120px; padding: 30px clamp(20px, 5vw, 76px); display: flex; align-items: center; justify-content: space-between; gap: 24px; color: #c7bdb5; background: #231f1d; font-size: 11px; }
.footer-brand { color: white; font-family: "Italiana", serif; font-size: 20px; }
.footer-brand span { margin-left: 8px; color: #c79c5d; font-family: "DM Sans", sans-serif; font-size: 9px; text-transform: uppercase; letter-spacing: .1em; }
footer a { text-decoration: none; }

dialog { padding: 0; border: 0; color: var(--ink); border-radius: 22px; background: var(--white); box-shadow: 0 30px 120px rgba(20,15,12,.4); }
dialog::backdrop { background: rgba(25,20,17,.72); backdrop-filter: blur(6px); }
.artist-dialog, .p-dialog { width: min(94vw, 570px); }
.dialog-close { position: absolute; z-index: 3; top: 15px; right: 16px; width: 38px; height: 38px; border: 0; border-radius: 50%; color: var(--ink); background: rgba(255,255,255,.7); font-size: 24px; line-height: 1; cursor: pointer; }
.dialog-accent, .p-dialog-color { height: 13px; background: var(--wine); }
.dialog-body { padding: clamp(30px, 6vw, 56px); }
.artist-identity { display: grid; grid-template-columns: minmax(0, 1fr) 132px; align-items: start; gap: 28px; }
.dialog-body h2 { margin: 0; font-size: clamp(45px, 8vw, 72px); line-height: .95; }
.artist-dialog-portrait { width: 132px; height: 165px; border: 1px solid rgba(173,124,50,.45); border-radius: 66px 66px 12px 12px; background-color: var(--paper); box-shadow: 0 14px 34px rgba(67,47,33,.14); }
.artist-role, .p-motto { margin: 15px 0 28px; color: var(--wine); font-size: 14px; }
.dialog-info { padding: 18px 0; display: grid; grid-template-columns: 1fr 1fr; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.dialog-info div { display: grid; gap: 5px; }
.dialog-info span, .installation-card > span { color: var(--muted); font-size: 9px; text-transform: uppercase; letter-spacing: .12em; }
.dialog-info strong { font-weight: 500; }
.artist-description { margin: 25px 0; color: var(--muted); line-height: 1.65; }
.next-room { width: 100%; }
.directory-dialog { width: min(94vw, 800px); max-height: 86vh; padding: 34px; }
.directory-head { display: flex; justify-content: space-between; }
.directory-head h2 { margin: 0 0 25px; font-size: 48px; }
.directory-dialog .dialog-close { position: static; background: var(--paper); }
.search-box { padding: 0 18px; display: flex; align-items: center; gap: 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--paper); }
.search-box input { width: 100%; padding: 15px 0; border: 0; outline: 0; background: transparent; }
.directory-results { margin-top: 18px; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; overflow: auto; max-height: 46vh; }
.directory-item { padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; display: grid; grid-template-columns: 44px 1fr auto; align-items: center; gap: 11px; background: white; cursor: pointer; text-align: left; }
.directory-photo { width: 44px; height: 52px; border-radius: 22px 22px 6px 6px; background-color: var(--paper); }
.directory-copy { min-width: 0; display: grid; gap: 3px; }
.directory-item strong { font-family: "Italiana", serif; font-size: 17px; font-weight: 400; }
.directory-copy > span { color: var(--muted); font-size: 10px; }
.directory-arrow { color: var(--gold); }
.p-dialog-color { height: 16px; background: var(--p-color, var(--wine)); }
.p-motto { font-size: 18px; }
.installation-card { margin: 25px 0; padding: 22px; border-radius: 14px; background: var(--paper); }
.installation-card strong { margin-top: 8px; display: block; font-family: "Italiana", serif; font-size: 25px; font-weight: 400; }
.installation-card p { margin-bottom: 0; color: var(--muted); line-height: 1.6; }

@media (max-width: 980px) {
  .hero { grid-template-columns: 1fr; min-height: auto; }
  .hero-card { max-width: 520px; }
  .map-layout, .agenda-section { grid-template-columns: 1fr; }
  .agenda-intro { position: static; }
  .floor-index { padding: 24px; }
}

@media (max-width: 650px) {
  .site-header { min-height: 70px; padding: 11px 16px; }
  .monogram { width: 42px; }
  .brand-copy small { display: none; }
  nav { gap: 13px; }
  nav a { font-size: 11px; }
  .hero {
    padding-top: 70px;
    background:
      linear-gradient(180deg, rgba(243,237,227,.95) 0%, rgba(243,237,227,.84) 62%, rgba(243,237,227,.94) 100%),
      url("assets/palazzo-fruscione-facciata.png") 72% center / auto 100% no-repeat;
  }
  h1 { font-size: clamp(48px, 15vw, 72px); }
  .hero-card { padding: 27px; }
  .section-heading { align-items: start; flex-direction: column; }
  .floor-tabs { overflow-x: auto; grid-template-columns: repeat(4, minmax(120px, 1fr)); }
  .map-card { min-height: 560px; padding: 20px; }
  .palazzo-ribbon { align-items: flex-start; }
  .palazzo-ribbon > div:last-child { display: block; }
  .palazzo-ribbon strong { display: block; margin-top: 3px; }
  .schematic { height: auto; }
  .schematic.informative { min-height: 370px; padding: 14px; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: 140px; gap: 10px; }
  .room { padding: 4px; }
  .room strong { font-family: "DM Sans", sans-serif; font-size: 9px; font-weight: 600; }
  .room small { display: none; }
  .informative .room { padding: 12px; grid-template-columns: 1fr auto; gap: 6px; }
  .informative .room-mark { display: none; }
  .informative .room strong { font-family: "Italiana", serif; font-size: 14px; font-weight: 400; }
  .informative .room small { display: block; }
  .agenda-section { padding-top: 90px; }
  .p-card { grid-template-columns: 32px 1fr auto; gap: 12px; }
  .p-card small { display: none; }
  .p-card .p-dot { width: 36px; height: 36px; }
  footer { align-items: start; flex-direction: column; }
  .directory-results { grid-template-columns: 1fr; }
  .artist-identity { grid-template-columns: 1fr 90px; gap: 16px; }
  .artist-dialog-portrait { width: 90px; height: 116px; border-radius: 45px 45px 9px 9px; }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; transition: none !important; }
}
