:root {
  --mist: #f2fbfa;
  --paper: #fff;
  --ink: #052b33;
  --text: #0c3038;
  --muted: #476169;
  --aqua: #00f8d8;
  --lagoon: #00727a;
  --cosmic: #5aa2ff;
  --line: rgba(5, 43, 51, .16);
  --line-ink: rgba(242, 251, 250, .2);
  --disp: "Big Shoulders Display", "Arial Narrow", Impact, sans-serif;
  --body: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --nav-h: 68px;
  --r: 4px;
  --r-btn: 12px 12px 12px 2px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-h) + 12px);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-width: 320px;
  overflow-x: hidden;
  background: var(--mist);
  color: var(--text);
  font: 400 16px/1.65 var(--body);
  -webkit-font-smoothing: antialiased;
}

button,
input,
textarea {
  font: inherit;
}

img,
svg {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
}

h1,
h2,
h3,
h4 {
  margin: 0 0 .5em;
  color: var(--ink);
  font-family: var(--disp);
  font-weight: 800;
  line-height: 1;
}

h1 {
  font-size: clamp(3.2rem, 10vw, 7.4rem);
  font-weight: 900;
  line-height: .9;
}

h2 {
  font-size: clamp(2.2rem, 7vw, 4rem);
}

h3 {
  font-size: 1.45rem;
  line-height: 1.05;
}

p {
  margin: 0 0 1em;
  max-width: 65ch;
}

::selection {
  background: var(--aqua);
  color: var(--ink);
}

:focus-visible {
  outline: 3px solid var(--lagoon);
  outline-offset: 3px;
}

.doodle,
.ampersand-cartoon {
  display: none;
}

.cover-screen {
  position: fixed;
  inset: 0;
  z-index: 50;
  min-height: 100dvh;
  overflow: hidden;
  background:
    radial-gradient(circle at 82% 18%, rgba(0, 248, 216, .12), transparent 22rem),
    linear-gradient(145deg, #f2fbfa 0%, #e4f6f4 58%, #d8efed 100%);
  transition: opacity 700ms cubic-bezier(.2, .7, .2, 1),
    visibility 700ms cubic-bezier(.2, .7, .2, 1),
    transform 700ms cubic-bezier(.2, .7, .2, 1);
}

.cover-screen.is-open {
  visibility: hidden;
  opacity: 0;
  transform: translateY(-100%);
  pointer-events: none;
}

.cover-inner {
  width: 100%;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 28px 20px 24px;
  text-align: center;
}

.cover-eyebrow {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 38px;
}

.cover-eyebrow img {
  width: 38px;
  height: 38px;
  object-fit: contain;
}

.cover-eyebrow .eyebrow,
.eyebrow,
.guest-label,
.card-label {
  margin: 0;
  color: var(--lagoon);
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: .12em;
  line-height: 1.3;
  text-transform: uppercase;
}

.cover-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: auto 0;
}

.cover-photo {
  position: relative;
  width: clamp(176px, 27vh, 238px);
  aspect-ratio: 4 / 5;
  margin-bottom: 18px;
  overflow: hidden;
  background: #cfece8;
}

.cover-photo img,
.person-photo img,
.gallery-grid img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 1;
}

.cover-photo,
.cartoon-box,
.cartoon-card,
.person-photo,
.gallery-grid figure,
.map-card,
.guestbook-form,
.guestbook-item,
.timeline-content,
.quote-card {
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--paper);
  box-shadow: none;
}

.cover-photo {
  border: 0;
  box-shadow: 0 12px 32px rgba(5, 43, 51, .2);
}

.guest-name {
  min-height: 28px;
  margin: 4px 0 8px;
  color: var(--ink);
  font-size: 19px;
  font-weight: 800;
  border-bottom: 2px solid var(--lagoon);
}

.cover-center h1 {
  max-width: 620px;
  margin: 8px 0 4px;
  font-size: clamp(38px, 9vw, 58px);
  line-height: .9;
}

.cover-center h1 span,
.hero-section h2 span {
  display: inline-block;
  transform: none;
}

.cover-date {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
}

.cartoon-button,
.copy-button {
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--ink);
  border-radius: var(--r-btn);
  padding: 12px 18px;
  background: transparent;
  color: var(--ink);
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
  transition: transform .18s, box-shadow .18s, background .18s;
}

.cartoon-button:hover,
.copy-button:hover {
  transform: translate(-2px, -2px);
  box-shadow: 3px 3px 0 var(--ink);
}

.open-button {
  min-width: 210px;
  background: var(--aqua);
  color: var(--ink);
  border-color: var(--ink);
  box-shadow: 3px 3px 0 var(--ink);
}

.invitation-nav {
  position: fixed;
  top: 12px;
  left: 50%;
  z-index: 45;
  width: min(680px, calc(100% - 24px));
  min-height: 58px;
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) 132px;
  align-items: center;
  gap: 6px;
  transform: translate(-50%, -90px);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 6px;
  background: rgba(242, 251, 250, .94);
  box-shadow: 0 10px 30px rgba(5, 43, 51, .10);
  opacity: 0;
  visibility: hidden;
  backdrop-filter: blur(12px);
  transition: transform .45s, opacity .45s, visibility .45s;
}

