/*
  Sara & Rasmus — August 2027

  Mobile-first, single stylesheet, no build step and no framework.
  Everything tunable lives in the custom properties at the top; change a value
  there and the whole site follows.

  Order: tokens -> reset -> layout -> components -> RSVP -> responsive.
*/

/* --------------------------------------------------------------- tokens -- */

:root {
  /* A warm, quiet palette. One accent, used sparingly. */
  --ink: #2b2724;
  --ink-soft: #6b625b;
  --ink-faint: #9a9089;
  --paper: #fdfbf7;
  --paper-alt: #f5f0e8;
  --line: #e5ddd1;
  --accent: #8a6f4e;
  --accent-dark: #6d573c;
  --accent-wash: #f0e8dc;
  --danger: #a13d2f;

  --font-display: 'Iowan Old Style', 'Palatino Linotype', Palatino, 'Book Antiqua', Georgia,
    serif;
  --font-body: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial,
    sans-serif;

  --measure: 62rem;
  --gap: 1.25rem;
  --radius: 4px;
  --focus: 0 0 0 3px var(--accent-wash), 0 0 0 5px var(--accent);
  --shadow: 0 1px 2px rgb(43 39 36 / 6%), 0 4px 16px rgb(43 39 36 / 4%);
}

/* ---------------------------------------------------------------- reset -- */

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

body,
h1,
h2,
h3,
p,
ul,
ol,
figure,
fieldset,
legend {
  margin: 0;
  padding: 0;
}

ul,
ol {
  list-style: none;
}

fieldset {
  border: 0;
  min-inline-size: 0;
}

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

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* One consistent focus ring everywhere, always visible. */
:focus-visible {
  outline: none;
  box-shadow: var(--focus);
  border-radius: var(--radius);
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  padding: 0.75rem 1.25rem;
  background: var(--accent);
  color: #fff;
  text-decoration: none;
}

.skip-link:focus {
  left: 0;
}

/* --------------------------------------------------------------- header -- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgb(253 251 247 / 92%);
  backdrop-filter: saturate(140%) blur(8px);
  border-bottom: 1px solid var(--line);
}

.site-nav {
  max-width: var(--measure);
  margin-inline: auto;
  padding: 0.75rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.site-nav__brand {
  font-family: var(--font-display);
  font-size: 1.15rem;
  letter-spacing: 0.14em;
  color: var(--ink);
  text-decoration: none;
  flex: 0 0 auto;
}

.site-nav__links {
  display: none;
  gap: 1.25rem;
  flex: 1 1 auto;
  justify-content: center;
}

.site-nav__links a {
  color: var(--ink-soft);
  text-decoration: none;
  font-size: 0.875rem;
  letter-spacing: 0.04em;
  padding: 0.25rem 0;
  border-bottom: 1px solid transparent;
  transition: color 0.15s, border-color 0.15s;
}

.site-nav__links a:hover {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* Language switch: two small toggles, current one filled. */
.lang-switch {
  margin-left: auto;
  display: flex;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  flex: 0 0 auto;
}

.lang-switch button {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--ink-soft);
  font: inherit;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  padding: 0.35rem 0.6rem;
  cursor: pointer;
  min-height: 32px;
}

.lang-switch button[aria-pressed='true'] {
  background: var(--accent);
  color: #fff;
}

.lang-switch button:not([aria-pressed='true']):hover {
  background: var(--paper-alt);
  color: var(--ink);
}

/* ----------------------------------------------------------------- hero -- */

.hero {
  text-align: center;
  padding: clamp(3.5rem, 14vw, 8rem) 1.25rem clamp(3rem, 10vw, 6rem);
  background: linear-gradient(180deg, var(--paper) 0%, var(--paper-alt) 100%);
  border-bottom: 1px solid var(--line);
}

.hero__eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.24em;
  font-size: 0.72rem;
  color: var(--ink-faint);
  margin-bottom: 1.25rem;
}

.hero__names {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(2.5rem, 11vw, 5rem);
  line-height: 1.05;
  letter-spacing: 0.01em;
}

