:root {
  --bg: #f3ead9;
  --bg-deep: #e7d8b8;
  --paper: #f8f1df;
  --ink: #1c140a;
  --ink-soft: #3a2a18;
  --muted: #76624a;
  --line: rgba(28, 20, 10, 0.18);
  --line-soft: rgba(28, 20, 10, 0.08);
  --whisky: #b6803a;
  --whisky-deep: #8a4f1c;
  --copper: #c46a2a;
  --mahogany: #4a1e10;
  --highland: #2f3d2c;
  --gold: #d4a14a;
  --gold-soft: #e8c98a;
  --shadow: 0 30px 80px rgba(74, 30, 16, 0.18);
  --radius-xl: 6px;
  --radius-lg: 4px;
  --radius-md: 4px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  font-family: "Inter", system-ui, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(ellipse at 12% 8%, rgba(212, 161, 74, 0.18), transparent 38%),
    radial-gradient(ellipse at 88% 92%, rgba(74, 30, 16, 0.16), transparent 42%),
    radial-gradient(ellipse at 78% 18%, rgba(196, 106, 42, 0.10), transparent 36%),
    linear-gradient(160deg, #f6ecd5 0%, #efe2c2 60%, #e7d6ad 100%);
}

.grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.5;
  mix-blend-mode: multiply;
  background-image:
    radial-gradient(rgba(74, 30, 16, 0.08) 1px, transparent 1.4px),
    radial-gradient(rgba(74, 30, 16, 0.05) 1px, transparent 1.4px);
  background-size: 3px 3px, 7px 7px;
  background-position: 0 0, 1px 2px;
}

.ember-layer {
  position: fixed;
  inset: 0;
  z-index: 5;
  pointer-events: none;
  overflow: hidden;
  mix-blend-mode: screen;
}

.ember {
  position: absolute;
  bottom: -20px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 215, 130, 1) 0%, rgba(220, 160, 70, 0.85) 50%, rgba(196, 106, 42, 0) 78%);
  box-shadow:
    0 0 10px rgba(220, 160, 70, 0.8),
    0 0 22px rgba(196, 106, 42, 0.5);
  opacity: 0;
  animation: ember-rise linear forwards;
  will-change: transform, opacity;
}

