:root {
  --wine: #8b1538;
  --wine-dark: #5b0e27;
  --cream: #fff8ed;
  --paper: #fffdf7;
  --muted: #7b5a61;
  --line: rgba(139, 21, 56, 0.25);
  --shadow: 0 28px 70px rgba(31, 20, 18, 0.22);
  --script: "Monotype Corsiva", "Segoe Script", "Brush Script MT", "Apple Chancery", cursive;
  --serif: Georgia, "Times New Roman", serif;
  --sans: "Trebuchet MS", "Segoe UI", Arial, sans-serif;
  --site-bg-image: url("assets/decor/background-architecture.svg");
  --site-bg-opacity: 0.62;
  --site-bg-size: cover;
  --site-bg-position: center center;
  --body-bg: #d9d4c9;
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  min-height: 100svh;
  color: var(--wine-dark);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.65;
  background:
    linear-gradient(90deg, rgba(36, 35, 32, 0.22), rgba(255, 248, 237, 0.76) 24%, rgba(255, 248, 237, 0.86) 76%, rgba(36, 35, 32, 0.24)),
    var(--body-bg);
  overflow-x: hidden;
}

img,
svg {
  max-width: 100%;
}

h1,
h2,
h3,
p,
a,
time,
span {
  overflow-wrap: normal;
  word-break: normal;
  hyphens: none;
}

.site-bg {
  position: fixed;
  inset: 0;
  z-index: -2;
  background-image: var(--site-bg-image);
  background-size: var(--site-bg-size);
  background-position: var(--site-bg-position);
  background-repeat: no-repeat;
  filter: grayscale(1);
  opacity: var(--site-bg-opacity);
}

.site-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 50% 14%, rgba(255, 255, 255, .86), transparent 42%),
    linear-gradient(90deg, rgba(255, 248, 237, .72), rgba(255, 248, 237, .42), rgba(255, 248, 237, .72));
}

.invitation {
  width: min(1180px, calc(100% - 48px));
  margin: 0 auto;
  padding: 56px 0 68px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 40px;
  align-items: start;
}

.paper {
  position: relative;
  min-height: 1180px;
  padding: clamp(34px, 3.25vw, 54px);
  background:
    linear-gradient(180deg, rgba(255, 253, 247, .955), rgba(255, 248, 237, .988)),
    url("assets/decor/paper-grain.svg");
  border: 1px solid rgba(139, 21, 56, 0.12);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.paper > * {
  position: relative;
  z-index: 1;
}

.paper::before,
.paper::after {
  content: "";
  position: absolute;
  pointer-events: none;
  border: 1px solid var(--line);
  opacity: .85;
}

.paper::before {
  inset: 14px;
}

.paper::after {
  inset: 21px;
  border-color: rgba(139, 21, 56, .09);
}

.paper-left {
  border-radius: 2px 2px 30px 30px;
}

.paper-right {
  border-radius: 2px 2px 24px 24px;
}

.script {
  font-family: var(--script);
  font-weight: 400;
  letter-spacing: .02em;
}

.caps {
  margin: 0;
  font-family: var(--sans);
  font-size: clamp(1rem, 1.55vw, 1.42rem);
  line-height: 1.35;
  letter-spacing: .08em;
  text-transform: lowercase;
}

.envelope-card {
  position: relative;
  width: min(420px, 100%);
  margin: 0 auto clamp(30px, 4vw, 42px);
  isolation: isolate;
}

.envelope-img {
  width: 100%;
  display: block;
  filter: drop-shadow(0 20px 20px rgba(66, 28, 34, .22));
}

.envelope-copy {
  position: absolute;
  inset: 18% 10% auto;
  z-index: 2;
  color: var(--paper);
  text-align: center;
}

.accent-line {
  margin: .2rem 0 0;
  font-size: clamp(2rem, 3.5vw, 3.45rem);
  line-height: .9;
}

.intro {
  width: min(390px, 100%);
  margin: 0 auto clamp(30px, 4vw, 42px);
  color: var(--wine-dark);
  font-size: clamp(.96rem, 1.2vw, 1.04rem);
  letter-spacing: .035em;
  text-align: center;
}

.name-frame {
  position: relative;
  width: min(420px, 100%);
  margin: 0 auto clamp(34px, 4vw, 44px);
  padding: clamp(48px, 5vw, 58px) clamp(20px, 3vw, 28px) clamp(38px, 4vw, 46px);
  text-align: center;
  background: rgba(255, 253, 247, .44);
  border: 2px solid rgba(139, 21, 56, .82);
  border-radius: 42% 42% 10% 10% / 14% 14% 8% 8%;
  clip-path: polygon(0 23%, 10% 15%, 14% 7%, 24% 5%, 31% 0, 69% 0, 76% 5%, 86% 7%, 90% 15%, 100% 23%, 100% 74%, 93% 80%, 91% 91%, 79% 93%, 72% 100%, 28% 100%, 21% 93%, 9% 91%, 7% 80%, 0 74%);
}

.name-frame::before {
  content: "";
  position: absolute;
  inset: 9px;
  border: 1px solid rgba(139, 21, 56, .62);
  clip-path: inherit;
  pointer-events: none;
}

.small-icon {
  width: 54px;
  height: 28px;
  object-fit: contain;
  margin-bottom: 10px;
}

.couple-title {
  margin: 0;
  color: var(--wine);
  font-size: clamp(3.25rem, 6vw, 5.2rem);
  line-height: .88;
  text-shadow: 0 12px 20px rgba(139, 21, 56, .08);
  white-space: pre-line;
}

.announcement {
  width: min(290px, 100%);
  margin: 34px auto 18px;
  font-size: .97rem;
  letter-spacing: .035em;
}

.date-row {
  display: grid;
  grid-template-columns: minmax(34px, 1fr) auto minmax(34px, 1fr);
  gap: 14px;
  align-items: center;
  margin-top: 20px;
}

.date-row time {
  color: var(--wine);
  font-family: var(--serif);
  font-size: clamp(2.25rem, 4.5vw, 3.25rem);
  letter-spacing: .14em;
  white-space: nowrap;
}

.thin-line {
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(139, 21, 56, .48), transparent);
}

