:root {
  --cream: #fff8f0;
  --ink: #1a1210;
  --muted: #6b5348;
  --card: rgba(255, 250, 245, 0.94);
  --stripe-a: #c41e3a;
  --stripe-b: #f4a261;
  --stripe-c: #2a9d8f;
  --gold: #e9c46a;
  --error: #9b1c1c;
  --ok: #1f6f5a;
  --shadow: 0 18px 50px rgba(26, 18, 16, 0.18);
  --radius: 1.25rem;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Source Sans 3", system-ui, sans-serif;
  color: var(--ink);
  background: var(--cream);
  line-height: 1.55;
}

.bg-stripes {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(135deg, rgba(196, 30, 58, 0.08), transparent 45%),
    linear-gradient(225deg, rgba(42, 157, 143, 0.1), transparent 40%),
    repeating-linear-gradient(
      -12deg,
      transparent,
      transparent 28px,
      rgba(244, 162, 97, 0.12) 28px,
      rgba(244, 162, 97, 0.12) 56px
    );
  pointer-events: none;
}

.site-header {
  text-align: center;
  padding: 3rem 1.25rem 1.25rem;
}

.eyebrow {
  margin: 0 0 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.28em;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--stripe-a);
}

.site-header h1,
.app h1 {
  margin: 0;
  font-family: "Playfair Display", Georgia, serif;
  font-size: clamp(2.1rem, 7vw, 3.6rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.year {
  margin: 0.35rem 0 0;
  font-family: "Playfair Display", Georgia, serif;
  font-size: clamp(1.5rem, 4vw, 2.2rem);
  font-weight: 600;
  color: var(--stripe-c);
}

.save-the-date {
  margin: 1rem auto 0;
  display: inline-block;
  padding: 0.5rem 1.1rem;
  border: 1px solid rgba(196, 30, 58, 0.35);
  border-radius: 999px;
  background: rgba(233, 196, 106, 0.28);
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--stripe-a);
}

.gate,
.app,
.setup-banner {
  width: min(640px, calc(100% - 2rem));
  margin: 0 auto 3rem;
}

.setup-banner {
  padding-top: 3rem;
}

.card {
  background: var(--card);
  border: 1px solid rgba(26, 18, 16, 0.08);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.75rem 1.5rem;
  backdrop-filter: blur(8px);
}

.gate-card h2,
.card h2 {
  margin: 0 0 0.75rem;
  font-family: "Playfair Display", Georgia, serif;
  font-size: 1.5rem;
}

.lede {
  margin: 0 0 1.25rem;
  font-size: 1.05rem;
}

.note {
  color: var(--muted);
  font-size: 0.95rem;
}

.gate-status {
  margin: 0 0 1rem;
  padding: 0.75rem 1rem;
  border-radius: 0.75rem;
  font-weight: 600;
  background: rgba(244, 162, 97, 0.2);
  color: var(--ink);
}

.gate-status[data-kind="error"] {
  background: rgba(155, 28, 28, 0.12);
  color: var(--error);
}

.gate-status[data-kind="success"] {
  background: rgba(42, 157, 143, 0.15);
  color: var(--ok);
}

.gate-status[data-kind="checking"] {
  background: rgba(233, 196, 106, 0.35);
}

.stack-form {
  display: grid;
  gap: 1rem;
}

.stack-form label {
  display: grid;
  gap: 0.35rem;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.stack-form input {
  font: inherit;
  font-size: 1.05rem;
  font-weight: 400;
  text-transform: none;
  letter-spacing: normal;
  color: var(--ink);
  padding: 0.75rem 0.9rem;
  border-radius: 0.75rem;
  border: 1px solid rgba(26, 18, 16, 0.18);
  background: #fff;
}

.stack-form input:focus {
  outline: 2px solid var(--stripe-c);
  outline-offset: 1px;
}

.btn {
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  border-radius: 999px;
  border: 1px solid rgba(26, 18, 16, 0.15);
  background: #fff;
  color: var(--ink);
  padding: 0.75rem 1.25rem;
}

.btn:hover {
  border-color: rgba(26, 18, 16, 0.35);
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn.primary {
  background: var(--stripe-a);
  border-color: var(--stripe-a);
  color: #fff;
}

.btn.primary:hover {
  filter: brightness(1.05);
}

.btn.small {
  padding: 0.45rem 0.9rem;
  font-size: 0.9rem;
}

.mode-toggle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  margin-bottom: 1.1rem;
}

.mode-btn {
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  padding: 0.55rem 0.75rem;
  border-radius: 999px;
  border: 1px solid rgba(26, 18, 16, 0.12);
  background: rgba(255, 255, 255, 0.7);
  color: var(--muted);
}

.mode-btn.active {
  background: var(--stripe-c);
  border-color: var(--stripe-c);
  color: #fff;
}

.form-footer {
  margin: 1rem 0 0;
  text-align: center;
  font-size: 0.95rem;
}

.form-footer a,
#try-another {
  color: var(--stripe-c);
}

.form-footer a {
  font-weight: 600;
  text-decoration: none;
}

.form-footer a:hover {
  text-decoration: underline;
}

.app {
  padding-top: 1.5rem;
}

.app-bar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.app-bar .who {
  margin: 0.15rem 0 0;
  color: var(--muted);
  font-size: 0.95rem;
  word-break: break-all;
}

.app main {
  display: grid;
  gap: 1.25rem;
}

.hero .lede {
  margin: 0.75rem 0 1.5rem;
  font-size: 1.15rem;
}

.hero-figure {
  margin: -1.75rem -1.5rem 1.5rem;
  overflow: hidden;
  border-radius: var(--radius) var(--radius) 0 0;
  line-height: 0;
}

.hero-figure img {
  width: 100%;
  height: auto;
  display: block;
}

.stamp {
  margin: 0 0 0.35rem;
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.28em;
  color: var(--stripe-a);
}

.carnevale {
  position: relative;
}

.mask-art {
  display: block;
  width: min(220px, 60%);
  height: auto;
  margin: 0 auto 1.25rem;
}

.flourishes {
  margin: 1.25rem 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.9rem;
}

.flourishes li {
  padding-left: 1.4rem;
  position: relative;
}

.flourishes li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.6em;
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: var(--gold);
  border: 1px solid rgba(138, 90, 28, 0.5);
}

.details {
  margin: 0;
  display: grid;
  gap: 1rem;
}

.details div {
  display: grid;
  grid-template-columns: 5rem 1fr;
  gap: 0.75rem;
  align-items: baseline;
  padding-top: 0.85rem;
  border-top: 1px dashed rgba(26, 18, 16, 0.15);
}

.details dt {
  margin: 0;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--stripe-a);
}

.details dd {
  margin: 0;
  font-weight: 600;
}

.muted {
  font-weight: 400;
  color: var(--muted);
}

.card p {
  margin: 0 0 0.85rem;
}

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

footer {
  text-align: center;
  padding: 1.5rem 0 2.5rem;
  color: var(--muted);
  font-size: 0.9rem;
}

code {
  font-size: 0.9em;
  background: rgba(26, 18, 16, 0.06);
  padding: 0.1em 0.35em;
  border-radius: 0.3em;
}

@media (max-width: 480px) {
  .details div {
    grid-template-columns: 1fr;
    gap: 0.25rem;
  }

  .app-bar {
    flex-direction: column;
  }
}
