:root {
  --desk: #1b3733;
  --desk-deep: #122925;
  --paper: #f4efdf;
  --paper-light: #fbf8ef;
  --paper-deep: #e9e1cd;
  --ink: #28261f;
  --muted: #6d685b;
  --rule: #c9bea7;
  --rule-deep: #918570;
  --seal: #9b3a30;
  --seal-deep: #74271f;
  --sage: #dce5df;
  --white: #fffdf8;
  --error: #9b2f27;
  --font-body: "Source Han Sans SC", "Noto Sans CJK SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  --font-serif: "Source Han Serif SC", "Noto Serif CJK SC", "Songti SC", "STSong", serif;
  --page-pad: clamp(18px, 4vw, 56px);
  --sheet-width: 1040px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  overflow-x: hidden;
  color: var(--ink);
  background: var(--desk);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.7;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
}

button,
input,
select,
textarea {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

:focus-visible {
  outline: 3px solid var(--seal);
  outline-offset: 4px;
}

.skip-link {
  position: fixed;
  z-index: 100;
  top: 12px;
  left: 12px;
  padding: 10px 14px;
  color: var(--white);
  background: var(--seal-deep);
  transform: translateY(-160%);
}

.skip-link:focus {
  transform: translateY(0);
}

.utility-bar {
  display: flex;
  justify-content: space-between;
  gap: 28px;
  align-items: center;
  width: min(calc(100% - var(--page-pad) * 2), 1180px);
  margin: 0 auto;
  padding: 24px 0;
  color: rgba(255, 253, 248, 0.78);
}

.utility-bar p {
  margin: 0;
  font-size: 12px;
  letter-spacing: 0.08em;
}

.wordmark {
  display: inline-flex;
  gap: 12px;
  align-items: center;
  text-decoration: none;
}

.wordmark-seal {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  color: var(--seal-deep);
  background: var(--paper);
  border: 1px solid var(--paper);
  font-family: var(--font-serif);
  font-size: 20px;
}

.wordmark > span:last-child {
  display: grid;
  line-height: 1.25;
}

.wordmark b {
  color: var(--white);
  font-family: var(--font-serif);
  font-size: 17px;
  letter-spacing: 0.12em;
}

.wordmark small {
  color: rgba(255, 253, 248, 0.56);
  font-size: 11px;
}

.invitation-stage {
  position: relative;
  display: grid;
  grid-template-columns: 72px minmax(0, var(--sheet-width));
  gap: 0;
  justify-content: center;
  width: min(calc(100% - var(--page-pad) * 2), calc(var(--sheet-width) + 72px));
  margin: 0 auto 76px;
}

.folio-rail {
  position: sticky;
  top: 24px;
  z-index: 2;
  display: flex;
  width: 72px;
  max-height: calc(100vh - 48px);
  align-self: start;
  align-items: center;
  flex-direction: column;
  padding: 26px 12px;
  color: rgba(255, 253, 248, 0.7);
  border: 1px solid rgba(255, 253, 248, 0.24);
  border-right: 0;
}

.folio-rail span {
  writing-mode: vertical-rl;
  font-size: 11px;
  letter-spacing: 0.2em;
}

.folio-rail b {
  margin-top: 20px;
  color: var(--white);
  font-family: var(--font-serif);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.08em;
  writing-mode: vertical-rl;
}

.folio-rail i {
  flex: 1;
  width: 1px;
  min-height: 70px;
  margin: 26px 0;
  background: rgba(255, 253, 248, 0.28);
}

.invitation-sheet {
  position: relative;
  min-width: 0;
  padding: clamp(34px, 7vw, 86px) clamp(26px, 8vw, 104px) 0;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--paper-deep);
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.22);
  animation: invitation-enter 700ms cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

.invitation-sheet::before {
  position: absolute;
  inset: 12px;
  pointer-events: none;
  border: 1px solid rgba(100, 86, 60, 0.2);
  content: "";
}

.letterhead {
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 32px;
  padding-bottom: 34px;
  border-bottom: 1px solid var(--rule);
}

.letter-kicker {
  margin: 0;
  color: var(--seal-deep);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.18em;
}

h1,
h2,
h3,
p,
dl,
dd,
blockquote {
  margin: 0;
}

