/* ─────────────────────────────────────────────────────────────────────────
   Save the Date — John & Erika
   Three stylistic directions toggled via [data-theme]:
     postcard  → vintage Aloha postcard
     garden    → modern editorial garden party
     twilight  → moody evening lūʻau
   ────────────────────────────────────────────────────────────────────── */

:root {
  --maxw: 1100px;
  --rad: 18px;
  --rad-sm: 10px;
  --shadow-card: 0 24px 60px -28px rgba(31, 22, 14, .35),
                 0 2px 0 rgba(255,255,255,.5) inset;
  --ease: cubic-bezier(.22,.61,.36,1);

  /* postcard defaults */
  --bg:        #f0e1c2;
  --paper:     #f7ecd2;
  --ink:       #2a1d14;
  --ink-mute:  #6b5641;
  --primary:   #b2422c;   /* sunset terracotta */
  --secondary: #1f5e4a;   /* jade */
  --accent:    #d99524;   /* honey */
  --accent-2:  #e8c98a;
  --rule:      #c9a878;
  --paper-grain: 0.06;

  --font-display: "Abril Fatface", "DM Serif Display", Georgia, serif;
  --font-body: "Karla", ui-sans-serif, system-ui, -apple-system, sans-serif;
  --font-hand: "Caveat", "Bradley Hand", cursive;
  --display-letter: 0em;
  --display-line: .95;
}

[data-theme="garden"] {
  --bg:        #f5f1e6;
  --paper:     #fbf8ef;
  --ink:       #1f2a1f;
  --ink-mute:  #5a6a55;
  --primary:   #5a7a4a;
  --secondary: #d76a52;
  --accent:    #c98a3a;
  --accent-2:  #ead9b9;
  --rule:      #b7c4a4;
  --paper-grain: 0.04;

  --font-display: "Cormorant Garamond", "DM Serif Display", Georgia, serif;
  --font-body: "Karla", ui-sans-serif, system-ui, sans-serif;
  --font-hand: "Caveat", cursive;
  --display-letter: -.01em;
  --display-line: 1.0;
}

[data-theme="twilight"] {
  --bg:        #0f2e2c;
  --paper:     #143734;
  --ink:       #f4e6c8;
  --ink-mute:  #b9a888;
  --primary:   #e8a64a;
  --secondary: #d76a52;
  --accent:    #f4e6c8;
  --accent-2:  #2a4b46;
  --rule:      #355c54;
  --paper-grain: 0.10;

  --font-display: "Italiana", "Cormorant Garamond", serif;
  --font-body: "Karla", ui-sans-serif, system-ui, sans-serif;
  --font-hand: "Caveat", cursive;
  --display-letter: .01em;
  --display-line: 1.0;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--bg);
  background-image:
    radial-gradient(ellipse at 10% 0%, color-mix(in oklab, var(--accent) 18%, transparent), transparent 55%),
    radial-gradient(ellipse at 100% 100%, color-mix(in oklab, var(--secondary) 14%, transparent), transparent 55%);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  line-height: 1.55;
  font-size: 17px;
  overflow-x: hidden;
}

/* paper grain overlay */
body::before {
  content: "";
  position: fixed; inset: 0; pointer-events: none; z-index: 1;
  opacity: var(--paper-grain);
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='220' height='220'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' seed='4'/><feColorMatrix values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 .9 0'/></filter><rect width='220' height='220' filter='url(%23n)'/></svg>");
  mix-blend-mode: multiply;
}
[data-theme="twilight"] body::before { mix-blend-mode: screen; }

/* ──────────── Type ──────────── */
.h-display {
  font-family: var(--font-display);
  font-weight: 400;
  letter-spacing: var(--display-letter);
  line-height: var(--display-line);
  margin: 0;
}
.h-script {
  font-family: var(--font-hand);
  font-weight: 400;
  line-height: 1;
}
.eyebrow {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 12px;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--primary);
}
.eyebrow.muted { color: var(--ink-mute); }

a { color: inherit; }

/* ──────────── Page scaffold ──────────── */
.page {
  position: relative;
  z-index: 2;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 28px clamp(20px, 4vw, 56px) 0;
}
.section {
  padding: clamp(64px, 9vw, 120px) 0;
  position: relative;
}
.section + .section { border-top: 1px dashed var(--rule); }