.hero__date {
  font-family: var(--font-display);
  font-size: clamp(1.1rem, 4vw, 1.6rem);
  color: var(--accent);
  margin-top: 0.75rem;
  letter-spacing: 0.06em;
}

.hero__tagline {
  color: var(--ink-soft);
  margin-top: 0.5rem;
  font-size: 0.95rem;
}

.hero .button {
  margin-top: 2.25rem;
}

/* ------------------------------------------------------------- sections -- */

.section {
  max-width: var(--measure);
  margin-inline: auto;
  padding: clamp(3rem, 9vw, 5rem) 1.25rem;
  /* The header is sticky, so an anchor jump would land under it. */
  scroll-margin-top: 4.5rem;
}

.section--alt {
  max-width: none;
  background: var(--paper-alt);
  border-block: 1px solid var(--line);
}

/* The alt band is full-bleed, so re-centre the content inside it. */
.section--alt > * {
  max-width: var(--measure);
  margin-inline: auto;
}

.section__title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(1.6rem, 5.5vw, 2.35rem);
  text-align: center;
  letter-spacing: 0.02em;
}

.section__title::after {
  content: '';
  display: block;
  width: 3rem;
  height: 1px;
  background: var(--accent);
  margin: 1rem auto 0;
}

.section__subtitle {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 1.5rem;
  text-align: center;
  margin-top: 3.5rem;
}

.section__subtitle + .section__lead {
  margin-top: 0.75rem;
}

.section__lead {
  text-align: center;
  color: var(--ink-soft);
  max-width: 46rem;
  margin: 1.5rem auto 0;
}

/* -------------------------------------------------------------- content -- */

.card-grid {
  display: grid;
  gap: var(--gap);
  margin-top: 2.5rem;
  grid-template-columns: 1fr;
}

.card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.5rem;
  text-align: center;
  box-shadow: var(--shadow);
}

.card h3 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 1.15rem;
  margin-bottom: 0.5rem;
}

.card p {
  color: var(--ink-soft);
  font-size: 0.95rem;
}

.card__meta {
  font-size: 0.85rem;
  color: var(--ink-faint);
  margin-top: 0.35rem;
  font-family: ui-monospace, 'SF Mono', SFMono-Regular, Menlo, Consolas, monospace;
}

.card__link {
  display: inline-block;
  margin-top: 0.85rem;
  color: var(--accent);
  font-size: 0.9rem;
  text-decoration: none;
  border-bottom: 1px solid var(--accent-wash);
  padding-bottom: 1px;
}

.card__link:hover {
  border-bottom-color: var(--accent);
}

/* --------------------------------------------------------- the two days -- */

.day-grid {
  display: grid;
  gap: var(--gap);
  margin-top: 2.5rem;
  grid-template-columns: 1fr;
}

.day-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.75rem 1.5rem;
  box-shadow: var(--shadow);
  /* A quiet rule at the top rather than a heavy border. */
  border-top: 3px solid var(--line);
}

/* The wedding day itself gets the accent. */
.day-card--feature {
  border-top-color: var(--accent);
}

.day-card__label {
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.68rem;
  color: var(--ink-faint);
  margin-bottom: 0.75rem;
}

.day-card__name {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 1.4rem;
  line-height: 1.2;
}

.day-card__date {
  color: var(--accent);
  font-size: 0.95rem;
  margin-top: 0.35rem;
}

.day-card__place {
  font-size: 0.95rem;
  font-weight: 500;
  margin-top: 0.75rem;
}

.day-card__body {
  color: var(--ink-soft);
  font-size: 0.95rem;
  margin-top: 0.5rem;
}

.day-card__dress {
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
  font-size: 0.9rem;
  color: var(--ink-soft);
}

.day-card__dress-label {
  display: block;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ink-faint);
  margin-bottom: 0.15rem;
}

/* Pulled-out note, e.g. the RSVP deadline. */
.notice {
  margin-top: var(--gap);
  padding: 1.5rem;
  text-align: center;
  background: var(--accent-wash);
  border-radius: var(--radius);
}

.notice h3 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 1.1rem;
  margin-bottom: 0.25rem;
}

.notice p {
  color: var(--ink-soft);
  font-size: 0.95rem;
}

/* ------------------------------------------------------------- schedule -- */