.invitation-nav.is-visible {
  transform: translate(-50%, 0);
  opacity: 1;
  visibility: visible;
}

.nav-brand,
.nav-music-toggle {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--paper);
  color: var(--ink);
  text-decoration: none;
  cursor: pointer;
}

.nav-brand {
  overflow: hidden;
  padding: 5px;
}

.nav-brand img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.nav-links {
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 2px;
}

.nav-links a {
  min-height: 44px;
  display: grid;
  place-items: center;
  color: var(--ink);
  font-size: .82rem;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
  border-bottom: 3px solid transparent;
}

.nav-links a:hover,
.nav-links a.is-active {
  border-bottom-color: var(--lagoon);
}

.nav-music-toggle {
  width: 132px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1px solid var(--ink);
}

.nav-music-toggle.is-playing {
  background: var(--aqua);
  color: var(--ink);
}

.nav-music-label {
  font-size: .68rem;
  font-weight: 800;
  white-space: nowrap;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.invitation-content {
  width: 100%;
  min-height: 100dvh;
  background: var(--mist);
  opacity: 0;
  transition: opacity 700ms ease 250ms;
}

.invitation-content.is-visible {
  opacity: 1;
}

.section-block {
  position: relative;
  width: 100%;
  min-height: 52vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding: 64px max(20px, calc((100% - 900px) / 2));
  border-bottom: 1px solid var(--line);
  text-align: center;
}

.section-block:nth-of-type(even) {
  background: var(--paper);
}

.section-block h2 {
  max-width: 760px;
  margin: 0;
  font-size: clamp(2.5rem, 7vw, 4.4rem);
  line-height: .95;
}

.section-block > p:not(.eyebrow) {
  max-width: 620px;
  color: var(--muted);
  line-height: 1.7;
}

.hero-section {
  min-height: 100dvh;
  background:
    radial-gradient(circle at 78% 24%, rgba(0, 248, 216, .12), transparent 16rem),
    var(--mist);
}

.hero-section h2 {
  max-width: 720px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--paper);
  padding: 18px 24px;
}

.couple-grid {
  width: min(900px, 100%);
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: center;
  justify-items: center;
  margin-inline: auto;
  gap: 18px;
}

.person-card {
  width: 100%;
  text-align: center;
}

.person-card h3 {
  margin: 16px 0 8px;
  font-size: 1.8rem;
}

.person-card p {
  max-width: 300px;
  margin: 0 auto;
  color: var(--muted);
  line-height: 1.65;
}

.person-photo {
  position: relative;
  width: min(280px, 100%);
  aspect-ratio: 4 / 5;
  margin: 0 auto;
  overflow: hidden;
  background: #e4f6f4;
}

.quote-section {
  background: var(--ink);
  color: var(--mist);
}

.quote-section h2,
.quote-section p,
.quote-section strong {
  color: var(--mist);
}

.quote-card {
  width: min(700px, 100%);
  border: 1px solid var(--line-ink);
  background: transparent;
  color: var(--mist);
  padding: 34px 28px;
}

.quote-card p {
  max-width: 560px;
  margin: 12px auto 18px;
  font-size: clamp(18px, 4vw, 26px);
  line-height: 1.55;
}

.timeline {
  position: relative;
  width: min(760px, 100%);
  display: grid;
  gap: 22px;
}

.timeline::before {
  content: "";
  position: absolute;
  left: 30px;
  top: 25px;
  bottom: 25px;
  width: 2px;
  background: var(--line);
}

.timeline-item {
  position: relative;
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  align-items: center;
  gap: 18px;
  text-align: left;
}

.timeline-dot {
  position: relative;
  z-index: 2;
  width: 64px;
  height: 64px;
  display: grid;
  place-items: center;
  border: 2px solid var(--ink);
  border-radius: 50%;
  background: var(--aqua);
  color: var(--ink);
  font-weight: 900;
  box-shadow: 3px 3px 0 var(--ink);
}

.timeline-content {
  width: 100%;
  padding: 18px 16px;
  text-align: left;
}

.timeline-content strong {
  display: block;
  margin: 8px 0;
  font-size: 20px;
}

.timeline-content p:last-child {
  margin: 0;
  color: var(--muted);
}

.event-grid,
.gift-grid {
  width: min(680px, 100%);
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.gift-grid {
  grid-template-columns: minmax(0, 1fr);
  justify-items: center;
}

.gift-grid > .cartoon-card {
  width: min(330px, 100%);
}

.wallet-grid {
  width: min(680px, 100%);
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  justify-items: center;
  gap: 18px;
}

.wallet-card {
  width: min(330px, 100%);
}

.cartoon-card {
  padding: 22px 16px;
  text-align: center;
}

.cartoon-card strong {
  display: block;
  margin: 8px 0;
  font-size: 18px;
  overflow-wrap: anywhere;
}

.countdown {
  width: min(680px, 100%);
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.countdown div {
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--ink);
  color: var(--mist);
  padding: 14px 5px;
}

.countdown strong,
.countdown span {
  display: block;
}

.countdown strong {
  font: 900 34px/1 var(--disp);
}

.countdown span {
  margin-top: 5px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
}

.action-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
}