@keyframes ember-rise {
  0% {
    transform: translate3d(0, 0, 0) scale(0.6);
    opacity: 0;
  }
  12% {
    opacity: 1;
  }
  60% {
    transform: translate3d(calc(var(--drift, 0px) * 0.55), -55vh, 0) scale(1);
    opacity: 0.9;
  }
  100% {
    transform: translate3d(var(--drift, 0px), -110vh, 0) scale(0.4);
    opacity: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ember-layer { display: none; }
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.35;
  background-image:
    repeating-linear-gradient(
      92deg,
      rgba(122, 70, 30, 0.05) 0 2px,
      transparent 2px 9px
    ),
    repeating-linear-gradient(
      178deg,
      rgba(74, 30, 16, 0.04) 0 1px,
      transparent 1px 14px
    );
}

.shell {
  position: relative;
  z-index: 1;
  width: min(1100px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 56px;
  display: grid;
  gap: 28px;
}

.admin-shell {
  width: min(900px, calc(100% - 28px));
}

.hero-card,
.form-card,
.tasting-card,
.info-card {
  position: relative;
  overflow: hidden;
  background: var(--paper);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.hero-card {
  padding: 36px 38px 38px;
  border-radius: var(--radius-xl);
  background:
    linear-gradient(180deg, rgba(255, 250, 235, 0.6), rgba(248, 241, 223, 0.85)),
    var(--paper);
  border: 1px solid rgba(74, 30, 16, 0.16);
  border-radius: 4px;
  box-shadow:
    var(--shadow),
    inset 0 0 0 1px rgba(212, 161, 74, 0.12),
    inset 0 0 0 8px rgba(255, 250, 235, 0.4);
  outline: 1px solid rgba(74, 30, 16, 0.05);
  outline-offset: 6px;
}

.hero-noise {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.18;
  background-image:
    radial-gradient(rgba(74, 30, 16, 0.4) 0.6px, transparent 0.8px);
  background-size: 5px 5px;
}

.hero-layout {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  column-gap: 36px;
  align-items: start;
}

.hero-main {
  display: grid;
  align-content: start;
  gap: 18px;
}

.hero-side {
  display: grid;
  gap: 22px;
  padding-top: 8px;
  align-self: stretch;
}

.hero-side .bottle-card {
  height: 100%;
}

.hero-counter {
  position: absolute;
  top: 24px;
  right: 28px;
  z-index: 2;
  display: inline-grid;
  justify-items: center;
  gap: 4px;
  padding: 12px 16px;
  border: 1px solid var(--line);
  background: var(--paper);
  font-family: "Cinzel", serif;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  box-shadow: 0 8px 20px rgba(74, 30, 16, 0.14);
}

.hero-counter::before,
.hero-counter::after {
  content: "";
  position: absolute;
  left: 50%;
  width: 24px;
  height: 1px;
  background: var(--whisky);
  transform: translateX(-50%);
}

.hero-counter::before {
  top: 6px;
}

.hero-counter::after {
  bottom: 6px;
}

.hero-counter-label {
  font-size: 0.62rem;
  color: var(--whisky-deep);
  font-weight: 500;
}

.hero-counter strong {
  font-family: "Cormorant Garamond", serif;
  font-weight: 700;
  font-size: 1.6rem;
  color: var(--ink);
  line-height: 1;
}

.eyebrow,
.section-kicker {
  position: relative;
  z-index: 1;
  margin: 0;
  font-family: "Cinzel", serif;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--whisky-deep);
}

.eyebrow::before,
.eyebrow::after {
  content: "·";
  margin: 0 10px;
  color: var(--whisky);
}

h1,
h2 {
  position: relative;
  z-index: 1;
  margin: 0;
  font-family: "Cormorant Garamond", serif;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.005em;
}

h1 {
  font-size: clamp(2.8rem, 6.5vw, 5rem);
  line-height: 0.95;
  display: grid;
  gap: 6px;
}

h1 em {
  font-family: "Cormorant Garamond", serif;
  font-style: italic;
  font-weight: 500;
  font-size: 0.5em;
  letter-spacing: 0.02em;
  color: var(--whisky-deep);
}

.h1-divider {
  display: block;
  width: 80px;
  height: 1px;
  margin: 6px 0 4px;
  background: linear-gradient(90deg, var(--whisky), transparent);
}

h2 {
  font-size: clamp(1.6rem, 3.5vw, 2.4rem);
  line-height: 1.05;
  margin-top: 6px;
}

.age-statement {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  margin-top: 6px;
  padding: 12px 0;
  border-top: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
  font-family: "Cinzel", serif;
  font-size: 0.78rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
}

.age-statement strong {
  color: var(--ink);
  font-weight: 700;
  margin-left: 4px;
}

.age-statement-dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--whisky);
}

.hero-copy {
  margin: 0;
  font-family: "Cormorant Garamond", serif;
  font-size: clamp(1.05rem, 1.4vw, 1.2rem);
  line-height: 1.6;
  color: var(--ink-soft);
  max-width: 38rem;
  font-style: italic;
}

.event-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  margin-top: 10px;
}

.meta-pill {
  padding: 16px 18px;
  border: 1px solid var(--line);
  background: rgba(255, 250, 235, 0.6);
  border-radius: 3px;
}

.meta-label {
  display: block;
  margin-bottom: 6px;
  font-family: "Cinzel", serif;
  font-size: 0.62rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--whisky-deep);
}

.meta-pill strong {
  display: block;
  font-family: "Cormorant Garamond", serif;
  font-weight: 600;
  font-size: 1.2rem;
  color: var(--ink);
}

.meta-pill small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.92rem;
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 8px;
}

.calendar-button,
.submit-button,
.mini-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 50px;
  padding: 0 28px;
  border: 1px solid var(--mahogany);
  border-radius: 2px;
  font-family: "Cinzel", serif;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  text-decoration: none;
  color: #f6ecd5;
  background: linear-gradient(180deg, var(--whisky-deep), var(--mahogany));
  cursor: pointer;
  transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease;
  box-shadow: 0 6px 18px rgba(74, 30, 16, 0.22);
}

.calendar-button:hover,
.submit-button:hover,
.mini-button:hover,
.calendar-button:focus-visible,
.submit-button:focus-visible,
.mini-button:focus-visible {
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(74, 30, 16, 0.28);
  background: linear-gradient(180deg, var(--copper), var(--whisky-deep));
}

.mini-button {
  min-height: 38px;
  padding: 0 16px;
  font-size: 0.66rem;
}

/* Bottle photo */
.bottle-card {
  margin: 0;
  display: grid;
  justify-items: center;
  gap: 14px;
  padding: 18px 16px 16px;
  border: 1px solid var(--line);
  background:
    radial-gradient(ellipse at 50% 30%, rgba(255, 240, 210, 0.5), transparent 70%),
    linear-gradient(180deg, rgba(255, 250, 235, 0.4), rgba(231, 214, 173, 0.5));
  border-radius: 3px;
}