.letter,
.place,
.countdown {
  text-align: center;
}

.section-script {
  margin: 0 0 18px;
  color: var(--wine);
  font-size: clamp(2.1rem, 3.6vw, 3rem);
  line-height: 1;
  text-wrap: balance;
}

.letter p,
.place p,
.gift-card p {
  width: min(370px, 100%);
  margin: 0 auto;
  letter-spacing: .025em;
}

.mini-calendar {
  width: min(385px, 100%);
  margin: clamp(34px, 4.5vw, 42px) auto 36px;
  text-align: center;
}

.calendar-month {
  margin: 0 0 18px;
  color: var(--wine);
  font-size: clamp(2.1rem, 3.6vw, 3rem);
}

.weekdays,
.days {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 10px;
  align-items: center;
}

.weekdays span {
  font-size: .86rem;
  font-weight: 700;
  letter-spacing: .1em;
  white-space: nowrap;
}

.days span {
  display: grid;
  min-height: 42px;
  place-items: center;
  font-family: var(--serif);
  font-size: 1.08rem;
}

.days .selected {
  position: relative;
  color: var(--paper);
}

.days .selected::before {
  content: "";
  position: absolute;
  width: 47px;
  height: 42px;
  background: var(--wine);
  border-radius: 50% 50% 45% 45%;
  transform: rotate(-9deg);
  z-index: -1;
  box-shadow: 0 9px 18px rgba(139, 21, 56, .24);
}

.place {
  margin-top: 36px;
}

.place-icon {
  display: block;
  width: min(180px, 52%);
  margin: 0 auto 12px;
}

.place-name {
  font-weight: 700;
  font-size: 1.03rem;
}

.place-address,
.place-note {
  color: var(--muted);
  font-size: .94rem;
}

.place-actions {
  margin-top: 20px;
}

.map-link {
  display: inline-flex;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  padding: 0 26px;
  border: 1px solid rgba(139, 21, 56, .55);
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(139, 21, 56, .94), rgba(91, 14, 39, 1));
  box-shadow: 0 14px 30px rgba(91, 14, 39, .18);
  color: var(--paper);
  text-decoration: none;
  letter-spacing: .05em;
  text-align: center;
  transition: transform .2s ease, box-shadow .2s ease, filter .2s ease;
}

.map-link:hover,
.map-link:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 18px 34px rgba(91, 14, 39, .22);
  filter: brightness(1.03);
}

.map-link:focus-visible {
  outline: 2px solid rgba(139, 21, 56, .22);
  outline-offset: 3px;
}

.bow {
  pointer-events: none;
  user-select: none;
}

