:root {
  --ink: #1B2A41;
  --paper: #F7F3EC;
  --paper-deep: #EFE8DC;
  --rose: #C98B95;
  --gold: #B08D57;
  --charcoal: #2A2622;
  --line: rgba(27, 42, 65, 0.14);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--charcoal);
  font-family: 'Work Sans', sans-serif;
  -webkit-font-smoothing: antialiased;
}

h1, h2, .eyebrow {
  font-family: 'Cormorant Garamond', serif;
}

/* ---------- HERO ---------- */
.hero {
  text-align: center;
  padding: 5rem 1.5rem 3rem;
  background:
    radial-gradient(ellipse at top, rgba(201,139,149,0.10), transparent 60%),
    var(--paper);
  border-bottom: 1px solid var(--line);
}

.eyebrow {
  font-style: italic;
  font-size: 1.05rem;
  color: var(--gold);
  letter-spacing: 0.04em;
  margin: 0 0 0.5rem;
}

.hero h1 {
  font-size: clamp(2.2rem, 5vw, 3.4rem);
  font-weight: 600;
  color: var(--ink);
  line-height: 1.15;
  margin: 0 0 1rem;
}

.hero .sub {
  font-size: 1.05rem;
  color: rgba(42,38,34,0.7);
  max-width: 32rem;
  margin: 0 auto;
}

/* ---------- UPLOAD CARD (elemento distintivo: una "cartolina" da imbucare) ---------- */
main {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.upload-card {
  position: relative;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 2.5rem 2rem 2rem;
  margin: -2.5rem auto 4rem;
  max-width: 560px;
  box-shadow: 0 24px 48px -24px rgba(27,42,65,0.25);
}

.stamp {
  position: absolute;
  top: -18px;
  right: 28px;
  width: 46px;
  height: 46px;
  background: var(--rose);
  color: #fff;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  transform: rotate(6deg);
  box-shadow: 0 6px 14px -6px rgba(201,139,149,0.6);
}

.upload-card h2 {
  margin: 0 0 1.25rem;
  font-size: 1.7rem;
  color: var(--ink);
  font-weight: 600;
}

#guestName {
  width: 100%;
  padding: 0.7rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: 4px;
  font-family: inherit;
  font-size: 0.95rem;
  margin-bottom: 1rem;
  background: var(--paper);
}
#guestName:focus { outline: 2px solid var(--rose); outline-offset: 1px; }

.dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
  padding: 2.2rem 1rem;
  border: 1.5px dashed var(--gold);
  border-radius: 6px;
  background: var(--paper-deep);
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease;
  text-align: center;
}
.dropzone:hover, .dropzone.drag-over {
  background: #f1e6d3;
  border-color: var(--rose);
}
.dz-icon {
  font-size: 1.8rem;
  color: var(--gold);
  line-height: 1;
}
.dz-text small { color: rgba(42,38,34,0.6); font-weight: 400; }

.preview-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
}
.preview-item {
  width: 64px;
  height: 64px;
  border-radius: 4px;
  overflow: hidden;
  position: relative;
  background: var(--paper-deep);
  border: 1px solid var(--line);
}
.preview-item img, .preview-item video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.preview-item .video-tag {
  position: absolute;
  bottom: 2px;
  right: 2px;
  background: rgba(27,42,65,0.75);
  color: #fff;
  font-size: 0.6rem;
  padding: 1px 4px;
  border-radius: 2px;
}

#sendBtn {
  width: 100%;
  margin-top: 1.4rem;
  padding: 0.85rem;
  border: none;
  border-radius: 4px;
  background: var(--ink);
  color: #fff;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s ease, opacity 0.2s ease;
}
#sendBtn:disabled { opacity: 0.4; cursor: not-allowed; }
#sendBtn:not(:disabled):hover { background: var(--rose); }

.status {
  min-height: 1.2rem;
  margin-top: 0.7rem;
  font-size: 0.9rem;
  text-align: center;
  color: var(--gold);
}
.status.error { color: #B5495B; }
.status.ok { color: #4A7A5D; }

/* ---------- GALLERY (bacheca fotografica) ---------- */
.gallery-section { padding-bottom: 5rem; }
.gallery-title {
  text-align: center;
  font-size: 2rem;
  color: var(--ink);
  margin-bottom: 0.2rem;
}
.gallery-sub {
  text-align: center;
  color: rgba(42,38,34,0.55);
  margin-bottom: 2rem;
  font-size: 0.95rem;
}

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 1.4rem 1.2rem;
}

.frame {
  background: #fff;
  padding: 10px 10px 28px;
  border-radius: 2px;
  box-shadow: 0 10px 20px -12px rgba(27,42,65,0.3);
  transition: transform 0.2s ease;
}
.frame:nth-child(odd) { transform: rotate(-2deg); }
.frame:nth-child(even) { transform: rotate(1.5deg); }
.frame:hover { transform: rotate(0deg) scale(1.03); z-index: 2; }

.frame img, .frame video {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  display: block;
  background: var(--paper-deep);
}

.frame .caption {
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-size: 0.85rem;
  color: var(--charcoal);
  text-align: center;
  padding-top: 8px;
}

footer {
  text-align: center;
  padding: 2rem;
  color: rgba(42,38,34,0.45);
  font-size: 0.85rem;
  border-top: 1px solid var(--line);
}

@media (prefers-reduced-motion: reduce) {
  .frame, .dropzone, #sendBtn { transition: none; }
}