h1,
h2,
h3 {
  font-family: var(--font-serif);
  font-weight: 600;
}

h1 {
  margin-top: 9px;
  font-size: clamp(42px, 7vw, 76px);
  line-height: 1.1;
  letter-spacing: 0.18em;
}

h2 {
  font-size: clamp(28px, 4.2vw, 48px);
  line-height: 1.35;
  letter-spacing: -0.02em;
}

h3 {
  font-size: 27px;
  line-height: 1.35;
}

.letter-seal {
  position: relative;
  display: grid;
  width: clamp(70px, 9vw, 92px);
  height: clamp(70px, 9vw, 92px);
  place-content: center;
  color: var(--seal);
  border: 2px solid currentColor;
  border-radius: 50%;
  text-align: center;
  transform: rotate(7deg);
}

.letter-seal::before {
  position: absolute;
  inset: 5px;
  border: 1px solid currentColor;
  border-radius: inherit;
  content: "";
}

.letter-seal span {
  font-family: var(--font-serif);
  font-size: clamp(25px, 3.2vw, 34px);
  line-height: 1;
}

.letter-seal small {
  margin-top: 4px;
  font-size: 9px;
  letter-spacing: 0.12em;
}

.letter-copy {
  display: grid;
  gap: 20px;
  padding: clamp(46px, 7vw, 76px) 0;
}

.letter-copy > p {
  max-width: 690px;
  color: var(--muted);
  font-family: var(--font-serif);
  font-size: clamp(16px, 2vw, 18px);
  line-height: 2;
}

.letter-copy .salutation {
  color: var(--ink);
  font-size: clamp(18px, 2.2vw, 21px);
}

.letter-copy .opening {
  color: var(--ink);
  font-size: clamp(24px, 3.2vw, 34px);
  line-height: 1.55;
}

.letter-copy blockquote {
  position: relative;
  max-width: 760px;
  margin: 24px 0 12px;
  padding: 24px 0 24px 28px;
  color: var(--ink);
  border-left: 2px solid var(--seal);
  font-family: var(--font-serif);
  font-size: clamp(22px, 3vw, 32px);
  line-height: 1.6;
}

.invitation-terms {
  display: grid;
  margin-top: 22px;
  border-top: 1px solid var(--rule);
}

.invitation-terms div {
  display: grid;
  grid-template-columns: 116px minmax(0, 1fr);
  gap: 28px;
  padding: 17px 0;
  border-bottom: 1px solid var(--rule);
}

.invitation-terms dt {
  color: var(--seal-deep);
  font-size: 13px;
  font-weight: 700;
}

.invitation-terms dd {
  color: var(--muted);
  font-size: 14px;
}

.promise-note {
  margin-right: clamp(-104px, -7vw, -26px);
  margin-left: clamp(-104px, -7vw, -26px);
  padding: clamp(36px, 5vw, 58px) clamp(26px, 8vw, 104px);
  background: var(--desk);
  color: var(--white);
}

.promise-note .letter-kicker {
  color: rgba(255, 253, 248, 0.58);
}

.promise-note h2 {
  max-width: 720px;
  margin-top: 12px;
}

.promise-lines {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 40px;
  border-top: 1px solid rgba(255, 253, 248, 0.24);
}

.promise-lines p {
  display: grid;
  gap: 8px;
  min-width: 0;
  padding: 22px 22px 0 0;
}

.promise-lines p + p {
  padding-left: 22px;
  border-left: 1px solid rgba(255, 253, 248, 0.16);
}

.promise-lines b {
  font-family: var(--font-serif);
  font-size: 28px;
  font-weight: 500;
}

.promise-lines span {
  color: rgba(255, 253, 248, 0.65);
  font-size: 13px;
}

.letter-fit {
  display: grid;
  grid-template-columns: minmax(230px, 0.85fr) minmax(0, 1.15fr);
  gap: clamp(38px, 7vw, 82px);
  padding: clamp(52px, 8vw, 82px) 0;
  border-bottom: 1px solid var(--rule);
}

.letter-fit h2 {
  margin-top: 12px;
}

.fit-list {
  display: grid;
  align-content: start;
  border-top: 1px solid var(--rule-deep);
}