/* ──────────── Top navbar / wordmark ──────────── */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 6px 0 36px;
  font-size: 12px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ink-mute);
}
.topbar .mark {
  display: inline-flex; align-items: center; gap: 10px;
  color: var(--ink);
  font-weight: 600;
}
.topbar .dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 0 0 4px color-mix(in oklab, var(--primary) 22%, transparent);
}
.topbar nav { display: flex; gap: 22px; }
.topbar nav a {
  text-decoration: none; color: inherit;
  transition: color .2s var(--ease);
}
.topbar nav a:hover { color: var(--primary); }

/* ──────────── Hero ──────────── */
.hero {
  position: relative;
  padding: clamp(40px, 7vw, 88px) 0 clamp(60px, 10vw, 130px);
  display: grid;
  grid-template-columns: 1fr;
  gap: 28px;
}
.hero-stack { display: grid; gap: 22px; justify-items: start; }
.hero-meta {
  display: flex; gap: 18px; align-items: center; flex-wrap: wrap;
  color: var(--ink-mute);
  font-size: 13px;
  letter-spacing: .18em;
  text-transform: uppercase;
}
.hero-meta b { color: var(--ink); font-weight: 700; letter-spacing: .18em; }
.hero-meta .sep {
  width: 5px; height: 5px; border-radius: 50%; background: var(--rule);
}
.hero-title {
  font-size: clamp(78px, 14vw, 220px);
  color: var(--ink);
}
.hero-title .amp {
  font-family: var(--font-hand);
  font-size: .9em;
  color: var(--primary);
  font-style: italic;
  display: inline-block;
  transform: translateY(.1em);
  margin: 0 .05em;
}
.hero-sub {
  font-family: var(--font-hand);
  font-size: clamp(28px, 3.5vw, 44px);
  color: var(--primary);
  line-height: 1.1;
  max-width: 26ch;
  transform: rotate(-1.5deg);
}
[data-theme="garden"] .hero-sub { color: var(--secondary); }
[data-theme="twilight"] .hero-sub { color: var(--primary); }

.hero-tag {
  display: inline-flex; align-items: center; gap: 14px;
  padding: 8px 16px 8px 8px;
  border: 1px solid var(--rule);
  border-radius: 999px;
  font-size: 13px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--ink-mute);
  background: color-mix(in oklab, var(--paper) 60%, transparent);
}
.hero-tag .pip {
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--primary);
  display: inline-grid; place-items: center;
  color: var(--paper); font-size: 11px; font-weight: 700;
}

.hero-row {
  display: grid; gap: clamp(20px, 4vw, 56px);
  grid-template-columns: 1.4fr 1fr;
  align-items: end;
}
@media (max-width: 820px) {
  .hero-row { grid-template-columns: 1fr; }
}

/* polaroid / image slot */
.polaroid {
  position: relative;
  padding: 14px 14px 56px;
  background: var(--paper);
  border: 1px solid color-mix(in oklab, var(--ink) 8%, transparent);
  box-shadow: var(--shadow-card);
  transform: rotate(3deg);
  transition: transform .35s var(--ease);
  max-width: 360px;
  justify-self: end;
}
.polaroid:hover { transform: rotate(0) translateY(-4px); }
.polaroid .photo-slot {
  width: 100%;
  aspect-ratio: 4/5;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: color-mix(in oklab, var(--accent-2) 35%, transparent);
  border: 1.5px dashed var(--rule);
  border-radius: 2px;
  color: var(--ink-mute);
  text-align: center;
  padding: 16px;
}
.polaroid .photo-slot-cap {
  font-family: var(--font-hand);
  font-size: 18px;
  color: var(--ink-mute);
  opacity: .8;
}
.polaroid .cap {
  position: absolute; left: 0; right: 0; bottom: 14px;
  text-align: center;
  font-family: var(--font-hand);
  font-size: 22px;
  color: var(--ink-mute);
}
[data-theme="twilight"] .polaroid { background: var(--paper); }
[data-theme="twilight"] .polaroid .cap { color: var(--ink-mute); }

.tape {
  position: absolute;
  width: 90px; height: 22px;
  background: color-mix(in oklab, var(--accent-2) 70%, white);
  opacity: .75;
  top: -8px; left: 50%;
  transform: translateX(-50%) rotate(-3deg);
}

/* corner ornaments */
.corner-orn {
  position: absolute; pointer-events: none;
  color: var(--primary);
  opacity: .55;
}
.corner-orn.tl { top: 0; left: -6px; transform: rotate(-8deg); }
.corner-orn.br { bottom: 0; right: -6px; transform: rotate(172deg); }