.secondary-button {
  background: var(--paper);
}

.map-card {
  position: relative;
  width: min(680px, 100%);
  height: 280px;
  overflow: hidden;
  background: #e4f6f4;
}

.map-card iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
  filter: saturate(.7);
}

.gallery-grid {
  width: min(900px, 100%);
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.gallery-grid figure {
  position: relative;
  aspect-ratio: 1 / 1;
  margin: 0;
  overflow: hidden;
  background: #e4f6f4;
}

.gallery-grid img {
  object-fit: cover;
}

.guestbook-description {
  max-width: 680px;
  color: var(--muted);
}

.guestbook-form {
  width: min(680px, 100%);
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 20px;
  text-align: left;
}

.guestbook-form label {
  font-weight: 800;
  font-size: .92rem;
}

.guestbook-form input,
.guestbook-form textarea {
  width: 100%;
  border: 2px solid var(--line);
  border-radius: var(--r);
  padding: 12px;
  background: var(--paper);
  color: var(--ink);
  resize: vertical;
}

.guestbook-form input:focus,
.guestbook-form textarea:focus {
  outline: none;
  border-color: var(--lagoon);
  box-shadow: 0 0 0 3px rgba(0, 114, 122, .18);
}

.guestbook-form .cartoon-button {
  align-self: flex-start;
  margin-top: 6px;
}

.guestbook-list {
  width: min(680px, 100%);
  display: grid;
  gap: 12px;
  text-align: left;
}

.guestbook-item {
  padding: 16px;
  background: var(--paper);
}

.guestbook-item strong {
  display: block;
  margin-bottom: 6px;
}

.guestbook-item p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 70;
  max-width: calc(100% - 32px);
  transform: translate(-50%, 20px);
  border: 1px solid var(--ink);
  border-radius: var(--r);
  padding: 12px 16px;
  background: var(--ink);
  color: var(--mist);
  opacity: 0;
  visibility: hidden;
  text-align: center;
  font-weight: 800;
  transition: opacity .18s, transform .18s, visibility .18s;
}

.toast.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, 0);
}

.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 650ms, transform 650ms;
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

footer {
  padding: 28px 20px;
  background: var(--ink);
  color: var(--mist);
  text-align: center;
  font-weight: 800;
}

footer p {
  max-width: none;
  margin: 0 auto;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
}

@media (max-width: 414px) {
  body {
    font-size: 14px;
  }

  .cover-inner {
    padding: 18px 16px 16px;
  }

  .cover-photo {
    width: clamp(138px, 21vh, 180px);
  }

  .cover-center h1 {
    font-size: 38px;
  }

  .cover-date,
  .guest-name {
    font-size: 12px;
  }

  .invitation-nav {
    top: 6px;
    width: calc(100% - 16px);
    min-height: 54px;
    grid-template-columns: 40px minmax(0, 1fr) 112px;
  }

  .nav-brand,
  .nav-music-toggle {
    width: 38px;
    height: 38px;
  }

  .nav-music-toggle {
    width: 112px;
  }

  .nav-music-label {
    font-size: 8px;
  }

  .nav-links a {
    min-height: 38px;
    font-size: 8px;
  }

  .section-block {
    min-height: auto;
    padding: 44px 16px;
    gap: 12px;
  }

  .section-block h2 {
    font-size: 2.5rem;
  }

  .section-block > p:not(.eyebrow) {
    font-size: 13px;
  }

  .couple-grid {
    grid-template-columns: 1fr;
  }

  .person-photo {
    width: min(190px, 68vw);
  }

  .event-grid,
  .gift-grid,
  .wallet-grid {
    grid-template-columns: 1fr;
  }

  .countdown {
    gap: 5px;
  }

  .countdown div {
    padding: 10px 2px;
  }

  .countdown strong {
    font-size: 24px;
  }

  .countdown span {
    font-size: 8px;
  }

  .action-row,
  .action-row .cartoon-button {
    width: 100%;
  }

  .timeline {
    gap: 12px;
  }

  .timeline-item {
    grid-template-columns: 48px minmax(0, 1fr);
    gap: 10px;
  }

  .timeline-dot {
    width: 48px;
    height: 48px;
  }

  .timeline::before {
    left: 23px;
  }

  .timeline-content strong {
    font-size: 16px;
  }

  .map-card {
    height: 190px;
  }

  .gallery-grid {
    gap: 8px;
  }

  .gallery-grid figure {
    max-height: 150px;
  }

  .guestbook-form,
  .guestbook-list,
  .guestbook-description {
    width: 100%;
  }

  .guestbook-form input,
  .guestbook-form textarea {
    font-size: 13px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