.fit-list p {
  position: relative;
  padding: 16px 0 16px 30px;
  color: var(--muted);
  border-bottom: 1px solid var(--rule);
  font-family: var(--font-serif);
}

.fit-list p::before {
  position: absolute;
  top: 19px;
  left: 2px;
  color: var(--seal);
  content: "·";
  font-family: var(--font-body);
  font-size: 24px;
}

.sequence {
  padding: clamp(52px, 8vw, 82px) 0;
  border-bottom: 1px solid var(--rule);
}

.sequence h2 {
  max-width: 670px;
  margin-top: 12px;
}

.sequence ol {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 42px 0 0;
  padding: 0;
  border-top: 1px solid var(--rule-deep);
  list-style: none;
}

.sequence li {
  min-width: 0;
  padding: 19px 18px 12px 0;
  border-right: 1px solid var(--rule);
}

.sequence li + li {
  padding-left: 18px;
}

.sequence li:last-child {
  border-right: 0;
}

.sequence li > span {
  display: block;
  margin-bottom: 34px;
  color: var(--seal);
  font-family: var(--font-serif);
  font-size: 18px;
}

.sequence b {
  display: block;
  font-family: var(--font-serif);
  font-size: 17px;
  font-weight: 600;
}

.sequence small {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.75;
}

.signature {
  display: grid;
  justify-content: end;
  gap: 28px;
  padding: clamp(44px, 7vw, 72px) 0;
  text-align: right;
}

.signature > p {
  color: var(--muted);
  font-family: var(--font-serif);
}

.signature div {
  display: grid;
  gap: 4px;
}

.signature b {
  font-family: var(--font-serif);
  font-size: 18px;
  font-weight: 600;
}

.signature span {
  color: var(--muted);
  font-size: 12px;
}

.rsvp {
  position: relative;
  margin-right: clamp(-104px, -7vw, -26px);
  margin-left: clamp(-104px, -7vw, -26px);
  padding: clamp(46px, 7vw, 76px) clamp(26px, 8vw, 104px) clamp(56px, 8vw, 86px);
  background: var(--paper-light);
}

.rsvp::before,
.rsvp::after {
  position: absolute;
  top: 29px;
  width: 24px;
  height: 24px;
  background: var(--paper);
  border-radius: 50%;
  content: "";
}

.rsvp::before {
  left: -12px;
}

.rsvp::after {
  right: -12px;
}

.tear-line {
  position: relative;
  height: 1px;
  margin-bottom: 44px;
  border-top: 1px dashed var(--rule-deep);
}

.tear-line span {
  position: absolute;
  top: -13px;
  left: 50%;
  padding: 0 12px;
  color: var(--seal-deep);
  background: var(--paper-light);
  font-family: var(--font-serif);
  font-size: 12px;
  letter-spacing: 0.3em;
  transform: translateX(-50%);
}

.rsvp-head {
  display: flex;
  justify-content: space-between;
  gap: 48px;
  align-items: flex-end;
  padding-bottom: 34px;
  border-bottom: 2px solid var(--ink);
}

.rsvp-head h2 {
  margin-top: 9px;
}

.rsvp-head > p {
  color: var(--muted);
  font-size: 12px;
  text-align: right;
}

.form-block {
  min-width: 0;
  margin: 0;
  padding: 34px 0;
  border: 0;
  border-bottom: 1px solid var(--rule);
}

.form-block legend {
  margin-bottom: 22px;
  padding: 0;
  color: var(--seal-deep);
  font-family: var(--font-serif);
  font-size: 18px;
  font-weight: 600;
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px 18px;
}

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

.field {
  display: grid;
  min-width: 0;
  align-content: start;
  gap: 8px;
}

.field-wide {
  grid-column: 1 / -1;
}

.field > span:first-child,
.radio-field legend {
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
}

.field b,
.radio-field b {
  color: var(--seal);
}

.field em {
  color: var(--muted);
  font-style: normal;
  font-weight: 400;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 46px;
  padding: 11px 12px;
  color: var(--ink);
  background: rgba(255, 253, 248, 0.7);
  border: 0;
  border-bottom: 1px solid var(--rule-deep);
  border-radius: 0;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: 0;
  border-bottom-color: var(--seal);
  box-shadow: 0 2px 0 var(--seal);
}

