/* Fonts are self-hosted so no visitor data goes to a font CDN. */
@font-face {
  font-family: 'Jost';
  font-weight: 300;
  font-display: swap;
  src: url('assets/fonts/jost-latin-300-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'Jost';
  font-weight: 400;
  font-display: swap;
  src: url('assets/fonts/jost-latin-400-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'Jost';
  font-weight: 500;
  font-display: swap;
  src: url('assets/fonts/jost-latin-500-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'Cormorant Garamond';
  font-weight: 500;
  font-style: italic;
  font-display: swap;
  src: url('assets/fonts/cormorant-garamond-latin-500-italic.woff2') format('woff2');
}

:root {
  --burgundy: #5a0f1b;
  --burgundy-deep: #470a14;
  --cream: #faf4f0;
  --gold: #c9a473;
  --sans: 'Jost', 'Helvetica Neue', Arial, sans-serif;
  --serif: 'Cormorant Garamond', 'Times New Roman', serif;
}

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

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--burgundy);
  color: var(--cream);
  font-family: var(--sans);
  font-weight: 400;
  font-size: 1rem;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
}

p {
  margin: 0;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.page {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 100svh;
  padding: 1.25rem 1.5rem 1.5rem;
}

/* Language switch */
.lang {
  display: flex;
  justify-content: flex-end;
  gap: 0.375rem;
  font-size: 0.75rem;
  letter-spacing: 0.16em;
}

.lang span {
  opacity: 0.4;
}

.lang button {
  padding: 0.5rem 0.25rem;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  letter-spacing: inherit;
  cursor: pointer;
  opacity: 0.75;
}

.lang button[aria-pressed='true'] {
  opacity: 1;
  text-decoration: underline;
  text-decoration-color: var(--gold);
  text-underline-offset: 0.35em;
}

/* Layout */
.invite {
  display: grid;
  gap: 2rem;
  align-items: center;
  width: 100%;
  max-width: 62rem;
  margin: auto;
  padding-block: 1rem 2.5rem;
}

/* Arch photo with the thin gold frame from the invitation */
.arch {
  position: relative;
  width: min(62vw, 15rem);
  margin: 0 auto;
  padding: 0.5rem;
}

.arch::before {
  content: '';
  position: absolute;
  inset: 0;
  border: 1px solid var(--gold);
  border-radius: 999px 999px 0 0;
  opacity: 0.75;
}

.arch img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 668 / 846;
  object-fit: cover;
  border-radius: 999px 999px 0 0;
}

.content {
  display: grid;
  justify-items: center;
  gap: 1.25rem;
  max-width: 27rem;
  margin-inline: auto;
  text-align: center;
}

.eyebrow {
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.28em;
  text-transform: uppercase;
}

.logo {
  display: block;
  width: 9.5rem;
  margin-block: -1.5rem -1rem;
}

.logo img {
  display: block;
  width: 100%;
  height: auto;
}

h1 {
  margin: 0;
  font-family: var(--serif);
  font-style: italic;
  font-weight: 500;
  font-size: clamp(1.75rem, 1.3rem + 2vw, 2.5rem);
  line-height: 1.1;
  text-wrap: balance;
}

.rule {
  width: 2.5rem;
  height: 1px;
  background: var(--gold);
}

.facts {
  display: grid;
  gap: 0.25rem;
  font-size: 0.875rem;
  letter-spacing: 0.04em;
}

.facts__date {
  font-weight: 500;
  letter-spacing: 0.24em;
  text-transform: uppercase;
}

.facts a {
  text-decoration-color: rgb(250 244 240 / 0.4);
  text-underline-offset: 0.25em;
}

.offer {
  display: grid;
  gap: 0.625rem;
  font-weight: 300;
  text-wrap: pretty;
}

.offer__lead {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 500;
  font-size: 1.375rem;
  line-height: 1.2;
}

/* Form */
.form {
  display: grid;
  gap: 0.5rem;
  width: 100%;
}

.form[hidden],
.consent[hidden],
.status[hidden] {
  display: none;
}

.form input[type='email'] {
  width: 100%;
  min-height: 3rem;
  padding: 0 1rem;
  border: 1px solid rgb(250 244 240 / 0.55);
  border-radius: 6px;
  background: var(--burgundy-deep);
  color: var(--cream);
  font: inherit;
  text-align: center;
}

.form input[type='email']::placeholder {
  color: rgb(250 244 240 / 0.6);
}

.form input[type='email']:focus-visible,
.form button:focus-visible,
.lang button:focus-visible,
a:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

.trap {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.form button {
  min-height: 3rem;
  padding: 0 1.5rem;
  border: 0;
  border-radius: 6px;
  background: var(--cream);
  color: var(--burgundy);
  font: inherit;
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.form button:hover {
  background: #fff;
}

.form button:disabled {
  opacity: 0.6;
  cursor: progress;
}

.status {
  width: 100%;
  padding: 1rem 1.125rem;
  border: 1px solid var(--gold);
  border-radius: 6px;
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.1875rem;
  line-height: 1.35;
}

.status--error {
  border-color: #f2b8b5;
  color: #f9dedc;
  font-family: var(--sans);
  font-style: normal;
  font-size: 0.875rem;
}

.consent {
  font-size: 0.75rem;
  line-height: 1.5;
  opacity: 0.85;
}

.gift {
  display: grid;
  gap: 0.25rem;
  width: 100%;
  padding-top: 1.25rem;
  border-top: 1px solid rgb(201 164 115 / 0.4);
  font-size: 0.875rem;
  font-weight: 300;
  text-wrap: pretty;
}

.gift__label {
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.28em;
  text-transform: uppercase;
}

.footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem 1.5rem;
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  opacity: 0.85;
}

.footer a {
  text-decoration: none;
}

.footer a:hover {
  text-decoration: underline;
  text-underline-offset: 0.25em;
}

@media (min-width: 52rem) {
  .page {
    padding: 1.5rem 2.5rem 2rem;
  }

  .invite {
    grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
    gap: 4.5rem;
  }

  .arch {
    width: min(100%, 24rem);
    padding: 0.75rem;
  }

  .form {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .form input[type='email'] {
    text-align: start;
  }
}

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