:root {
  --ink: #27231f;
  --muted: #6f665e;
  --paper: #fbf7ee;
  --paper-deep: #efe6d8;
  --sage: #6f7953;
  --sage-dark: #596240;
  --sage-deep: #444b32;
  --gold: #b89455;
  --line: rgba(75, 67, 57, 0.22);
  --white: #fffdf8;
  --error: #8d2f2a;
  --shadow: 0 28px 70px rgba(0, 0, 0, 0.28);
  --font-body: "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-serif: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --font-script: "Great Vibes", "Cormorant Garamond", Georgia, serif;
  --envelope-open: 0;
  --envelope-angle: 0deg;
  --envelope-lift: 0px;
  --envelope-brightness: 1;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  scroll-behavior: smooth;
  background: #151514;
}

body {
  min-height: 100%;
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.04) 25%, transparent 25%) 0 0 / 18px 18px,
    linear-gradient(45deg, rgba(255, 255, 255, 0.035) 25%, transparent 25%) 0 0 / 22px 22px,
    #151514;
  font-family: var(--font-body);
  line-height: 1.6;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(255, 255, 255, 0.1), transparent 34rem),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03), transparent 18%, transparent 82%, rgba(255, 255, 255, 0.03));
  pointer-events: none;
}

a {
  color: inherit;
}

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

button,
input {
  font: inherit;
}

.chapter-nav {
  position: fixed;
  top: 50%;
  right: max(14px, calc(50% - 266px));
  z-index: 20;
  display: grid;
  gap: 10px;
  transform: translateY(-50%);
}

.chapter-nav a {
  width: 9px;
  height: 9px;
  border: 1px solid rgba(255, 253, 248, 0.78);
  border-radius: 50%;
  background: rgba(89, 98, 64, 0.78);
  box-shadow: 0 0 0 3px rgba(255, 253, 248, 0.16);
}

.chapter-nav a:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 4px;
}

.invitation-scroll {
  position: relative;
  z-index: 1;
  width: min(430px, 100%);
  min-height: 100svh;
  margin: 0 auto;
  overflow: hidden;
  background: var(--paper);
  border-left: 14px solid var(--white);
  border-right: 14px solid var(--white);
  box-shadow: var(--shadow);
}

.chapter {
  position: relative;
  background:
    linear-gradient(90deg, rgba(184, 148, 85, 0.035) 1px, transparent 1px) 0 0 / 18px 18px,
    linear-gradient(0deg, rgba(184, 148, 85, 0.03) 1px, transparent 1px) 0 0 / 22px 22px,
    var(--paper);
}

.envelope-hero {
  min-height: 100svh;
  position: relative;
  display: grid;
  place-items: center;
  padding: 18px;
  background:
    linear-gradient(180deg, rgba(255, 253, 248, 0.24), rgba(255, 253, 248, 0)),
    var(--paper);
}

.envelope-hero::before,
.envelope-hero::after {
  content: "";
  position: absolute;
  pointer-events: none;
}

.envelope-hero::before {
  inset: 14px;
  border: 1px solid rgba(184, 148, 85, 0.38);
}

.envelope-hero::after {
  inset: 26px;
  background: url("assets/floral-corner.svg") left top / 140px auto no-repeat;
  opacity: 0.18;
}

.envelope-card {
  width: 100%;
  min-height: 620px;
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(39, 35, 31, 0.24);
  border-radius: 4px;
  background:
    radial-gradient(ellipse at 50% 20%, rgba(255, 253, 248, 0.11), transparent 18rem),
    var(--sage);
  box-shadow:
    inset 0 0 0 1px rgba(255, 253, 248, 0.16),
    0 28px 50px rgba(68, 75, 50, 0.26);
  perspective: 1000px;
  transform-style: preserve-3d;
}

