:root {
  --paper: #FBF7F0;
  --ink: #17484F;
  --ink-soft: #3E6A70;
  --sea: #1F8A8F;
  --sea-deep: #0F6A72;
  --coral: #C9695A;
  --water: #49B6BA;
  --serif: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --script: "Pinyon Script", "Snell Roundhand", "Apple Chancery", cursive;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font-family: var(--serif); font-size: 1.25rem; line-height: 1.45;
  overflow-x: hidden; -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; }
a { color: inherit; }
a:focus-visible { outline: 2px solid var(--sea-deep); outline-offset: 3px; border-radius: 3px; }

/* ---------- Hero ---------- */
.hero {
  position: relative; overflow: hidden; isolation: isolate;
  min-height: 100vh; min-height: 100svh;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
}
#paint { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0; display: block; }

/* Portrait: the photo bleeds off the top and sides, the text sits on paper below. */
.photo-slot {
  grid-row: 1; position: relative; z-index: 0;
  margin: -70px -70px 0; min-height: max(56svh, calc(100vw + 40px));
}
.photo-slot img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; object-position: 50% 30%;
  -webkit-mask-image: linear-gradient(#000 85%, transparent);
  mask-image: linear-gradient(#000 85%, transparent);
}
.gl .photo-slot img { opacity: 0; }

.hero-text {
  grid-row: 2; position: relative; z-index: 2; text-align: center;
  padding: .25rem 20px max(1.75rem, env(safe-area-inset-bottom));
}
.eyebrow {
  margin: 0; font-size: clamp(.8rem, 3.2vw, .95rem);
  letter-spacing: clamp(.1em, 1vw, .24em); text-transform: uppercase; color: var(--ink-soft);
}
h1 {
  margin: .1em 0 .12em; font-family: var(--script); font-weight: 400;
  font-size: clamp(2.5rem, 13.6vw, 5.6rem); line-height: 1.08; white-space: nowrap; color: var(--sea-deep);
}
h1 em { font-family: var(--serif); font-style: italic; font-size: .72em; color: var(--coral); padding: 0 .06em; }
.hero-date { margin: 0; font-size: clamp(1.25rem, 5vw, 1.6rem); font-weight: 500; }
.hero-place { margin: 0 0 1.05rem; font-size: clamp(1.05rem, 4.2vw, 1.3rem); font-style: italic; color: var(--ink-soft); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .55em;
  min-height: 48px; padding: .55em 1.9em; border-radius: 999px;
  font-size: 1.02rem; font-weight: 500; letter-spacing: .14em; text-transform: uppercase;
  text-decoration: none; transition: background .25s, color .25s, border-color .25s, transform .25s;
}
.btn:hover { transform: translateY(-2px); }
.btn-ghost { border: 1px solid var(--sea-deep); color: var(--sea-deep); background: rgba(251,247,240,.55); }
.btn-ghost:hover { background: var(--sea-deep); color: var(--paper); }
.btn-solid { background: var(--sea-deep); color: #fff; }
.btn-solid:hover { background: var(--ink); }
.btn-quiet { border: 1px solid rgba(23,72,79,.4); color: var(--ink); }
.btn-quiet:hover { border-color: var(--ink); background: rgba(23,72,79,.06); }

.palm { position: absolute; z-index: 1; pointer-events: none; width: clamp(110px, 31vw, 300px); transform-origin: 0 0; }
.palm-l { top: 0; left: 0; animation: sway 8s ease-in-out infinite alternate; }
.palm-r { top: 0; right: 0; width: clamp(90px, 24vw, 230px); transform-origin: 50% 0; animation: sway-r 9.5s ease-in-out infinite alternate; }
@keyframes sway { from { transform: rotate(-1.4deg); } to { transform: rotate(1.6deg); } }
@keyframes sway-r { from { transform: scaleX(-1) rotate(-1.2deg); } to { transform: scaleX(-1) rotate(1.8deg); } }

/* Intro choreography — only when the painted intro is actually running. */
.intro .palm { opacity: 0; }
.intro .hero-text > * { opacity: 0; transform: translateY(14px); }
.palm { transition: opacity 2.2s ease; }
.hero-text > * { transition: opacity 1.2s ease, transform 1.2s cubic-bezier(.2,.7,.2,1), background .25s, color .25s; }
.hero-text > :nth-child(2) { transition-delay: .2s, .2s, 0s, 0s; }
.hero-text > :nth-child(3) { transition-delay: .55s, .55s, 0s, 0s; }
.hero-text > :nth-child(4) { transition-delay: .7s, .7s, 0s, 0s; }
.hero-text > :nth-child(5) { transition-delay: .95s, .95s, 0s, 0s; }

/* Landscape: photo on the right, invitation on the left, painted sea all around. */
@media (min-aspect-ratio: 1/1) {
  .hero { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-rows: 1fr; align-items: center; min-height: max(100svh, 520px); }
  .photo-slot {
    grid-column: 2; grid-row: 1; margin: 0; min-height: 0;
    height: calc(max(100svh, 520px) - clamp(40px, 9svh, 96px));
    width: min(calc((max(100svh, 520px) - clamp(40px, 9svh, 96px)) * .78), 92%);
    justify-self: center;
  }
  .photo-slot img { -webkit-mask-image: none; mask-image: none; border-radius: 12px; }
  .hero-text { grid-column: 1; grid-row: 1; padding: 1.5rem 2rem; justify-self: center; }
  h1 { font-size: clamp(3.2rem, min(7.4vw, 15svh), 7.2rem); }
  .eyebrow { font-size: clamp(.78rem, 1.15vw, 1.02rem); }
  .hero-date { font-size: clamp(1.2rem, 2vw, 1.85rem); }
  .hero-place { font-size: clamp(1.05rem, 1.5vw, 1.4rem); }
  .palm { width: clamp(180px, 27vw, 520px); }
  .palm-r { width: clamp(120px, 15vw, 300px); }
}
/* Short phones in landscape: keep everything on one screen. */
@media (min-aspect-ratio: 1/1) and (max-height: 480px) {
  h1 { font-size: clamp(2.6rem, 8vw, 3.8rem); }
  .hero-place { margin-bottom: .5rem; }
  .btn { min-height: 44px; }
}

/* ---------- Details ---------- */
.script { font-family: var(--script); font-weight: 400; color: var(--sea-deep); line-height: 1.1; margin: 0; }
.details {
  position: relative; max-width: 1040px; margin: 0 auto; text-align: center;
  padding: clamp(3.5rem, 9vw, 7rem) 20px clamp(2.5rem, 6vw, 4.5rem);
}
.details h2 { font-size: clamp(3.2rem, 11vw, 5.2rem); }
.lede { margin: .35em auto 0; max-width: 26em; font-size: clamp(1.3rem, 3.6vw, 1.65rem); font-style: italic; color: var(--ink-soft); line-height: 1.3; }
.facts {
  display: grid; grid-template-columns: 1fr; gap: 2rem;
  margin: clamp(2.25rem, 6vw, 4rem) 0 clamp(2rem, 5vw, 3rem);
}
.facts dt { font-size: .9rem; letter-spacing: .26em; text-transform: uppercase; color: var(--coral); font-weight: 500; margin-bottom: .45rem; }
.facts dd { margin: 0; font-size: clamp(1.45rem, 4vw, 1.75rem); line-height: 1.25; }
.facts small { font-size: .74em; color: var(--ink-soft); line-height: 1.35; display: inline-block; margin-top: .25em; }
@media (min-width: 720px) {
  .facts { grid-template-columns: repeat(3, 1fr); gap: 0; }
  .facts > div + div { border-left: 1px solid rgba(31,138,143,.25); }
  .facts > div { padding: 0 1.5rem; }
}
.links { display: flex; flex-wrap: wrap; justify-content: center; gap: .5rem 2rem; }
.links a { display: inline-block; padding: .55rem .2rem; font-style: italic; font-size: 1.2rem; color: var(--sea-deep); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 4px; }
.links a:hover { color: var(--coral); }

.creature { position: absolute; pointer-events: none; }
.parrot { width: clamp(84px, 15vw, 190px); right: max(2%, calc(50% - 560px)); top: clamp(1.25rem, 5vw, 3.5rem); animation: bob 5s ease-in-out infinite alternate; transform-origin: 50% 80%; }
@keyframes bob { from { transform: rotate(-1.5deg); } to { transform: rotate(1.5deg); } }

/* ---------- RSVP ---------- */
.rsvp { position: relative; overflow: hidden; margin-top: 1rem; }
.wave { width: 100%; min-width: 900px; height: auto; margin-bottom: -2px; position: relative; }
.rsvp-sea {
  position: relative; text-align: center; margin-top: -1px;
  padding: clamp(1.5rem, 5vw, 3.5rem) 20px max(2rem, env(safe-area-inset-bottom));
  background: linear-gradient(#7fcdcd 0, #6bc4c7 30%, #4fb2b9 100%);
}
.rsvp-card {
  position: relative; z-index: 1; max-width: 620px; margin: 0 auto;
  background: rgba(251,247,240,.94); border-radius: 18px 26px 20px 28px / 26px 18px 28px 20px;
  padding: clamp(2rem, 6vw, 3.25rem) clamp(1.25rem, 5vw, 3rem);
  box-shadow: 0 18px 50px -24px rgba(15,70,80,.55);
}
.rsvp-card h2 { font-size: clamp(2.8rem, 10vw, 4.4rem); }
.rsvp-card p { margin: .5rem 0 1.5rem; }
.rsvp-buttons { display: flex; flex-wrap: wrap; gap: .75rem; justify-content: center; }
.rsvp-buttons .btn { flex: 1 1 240px; padding-inline: 1em; font-size: .95rem; }
.turtle { width: clamp(110px, 17vw, 230px); left: max(1%, calc(50% - 620px)); top: 10%; animation: swim 14s ease-in-out infinite alternate; }
.ray { width: clamp(120px, 19vw, 260px); right: max(0%, calc(50% - 640px)); bottom: 24%; animation: glide 17s ease-in-out infinite alternate; opacity: .85; }
@keyframes swim { from { transform: translate(-14px, 12px) rotate(-6deg); } to { transform: translate(34px, -26px) rotate(8deg); } }
@keyframes glide { from { transform: translate(24px, 14px) rotate(4deg); } to { transform: translate(-44px, -24px) rotate(-7deg); } }
@media (max-width: 859px) {
  .turtle { position: relative; left: auto; top: auto; margin: -2.6rem auto .4rem; display: block; width: 96px; }
  .ray { position: relative; right: auto; bottom: auto; margin: 1.5rem auto 0; display: block; width: 120px; }
  .rsvp-sea { display: flex; flex-direction: column; }
  .rsvp-card { order: 1; width: 100%; } .ray { order: 2; } footer { order: 3; }
}
footer { position: relative; z-index: 1; color: #fff; padding-top: clamp(1.75rem, 5vw, 3rem); font-size: 1.05rem; letter-spacing: .1em; }
footer p { margin: 0; }
.foot-names em { font-family: var(--serif); font-size: .72em; }
.foot-names { color: #fff; font-size: 2.6rem; letter-spacing: 0; margin-bottom: .1rem; text-shadow: 0 1px 8px rgba(15,70,80,.35); }

/* Scroll reveals */
.js .reveal { opacity: 0; transform: translateY(18px); transition: opacity 1s ease, transform 1s cubic-bezier(.2,.7,.2,1); }
.js .reveal.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .js .reveal { opacity: 1; transform: none; }
  .palm-r { transform: scaleX(-1); }
}

/* Skip control for the long intro, and replay link */
.skip {
  position: absolute; z-index: 3; right: 16px; bottom: max(16px, env(safe-area-inset-bottom));
  min-height: 44px; padding: .3em 1.1em; border: 1px solid rgba(23,72,79,.35); border-radius: 999px;
  background: rgba(251,247,240,.72); color: var(--ink); cursor: pointer;
  font: 500 .95rem var(--serif); letter-spacing: .1em;
}
.skip[hidden] { display: none; }
.replay { margin-top: .6rem !important; font-size: .95rem; letter-spacing: .04em; }
.replay a { color: #fff; text-underline-offset: 3px; }
