/* J'Adore Launch Party */

:root {
  --bg: #f3f0ed;
  --bg-2: #e6d8cc;
  --ink: #181615;
  --chip: #f8f8f8;
  --grey: #979696;
  --rule: #d9d6d2;

  --serif: "Cormorant Garamond", "Apple Garamond", Garamond, Georgia, "Times New Roman", serif;
  --sans: "Inter", "Helvetica Neue", Helvetica, Arial, sans-serif;

  --gap: 20px;
  --hole-x: 42.2%;
  --hole-y: 42.2%;
  --brand-w: clamp(200px, 19vw, 290px);
  --intro-h: 210vh;
  --title-top: 11vh;

  --ease-out-quint: cubic-bezier(.22, 1, .36, 1);
  --ease-out-expo: cubic-bezier(.19, 1, .22, 1);
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-stopped { overflow: hidden; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 1.125rem/1.5 var(--serif);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

h1, h2, p, ul { margin: 0; padding: 0; font-weight: inherit; }
ul { list-style: none; }
video { display: block; width: 100%; height: 100%; object-fit: cover; }
a { color: inherit; text-decoration: none; }

/* ---------- type ---------- */

.display {
  display: block;
  font: 500 clamp(38px, 5.6vw, 104px)/1 var(--serif);
  letter-spacing: -.012em;
  text-transform: uppercase;
  text-align: center;
}
.display--xl { font-size: clamp(42px, 7.4vw, 132px); line-height: .98; }
.display i, .label i, .chip i {
  font-style: italic;
  font-weight: 400;
  text-transform: lowercase;
  letter-spacing: -.005em;
}

.label {
  display: block;
  font: 500 .8125rem/1.1 var(--serif);
  letter-spacing: .05em;
  text-transform: uppercase;
  text-align: center;
}
.label i { font-size: 1.12em; letter-spacing: .01em; }

.line {
  display: block;
  overflow: hidden;
  padding: .06em .12em .1em;
  margin: -.06em -.12em -.1em;
}
.line__in { display: block; will-change: transform; }

.link {
  font: 500 .8125rem/1 var(--serif);
  letter-spacing: .1em;
  text-transform: uppercase;
  padding-bottom: 5px;
  background: linear-gradient(currentColor, currentColor) 0 100% / 100% 1px no-repeat;
  transition: background-size .6s var(--ease-out-expo);
}
.link:hover { background-size: 0 1px; background-position: 100% 100%; }

/* reveal on scroll */
[data-reveal] .line__in { transform: translateY(108%); transition: transform 1.3s var(--ease-out-quint); }
[data-reveal] h2 .line:nth-child(2) .line__in { transition-delay: .09s; }
[data-reveal] > .label, [data-reveal] > .details__lede,
.perks[data-reveal] > li, .where[data-reveal] > *, .rsvp[data-reveal] > * {
  opacity: 0; transform: translateY(18px);
  transition: opacity 1s ease, transform 1.2s var(--ease-out-quint);
}
[data-reveal].is-in .line__in { transform: none; }
[data-reveal].is-in > .label, [data-reveal].is-in > .details__lede,
.perks[data-reveal].is-in > li, .where[data-reveal].is-in > *, .rsvp[data-reveal].is-in > * { opacity: 1; transform: none; }
[data-reveal].is-in > *:nth-child(2) { transition-delay: .1s; }
[data-reveal].is-in > *:nth-child(3) { transition-delay: .2s; }
[data-reveal].is-in > *:nth-child(4) { transition-delay: .3s; }
[data-reveal].is-in > .details__lede { transition-delay: .35s; }

/* ---------- chips ---------- */

.chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 15px 42px;
  background: var(--chip);
  color: var(--ink);
  font: 500 .9375rem/1 var(--serif);
  letter-spacing: .03em;
  text-transform: uppercase;
  white-space: nowrap;
  box-shadow: 0 0 46px rgba(214, 150, 80, .16);
  transition: box-shadow .6s ease, background-color .4s ease;
}
.chip i { font-size: 1.08em; letter-spacing: 0; margin-right: .12em; }
.chip__roll { display: block; height: 1.15em; overflow: hidden; }
.chip__roll > span { display: block; line-height: 1.15; transition: transform .7s var(--ease-out-expo); }
.chip:hover { background: #fff; box-shadow: 0 0 60px rgba(214, 150, 80, .3); }
.chip:hover .chip__roll > span { transform: translateY(-100%); }
.chip--center { display: flex; width: max-content; margin: 0 auto; }

/* ---------- 01 invitation + video ---------- */

.intro { position: relative; height: var(--intro-h); }
.intro__pin {
  position: sticky; top: 0;
  height: 100vh; height: 100svh;
  overflow: hidden;
}
.intro__media {
  position: absolute; inset: 0;
  z-index: 1;
  overflow: hidden;
  clip-path: inset(var(--hole-y) var(--hole-x));
  will-change: clip-path;
  background: var(--bg-2);
}
.intro__video { position: absolute; inset: 0; transform: scale(1.3); will-change: transform; }
.intro__shade {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(24,22,21,.34), rgba(24,22,21,.2) 40%, rgba(24,22,21,.42));
  opacity: 0;
}
.intro__words {
  position: absolute; inset: 0;
  z-index: 2;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: calc(15.6vh + 46px);
  color: #dcd8d3;
  pointer-events: none;
}
.intro__group { display: block; will-change: transform; }

.intro__foot { position: absolute; left: 30px; right: 30px; bottom: 30px; z-index: 2; }
.intro__bar { position: relative; height: 1px; background: var(--rule); }
.intro__fill { position: absolute; inset: 0; background: var(--ink); transform: scaleX(0); transform-origin: 0 50%; }
.intro__count {
  position: absolute; right: 0; bottom: 14px;
  font: 500 1rem/1 var(--serif);
}
.intro__count.is-cue { font-size: .8125rem; letter-spacing: .1em; text-transform: uppercase; }

/* ---------- title block: rides the video, then settles ---------- */

.title-track {
  position: relative;
  z-index: 5;
  margin-top: calc(var(--intro-h) * -1);
  pointer-events: none;
}
/* room for the sticky block to travel: must be content, not padding, or sticky has nowhere to move */
.title-track::after { content: ""; display: block; height: calc(var(--intro-h) + var(--title-top)); }
.title { position: sticky; top: var(--title-top); --edge: 9999px; }
.title__in { position: relative; opacity: 0; will-change: transform, opacity; }
.title__copy { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 0 var(--gap); }
.title__copy--dark { color: var(--ink); clip-path: inset(var(--edge) -60px -60px -60px); }
.title__copy--light {
  position: absolute; inset: 0;
  color: #fff;
  clip-path: inset(-60px -60px calc(100% - var(--edge)) -60px);
  text-shadow: 0 1px 22px rgba(20, 17, 15, .45);
}
.title__mark {
  display: block;
  width: var(--brand-w);
  aspect-ratio: 913 / 353;
  background: currentColor;
  -webkit-mask: url(assets/img/wordmark.png) center / contain no-repeat;
          mask: url(assets/img/wordmark.png) center / contain no-repeat;
}
.title__copy--light .title__mark { filter: drop-shadow(0 1px 14px rgba(20, 17, 15, .35)); }
.title__tag {
  margin-top: 14px;
  font: 500 clamp(.8125rem, 1.1vw, 1.0625rem)/1.2 var(--serif);
  letter-spacing: .08em;
  text-transform: uppercase;
}
.title__label { margin-top: min(9vh, 84px); }
.title__date {
  margin-top: 22px;
  font: 500 min(7.4vw, 14.5vh)/.98 var(--serif);
  letter-spacing: -.012em;
  text-transform: uppercase;
}
.title__time {
  margin-top: .1em;
  font: 500 min(4.4vw, 8.6vh)/1.05 var(--serif);
  letter-spacing: -.012em;
  text-transform: uppercase;
}
.title__copy i { font-style: italic; font-weight: 400; text-transform: lowercase; letter-spacing: -.005em; }
.title__tag i { font-size: 1.12em; letter-spacing: .01em; }

/* ---------- 02 details ---------- */

.details { padding: 9vh var(--gap) 0; text-align: center; }
.details__lede { font: 500 clamp(1.15rem, 1.6vw, 1.5rem)/1.3 var(--serif); }
.details__lede[data-reveal] > span { display: block; opacity: 0; transform: translateY(18px); transition: opacity 1s ease, transform 1.2s var(--ease-out-quint); }
.details__lede[data-reveal].is-in > span { opacity: 1; transform: none; }

.perks {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  max-width: 1120px;
  margin: 6vh auto 0;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}
.perks li { padding: 38px 20px 42px; }
.perks li + li { border-left: 1px solid var(--rule); }
.perks .label { margin-bottom: 20px; }
.perks__text { display: block; font: 500 clamp(1.5rem, 2.3vw, 2.15rem)/1.1 var(--serif); letter-spacing: -.01em; }

.where { padding: 8vh 0 0; }
.where .label { margin-bottom: 20px; }
.where__address { font: 500 clamp(1.5rem, 2.3vw, 2.15rem)/1.15 var(--serif); letter-spacing: -.01em; }
.where__links { margin-top: 34px; display: flex; justify-content: center; gap: 38px; }

/* ---------- 03 rsvp ---------- */

.rsvp { padding: 10vh var(--gap) 11vh; text-align: center; }
.rsvp__title { font: 500 clamp(1.6rem, 2.3vw, 2.1rem)/1.08 var(--sans); letter-spacing: -.03em; margin-bottom: 18px; }
.rsvp__text { font: 500 1.125rem/1.4 var(--serif); margin-bottom: 40px; }
.rsvp__alt { margin-top: 28px; font: 400 .9375rem/1.4 var(--serif); color: #5d5955; }
.rsvp__alt a { color: var(--ink); background: linear-gradient(currentColor, currentColor) 0 100% / 100% 1px no-repeat; padding-bottom: 2px; }

/* ---------- RSVP form ---------- */

button.chip { border: 0; border-radius: 0; cursor: pointer; -webkit-appearance: none; appearance: none; }
.rsvp .chip { padding: 19px 64px; font-size: 1.0625rem; letter-spacing: .12em; }

.modal { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; padding: 16px; }
.modal[hidden] { display: none; }
.modal__backdrop { position: absolute; inset: 0; background: rgba(24, 22, 21, .5); opacity: 0; transition: opacity .45s ease; }
.modal__panel {
  position: relative;
  width: min(480px, 100%);
  max-height: calc(100dvh - 32px);
  overflow-y: auto;
  background: var(--bg);
  padding: 54px clamp(22px, 5vw, 48px) 40px;
  text-align: center;
  opacity: 0; transform: translateY(26px);
  transition: opacity .45s ease, transform .7s var(--ease-out-quint);
}
.modal.is-open .modal__backdrop { opacity: 1; }
.modal.is-open .modal__panel { opacity: 1; transform: none; }
.modal__close {
  position: absolute; top: 18px; right: 20px;
  border: 0; background: none; padding: 4px; cursor: pointer; color: var(--ink);
  font: 500 .75rem/1 var(--serif); letter-spacing: .12em; text-transform: uppercase;
}
.form__title { margin: 16px 0 28px; font: 500 clamp(2.4rem, 5vw, 3.2rem)/1 var(--serif); letter-spacing: -.012em; text-transform: uppercase; }
.form__done .form__title { font-size: clamp(1.9rem, 4vw, 2.5rem); margin-bottom: 18px; }
.form__done .link { display: inline-block; margin-top: 26px; }
.field { display: block; text-align: left; margin-bottom: 20px; }
.field > span { display: block; font: 500 .6875rem/1 var(--sans); letter-spacing: .12em; text-transform: uppercase; color: #6b6763; margin-bottom: 4px; }
.field em { font-style: normal; text-transform: none; letter-spacing: 0; color: var(--grey); margin-left: 6px; }
.field input, .field select {
  width: 100%;
  border: 0; border-bottom: 1px solid #bdb8b2; border-radius: 0;
  background: transparent; color: var(--ink);
  font: 500 1.25rem/1.3 var(--serif);
  padding: 8px 0 9px;
  outline: none;
  -webkit-appearance: none; appearance: none;
  transition: border-color .3s ease;
}
.field input:focus, .field select:focus { border-bottom-color: var(--ink); }
.field select { background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%23181615'/%3E%3C/svg%3E") right 2px center no-repeat; cursor: pointer; }
.field--trap { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form__error { margin: 4px 0 18px; font: 500 1rem/1.35 var(--serif); color: #9d1414; }
.form__submit { width: 100%; margin-top: 12px; padding: 19px 20px; background: var(--ink); color: #fff; box-shadow: none; letter-spacing: .12em; }
.form__submit:hover { background: #000; box-shadow: none; }
.form__submit[disabled] { opacity: .5; cursor: default; }
.form__alt { margin-top: 20px; font: 400 .9375rem/1.4 var(--serif); color: #5d5955; }
.form__alt a { color: var(--ink); background: linear-gradient(currentColor, currentColor) 0 100% / 100% 1px no-repeat; padding-bottom: 2px; }

/* ---------- footer ---------- */

.footer {
  display: flex; justify-content: space-between; gap: 20px;
  border-top: 1px solid var(--rule);
  padding: 22px 30px;
  font: 400 .8125rem/1.4 var(--sans);
  color: var(--grey);
}
.footer a { transition: color .3s ease; }
.footer a:hover { color: var(--ink); }

/* the font shorthand resets numeral style, so this sits after every font rule */
.display, .label, .chip, .link, .intro__count, .title__tag, .title__date, .title__time, .details__lede,
.perks__text, .where__address, .rsvp__text, .rsvp__alt, .form__title, .form__alt, .form__error, .field input, .field select { font-variant-numeric: lining-nums; }

/* ---------- mobile ---------- */

@media (max-width: 760px) {
  :root { --gap: 16px; --hole-x: 33%; --hole-y: 41%; --brand-w: 46vw; --intro-h: 200vh; --title-top: 12vh; }

  .display { font-size: 11vw; }
  .display--xl { font-size: 12.6vw; }
  .intro__words { gap: calc(18vh + 30px); }
  .intro__foot { left: 18px; right: 18px; bottom: calc(26px + env(safe-area-inset-bottom)); }

  .title__label { margin-top: 9vh; }
  .title__date { font-size: min(13vw, 9vh); }
  .title__time { font-size: min(8.4vw, 6vh); }
  .details { padding-top: 7vh; }
  .perks { grid-template-columns: 1fr; margin-top: 6vh; }
  .perks li { padding: 26px 10px 28px; }
  .perks li + li { border-left: 0; border-top: 1px solid var(--rule); }
  .perks__text br { display: none; }
  .where { padding-top: 6vh; }
  .rsvp { padding: 8vh var(--gap) 10vh; }
  .footer { padding: 20px 18px; }
}

@media (prefers-reduced-motion: reduce) {
  [data-reveal] .line__in, [data-reveal] > .label, [data-reveal] > .details__lede,
  .perks[data-reveal] > li, .where[data-reveal] > *, .rsvp[data-reveal] > * { transition: none; transform: none; opacity: 1; }
}