.envelope-card__texture,
.envelope-card__lid,
.envelope-card__side,
.envelope-card__pocket {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.envelope-card__texture {
  z-index: 1;
  opacity: 0.48;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px) 0 0 / 5px 5px,
    linear-gradient(0deg, rgba(0, 0, 0, 0.05) 1px, transparent 1px) 0 0 / 6px 6px;
  mix-blend-mode: soft-light;
}

.envelope-card__lid {
  bottom: auto;
  z-index: 7;
  height: 55%;
  background:
    linear-gradient(180deg, rgba(255, 253, 248, 0.11), transparent 56%),
    linear-gradient(135deg, var(--sage), var(--sage-dark));
  clip-path: polygon(0 0, 100% 0, 50% 100%);
  transform: rotateX(var(--envelope-angle));
  transform-origin: top center;
  transition:
    transform 80ms linear,
    filter 80ms linear;
  filter: brightness(var(--envelope-brightness));
  backface-visibility: hidden;
  box-shadow: 0 18px 34px rgba(37, 42, 28, 0.22);
}

.envelope-card__side {
  z-index: 4;
  background: linear-gradient(145deg, rgba(255, 253, 248, 0.06), rgba(68, 75, 50, 0.2));
}

.envelope-card__side--left {
  clip-path: polygon(0 0, 52% 50%, 0 100%);
}

.envelope-card__side--right {
  clip-path: polygon(100% 0, 48% 50%, 100% 100%);
}

.envelope-card__pocket {
  z-index: 5;
  top: auto;
  height: 54%;
  background:
    linear-gradient(0deg, rgba(68, 75, 50, 0.18), transparent 56%),
    linear-gradient(135deg, var(--sage-dark), var(--sage));
  clip-path: polygon(0 100%, 50% 0, 100% 100%);
  box-shadow: 0 -18px 34px rgba(37, 42, 28, 0.18);
}

.envelope-card__content {
  position: absolute;
  inset: 80px 18px 70px;
  z-index: 8;
  display: grid;
  align-content: center;
  justify-items: center;
  text-align: center;
  color: var(--white);
  transform: translateY(var(--envelope-lift));
  transition: transform 80ms linear;
}

