:root {
  color-scheme: dark;
  --black: #080706;
  --ink: #11100e;
  --ivory: #f4ead8;
  --paper: #ece0ca;
  --gold: #c7a45a;
  --gold-light: #eed997;
  --wine: #3c0710;
  --wine-light: #6f101b;
  --muted: rgba(244, 234, 216, 0.7);
  --serif: "Bodoni Moda", Didot, "Times New Roman", serif;
  --sans: "Montserrat", Arial, sans-serif;
}

* { box-sizing: border-box; }

html { background: var(--black); scroll-behavior: smooth; }

body {
  margin: 0;
  min-width: 320px;
  background: var(--black);
  color: var(--ivory);
  font-family: var(--sans);
  -webkit-font-smoothing: auto;
  text-rendering: optimizeLegibility;
}

button, a { -webkit-tap-highlight-color: transparent; }
button { color: inherit; font: inherit; }

.experience { min-height: 100svh; overflow-x: hidden; }

.screen {
  position: fixed;
  inset: 0;
  min-height: 100svh;
  opacity: 0;
  pointer-events: none;
  transition: opacity 700ms ease, visibility 700ms ease;
  visibility: hidden;
  z-index: 1;
}

.screen.is-active {
  opacity: 1;
  pointer-events: auto;
  visibility: visible;
  z-index: 5;
}

.screen-media {
  position: absolute;
  inset: -3%;
  background: url("assets/intro-poster.jpg") center 48% / cover no-repeat;
  filter: saturate(.76) contrast(1.14) brightness(.54);
  transform: scale(1.03);
}

.checkin .screen-media { animation: slowPush 11s ease-out both; }

.vignette {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(8,7,6,.45), rgba(8,7,6,.04) 31%, rgba(8,7,6,.15) 55%, rgba(8,7,6,.96) 100%),
    radial-gradient(circle at 50% 38%, transparent 0 25%, rgba(8,7,6,.35) 68%, rgba(8,7,6,.8) 100%);
}

.checkin-copy {
  position: relative;
  z-index: 2;
  display: flex;
  min-height: 100svh;
  padding: max(32px, env(safe-area-inset-top)) 28px max(32px, env(safe-area-inset-bottom));
  align-items: center;
  justify-content: flex-end;
  flex-direction: column;
  text-align: center;
}

.eyebrow,
.save-label,
.event-type,
.location,
.section-number {
  margin: 0;
  color: var(--gold-light);
  font-size: .68rem;
  font-weight: 600;
  letter-spacing: .24em;
  line-height: 1.5;
  text-transform: uppercase;
}

.checkin-copy .eyebrow { position: absolute; top: max(34px, env(safe-area-inset-top)); }

.monogram { display: flex; align-items: center; gap: 11px; margin-bottom: 18px; color: var(--gold-light); font-family: var(--serif); font-size: 1rem; }
.monogram i { width: 36px; height: 1px; background: var(--gold); transform: rotate(-45deg); }

.checkin h1 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(3rem, 13vw, 5rem);
  font-weight: 600;
  letter-spacing: -.035em;
  line-height: .96;
}

.request-line {
  margin: 16px 0 34px;
  color: var(--muted);
  font-family: var(--serif);
  font-size: 1.1rem;
  font-style: italic;
  line-height: 1.45;
}

