/* ==========================================================================
   The Aromaverse — motion and finish layer
   Everything here is progressive: without JS or with reduced motion the
   site renders fully, just still.
   ========================================================================== */

:root {
  --gold-foil: linear-gradient(100deg, #7A5716 0%, #C9A45A 28%, #F1DDA6 48%, #C29A4E 64%, #7A5716 100%);
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --ease-in-out: cubic-bezier(.65, 0, .35, 1);
}

/* Paper grain over everything: the difference between flat and printed */
body::after {
  content: ""; position: fixed; inset: -50%; z-index: 300; pointer-events: none; opacity: .055;
  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='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.16 0 0 0 0 0.12 0 0 0 0 0.09 0 0 0 1 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* Scroll progress: a gold thread across the top */
.scroll-thread { position: fixed; top: 0; left: 0; right: 0; height: 2px; z-index: 210; transform-origin: 0 50%; transform: scaleX(var(--progress, 0)); background: var(--gold-foil); pointer-events: none; }

/* ---------- Intro (first visit per session) ---------- */
.intro { position: fixed; inset: 0; z-index: 400; background: var(--oud); display: grid; place-items: center; color: #F3E6C9; }
.intro-mark { display: grid; justify-items: center; gap: 22px; }
.intro-arch { width: 88px; height: 120px; }
.intro-arch circle { fill: none; stroke: url(#introGold); stroke-width: 1; stroke-dasharray: 260; stroke-dashoffset: 260; animation: draw 1.4s var(--ease-in-out) forwards; }
.intro-arch circle + circle { animation-delay: .2s; }
.intro-arch path { fill: none; stroke: url(#introGold); stroke-width: 1.2; stroke-dasharray: 420; stroke-dashoffset: 420; animation: draw 1.3s var(--ease-in-out) forwards; }
.intro-word { font-family: var(--serif); font-size: clamp(1.6rem, 1.2rem + 1.6vw, 2.3rem); letter-spacing: .08em; opacity: 0; animation: intro-word 1s .55s var(--ease-out) forwards; }
.intro.is-done { animation: intro-out .9s var(--ease-in-out) forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes intro-word { from { opacity: 0; letter-spacing: .3em; } to { opacity: 1; letter-spacing: .08em; } }
@keyframes intro-out { to { clip-path: inset(0 0 100% 0); } }
.intro { clip-path: inset(0 0 0 0); }

/* ---------- Page transitions: an arch rises to cover, then lifts ---------- */
.curtain { position: fixed; inset: 0; z-index: 390; pointer-events: none; }
.curtain::before {
  content: ""; position: absolute; left: -10%; right: -10%; top: 0; height: 130%;
  background: var(--oud); border-radius: 50% 50% 0 0 / 22% 22% 0 0;
  transform: translateY(100%);
}
.curtain.is-covering::before { transition: transform .6s var(--ease-in-out); transform: translateY(-12%); }
.curtain.is-lifting::before { transform: translateY(-12%); animation: lift .8s .05s var(--ease-in-out) forwards; }
@keyframes lift { to { transform: translateY(-130%); } }
.curtain-word { position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--serif); font-size: 1.6rem; letter-spacing: .08em; color: #F3E6C9; opacity: 0; transition: opacity .3s .25s; }
.curtain.is-covering .curtain-word { opacity: 1; }

/* ---------- Scroll reveals ---------- */
.motion .rv { opacity: 0; transform: translateY(34px); transition: opacity 1s var(--ease-out), transform 1.1s var(--ease-out); transition-delay: calc(var(--i, 0) * 70ms); }
.motion .rv.is-in { opacity: 1; transform: none; }
/* Arched images unveil from the base upwards, like a door opening */
.motion .rv-arch { clip-path: inset(100% 0 0 0 round 22px); transition: clip-path 1.3s var(--ease-out); transition-delay: calc(var(--i, 0) * 80ms); }
.motion .rv-arch.is-in { clip-path: inset(0 0 0 0 round 22px); }
.motion .rv-arch img { transform: scale(1.14); transition: transform 1.8s var(--ease-out); transition-delay: calc(var(--i, 0) * 80ms); }
.motion .rv-arch.is-in img { transform: none; }
/* Hairlines draw across */
.motion .rv-line { transform: scaleX(0); transform-origin: 0 50%; transition: transform 1.2s var(--ease-out); }
.motion .rv-line.is-in { transform: none; }

/* Split headlines: each word rises out of its own mask */
.split-word { display: inline-block; overflow: hidden; vertical-align: top; padding-bottom: .08em; margin-bottom: -.08em; }
.split-word > span { display: inline-block; }
.motion .split .split-word > span { transform: translateY(105%) rotate(4deg); transform-origin: 0 100%; transition: transform 1.1s var(--ease-out); transition-delay: calc(var(--w, 0) * 55ms + 80ms); }
.motion .split.is-in .split-word > span { transform: none; }

/* ---------- Header: glides away on scroll down, returns on scroll up ---------- */
.site-header { transition: transform .5s var(--ease-out), box-shadow .4s, background-color .4s; }
.site-header.is-scrolled { box-shadow: 0 10px 30px -24px rgba(42, 31, 25, .6); }
.site-header.is-hidden { transform: translateY(-100%); }
.wordmark { transition: letter-spacing .6s var(--ease-out); }
.wordmark:hover { letter-spacing: .05em; }

/* Nav: gold underline grows from the centre */
.primary-nav a::before { content: ""; position: absolute; left: 0; right: 0; bottom: 6px; height: 1px; background: var(--gold-foil); transform: scaleX(0); transition: transform .5s var(--ease-out); }
.primary-nav a:hover::before { transform: scaleX(1); }

/* ---------- Buttons: foil sweep + magnetic pull (JS) ---------- */
.btn { position: relative; overflow: hidden; isolation: isolate; transition: background-color .3s, color .3s, border-color .3s, transform .5s var(--ease-out); }
.btn::before { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(110deg, transparent 20%, rgba(241, 221, 166, .45) 45%, transparent 70%); transform: translateX(-120%); transition: transform .9s var(--ease-out); }
.btn:hover::before { transform: translateX(120%); }
.btn-primary { background: var(--oud); box-shadow: inset 0 0 0 1px rgba(201, 164, 90, .0); }
.btn-primary:hover { background: #3A2B21; box-shadow: inset 0 0 0 1px rgba(201, 164, 90, .55); }
.btn-gold { background: var(--gold-foil); background-size: 200% 100%; color: var(--oud); border: 0; transition: background-position .8s var(--ease-out); }
.btn-gold:hover { background-position: 100% 0; }
.ripple { position: absolute; border-radius: 50%; pointer-events: none; background: rgba(241, 221, 166, .45); transform: scale(0); animation: ripple .7s var(--ease-out) forwards; z-index: -1; }
@keyframes ripple { to { transform: scale(4); opacity: 0; } }

/* ---------- Product cards: light follows the pointer, gentle tilt ---------- */
.pcard-media { transform-style: preserve-3d; transition: transform .7s var(--ease-out), box-shadow .7s var(--ease-out); will-change: transform; }
.pcard-media::after {
  content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none; border-radius: inherit; opacity: 0; transition: opacity .5s;
  background: radial-gradient(260px circle at var(--mx, 50%) var(--my, 30%), rgba(255, 244, 214, .55), transparent 60%);
}
.pcard:hover .pcard-media::after { opacity: 1; }
.pcard:hover .pcard-media { box-shadow: 0 30px 50px -34px rgba(42, 31, 25, .6); }
.pcard-media img { transition: transform 1s var(--ease-out), filter 1s var(--ease-out); }
.pcard:hover .pcard-media img { transform: translateY(-8px) scale(1.04); filter: drop-shadow(0 26px 22px rgba(42, 31, 25, .3)); }
.pcard-name a { background: linear-gradient(currentColor, currentColor) 0 100% / 0 1px no-repeat; transition: background-size .6s var(--ease-out); }
.pcard:hover .pcard-name a { background-size: 100% 1px; }
.pcard-add { transition: background-color .35s, color .35s, border-color .35s, letter-spacing .5s var(--ease-out); }
.pcard-add:hover { letter-spacing: .06em; }
.pcard-add.is-added, .btn.is-added { background: var(--sage) !important; border-color: var(--sage) !important; color: #fff !important; }

/* Wishlist heart pops */
.js-wish svg { transition: transform .4s var(--ease-out), fill .3s; }
.js-wish.is-active svg { animation: heart-pop .55s var(--ease-out); }
@keyframes heart-pop { 30% { transform: scale(1.35); } 60% { transform: scale(.9); } }

/* ---------- Add to cart: a drop of gold flies to the bag ---------- */
.fly-drop { position: fixed; z-index: 260; width: 18px; height: 18px; margin: -9px 0 0 -9px; border-radius: 50%; background: var(--gold-foil); box-shadow: 0 0 18px rgba(241, 221, 166, .8); pointer-events: none; }
.bag-pulse { animation: bag-pulse .7s var(--ease-out); }
@keyframes bag-pulse { 30% { transform: scale(1.25) rotate(-8deg); } 60% { transform: scale(.95) rotate(4deg); } }

/* ---------- Cursor companion (fine pointers only) ---------- */
.cursor { position: fixed; top: 0; left: 0; z-index: 280; pointer-events: none; width: 34px; height: 34px; margin: -17px 0 0 -17px; border: 1px solid rgba(168, 123, 42, .7); border-radius: 50%; transition: width .4s var(--ease-out), height .4s var(--ease-out), margin .4s var(--ease-out), background-color .4s, border-color .4s, opacity .3s; display: grid; place-items: center; mix-blend-mode: multiply; opacity: 0; }
.cursor.is-visible { opacity: 1; }
.cursor span { font-size: 11px; font-weight: 600; letter-spacing: .06em; color: #FAF7F1; opacity: 0; transition: opacity .3s; }
.cursor.is-view { width: 84px; height: 84px; margin: -42px 0 0 -42px; background: var(--oud); border-color: var(--oud); mix-blend-mode: normal; }
.cursor.is-view span { opacity: 1; }
.cursor.is-link { width: 12px; height: 12px; margin: -6px 0 0 -6px; background: var(--saffron); border-color: var(--saffron); }
@media (hover: none), (pointer: coarse) { .cursor { display: none; } }

/* ---------- Tabs: the underline slides between tabs ---------- */
.tabs { position: relative; }
.tab[aria-selected="true"]::after { display: none; }
.tab-ink { position: absolute; bottom: 4px; height: 1px; background: var(--gold-foil); transition: transform .6s var(--ease-out), width .6s var(--ease-out); pointer-events: none; left: 0; }

/* ---------- Houses band: slow continuous drift ---------- */
.houses.is-marquee .container { max-width: none; padding: 0; overflow: hidden; -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); }
.houses.is-marquee .houses-list { flex-wrap: nowrap; justify-content: flex-start; width: max-content; gap: 0 54px; animation: drift var(--drift, 60s) linear infinite; padding-right: 54px; }
.houses.is-marquee:hover .houses-list { animation-play-state: paused; }
@keyframes drift { to { transform: translateX(-50%); } }

/* ---------- Drawers and sheets: contents cascade in ---------- */
.drawer.is-open .mobile-nav a, .drawer.is-open .facet { animation: cascade .7s var(--ease-out) both; animation-delay: calc(var(--i, 0) * 50ms + 120ms); }
@keyframes cascade { from { opacity: 0; transform: translateX(-18px); } }
.sheet.is-open .size-opt { animation: cascade-up .5s var(--ease-out) both; animation-delay: calc(var(--i, 0) * 40ms + 150ms); }
@keyframes cascade-up { from { opacity: 0; transform: translateY(10px); } }
.search-dialog.is-open .search-result, .search-dialog.is-open .search-suggest .chip { animation: cascade-up .5s var(--ease-out) both; animation-delay: calc(var(--i, 0) * 35ms); }

/* ---------- Forms: a gold line draws under the focused field ---------- */
.field { position: relative; }
.input, .select, .textarea { background-image: linear-gradient(90deg, #8A6219, #E3C27A, #8A6219); background-size: 0 2px; background-repeat: no-repeat; background-position: 50% 100%; transition: background-size .6s var(--ease-out), border-color .2s, box-shadow .2s; }
.input:focus, .textarea:focus { background-size: 100% 2px; box-shadow: none; }
.select { background-size: 18px, 0 2px; }

/* ---------- Product page ---------- */
.product-media { cursor: zoom-in; }
.product-media img { transition: transform .5s var(--ease-out); transform-origin: var(--zx, 50%) var(--zy, 50%); }
.product-media.is-zoom img { transform: scale(1.7); }
.size-opt span { transition: border-color .25s, box-shadow .25s, transform .4s var(--ease-out), background-color .25s; }
.size-opt:hover span { transform: translateY(-2px); }
.size-opt input:checked + span { background: #fff; }
.price-tick { display: inline-block; animation: price-tick .5s var(--ease-out); }
@keyframes price-tick { from { opacity: 0; transform: translateY(40%); filter: blur(3px); } }
.notes dd a { transition: transform .4s var(--ease-out), border-color .3s, background-color .3s; }
.notes dd a:hover { transform: translateY(-2px); }

/* Cart line leaving */
.line.is-leaving { animation: line-out .5s var(--ease-in-out) forwards; }
@keyframes line-out { to { opacity: 0; transform: translateX(30px); } }

/* Numbers counting up */
[data-count-to] { font-variant-numeric: tabular-nums; }

/* Ambient float for decorative arches */
.float { animation: float 7s ease-in-out infinite; }
@keyframes float { 50% { transform: translateY(-10px); } }

@media (prefers-reduced-motion: reduce) {
  .motion .rv, .motion .rv-arch, .motion .rv-line, .motion .split .split-word > span { opacity: 1 !important; transform: none !important; clip-path: none !important; }
  .intro, .curtain, .cursor, .scroll-thread { display: none !important; }
  .houses.is-marquee .houses-list { animation: none; }
}

/* The curtain only exists while it is moving */
.curtain:not(.is-covering):not(.is-lifting) { visibility: hidden; }
