/* =====================================================================
   InvitationMate design system — tokens, base elements and UI components
   shared by the website (index + pages/) and Invite Studio (editor/).
   Component class names (.btn, .chip, .card, .modal…) map 1:1 to future
   React components.
   ===================================================================== */
:root {
  --brand: #6b1d3a;
  --brand-2: #8f2b4f;
  --brand-ink: #2b1420;
  --gold: #c8963e;
  --gold-2: #e8c77a;
  --cream: #fbf6ee;
  --blush: #f7e9e4;
  --paper: #ffffff;
  --ink: #2b1d22;
  --muted: #6f5d62;
  --line: #eadccf;
  --ok: #9a6a12;
  --err: #c0392b;
  --focus: #c8963e;

  --font-display: 'Cormorant Garamond', Georgia, serif;
  --font-body: 'Outfit', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-script: 'Pinyon Script', cursive;

  --r-sm: 10px;
  --r: 16px;
  --r-lg: 26px;
  --shadow-sm: 0 2px 8px rgba(60, 20, 35, .06);
  --shadow: 0 14px 40px -12px rgba(60, 20, 35, .22);
  --shadow-lg: 0 30px 80px -24px rgba(60, 20, 35, .35);
  --wrap: 1200px;
  --header-h: 72px;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 12px); -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--cream); color: var(--ink); font: 400 16px/1.6 var(--font-body); -webkit-font-smoothing: antialiased; overflow-x: hidden; }