.field textarea {
  min-height: 132px;
  resize: vertical;
  border: 1px solid var(--rule);
}

.field input::placeholder,
.field textarea::placeholder {
  color: #918b7d;
}

.field input[aria-invalid="true"],
.field select[aria-invalid="true"],
.field textarea[aria-invalid="true"],
input[aria-invalid="true"],
select[aria-invalid="true"] {
  border-color: var(--error);
}

.field-error {
  min-height: 17px;
  color: var(--error);
  font-size: 12px;
}

.character-count {
  justify-self: end;
  color: var(--muted);
  font-size: 11px;
}

.radio-field {
  padding: 0;
  border: 0;
}

.radio-field legend {
  margin-bottom: 10px;
}

.radio-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.radio-options label {
  display: flex;
  min-height: 46px;
  align-items: center;
  gap: 9px;
  padding: 10px 12px;
  background: rgba(255, 253, 248, 0.64);
  border: 1px solid var(--rule);
  cursor: pointer;
  font-size: 13px;
}

.radio-options input {
  flex: 0 0 17px;
  width: 17px;
  height: 17px;
  min-height: 0;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 50%;
  accent-color: var(--seal);
}

.consent-field {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  gap: 10px;
  margin-top: 28px;
  align-items: start;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
  cursor: pointer;
}

.consent-field input {
  width: 17px;
  height: 17px;
  margin: 2px 0 0;
  accent-color: var(--seal);
}

.consent-error {
  margin-top: 5px;
}

.form-submit-row {
  display: flex;
  justify-content: space-between;
  gap: 28px;
  align-items: center;
  margin-top: 30px;
}

.form-submit-row p {
  max-width: 370px;
  color: var(--muted);
  font-size: 12px;
}

.button {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 0 22px;
  border: 1px solid transparent;
  border-radius: 0;
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
}

.button-primary {
  color: var(--white);
  background: var(--seal);
  border-color: var(--seal);
}

.button-primary:hover {
  background: var(--seal-deep);
  border-color: var(--seal-deep);
}

.submit-button {
  min-width: 176px;
}

.submit-button:disabled {
  cursor: wait;
  opacity: 0.58;
}

.form-status {
  min-height: 22px;
  margin-top: 14px;
  color: var(--error);
  font-size: 13px;
}

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

.success-panel {
  padding: 44px 0 12px;
  text-align: center;
}

.success-seal {
  display: grid;
  width: 68px;
  height: 68px;
  margin: 0 auto 24px;
  place-items: center;
  color: var(--seal);
  border: 2px solid currentColor;
  border-radius: 50%;
  font-family: var(--font-serif);
  font-size: 28px;
  transform: rotate(-5deg);
}

.success-panel h3 {
  margin-top: 10px;
  font-size: clamp(28px, 4vw, 42px);
}

.success-panel > p:not(.letter-kicker) {
  max-width: 540px;
  margin: 18px auto 0;
  color: var(--muted);
}

.success-reference {
  display: inline-flex;
  gap: 16px;
  margin-top: 28px;
  padding: 12px 16px;
  border: 1px solid var(--rule);
  font-size: 13px;
}

.success-reference span {
  color: var(--muted);
}

.text-link {
  display: block;
  width: fit-content;
  margin: 24px auto 0;
  padding: 8px 0;
  color: var(--seal-deep);
  background: transparent;
  border: 0;
  border-bottom: 1px solid currentColor;
  cursor: pointer;
  text-decoration: none;
}

.letter-footer {
  display: grid;
  gap: 4px;
  margin-right: clamp(-104px, -7vw, -26px);
  margin-left: clamp(-104px, -7vw, -26px);
  padding: 28px clamp(26px, 8vw, 104px);
  color: rgba(255, 253, 248, 0.7);
  background: var(--desk-deep);
  font-size: 11px;
}

.letter-footer p:first-child {
  color: var(--white);
  font-family: var(--font-serif);
  font-size: 13px;
}

.mobile-rsvp {
  display: none;
}