.schedule-grid {
  display: grid;
  gap: 2.5rem;
  margin-top: 2.5rem;
  grid-template-columns: 1fr;
}

.schedule-day__title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 1.2rem;
  text-align: center;
  color: var(--accent);
  margin-bottom: 1.25rem;
}

.timeline {
  margin: 0 auto;
  max-width: 34rem;
  border-left: 1px solid var(--line);
  padding-left: 1.75rem;
}

.timeline__item {
  position: relative;
  padding-bottom: 2rem;
}

.timeline__item:last-child {
  padding-bottom: 0;
}

.timeline__item::before {
  content: '';
  position: absolute;
  left: calc(-1.75rem - 4px);
  top: 0.6rem;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
}

.timeline__item h4 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 1.1rem;
  margin: 0;
}

.timeline__item p {
  color: var(--ink-soft);
  font-size: 0.95rem;
}

.faq {
  margin: 2.5rem auto 0;
  max-width: 44rem;
}

.faq__item {
  border-bottom: 1px solid var(--line);
}

.faq__item summary {
  cursor: pointer;
  padding: 1.1rem 0;
  font-weight: 500;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.faq__item summary::-webkit-details-marker {
  display: none;
}

.faq__item summary::after {
  content: '+';
  color: var(--accent);
  font-size: 1.3rem;
  line-height: 1;
  flex: 0 0 auto;
}

.faq__item[open] summary::after {
  content: '\2013';
}

.faq__item p {
  color: var(--ink-soft);
  padding-bottom: 1.1rem;
  font-size: 0.95rem;
}

/* -------------------------------------------------------------- buttons -- */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font: inherit;
  font-size: 0.95rem;
  letter-spacing: 0.04em;
  padding: 0.8rem 1.75rem;
  border-radius: var(--radius);
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  /* Comfortable tap target on a phone. */
  min-height: 48px;
  transition: background-color 0.15s, color 0.15s, border-color 0.15s;
}

.button--primary {
  background: var(--accent);
  color: #fff;
}

.button--primary:hover:not(:disabled) {
  background: var(--accent-dark);
}

.button--quiet {
  background: transparent;
  color: var(--ink-soft);
  border-color: var(--line);
}

.button--quiet:hover {
  background: var(--paper-alt);
  color: var(--ink);
}

.button:disabled {
  opacity: 0.55;
  cursor: progress;
}

/* --------------------------------------------------------------- fields -- */

.field + .field {
  margin-top: 1.25rem;
}

.field__label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  margin-bottom: 0.2rem;
}

.field__hint {
  font-size: 0.8rem;
  color: var(--ink-faint);
  margin-bottom: 0.45rem;
  line-height: 1.5;
}

.field__input {
  width: 100%;
  font: inherit;
  /* 16px minimum, or iOS Safari zooms the page on focus. */
  font-size: 1rem;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.7rem 0.85rem;
  min-height: 48px;
  transition: border-color 0.15s;
}

.field__input:hover {
  border-color: var(--ink-faint);
}

.field__input::placeholder {
  color: var(--ink-faint);
}

textarea.field__input {
  resize: vertical;
  min-height: 6rem;
  line-height: 1.6;
}

/* The code box: monospaced and spaced out, so a typo is easy to spot. */
.field__input--code {
  font-family: ui-monospace, 'SF Mono', SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 1.15rem;
  letter-spacing: 0.18em;
  text-align: center;
  text-transform: uppercase;
}

/* ----------------------------------------------------------------- rsvp -- */

.rsvp {
  max-width: 38rem;
  margin: 2.5rem auto 0;
}

.rsvp [hidden],
[data-rsvp-open][hidden] {
  display: none;
}

.rsvp__how {
  margin-bottom: 1.5rem;
  color: var(--ink-soft);
  font-size: 0.95rem;
}

.rsvp__how h3 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 1.25rem;
  color: var(--ink);
  margin-bottom: 0.5rem;
}

.rsvp__how ol {
  list-style: decimal;
  padding-left: 1.25rem;
}

.rsvp__how li + li {
  margin-top: 0.35rem;
}

