/* Palette: "salvia" è attiva (data-pal su <body> in index.html). Valori possibili: kraft (default senza attributo), salvia, cipria. */
:root {
  --bg: #cdb08a; --card: #d4b892; --card2: #d9bf9a; --ink: #24304d; --accent: #3f6b5c;
  --light: #e8d7bb; --accentLight: #a9c8b8; --paper: #f3e7d2; --hero: #2a3550; --stamp: #3f6b5c;
  --noise: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .3 0 0 0 0 .2 0 0 0 0 .1 0 0 0 .22 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  --script: 'Allura', cursive;
  --hand: 'Amatic SC', cursive;
  --mono: 'DM Mono', monospace;
}
[data-pal="salvia"] { --bg: #d6d1bd; --card: #e2dcc8; --card2: #e7e1ce; --ink: #3b4636; --accent: #b0583a; --light: #efe7d4; --accentLight: #e9b497; --paper: #f6f0e2; --hero: #5a6b52; --stamp: #6f8f5e; }
[data-pal="cipria"] { --bg: #e3c9bd; --card: #ecd6cb; --card2: #efdcd2; --ink: #5b2233; --accent: #8c5a36; --light: #f6e7dd; --accentLight: #f1c3b2; --paper: #faf0ea; --hero: #6d2e40; --stamp: #8c5a36; }

html { scroll-behavior: smooth; }
body {
  margin: 0; min-height: 100vh;
  color: var(--ink);
  font-family: 'Cormorant Garamond', Georgia, serif; font-size: 19px; line-height: 1.55;
  background: var(--noise) 0 0 / 220px 220px, var(--bg);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--ink); text-decoration: none; }
a:hover { color: var(--accent); }
input, textarea, select, button { font: inherit; color: inherit; }
::selection { background: var(--ink); color: var(--light); }
img { display: block; }

.script { font-family: var(--script); font-weight: 400; line-height: 1; }
.hand { font-family: var(--hand); font-weight: 700; letter-spacing: .05em; }
.hand-light { font-family: var(--hand); font-weight: 400; letter-spacing: .05em; }
.textured { background: var(--noise) 0 0 / 220px 220px, var(--card); }

.pill {
  display: inline-block; padding: 10px 30px; border: 2px solid var(--ink); border-radius: 999px;
  font-family: var(--hand); font-weight: 700; font-size: 26px; letter-spacing: .06em;
  transition: background .15s, color .15s;
}
.pill:hover { background: var(--ink); color: var(--card); }
.pill--light { border-color: var(--light); color: var(--light); }
.pill--light:hover { background: var(--light); color: var(--ink); }

/* ---------- Nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 10;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 28px;
  padding: 14px clamp(20px, 5vw, 56px);
  background: color-mix(in srgb, var(--bg) 94%, transparent); backdrop-filter: blur(4px);
  border-bottom: 1px solid color-mix(in srgb, var(--ink) 18%, transparent);
}
.nav__logo { font-family: var(--script); font-size: 34px; line-height: 1; }
.nav__links { display: flex; flex-wrap: wrap; gap: 6px 26px; font-family: var(--hand); font-weight: 700; font-size: 24px; letter-spacing: .04em; }
.nav__links .rsvp-link { color: var(--accent); }

/* ---------- Hero (cartolina, variante B del design) ---------- */
.hero {
  background: var(--noise) 0 0 / 220px 220px, var(--hero);
  padding: clamp(56px, 9vw, 110px) clamp(16px, 4vw, 40px);
  display: flex; flex-direction: column; align-items: center; gap: 36px; overflow: hidden;
}
.postcard {
  width: 100%; max-width: 980px; box-sizing: border-box; border-radius: 6px;
  padding: clamp(14px, 2vw, 22px);
  display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: clamp(18px, 3vw, 32px);
  box-shadow: 0 30px 60px rgba(20, 12, 4, .5), 0 4px 10px rgba(20, 12, 4, .3);
  transform: rotate(-1deg);
}
.postcard__photo { width: 100%; height: 100%; min-height: 340px; max-height: 560px; object-fit: cover; object-position: center 60%; }
.postcard__back {
  position: relative; display: flex; flex-direction: column;
  padding: 6px 4px 4px clamp(16px, 3vw, 28px);
  border-left: 2px dashed color-mix(in srgb, var(--ink) 35%, transparent);
}
.postcard__marks { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.postmark {
  flex: none; width: 92px; height: 92px; border-radius: 50%;
  border: 2px solid color-mix(in srgb, var(--ink) 70%, transparent);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  transform: rotate(-14deg);
  font-family: var(--hand); font-weight: 700; font-size: 16px; letter-spacing: .05em; line-height: 1;
  color: color-mix(in srgb, var(--ink) 80%, transparent);
}
.postmark span + span { font-size: 22px; }
/* Bordo dentellato del francobollo: maschera a cerchi lungo il perimetro. */
.stamp {
  flex: none; width: 81px; height: 99px; padding: 8px; box-sizing: border-box;
  background: var(--stamp); transform: rotate(3deg);
  -webkit-mask: linear-gradient(#000, #000) center / calc(100% - 8px) calc(100% - 8px) no-repeat, radial-gradient(circle at center, transparent 3.2px, #000 3.6px) -4.5px -4.5px / 9px 9px;
  mask: linear-gradient(#000, #000) center / calc(100% - 8px) calc(100% - 8px) no-repeat, radial-gradient(circle at center, transparent 3.2px, #000 3.6px) -4.5px -4.5px / 9px 9px;
}
.stamp__inner { width: 100%; height: 100%; box-sizing: border-box; padding: 5px; background: var(--paper); border: 1px solid color-mix(in srgb, var(--stamp) 60%, transparent); }
.stamp__inner img { width: 100%; height: 100%; object-fit: contain; }
.postcard__kicker { font-family: var(--hand); font-weight: 700; font-size: 24px; letter-spacing: .12em; margin-top: 18px; }
.postcard h1 { margin: 0; font-size: clamp(54px, 7vw, 76px); }
.postcard__lines { display: flex; flex-direction: column; margin-top: 14px; }
.postcard__lines div { border-bottom: 1.5px solid color-mix(in srgb, var(--ink) 45%, transparent); padding: 6px 0 2px; font-family: var(--hand); font-size: 26px; line-height: 1.2; letter-spacing: .05em; }
.postcard__lines .date { font-weight: 700; font-size: 30px; line-height: 1.15; }
.countdown { margin-top: 14px; font-style: italic; }

/* ---------- Sezioni ---------- */
.split {
  max-width: 1080px; margin: 0 auto; padding: clamp(64px, 10vw, 120px) clamp(20px, 5vw, 56px);
  display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 48px; align-items: center;
}
.split h2 { margin: 0 0 18px; font-size: clamp(52px, 7vw, 72px); }
.split p { margin: 0 0 16px; text-wrap: pretty; }
.frame {
  border-radius: 18px; overflow: hidden; box-shadow: 0 12px 30px rgba(40, 25, 10, .2);
  background: color-mix(in srgb, var(--bg) 85%, var(--ink));
  display: flex; align-items: center; justify-content: center;
}
.frame img { width: 100%; height: 100%; object-fit: cover; }
.frame--portrait { aspect-ratio: 4 / 5; transform: rotate(1.2deg); }
.frame--landscape { aspect-ratio: 4 / 3; transform: rotate(-1deg); }
.frame__empty { font-style: italic; opacity: .6; padding: 20px; text-align: center; }

.band {
  padding: clamp(64px, 10vw, 110px) clamp(20px, 5vw, 56px);
  background: color-mix(in srgb, var(--ink) 5%, transparent);
  border-block: 1px solid color-mix(in srgb, var(--ink) 15%, transparent);
}
.band__inner { max-width: 820px; margin: 0 auto; }
.section-title { margin: 0 0 8px; text-align: center; font-size: clamp(52px, 8vw, 80px); }
.section-sub { margin: 0 auto 56px; text-align: center; font-style: italic; max-width: 440px; }

/* ---------- Timeline alternata ---------- */
.timeline__row { display: grid; grid-template-columns: minmax(0, 1fr) 56px minmax(0, 1fr); min-height: 130px; }
.timeline__side { display: flex; align-items: flex-start; padding-top: 4px; }
.timeline__side--l { justify-content: flex-end; text-align: right; }
.timeline__side--r { justify-content: flex-start; }
.timeline__axis { position: relative; }
.timeline__axis::before { content: ""; position: absolute; left: 50%; top: 0; bottom: 0; width: 2px; margin-left: -1px; background: var(--ink); }
.timeline__axis::after { content: ""; position: absolute; top: 22px; width: 24px; height: 2px; background: var(--ink); }
.timeline__row--l .timeline__axis::after { right: 50%; }
.timeline__row--r .timeline__axis::after { left: 50%; }
.timeline__what { font-family: var(--hand); font-weight: 700; font-size: clamp(26px, 4vw, 34px); line-height: 1.05; letter-spacing: .04em; }
.timeline__icon { flex: none; width: 84px; height: 84px; object-fit: contain; margin: 0 8px; }

/* ---------- Luogo ---------- */
.venue__name { font-family: var(--hand); font-weight: 700; font-size: 34px; line-height: 1.1; letter-spacing: .04em; }
.split .venue__addr { margin: 6px 0 18px; }
.split .venue__note { margin-bottom: 24px; }
.pill--sm { padding: 8px 26px; font-size: 24px; }
.pill--sm:hover { color: var(--bg); }

/* ---------- Info ---------- */
.info { padding: clamp(64px, 10vw, 110px) clamp(20px, 5vw, 56px); background: var(--ink); color: var(--light); }
.info__inner { max-width: 1080px; margin: 0 auto; }
.info .section-title { margin-bottom: 48px; color: var(--light); }
.info__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 40px 48px; }
.info__label { font-family: var(--hand); font-weight: 700; font-size: 32px; letter-spacing: .05em; color: var(--accentLight); }
.info p { margin: 6px 0 0; text-wrap: pretty; }

/* ---------- RSVP ---------- */
.rsvp { padding: clamp(64px, 10vw, 120px) 20px; display: flex; justify-content: center; }
.rsvp__card {
  width: 100%; max-width: 620px; box-sizing: border-box; border-radius: 22px;
  padding: clamp(32px, 6vw, 52px);
  background: var(--noise) 0 0 / 220px 220px, var(--card2);
  box-shadow: 0 18px 40px rgba(40, 25, 10, .22);
}
.rsvp__card h2 { margin: 0; text-align: center; font-size: clamp(52px, 8vw, 72px); }
.rsvp__intro { text-align: center; margin: 6px 0 30px; font-style: italic; text-wrap: pretty; }
.rsvp form { display: flex; flex-direction: column; gap: 20px; }
.rsvp__fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 20px; }
.field { display: flex; flex-direction: column; gap: 4px; }
.field > span { font-family: var(--hand); font-weight: 700; font-size: 24px; letter-spacing: .05em; }
.line-input {
  background: transparent; border: none; border-bottom: 2px solid var(--ink);
  padding: 6px 2px; font-size: 20px; outline: none; width: 100%; box-sizing: border-box;
}
.line-input:focus { border-bottom-color: var(--accent); }
.notice { margin: 0; padding: 12px 16px; border: 1.5px dashed var(--ink); border-radius: 12px; font-size: 17px; text-wrap: pretty; }
.btn {
  padding: 12px; border: none; border-radius: 999px; background: var(--ink); color: var(--light); cursor: pointer;
  font-family: var(--hand); font-weight: 700; font-size: 28px; letter-spacing: .08em; transition: background .15s;
}
.btn:hover { background: var(--accent); }
.btn:disabled { opacity: .6; cursor: wait; }
.btn-link { background: none; border: none; border-bottom: 1px solid var(--ink); cursor: pointer; font-size: 17px; padding: 0; color: var(--ink); }
.rsvp__step { display: flex; flex-direction: column; gap: 22px; margin-top: 14px; }
.rsvp__hello { text-align: center; }
.rsvp__hello .hand { font-size: 32px; }
.rsvp__hello p { margin: 2px 0 0; font-style: italic; text-wrap: pretty; }
.members { display: flex; flex-direction: column; gap: 14px; }
.member {
  display: flex; flex-direction: column; gap: 12px; padding: 16px 18px; border-radius: 16px;
  background: color-mix(in srgb, var(--paper) 55%, transparent);
  border: 1.5px solid color-mix(in srgb, var(--ink) 18%, transparent);
}
.member__top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; }
.member__name { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; font-size: 22px; font-weight: 500; }
.tag { font-family: var(--mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; padding: 2px 8px; border: 1px solid var(--ink); border-radius: 999px; }
.choice { display: flex; gap: 6px; }
.choice button {
  min-width: 84px; padding: 6px 14px; border: 2px solid var(--ink); border-radius: 999px;
  background: transparent; color: var(--ink); cursor: pointer; font-family: var(--hand); font-weight: 700; font-size: 22px;
}
.choice button[aria-pressed="true"] { background: var(--ink); color: var(--card2); }
.member .field > span { font-family: inherit; font-weight: 400; font-style: italic; font-size: 16px; letter-spacing: 0; }
.member .line-input { font-size: 18px; border-bottom-width: 1.5px; }
.warn { margin: 0; text-align: center; font-style: italic; color: var(--accent); }
.summary { display: flex; flex-direction: column; text-align: left; border-top: 1.5px solid color-mix(in srgb, var(--ink) 25%, transparent); }
.summary > div { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding: 10px 2px; border-bottom: 1.5px solid color-mix(in srgb, var(--ink) 25%, transparent); }
.summary .who { display: flex; flex-direction: column; font-size: 20px; }
.summary .who i { font-size: 15px; }
.summary .status { flex: none; font-family: var(--hand); font-weight: 700; font-size: 22px; letter-spacing: .05em; }

/* ---------- Footer ---------- */
.footer { padding: 48px 20px 56px; text-align: center; border-top: 1px solid color-mix(in srgb, var(--ink) 18%, transparent); }
.footer .script { font-size: 48px; }
.footer .hand { font-size: 24px; letter-spacing: .08em; margin-top: 6px; }
.footer .mail { margin-top: 10px; font-size: 16px; font-style: italic; }

[hidden] { display: none !important; }

@media (max-width: 560px) {
  .timeline__icon { width: 56px; height: 56px; }
  .timeline__row { grid-template-columns: minmax(0, 1fr) 36px minmax(0, 1fr); }
  .timeline__axis::after { width: 14px; }
}
