@import url('./fonts.css');

:root {
  color-scheme: light;
  --plum: #392142;
  --plum-ink: #512b5c;
  --lilac-ink: #70437d;
  --muted: #655372;
  --line: #d6c3db;
  --paper: #fcf6f0;
  --display: 'Cormorant Garamond', Georgia, serif;
  --serif: 'Lora', Georgia, serif;
  --sans: 'Segoe UI', system-ui, sans-serif;
  font: 100% var(--serif);
  color: var(--plum);
  background: #f3eaf4;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-height: 100vh; }
body:has(.forest.is-opening:not([hidden])) { overflow: hidden; }
img { display: block; max-width: 100%; }
p, dd { margin: 0; }
button, input { font: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--lilac-ink); outline-offset: 4px; }
[tabindex="-1"]:focus { outline: none; }
h1, h2, h3 { margin: 0; font-family: var(--display); line-height: 1; }
h1, h2 { letter-spacing: -.03em; }
h1 em, h2 em { font-weight: 600; color: var(--lilac-ink); }

.forest {
  position: fixed;
  inset: 0;
  z-index: 2;
  isolation: isolate;
  overflow: auto;
  color: #fff8f0;
  background: #28362e;
  --weather-accent: #dfe8b2;
}
.forest[data-season="summer"] { --weather-accent: #bfe2f6; }
.forest[data-season="autumn"] { --weather-accent: #ffc99d; }
.forest[data-season="winter"] { --weather-accent: #e2edff; }
.forest-backdrop, .forest-atmosphere, .season-light, .season-weather {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.forest-backdrop { isolation: isolate; overflow: hidden; }
.season-plate { position: absolute; inset: 0; opacity: 0; }
.season-plate.is-outgoing { z-index: 0; opacity: 1; }
.season-plate.is-active { z-index: 1; opacity: 1; }
.season-plate.is-entering { animation: season-crossfade 960ms ease-in-out both; }
.season-weather { width: 100%; height: 100%; }
.season-light span { position: absolute; inset: 0; opacity: 0; transition: opacity 850ms ease-in-out; }
.season-light [data-light="spring"] { background: radial-gradient(ellipse at 77% 16%, #fff2c44f, #d8e99a12 47%, transparent 70%); }
.season-light [data-light="summer"] { background: linear-gradient(135deg, #1d3c554a, transparent 63%), radial-gradient(ellipse at 83% 25%, #bcc9e22e, transparent 66%); }
.season-light [data-light="autumn"] { background: radial-gradient(ellipse at 88% 16%, #ffc16d50, #f48e351b 46%, transparent 71%); }
.season-light [data-light="winter"] { background: linear-gradient(130deg, #263c6542, transparent 68%), radial-gradient(ellipse at 85% 26%, #e0eaff55, transparent 65%); }
.forest[data-season="spring"] [data-light="spring"],
.forest[data-season="summer"] [data-light="summer"],
.forest[data-season="autumn"] [data-light="autumn"],
.forest[data-season="winter"] [data-light="winter"] { opacity: 1; }

@keyframes season-crossfade {
  from { opacity: 0; }
  to { opacity: 1; }
}
.forest-backdrop img { width: 100%; height: 100%; object-fit: cover; object-position: 70% 51%; }
.forest-atmosphere {
  background:
    linear-gradient(90deg, #101714a6 0%, #1017147c 33%, #1b211615 63%, #10171425),
    linear-gradient(0deg, #101714aa, transparent 31%);
}
.forest-shell {
  position: relative;
  width: min(calc(100% - 8rem), 1210px);
  min-height: 100svh;
  margin-inline: auto;
  padding-block: 6.6rem 4rem;
  display: grid;
  grid-template-columns: 1.06fr .94fr;
  place-items: center stretch;
}
.forest-brand {
  position: absolute;
  top: clamp(1.55rem, 5vh, 3.3rem);
  left: 0;
  display: flex;
  align-items: center;
  gap: .85rem;
  color: #ead4fa;
  font: 700 1.7rem/.8 var(--display);
  text-shadow: 0 1px 4px #17101dd9;
}
.forest-brand-mark {
  flex: none;
  width: 40px;
  aspect-ratio: 1;
  background-color: #caa4ea;
  mask: url('./yushinkai-mark.png') center / contain no-repeat;
}
.forest-brand small { display: block; margin-top: .47rem; color: #dfbaf2; font: 650 .71rem/1 var(--sans); text-transform: uppercase; letter-spacing: .205em; }
.forest-copy { position: relative; z-index: 1; margin: 0; padding-block: 1.1rem 2rem; }
.forest-copy blockquote { margin: 0; }
.forest-copy h1 { font-size: clamp(2.4rem, 5.15vw, 5rem); line-height: 1.1; text-shadow: 0 5px 28px #0b170cad; }
.forest-copy h1 em { color: #e7d2f0; }
.quote-japanese {
  margin-top: 1.35rem;
  color: #fff3ed;
  font: 500 clamp(.9rem, 1.45vw, 1.2rem)/1.65 'Noto Serif JP', 'Yu Mincho', 'Hiragino Mincho ProN', serif;
  letter-spacing: .045em;
  text-shadow: 0 2px 8px #101913;
}
.quote-japanese span { white-space: nowrap; }
.quote-source { margin-top: .68rem; font: 500 .84rem/1.5 var(--sans); color: #f4e9f1; }
.quote-source a { color: inherit; text-underline-offset: 4px; text-decoration-color: #f4e9f196; }
.quote-source a:hover { text-decoration-color: currentColor; }
.quote-source a:focus-visible { outline-color: #f4e9f1; }
.forest-open {
  position: relative;
  display: grid;
  justify-items: center;
  align-content: center;
  justify-self: center;
  width: clamp(235px, 36vw, 472px);
  max-width: 100%;
  padding: 0 0 .45rem;
  border: 0;
  color: inherit;
  background: transparent;
  isolation: isolate;
  -webkit-tap-highlight-color: transparent;
  border-radius: 100% 100% 10% 10%;
}
.forest-open:focus-visible { outline-color: #f4dbfb; outline-offset: .65rem; }
.forest-open:disabled { cursor: default; }
.forest-halo {
  position: absolute;
  z-index: -1;
  inset: 14% -5% auto;
  height: 69%;
  background: radial-gradient(ellipse at center, #c4abd62e 0%, #b2a1cf18 34%, transparent 72%);
  opacity: .64;
  transition: opacity 500ms ease;
}
.iris {
  position: relative;
  display: block;
  width: 100%;
  max-width: 58svh;
  aspect-ratio: 1;
}
.iris img, .iris-flower, .iris-frames {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.iris img { object-fit: contain; }
.iris-flower {
  filter: var(--flower-light, brightness(1) saturate(1)) drop-shadow(0 12px 18px #1612165c);
  transition: filter 840ms ease-in-out;
}
.iris .iris-leaves {
  inset: auto 4% -4%;
  width: 92%;
  height: auto;
  opacity: .9;
  filter: var(--leaf-light, brightness(.83) saturate(.9)) drop-shadow(0 6px 12px #18201877);
}
.forest[data-season="summer"] { --flower-light: brightness(.86) saturate(.83); --leaf-light: brightness(.65) saturate(.75); }
.forest[data-season="autumn"] { --flower-light: sepia(.18) saturate(.92); --leaf-light: sepia(.33) brightness(.74) saturate(.82); }
.forest[data-season="winter"] { --flower-light: brightness(.92) saturate(.65); --leaf-light: brightness(.86) saturate(.45); }
.iris-bloom { opacity: 0; }
.is-bloom-fallback .iris-bud { opacity: 0; transition: opacity 420ms ease; }
.is-bloom-fallback .iris-bloom { opacity: 1; transition: opacity 520ms ease; }
.forest-open:hover .forest-halo, .forest-open:focus-visible .forest-halo { opacity: 1; }
.forest-open-label {
  z-index: 1;
  display: flex;
  align-items: center;
  gap: .59rem;
  margin-top: -.3rem;
  border: 1px solid #ecdff293;
  border-radius: 999px;
  padding: .64rem 1rem;
  background: #2b3230e6;
  color: #fff4fa;
  box-shadow: 0 4px 28px #1015113b;
  font: 600 .9rem/1.2 var(--sans);
  white-space: nowrap;
}
.forest-open-label span { width: 7px; height: 7px; border: 1px solid #f4c7f7; transform: rotate(45deg); background: var(--weather-accent); }
.forest.is-opening .forest-halo { opacity: 1; }
.forest.is-opening .forest-open-label { opacity: 0; transition: opacity 220ms ease; }
.forest.is-leaving { pointer-events: none; animation: forest-exit 780ms cubic-bezier(.32, .07, .31, 1) both; }

@keyframes forest-exit {
  0% { opacity: 1; transform: scale(1); }
  100% { opacity: 0; transform: scale(1.035); }
}

.invite-shell {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  min-height: 100svh;
  display: grid;
  align-items: center;
  justify-items: center;
  padding: clamp(.85rem, 1.8vw, 2.5rem) clamp(.7rem, 1.65vw, 2.1rem);
  background:
    radial-gradient(ellipse at 29% 4%, #f9eee04d, transparent 64%),
    linear-gradient(145deg, #bba7be6b, #947c9a85),
    url('./handbook-paper.webp') center / cover #dbcec6;
}
.invite-shell::before {
  content: '';
  position: absolute;
  z-index: -1;
  inset: 0;
  background:
    url('./handbook-brush.webp') left -135px top -200px / min(53rem, 75vw) auto no-repeat,
    url('./handbook-iris.webp') right 8px bottom -32px / min(12vw, 132px) auto no-repeat;
  opacity: .36;
  pointer-events: none;
}
.fold-card {
  position: relative;
  width: min(100%, 1560px);
  display: grid;
  grid-template-columns: minmax(0, .81fr) minmax(0, 1.19fr);
  border: 1px solid #9e88754d;
  border-radius: 4px;
  box-shadow:
    0 1px #e5d7c6, 0 2px #cabaad, 0 3px #a68f8059,
    0 5px 9px #58433829, 0 22px 42px -9px #4d354e52;
  overflow: hidden;
  background:
    url('./paper-grain.png') 0 0 / 288px repeat,
    url('./handbook-paper.webp') center / cover no-repeat #eee7dc;
  transform-origin: 41% center;
}
.is-revealing .fold-card { animation: fold-reveal 850ms cubic-bezier(.19, .76, .23, 1) both; }
@keyframes fold-reveal {
  0% { opacity: 0; transform: perspective(1500px) translateY(32px) scale(.94) rotateY(-13deg); }
  100% { opacity: 1; transform: perspective(1500px); }
}
.letter-pane, .photo-pane {
  position: relative;
  isolation: isolate;
  box-shadow: inset 0 1px #fffdf47d;
}
.letter-pane {
  min-width: 0;
  padding: clamp(1.45rem, 2.65vw, 2.75rem) clamp(1.45rem, 4vw, 3.55rem);
  background:
    linear-gradient(270deg, #604a3d26, #6653430d 9px, transparent 29px),
    linear-gradient(162deg, #fffaec20, transparent 56%, #8a6f6720);
  border-right: 1px solid #866f6459;
}
.letter-pane::before, .photo-pane::before {
  content: '';
  position: absolute;
  z-index: -1;
  inset: 0;
  pointer-events: none;
}
.letter-pane::before {
  background: url('./handbook-iris.webp') right -10px bottom -48px / clamp(75px, 17%, 98px) auto no-repeat;
  opacity: .54;
}
.letter-logo { width: 113px; height: auto; margin-bottom: 1.2rem; }
.letter-pane h1 { font-size: clamp(2.04rem, 2.8vw, 2.68rem); line-height: 1.02; text-wrap: pretty; }
.invite-copy { margin-top: 1rem; font-size: clamp(1rem, 1.295vw, 1.08rem); line-height: 1.66; color: var(--muted); }
.invite-copy p + p { margin-top: .58rem; }
.invite-copy .invite-request { margin-top: 1.04rem; color: var(--plum-ink); }
.event {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 3fr);
  gap: .65rem;
  margin: 1.15rem 0;
}
.event div { min-width: 0; border-top: 1px solid #bfa9c9; padding-top: .5rem; }
.event dt { margin-bottom: .23rem; font: 700 .83rem/1.2 var(--sans); color: var(--plum-ink); }
.event dd { font-size: .875rem; line-height: 1.45; overflow-wrap: anywhere; }
.event a { color: var(--lilac-ink); text-underline-offset: 3px; }
.rsvp label { display: block; margin-bottom: .4rem; font: 700 .875rem/1.2 var(--sans); }
.rsvp-row { display: flex; flex-wrap: wrap; align-items: stretch; gap: .45rem; }
.rsvp input {
  flex: 1 1 7.8rem;
  min-width: 0;
  width: 100%;
  min-height: 43px;
  border: 1px solid #bca1c7;
  border-radius: 4px;
  padding: .55rem .65rem;
  background: #fffafc;
  color: var(--plum);
  font-size: 1rem;
}
.rsvp input::placeholder { color: #706177; opacity: 1; font: 400 .88rem var(--sans); }
.rsvp button {
  flex: 1 0 auto;
  min-height: 43px;
  border: 1px solid transparent;
  border-radius: 4px;
  padding: .45rem .79rem;
  color: #fff5fd;
  background: var(--plum-ink);
  font: 700 .875rem/1.2 var(--sans);
  white-space: nowrap;
}
.rsvp button:not(:disabled):hover { background: #41204c; }
.rsvp button:disabled { opacity: .68; cursor: default; }
.rsvp-status { margin-top: .45rem; color: #4b3858; font: 600 .88rem/1.4 var(--sans); }
.rsvp-status:empty { margin-top: 0; }
.rsvp-status[data-error] { color: #89324e; }

.photo-pane {
  display: grid;
  align-content: start;
  min-width: 0;
  padding: clamp(1.45rem, 3.15vw, 3.35rem) clamp(1.45rem, 4.25vw, 4rem);
  background:
    linear-gradient(90deg, #fffaf378 0 1px, #715a4915 2px, transparent 26px),
    linear-gradient(159deg, #fffbf517, transparent 47%, #a6927d17);
}
.photo-pane::before {
  background: url('./handbook-brush.webp') right -113px top -121px / min(29vw, 310px) auto no-repeat;
  opacity: .68;
}
.photo-pane h2 { margin-bottom: clamp(.85rem, 1.9vw, 1.35rem); font-size: clamp(2rem, 2.9vw, 3.05rem); line-height: 1; }
.photo-media { position: relative; }
.photo-timeline {
  position: absolute;
  z-index: 1;
  inset: auto .67rem .22rem;
  display: grid;
  align-items: center;
  width: calc(100% - 1.34rem);
  height: 29px;
  padding: 0 .28rem;
  border: 0;
  border-radius: 4px;
  background: transparent;
}
.photo-timeline-track { display: block; height: 3px; overflow: hidden; border-radius: 8px; background: #26162f61; box-shadow: 0 1px 3px #25153236; }
.photo-timeline-fill { display: block; height: 100%; border-radius: inherit; background: #fff4fbb0; transform: scaleX(0); transform-origin: left center; }
.photo-timeline[aria-pressed="false"] .photo-timeline-fill { background: #dec0ed9e; }
.photo-timeline:focus-visible { outline-color: #fff6fc; outline-offset: -2px; }
.photo-viewport {
  width: 100%;
  aspect-ratio: 1.58;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
  background: #e1d3e6;
  border-radius: 4px;
  box-shadow: 0 12px 25px #4d365517;
}
.photo-viewport::-webkit-scrollbar { display: none; }
.photo-track { display: flex; height: 100%; }
.photo-slide { flex: 0 0 100%; min-width: 0; height: 100%; scroll-snap-align: start; }
.photo-slide img { width: 100%; height: 100%; object-fit: cover; }
.photo-footer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: .55rem .7rem;
  align-items: start;
  margin-top: .83rem;
}
.photo-caption { display: grid; grid-template-columns: minmax(0, 1fr); align-items: start; overflow-wrap: anywhere; }
.photo-caption-item { grid-area: 1 / 1; }
.photo-caption-item[inert] { visibility: hidden; }
.photo-caption h3 { font-size: clamp(1.6rem, 2.3vw, 2.2rem); line-height: 1.05; }
.photo-caption p { margin-top: .25rem; color: var(--muted); font-size: .88rem; line-height: 1.52; }
.photo-caption a { display: inline-block; margin-top: .45rem; color: var(--lilac-ink); font: 600 .8rem/1.25 var(--sans); text-underline-offset: 3px; }
@supports (grid-template-rows: subgrid) {
  .photo-caption { grid-template-rows: repeat(3, auto); }
  .photo-caption-item { display: grid; grid-area: 1 / 1 / span 3; grid-template-rows: subgrid; }
  .photo-caption a { justify-self: start; }
}
.photo-controls { display: grid; justify-items: center; }
.photo-controls-row { display: flex; align-items: center; gap: .5rem; }
.photo-count { inline-size: 5ch; text-align: center; color: var(--muted); font: 650 .81rem/1.2 var(--sans); font-variant-numeric: tabular-nums; }
.gallery-step {
  width: 41px;
  height: 41px;
  display: grid;
  place-items: center;
  border: 1px solid #ccb4d4;
  border-radius: 50%;
  background: #fff9fc;
  color: var(--plum-ink);
}
.gallery-step::before { content: ''; width: 8px; height: 8px; border: solid currentColor; border-width: 0 1.5px 1.5px 0; transform: translateX(1px) rotate(135deg); }
.gallery-step.next::before { transform: translateX(-1px) rotate(-45deg); }
.gallery-step:hover { background: #eddfef; }
.static-photo { margin: 0; }
.static-photo figcaption { margin-top: .5rem; }

@media (max-width: 880px) {
  .forest-shell { width: calc(100% - 4.2rem); }
  .fold-card { grid-template-columns: minmax(0, .89fr) minmax(0, 1.11fr); }
}

@media (min-width: 651px) and (max-width: 880px) {
  .fold-card { min-height: min(850px, 92svh); }
}

@media (min-width: 881px) {
  .invite-shell { padding-inline: clamp(1.55rem, 2.8vw, 3.4rem); }
  .fold-card { width: min(100%, 1460px); }
  .letter-pane, .photo-pane {
    display: grid;
    align-content: center;
    padding-block: clamp(1.6rem, 2.6vw, 2.75rem);
  }
  .letter-logo { margin-bottom: 1.02rem; }
  .photo-pane h2 { margin-bottom: clamp(.9rem, 1.3vw, 1.13rem); }
}

@media (max-width: 650px) {
  .forest { overflow-x: hidden; }
  .forest-backdrop img { object-position: 59% center; }
  .forest-atmosphere { background: linear-gradient(180deg, #111a15a8, #141d1727 57%, #121b1666 87%), linear-gradient(90deg, #11191557, #272b2426); }
  .forest-shell {
    width: calc(100% - 2rem);
    min-height: 100svh;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto 1fr;
    padding-block: clamp(5.05rem, 14vh, 7rem) 1.45rem;
    text-align: center;
  }
  .forest-brand { top: clamp(.8rem, 2.4svh, 1.15rem); left: .15rem; gap: .55rem; text-align: left; font-size: 1.32rem; }
  .forest-brand small { font-size: .63rem; }
  .forest-brand-mark { width: 32px; }
  .forest-copy { padding: .45rem 0 .7rem; }
  .forest-copy h1 { font-size: clamp(2rem, 8.5vw, 3.8rem); }
  .quote-japanese { margin-top: .88rem; }
  .quote-source { margin-top: .46rem; }
  .forest-open { width: clamp(218px, 74vw, 332px); align-self: center; }
  .iris { max-width: 42svh; }
  .invite-shell { padding: .7rem .55rem 1.1rem; }
  .fold-card {
    grid-template-columns: minmax(0, 1fr);
    background-position: 0 0, right 30% bottom;
  }
  .letter-pane {
    background: linear-gradient(0deg, #604a3d26, #6653430d 9px, transparent 29px);
    border-right: 0;
    border-bottom: 1px solid #866f6459;
  }
  .letter-logo { width: 106px; margin-bottom: 1.15rem; }
  .letter-pane h1 { font-size: clamp(2.04rem, 7.8vw, 2.68rem); }
  .photo-pane { background: linear-gradient(180deg, #715a4915, transparent 24px); }
  .photo-pane h2 { font-size: clamp(2rem, 7.5vw, 3.05rem); }
  .photo-pane::before { background-size: 185px auto; background-position: right -52px top -75px; }
  .rsvp input, .rsvp button { min-height: 44px; }
  .gallery-step { width: 44px; height: 44px; }
}

@media (max-width: 365px) {
  .forest-shell { padding-block-start: clamp(4.2rem, 12svh, 5.2rem); }
  .quote-japanese { font-size: .82rem; letter-spacing: .015em; }
  .quote-source a { display: inline-block; }
  .quote-author, .quote-work { display: block; }
  .quote-separator { display: none; }
  .letter-pane, .photo-pane { padding-inline: 1.05rem; }
  .photo-controls-row { gap: .28rem; }
}

@media (max-width: 480px) {
  .photo-footer { grid-template-columns: minmax(0, 1fr); gap: .75rem; }
  .photo-controls { justify-self: end; }
}

@media (max-height: 550px) and (min-width: 651px) {
  .forest-shell { padding-block: 4.25rem 1.25rem; }
  .forest-copy h1 { font-size: min(5.15vw, 4.4rem); }
}

@media (prefers-reduced-motion: reduce) {
  .iris img, .iris-flower, .forest, .forest-halo, .fold-card, .season-plate, .season-light span { animation: none !important; transition: none !important; }
}