.bow-top {
  position: absolute;
  top: 44px;
  right: 50px;
  width: 126px;
  transform: rotate(-7deg);
  filter: drop-shadow(0 12px 12px rgba(66, 28, 34, .22));
}

.page-title {
  max-width: calc(100% - 120px);
  margin: 0 auto 38px;
  color: var(--wine);
  font-size: clamp(3.2rem, 5.25vw, 4.8rem);
  line-height: 1;
  text-align: center;
  text-wrap: balance;
}

.timeline {
  position: relative;
  min-height: 720px;
  margin: 8px 0 50px;
  padding: 8px clamp(108px, 24%, 146px) 8px 0;
}

.timeline-curve {
  position: absolute;
  top: 0;
  right: 8px;
  bottom: 0;
  width: clamp(102px, 22%, 134px);
  height: 100%;
  color: var(--wine);
  opacity: .74;
  z-index: 0;
  pointer-events: none;
}

.timeline-curve path {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.45;
}

.timeline-list {
  position: relative;
  z-index: 2;
  display: grid;
  gap: 42px;
  max-width: 420px;
}

.timeline-item {
  position: relative;
  width: 100%;
  display: grid;
  grid-template-columns: clamp(62px, 6vw, 82px) minmax(0, 1fr);
  align-items: center;
  gap: clamp(14px, 2vw, 20px);
  min-height: 126px;
  margin: 0;
  padding: 6px 0;
}

.timeline-item:nth-child(even) {
  transform: translateX(clamp(12px, 5%, 34px));
}

.timeline-icon {
  width: clamp(62px, 6vw, 78px);
  height: clamp(62px, 6vw, 78px);
  object-fit: contain;
  justify-self: center;
}

.timeline-copy {
  min-width: 0;
  text-align: left;
}

.timeline-time {
  margin: 0;
  color: var(--wine);
  font-family: var(--serif);
  font-size: clamp(1.35rem, 1.9vw, 1.55rem);
  letter-spacing: .04em;
  white-space: nowrap;
}

.timeline-title {
  margin: 0 0 6px;
  color: var(--wine);
  font-family: var(--script);
  font-size: clamp(2rem, 3.1vw, 2.28rem);
  line-height: 1.02;
  text-wrap: balance;
}

.timeline-text {
  margin: 0;
  color: var(--muted);
  font-size: clamp(.9rem, 1.05vw, .94rem);
  line-height: 1.48;
}

.gift-card {
  position: relative;
  width: min(390px, 88%);
  margin: 0 auto 46px;
  padding: 46px 32px 34px;
  text-align: center;
  background: var(--paper);
  box-shadow: 0 20px 34px rgba(58, 38, 30, .16);
  transform: rotate(1.8deg);
}

.bow-card {
  position: absolute;
  top: -33px;
  left: -24px;
  width: 94px;
  transform: rotate(-22deg);
  filter: drop-shadow(0 9px 8px rgba(66, 28, 34, .2));
}

.gift-card h2 {
  max-width: 280px;
  margin: 0 auto 12px;
  font-size: 1.02rem;
  letter-spacing: .04em;
}

.countdown {
  margin-top: 12px;
}

.countdown-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  width: min(450px, 100%);
  margin: 24px auto 28px;
}

.count-item {
  min-width: 0;
  padding: 8px 3px;
  border-top: 1px solid rgba(139, 21, 56, .24);
  border-bottom: 1px solid rgba(139, 21, 56, .14);
}

.count-item strong {
  display: block;
  color: var(--wine);
  font-family: var(--serif);
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 400;
  line-height: 1.1;
}

.count-item span {
  display: block;
  color: var(--wine-dark);
  font-size: .78rem;
  letter-spacing: .05em;
  white-space: nowrap;
}

.rings-large {
  display: block;
  width: min(170px, 48%);
  margin: 0 auto;
}

.footer-note {
  margin: 22px auto 0;
  color: var(--wine);
  font-family: var(--script);
  font-size: clamp(1.85rem, 3vw, 2.1rem);
  text-align: center;
}

.reveal {
  animation: reveal .8s ease both;
}

.reveal:nth-of-type(2) { animation-delay: .06s; }
.reveal:nth-of-type(3) { animation-delay: .12s; }
.reveal:nth-of-type(4) { animation-delay: .18s; }
.reveal:nth-of-type(5) { animation-delay: .24s; }

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

