/* ═══════════ Motion ═══════════
   Slow, soft and few. Everything here switches off for visitors who ask for reduced motion. */
:root { --ease-out: cubic-bezier(.16, 1, .3, 1); }

/* ---- Soft page-to-page fade (browsers that support it) ---- */
@view-transition { navigation: auto; }
::view-transition-old(root) { animation: vt-out .35s ease both; }
::view-transition-new(root) { animation: vt-in .6s var(--ease-out) both; }
.site-header { view-transition-name: site-header; }
.announce { view-transition-name: announce; }
@keyframes vt-out { to { opacity: 0; } }
@keyframes vt-in { from { opacity: 0; transform: translateY(8px); } }

/* ---- Paper grain: a barely-there texture so the page feels less digital ---- */
body::after {
  content: ""; position: fixed; inset: 0; z-index: 90; pointer-events: none;
  opacity: .045; mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---- Headlines: each line rises out of a mask ---- */
.js .lines .line { display: block; overflow: hidden; padding-bottom: .12em; margin-bottom: -.12em; }
.js .lines .line > span { display: block; transform: translateY(105%); transition: transform 1.2s var(--ease-out); }
.js .lines .line:nth-child(2) > span { transition-delay: .14s; }
.js .lines.is-visible .line > span { transform: none; }
.section-head .lines .line > span, .cta-band .lines .line > span, .page-hero .lines .line > span { display: block; }

/* ---- Images: a curtain lifts while the photo settles ---- */
/* (the clip sits on the <img>, not the frame, so the frame can still be detected as on-screen) */
.js .img-reveal img { clip-path: inset(100% 0 0 0); transform: scale(1.14); transition: clip-path 1.3s var(--ease-out), transform 1.8s var(--ease-out), opacity .8s var(--ease); }
.js .img-reveal.is-visible img { clip-path: inset(0 0 0 0); transform: scale(1); }
.js .card:hover .img-reveal.is-visible img:first-child,
.js .occasion:hover .img-reveal.is-visible img { transform: scale(1.04); }

/* On phones the dress gallery is a swipe carousel: show photos straight away, no curtain */
@media (max-width: 900px) {
  .js .gallery .img-reveal img { clip-path: none; transform: none; }
}

/* ---- Parallax hook (value set by main.js) ---- */
[data-parallax] { translate: 0 var(--py, 0px); will-change: translate; }

/* ---- The bow draws itself ---- */
@keyframes draw { to { stroke-dashoffset: 0; } }
.js .brand__mark path, .js .brand__mark ellipse,
.js .ornament svg path, .js .ornament svg ellipse,
.js .ribbon__bow path, .js .ribbon__bow ellipse { stroke-dasharray: 1; stroke-dashoffset: 1; }
.js .brand__mark path, .js .brand__mark ellipse { animation: draw 2.2s var(--ease-out) .25s forwards; }
.js .brand__mark ellipse { animation-delay: 1.1s; }
.js .ornament.is-visible svg path, .js .ornament.is-visible svg ellipse { animation: draw 2s var(--ease-out) .2s forwards; }
.js .ribbon__bow path, .js .ribbon__bow ellipse { stroke-dashoffset: 0; }

/* ---- The measuring diagram sketches in ---- */
.js .measure-svg .m-outline { stroke-dasharray: 1; stroke-dashoffset: 1; }
.js .measure-svg .m-lines path[pathLength] { stroke-dasharray: 1; stroke-dashoffset: 1; }
.js .measure-svg .m-labels, .js .measure-svg .m-lines path:not([pathLength]) { opacity: 0; transition: opacity .8s ease 1.6s; }
.js .is-visible .measure-svg .m-outline { animation: draw 2.4s var(--ease-out) .1s forwards; }
.js .is-visible .measure-svg .m-lines path[pathLength] { animation: draw 1.2s var(--ease-out) 1.2s forwards; }
.js .is-visible .measure-svg .m-labels, .js .is-visible .measure-svg .m-lines path:not([pathLength]) { opacity: 1; }

/* ---- Ribbon of taglines ---- */
.ribbon {
  overflow: hidden; border-block: 1px solid var(--hairline); padding-block: clamp(18px, 2.4vw, 28px);
  background: var(--porcelain);
}
.ribbon__track { display: flex; align-items: center; width: max-content; animation: ribbon 70s linear infinite; }
.ribbon:hover .ribbon__track { animation-play-state: paused; }
.ribbon__track > span:not(.ribbon__bow) {
  font-family: var(--font-display); font-style: italic; font-weight: 300; color: var(--ink);
  font-size: clamp(1.4rem, 1.1rem + 1.2vw, 2.2rem); white-space: nowrap; padding-inline: clamp(18px, 2.5vw, 36px);
}
.ribbon__bow { color: var(--clay); display: inline-flex; }
.ribbon__bow svg { width: 30px; height: 20px; }
@keyframes ribbon { to { transform: translateX(-50%); } }

/* ---- Pull quote: words come in one by one ---- */
.js [data-words] .w { opacity: .14; transition: opacity .7s ease; }
.js [data-words].is-visible .w { opacity: 1; }

/* ---- Signature: written left to right ---- */
.signature-wrap { margin: 0; }
.signature-wrap .signature { display: inline-block; padding-inline: .3em .5em; }
.js .signature-wrap.reveal { transform: none; }
.js .signature-wrap .signature { clip-path: inset(-30% 100% -30% -5%); transition: clip-path 2.2s cubic-bezier(.45, .05, .35, 1) .4s; }
.js .signature-wrap.is-visible .signature { clip-path: inset(-30% -15% -30% -10%); }

/* ---- Header tucks away when scrolling down, returns when scrolling up ---- */
.site-header { transition: transform .5s var(--ease-out), border-color .4s var(--ease); }
.site-header.is-hidden { transform: translateY(-100%); }

/* ---- Buttons: colour sweeps in from the left ---- */
.btn { position: relative; overflow: hidden; isolation: isolate; --sweep: #4A3F3B; }
.btn::before {
  content: ""; position: absolute; inset: 0; z-index: -1; background: var(--sweep);
  transform: scaleX(0); transform-origin: right; transition: transform .7s var(--ease-out);
}
.btn:hover::before, .btn:focus-visible::before { transform: scaleX(1); transform-origin: left; }
.btn:hover { background: var(--ink); border-color: var(--ink); }
.btn--ghost { --sweep: var(--ink); }
.btn--ghost:hover { background: transparent; color: var(--porcelain); }
.btn--light { --sweep: var(--tint-rose); }
.btn--light:hover { background: var(--porcelain); color: var(--ink); border-color: var(--porcelain); }

/* ---- Small touches ---- */
.size-options label { transition: border-color .25s, background .25s, color .25s, transform .25s var(--ease-out); }
.size-options input:checked + label { transform: translateY(-2px); }
.sizes.has-error .size-options { animation: nudge .45s ease; }
@keyframes nudge { 20%, 60% { transform: translateX(-5px); } 40%, 80% { transform: translateX(5px); } }
.card__name { transition: color .4s; }
.card:hover .card__name { color: var(--clay-deep); }

@media (prefers-reduced-motion: reduce) {
  @view-transition { navigation: none; }
  body::after { display: none; }
  .js .lines .line > span, .js .img-reveal img, .js [data-words] .w { transform: none; opacity: 1; }
  .js .img-reveal img, .js .signature-wrap .signature { clip-path: none; }
  .js .brand__mark *, .js .ornament svg *, .js .measure-svg * { stroke-dashoffset: 0 !important; animation: none !important; opacity: 1 !important; }
  .ribbon__track { animation: none; }
  [data-parallax] { translate: none; }
  .site-header.is-hidden { transform: none; }
}
