:root {
  --ink: #332F0A;        /* sampled from the invitation */
  --ink-soft: #5b5636;
  --black: #1E1E1E;      /* program card ink */
  --line: #3a3a3a;
  --paper: #ffffff;
  --hair: #e7e4d8;
  --mono: "Courier Prime", "Courier New", Courier, monospace;
  --nav-h: 52px;
  --r-sm: 6px;           /* buttons, inputs, photos */
  --r-md: 8px;           /* paper notes, font chips */
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: var(--nav-h); -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font-family: var(--mono); font-size: 17px; line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
b, .strong { font-weight: 700; }

/* ---------- nav ---------- */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 20; height: var(--nav-h);
  display: flex; align-items: center; justify-content: center; gap: clamp(14px, 4vw, 40px);
  /* light frosted glass over the page */
  background: rgba(255,255,255,.66);
  -webkit-backdrop-filter: blur(18px) saturate(1.4); backdrop-filter: blur(18px) saturate(1.4);
  border-bottom: 1px solid transparent;
  transition: border-color .35s, transform .35s, background-color .35s, color .35s, box-shadow .35s;
  font-size: 13px; letter-spacing: .22em; text-transform: lowercase;
}
.nav.scrolled { border-bottom-color: rgba(0,0,0,.07); }
/* no blur support, or the viewer asked for less transparency: keep it nearly solid */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) { .nav { background: rgba(255,255,255,.94); } }
@media (prefers-reduced-transparency: reduce) { .nav { background: rgba(255,255,255,.96); } }
.lite .nav { -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); background: rgba(255,255,255,.82); }
.nav a { text-decoration: none; padding: 8px 2px; position: relative; }
.nav a::after { content: ""; position: absolute; left: 0; right: .22em; bottom: 2px; height: 1px; background: currentColor; transform: scaleX(0); transition: transform .3s; transform-origin: left; }
.nav a.active::after, .nav a:hover::after { transform: scaleX(1); }
.nav-mark { font-weight: 700; letter-spacing: .1em !important; }
/* desktop: transparent nav floating over the video hero, solid white again once past it */
@media (min-width: 641px) {
  .nav.over-hero {
    background: transparent; -webkit-backdrop-filter: none; backdrop-filter: none;
    border-bottom-color: transparent; color: #fff; text-shadow: 0 1px 10px rgba(0,0,0,.4);
  }
}

@media (max-width: 640px) {
  /* phones: thumb-friendly frosted capsule floating above the bottom edge */
  .nav {
    top: auto; left: 12px; right: 12px; bottom: calc(10px + env(safe-area-inset-bottom));
    height: 50px; padding: 0 8px; border-radius: 999px;
    border: 1px solid rgba(0,0,0,.06); box-shadow: 0 8px 28px rgba(0,0,0,.12);
    gap: 0; justify-content: space-around; font-size: 12px; letter-spacing: .12em;
  }
  .nav.scrolled { border-bottom-color: rgba(0,0,0,.06); }
  /* over the video: dark smoky glass, white links */
  .nav.over-hero {
    background: rgba(22,20,14,.30); border-color: rgba(255,255,255,.22);
    color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,.3); box-shadow: 0 10px 32px rgba(0,0,0,.28);
  }
  .lite .nav.over-hero { background: rgba(22,20,14,.55); }
  .nav-mark { display: none; }
  html { scroll-padding-top: 0; }
  body { padding-bottom: calc(76px + env(safe-area-inset-bottom)); }
  /* hero runs to the very bottom edge, under the capsule; keep its contents clear of it */
  .card.cover { padding-bottom: calc(96px + env(safe-area-inset-bottom)); }
  .cover .scroll-cue { margin-top: 6vh; }
}

/* ---------- cards / sections ---------- */
.card {
  min-height: 100vh; min-height: 100svh;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: calc(var(--nav-h) + 40px) 24px 72px; text-align: center;
  max-width: 980px; margin: 0 auto;
}
.card + .card { border-top: 1px solid var(--hair); }
.kicker { font-weight: 700; font-size: 15px; letter-spacing: .45em; text-transform: lowercase; margin: 0 0 18px; color: var(--black); }
.sub { margin: 0 0 28px; color: var(--ink-soft); }
.lede { font-size: clamp(16px, 2.6vw, 22px); line-height: 1.6; max-width: 34em; margin: 0; }
.lede.small { font-size: clamp(15px, 2.2vw, 19px); }
@media (max-width: 640px) { br.wide { display: none; } }

.script { margin: 0; font-weight: normal; }
.logo { height: auto; }
.logo-hero { width: min(64vw, 560px); margin: 0 auto 7vh; }
.logo-small { width: min(52vw, 260px); margin: 0 auto 10px; }