@media (min-width: 1500px) {
  .invitation {
    width: min(1260px, calc(100% - 96px));
    gap: 56px;
    padding: 70px 0 84px;
  }

  .paper {
    min-height: 1260px;
    padding: 60px;
  }

  .envelope-card,
  .name-frame {
    width: min(450px, 100%);
  }

  .timeline {
    padding-right: 162px;
  }

  .timeline-curve {
    right: 18px;
    width: 148px;
  }
}

@media (min-width: 1920px) {
  .invitation {
    width: min(1320px, calc(100% - 160px));
  }
}

@media (max-width: 1320px) and (min-width: 1121px) {
  .invitation {
    width: min(1120px, calc(100% - 36px));
    gap: 30px;
  }

  .paper {
    padding: clamp(34px, 3vw, 44px);
  }

  .page-title {
    max-width: calc(100% - 92px);
  }

  .bow-top {
    right: 34px;
    width: 108px;
  }

  .timeline {
    padding-right: 104px;
  }

  .timeline-curve {
    right: 4px;
    width: 94px;
  }

  .timeline-list {
    max-width: 380px;
  }

  .timeline-item {
    grid-template-columns: 68px minmax(0, 1fr);
    gap: 15px;
  }

  .timeline-icon {
    width: 64px;
    height: 64px;
  }

  .timeline-title {
    font-size: 2rem;
  }
}

@media (max-width: 1120px) {
  body {
    background:
      linear-gradient(180deg, rgba(255, 248, 237, .84), rgba(255, 248, 237, .94)),
      var(--body-bg);
  }

  .site-bg {
    opacity: min(var(--site-bg-opacity), .48);
  }

  .invitation {
    width: min(700px, calc(100% - 28px));
    grid-template-columns: 1fr;
    gap: 24px;
    padding: 24px 0 42px;
  }

  .paper {
    min-height: auto;
    padding: clamp(34px, 6vw, 54px);
  }

  .paper-left {
    border-radius: 2px 2px 26px 26px;
  }

  .paper-right {
    border-radius: 26px 26px 2px 2px;
  }

  .bow-top {
    right: 28px;
    width: 104px;
  }

  .page-title {
    max-width: calc(100% - 90px);
  }

  .timeline {
    min-height: auto;
    padding-right: 128px;
  }

  .timeline-curve {
    right: 14px;
    width: 112px;
  }

  .timeline-list {
    max-width: 460px;
  }

  .timeline-item:nth-child(even) {
    transform: translateX(24px);
  }
}

@media (max-width: 760px) {
  .site-bg {
    background-size: auto 100%;
    background-position: center top;
    opacity: .36;
  }

  .invitation {
    width: min(100%, calc(100% - 18px));
    gap: 18px;
    padding: 12px 0 26px;
  }

  .paper {
    padding: 32px 20px 40px;
  }

  .paper::before {
    inset: 10px;
  }

  .paper::after {
    inset: 16px;
  }

  .envelope-card {
    width: min(370px, 100%);
  }

  .intro,
  .letter p,
  .place p,
  .gift-card p {
    width: min(32rem, 100%);
  }

  .name-frame {
    width: min(400px, 100%);
  }

  .timeline {
    padding-right: 92px;
  }

  .timeline-curve {
    right: 4px;
    width: 82px;
    opacity: .52;
  }

  .timeline-list {
    max-width: none;
  }
}