/* date stamp */
.stamp {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 168px; height: 168px;
  border: 2px solid var(--primary);
  border-radius: 50%;
  color: var(--primary);
  background:
    radial-gradient(circle, transparent 62%, color-mix(in oklab, var(--primary) 12%, transparent) 64%);
  transform: rotate(-8deg);
  text-align: center;
  padding: 6px;
  font-family: var(--font-body);
  letter-spacing: .14em;
  text-transform: uppercase;
}
.stamp::before, .stamp::after {
  content: ""; position: absolute; inset: 8px;
  border: 1px dashed currentColor;
  border-radius: 50%;
  opacity: .5;
}
.stamp::after { inset: 14px; border-style: dotted; }
.stamp .big {
  font-family: var(--font-display);
  font-size: 46px;
  line-height: 1;
  color: inherit;
  letter-spacing: 0;
}
.stamp .small { font-size: 10px; }

/* ──────────── Section header pattern ──────────── */
.sec-head {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: end;
  gap: 22px;
  margin-bottom: clamp(28px, 4vw, 48px);
}
.sec-head .num {
  font-family: var(--font-display);
  font-size: 64px;
  line-height: .8;
  color: var(--primary);
  opacity: .9;
}
.sec-head .t {
  border-bottom: 1px solid var(--rule);
  padding-bottom: 18px;
  display: grid; gap: 6px;
}
.sec-head h2 {
  font-family: var(--font-display);
  font-size: clamp(34px, 5vw, 62px);
  margin: 0; line-height: 1.02;
}

/* ──────────── Story ──────────── */
.story {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(28px, 4vw, 56px);
  align-items: start;
}
@media (max-width: 760px) { .story { grid-template-columns: 1fr; } }
.story p {
  font-size: 18px;
  line-height: 1.65;
  max-width: 56ch;
}
.story .lead {
  font-family: var(--font-display);
  font-size: clamp(28px, 3.6vw, 42px);
  line-height: 1.15;
}
.story .lead em {
  font-family: var(--font-hand);
  font-style: normal;
  color: var(--primary);
  font-size: 1.2em;
}
.fact-list {
  list-style: none; padding: 0; margin: 0;
  display: grid; gap: 18px;
}
.fact-list li {
  display: grid;
  grid-template-columns: 24px 1fr;
  gap: 14px; align-items: start;
}
.fact-list li .bul {
  margin-top: 6px;
  color: var(--primary);
}
.fact-list strong { color: var(--ink); }

/* ──────────── Plan / Cards ──────────── */
.cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(16px, 2.4vw, 28px);
}
@media (max-width: 760px) { .cards { grid-template-columns: 1fr; } }
.card {
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: var(--rad);
  padding: 26px 24px 28px;
  display: grid; gap: 14px;
  position: relative;
  transition: transform .25s var(--ease), box-shadow .25s var(--ease);
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-card); }
.card .icon {
  width: 56px; height: 56px;
  display: inline-grid; place-items: center;
  color: var(--primary);
  border: 1px dashed var(--rule);
  border-radius: 50%;
  background: color-mix(in oklab, var(--accent-2) 30%, transparent);
}
.card h3 {
  font-family: var(--font-display);
  font-size: 28px;
  margin: 0;
}
.card p { margin: 0; color: var(--ink-mute); }
.card .when {
  font-family: var(--font-hand);
  font-size: 22px;
  color: var(--primary);
  margin-top: -4px;
}

/* ──────────── The Day (single-day plan) ──────────── */
.day { display: grid; gap: clamp(20px, 3vw, 36px); }

.day-banner {
  display: flex; flex-wrap: wrap; align-items: baseline;
  gap: 14px 24px;
  padding: clamp(20px, 3vw, 32px) clamp(22px, 3.5vw, 40px);
  background: color-mix(in oklab, var(--accent-2) 35%, transparent);
  border: 1px dashed var(--rule);
  border-radius: var(--rad);
}
[data-theme="twilight"] .day-banner {
  background: color-mix(in oklab, var(--accent-2) 60%, transparent);
}
.day-banner-eyebrow {
  font-size: 12px; letter-spacing: .22em; text-transform: uppercase;
  color: var(--ink-mute); font-weight: 600;
}
.day-banner-date {
  font-family: var(--font-display);
  font-size: clamp(30px, 4.6vw, 56px);
  line-height: 1;
  color: var(--ink);
}
.day-banner-tail {
  font-family: var(--font-hand);
  font-size: clamp(22px, 2.6vw, 30px);
  color: var(--primary);
  flex: 1; min-width: 240px;
}