/* hand-written reveal: wipe the lettering on left→right, top line then bottom */
.logo-hero {
  -webkit-mask-image: linear-gradient(100deg, #000 45%, transparent 55%);
          mask-image: linear-gradient(100deg, #000 45%, transparent 55%);
  -webkit-mask-size: 260% 100%; mask-size: 260% 100%;
  -webkit-mask-position: 100% 0; mask-position: 100% 0;
  animation: write 2.6s cubic-bezier(.45,.05,.3,1) .25s forwards;
}
@keyframes write { to { -webkit-mask-position: 0 0; mask-position: 0 0; } }
.cover .lede { opacity: 0; animation: fade 1.2s ease 2.4s forwards; }

/* ---------- video hero ---------- */
.card.cover { position: relative; isolation: isolate; overflow: hidden; max-width: none; color: #fff; }
.cover-media {
  position: absolute; inset: 0; z-index: -1;
  background: #2a2a22 url(/assets/video/hero-poster.jpg) center / cover no-repeat;
}
@media (orientation: portrait) {
  .cover-media { background-image: url(/assets/video/hero-poster-portrait.jpg); }
}
.cover-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity 1s ease; }
.cover-video.on { opacity: 1; }
/* soft scrim: a little darker where the logo sits, so white reads on white flowers */
.cover-media::after {
  content: ""; position: absolute; inset: 0;
  background:
    linear-gradient(rgba(0,0,0,.35), rgba(0,0,0,0) 140px),
    radial-gradient(ellipse 70% 55% at 50% 45%, rgba(0,0,0,.38), rgba(0,0,0,0) 78%),
    linear-gradient(rgba(0,0,0,.12), rgba(0,0,0,.28));
}
/* logo is a single-colour SVG: turn it white and give it a soft, wide shadow */
.cover .logo-hero { filter: brightness(0) invert(1) drop-shadow(0 2px 18px rgba(0,0,0,.38)) drop-shadow(0 0 4px rgba(0,0,0,.18)); }
/* invitation line: frosted glass panel, so it reads over any frame of the video */
.cover .lede {
  font-size: clamp(16px, 2.4vw, 21px); line-height: 1.7; max-width: 30em;
  padding: 16px clamp(18px, 3vw, 30px);
  background: rgba(24, 22, 14, .26);
  -webkit-backdrop-filter: blur(12px) saturate(1.15); backdrop-filter: blur(12px) saturate(1.15);
  border: 1px solid rgba(255,255,255,.28); border-radius: 16px;
  box-shadow: 0 10px 40px rgba(0,0,0,.18);
  text-shadow: 0 1px 2px rgba(0,0,0,.35);
}
/* status ("happening now"): thin outlined pill with a live pulse */
.cover .status {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 7px 18px 7px 14px; border-radius: 999px;
  font-size: 13px; letter-spacing: .24em; font-weight: 700;
  background: rgba(24, 22, 14, .24);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,.55);
  text-shadow: 0 1px 2px rgba(0,0,0,.35);
}
.cover .status::before { background: #fff; margin: 0; vertical-align: 0; box-shadow: 0 0 0 0 rgba(255,255,255,.7); animation: live 1.8s infinite; }
/* longer messages ("thank you for celebrating with us") stay on one line on phones */
.cover .status.quiet { padding: 8px 18px; font-size: clamp(11px, 3.2vw, 12px); letter-spacing: .14em; white-space: nowrap; }
.cover .status[hidden] { display: none; }
@keyframes live { 0% { box-shadow: 0 0 0 0 rgba(255,255,255,.7); } 70% { box-shadow: 0 0 0 8px rgba(255,255,255,0); } 100% { box-shadow: 0 0 0 0 rgba(255,255,255,0); } }
@media (prefers-reduced-motion: reduce) { .cover .status::before { animation: none; } }
.cover .scroll-cue { border-color: #fff; opacity: .85; }
.cover .scroll-cue span { background: #fff; }
@keyframes fade { to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  .logo-hero { animation: none; -webkit-mask-image: none; mask-image: none; }
  .cover .lede { animation: none; opacity: 1; }
}

.status { margin: 28px 0 0; font-size: 14px; letter-spacing: .18em; text-transform: lowercase; }
.status::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--ink); margin-right: 10px; vertical-align: 2px; animation: pulse 1.8s infinite; }
@keyframes pulse { 50% { opacity: .2; } }

.scroll-cue { margin-top: 8vh; width: 22px; height: 36px; border: 1.5px solid var(--ink); border-radius: 12px; position: relative; opacity: .55; }
.scroll-cue span { position: absolute; left: 50%; top: 7px; width: 2px; height: 7px; margin-left: -1px; background: var(--ink); border-radius: 1px; animation: cue 1.8s infinite; }
@keyframes cue { 0% { transform: translateY(0); opacity: 1; } 80% { transform: translateY(12px); opacity: 0; } 100% { opacity: 0; } }

/* ---------- details ---------- */
.details { gap: 10vh; }
.details .block p { margin: 0 0 6px; font-size: clamp(17px, 2.8vw, 24px); }
.details .notes p { font-size: clamp(16px, 2.5vw, 21px); max-width: 30em; margin: 0 auto 1.4em; }
.actions { margin-top: 22px !important; display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 22px;
  font: 700 14px/1 var(--mono); letter-spacing: .12em; text-transform: lowercase; text-decoration: none;
  color: var(--ink); background: transparent; border: 1.5px solid var(--ink); border-radius: var(--r-sm); cursor: pointer;
  transition: background .2s, color .2s;
}
.btn:hover, .btn-solid { background: var(--ink); color: #fff; }
.btn-solid:hover { background: #1f1c05; }
.btn:disabled { opacity: .5; cursor: default; }

/* ---------- program (timeline) ---------- */
.program { color: var(--black); }
.timeline { list-style: none; margin: 10px 0 0; padding: 18px 0 26px; position: relative; width: min(100%, 860px); }
.timeline::before { content: ""; position: absolute; top: 0; bottom: 0; left: 50%; width: 2px; margin-left: -1px; background: var(--line); }
.timeline li {
  position: relative; display: grid; grid-template-columns: 1fr 1fr; align-items: start;
  min-height: 150px; opacity: 0; transform: translateY(14px); transition: opacity .7s, transform .7s;
}
.timeline li + li { margin-top: -38px; }
.timeline li.in { opacity: 1; transform: none; }
.timeline li::before { /* tick from the centre line */
  content: ""; position: absolute; top: 44px; width: 56px; height: 2px; background: var(--line);
}
.timeline li.r::before { left: 50%; }
.timeline li.l::before { right: 50%; }
.timeline li > img { width: 96px; height: 96px; object-fit: contain; position: absolute; top: -4px; }
.timeline li.r > img { left: calc(50% + 66px); }
.timeline li.l > img { right: calc(50% + 66px); }
.timeline li > div { display: flex; flex-direction: column; font-size: clamp(15px, 2vw, 19px); letter-spacing: .28em; line-height: 1.5; }
.timeline li > div b { letter-spacing: .32em; }
.timeline li.r > div { grid-column: 2; text-align: left; padding-left: 182px; }
.timeline li.l > div { grid-column: 1; text-align: right; padding-right: 182px; align-items: flex-end; }
.end { margin: 0; display: flex; flex-direction: column; letter-spacing: .3em; font-size: clamp(15px, 2vw, 19px); gap: 6px; }
.end b { letter-spacing: .32em; }

/* now / done states (driven by Asia/Manila time) */
.timeline li.done, .end.done { opacity: .45; }
.timeline li.now > div b::after, .end.now b::after {
  content: "now"; display: inline-block; margin-left: 12px; padding: 2px 6px 1px; font-size: .62em; letter-spacing: .2em;
  background: var(--ink); color: #fff; vertical-align: 3px;
}

@media (max-width: 760px) {
  .timeline { width: 100%; max-width: 420px; padding-top: 8px; }
  .timeline::before { left: 18px; }
  .timeline li { display: flex; align-items: center; gap: 16px; min-height: 0; padding: 18px 0 18px 46px; text-align: left; }
  .timeline li + li { margin-top: 0; }
  .timeline li::before, .timeline li.r::before, .timeline li.l::before { left: 19px; right: auto; top: 50%; width: 20px; }
  .timeline li > img, .timeline li.r > img, .timeline li.l > img { position: static; width: 62px; height: 62px; flex: none; }
  .timeline li.r > div, .timeline li.l > div { padding: 0; text-align: left; align-items: flex-start; letter-spacing: .16em; }
  .end { align-self: stretch; max-width: 420px; margin: 0 auto; letter-spacing: .2em; }
}

/* ---------- gallery ---------- */
.gallery, .messages { justify-content: flex-start; }
.gallery { max-width: 1200px; }

input[type=text], textarea {
  font: 16px/1.5 var(--mono); color: var(--ink); background: #fff;
  border: 1.5px solid #cfcab6; border-radius: var(--r-sm); padding: 10px 12px; min-height: 44px; outline: none; transition: border-color .2s;
}
input[type=text]:focus, textarea:focus { border-color: var(--ink); }
::placeholder { color: #a29d86; }

.g-bar { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 12px 20px; flex-wrap: wrap;
         border-bottom: 1px solid var(--hair); margin-bottom: 18px; padding-bottom: 6px; }
.tabs { display: flex; gap: 4px; flex-wrap: wrap; }
.tabs button { font: 13px var(--mono); letter-spacing: .16em; background: none; border: 0; padding: 10px 10px; cursor: pointer; color: var(--ink-soft);
               position: relative; text-transform: lowercase; }
.tabs button::after { content: ""; position: absolute; left: 10px; right: 10px; bottom: -7px; height: 1.5px; background: var(--ink); transform: scaleX(0); transition: transform .35s; }
.tabs button[aria-selected="true"] { color: var(--ink); font-weight: 700; }
.tabs button[aria-selected="true"]::after { transform: scaleX(1); }
.tabs small { font-size: 11px; letter-spacing: .05em; opacity: .6; font-weight: 400; }
.g-play { min-height: 38px; padding: 0 16px; gap: 8px; font-size: 12px; }
.g-play svg { width: 11px; height: 11px; }

/* square thumbnails: four across, three on phones; loaded twelve at a time so rows always end full */
.grid { width: 100%; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.tile {
  position: relative; display: block; aspect-ratio: 1; padding: 0; border: 0; border-radius: var(--r-sm); cursor: zoom-in; overflow: hidden; background: #f3f0e6;
  opacity: 0; transform: translateY(10px); transition: opacity .7s ease, transform .7s ease;
}
.tile.in { opacity: 1; transform: none; }
.tile img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transform: scale(1.02);
            transition: opacity .6s ease, transform 1.2s cubic-bezier(.2,.7,.2,1); }
.tile img.loaded { opacity: 1; transform: none; }
.tile:hover img.loaded { transform: scale(1.035); }
.tile .by { position: absolute; left: 0; right: 0; bottom: 0; padding: 26px 12px 9px; font-size: 12px; letter-spacing: .08em; color: #fff; text-align: left;
            background: linear-gradient(transparent, rgba(20,18,4,.5)); opacity: 0; transform: translateY(6px); transition: opacity .35s, transform .35s; }
.tile:hover .by, .tile:focus-visible .by { opacity: 1; transform: none; }
.tile .badge { position: absolute; top: 8px; left: 8px; font-size: 10px; letter-spacing: .18em; background: rgba(255,255,255,.92); color: var(--ink); padding: 3px 7px 2px; border-radius: 3px; }
.tile:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
@media (max-width: 900px) { .grid { gap: 6px; } }
@media (max-width: 640px) {
  .gallery { padding-left: 10px; padding-right: 10px; }
  .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 3px; }
  .tile .badge { display: none; }                 /* small squares stay clean; the filter tabs sort official vs guest */
  .tile .by { display: none; }
  .tile { border-radius: 4px; }
  .tile .by { opacity: 1; transform: none; padding: 18px 8px 6px; font-size: 10px; }
  .g-bar { justify-content: center; border-bottom: 0; }
  .tabs { justify-content: center; }
}
@media (prefers-reduced-motion: reduce) { .tile, .tile img { transition: none; transform: none; } }

.g-empty { padding: 34px 0 6px; display: flex; flex-direction: column; align-items: center; animation: fade .9s ease both; }
.frames { position: relative; width: 300px; height: 190px; margin-bottom: 30px; }
.frame { position: absolute; top: 18px; width: 116px; height: 136px; background: #fff; border: 1px solid #dcd7c4;
         box-shadow: 0 14px 30px -16px rgba(51,47,10,.35); padding: 10px 10px 30px; display: block; }
.frame::before { content: ""; position: absolute; inset: 10px 10px 30px; background: #f6f3ea; }
.frame img { position: relative; width: 62%; height: 62%; object-fit: contain; margin: 18% auto 0; opacity: .55; }
.f1 { left: 8px;  transform: rotate(-8deg); animation: float1 6s ease-in-out infinite; }
.f2 { left: 92px; top: 0; z-index: 2; transform: rotate(2deg); animation: float2 7s ease-in-out infinite; }
.f3 { left: 176px; transform: rotate(9deg); animation: float3 6.5s ease-in-out infinite; }
@keyframes float1 { 50% { transform: rotate(-6deg) translateY(-6px); } }
@keyframes float2 { 50% { transform: rotate(0deg) translateY(-9px); } }
@keyframes float3 { 50% { transform: rotate(7deg) translateY(-5px); } }
@media (prefers-reduced-motion: reduce) { .frame { animation: none; } }
.g-empty-title { margin: 0 0 8px; font-weight: 700; font-size: 14px; letter-spacing: .34em; color: var(--ink); }
.g-empty-text { margin: 0 0 22px; color: var(--ink-soft); max-width: 26em; }
.gallery.is-empty .g-bar { display: none; }
.gallery.is-empty .upload { margin-top: 28px; }
@media (max-width: 640px) { .frames { transform: scale(.85); margin-bottom: 18px; } }

/* reception screen waiting for its first photo */
.v-wait { position: absolute; inset: 0; z-index: 5; background: #fffefa; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 4vh 6vw; animation: fade 1s ease both; }
.w-logo { width: min(34vw, 46vh); margin-bottom: 4vh; }
.w-qr { padding: 18px; border: 1px solid #dcd7c4; background: #fff; box-shadow: 0 18px 40px -22px rgba(51,47,10,.4); margin-bottom: 3.5vh; }
.w-qr img { width: min(18vw, 24vh); }
.w-title { margin: 0 0 1.4vh; font-weight: 700; letter-spacing: .4em; font-size: clamp(14px, 1.6vw, 22px); }
.w-text { margin: 0; color: var(--ink-soft); font-size: clamp(14px, 1.4vw, 20px); line-height: 1.7; }
.viewer.waiting .v-brand, .viewer.waiting .v-cap, .viewer.waiting .v-progress { visibility: hidden; }

#grid-more { margin-top: 22px; }

.upload { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; align-items: center; width: 100%; max-width: 560px;
          margin-top: 48px; padding: 26px 22px 18px; border: 1px dashed #cfcab6; }
.upload-title { flex-basis: 100%; margin: 0 0 4px; font-weight: 700; font-size: 13px; letter-spacing: .3em; }
.upload input[type=text] { flex: 1 1 200px; }
.upload-progress { flex-basis: 100%; height: 2px; background: var(--hair); overflow: hidden; }
.upload-progress span { display: block; height: 100%; width: 0; background: var(--ink); transition: width .3s; }
.upload-status, .form-status { flex-basis: 100%; margin: 4px 0 0; min-height: 1.4em; font-size: 14px; color: var(--ink-soft); }

/* ---------- viewer / slideshow ---------- */
.viewer {
  position: fixed; inset: 0; z-index: 60; background: rgba(16,15,8,.88); color: #f4f1e6;
  -webkit-backdrop-filter: blur(16px) saturate(.9); backdrop-filter: blur(16px) saturate(.9);
  display: grid; grid-template-rows: auto 2px 1fr auto auto; height: 100vh; height: 100dvh;
  padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom);
  opacity: 0; transition: opacity .35s ease; touch-action: none; user-select: none; -webkit-user-select: none;
}
.viewer.open { opacity: 1; }
.viewer .v-stage { transform: scale(.965); transition: transform .45s cubic-bezier(.2,.8,.2,1); }
.viewer.open .v-stage { transform: none; }
.v-top { display: flex; align-items: center; justify-content: space-between; padding: 10px 14px 10px 22px; transition: opacity .5s; }
.v-count { font-size: 13px; letter-spacing: .3em; }
.v-actions { display: flex; gap: 2px; }
.v-actions button, .v-actions a { width: 44px; height: 44px; display: grid; place-items: center; background: none; border: 0; color: inherit; cursor: pointer; border-radius: 50%; transition: background .2s; }
.v-actions button:hover, .v-actions a:hover { background: rgba(255,255,255,.12); }
.v-actions svg { width: 17px; height: 17px; }
.viewer .i-pause, .viewer.playing .i-play { display: none; }
.viewer.playing .i-pause { display: block; }
.v-progress { background: transparent; }
.v-progress span { display: block; height: 100%; width: 0; background: currentColor; opacity: .6; }

.v-stage { position: relative; overflow: hidden; min-height: 0; }
.v-track { position: absolute; inset: 0; }
.v-slide { position: absolute; inset: 0; display: grid; place-items: center; padding: 14px clamp(14px, 7vw, 96px);
           opacity: 0; transition: opacity .7s ease, transform .7s cubic-bezier(.2,.7,.2,1); will-change: opacity, transform; }
.v-slide.on { opacity: 1; z-index: 1; }
.v-slide img { max-width: 100%; max-height: 100%; object-fit: contain; box-shadow: 0 24px 70px -20px rgba(0,0,0,.7); border-radius: 2px;
               opacity: 0; transition: opacity .5s ease; }
.v-slide img.loaded { opacity: 1; }
.v-slide.kb img.loaded { animation: kb 7s ease-out forwards; }
@keyframes kb { from { transform: scale(1); } to { transform: scale(1.03); } }
.v-slide .spin { position: absolute; width: 22px; height: 22px; border: 1.5px solid rgba(255,255,255,.18); border-top-color: currentColor; border-radius: 50%; animation: spin .9s linear infinite; }
.v-slide img.loaded + .spin { display: none; }
@keyframes spin { to { transform: rotate(360deg); } }

.v-nav { position: absolute; top: 50%; z-index: 3; width: 56px; height: 56px; margin-top: -28px; display: grid; place-items: center;
         background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.16); border-radius: 50%; color: inherit; cursor: pointer;
         transition: opacity .4s, background .2s, transform .2s; }
.v-nav:hover { background: rgba(255,255,255,.2); transform: scale(1.05); }
.v-nav svg { width: 18px; height: 18px; }
.v-prev { left: 18px; } .v-next { right: 18px; }

.v-cap { margin: 0; padding: 8px 16px 0; text-align: center; font-size: 14px; font-style: italic; min-height: 1.6em; color: inherit; opacity: .7; transition: opacity .5s; }
.v-strip { display: flex; gap: 6px; overflow-x: auto; padding: 12px 16px 14px; scrollbar-width: none; scroll-behavior: smooth; justify-content: safe center; transition: opacity .5s; }
.v-strip::-webkit-scrollbar { display: none; }
.v-strip button { flex: none; width: 54px; height: 54px; padding: 0; border: 0; background: rgba(255,255,255,.08); cursor: pointer; opacity: .45; transition: opacity .3s, outline-color .3s;
                  outline: 1.5px solid transparent; outline-offset: 2px; }
.v-strip button.on { opacity: 1; outline-color: currentColor; }
.v-strip button:hover { opacity: .85; }
.v-strip img { width: 100%; height: 100%; object-fit: cover; }
.v-strip button { border-radius: 4px; overflow: hidden; }
.v-brand { display: none; }

/* idle: controls fade away while the slideshow plays */
.viewer.idle { cursor: none; }
.viewer.idle .v-top, .viewer.idle .v-nav, .viewer.idle .v-strip { opacity: 0; }
.viewer.idle .v-nav { pointer-events: none; }

@media (max-width: 640px) {
  .v-top { padding: 4px 6px 4px 16px; }
  .v-nav { display: none; }                         /* swipe on phones */
  .v-slide { padding: 6px 0; }
  .v-slide img { box-shadow: none; }
  .v-strip button { width: 44px; height: 44px; }
  .v-strip { justify-content: flex-start; }
}
@media (hover: none) { .v-nav { display: none; } }

/* big-screen mode for the reception (/slideshow) */
.viewer.screen { grid-template-rows: 2px 1fr auto auto; background: #fffefa; color: var(--ink); -webkit-backdrop-filter: none; backdrop-filter: none; }
.viewer.screen .v-cap { color: var(--ink-soft); opacity: 1; }
.viewer.screen .v-slide img { box-shadow: 0 18px 50px -18px rgba(40,36,10,.35); }
.viewer.screen .v-top, .viewer.screen .v-strip, .viewer.screen .v-nav { display: none; }
.viewer.screen .v-cap { font-size: 18px; padding-top: 14px; }
.viewer.screen .v-brand { display: flex; align-items: center; justify-content: center; gap: 22px; padding: 6px 0 22px; font-size: 15px; letter-spacing: .25em; }
.viewer.screen .v-brand img { width: 110px; }
.viewer.screen .v-slide { padding: 4vh 6vw 0; }

@media (prefers-reduced-motion: reduce) { .v-slide, .v-slide img { transition: none; } .v-slide.kb img.loaded { animation: none; } }

/* ---------- "table" slideshow: prints laid on a dark table that drifts upward ---------- */
.table { position: fixed; inset: 0; z-index: 70; overflow: hidden; color: #f4f1e6;
  background: rgba(14,13,8,.8); -webkit-backdrop-filter: blur(18px) saturate(.85); backdrop-filter: blur(18px) saturate(.85);
  opacity: 0; transition: opacity 1.1s ease; touch-action: none; user-select: none; -webkit-user-select: none; }
.table.open { opacity: 1; }
.table::after { content: ""; position: absolute; inset: 0; pointer-events: none; z-index: 2000;
  background: radial-gradient(120% 90% at 50% 45%, transparent 55%, rgba(0,0,0,.5)); }
.t-stage { position: absolute; inset: 0; }
.print { position: absolute; left: 0; top: 0; will-change: transform; }
.print .p-in { padding: var(--pad, 10px); background: #fbf9f2; border-radius: 2px;
  box-shadow: 0 1px 2px rgba(0,0,0,.3), 0 30px 60px -18px rgba(0,0,0,.75);
  animation: lay 2.4s cubic-bezier(.16,.8,.24,1) both; }
.print img { display: block; width: 100%; height: auto; background: #e9e5d8; }
.print.gone .p-in { opacity: 0; transition: opacity 1.4s ease; }
@keyframes lay {
  0%   { opacity: 0; transform: translateY(-14px) scale(1.14); filter: blur(3px); box-shadow: 0 1px 2px rgba(0,0,0,0), 0 70px 90px -20px rgba(0,0,0,.35); }
  45%  { opacity: 1; filter: blur(0); }
  100% { opacity: 1; transform: none; }
}
.t-intro { position: absolute; inset: 0; z-index: 2001; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px;
  pointer-events: none; opacity: 0; transition: opacity 1.6s ease; }
.t-intro.on { opacity: 1; }
.t-intro img { width: min(46vw, 300px); filter: brightness(0) invert(1); opacity: .92; }
.t-intro p { margin: 0; font-size: 13px; letter-spacing: .5em; opacity: .7; }
.t-controls { position: absolute; left: 50%; bottom: calc(22px + env(safe-area-inset-bottom)); z-index: 2002; transform: translateX(-50%);
  display: flex; gap: 4px; padding: 5px; border-radius: 999px; background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.14);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); transition: opacity .6s, transform .6s; }
.t-controls button { width: 44px; height: 44px; display: grid; place-items: center; border: 0; border-radius: 50%; background: none; color: inherit; cursor: pointer; transition: background .2s; }
.t-controls button:hover { background: rgba(255,255,255,.14); }
.t-controls svg { width: 16px; height: 16px; }
.table .i-play, .table.paused .i-pause { display: none; }
.table.paused .i-play { display: block; }
.table.idle { cursor: none; }
.table.idle .t-controls { opacity: 0; transform: translate(-50%, 10px); pointer-events: none; }
/* reception screen (/slideshow): no controls, a quiet brand mark in the corner */
.t-brand { display: none; }
.table.screen { cursor: none; }
.table.screen .t-controls { display: none; }
.table.screen .t-brand { display: flex; align-items: center; gap: 18px; position: absolute; right: 3vw; bottom: 3vh; z-index: 2001;
  font-size: clamp(12px, 1.1vw, 18px); letter-spacing: .3em; opacity: .75; pointer-events: none; }
.table.screen .t-brand img { width: clamp(70px, 6.5vw, 120px); filter: brightness(0) invert(1); }
.table.screen .t-intro img { width: min(34vw, 460px); }
.table.screen .t-intro p { font-size: clamp(13px, 1.2vw, 20px); }
@media (prefers-reduced-motion: reduce) { .print .p-in { animation: fadein 1.6s ease both; } }
@keyframes fadein { from { opacity: 0; } }

/* ---------- messages ---------- */
.note-form { display: flex; flex-direction: column; gap: 10px; width: 100%; max-width: 560px; margin-bottom: 40px; }
.note-form textarea { resize: vertical; }
.note-form .btn { align-self: center; margin-top: 4px; }
.hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; opacity: 0; }

/* before sending: a quiet line when notes go up after the couple reads them, or the board is resting */
.form-hint { margin: 2px 0 0; text-align: center; font-size: 13px; color: var(--ink-soft); }
.note-form.closed > :not(.form-hint) { opacity: .45; pointer-events: none; }
.note-form.closed .form-hint { font-size: 15px; color: var(--ink); padding: 10px 0; }

/* ---------- "sent" moment: the note slips into an envelope and is sealed ---------- */
.sent { display: flex; flex-direction: column; align-items: center; width: 100%; max-width: 560px; margin: 6px auto 46px; text-align: center; outline: none; }
.env { --w: min(300px, 74vw); position: relative; perspective: 900px; width: var(--w); height: calc(var(--w) * .62); margin: calc(var(--w) * .32) 0 26px;
       animation: env-float 5s ease-in-out 2.6s infinite; }
.env > div { position: absolute; }
.env-back { inset: 0; background: #efe9d8; border-radius: 4px; box-shadow: 0 22px 40px -24px rgba(51,47,10,.45); }
.env-letter { left: 7%; right: 7%; top: 6%; height: 92%; z-index: 3; background: #fffef9; border: 1px solid var(--hair); border-radius: 2px;
              padding: 10% 9% 0; overflow: hidden; text-align: left; animation: env-letter 1.1s cubic-bezier(.3,.7,.2,1) .15s both; }
.env-letter p { margin: 0; font-family: var(--ff, var(--mono)); font-style: var(--fst, normal); font-size: calc(var(--w) * .052); line-height: 1.45; color: var(--ink);
                display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 4; overflow: hidden; }
.env-front { inset: 0; z-index: 4; background: #f6f1e3; border-radius: 4px;
             clip-path: polygon(0 0, 50% 52%, 100% 0, 100% 100%, 0 100%); box-shadow: inset 0 0 0 1px rgba(51,47,10,.06); }
.env-flap { left: 0; right: 0; top: 0; height: 58%; z-index: 2; background: #e9e2cd; transform-origin: top;
            clip-path: polygon(0 0, 100% 0, 50% 100%); transform: rotateX(180deg);
            animation: env-flap .7s cubic-bezier(.5,0,.3,1) 1.2s both; }
.env-seal { left: 50%; top: 58%; z-index: 6; width: calc(var(--w) * .24); height: calc(var(--w) * .24); margin: calc(var(--w) * -.12) 0 0 calc(var(--w) * -.12);
            border-radius: 50%; display: grid; place-items: center; color: #f4ead0;
            background: radial-gradient(circle at 35% 30%, #5a531f, #332F0A 70%); box-shadow: 0 3px 8px rgba(51,47,10,.45), inset 0 0 0 3px rgba(255,255,255,.08);
            animation: env-seal .55s cubic-bezier(.3,1.6,.5,1) 1.85s both; }
.env-seal span { font-family: "Great Vibes", cursive; font-size: calc(var(--w) * .05); line-height: 1; white-space: nowrap; transform: translateY(1px); }
.sent-title { margin: 0 0 8px; font-weight: 700; font-size: 14px; letter-spacing: .34em; color: var(--black); animation: fade .8s ease 2.2s both; opacity: 0; }
.sent-text { margin: 0 0 22px; max-width: 30em; color: var(--ink-soft); animation: fade .8s ease 2.4s both; opacity: 0; }
.sent .btn { animation: fade .8s ease 2.7s both; opacity: 0; }
@keyframes env-letter { from { transform: translateY(-78%); } to { transform: translateY(0); } }
@keyframes env-flap { 0% { transform: rotateX(180deg); z-index: 2; } 49% { z-index: 2; } 50% { z-index: 5; } 100% { transform: rotateX(0deg); z-index: 5; } }
@keyframes env-seal { from { transform: scale(0) rotate(-30deg); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes env-float { 50% { transform: translateY(-5px) rotate(-.6deg); } }
@media (prefers-reduced-motion: reduce) {
  .env, .env-letter, .env-seal { animation: none; }
  .env-flap { animation: none; transform: none; z-index: 5; }
  .sent-title, .sent-text, .sent .btn { animation: fade .6s ease both; }
}

/* a note waiting for the couple: only its writer sees it, softly sealed */
.note.pending { background: #fbf8ee; border-style: dashed; border-color: #ddd5bd; }
.note.pending p { opacity: .72; }
.note-tag { display: inline-flex; align-items: center; gap: 7px; margin-top: 10px; font-size: 11px; letter-spacing: .14em; color: var(--ink-soft);
            transition: opacity .8s ease; }
.note-tag::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #5a531f, #332F0A 70%); flex: none; }
.note-tag.ok { color: #3f5a1f; }
.note-tag.ok::before { background: #5e8a2e; }
.note-tag.fade { opacity: 0; }
.note.approved { animation: approved 1.4s ease; }
@keyframes approved { 0% { box-shadow: 0 0 0 0 rgba(94,138,46,.35); } 100% { box-shadow: 0 0 0 14px rgba(94,138,46,0); } }

.board { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr)); gap: 18px; align-items: start; width: 100%; text-align: left; }
.note {
  margin: 0; padding: 22px 22px 18px; border: 1px solid var(--hair); border-radius: var(--r-md); background: #fffef9;
  animation: fade .6s ease both;
}
.note p { margin: 0 0 14px; white-space: pre-wrap; word-wrap: break-word; font-size: 16px; }
.note footer { font-size: 13px; letter-spacing: .1em; color: var(--ink-soft); }
.note footer b { color: var(--ink); }
.board .note p { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 8; line-clamp: 8; overflow: hidden; }
.board .note.open p { display: block; -webkit-line-clamp: unset; line-clamp: none; overflow: visible; }
.read-more { display: block; margin: -6px 0 14px; padding: 0; border: 0; background: none; cursor: pointer;
  font-size: 12px; letter-spacing: .2em; color: var(--ink-soft); text-decoration: underline; text-underline-offset: 3px; }
.read-more:hover { color: var(--ink); }
.board-more { display: flex; flex-direction: column; align-items: center; gap: 12px; margin-top: 28px; }
.board-more:not(:has(> :not([hidden]))) { display: none; }
.board-count { margin: 0; font-size: 12px; letter-spacing: .2em; color: var(--ink-soft); }

/* ---------- closing ---------- */
.closing .date { font-size: clamp(20px, 3vw, 28px); letter-spacing: .06em; margin: 6px 0 30px; color: var(--ink); }
.closing { padding-bottom: 110px; }
.status.quiet::before { display: none; }
[hidden] { display: none !important; }
button { font-family: inherit; }
.board:empty { display: block; text-align: center; }
.board:empty::before { content: "No notes yet. Yours could be the very first."; display: block; font-style: italic; color: var(--ink-soft); padding: 8px 0 20px; }

/* ---------- message handwriting ---------- */
.f-typewriter  { --ff: var(--mono);                                   --fs: 16px; --lh: 1.6;  --fst: normal; --fw: 400; }
.f-monoline    { --ff: "Sacramento", cursive;                         --fs: 31px; --lh: 1.2;  --fst: normal; --fw: 400; }
.f-calligraphy { --ff: "Great Vibes", cursive;                        --fs: 28px; --lh: 1.28; --fst: normal; --fw: 400; }
.f-handwritten { --ff: "Caveat", cursive;                             --fs: 24px; --lh: 1.3;  --fst: normal; --fw: 400; }
.f-classic     { --ff: "Cormorant Garamond", Georgia, serif;          --fs: 21px; --lh: 1.45; --fst: italic; --fw: 500; }
.f-pen         { --ff: "Homemade Apple", cursive;                     --fs: 16px; --lh: 1.95; --fst: normal; --fw: 400; }
.note[class*="f-"] p, .chip-face { font-family: var(--ff); font-style: var(--fst); font-weight: var(--fw); }
.note[class*="f-"] p { font-size: var(--fs); line-height: var(--lh); }
@media (max-width: 640px) { .note[class*="f-"] p { font-size: calc(var(--fs) * .92); } }

.fonts { border: 0; padding: 0; margin: 6px 0 0; min-width: 0; }
.fonts legend { padding: 0; margin: 0 0 10px; font-size: 12px; letter-spacing: .3em; color: var(--ink-soft); width: 100%; text-align: center; }
.chips { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; }
.chip { position: relative; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 2px;
        padding: 10px 4px 8px; border: 1px solid var(--hair); border-radius: var(--r-md); background: #fff; transition: border-color .2s, background .2s, transform .2s; }
.chip:hover { border-color: #cfcab6; transform: translateY(-1px); }
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip-face { font-size: 26px; line-height: 1.2; height: 34px; display: flex; align-items: center; color: var(--ink); }
.chip .f-typewriter { font-size: 22px; } .chip .f-pen { font-size: 15px; } .chip .f-classic { font-size: 26px; }
.chip small { font-size: 10px; letter-spacing: .08em; color: var(--ink-soft); white-space: nowrap; }
.chip:has(input:checked) { border-color: var(--ink); background: #fffef9; box-shadow: inset 0 0 0 1px var(--ink); }
.chip:has(input:focus-visible) { outline: 2px solid var(--ink); outline-offset: 2px; }
@media (max-width: 640px) {
  .chips { grid-template-columns: repeat(3, 1fr); }
}

.preview { margin-top: 6px; text-align: left; }
.preview-label { margin: 0 0 8px; font-size: 12px; letter-spacing: .3em; color: var(--ink-soft); text-align: center; }
.preview .note { margin: 0; animation: none; transition: box-shadow .3s; box-shadow: 0 14px 34px -22px rgba(51,47,10,.45); }
.preview #pv-msg:empty::before { content: "Your message will look like this…"; opacity: .45; }
.preview .note p { transition: font-size .2s; min-height: 1.4em; }

.gallery:not(.mixed) .tile .badge { display: none; }
.g-bar:has(.tabs[hidden]) { justify-content: center; border-bottom: 0; }