@media (max-width: 540px) {
  body {
    line-height: 1.56;
  }

  .invitation {
    width: 100%;
    gap: 0;
    padding: 0;
  }

  .paper {
    padding:
      max(32px, env(safe-area-inset-top))
      max(18px, env(safe-area-inset-right))
      40px
      max(18px, env(safe-area-inset-left));
    border-left: 0;
    border-right: 0;
    border-radius: 0;
    box-shadow: none;
    background:
      linear-gradient(180deg, rgba(255, 253, 247, .977), rgba(255, 248, 237, .994)),
      url("assets/decor/paper-grain.svg");
  }

  .paper::before {
    inset: 8px;
  }

  .paper::after {
    display: none;
  }

  .envelope-card {
    margin-bottom: 28px;
  }

  .envelope-copy {
    inset: 16% 8% auto;
  }

  .caps {
    font-size: clamp(.84rem, 3.9vw, 1.02rem);
  }

  .accent-line {
    font-size: clamp(1.68rem, 7.6vw, 2.35rem);
  }

  .intro {
    margin-bottom: 28px;
    font-size: .95rem;
  }

  .name-frame {
    padding: 46px 16px 36px;
  }

  .couple-title {
    font-size: clamp(2.65rem, 12.4vw, 3.8rem);
  }

  .announcement,
  .letter p,
  .place p,
  .gift-card p,
  .timeline-text {
    font-size: .92rem;
  }

  .date-row {
    grid-template-columns: minmax(18px, 1fr) auto minmax(18px, 1fr);
    gap: 8px;
  }

  .date-row time {
    font-size: clamp(1.95rem, 7.6vw, 2.65rem);
    letter-spacing: .09em;
  }

  .section-script,
  .calendar-month {
    font-size: clamp(1.95rem, 9.4vw, 2.55rem);
  }

  .weekdays,
  .days {
    gap: 5px;
  }

  .weekdays span {
    font-size: .74rem;
    letter-spacing: .07em;
  }

  .days span {
    min-height: 38px;
  }

  .days .selected::before {
    width: 40px;
    height: 36px;
  }

  .place-actions {
    display: flex;
  }

  .map-link {
    width: 100%;
    min-height: 50px;
  }

  .bow-top {
    top: 28px;
    right: 18px;
    width: 82px;
  }

  .page-title {
    max-width: calc(100% - 58px);
    margin: 0 auto 24px;
  }

  .timeline {
    margin-bottom: 32px;
    padding: 6px 62px 0 0;
  }

  .timeline-curve {
    right: 0;
    width: 54px;
    opacity: .42;
  }

  .timeline-list {
    gap: 28px;
  }

  .timeline-item,
  .timeline-item:nth-child(even) {
    grid-template-columns: 52px minmax(0, 1fr);
    min-height: 104px;
    gap: 10px;
    padding: 0;
    transform: none;
  }

  .timeline-icon {
    width: 50px;
    height: 50px;
  }

  .timeline-time {
    font-size: 1.28rem;
  }

  .timeline-title {
    font-size: clamp(1.62rem, 7.2vw, 1.9rem);
  }

  .gift-card {
    width: 100%;
    margin-bottom: 34px;
    padding: 38px 18px 28px;
    transform: none;
    box-shadow: 0 14px 28px rgba(58, 38, 30, .13);
  }

  .bow-card {
    top: -28px;
    left: -10px;
    width: 78px;
  }

  .countdown-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .rings-large {
    width: min(150px, 54%);
  }
}

@media (max-width: 380px) {
  .paper {
    padding-left: 14px;
    padding-right: 14px;
  }

  .paper::before {
    inset: 6px;
  }

  .name-frame {
    padding-left: 12px;
    padding-right: 12px;
  }

  .couple-title {
    font-size: clamp(2.5rem, 12vw, 3.15rem);
  }

  .date-row time {
    font-size: 1.72rem;
  }

  .weekdays span {
    font-size: .68rem;
    letter-spacing: .055em;
  }

  .days span {
    min-height: 34px;
    font-size: .98rem;
  }

  .timeline {
    padding-right: 44px;
  }

  .timeline-curve {
    width: 38px;
  }

  .timeline-item,
  .timeline-item:nth-child(even) {
    grid-template-columns: 42px minmax(0, 1fr);
    gap: 8px;
  }

  .timeline-icon {
    width: 40px;
    height: 40px;
  }

  .timeline-title {
    font-size: 1.52rem;
  }

  .timeline-text {
    font-size: .88rem;
  }

  .count-item strong {
    font-size: 1.7rem;
  }

  .count-item span {
    font-size: .72rem;
  }

  .map-link {
    padding-left: 14px;
    padding-right: 14px;
    font-size: .92rem;
  }
}

@media (max-width: 1120px) and (orientation: landscape) {
  .invitation {
    width: min(760px, calc(100% - 24px));
  }

  .paper {
    padding-top: 30px;
    padding-bottom: 36px;
  }

  .envelope-card,
  .name-frame {
    width: min(380px, 100%);
  }

  .timeline {
    padding-right: 110px;
  }

  .timeline-curve {
    width: 92px;
  }
}

@media (max-height: 720px) and (min-width: 1121px) {
  .invitation {
    padding-top: 30px;
    padding-bottom: 42px;
  }

  .paper {
    min-height: 1080px;
  }
}

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

  .reveal {
    animation: none;
  }

  .map-link {
    transition: none;
  }
}