img, svg { display: block; max-width: 100%; }
a { color: var(--brand); }
h1, h2, h3, h4, p, ul, ol, figure, blockquote { margin: 0; }
ul, ol { padding: 0; list-style: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; border-radius: 4px; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 200; padding: 10px 16px; background: var(--brand); color: #fff; border-radius: 8px; }
.skip:focus { top: 12px; }

.ic { width: 1.15em; height: 1.15em; flex: none; }
.wrap { width: min(100% - 32px, var(--wrap)); margin-inline: auto; }
.section { padding: clamp(72px, 10vw, 120px) 0; position: relative; }
.section--tint { background: var(--blush); }
.section--dark { background: radial-gradient(ellipse at 50% 0, #4a1530, #22090f 70%); color: #f7ecdf; }

/* ---------- typography ---------- */
.eyebrow { display: inline-flex; align-items: center; gap: 10px; font: 600 .74rem/1 var(--font-body); letter-spacing: .24em; text-transform: uppercase; color: var(--gold); }
.eyebrow::before, .eyebrow--center::after { content: ''; width: 26px; height: 1px; background: currentColor; }
.h1 { font: 500 clamp(2.6rem, 6.4vw, 4.8rem)/1.02 var(--font-display); letter-spacing: -.01em; color: var(--brand-ink); }
.h2 { font: 500 clamp(2.1rem, 4.6vw, 3.4rem)/1.08 var(--font-display); color: var(--brand-ink); }
.h3 { font: 600 1.4rem/1.25 var(--font-display); color: var(--brand-ink); }
.h1 em, .h2 em { font-family: var(--font-script); font-style: normal; font-weight: 400; color: var(--brand); font-size: 1.08em; line-height: .8; }
.lead { font-size: clamp(1.04rem, 1.6vw, 1.18rem); color: var(--muted); max-width: 60ch; }
.section-head { text-align: center; max-width: 720px; margin: 0 auto clamp(36px, 6vw, 56px); display: grid; gap: 14px; justify-items: center; }
.section--dark .h2, .section--dark .h3 { color: #fff4e6; }
.section--dark .h2 em { color: var(--gold-2); }
.section--dark .lead { color: #e6cfc0; }

/* ---------- buttons ---------- */
.btn {
  --b: var(--brand); --t: #fff;
  display: inline-flex; align-items: center; justify-content: center; gap: .55em;
  min-height: 46px; padding: .7em 1.35em; border-radius: 999px; border: 1px solid var(--b);
  background: var(--b); color: var(--t); text-decoration: none; white-space: nowrap;
  font: 500 .95rem/1 var(--font-body); letter-spacing: .01em;
  transition: transform .2s, box-shadow .2s, background .2s, color .2s, border-color .2s;
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 10px 24px -10px color-mix(in srgb, var(--b) 70%, transparent); }
.btn:active { transform: translateY(0); }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .5; pointer-events: none; }
.btn--gold { --b: var(--gold); --t: #2b1606; }
.btn--ghost { background: transparent; color: var(--brand); border-color: color-mix(in srgb, var(--brand) 35%, transparent); }
.btn--ghost:hover { background: color-mix(in srgb, var(--brand) 7%, transparent); box-shadow: none; }
.btn--light { --b: #fff; --t: var(--brand-ink); }
.btn--quiet { background: transparent; border-color: transparent; color: var(--ink); }
.btn--quiet:hover { background: color-mix(in srgb, var(--brand) 7%, transparent); box-shadow: none; }
.btn--sm { min-height: 36px; padding: .5em 1em; font-size: .86rem; }
.btn--lg { min-height: 54px; padding: .8em 1.8em; font-size: 1.02rem; }
.btn--block { width: 100%; }
.btn--icon { width: 40px; min-height: 40px; padding: 0; border-radius: 12px; }
.btn--danger { --b: var(--err); }

/* ---------- chips / badges ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 8px 16px; border-radius: 999px; border: 1px solid var(--line); background: var(--paper); font-size: .9rem; color: var(--ink); transition: all .2s; }
.chip:hover { border-color: var(--gold); }
.chip[aria-pressed="true"], .chip.is-active { background: var(--brand); color: #fff; border-color: var(--brand); }
.chip__n { font-size: .75rem; opacity: .7; }
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px; border-radius: 999px; font: 600 .68rem/1.2 var(--font-body); letter-spacing: .08em; text-transform: uppercase; background: var(--blush); color: var(--brand); }
.badge--gold { background: #f6e6c4; color: #7a5310; }
.badge--new { background: #fde3ec; color: #a3154f; }
.badge--free { background: #e8eefc; color: #2c4a9a; }
.tag { font-size: .78rem; color: var(--muted); }

/* ---------- cards ---------- */
.card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r); padding: 24px; box-shadow: var(--shadow-sm); }

/* ---------- forms ---------- */
.field { display: grid; gap: 6px; min-width: 0; }
.field > label, .field > .label { font-size: .84rem; font-weight: 500; color: var(--ink); }
.field .hint { font-size: .78rem; color: var(--muted); }
.input, .select, .textarea {
  width: 100%; min-height: 44px; padding: 10px 14px; border-radius: var(--r-sm); border: 1px solid var(--line);
  background: var(--paper); color: var(--ink); transition: border-color .2s, box-shadow .2s;
}
.textarea { resize: vertical; min-height: 96px; line-height: 1.5; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px color-mix(in srgb, var(--gold) 22%, transparent); }
.field.is-invalid .input, .field.is-invalid .select, .field.is-invalid .textarea, .input[aria-invalid="true"] { border-color: var(--err); }
.field__err { font-size: .78rem; color: var(--err); }
.field__err:empty { display: none; }
.row { display: grid; gap: 14px; align-items: start; }
@media (min-width: 560px) { .row--2 { grid-template-columns: 1fr 1fr; } }

.switch { position: relative; display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-size: .9rem; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch__t { width: 40px; height: 24px; border-radius: 999px; background: #d9cbc3; position: relative; transition: background .2s; flex: none; }
.switch__t::after { content: ''; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .2s; }
.switch input:checked + .switch__t { background: var(--brand); }
.switch input:checked + .switch__t::after { transform: translateX(16px); }
.switch input:focus-visible + .switch__t { outline: 2px solid var(--focus); outline-offset: 2px; }

/* ---------- header ---------- */
.site-header { position: sticky; top: 0; z-index: 60; height: var(--header-h); background: color-mix(in srgb, var(--cream) 86%, transparent); backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px); border-bottom: 1px solid transparent; transition: border-color .3s, background .3s; }
.site-header.is-scrolled { border-bottom-color: var(--line); background: color-mix(in srgb, var(--cream) 94%, transparent); }
.site-header__in { height: 100%; display: flex; align-items: center; gap: 24px; }
.logo { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--brand-ink); font: 600 1.45rem/1 var(--font-display); letter-spacing: .01em; }
.logo__mark { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: var(--gold-2); box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--gold-2) 40%, transparent); }
.logo__mark svg { width: 20px; height: 20px; }
.logo b { color: var(--brand); font-weight: 600; }
.nav { display: none; gap: 4px; margin-left: auto; }
.nav a { padding: 8px 12px; border-radius: 999px; text-decoration: none; color: var(--ink); font-size: .93rem; transition: background .2s, color .2s; }
.nav a:hover, .nav a[aria-current="page"] { background: color-mix(in srgb, var(--brand) 8%, transparent); color: var(--brand); }
.header-cta { display: none; gap: 8px; }
.menu-btn { margin-left: auto; width: 44px; height: 44px; border-radius: 12px; border: 1px solid var(--line); background: var(--paper); display: grid; place-items: center; }
.menu-btn .ic { width: 22px; height: 22px; }
@media (min-width: 980px) {
  .nav, .header-cta { display: flex; }
  .menu-btn { display: none; }
}
.mobile-nav { position: fixed; inset: var(--header-h) 0 auto 0; z-index: 59; background: var(--cream); border-bottom: 1px solid var(--line); box-shadow: var(--shadow); padding: 12px 16px 20px; display: grid; gap: 4px; transform-origin: top; animation: drop .25s ease; }
.mobile-nav[hidden] { display: none; }
.mobile-nav a:not(.btn) { padding: 12px 10px; text-decoration: none; color: var(--ink); border-bottom: 1px solid var(--line); font-size: 1.02rem; }
.mobile-nav .btn { margin-top: 10px; }
@keyframes drop { from { opacity: 0; transform: scaleY(.92); } }

/* ---------- footer ---------- */
.site-footer { background: #1d0b12; color: #e9d9cf; padding: 64px 0 28px; }
.site-footer a { color: #e9d9cf; text-decoration: none; }
.site-footer a:hover { color: var(--gold-2); }
.site-footer .logo { color: #fff6ea; }
.footer-grid { display: grid; gap: 34px; grid-template-columns: 1fr; }
@media (min-width: 760px) { .footer-grid { grid-template-columns: 1.6fr repeat(3, 1fr); } }
.footer-grid h4 { font: 600 .76rem var(--font-body); letter-spacing: .2em; text-transform: uppercase; color: var(--gold-2); margin-bottom: 14px; }
.footer-grid li { padding: 4px 0; font-size: .94rem; }
.footer-about { max-width: 36ch; margin-top: 14px; color: #bfa9a0; font-size: .94rem; }
.footer-bottom { margin-top: 44px; padding-top: 20px; border-top: 1px solid #3a2128; display: flex; flex-wrap: wrap; gap: 10px 24px; justify-content: space-between; font-size: .82rem; color: #a88f87; }

/* ---------- modal ---------- */
.modal { position: fixed; inset: 0; z-index: 120; display: grid; place-items: center; padding: 16px; background: rgba(30, 10, 18, .55); backdrop-filter: blur(4px); animation: fade .2s ease; }
.modal[hidden] { display: none; }
.modal__box { position: relative; width: min(100%, 560px); max-height: calc(100dvh - 32px); overflow: auto; background: var(--paper); border-radius: var(--r-lg); box-shadow: var(--shadow-lg); padding: clamp(20px, 4vw, 32px); animation: pop .25s cubic-bezier(.2,.8,.2,1); }
.modal__box--wide { width: min(100%, 1100px); }
.modal__close { position: absolute; top: 12px; right: 12px; }
.modal__title { font: 600 1.6rem/1.2 var(--font-display); color: var(--brand-ink); padding-right: 40px; }
.modal__foot { display: flex; flex-wrap: wrap; gap: 10px; justify-content: flex-end; margin-top: 22px; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(14px) scale(.98); } }

/* ---------- toast ---------- */
.toasts { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); z-index: 200; display: grid; gap: 8px; width: min(92vw, 420px); pointer-events: none; }
.toast { pointer-events: auto; display: flex; gap: 10px; align-items: center; padding: 12px 16px; border-radius: 12px; background: #2b1420; color: #fff; box-shadow: var(--shadow); font-size: .92rem; animation: pop .25s ease; }
.toast .ic { color: var(--gold-2); }
.toast--err { background: #7a1f1f; }

/* ---------- demo notice ---------- */
.demo-note { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; background: #fff6e2; border: 1px solid #f1dcae; color: #6b4a10; font-size: .86rem; }
.demo-note .ic { margin-top: 2px; }

/* ---------- reveal ---------- */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .8s ease, transform .8s cubic-bezier(.2,.7,.2,1); transition-delay: calc(var(--d, 0) * 80ms); }
.reveal.is-in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
  .reveal { opacity: 1; transform: none; }
}
