@font-face {
  font-family: Lora;
  src: url('../../assets/Lora.ttf') format('truetype');
  font-display: swap;
}
@font-face {
  font-family: Manrope;
  src: url('../../assets/Manrope.ttf') format('truetype');
  font-display: swap;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body {
  --bar-height: 3.5rem;
  --gutter: clamp(1.4rem, 7cqw, 9rem);
  --serif: Lora, Georgia, serif;
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 1rem/1.7 Manrope, Arial, sans-serif;
}
.toba {
  --paper: #f4f3ec; --soft: #e1eae6; --ink: #172f35;
  --accent: #355b56; --line: #adbfba; --strong: #19383e;
}
.pusaka {
  --paper: #f5ecdd; --soft: #eadbc5; --ink: #341f19;
  --accent: #853825; --line: #c4a58f; --strong: #5a281f;
}
a { color: inherit; }
img { display: block; max-width: 100%; }
button, select { font: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid currentColor; outline-offset: 4px; }
.skip { position: fixed; z-index: 10; top: -6rem; left: 1rem; padding: .65rem 1rem; background: white; }
.skip:focus { top: .4rem; }

.preview-bar {
  position: sticky;
  z-index: 5;
  top: 0;
  min-height: var(--bar-height);
  padding: .4rem clamp(.7rem, 4vw, 4rem);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: .75rem;
  background: #fffdf8;
  color: #392b2a;
  border-bottom: 1px solid #ded2c3;
  font-size: .78rem;
  font-weight: 800;
}
.preview-bar > a { justify-self: start; text-underline-offset: .25em; }
.preview-notice { font-size: .66rem; text-transform: uppercase; letter-spacing: .13em; }
.preview-switch { justify-self: end; display: inline-flex; min-height: 2.65rem; gap: .6rem; align-items: center; cursor: pointer; white-space: nowrap; }
.preview-switch input {
  appearance: none;
  width: 2.45rem;
  height: 1.4rem;
  margin: 0;
  border-radius: 1rem;
  border: 1px solid #79655c;
  background: #e3d9d0;
  cursor: pointer;
}
.preview-switch input::before {
  content: '';
  display: block;
  width: 1rem;
  height: 1rem;
  margin: .14rem .17rem;
  border-radius: 50%;
  background: #60473e;
  transition: transform .18s;
}
.preview-switch input:checked { background: #76283b; border-color: #76283b; }
.preview-switch input:checked::before { transform: translateX(1rem); background: #fff; }
.preview-shell { container: invitation / inline-size; width: 100%; }
.is-phone .preview-stage { padding: clamp(.6rem, 3vw, 1.5rem); background: #e9e1d7; }
.is-phone .preview-shell {
  position: relative;
  width: min(100%, 410px);
  margin-inline: auto;
  padding: 0;
  border: 8px solid #251f20;
  border-radius: 2.3rem;
  overflow: hidden;
  box-shadow: 0 18px 45px #392e2b38;
  background: var(--paper);
}
.is-phone .preview-shell::before {
  content: '';
  position: absolute;
  z-index: 4;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 5.7rem;
  height: 1rem;
  border-radius: 0 0 1rem 1rem;
  background: #251f20;
  pointer-events: none;
}
.is-phone .preview-scroll {
  height: min(49rem, calc(100dvh - 8rem));
  min-height: 15rem;
  overflow: auto;
  scroll-behavior: smooth;
  scrollbar-width: thin;
  overscroll-behavior: contain;
}

h1, h2, h3, p, figure { margin: 0; }
h1, h2, h3 { font: normal 1em/1.05 var(--serif); }
h1 em, h2 em { font-weight: inherit; }
h2 em { color: var(--accent); }
h2 { font-size: clamp(2.6rem, 6cqw, 6.7rem); letter-spacing: -.055em; text-wrap: balance; }
h3 { font-size: clamp(1.45rem, 2.7cqw, 2.75rem); letter-spacing: -.035em; }
.label { font-size: .71rem; line-height: 1.45; letter-spacing: .16em; font-weight: 800; text-transform: uppercase; }
.label + h2 { margin-top: .8rem; }
h2 + p { margin-top: 1.4rem; max-width: 33rem; }
.button {
  display: inline-flex;
  justify-content: space-between;
  align-items: center;
  gap: 1.2rem;
  min-height: 2.8rem;
  padding: .6rem 1.2rem;
  background: transparent;
  border: 1px solid currentColor;
  color: inherit;
  text-decoration: none;
  font-size: .78rem;
  font-weight: 800;
}
.button:hover { text-decoration: underline; text-underline-offset: .25em; }
.cover {
  display: grid;
  align-items: center;
  position: relative;
  isolation: isolate;
  min-height: calc(100dvh - var(--bar-height));
  padding: clamp(3.1rem, 8vh, 6rem) var(--gutter);
  overflow: hidden;
}
.cover-content { z-index: 1; }
.cover h1 { margin: 1.2rem 0 1.3rem; font-size: clamp(5rem, 10.5cqw, 13rem); letter-spacing: -.07em; line-height: .88; }
.cover h1 em { font-size: .61em; }
.cover-date { font-size: clamp(.89rem, 1.3cqw, 1.04rem); }
.cover-button { margin-top: 1.55rem; }
.toba-cover { color: #fffdf2; background: #17343e; }
.cover-image {
  position: absolute;
  z-index: -2;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 65% 47%;
}
.toba-cover::after {
  content: '';
  position: absolute;
  z-index: -1;
  inset: 0;
  background: linear-gradient(90deg, #10282fea 0%, #10282fba 23%, #10282f35 55%, #10282f06 85%);
}
.toba-cover h1 em { color: #d1e4d5; }
.toba .button { border-radius: 3rem; }
.toba .cover-button { background: #f4f3ec; color: #172f35; }
.pusaka-cover {
  grid-template-columns: 1fr .86fr;
  gap: clamp(2rem, 7cqw, 8rem);
  background: radial-gradient(ellipse at 40% 40%, #fff5e5, var(--soft) 95%);
}
.pusaka-cover::before {
  content: '';
  position: absolute;
  inset: clamp(.5rem, 2cqw, 2rem);
  border: 4px double var(--line);
  pointer-events: none;
}
.pusaka-cover .label, .pusaka-cover h1 em { color: var(--accent); }
.pusaka-cover h1 { font-size: clamp(4.8rem, 10.2cqw, 11rem); }
.pusaka .cover-button { background: var(--accent); color: #fffbf2; }
.cover-portrait { position: relative; width: min(100%, 31rem); justify-self: end; padding: .64rem; border: 1px solid var(--line); background: var(--paper); box-shadow: .75rem .75rem 0 #a67d583b; }
.cover-portrait img { width: 100%; height: min(64dvh, 42rem); min-height: 18rem; object-fit: cover; object-position: center 40%; }

.section-nav {
  position: sticky;
  z-index: 3;
  top: var(--bar-height);
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0 clamp(.65rem, 4cqw, 3rem);
  padding: .35rem var(--gutter);
  background: var(--paper);
  color: var(--accent);
  border-bottom: 1px solid var(--line);
}
.section-nav a { display: grid; place-items: center; min-height: 2.55rem; text-decoration: none; font-weight: 800; font-size: .78rem; }
.section-nav a:hover { text-decoration: underline; text-underline-offset: .2em; }
.section { padding: clamp(4.3rem, 9cqw, 10rem) var(--gutter); scroll-margin-top: calc(var(--bar-height) + 3.7rem); }
.toba-intro, .toba-events, .pusaka-events, .attendance { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(2rem, 7cqw, 8rem); align-items: start; }
.couple { display: grid; gap: 1.2rem; }
.couple article { border-top: 1px solid var(--line); padding: 1.5rem .1rem .5rem; }
.couple p { margin-top: .6rem; font-size: .89rem; }
.toba-events { color: #f3f4eb; background: var(--strong); }
.toba-events h2 em, .toba-events .label { color: #c8ded4; }
.section [data-calendar] { margin-top: 1.5rem; }
.schedule { padding: 0; margin: 0; list-style: none; }
.schedule li { display: grid; grid-template-columns: auto 1fr; gap: clamp(.85rem, 3cqw, 2rem); align-items: baseline; padding: 1.6rem 0; border-top: 1px solid #8faea7; }
.schedule time, summary time { font-size: .78rem; font-weight: 800; white-space: nowrap; }
.schedule p { margin-top: .55rem; font-size: .88rem; }
.pusaka-intro { text-align: center; }
.pusaka-intro h2 + p { margin-inline: auto; }
.pusaka-intro .couple { grid-template-columns: 1fr 1fr; max-width: 66rem; margin: 3rem auto 0; gap: 1.5rem; }
.pusaka-intro .couple article { padding: 2rem 1rem; border: 4px double var(--line); }
.pusaka-events { background: var(--soft); }
.event-details details { border-top: 1px solid var(--line); }
.event-details details:last-child { border-bottom: 1px solid var(--line); }
.event-details summary { list-style: none; display: flex; align-items: center; gap: .75rem; padding: 1.3rem 0; cursor: pointer; font: normal clamp(1.24rem, 2.3cqw, 2.25rem)/1.15 var(--serif); }
.event-details summary::-webkit-details-marker { display: none; }
.event-details summary::before { content: '+'; color: var(--accent); }
.event-details details[open] summary::before { content: '−'; }
.event-details summary time { margin-inline-start: auto; font-family: Manrope, Arial, sans-serif; }
.event-details details > p { padding: 0 0 1.2rem 1.5rem; font-size: .89rem; }
.toba-gallery { background: var(--soft); }
.gallery { display: grid; grid-template-columns: 1.6fr 1fr; grid-template-rows: repeat(2, minmax(7rem, 17cqw)); gap: clamp(.5rem, 1.6cqw, 1.4rem); margin-top: 2rem; }
.gallery button { padding: 0; border: 0; background: var(--soft); overflow: hidden; color: var(--ink); }
.gallery button:first-child { grid-row: span 2; }
.gallery img { width: 100%; height: 100%; object-fit: cover; transition: transform .25s; }
.gallery button:hover img { transform: scale(1.035); }
.toba-gallery .gallery button:first-child img { object-position: 67% center; }
.pusaka-gallery .gallery { grid-template-columns: 1fr 1.5fr; grid-template-rows: clamp(14rem, 30cqw, 32rem); align-items: center; }
.pusaka-gallery .gallery button { grid-row: auto; height: 75%; border: .55rem solid white; box-shadow: 0 7px 24px #6b4c3326; }
.pusaka-gallery .gallery button:first-child { height: 100%; }
.pusaka-gallery .gallery button:first-child img { object-position: center 38%; }
.attendance { align-items: center; background: var(--strong); color: var(--paper); }
.attendance h2 em { color: #efcdb2; }
.toba .attendance h2 em { color: #c8ded4; }
.rsvp { display: grid; gap: .95rem; padding: clamp(1rem, 3cqw, 2.3rem); border: 1px solid currentColor; }
.rsvp-note { font-size: .85rem; }
.rsvp label { display: grid; gap: .3rem; font-size: .83rem; font-weight: 800; }
.rsvp select { width: 100%; min-height: 2.75rem; padding: .45rem .65rem; border: 1px solid var(--line); border-radius: .2rem; background: var(--paper); color: var(--ink); font-weight: 600; }
.rsvp .button { justify-content: center; background: var(--paper); color: var(--ink); }
.rsvp-result { font-size: .85rem; font-weight: 800; }
.rsvp-result:empty { display: none; }
.invitation-footer { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .75rem; padding: 1.4rem var(--gutter); font-size: .76rem; }
.invitation-footer a { font-weight: 800; }
.lightbox { width: min(94vw, 65rem); max-height: 94dvh; border: 0; padding: 1rem; color: #fffdf8; background: #201b1b; }
.lightbox::backdrop { background: #171315db; }
.lightbox img { margin-inline: auto; width: 100%; height: min(70dvh, 46rem); object-fit: contain; }
.lightbox button { min-width: 2.7rem; min-height: 2.7rem; background: transparent; color: inherit; border: 1px solid #b8aba1; border-radius: 50%; font-size: 1.2rem; }
.lightbox-close { display: block; margin: 0 0 .55rem auto; line-height: 1; }
.lightbox-controls { display: flex; justify-content: center; align-items: center; gap: 1rem; padding-top: .55rem; }
.lightbox-controls span { font-size: .8rem; }

@container invitation (max-width: 660px) {
  .cover { min-height: calc(100svh - var(--bar-height)); }
  .cover h1 { font-size: clamp(3.7rem, 16cqw, 6.2rem); }
  .toba-cover { align-items: end; min-height: max(33rem, calc(100svh - var(--bar-height))); padding-bottom: 2.3rem; }
  .toba-cover .cover-image { object-position: 84% center; }
  .toba-cover::after { background: linear-gradient(0deg, #10282ff9 1%, #10282fc9 24%, #10282f38 60%, transparent 83%); }
  .pusaka-cover { grid-template-columns: 1fr; align-content: center; justify-items: center; text-align: center; gap: 1.5rem; padding-block: 2.7rem 2.4rem; }
  .pusaka-cover h1 br { display: none; }
  .pusaka-cover h1 { font-size: clamp(3rem, 13cqw, 5.5rem); margin: .8rem 0; line-height: .95; }
  .cover-portrait { grid-row: 1; justify-self: center; width: min(70%, 18rem); padding: .3rem; box-shadow: .42rem .42rem 0 #a67d583b; }
  .cover-portrait img { height: clamp(13rem, 63cqw, 20.5rem); min-height: 0; }
  .toba-intro, .toba-events, .pusaka-events, .attendance, .pusaka-intro .couple { grid-template-columns: 1fr; }
  .pusaka-intro .couple { margin-top: 2rem; }
  .gallery { gap: .5rem; }
}
.is-phone .cover { min-height: clamp(27rem, calc(100dvh - 9rem), 39rem); }
.is-phone .section-nav { top: 0; }
.is-phone .section { scroll-margin-top: 3.6rem; }
@media (max-width: 470px) {
  body { --bar-height: 4.375rem; }
  .preview-bar { grid-template-columns: 1fr 1fr; column-gap: .5rem; row-gap: 0; padding-block: .2rem .45rem; }
  .preview-notice { grid-area: 2 / 1 / 3 / -1; justify-self: center; font-size: .59rem; }
  .preview-switch { grid-area: 1 / 2; }
}
@media (prefers-reduced-motion: reduce) {
  html, .is-phone .preview-scroll { scroll-behavior: auto; }
  .preview-switch input::before, .gallery img { transition: none; }
}
