:root {
  --orange: #FF5000;
  --orange-dark: #d94300;
  --ink: #1f1a14;
  --kraft: #e9d8b4;
  --kraft-dark: #d6bf91;
  --wood: #b07a45;
  --wood-dark: #7a4f27;
  --chalk: #2f3b33;
  --cream: #fbf5e6;
  --leaf: #5f7d3a;
}

* { box-sizing: border-box; }

html, body { margin: 0; }

body {
  font-family: 'Lora', Georgia, serif;
  color: var(--ink);
  background-color: var(--kraft);
  /* kraft paper grain */
  background-image:
    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 .45 0 0 0 0 .32 0 0 0 0 .15 0 0 0 .18 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"),
    radial-gradient(ellipse at top, #f3e6c8 0%, var(--kraft) 55%, var(--kraft-dark) 100%);
  min-height: 100vh;
  line-height: 1.6;
}

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); border: 0;
}

/* ---------- Bunting (bandierine a quadretti) ---------- */
.bunting {
  position: relative;
  height: 70px;
}
.bunting::before {
  content: "";
  position: absolute;
  top: 6px; left: 0; right: 0;
  height: 4px;
  background: repeating-linear-gradient(90deg, #8a6a43 0 6px, #a3825a 6px 12px);
}
.bunting::after {
  --flag: 64px;
  content: "";
  position: absolute;
  top: 9px; left: 0; right: 0;
  height: 56px;
  background:
    repeating-linear-gradient(45deg, rgba(255,255,255,.3) 0 5px, transparent 5px 10px),
    repeating-linear-gradient(-45deg, rgba(255,255,255,.3) 0 5px, transparent 5px 10px),
    repeating-linear-gradient(90deg,
      var(--orange) 0 var(--flag),
      var(--leaf) var(--flag) calc(var(--flag) * 2),
      #c9372c calc(var(--flag) * 2) calc(var(--flag) * 3),
      #e8b23a calc(var(--flag) * 3) calc(var(--flag) * 4));
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='64' height='56'%3E%3Cpolygon points='4,0 60,0 32,54' fill='black'/%3E%3C/svg%3E") 0 0 / 64px 56px repeat-x;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='64' height='56'%3E%3Cpolygon points='4,0 60,0 32,54' fill='black'/%3E%3C/svg%3E") 0 0 / 64px 56px repeat-x;
}
/* ---------- Layout ---------- */
.page {
  max-width: 1080px;
  margin: 0 auto;
  padding: 1rem 1.25rem 3rem;
}

.hero {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.75rem;
}

.hero-logo {
  width: min(560px, 100%);
  height: auto;
  filter: drop-shadow(0 6px 0 rgba(122, 79, 39, .15));
  animation: drive-in 1.1s cubic-bezier(.2,.8,.25,1) both;
}

@keyframes drive-in {
  from { transform: translateX(-40px); opacity: 0; }
  to   { transform: none; opacity: 1; }
}

/* ---------- Lavagnetta ---------- */
.chalkboard {
  position: relative;
  background:
    radial-gradient(ellipse at 30% 20%, rgba(255,255,255,.07), transparent 60%),
    radial-gradient(ellipse at 70% 80%, rgba(255,255,255,.05), transparent 55%),
    var(--chalk);
  color: var(--cream);
  padding: 1.6rem 3rem 1.4rem;
  border: 14px solid var(--wood);
  border-image: repeating-linear-gradient(90deg, var(--wood) 0 18px, #9b6a3a 18px 22px, var(--wood) 22px 40px) 14;
  box-shadow:
    inset 0 0 25px rgba(0,0,0,.5),
    0 12px 20px -8px rgba(60, 35, 10, .45);
  transform: rotate(-1.5deg);
  max-width: 560px;
  width: 100%;
}

.nail {
  position: absolute; top: -8px;
  width: 10px; height: 10px; border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #ddd, #666);
  box-shadow: 0 1px 2px rgba(0,0,0,.5);
}
.nail-l { left: -6px; }
.nail-r { right: -6px; }

.chalk-title {
  font-family: 'Rye', 'Caveat', serif;
  font-weight: 400;
  font-size: clamp(1.7rem, 6.5vw, 3.2rem);
  overflow-wrap: anywhere;
  margin: .2rem 0;
  color: #fff7e8;
  letter-spacing: .02em;
  text-shadow: 0 0 2px rgba(255,255,255,.5), 2px 2px 0 rgba(255, 80, 0, .55);
}

.chalk-small {
  font-family: 'Caveat', cursive;
  font-size: 1.6rem;
  margin: 0;
  opacity: .85;
}

.lead {
  max-width: 680px;
  font-size: 1.2rem;
  margin: 0;
}
.lead em {
  font-family: 'Caveat', cursive;
  font-style: normal;
  font-size: 1.6em;
  color: var(--orange);
  line-height: 1;
}

/* ---------- Cassette di legno ---------- */
.crates {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 2rem;
  margin: 3.5rem 0;
}

.crate {
  position: relative;
  background:
    repeating-linear-gradient(0deg,
      transparent 0 58px,
      rgba(60, 30, 5, .45) 58px 62px),
    repeating-linear-gradient(90deg,
      rgba(255,255,255,.04) 0 3px, rgba(0,0,0,.04) 3px 7px),
    linear-gradient(180deg, #c58c54, var(--wood));
  border: 4px solid var(--wood-dark);
  border-radius: 6px;
  padding: 2.4rem 1.5rem 1.6rem;
  color: var(--cream);
  text-align: center;
  box-shadow: 0 10px 18px -8px rgba(60,35,10,.55);
  transition: transform .25s ease;
}
.crate:nth-child(1) { transform: rotate(-1deg); }
.crate:nth-child(2) { transform: rotate(.8deg); }
.crate:nth-child(3) { transform: rotate(-.6deg); }
.crate:hover { transform: rotate(0) translateY(-6px); }

.crate-label {
  position: absolute;
  top: -18px; left: 50%;
  transform: translateX(-50%) rotate(-2deg);
  background: var(--cream);
  color: var(--ink);
  font-family: 'Caveat', cursive;
  font-weight: 700;
  font-size: 1.35rem;
  padding: .1rem 1rem;
  border: 2px dashed var(--orange);
  border-radius: 4px;
  white-space: nowrap;
  box-shadow: 0 3px 5px rgba(0,0,0,.2);
}

.crate-icon {
  font-size: 2.8rem;
  line-height: 1;
  filter: drop-shadow(0 3px 0 rgba(0,0,0,.25));
}

.crate h2 {
  font-family: 'Rye', serif;
  font-weight: 400;
  font-size: 1.5rem;
  margin: .6rem 0 .4rem;
  text-shadow: 2px 2px 0 rgba(60, 30, 5, .6);
}

.crate p {
  margin: 0;
  background: rgba(251, 245, 230, .93);
  color: var(--ink);
  padding: .8rem 1rem;
  border-radius: 3px;
  font-size: .98rem;
}

/* ---------- Cartellino iscrizione ---------- */
.notify {
  display: flex;
  justify-content: center;
}

.paper-tag {
  position: relative;
  background: var(--cream);
  /* bordo a quadretti stile tovaglia */
  border: 14px solid transparent;
  border-image:
    repeating-conic-gradient(var(--orange) 0 25%, var(--cream) 0 50%) 0 / 14px 14px;
  border-image-slice: 14;
  border-image-repeat: round;
  border-image-source: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='42' height='42'%3E%3Crect width='42' height='42' fill='%23fbf5e6'/%3E%3Cg fill='%23FF5000' fill-opacity='.85'%3E%3Crect width='7' height='7'/%3E%3Crect x='14' width='7' height='7'/%3E%3Crect x='28' width='7' height='7'/%3E%3Crect y='14' width='7' height='7'/%3E%3Crect y='28' width='7' height='7'/%3E%3Crect x='35' y='14' width='7' height='7'/%3E%3Crect x='35' y='28' width='7' height='7'/%3E%3Crect x='7' y='35' width='7' height='7'/%3E%3Crect x='21' y='35' width='7' height='7'/%3E%3Crect x='35' y='35' width='7' height='7'/%3E%3Crect x='35' y='0' width='7' height='7'/%3E%3C/g%3E%3C/svg%3E");
  padding: 2rem 2rem 1.5rem;
  max-width: 620px;
  width: 100%;
  text-align: center;
  box-shadow: 0 14px 22px -10px rgba(60,35,10,.5);
  transform: rotate(.6deg);
}

.paper-tag h2 {
  font-family: 'Caveat', cursive;
  font-size: 2.2rem;
  margin: 0;
  color: var(--orange-dark);
  line-height: 1.1;
}
.paper-tag > p { margin: .5rem 0 1.2rem; }

.notify-form {
  display: flex;
  gap: .6rem;
  flex-wrap: wrap;
  justify-content: center;
}

.notify-form input {
  flex: 1 1 240px;
  font: inherit;
  font-size: 1.05rem;
  padding: .75rem 1rem;
  border: 2px solid var(--wood-dark);
  border-radius: 6px;
  background: #fffdf7;
  color: var(--ink);
}
.notify-form input:focus {
  outline: 3px solid rgba(255, 80, 0, .35);
  border-color: var(--orange);
}

.notify-form button {
  font-family: 'Rye', serif;
  font-size: 1.05rem;
  padding: .75rem 1.5rem;
  border: none;
  border-radius: 6px;
  background: var(--orange);
  color: #fff;
  cursor: pointer;
  box-shadow: 0 4px 0 var(--orange-dark);
  transition: transform .1s ease, box-shadow .1s ease, background .2s;
}
.notify-form button:hover { background: #ff6a24; }
.notify-form button:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--orange-dark); }
.notify-form button:disabled { opacity: .65; cursor: wait; }

.notify-msg {
  min-height: 1.6em;
  margin: .8rem 0 0;
  font-family: 'Caveat', cursive;
  font-size: 1.45rem;
}
.notify-msg.ok { color: var(--leaf); }
.notify-msg.error { color: #b3261e; }

/* ---------- Footer ---------- */
.footer {
  text-align: center;
  padding: 1.5rem 1rem 2rem;
  border-top: 2px dashed rgba(122, 79, 39, .45);
  max-width: 1080px;
  margin: 0 auto;
  font-family: 'Caveat', cursive;
  font-size: 1.35rem;
  color: var(--wood-dark);
}
.footer-icon { width: 54px; height: auto; }
.footer p { margin: .3rem 0 0; }

@media (max-width: 560px) {
  .chalkboard { padding: 1.2rem 1.2rem 1rem; }
  .crates { gap: 2.4rem; }
}

@media (prefers-reduced-motion: reduce) {
  .hero-logo { animation: none; }
  .crate, .crate:hover { transition: none; }
}
