/* =========================================================================
   THE PAMPERED BRIDE — scroll-scrubbed film site (black-and-white editorial)
   The page barely moves; scrolling scrubs a preloaded frame sequence on a
   <canvas>. Mobile-first, iOS Safari is the hero target.
   Customize: palette tokens in :root; copy in index.html; film frames in
   assets.js. See README.
   ========================================================================= */

:root {
  /* warm black-and-white monochrome — deepened for legibility over the film */
  --ivory:  #f2efea;
  --cream:  #e9e5df;
  --sand:   #ddd8d0;
  --taupe:  #aaa395;     /* hairlines */
  --greige: #6c655c;     /* labels / kickers — dark enough to stand out */
  --umber:  #423d35;     /* secondary text */
  --ink:    #1d1a15;     /* headlines — deep near-charcoal (never pure black) */
  --gold:   #5b544a;     /* dark pewter accent */
  --scrim:  242, 239, 234;

  --serif-display: 'Playfair Display', 'Cormorant Garamond', Georgia, serif;
  --serif-body:    'EB Garamond', 'Cormorant Garamond', Georgia, serif;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);

  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-l: env(safe-area-inset-left, 0px);
  --safe-r: env(safe-area-inset-right, 0px);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
html, body { max-width: 100%; overflow-x: hidden; }
body {
  font-family: var(--serif-body); color: var(--ink); background: var(--ivory);
  line-height: 1.6; font-size: 17px;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
a { color: inherit; text-decoration: none; }
ul { list-style: none; }
em { font-style: italic; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ----------------------------------------------------------------- loader */
.loader {
  position: fixed; inset: 0; z-index: 100; background: var(--ivory);
  display: flex; align-items: center; justify-content: center; text-align: center;
  transition: opacity 1s var(--ease); padding: 2rem;
}
.loader.is-done { opacity: 0; pointer-events: none; }
.loader__issue { font-size: 0.62rem; letter-spacing: 0.34em; text-transform: uppercase; color: var(--greige); margin-bottom: 1.4rem; }
.loader__mast { font-family: var(--serif-display); font-weight: 500; line-height: 0.95; color: var(--ink); animation: fadeup 1.4s var(--ease) both; }
.loader__mast span { display: block; }
.loader__mast span:first-child { font-size: clamp(1.8rem, 8vw, 3rem); letter-spacing: 0.06em; text-transform: uppercase; }
.loader__mast--em { font-style: italic; font-size: clamp(2.6rem, 12vw, 4.4rem); color: var(--umber); }
.loader__bar { width: min(220px, 60vw); height: 1px; background: rgba(108,101,92,0.3); margin: 1.8rem auto 0.9rem; overflow: hidden; }
.loader__bar span { display: block; height: 100%; width: 0%; background: var(--gold); transition: width 0.35s var(--ease); }
.loader__hint { font-size: 0.56rem; letter-spacing: 0.3em; text-transform: uppercase; color: var(--greige); }
@keyframes fadeup { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

/* ----------------------------------------------------------- paper grain */
.grain {
  position: fixed; inset: 0; z-index: 40; pointer-events: none;
  opacity: 0.45; mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.4'/%3E%3C/svg%3E");
}

/* ----------------------------------------------------------- running head */
.topbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 30;
  display: flex; align-items: center; gap: 0.85rem;
  padding: calc(var(--safe-t) + 0.8rem) calc(var(--safe-r) + 1.25rem) 0.8rem calc(var(--safe-l) + 1.25rem);
  color: var(--ink); mix-blend-mode: multiply; pointer-events: none;
}
.topbar__name { font-family: var(--serif-display); font-weight: 500; font-size: 0.76rem; letter-spacing: 0.18em; text-transform: uppercase; white-space: nowrap; }
.topbar__rule { flex: 1; height: 1px; background: currentColor; opacity: 0.28; }
.topbar__ig { pointer-events: auto; display: inline-flex; align-items: center; gap: 0.4rem; font-size: 0.6rem; letter-spacing: 0.16em; text-transform: uppercase; opacity: 0.9; min-height: 30px; }
.topbar__ig:hover, .topbar__ig:focus-visible { opacity: 1; }
@media (max-width: 460px) { .topbar__ig span { display: none; } }

/* -------------------------------------------------- corner Instagram icon */
/* fades into the corner once you reach the bottom of the page */
.ig-corner {
  position: fixed; z-index: 45;
  right: calc(var(--safe-r) + 1rem); bottom: calc(var(--safe-b) + 1rem);
  width: 48px; height: 48px; display: flex; align-items: center; justify-content: center;
  color: var(--ink); background: rgba(242,239,234,0.85);
  border: 1px solid rgba(108,101,92,0.45); border-radius: 50%;
  box-shadow: 0 10px 26px -12px rgba(29,26,21,0.55);
  -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
  opacity: 0; transform: translateY(10px) scale(0.9); pointer-events: none;
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease), background 0.4s, color 0.4s;
}
.ig-corner.is-shown { opacity: 1; transform: none; pointer-events: auto; }
.ig-corner:hover, .ig-corner:focus-visible { background: var(--ink); color: var(--ivory); }

/* ----------------------------------------------------------------- rail */
.rail { position: fixed; z-index: 30; right: calc(var(--safe-r) + 0.7rem); top: 50%; transform: translateY(-50%); width: 1px; height: 28vh; background: rgba(108,101,92,0.3); }
.rail__fill { position: absolute; top: 0; left: 0; width: 100%; height: 0%; background: var(--gold); }

/* --------------------------------------------------------------- stage */
.stage { position: fixed; inset: 0; z-index: 1; overflow: hidden; }
.film {
  position: absolute; inset: 0; width: 100%; height: 100%; display: block;
  background: radial-gradient(120% 95% at 50% 35%, #efece6 0%, #cfcbc3 100%);
}
.scrim { position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(180deg, rgba(var(--scrim),0.42) 0%, rgba(var(--scrim),0.30) 40%, rgba(var(--scrim),0.50) 100%);
}

/* spacer drives the scroll length (also set in JS) */
.spacer { height: 600svh; height: 600dvh; }

/* --------------------------------------------------------- chapters */
.chapters { position: absolute; inset: 0; z-index: 2; pointer-events: none; }
.chapter {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: safe center; text-align: center;
  padding: calc(var(--safe-t) + 4.6rem) calc(var(--safe-r) + 1.6rem) calc(var(--safe-b) + 4.6rem) calc(var(--safe-l) + 1.6rem);
  opacity: 0; will-change: opacity, transform;
}
.chapter > * { max-width: 680px; }
/* soft pearl halo lifts dark text off darker areas of the film (legibility) */
.chapter { text-shadow: 0 1px 2px rgba(245,242,237,0.55), 0 0 16px rgba(245,242,237,0.35); }
.pkg, .pkg *, .inquire, .inquire * { text-shadow: none; }

/* delicate corner botanical on every chapter */
.chapter::after {
  content: ""; position: absolute; bottom: calc(var(--safe-b) + 0.4rem); left: calc(var(--safe-l) + 0.3rem);
  width: 64px; height: 104px; opacity: 0.18; pointer-events: none; transform: scaleX(-1) rotate(10deg);
  background: no-repeat center / contain;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 160'%3E%3Cg fill='none' stroke='%236c655c' stroke-width='1.3' stroke-linecap='round'%3E%3Cpath d='M52 8 C 30 45 70 82 40 152'/%3E%3Cellipse cx='42' cy='30' rx='6.5' ry='9' transform='rotate(-28 42 30)'/%3E%3Cellipse cx='60' cy='46' rx='6.5' ry='9' transform='rotate(26 60 46)'/%3E%3Cellipse cx='38' cy='62' rx='6.5' ry='9' transform='rotate(-30 38 62)'/%3E%3Cellipse cx='62' cy='80' rx='6.5' ry='9' transform='rotate(28 62 80)'/%3E%3Cellipse cx='40' cy='98' rx='6' ry='8.5' transform='rotate(-30 40 98)'/%3E%3Cellipse cx='58' cy='116' rx='6' ry='8.5' transform='rotate(26 58 116)'/%3E%3C/g%3E%3C/svg%3E");
}

/* magazine furniture */
.kicker { font-family: var(--serif-body); text-transform: uppercase; letter-spacing: 0.4em; font-size: 0.66rem; color: var(--greige); margin-bottom: 1.3rem; }
/* darker section labels so they pop (The Philosophy, The Difference, Services, The Collection) */
.chapter--text .kicker, .closing__inner > .kicker { color: var(--ink); }
.issue { font-family: var(--serif-body); text-transform: uppercase; letter-spacing: 0.28em; font-size: 0.62rem; color: var(--ink); margin-bottom: 1.5rem; }
.folio { position: absolute; left: 50%; transform: translateX(-50%); bottom: calc(var(--safe-b) + 1.15rem); font-size: 0.6rem; letter-spacing: 0.3em; color: var(--greige); }

.divider { width: 200px; height: 22px; margin: 1.4rem auto; opacity: 0.9; background: no-repeat center / contain;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 24'%3E%3Cg fill='none' stroke='%235b544a' stroke-width='1.2' stroke-linecap='round'%3E%3Cpath d='M4 12 H74'/%3E%3Cpath d='M126 12 H196'/%3E%3Cpath d='M100 3 C 92 12 92 12 100 21 C 108 12 108 12 100 3 Z'/%3E%3Cpath d='M88 12 q -7 -6 -15 -4'/%3E%3Cpath d='M112 12 q 7 -6 15 -4'/%3E%3C/g%3E%3Ccircle cx='100' cy='12' r='1.7' fill='%235b544a'/%3E%3C/svg%3E"); }

.masthead { font-family: var(--serif-display); font-weight: 500; line-height: 0.94; color: var(--ink); }
.masthead__line { display: block; }
.masthead__line:first-child { font-size: clamp(2.1rem, 10.5vw, 6rem); letter-spacing: 0.05em; text-transform: uppercase; }
.masthead__line--em { font-style: italic; font-size: clamp(3.2rem, 15vw, 8rem); color: var(--umber); margin-top: 0.04em; }
.cover__sub { font-family: var(--serif-body); text-transform: uppercase; letter-spacing: 0.3em; font-size: 0.76rem; color: var(--ink); margin-top: 0.3rem; }

.lede { font-family: var(--serif-display); font-size: clamp(1.5rem, 5.2vw, 2.5rem); line-height: 1.36; color: var(--ink); max-width: 20ch; margin: 0 auto; }
.lede em { color: var(--gold); }
.dropcap::first-letter { float: left; font-family: var(--serif-display); font-weight: 500; font-size: 3em; line-height: 0.72; padding: 0.05em 0.12em 0 0; color: var(--umber); }

.pullquote { font-family: var(--serif-display); font-style: italic; font-size: clamp(1.6rem, 5.6vw, 2.8rem); line-height: 1.3; color: var(--ink); max-width: 18ch; margin: 0 auto; padding: 1.4rem 0; border-top: 1px solid rgba(108,101,92,0.45); border-bottom: 1px solid rgba(108,101,92,0.45); }
.pullquote em { color: var(--gold); }

.svc { max-width: 460px; margin: 0.4rem auto 0; width: 100%; }
.svc li { display: flex; align-items: baseline; gap: 1rem; padding: 0.8rem 0.2rem; border-bottom: 1px solid rgba(108,101,92,0.28); text-align: left; }
.svc li:first-child { border-top: 1px solid rgba(108,101,92,0.28); }
.svc__n { font-family: var(--serif-display); font-style: italic; font-size: 0.95rem; color: var(--gold); min-width: 1.8em; }
.svc__t { font-family: var(--serif-display); font-size: clamp(1.1rem, 4vw, 1.5rem); color: var(--ink); }
.svc__foot { font-family: var(--serif-display); font-style: italic; font-size: 1.05rem; color: var(--ink); margin-top: 1.3rem; }

/* --------------------------------------------------------- closing spread */
/* closing spread can be taller than the screen → let it scroll internally,
   top-aligned when it overflows so the top card is never clipped on mobile */
.chapter--closing { justify-content: safe center; pointer-events: none; overflow-y: auto; -webkit-overflow-scrolling: touch; padding-bottom: calc(var(--safe-b) + 5.6rem); }
.closing__inner { width: 100%; max-width: 880px; margin: 0 auto; }
.chapter--closing .kicker { margin-bottom: 1.4rem; }

.packages { display: grid; grid-template-columns: 1fr; gap: 1rem; margin: 0 auto 1.2rem; max-width: 1040px; text-align: left; }
.pkg { position: relative; background: rgba(242,239,234,0.9); border: 1px solid rgba(108,101,92,0.4); border-radius: 2px; padding: 1.5rem 1.5rem 1.4rem; box-shadow: 0 18px 50px -30px rgba(29,26,21,0.65); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
.pkg--signature { background: rgba(237,232,223,0.94); border-color: var(--gold); box-shadow: 0 22px 60px -28px rgba(29,26,21,0.75); }
.pkg__ribbon { position: absolute; top: 0; right: 1.3rem; transform: translateY(-50%); background: var(--gold); color: var(--ivory); font-size: 0.52rem; letter-spacing: 0.26em; text-transform: uppercase; padding: 0.38rem 0.85rem; border-radius: 1px; }
.pkg__name { font-family: var(--serif-display); font-size: 1.34rem; color: var(--ink); letter-spacing: 0.02em; text-transform: uppercase; line-height: 1.1; }
.pkg__tag { font-size: 0.64rem; letter-spacing: 0.2em; text-transform: uppercase; color: var(--greige); margin-top: 0.35rem; }
.pkg__rule { height: 1px; background: rgba(108,101,92,0.35); margin: 1rem 0; }
.pkg__list { display: flex; flex-direction: column; gap: 0.5rem; }
.pkg__list li { font-size: 0.92rem; line-height: 1.4; color: var(--umber); padding-left: 1rem; position: relative; }
.pkg__list li::before { content: "\2014"; position: absolute; left: 0; color: var(--taupe); }
.pkg__list li em { color: var(--gold); font-style: italic; }

.inquire { max-width: 420px; margin: 0 auto; background: rgba(242,239,234,0.92); border: 1px solid rgba(108,101,92,0.4); border-radius: 2px; padding: 1.5rem 1.4rem; box-shadow: 0 18px 50px -30px rgba(29,26,21,0.65); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
.capture { display: flex; flex-direction: column; gap: 0.6rem; margin: 0.4rem 0 1rem; }
.capture__input { font-family: var(--serif-body); font-size: 1rem; color: var(--ink); background: rgba(255,255,255,0.55); border: 1px solid var(--taupe); border-radius: 1px; padding: 0.95rem 1.1rem; min-height: 48px; text-align: center; letter-spacing: 0.04em; -webkit-appearance: none; appearance: none; transition: border-color 0.4s, background 0.4s; }
.capture__input::placeholder { color: var(--greige); }
.capture__input:focus { outline: none; border-color: var(--gold); background: rgba(255,255,255,0.8); }
.capture__note { font-family: var(--serif-display); font-style: italic; font-size: 0.9rem; color: var(--gold); min-height: 1.2em; }
.ig { display: inline-flex; align-items: center; gap: 0.5rem; font-size: 0.78rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--umber); padding: 0.5rem; min-height: 40px; border-bottom: 1px solid transparent; transition: border-color 0.4s; }
.ig:hover, .ig:focus-visible { border-color: var(--gold); }
.signoff { font-family: var(--serif-display); font-style: italic; font-size: 1rem; color: var(--greige); margin-top: 0.8rem; }

/* --------------------------------------------------------------- button */
.btn { display: inline-block; font-family: var(--serif-body); text-transform: uppercase; letter-spacing: 0.3em; font-size: 0.7rem; color: var(--ivory); background: var(--ink); padding: 1rem 2.4rem; min-height: 44px; border: 1px solid var(--ink); border-radius: 1px; cursor: pointer; transition: background 0.5s var(--ease), transform 0.5s var(--ease); -webkit-tap-highlight-color: transparent; }
.btn:hover, .btn:focus-visible { background: #000; transform: translateY(-1px); }

/* --------------------------------------------------------------- scroll cue */
.scroll-cue { position: absolute; z-index: 3; left: 50%; transform: translateX(-50%); bottom: calc(var(--safe-b) + 1.6rem); display: flex; flex-direction: column; align-items: center; gap: 0.7rem; font-size: 0.72rem; letter-spacing: 0.34em; text-transform: uppercase; color: var(--umber); transition: opacity 0.6s var(--ease); text-shadow: 0 1px 2px rgba(245,242,237,0.6); }
.scroll-cue__line { width: 1.5px; height: 44px; background: var(--umber); opacity: 0.7; transform-origin: top; animation: cue 2.6s var(--ease) infinite; }
@keyframes cue { 0%,100% { transform: scaleY(0.4); opacity: 0.2; } 50% { transform: scaleY(1); opacity: 0.7; } }

/* ----------------------------------------------------------- reveal-ish */
.box { opacity: 0; transform: translateY(20px); transition: opacity 1.1s var(--ease), transform 1.1s var(--ease); }
.chapter--closing.is-on { pointer-events: auto; }
.chapter--closing.is-on .box { opacity: 1; transform: none; transition-delay: calc(var(--i) * 0.16s); }

/* ================================ DESKTOP ================================ */
@media (min-width: 768px) {
  body { font-size: 18px; }
  .packages { grid-template-columns: 1fr 1fr 1fr; gap: 1.2rem; }
  .chapter--closing .closing__inner { display: grid; gap: 1.4rem; max-width: 1040px; }
  .topbar { padding-left: calc(var(--safe-l) + 2.2rem); padding-right: calc(var(--safe-r) + 2.2rem); }
  .scrim { background: linear-gradient(180deg, rgba(var(--scrim),0.38) 0%, rgba(var(--scrim),0.24) 40%, rgba(var(--scrim),0.46) 100%); }
  .chapter::after { width: 104px; height: 168px; }
  .ig-corner { right: calc(var(--safe-r) + 1.6rem); bottom: calc(var(--safe-b) + 1.6rem); }
}

/* short screens */
@media (max-height: 620px) {
  .masthead__line:first-child { font-size: clamp(1.8rem, 8vw, 3rem); }
  .masthead__line--em { font-size: clamp(2.2rem, 11vw, 4rem); }
}

/* ============================== REDUCED MOTION ============================== */
body.reduced .spacer { display: none; }
body.reduced .scroll-cue, body.reduced .rail { display: none; }
body.reduced .ig-corner { opacity: 1; transform: none; pointer-events: auto; }
body.reduced .stage { position: static; height: auto; overflow: visible; }
body.reduced .film, body.reduced .scrim { position: fixed; }
body.reduced .chapters { position: static; pointer-events: auto; }
body.reduced .chapter {
  position: relative; inset: auto; opacity: 1 !important; transform: none !important;
  min-height: 100svh; min-height: 100dvh;
}
body.reduced .chapter--closing .box { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .scroll-cue__line { animation: none; }
  .loader__mast { animation: none; }
}