.eyebrow,
.section-kicker {
  margin: 0;
  color: currentColor;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1,
h2,
.signature {
  font-family: var(--font-script);
  font-weight: 400;
}

h1 {
  margin: 20px 0 0;
  font-size: 4.65rem;
  line-height: 0.95;
  text-shadow: 0 2px 16px rgba(0, 0, 0, 0.18);
}

h1 span,
h1 em {
  display: block;
}

h1 em {
  margin: 8px 0;
  font-size: 3rem;
  font-style: normal;
}

.hero-date {
  margin: 88px 0 0;
  font-family: var(--font-serif);
  font-size: 1.15rem;
  font-weight: 700;
}

.paper-sheet {
  position: relative;
  padding: 58px 28px;
  background:
    linear-gradient(90deg, rgba(184, 148, 85, 0.035) 1px, transparent 1px) 0 0 / 16px 16px,
    linear-gradient(0deg, rgba(184, 148, 85, 0.03) 1px, transparent 1px) 0 0 / 19px 19px,
    var(--paper);
  text-align: center;
}

.paper-sheet::before {
  content: "";
  position: absolute;
  inset: 18px;
  border: 1px solid rgba(184, 148, 85, 0.18);
  pointer-events: none;
}

.paper-sheet--intro {
  padding-top: 70px;
}

.portrait-frame,
.wide-photo,
.closing-photo {
  margin: 0;
}

.portrait-frame {
  width: min(292px, 86%);
  margin: 0 auto;
  overflow: hidden;
  border: 1px solid rgba(39, 35, 31, 0.12);
  background: var(--paper-deep);
}

.portrait-frame img {
  width: 100%;
  height: 520px;
  object-fit: cover;
}

.intro-copy {
  width: min(290px, 100%);
  margin: 44px auto 0;
  color: var(--ink);
  font-family: var(--font-serif);
  font-size: 1.08rem;
  font-weight: 600;
  line-height: 1.45;
}

.intro-copy::before,
.intro-copy::after {
  content: "";
  display: block;
  width: 116px;
  height: 1px;
  margin: 0 auto 24px;
  background: var(--line);
}

.intro-copy::after {
  margin: 24px auto 0;
}

.intro-copy p {
  margin: 0;
}

.date-panel,
.gift-panel,
.confirm-panel {
  position: relative;
  padding: 62px 28px;
  background:
    linear-gradient(180deg, rgba(255, 253, 248, 0.07), transparent 28%),
    var(--sage);
  color: var(--white);
  text-align: center;
}

.date-panel::before,
.gift-panel::before,
.confirm-panel::before {
  content: "";
  position: absolute;
  inset: 16px;
  border: 1px solid rgba(255, 253, 248, 0.3);
  pointer-events: none;
}

.date-display {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 14px;
  width: min(320px, 100%);
  margin: 32px auto 0;
}

.date-display span {
  display: grid;
  min-height: 38px;
  align-items: center;
  border-top: 1px solid rgba(255, 253, 248, 0.54);
  border-bottom: 1px solid rgba(255, 253, 248, 0.54);
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
}

.date-display strong {
  color: var(--white);
  font-family: var(--font-script);
  font-size: 4.2rem;
  font-weight: 400;
  line-height: 0.95;
}

.weekday {
  margin: 18px 0 0;
  font-family: var(--font-serif);
  font-size: 1.18rem;
  font-weight: 700;
}

.countdown {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  width: min(326px, 100%);
  margin: 42px auto 0;
}

.countdown div {
  display: grid;
  gap: 3px;
}

.countdown strong {
  color: var(--white);
  font-family: var(--font-serif);
  font-size: 2.15rem;
  font-weight: 700;
  line-height: 1;
}

.countdown span {
  color: rgba(255, 253, 248, 0.78);
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
}

.mini-calendar {
  width: min(318px, 100%);
  margin: 54px auto 0;
  color: rgba(255, 253, 248, 0.88);
}

.mini-calendar p {
  margin-bottom: 20px;
  font-family: var(--font-serif);
  font-size: 1.36rem;
  font-weight: 700;
  text-transform: uppercase;
}

.mini-calendar ol {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 9px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.mini-calendar li {
  position: relative;
  display: grid;
  min-height: 32px;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 50%;
  font-family: var(--font-serif);
  font-size: 0.98rem;
  line-height: 1;
}

.mini-calendar .is-selected {
  border-color: transparent;
  background: transparent;
  color: var(--white);
  z-index: 1;
}

.mini-calendar .is-selected::before {
  content: "♡";
  position: absolute;
  top: 65%;
  left: 50%;
  transform: translate(-50%, -52%);
  font-size: 2.35rem;
  line-height: 1;
  color: rgba(255, 253, 248, 0.82);
  z-index: -1;
}

.section-heading {
  position: relative;
  z-index: 1;
  text-align: center;
}

.section-heading img {
  width: 70px;
  margin: 0 auto 14px;
  opacity: 0.78;
}

.section-heading .section-kicker,
.dress-panel .section-kicker {
  color: var(--sage-deep);
}

.section-heading h2,
.dress-panel h2,
.gift-panel h2,
.confirm-panel h2,
.recommendations h2 {
  margin: 8px 0 0;
  color: var(--ink);
  font-size: 2.75rem;
  line-height: 1;
}

.location-block {
  position: relative;
  z-index: 1;
  width: min(305px, 100%);
  margin: 24px auto 0;
  color: var(--ink);
}

.event-time {
  margin: 0 0 8px;
  font-family: var(--font-serif);
  font-size: 1.35rem;
  font-weight: 700;
}

.location-block p:not(.event-time) {
  margin: 0;
  color: var(--muted);
  font-family: var(--font-serif);
  font-size: 1.04rem;
  font-weight: 600;
  line-height: 1.45;
}

.location-block a {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  margin-top: 22px;
  padding: 0 24px;
  border: 1px solid rgba(75, 67, 57, 0.5);
  border-radius: 6px;
  color: var(--ink);
  font-weight: 700;
  text-decoration: none;
}

.location-block a:hover {
  background: rgba(111, 121, 83, 0.08);
}

.paper-sheet--program {
  padding-top: 38px;
}

.program-line {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 24px;
  width: min(320px, 100%);
  margin: 44px auto 0;
  padding: 0;
  list-style: none;
}

.program-line::before {
  content: "";
  position: absolute;
  top: 9px;
  bottom: 9px;
  left: 50%;
  width: 1px;
  background: rgba(75, 67, 57, 0.42);
  transform: translateX(-50%);
}

.program-line li {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 42px 1fr;
  align-items: center;
  min-height: 58px;
}

.program-line li::before {
  content: "";
  grid-column: 2;
  justify-self: center;
  width: 11px;
  height: 11px;
  border: 2px solid var(--paper);
  border-radius: 50%;
  background: var(--sage);
  box-shadow: 0 0 0 1px rgba(75, 67, 57, 0.38);
}

.program-line time {
  grid-column: 1;
  grid-row: 1;
  justify-self: end;
  color: var(--sage-deep);
  font-size: 0.78rem;
  font-weight: 800;
}

.program-line img {
  grid-column: 1;
  grid-row: 1;
  justify-self: center;
  color: var(--sage-deep);
}
.program-line span {
  grid-column: 3;
  grid-row: 1;
  justify-self: start;
  color: var(--ink);
  font-family: var(--font-serif);
  font-size: 0.92rem;
  font-weight: 700;
  line-height: 1.15;
  text-align: left;
  text-transform: uppercase;
}

.wide-photo,
.closing-photo {
  padding: 28px;
  background: var(--paper);
}

.wide-photo img,
.closing-photo img {
  width: 100%;
  height: 272px;
  border: 1px solid rgba(39, 35, 31, 0.12);
  object-fit: cover;
}

.dress-panel {
  position: relative;
  z-index: 1;
  width: min(315px, 100%);
  margin: 0 auto;
  color: var(--muted);
}

.dress-panel h2 {
  margin-top: 10px;
}

.dress-panel p:last-child {
  margin: 20px 0 0;
  font-family: var(--font-serif);
  font-size: 1.05rem;
  font-style: italic;
  font-weight: 600;
  line-height: 1.45;
}

.gift-panel img {
  position: relative;
  z-index: 1;
  width: 126px;
  margin: 0 auto 18px;
  filter: brightness(0) invert(1);
  opacity: 0.9;
}

.gift-panel .section-kicker,
.confirm-panel .section-kicker {
  position: relative;
  z-index: 1;
  color: rgba(255, 253, 248, 0.82);
}

.gift-panel h2,
.confirm-panel h2 {
  position: relative;
  z-index: 1;
  color: var(--white);
}

.gift-panel p:not(.section-kicker),
.confirm-panel > p {
  position: relative;
  z-index: 1;
  width: min(310px, 100%);
  margin: 18px auto 0;
  color: rgba(255, 253, 248, 0.88);
  font-family: var(--font-serif);
  font-size: 1.08rem;
  font-weight: 600;
  line-height: 1.45;
}

.confirm-panel {
  padding-top: 58px;
  background:
    linear-gradient(180deg, rgba(255, 253, 248, 0.1), transparent 26%),
    var(--sage-dark);
}

.confirm-panel img {
  position: relative;
  z-index: 1;
  width: 74px;
  margin: 0 auto 14px;
  filter: brightness(0) invert(1);
  opacity: 0.88;
}

.rsvp-form {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 11px;
  width: min(310px, 100%);
  margin: 32px auto 0;
  text-align: left;
}

.rsvp-form label {
  color: rgba(255, 253, 248, 0.92);
  font-size: 0.82rem;
  font-weight: 800;
}

.rsvp-form input {
  width: 100%;
  min-height: 48px;
  padding: 0 14px;
  border: 1px solid rgba(255, 253, 248, 0.48);
  border-radius: 6px;
  background: rgba(255, 253, 248, 0.94);
  color: var(--ink);
}

.rsvp-form input:focus {
  outline: 2px solid rgba(255, 253, 248, 0.62);
  outline-offset: 2px;
}

.rsvp-form button {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  margin-top: 8px;
  border: 1px solid rgba(255, 253, 248, 0.72);
  border-radius: 6px;
  background: transparent;
  color: var(--white);
  font-weight: 800;
  cursor: pointer;
  transition:
    background 160ms ease,
    color 160ms ease,
    transform 160ms ease;
}

.rsvp-form button:hover {
  background: var(--white);
  color: var(--sage-deep);
  transform: translateY(-1px);
}

.rsvp-form button:disabled {
  cursor: progress;
  opacity: 0.66;
  transform: none;
}

.form-status {
  min-height: 24px;
  margin: 4px 0 0;
  color: rgba(255, 253, 248, 0.9);
  font-size: 0.84rem;
  font-weight: 800;
  text-align: center;
}

.form-status.is-error {
  color: #ffd5d1;
}

.paper-sheet--thanks {
  padding-top: 54px;
  padding-bottom: 54px;
}

.recommendations {
  position: relative;
  z-index: 1;
  width: min(318px, 100%);
  margin: 0 auto;
  color: var(--ink);
}

.recommendations span {
  display: block;
  width: 30px;
  height: 24px;
  margin: 0 auto 18px;
  background: var(--sage-dark);
  clip-path: polygon(50% 100%, 8% 52%, 0 28%, 8% 8%, 28% 0, 50% 20%, 72% 0, 92% 8%, 100% 28%, 92% 52%);
}

.recommendations h2 {
  font-family: var(--font-serif);
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.recommendations p {
  margin: 18px 0 0;
  color: var(--ink);
  font-family: var(--font-serif);
  font-size: 1.06rem;
  font-weight: 600;
  line-height: 1.45;
}

.recommendations .signature {
  margin-top: 34px;
  color: var(--sage-dark);
  font-size: 2.8rem;
  line-height: 1;
}

.closing-photo {
  padding-top: 6px;
  padding-bottom: 32px;
}

.closing-photo img {
  height: 430px;
}

@media (max-width: 560px) {
  .chapter-nav {
    display: none;
  }

  .invitation-scroll {
    border-left-width: 10px;
    border-right-width: 10px;
  }
}

@media (max-width: 420px) {
  .invitation-scroll {
    border-left-width: 6px;
    border-right-width: 6px;
  }

  .envelope-hero {
    padding: 12px;
  }

  .envelope-card {
    min-height: 584px;
  }

  .envelope-card__content {
    inset: 74px 14px 62px;
  }

  h1 {
    font-size: 4.05rem;
  }

  h1 em {
    font-size: 2.55rem;
  }

  .hero-date {
    margin-top: 76px;
  }

  .paper-sheet,
  .date-panel,
  .gift-panel,
  .confirm-panel {
    padding-left: 22px;
    padding-right: 22px;
  }

  .portrait-frame img {
    height: 480px;
  }

  .section-heading h2,
  .dress-panel h2,
  .gift-panel h2,
  .confirm-panel h2 {
    font-size: 2.45rem;
  }

  .date-display {
    gap: 10px;
  }

  .date-display strong {
    font-size: 3.65rem;
  }

  .countdown strong {
    font-size: 1.84rem;
  }

  .program-line {
    gap: 20px;
  }
}

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

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