.moments {
  list-style: none; padding: 0; margin: 0;
  display: grid; gap: 0;
  border-top: 1px solid var(--rule);
}
.moments li {
  display: grid;
  grid-template-columns: 180px 28px 1fr;
  align-items: center;
  gap: 16px;
  padding: 22px 6px;
  border-bottom: 1px solid var(--rule);
}
.moments-time {
  font-family: var(--font-display);
  font-size: clamp(22px, 2.6vw, 32px);
  color: var(--primary);
  line-height: 1;
}
.moments-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--primary);
  justify-self: center;
  box-shadow: 0 0 0 5px color-mix(in oklab, var(--primary) 18%, transparent);
}
.moments-what {
  font-size: clamp(17px, 1.5vw, 19px);
  color: var(--ink-mute);
  line-height: 1.5;
}
.moments-what b {
  color: var(--ink); font-weight: 700; margin-right: 2px;
}
@media (max-width: 600px) {
  .moments li { grid-template-columns: 110px 18px 1fr; gap: 12px; padding: 18px 4px; }
}

.day-note {
  margin: 6px 0 0;
  text-align: center;
  font-family: var(--font-hand);
  font-size: clamp(22px, 2.4vw, 28px);
  color: var(--ink-mute);
}

/* ──────────── RSVP ──────────── */
.rsvp-wrap {
  background: var(--paper);
  border-radius: var(--rad);
  border: 1px solid var(--rule);
  padding: clamp(28px, 5vw, 56px);
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-card);
}
.rsvp-wrap::before,
.rsvp-wrap::after {
  content: ""; position: absolute;
  pointer-events: none;
  width: 220px; height: 220px;
  opacity: .14;
  background: radial-gradient(closest-side, var(--primary), transparent 70%);
}
.rsvp-wrap::before { top: -120px; left: -80px; }
.rsvp-wrap::after  { bottom: -140px; right: -100px; background: radial-gradient(closest-side, var(--secondary), transparent 70%); }

.rsvp-head {
  display: grid; gap: 8px; margin-bottom: 28px;
  position: relative; z-index: 1;
}
.rsvp-head h2 {
  font-family: var(--font-display);
  font-size: clamp(34px, 4.8vw, 56px);
  margin: 0; line-height: 1;
}
.rsvp-head .hand {
  font-family: var(--font-hand);
  font-size: 28px;
  color: var(--primary);
  margin-top: 4px;
}

.lock-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  position: relative; z-index: 1;
}
.lock-hint {
  font-size: 13px;
  color: var(--ink-mute);
  margin-top: 12px;
  display: flex; align-items: center; gap: 8px;
}

.field {
  display: grid; gap: 6px;
  font-size: 13px;
  color: var(--ink-mute);
  letter-spacing: .04em;
}
.field > label {
  text-transform: uppercase;
  letter-spacing: .14em;
  font-size: 11px;
  font-weight: 600;
}
.field > .req { color: var(--primary); margin-left: 4px; }
.input, .stepper input, .stepper button {
  font-family: var(--font-body);
}
.input {
  height: 48px;
  padding: 0 16px;
  font-size: 16px;
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 12px;
  color: var(--ink);
  width: 100%;
  outline: none;
  transition: border-color .15s var(--ease), background .15s var(--ease), box-shadow .15s var(--ease);
}
.input:focus {
  border-color: var(--primary);
  background: color-mix(in oklab, var(--paper) 90%, white);
  box-shadow: 0 0 0 4px color-mix(in oklab, var(--primary) 18%, transparent);
}
.input.err {
  border-color: var(--secondary);
  box-shadow: 0 0 0 4px color-mix(in oklab, var(--secondary) 18%, transparent);
}
[data-theme="twilight"] .input { background: color-mix(in oklab, var(--paper) 80%, black); color: var(--ink); }

.btn {
  appearance: none; border: 0; cursor: pointer;
  height: 48px;
  padding: 0 22px;
  border-radius: 12px;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 14px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--paper);
  background: var(--ink);
  transition: transform .15s var(--ease), background .15s var(--ease);
  display: inline-flex; align-items: center; gap: 10px;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); background: var(--primary); }