.primary-button,
.open-button {
  border: 1px solid rgba(238,217,151,.75);
  background: linear-gradient(135deg, rgba(213,178,97,.97), rgba(143,105,41,.97));
  box-shadow: 0 15px 50px rgba(0,0,0,.35);
  color: #0d0b08;
  cursor: pointer;
  display: inline-flex;
  min-height: 54px;
  padding: 0 24px;
  align-items: center;
  justify-content: center;
  gap: 14px;
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .18em;
  text-decoration: none;
  text-transform: uppercase;
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.primary-button svg, .open-button svg { width: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; }
.primary-button:hover, .open-button:hover { transform: translateY(-2px); box-shadow: 0 20px 56px rgba(0,0,0,.48); }
.primary-button:focus-visible, .open-button:focus-visible, .skip-button:focus-visible, .replay-button:focus-visible { outline: 2px solid var(--gold-light); outline-offset: 4px; }

.checkin-soundtrack-space { width: min(100%, 300px); height: 245px; margin: -13px 0 18px; }
.phil-player-shell {
  position: fixed;
  left: 50%;
  bottom: max(101px, calc(env(safe-area-inset-bottom) + 82px));
  z-index: 8;
  width: min(300px, calc(100vw - 40px));
  color: var(--ivory);
  text-align: center;
  transform: translateX(-50%);
  transition: width 260ms ease, left 260ms ease, bottom 260ms ease, opacity 220ms ease, transform 260ms ease;
}
.soundtrack-step { margin: 0 0 9px; color: var(--gold-light); font-size: .62rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; }
.soundtrack-help { margin: 8px 0 0; color: rgba(244,234,216,.7); font-family: var(--serif); font-size: .78rem; font-style: italic; }
.youtube-player-frame { height: 200px; overflow: hidden; border: 1px solid rgba(199,164,90,.45); border-radius: 14px; background: #000; box-shadow: 0 18px 56px rgba(0,0,0,.48); }
.youtube-player-frame iframe { width: 100%; height: 100%; display: block; border: 0; }
.phil-player-shell.is-hidden { opacity: 0; pointer-events: none; }
body.intro-running .phil-player-shell { left: 12px; bottom: max(76px, calc(env(safe-area-inset-bottom) + 62px)); width: 200px; opacity: .82; transform: none; }
body.intro-running .phil-player-shell:hover, body.intro-running .phil-player-shell:focus-within { opacity: 1; }
body.intro-running .phil-player-shell .soundtrack-step, body.intro-running .phil-player-shell .soundtrack-help { display: none; }
body.intro-running .youtube-player-frame { border-radius: 10px; }

.film { background: #000; }
.film video { width: 100%; height: 100%; display: block; object-fit: cover; }

.skip-button {
  position: absolute;
  right: 18px;
  bottom: max(24px, env(safe-area-inset-bottom));
  border: 1px solid rgba(244,234,216,.46);
  border-radius: 999px;
  background: rgba(8,7,6,.5);
  backdrop-filter: blur(12px);
  color: var(--ivory);
  cursor: pointer;
  padding: 11px 16px;
  font-size: .68rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  z-index: 3;
}

.flash { position: absolute; inset: 0; background: #fff8df; opacity: 0; pointer-events: none; z-index: 4; }
.flash.fire { animation: cameraFlash 720ms ease-out both; }

.cover-media { filter: saturate(.72) contrast(1.18) brightness(.38); background-position: center 40%; }
.cover-vignette { background: linear-gradient(180deg, rgba(8,7,6,.65), rgba(8,7,6,.2) 45%, rgba(8,7,6,.88)); }
.cover-frame { position: absolute; inset: 14px; border: 1px solid rgba(199,164,90,.5); box-shadow: inset 0 0 0 5px rgba(8,7,6,.18); }
.cover-frame::before, .cover-frame::after { content: ""; position: absolute; width: 48px; height: 48px; border-color: var(--gold); opacity: .65; }
.cover-frame::before { left: 9px; top: 9px; border-left: 1px solid; border-top: 1px solid; }
.cover-frame::after { right: 9px; bottom: 9px; border-right: 1px solid; border-bottom: 1px solid; }

.cover-copy {
  position: relative;
  z-index: 2;
  display: flex;
  min-height: 100svh;
  padding: max(54px, env(safe-area-inset-top)) 34px max(44px, env(safe-area-inset-bottom));
  align-items: center;
  justify-content: center;
  flex-direction: column;
  text-align: center;
}

.save-label { margin-bottom: 13px; }
.title-rule { width: min(230px, 60vw); display: flex; align-items: center; gap: 10px; color: var(--gold); font-size: .55rem; }
.title-rule span { height: 1px; flex: 1; background: linear-gradient(90deg, transparent, var(--gold)); }
.title-rule span:last-child { background: linear-gradient(90deg, var(--gold), transparent); }

.cover h2 {
  margin: 18px 0 12px;
  max-width: 460px;
  font-family: var(--serif);
  font-size: clamp(2.85rem, 12.5vw, 5.9rem);
  font-weight: 600;
  letter-spacing: -.035em;
  line-height: .89;
  text-shadow: 0 2px 8px rgba(0,0,0,.72);
}
.cover h2 span { display: block; color: var(--gold-light); font-size: .48em; font-style: italic; letter-spacing: .02em; line-height: 1.25; }
.event-type { color: var(--ivory); letter-spacing: .16em; }

.date-lockup { display: flex; margin: 34px 0 12px; align-items: center; justify-content: center; gap: 13px; font-family: var(--serif); font-size: 1.06rem; text-transform: uppercase; }
.date-lockup i { width: 4px; height: 4px; background: var(--gold); transform: rotate(45deg); }
.location { color: var(--gold-light); }
.teaser { margin: 38px 0 26px; color: rgba(244,234,216,.72); font-family: var(--serif); font-size: .92rem; font-style: italic; }
.open-button { background: rgba(8,7,6,.55); backdrop-filter: blur(10px); color: var(--ivory); }

.invitation {
  position: relative;
  display: none;
  background:
    radial-gradient(circle at 100% 12%, rgba(111,16,27,.36), transparent 36rem),
    radial-gradient(circle at 0 62%, rgba(117,80,26,.2), transparent 38rem),
    var(--black);
}
.invitation.is-active { display: block; animation: inviteIn 650ms ease; }

.invitation-hero {
  min-height: 73svh;
  padding: max(82px, env(safe-area-inset-top)) 28px 58px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  text-align: center;
}
.invitation-hero h2 { margin: 24px 0; color: #fff8ec; font-family: var(--serif); font-size: clamp(3.9rem, 17vw, 8.2rem); font-weight: 500; letter-spacing: -.04em; line-height: .86; text-shadow: 0 1px 0 rgba(0,0,0,.6); }
.invitation-hero h2 em { color: var(--gold-light); font-weight: 400; }
.gold-mark { width: 1px; height: 90px; background: linear-gradient(var(--gold), transparent); }
.wolfpack-soundtrack { width: min(100%, 300px); margin-top: 22px; opacity: .78; transition: opacity 180ms ease; }
.wolfpack-soundtrack:hover, .wolfpack-soundtrack:focus-within { opacity: 1; }

.letter { max-width: 680px; margin: 0 auto; padding: 68px 29px 86px; border-top: 1px solid rgba(199,164,90,.26); }
.letter p { margin: 0 0 27px; color: rgba(255,248,236,.94); font-family: var(--serif); font-size: clamp(1.18rem, 5vw, 1.55rem); line-height: 1.72; }
.letter .dropcap::first-letter { float: left; margin: .07em .1em 0 0; color: var(--gold-light); font-size: 4.2em; line-height: .72; }
.letter blockquote { margin: 70px 0; padding: 30px 0; border-top: 1px solid rgba(199,164,90,.34); border-bottom: 1px solid rgba(199,164,90,.34); text-align: center; }
.letter blockquote span, .letter blockquote strong { display: block; font-family: var(--serif); font-weight: 400; }
.letter blockquote span { color: var(--gold-light); font-size: 1.05rem; font-style: italic; }
.letter blockquote strong { margin-top: 9px; font-size: clamp(1.5rem, 6vw, 2.1rem); }
.signature { display: flex; align-items: center; flex-direction: column; gap: 7px; color: var(--muted); font-family: var(--serif); font-style: italic; }
.signature strong { color: var(--gold-light); font-size: 2.2rem; font-weight: 400; }

.travel-note, .for-now { padding: 82px 29px; }
.travel-note { background: linear-gradient(135deg, #420912, #1c070a); }
.travel-note > *, .for-now > * { max-width: 650px; margin-left: auto; margin-right: auto; }
.travel-note h3, .for-now h3 { margin-top: 22px; margin-bottom: 28px; font-family: var(--serif); font-size: clamp(3.1rem, 14vw, 6.5rem); font-weight: 400; letter-spacing: -.065em; line-height: .88; }
.travel-note p:not(.section-number), .for-now p:not(.section-number) { color: rgba(244,234,216,.77); font-family: var(--serif); font-size: 1.16rem; line-height: 1.72; }
.travel-note .section-number, .for-now .section-number { margin-bottom: 0; }
.for-now { padding-top: 96px; padding-bottom: 94px; text-align: center; }
.for-now h3 { max-width: 720px; color: var(--gold-light); }
.actions { display: flex; max-width: 650px; margin: 48px auto 0; align-items: center; justify-content: center; flex-direction: column; gap: 19px; }
.calendar-button { width: min(100%, 360px); }
.replay-button { border: 0; background: transparent; color: var(--ivory); cursor: pointer; display: inline-flex; padding: 12px; align-items: center; gap: 10px; font-size: .72rem; letter-spacing: .13em; text-transform: uppercase; }
.replay-button svg { width: 18px; fill: none; stroke: var(--gold-light); stroke-width: 1.5; }

.spotify-embed { min-height: 80px; border-radius: 12px; overflow: hidden; }
.friends-embed { min-height: 80px; box-shadow: 0 16px 42px rgba(0,0,0,.22); }
.spotify-embed iframe { display: block; width: 100%; border: 0; }

footer { display: flex; padding: 27px 24px max(27px, env(safe-area-inset-bottom)); border-top: 1px solid rgba(199,164,90,.2); align-items: center; justify-content: space-between; gap: 20px; color: rgba(244,234,216,.45); font-size: .62rem; letter-spacing: .14em; text-transform: uppercase; }

.headcount-card { margin: 48px auto 8px; padding: clamp(28px, 6vw, 52px); max-width: 760px; border: 1px solid rgba(199,164,90,.5); background: linear-gradient(145deg, rgba(24,20,17,.98), rgba(8,7,6,.98)); box-shadow: 0 24px 70px rgba(0,0,0,.38); color: var(--ivory); text-align: left; }
.headcount-card h3 { margin-bottom: 14px; font-size: clamp(2.7rem, 10vw, 5rem); }
.headcount-card .headcount-note { color: rgba(244,234,216,.76); }
.headcount-form { margin-top: 28px; }
.response-options { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; border: 0; padding: 0; }
.response-options legend { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.response-choice { position: relative; cursor: pointer; }
.response-choice input { position: absolute; opacity: 0; pointer-events: none; }
.response-choice span { display: grid; gap: 5px; min-height: 96px; align-content: center; padding: 18px; border: 1px solid rgba(199,164,90,.4); background: rgba(255,255,255,.035); transition: border-color 180ms ease, background 180ms ease, transform 180ms ease; }
.response-choice small { color: rgba(244,234,216,.62); font-size: .78rem; }
.response-choice input:checked + span { border-color: var(--gold); background: rgba(199,164,90,.14); transform: translateY(-2px); }
.response-choice input:focus-visible + span { outline: 2px solid var(--ivory); outline-offset: 3px; }
.headcount-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 22px; }
.headcount-fields label { display: grid; gap: 8px; }
.headcount-fields label > span { font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; color: rgba(244,234,216,.72); }
.headcount-fields input, .headcount-fields select { width: 100%; min-height: 48px; border: 1px solid rgba(199,164,90,.38); border-radius: 0; padding: 0 14px; color: var(--ivory); background: #0d0b0a; font: inherit; }
.headcount-fields input:focus, .headcount-fields select:focus { outline: 2px solid var(--gold); outline-offset: 2px; }
.guest-field { grid-column: 1 / -1; }
.headcount-submit { margin-top: 24px; width: 100%; justify-content: center; }
.headcount-submit[disabled] { opacity: .65; cursor: wait; }
.form-status { min-height: 24px; margin: 14px 0 0; color: var(--gold-light); text-align: center; }
.headcount-card.is-complete .headcount-form > *:not(.form-status) { display: none; }
.headcount-card.is-complete .form-status { min-height: 110px; display: grid; place-items: center; font-family: var(--serif); font-size: clamp(1.6rem, 5vw, 2.6rem); }

@media (max-width: 620px) {
  .response-options, .headcount-fields { grid-template-columns: 1fr; }
  .guest-field { grid-column: auto; }
}

@keyframes slowPush { from { transform: scale(1.03); } to { transform: scale(1.11); } }
@keyframes cameraFlash { 0% { opacity: 0; } 28% { opacity: 1; } 100% { opacity: 0; } }
@keyframes inviteIn { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: translateY(0); } }
@keyframes musicPulse { 0%, 100% { transform: scale(.9); } 50% { transform: scale(1.08); } }

@media (min-width: 760px) {
  .screen-media { background-position: center 46%; }
  .checkin-copy { padding-bottom: 50px; }
  .cover-frame { inset: 25px; }
  .letter { padding-left: 42px; padding-right: 42px; }
  .travel-note, .for-now { padding-left: 42px; padding-right: 42px; }
  .travel-note { text-align: center; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