.rsvp__panel {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: clamp(1.5rem, 5vw, 2.25rem);
  box-shadow: var(--shadow);
}

.rsvp__panel--status {
  text-align: center;
}

.rsvp__panel--status h3 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 1.6rem;
  margin-bottom: 0.5rem;
}

.rsvp__panel--status p {
  color: var(--ink-soft);
}

#rsvp-code-form .button {
  width: 100%;
  margin-top: 1.5rem;
}

.rsvp__welcome {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 1.5rem;
  text-align: center;
  margin-bottom: 0.5rem;
}

.rsvp__note {
  text-align: center;
  color: var(--ink-faint);
  font-size: 0.875rem;
  margin-bottom: 1.5rem;
}

.rsvp__actions {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 1.75rem;
}

.rsvp__error {
  margin-top: 1rem;
  padding: 0.85rem 1rem;
  background: #fbf2f0;
  border: 1px solid #e8cdc7;
  border-left: 3px solid var(--danger);
  border-radius: var(--radius);
  color: var(--danger);
  font-size: 0.9rem;
  text-align: center;
}

/* One guest's block. */
.guest {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.35rem;
  background: var(--paper-alt);
}

.guest + .guest {
  margin-top: 1rem;
}

.guest__name {
  font-family: var(--font-display);
  font-size: 1.2rem;
  padding: 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.guest__badge {
  font-family: var(--font-body);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent-dark);
  background: var(--accent-wash);
  border-radius: 999px;
  padding: 0.15rem 0.55rem;
}

/* One row per day: the day on the left, Yes/No on the right. */
.guest__days {
  margin-top: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.guest__day {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.guest__day-label {
  display: flex;
  flex-direction: column;
  line-height: 1.35;
}

.guest__day-name {
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.guest__day-date {
  font-size: 0.78rem;
  color: var(--ink-faint);
}

/*
  Yes/No. Real radio inputs, visually hidden but still focusable, with the
  labels styled as the buttons — so it behaves correctly for a keyboard and a
  screen reader while looking like a segmented control.
*/
.guest__choices {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
}

.guest__radio {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.guest__choice {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 48px;
  padding: 0.6rem 0.75rem;
  font-size: 0.9rem;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  cursor: pointer;
  transition: background-color 0.15s, border-color 0.15s, color 0.15s;
}

.guest__choice:hover {
  border-color: var(--accent);
}

.guest__radio:checked + .guest__choice {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

/* The ring has to follow the label, since the input itself is invisible. */
.guest__radio:focus-visible + .guest__choice {
  box-shadow: var(--focus);
}

.guest__food {
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--line);
}

.guest__food[hidden] {
  display: none;
}

.guest__food--revealed:not([hidden]) {
  animation: reveal 0.2s ease-out;
}

@keyframes reveal {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.spinner {
  width: 26px;
  height: 26px;
  margin: 0 auto 1rem;
  border: 2px solid var(--line);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* --------------------------------------------------------------- footer -- */

.site-footer {
  border-top: 1px solid var(--line);
  padding: 2.5rem 1.25rem;
  text-align: center;
  color: var(--ink-faint);
  font-family: var(--font-display);
  font-size: 0.9rem;
  letter-spacing: 0.08em;
}

/* ----------------------------------------------------------- responsive -- */

/* Tablet: the nav links fit, and cards can sit side by side. */
@media (min-width: 40rem) {
  .site-nav__links {
    display: flex;
  }

  .card-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .card-grid--two {
    grid-template-columns: repeat(2, 1fr);
  }

  .day-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .schedule-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--gap);
  }

  .rsvp__actions {
    flex-direction: row;
    justify-content: space-between;
  }

  #rsvp-code-form .button {
    width: auto;
  }

  /* Enough width to put the day and its Yes/No on one line. */
  .guest__day {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
  }

  .guest__choices {
    flex: 0 0 auto;
    width: 15rem;
  }
}

/* Desktop: a little more air. */
@media (min-width: 64rem) {
  .site-nav {
    padding-inline: 2rem;
  }

  .section {
    padding-inline: 2rem;
  }
}

@media print {
  .site-header,
  .lang-switch,
  .rsvp,
  .skip-link {
    display: none;
  }
}