.btn:active { transform: translateY(0); }
.btn.primary { background: var(--primary); color: var(--paper); }
.btn.primary:hover { background: var(--ink); }
.btn.ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--rule);
}
.btn.ghost:hover { background: color-mix(in oklab, var(--primary) 12%, transparent); color: var(--ink); }

.error {
  color: var(--secondary);
  font-size: 13px;
  margin-top: 10px;
  display: flex; align-items: center; gap: 8px;
  letter-spacing: .04em;
}

@keyframes shake {
  10%, 90% { transform: translateX(-1px); }
  20%, 80% { transform: translateX(2px); }
  30%, 50%, 70% { transform: translateX(-4px); }
  40%, 60% { transform: translateX(4px); }
}
.shake { animation: shake .45s cubic-bezier(.36,.07,.19,.97); }

/* Stepper */
.stepper {
  display: inline-flex; align-items: center;
  height: 48px;
  border: 1px solid var(--rule);
  border-radius: 12px;
  background: var(--paper);
  overflow: hidden;
}
[data-theme="twilight"] .stepper { background: color-mix(in oklab, var(--paper) 80%, black); }
.stepper button {
  appearance: none; border: 0; background: transparent;
  width: 48px; height: 48px;
  font-size: 22px; line-height: 1;
  color: var(--ink); cursor: pointer;
  transition: background .15s var(--ease);
}
.stepper button:hover { background: color-mix(in oklab, var(--primary) 15%, transparent); }
.stepper button:disabled { color: var(--ink-mute); opacity: .4; cursor: not-allowed; }
.stepper .val {
  min-width: 60px;
  text-align: center;
  font-family: var(--font-display);
  font-size: 24px;
  color: var(--ink);
}

/* RSVP form layout */
.rsvp-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
  position: relative; z-index: 1;
}
.rsvp-form .full { grid-column: 1 / -1; }
@media (max-width: 600px) { .rsvp-form { grid-template-columns: 1fr; } }

.rsvp-actions {
  margin-top: 12px;
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; flex-wrap: wrap;
}
.rsvp-actions .note {
  font-size: 13px; color: var(--ink-mute);
  font-style: italic;
}

/* Thank-you state */
.thanks {
  text-align: center;
  display: grid; gap: 18px; justify-items: center;
  padding: 20px 0;
  position: relative; z-index: 1;
}
.thanks .glyph {
  font-family: var(--font-hand);
  font-size: 96px;
  line-height: .9;
  color: var(--primary);
  transform: rotate(-6deg);
}
.thanks h3 {
  font-family: var(--font-display);
  font-size: clamp(34px, 4.5vw, 52px);
  margin: 0; line-height: 1;
}
.thanks p { max-width: 38ch; color: var(--ink-mute); margin: 0; }
.thanks .receipt {
  display: grid;
  grid-template-columns: auto auto;
  gap: 6px 22px;
  background: color-mix(in oklab, var(--accent-2) 30%, transparent);
  padding: 16px 22px;
  border: 1px dashed var(--rule);
  font-size: 14px;
  margin-top: 6px;
  text-align: left;
}
.thanks .receipt span:nth-child(odd) {
  text-transform: uppercase;
  letter-spacing: .14em;
  font-size: 11px;
  color: var(--ink-mute);
  align-self: center;
}

/* ──────────── Footer ──────────── */
.footer {
  padding: 80px 0 50px;
  text-align: center;
  display: grid;
  gap: 18px;
  border-top: 1px dashed var(--rule);
  position: relative;
}
.footer .signoff {
  font-family: var(--font-hand);
  font-size: clamp(40px, 7vw, 88px);
  color: var(--primary);
  line-height: .95;
}
.footer .meta {
  font-size: 12px; letter-spacing: .22em; text-transform: uppercase;
  color: var(--ink-mute);
}

/* ──────────── Floating decorations ──────────── */
.float-orn {
  position: absolute;
  pointer-events: none;
  color: var(--secondary);
  opacity: .35;
}
[data-theme="twilight"] .float-orn { color: var(--primary); opacity: .25; }

/* Reveal animation when unlocking */
.reveal-enter {
  animation: revealIn .55s var(--ease) both;
}
@keyframes revealIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* responsive nudges */
@media (max-width: 560px) {
  .stamp { width: 130px; height: 130px; }
  .stamp .big { font-size: 36px; }
  .topbar nav { display: none; }
}