@keyframes invitation-enter {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 980px) {
  .invitation-stage {
    grid-template-columns: 58px minmax(0, 1fr);
    width: min(calc(100% - var(--page-pad) * 2), 860px);
  }

  .folio-rail {
    width: 58px;
  }

  .sequence ol {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .sequence li:nth-child(2) {
    border-right: 0;
  }

  .sequence li:nth-child(-n + 2) {
    border-bottom: 1px solid var(--rule);
  }
}

@media (max-width: 720px) {
  body {
    padding-bottom: 64px;
  }

  .utility-bar {
    padding: 17px 0;
  }

  .utility-bar > p {
    display: none;
  }

  .wordmark small {
    display: none;
  }

  .invitation-stage {
    display: block;
    width: 100%;
    margin: 0;
  }

  .folio-rail {
    position: static;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    width: auto;
    max-height: none;
    align-items: center;
    margin: 0 14px;
    padding: 12px 14px;
    border-right: 1px solid rgba(255, 253, 248, 0.24);
  }

  .folio-rail span {
    writing-mode: horizontal-tb;
  }

  .folio-rail span:last-child {
    text-align: right;
  }

  .folio-rail b {
    margin: 0;
    writing-mode: horizontal-tb;
  }

  .folio-rail i {
    display: none;
  }

  .invitation-sheet {
    padding: 36px 22px 0;
    border-right: 0;
    border-left: 0;
  }

  .invitation-sheet::before {
    inset: 8px;
  }

  .letterhead {
    padding-bottom: 24px;
  }

  h1 {
    font-size: 48px;
  }

  .letter-copy {
    padding: 42px 0;
  }

  .letter-copy .opening {
    font-size: 25px;
  }

  .letter-copy blockquote {
    padding-left: 20px;
    font-size: 23px;
  }

  .invitation-terms div {
    grid-template-columns: minmax(0, 1fr);
    gap: 6px;
  }

  .promise-note,
  .rsvp,
  .letter-footer {
    margin-right: -22px;
    margin-left: -22px;
    padding-right: 22px;
    padding-left: 22px;
  }

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

  .promise-lines p {
    padding: 18px 0;
    border-bottom: 1px solid rgba(255, 253, 248, 0.16);
  }

  .promise-lines p + p {
    padding-left: 0;
    border-left: 0;
  }

  .letter-fit {
    grid-template-columns: minmax(0, 1fr);
    gap: 34px;
  }

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

  .sequence li,
  .sequence li + li {
    padding: 18px 0;
    border-right: 0;
    border-bottom: 1px solid var(--rule);
  }

  .sequence li:last-child {
    border-bottom: 0;
  }

  .sequence li > span {
    margin-bottom: 12px;
  }

  .signature {
    justify-content: start;
    text-align: left;
  }

  .rsvp-head {
    display: block;
  }

  .rsvp-head > p {
    margin-top: 16px;
    text-align: left;
  }

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

  .field-wide {
    grid-column: auto;
  }

  .form-submit-row {
    align-items: stretch;
    flex-direction: column;
  }

  .submit-button {
    width: 100%;
  }

  .mobile-rsvp {
    position: fixed;
    z-index: 30;
    right: 14px;
    bottom: 14px;
    left: 14px;
    display: grid;
    min-height: 48px;
    place-items: center;
    color: var(--white);
    background: var(--seal);
    border: 1px solid var(--seal);
    text-decoration: none;
    opacity: 0;
    transform: translateY(calc(100% + 24px));
    visibility: hidden;
    transition:
      opacity 180ms ease,
      transform 180ms ease,
      visibility 180ms;
  }

  .mobile-rsvp.is-visible {
    opacity: 1;
    transform: translateY(0);
    visibility: visible;
  }
}

@media (max-width: 420px) {
  .letter-seal {
    width: 62px;
    height: 62px;
  }

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

@media print {
  body {
    background: #ffffff;
  }

  .utility-bar,
  .folio-rail,
  .mobile-rsvp {
    display: none;
  }

  .invitation-stage {
    display: block;
    width: 100%;
    margin: 0;
  }

  .invitation-sheet {
    padding: 28px 42px 0;
    border: 0;
    box-shadow: none;
    animation: none;
  }
}

@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;
    scroll-behavior: auto !important;
  }
}