.bottle-photo {
  display: block;
  width: 100%;
  max-width: 280px;
  height: auto;
  border-radius: 2px;
  filter: drop-shadow(0 18px 28px rgba(74, 30, 16, 0.32));
}

.bottle-caption {
  margin: 0;
  font-family: "Cinzel", serif;
  font-size: 0.66rem;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--whisky-deep);
}

/* Invite note */
.invite-note {
  padding: 22px 26px 20px;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: rgba(255, 250, 235, 0.55);
  max-width: 72ch;
  margin-inline: auto;
  width: 100%;
  box-sizing: border-box;
}

.invite-note p {
  margin: 0 0 10px;
  font-family: "Cormorant Garamond", serif;
  font-size: 1.04rem;
  line-height: 1.55;
  color: var(--ink-soft);
}

.invite-note p:last-child {
  margin-bottom: 0;
}

.invite-lead {
  font-weight: 600;
  color: var(--ink) !important;
}

.invite-signoff {
  margin-top: 14px !important;
  font-style: italic;
  color: var(--whisky-deep) !important;
  font-weight: 600;
}

/* Tasting card */
.tasting-card {
  padding: 30px 32px 28px;
  border-radius: 4px;
  background:
    linear-gradient(180deg, rgba(74, 30, 16, 0.04), rgba(255, 250, 235, 0.6)),
    var(--paper);
  border: 1px solid var(--line);
}

.tasting-card h2 {
  margin-top: 6px;
}

.tasting-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
  margin-top: 20px;
  padding: 22px 0;
  border-top: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
}

.tasting-note {
  display: grid;
  gap: 8px;
}

.tasting-label {
  font-family: "Cinzel", serif;
  font-size: 0.7rem;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--whisky-deep);
  padding-bottom: 6px;
  border-bottom: 1px solid var(--whisky);
  width: fit-content;
}

.tasting-note p {
  margin: 0;
  font-family: "Cormorant Garamond", serif;
  font-size: 1.05rem;
  line-height: 1.55;
  color: var(--ink-soft);
  font-style: italic;
}

.tasting-footer {
  margin: 16px 0 0;
  font-family: "Cinzel", serif;
  font-size: 0.66rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
  text-align: center;
}

/* Form */
.content-grid {
  display: grid;
  gap: 20px;
}

.form-card {
  padding: 30px 32px;
  border-radius: 4px;
}

.section-head {
  margin-bottom: 22px;
}

.section-head p {
  margin: 10px 0 0;
  color: var(--muted);
  font-family: "Cormorant Garamond", serif;
  font-size: 1.05rem;
  font-style: italic;
}

.rsvp-form {
  display: grid;
  gap: 22px;
}

.field {
  display: grid;
  gap: 10px;
  margin: 0;
}

.is-hidden {
  display: none !important;
}

.field span,
legend {
  font-family: "Cinzel", serif;
  font-size: 0.74rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--whisky-deep);
  font-weight: 600;
}

.field-helper {
  margin: -2px 0 4px;
  font-family: "Cormorant Garamond", serif;
  font-style: italic;
  font-size: 0.98rem;
  color: var(--muted);
}

.field-hint {
  min-height: 1rem;
  margin: 0;
  color: var(--mahogany);
  font-size: 0.85rem;
  font-weight: 600;
}

.field-error .choice {
  border-color: var(--mahogany);
  box-shadow: 0 0 0 3px rgba(74, 30, 16, 0.08);
}

input[type="text"],
select,
textarea {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: rgba(255, 250, 235, 0.7);
  color: var(--ink);
  font-family: "Inter", sans-serif;
  font-size: 1rem;
  outline: none;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

input[type="text"]:focus,
select:focus,
textarea:focus {
  border-color: var(--whisky);
  box-shadow: 0 0 0 3px rgba(182, 128, 58, 0.18);
  background: #fffaee;
}

fieldset {
  padding: 0;
  border: none;
  display: grid;
  gap: 10px;
}

.choice-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.kid-choice-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.cake-choice-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.choice {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 70px;
  padding: 14px 12px;
  border: 1px solid var(--line);
  background: rgba(255, 250, 235, 0.6);
  border-radius: 2px;
  text-align: center;
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease, transform 140ms ease;
  font-family: "Cormorant Garamond", serif;
  font-size: 1.04rem;
}

.choice input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.choice span {
  position: relative;
  z-index: 1;
  font-weight: 500;
  color: var(--ink-soft);
}

.choice:hover {
  transform: translateY(-1px);
  border-color: var(--whisky);
}

.choice:has(input:checked) {
  border-color: var(--mahogany);
  background: linear-gradient(180deg, rgba(212, 161, 74, 0.18), rgba(196, 106, 42, 0.08));
  box-shadow: inset 0 0 0 1px var(--whisky);
}

.choice:has(input:checked) span {
  color: var(--mahogany);
  font-weight: 600;
}

.form-status {
  min-height: 1.4rem;
  margin: 0;
  font-family: "Cormorant Garamond", serif;
  font-style: italic;
  color: var(--muted);
}

.form-status.success {
  color: var(--highland);
  font-weight: 600;
}

.form-status.error {
  color: var(--mahogany);
  font-weight: 600;
}

.footer-note {
  margin-top: 8px;
  text-align: center;
}

.footer-note p {
  margin: 0;
  font-family: "Cinzel", serif;
  font-size: 0.66rem;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--muted);
}

