@font-face {
  font-family: "EB Garamond";
  src: url("./assets/fonts/eb-garamond-latin.woff2") format("woff2");
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
}

@font-face {
  font-family: "DM Sans";
  src: url("./assets/fonts/dm-sans-latin.woff2") format("woff2");
  font-style: normal;
  font-weight: 100 1000;
  font-display: swap;
}

:root {
  color-scheme: light;
  --paper: #f7f5ef;
  --ink: #293626;
  --muted: #727369;
  --gold: #947132;
  --line: #deded2;
  font-family: "DM Sans", sans-serif;
  color: var(--ink);
  background: var(--paper);
  font-synthesis: none;
}

* { box-sizing: border-box; }
body { margin: 0; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; }
button, a, input { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 4px; }
[hidden] { display: none !important; }
.page { width: min(100% - 2.5rem, 80rem); margin-inline: auto; }
.masthead { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 6rem; border-bottom: 1px solid var(--line); }
.identity { display: flex; gap: .8rem; align-items: center; color: inherit; text-decoration: none; min-height: 3rem; }
.monogram { font: 1.55rem "EB Garamond", serif; border: 1px solid #a2a78e; border-radius: 50%; width: 3.2rem; height: 3.2rem; display: flex; align-items: center; justify-content: center; }
.monogram span { color: var(--gold); font-size: 1.1rem; }
.identity-text { font: 1.15rem "EB Garamond", serif; }
.identity-text > span { display: block; margin-top: .2rem; font: .6rem "DM Sans", sans-serif; letter-spacing: .17em; color: var(--muted); }
.date { font-size: .75rem; color: var(--muted); white-space: nowrap; }
main { display: grid; gap: 2.5rem; padding-block: 2.5rem; }
.editor { min-width: 0; }
.eyebrow { display: flex; gap: .6rem; align-items: center; font-size: .65rem; letter-spacing: .19em; color: var(--gold); margin: 0 0 1rem; font-weight: 600; }
.eyebrow > span { width: 1.8rem; height: 1px; background: var(--gold); }
h1 { font: 400 clamp(3.3rem, 6.6vw, 5.5rem)/.95 "EB Garamond", serif; letter-spacing: -.045em; margin: 0 0 1.4rem; }
.intro { font-size: .95rem; line-height: 1.8; color: var(--muted); max-width: 24rem; margin: 0 0 2rem; }
form { max-width: 26rem; }
label { display: block; font-size: .875rem; font-weight: 500; margin-bottom: .7rem; }
.input-wrap { position: relative; }
input[type="text"], input[type="date"], input[type="time"], textarea { border: 1px solid #bbbeaf; border-radius: .3rem; background: #fffefa; color: var(--ink); width: 100%; min-width: 0; min-height: 3.5rem; padding: .9rem 1rem; font-size: 1rem; }
input[type="text"] { padding-right: 3rem; }
input::placeholder { color: #909086; }
input:focus, textarea:focus { outline: 2px solid var(--ink); outline-offset: 2px; }
.clear-name { position: absolute; right: .25rem; top: 50%; transform: translateY(-50%); border: 0; background: transparent; color: var(--muted); width: 2.75rem; height: 2.75rem; padding: .75rem; }
.help { color: var(--muted); font-size: .8rem; line-height: 1.5; margin: .65rem 0 1.25rem; }
.family-option { display: flex; align-items: center; gap: .65rem; min-height: 2.75rem; margin: -.5rem 0 1rem; cursor: pointer; }
.family-option input { width: 1.15rem; height: 1.15rem; margin: 0; accent-color: var(--ink); cursor: pointer; flex: 0 0 auto; }
.salutation { display: flex; flex-direction: column; gap: .3rem; border-left: 2px solid #b59b61; padding: .2rem 1rem; margin: 0 0 1.6rem; }
.salutation > span { font-size: .6rem; letter-spacing: .15em; color: var(--muted); }
output { font: 1.5rem/1.35 "EB Garamond", serif; overflow-wrap: anywhere; }
.invitation-wording { font: .8rem/1.5 "DM Sans", sans-serif; color: var(--muted); }
.event-settings { margin-bottom: 1rem; border-block: 1px solid var(--line); }
.event-settings summary { min-height: 3.5rem; padding-block: 1rem; cursor: pointer; font-size: .85rem; font-weight: 500; }
.event-settings summary > span { display: block; padding-left: 1rem; margin-top: .2rem; font-size: .75rem; font-weight: 400; color: var(--muted); }
.event-settings fieldset { margin: 0; padding: .5rem 0 1rem; border: 0; min-width: 0; }
.event-date-time { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 10rem), 1fr)); gap: 1rem; margin-bottom: 1.1rem; }
.event-date-time > div { min-width: 0; }
textarea { display: block; resize: vertical; line-height: 1.5; }
.restore-details { min-height: 2.75rem; border: 1px solid var(--line); border-radius: .3rem; padding: .6rem .85rem; background: transparent; color: var(--ink); font-size: .8rem; }
.details-error { font-size: .8rem; line-height: 1.5; color: #a23529; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.format-row { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: .65rem; }
.format-row label { margin: 0; font-size: .8rem; color: var(--muted); }
.format-row select { max-width: 75%; min-height: 2.75rem; padding: .5rem .6rem; border: 1px solid var(--line); border-radius: .3rem; background: transparent; color: var(--ink); font-size: .85rem; }
.download { display: flex; align-items: center; justify-content: center; gap: .65rem; width: 100%; min-height: 3.5rem; background: var(--ink); border: 1px solid var(--ink); color: var(--paper); border-radius: .3rem; font-size: .9rem; font-weight: 500; transition: background .2s, transform .2s; }
.download svg { width: 1.25rem; height: 1.25rem; }
.download:disabled { background: #656e5f; border-color: #656e5f; }
.download:not(:disabled):active { transform: translateY(1px); }
.download-note { text-align: center; color: var(--muted); font-size: .7rem; line-height: 1.5; margin: .75rem 0 0; }
.status { font-size: .8rem; line-height: 1.5; min-height: 1.5em; margin: .7rem 0 0; color: var(--ink); }
.status.error { color: #a23529; }
.privacy { display: flex; align-items: center; gap: .45rem; font-size: .7rem; line-height: 1.5; color: var(--muted); margin: 1.25rem 0 0; }
.privacy svg { width: 1rem; height: 1rem; flex: 0 0 auto; }
.preview { min-width: 0; }
.preview-heading { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.preview-heading h2 { font-size: .85rem; font-weight: 500; margin: 0; }
.preview-heading > span { display: flex; gap: .4rem; align-items: center; color: var(--muted); font-size: .6rem; letter-spacing: .12em; }
.preview-heading i { width: .35rem; height: .35rem; border-radius: 50%; background: #798165; }
.card-frame { position: relative; background: #eae3d4; padding: .55rem; border: 1px solid #dfd9ca; box-shadow: 0 1rem 2.5rem -.9rem #3c3d2420; }
canvas { width: 100%; height: auto; display: block; aspect-ratio: 1; }
.loading { position: absolute; inset: 0; display: grid; place-items: center; background: #eae3d4; color: var(--muted); font: 1.25rem "EB Garamond", serif; text-align: center; padding: 1rem; }
.preview-caption { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .75rem; color: var(--muted); font-size: .6rem; letter-spacing: .13em; margin: 1.2rem 0 0; }
.ampersand { font-family: "EB Garamond", serif; font-size: .9rem; color: var(--gold); padding-inline: .15rem; }
.preview-caption > span:last-child { font-size: .7rem; letter-spacing: 0; }
footer { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 1rem; padding-block: 1.5rem; border-top: 1px solid var(--line); color: var(--muted); }
footer > span:first-child { font: 1rem "EB Garamond", serif; }
footer > span:last-child { font-size: .6rem; letter-spacing: .14em; }
footer > span > span { color: var(--gold); margin-inline: .6rem; }
.noscript { padding: 1rem; color: #a23529; text-align: center; }

@media (hover: hover) {
  .download:not(:disabled):hover { background: #3b4d36; }
  .clear-name:hover { color: var(--ink); }
}

@media (min-width: 768px) {
  .page { width: min(100% - 5rem, 80rem); }
  .masthead { min-height: 7rem; }
  .date { font-size: .8rem; }
  main { grid-template-columns: .85fr 1.15fr; align-items: center; gap: 2.5rem; padding-block: 3.5rem; }
  .intro { font-size: .9rem; }
  .card-frame { padding: .7rem; }
  .privacy { max-width: 24rem; }
}

@media (min-width: 1024px) {
  .page { width: min(100% - 8rem, 80rem); }
  main { grid-template-columns: .8fr 1.2fr; gap: clamp(3rem, 7vw, 7rem); padding-block: 3.75rem; }
  .intro { font-size: 1rem; margin-bottom: 2.5rem; }
  .privacy { margin-top: 1.8rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
}
