/* THE NJOKUS - From Everywhere to Forever. */

/* Salt Blue Script (trial version: buy the licence before sharing the site) */
@font-face {
  font-family: 'Salt Blue Script';
  src: url('../fonts/SaltBlueScript.woff2') format('woff2'), url('../fonts/SaltBlueScript.otf') format('opentype');
  font-display: swap;
}

:root {
  --burgundy: #681C30;
  --burgundy-deep: #4E1424;
  --ivory: #F3E8D5;
  --red: #981F35;
  --black: #242221;
  --silver: #B9B7B4;
  --paper: #F6EEDF;
  --logo: 'Salt Blue Script', 'Pinyon Script', cursive;
  --calli: 'Salt Blue Script', 'Pinyon Script', cursive;
  --hand: 'Salt Blue Script', 'Mrs Saint Delafield', cursive;
  --serif: 'Cormorant Garamond', Georgia, serif;
  --sans: 'DM Sans', system-ui, sans-serif;
  --mono: 'Courier Prime', 'Courier New', monospace;
  --ease: cubic-bezier(.22, .8, .24, 1);
  --noise: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  background: var(--burgundy);
  color: var(--ivory);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
body.locked { overflow: hidden; }
body::after {
  content: ''; position: fixed; inset: 0; z-index: 200; pointer-events: none;
  background-image: var(--noise); opacity: .1; mix-blend-mode: multiply;
}
img { display: block; max-width: 100%; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
a { color: inherit; text-decoration: none; }
[hidden] { display: none !important; }

/* ---------- Type ---------- */
.label { font-family: var(--sans); font-size: 11px; font-weight: 400; letter-spacing: .16em; text-transform: uppercase; }
.dim { opacity: .6; }
.calli { font-family: var(--calli); font-weight: 400; line-height: 1.05; }
.hand { font-family: var(--hand); font-weight: 400; line-height: 1.05; }
.logo { font-family: var(--logo); font-weight: 400; line-height: 1.1; display: inline-block; font-size: 46px; }
.logo-img { display: block; width: min(62vw, 240px); height: auto; margin: 4px auto 0; }
.red { color: var(--red); }
.caps {
  font-family: var(--sans); font-weight: 400;
  font-size: 12px; line-height: 1.9; letter-spacing: .13em;
  text-transform: uppercase; text-align: center;
}
.caps.strong { font-weight: 500; }
.heading {
  font-family: var(--sans); font-weight: 400;
  font-size: 22px; line-height: 1.25; letter-spacing: .05em;
  text-transform: uppercase; text-align: center;
}
.heading.sm { font-size: 17px; }

.btn {
  display: inline-block;
  font-family: var(--sans); font-size: 10.5px; font-weight: 400; letter-spacing: .18em; text-transform: uppercase;
  padding: 10px 16px; border: 1px solid currentColor;
  transition: background .3s, color .3s;
}
.btn:hover { background: var(--ivory); color: var(--burgundy); border-color: var(--ivory); }
.btn-dark { color: var(--black); }
.btn-dark:hover { background: var(--black); color: var(--ivory); border-color: var(--black); }
.btn-solid { background: var(--burgundy); border-color: var(--burgundy); color: var(--ivory); }
.btn-solid:hover { background: var(--red); border-color: var(--red); color: var(--ivory); }
.btn-block { display: block; width: 100%; padding: 16px; font-size: 11.5px; }

/* ================= INTRO: PHOTO BOOTH ================= */
.intro {
  position: fixed; inset: 0; z-index: 60;
  display: flex; overflow-y: auto;
  background: #4A1214 url('../assets/fond-cuir.jpg') center / cover no-repeat;
  padding: max(26px, env(safe-area-inset-top)) 24px 26px;
  transition: opacity .8s var(--ease), visibility .8s;
}
.intro::before {
  content: ''; position: fixed; inset: 0; pointer-events: none;
  background: radial-gradient(ellipse at 50% 45%, transparent 45%, rgba(20, 6, 8, .5));
}
.intro.is-leaving { opacity: 0; visibility: hidden; }
.intro-inner {
  position: relative; margin: auto; width: 100%;
  display: flex; flex-direction: column; align-items: center; gap: 16px;
  text-align: center;
  animation: fadeIn 1.2s var(--ease) both;
}
.intro-head { display: grid; place-items: center; height: 92px; }
.intro-head > * { grid-area: 1 / 1; transition: opacity .7s var(--ease); }
.plate {
  width: 84px; height: 84px; display: grid; place-items: center;
  font-family: var(--sans); font-size: 8.5px; line-height: 1.45; letter-spacing: .06em; text-transform: uppercase;
  color: #3A3836;
  background:
    radial-gradient(circle at 7px 7px, #6F6D6A 1.8px, transparent 2.3px),
    radial-gradient(circle at calc(100% - 7px) 7px, #6F6D6A 1.8px, transparent 2.3px),
    radial-gradient(circle at 7px calc(100% - 7px), #6F6D6A 1.8px, transparent 2.3px),
    radial-gradient(circle at calc(100% - 7px) calc(100% - 7px), #6F6D6A 1.8px, transparent 2.3px),
    linear-gradient(125deg, #E4E3E1, #A3A19E 35%, #F1F0EE 52%, #8F8D8A 75%, #CFCDCA);
  border-radius: 2px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .55), 0 8px 16px rgba(0, 0, 0, .45);
}
.intro-logo { width: min(72vw, 280px); height: auto; opacity: 0; }

.booth {
  height: min(52vh, 560px); height: min(52svh, 560px); aspect-ratio: 9 / 16;
  border-radius: 3px; overflow: hidden; background: #1A1716;
  box-shadow: 0 30px 50px -20px rgba(0, 0, 0, .85), 0 0 0 1px rgba(255, 255, 255, .08);
}
.booth video { display: block; width: 100%; height: 100%; object-fit: cover; }

.intro-foot { display: grid; place-items: center; min-height: 150px; }
.intro-foot > * { grid-area: 1 / 1; }
.booth-button {
  width: 76px; height: 76px; border-radius: 50%;
  animation: pulse 2.2s ease-in-out infinite;
  transition: opacity .5s var(--ease), transform .15s;
}
.booth-button img { width: 100%; height: 100%; filter: drop-shadow(0 6px 8px rgba(0, 0, 0, .55)); }
.booth-button:active { transform: scale(.92); }
.intro-after { display: flex; flex-direction: column; align-items: center; gap: 12px; opacity: 0; visibility: hidden; }
.big-date { font-family: var(--serif); font-weight: 300; font-size: 36px; line-height: 1; letter-spacing: .02em; }

/* printing state */
.intro.is-printing .plate { opacity: 0; }
.intro.is-printing .intro-logo { opacity: 1; transition-delay: .3s; }
.intro.is-printing .booth-button { opacity: 0; pointer-events: none; animation: none; }
.intro.is-printed .intro-after { opacity: 1; visibility: visible; transition: opacity 1s var(--ease); }

/* ================= HOME: COLLAGE ================= */
#home { opacity: 0; transition: opacity 1s var(--ease); }
#home.is-in { opacity: 1; }
.collage-sec { padding: 26px 0 50px; overflow: hidden; }
.collage {
  position: relative; container-type: inline-size;
  width: 100%; max-width: 520px; margin: 0 auto;
  height: calc(min(100vw, 520px) * 2.34);
}
.it { position: absolute; display: block; opacity: 0; }
.it img { width: 100%; height: auto; filter: drop-shadow(0 1.6cqw 2cqw rgba(0, 0, 0, .4)); }
#home.is-in .it { animation: itemIn 1s var(--ease) both; animation-delay: calc(var(--d) * .13s + .15s); }
a.it, button.it { transition: scale .35s var(--ease); }
a.it:hover, button.it:hover { scale: 1.03; }
a.it:active, button.it:active { scale: .98; }

.invited { left: 2cqw; top: 3cqw; width: 54cqw; rotate: -5deg; z-index: 3; }
.stamps { left: 58cqw; top: 1cqw; width: 39cqw; rotate: 5deg; z-index: 2; }

.vinyl-wrap {
  left: 59cqw; top: 39cqw; width: 37cqw; aspect-ratio: 1; z-index: 4; border-radius: 50%;
  filter: drop-shadow(0 1.6cqw 2cqw rgba(0, 0, 0, .5));
}
.vinyl-wrap img { position: absolute; filter: none; }
.vinyl-disc { inset: 0; height: 100%; }
.vinyl-player { left: 50%; top: 50%; width: 34% !important; translate: -50% -50%; }
.vinyl-wrap.is-playing .vinyl-disc { animation: spin 3.2s linear infinite; }

.camera { left: 1cqw; top: 66cqw; width: 42cqw; rotate: -7deg; z-index: 5; }
.inv-card { left: 40cqw; top: 73cqw; width: 58cqw; rotate: 4deg; z-index: 3; }
.rsvp-tray { left: 3cqw; top: 116cqw; width: 70cqw; rotate: -3deg; z-index: 5; }
.flowers { left: 56cqw; top: 110cqw; width: 40cqw; rotate: 12deg; z-index: 4; }
.details-tag { left: 4cqw; top: 170cqw; width: 43cqw; rotate: -6deg; z-index: 2; }
.story-pola { left: 44cqw; top: 171cqw; width: 53cqw; z-index: 3; }

.with-love { text-align: center; margin-top: 4px; }
.with-love .logo-img { width: min(64vw, 260px); }

/* ending (ivory) */
.ending { background: var(--ivory); color: var(--black); text-align: center; padding: 44px 28px 60px; }
.countdown { display: flex; justify-content: center; align-items: flex-start; gap: 10px; color: var(--burgundy); }
.countdown div { display: flex; flex-direction: column; align-items: center; min-width: 46px; }
.countdown span { font-family: var(--serif); font-weight: 300; font-size: 34px; line-height: 1; }
.countdown small { font-family: var(--sans); font-size: 7.5px; letter-spacing: .14em; text-transform: uppercase; margin-top: 7px; color: var(--black); }
.countdown i { font-style: normal; font-family: var(--serif); font-size: 28px; line-height: 1.1; }
.countdown-line { font-size: 30px; color: var(--burgundy); margin: 10px 0 40px; }
.ending .heading { margin-bottom: 14px; }
.ending .caps { max-width: 330px; margin: 0 auto 10px; }
.ending .btn { margin-top: 10px; }
.ending-nav { margin: 34px 0 0; line-height: 2.4; font-size: 10px; }
.ending-nav a { border-bottom: 1px solid rgba(36, 34, 33, .35); }
.closing { margin-top: 56px; padding-top: 40px; border-top: 1px solid rgba(36, 34, 33, .15); }
.closing-line { font-size: 34px; color: var(--burgundy); }
.closing .label { margin-top: 6px; }
.closing .logo-img { margin-top: 18px; }

/* ================= SUB PAGES ================= */
.page {
  position: fixed; inset: 0; z-index: 80;
  overflow-y: auto; -webkit-overflow-scrolling: touch;
  padding: max(30px, env(safe-area-inset-top)) 28px 80px;
  text-align: center;
  opacity: 0; visibility: hidden;
  transition: opacity .7s var(--ease), visibility .7s;
}
.page.is-open { opacity: 1; visibility: visible; }
.page.dark { background: var(--burgundy); color: var(--ivory); }
.page.light { background: var(--ivory); color: var(--black); }
.go-back { display: inline-block; padding: 6px 10px; font-size: 11px; }
.page-title { font-size: clamp(60px, 18vw, 82px); margin: 22px 0 18px; font-weight: 400; }
.page.light .page-title { color: var(--burgundy); }
.page-body { max-width: 360px; margin: 0 auto; }
.page-body > * + * { margin-top: 18px; }
.page-body .heading { margin-top: 48px; }
.page-body .heading.sm { margin-top: 36px; }
.page-body .heading + .caps { margin-top: 10px; }
.page-body .btn { margin-top: 22px; }
.page-names { font-size: 44px; }
.section-script { font-size: 44px; margin-top: 64px !important; color: var(--burgundy); }
.section-script.small { font-size: 36px; margin-top: 14px !important; }
.page.dark .section-script { color: var(--ivory); }

/* The Details: one framed card per part */
.block {
  position: relative; margin-top: 34px !important; padding: 34px 20px 36px;
  background: var(--paper); border: 1px solid rgba(104, 28, 48, .45);
  box-shadow: 0 18px 34px -24px rgba(36, 34, 33, .45);
}
.block::before { content: ''; position: absolute; inset: 6px; border: 1px solid rgba(104, 28, 48, .18); pointer-events: none; }
.block > * + * { margin-top: 16px; }
.block > .heading:first-child { margin-top: 0; color: var(--burgundy); font-size: 19px; padding-bottom: 14px; border-bottom: 1px solid rgba(104, 28, 48, .25); }
.block > .section-script:first-child { margin-top: 0 !important; }
.block .heading.sm { margin-top: 30px; color: var(--burgundy); font-size: 15px; letter-spacing: .1em; }
.block .heading.sm::before { content: ''; display: block; width: 28px; height: 1px; margin: 0 auto 22px; background: rgba(104, 28, 48, .4); }
.block .btn { margin-top: 14px; }
.page.is-open .page-title, .page.is-open .story-photos:first-of-type { animation: fadeIn 1.2s var(--ease) both; }

/* story page photos */
.story-photos { position: relative; height: 300px; max-width: 340px; margin: 8px auto 30px; }
.pola { position: absolute; background: var(--paper); padding: 8px 8px 34px; box-shadow: 0 18px 30px -12px rgba(0, 0, 0, .7); }
.pola img { width: 100%; aspect-ratio: 1 / 1.02; object-fit: cover; }
.story-main { left: 6%; top: 46px; width: 58%; rotate: -9deg; }
.story-main img { object-position: 50% 30%; }
.stamp-strip { position: absolute; left: 63%; top: 6px; width: 21%; rotate: 11deg; display: flex; flex-direction: column; gap: 3px; z-index: 2; }
.stamp { display: block; padding: 4px; background: radial-gradient(circle, transparent 1.3px, var(--paper) 1.8px) -3px -3px / 5px 5px; filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .35)); }
.stamp img { aspect-ratio: 1 / 1; object-fit: cover; border: 2px solid var(--paper); }
.clip {
  position: absolute; left: 50%; top: -12px; z-index: 3; width: 26px; height: 16px; margin-left: -13px;
  background: linear-gradient(180deg, #2B2928, #111); border-radius: 3px 3px 1px 1px;
  box-shadow: 0 2px 3px rgba(0, 0, 0, .4);
}
.clip::before {
  content: ''; position: absolute; left: 3px; right: 3px; top: -12px; height: 14px;
  border: 1.5px solid #C9C7C4; border-bottom: 0; border-radius: 8px 8px 0 0;
}
.story-note { position: absolute; right: 2%; bottom: 0; font-size: 30px; rotate: -16deg; opacity: .7; text-align: left; line-height: 1; }
.story-photos.small { height: 270px; margin: 34px auto 24px; }
.story-second { left: 18%; top: 6px; width: 60%; rotate: 6deg; }
.story-second img { object-position: 50% 60%; }
.story-photos.small .story-note { right: auto; left: 2%; bottom: 4px; rotate: -12deg; }

/* RSVP page */
.deadline { border-bottom: 1px solid currentColor; white-space: nowrap; }
.rsvp-card { display: none; text-align: left; margin-top: 34px !important; padding: 30px 22px; background: var(--paper); box-shadow: 0 20px 40px -20px rgba(0, 0, 0, .35); }
.rsvp-card.is-open { display: block; animation: fadeIn 1s var(--ease) both; }
.field { border: 0; margin: 0 0 24px; }
.field label, .field legend { display: block; font-family: var(--sans); font-size: 11px; line-height: 1.6; letter-spacing: .12em; text-transform: uppercase; margin-bottom: 4px; }
.field input:not([type=radio]), .field textarea {
  width: 100%; padding: 8px 0; font: 400 16px/1.5 var(--sans); color: var(--black);
  background: transparent; border: 0; border-bottom: 1px solid rgba(36, 34, 33, .35); border-radius: 0; outline: none; resize: vertical;
}
.field input:focus, .field textarea:focus { border-color: var(--burgundy); }
.field.invalid input, .field.invalid textarea { border-color: var(--red); }
.field.invalid label, .field.invalid legend { color: var(--red); }
.choices { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice > span { display: inline-block; padding: 9px 14px; font-size: 13px; border: 1px solid rgba(36, 34, 33, .4); cursor: pointer; transition: background .25s, color .25s; }
.choice input:checked + span { background: var(--burgundy); color: var(--ivory); border-color: var(--burgundy); }
.choice input:focus-visible + span { outline: 2px solid var(--red); outline-offset: 2px; }
.form-error { color: var(--red); font-size: 13px; margin-bottom: 12px; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.rsvp-done { text-align: center; padding: 10px 0; animation: fadeIn 1s var(--ease) both; }
.rsvp-done > * + * { margin-top: 12px; }
.preview-note { text-align: center; margin-top: 18px; color: var(--red); font-size: 9px; line-height: 1.7; }

/* reveal on scroll */
.rv { opacity: 0; translate: 0 16px; transition: opacity 1s var(--ease), translate 1s var(--ease); }
.rv.is-visible { opacity: 1; translate: 0 0; }

/* ---------- Motion ---------- */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes itemIn { from { opacity: 0; transform: translateY(-14px) scale(1.04); } to { opacity: 1; transform: none; } }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(243, 232, 213, 0); } 50% { box-shadow: 0 0 0 11px rgba(243, 232, 213, .16); } }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .rv { opacity: 1; translate: none; }
}

/* ---------- Language (FR / EN) ---------- */
html[lang="fr"] [lang="en"], html[lang="en"] [lang="fr"] { display: none !important; }
.lang-switch {
  position: fixed; z-index: 150; top: max(12px, env(safe-area-inset-top)); right: 12px;
  display: flex; padding: 3px; border-radius: 999px;
  background: rgba(104, 28, 48, .88); box-shadow: 0 4px 14px -6px rgba(0, 0, 0, .45);
  -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
}
.lang-switch button {
  font-family: var(--sans); font-size: 10px; letter-spacing: .14em; line-height: 1;
  padding: 7px 9px 6px 10px; border-radius: 999px; color: var(--ivory); opacity: .65;
  transition: background .25s, color .25s, opacity .25s;
}
html[lang="fr"] .lang-switch [data-lang="fr"], html[lang="en"] .lang-switch [data-lang="en"] {
  background: var(--ivory); color: var(--burgundy); opacity: 1;
}