/* Admin */
.admin-hero {
  padding: 28px 30px;
}

.stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.stat-box {
  padding: 14px 16px;
  border: 1px solid var(--line);
  background: rgba(255, 250, 235, 0.6);
  border-radius: 3px;
}

.stat-box span {
  display: block;
  margin-bottom: 6px;
  font-family: "Cinzel", serif;
  font-size: 0.62rem;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--whisky-deep);
}

.stat-box strong {
  font-family: "Cormorant Garamond", serif;
  font-weight: 700;
  font-size: 1.6rem;
  color: var(--ink);
}

.submission-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.submission-list {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.submission-item {
  padding: 16px 18px;
  border: 1px solid var(--line);
  background: rgba(255, 250, 235, 0.6);
  border-radius: 3px;
}

.submission-item strong {
  display: block;
  font-family: "Cormorant Garamond", serif;
  font-weight: 600;
  font-size: 1.2rem;
  color: var(--ink);
}

.admin-item-head {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
}

.admin-head-actions {
  display: inline-flex;
  gap: 8px;
  flex-wrap: wrap;
}

.submission-meta,
.submission-note {
  margin-top: 8px;
  font-size: 0.94rem;
  color: var(--muted);
}

.empty-state {
  margin: 0;
  font-family: "Cormorant Garamond", serif;
  font-style: italic;
  color: var(--muted);
}

.admin-edit-form {
  display: grid;
  gap: 14px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line-soft);
}

.admin-form-actions {
  display: grid;
}

.admin-form-status {
  min-height: 1.2rem;
}

@media (max-width: 840px) {
  .shell {
    width: min(100% - 18px, 100%);
    padding-top: 16px;
  }

  .hero-card,
  .form-card,
  .tasting-card {
    padding: 22px 20px;
  }

  .hero-layout {
    grid-template-columns: 1fr;
    row-gap: 22px;
  }

  .hero-card {
    padding-top: 28px;
  }

  .hero-main {
    text-align: center;
    justify-items: center;
  }

  .hero-main h1 {
    align-items: center;
  }

  .h1-divider {
    margin-left: auto;
    margin-right: auto;
  }

  .age-statement {
    justify-content: center;
  }

  .hero-copy {
    margin-left: auto;
    margin-right: auto;
  }

  .event-meta {
    text-align: center;
  }

  .cta-row {
    justify-content: center;
  }

  .hero-counter {
    position: absolute;
    top: 14px;
    right: 14px;
    padding: 6px 10px 5px;
    border: 1px solid var(--line);
    background: var(--paper);
    box-shadow: 0 4px 10px rgba(74, 30, 16, 0.1);
  }

  .hero-counter::before,
  .hero-counter::after {
    width: 16px;
  }

  .hero-counter::before { top: 4px; }
  .hero-counter::after { bottom: 4px; }

  .hero-counter-label {
    font-size: 0.46rem;
    letter-spacing: 0.16em;
  }

  .hero-counter strong {
    font-size: 0.95rem;
  }

  .hero-main {
    padding-top: 38px;
  }

  .invite-note,
  .tasting-card,
  .form-card .section-head {
    text-align: center;
  }

  .tasting-label {
    margin-left: auto;
    margin-right: auto;
  }

  .tasting-grid {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .choice-grid,
  .cake-choice-grid {
    grid-template-columns: 1fr;
  }

  .kid-choice-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .stats {
    grid-template-columns: 1fr 1fr;
  }

  .age-statement {
    gap: 10px;
    font-size: 0.7rem;
  }

  h1 {
    font-size: clamp(2.4rem, 9vw, 3.4rem);
  }
}
