/* ============================================================================
   components.css — Reusable UI: buttons, chips, cards, badges, toasts, dock,
   preloader, scroll-progress, back-to-top, custom cursor, reveal, modals.
   ----------------------------------------------------------------------------
   Section-specific styling lives in assets/css/sections/*. Keep this file to
   things used across multiple sections.
   ========================================================================== */

/* ===== Buttons ========================================================
   Every button is a pill. Gold = the jewel (one per view, ideally).
   Ghost = the companion. WhatsApp keeps its own brand green so it is
   instantly recognisable as a chat channel, not a decorative CTA. */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: .9rem 1.7rem;
  border-radius: var(--radius-pill);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: var(--fs-small);
  letter-spacing: .03em;
  line-height: 1;
  border: 1.35px solid transparent;
  overflow: hidden;
  isolation: isolate;                 /* keep the hover-fill ::after (z-index:-1) inside the button */
  transition: transform var(--dur-fast) var(--ease),
              box-shadow var(--dur) var(--ease),
              background var(--dur) var(--ease),
              border-color var(--dur) var(--ease),
              color var(--dur) var(--ease);
  will-change: transform;
}
.btn:hover { transform: translateY(-2px); }
/* Press: a real dip, not just a return-to-rest — the button should feel like
   it's actually being pushed. */
.btn:active { transform: translateY(0) scale(.965); }
.btn svg { width: 18px; height: 18px; flex: none; }

/* ── The luxury button language ───────────────────────────────────────
   At rest a button is a THIN GOLD RULE on the canvas — an engraved outline,
   never a filled UI control. On hover it becomes a solid gold seal: the gilt
   floods in and the label goes ink-navy, like foil pressed onto an invitation.
   No saturated fills at rest, no glow, no white light-sweep — that restraint
   is the whole difference between "a website button" and "a luxury mark". */

/* Primary — the gold seal. Used for the main CTA and every WhatsApp inquiry. */
.btn--gold,
.btn--whatsapp {
  background: transparent;
  color: var(--gold-100);
  border-color: var(--gold-500);
}
.btn--gold::after,
.btn--whatsapp::after {                 /* the gilt that floods in on hover */
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: var(--gold-metallic);
  opacity: 0; transition: opacity var(--dur) var(--ease);
  pointer-events: none;
}
.btn--gold:hover,
.btn--whatsapp:hover { color: var(--indigo-950); border-color: transparent; }
.btn--gold:hover::after,
.btn--whatsapp:hover::after { opacity: 1; }

/* Ghost — the companion (Email / secondary). Quieter at rest, and on hover it
   warms with a translucent gilt rather than the solid seal, so the primary
   always leads the eye. */
.btn--ghost {
  border-color: rgba(200,162,74,.4);
  color: var(--gold-300);
  background: transparent;
}
.btn--ghost:hover { border-color: var(--gold-500); background: rgba(200,162,74,.14); color: var(--gold-100); }

/* Ink — the seal for the IVORY chapters. Same outline→fill grammar, but the
   fill is midnight navy with a gold hairline, so on warm paper it reads as a
   wax seal, not a bright control. */
.btn--royal {
  background: transparent;
  color: var(--indigo-900);
  border-color: rgba(200,162,74,.55);
}
.btn--royal:hover {
  background: var(--indigo-900);
  color: var(--gold-100);
  border-color: var(--indigo-900);
}
.btn--royal:active { transform: translateY(0) scale(.965); }

/* Small inline variant for product cards */
.btn--sm { padding: .55rem 1rem; font-size: .8rem; }
.btn--block { width: 100%; }

/* ===== Chips & pills ================================================== */
.chip {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .38rem .85rem;
  border: 1.35px solid var(--line);
  border-radius: var(--radius-pill);
  font-size: var(--fs-small);
  color: var(--text-muted-on-dark);
  background: rgba(169,207,234,.04);
  transition: border-color var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease);
}
.chip:hover { border-color: rgba(201,162,75,.45); color: var(--gold-100); }
.section--light .chip, .section--powder .chip {
  color: var(--ink-600);
  border-color: rgba(5,12,28,.12);
  background: rgba(255,255,255,.6);
}
.chip .flag { font-size: 1rem; line-height: 1; }
.chip--more { cursor: pointer; color: var(--gold-300); border-color: var(--gold-700); }

/* Filter pills (products) */
.pill {
  padding: .55rem 1.15rem;
  border: 1.35px solid var(--line);
  border-radius: var(--radius-pill);
  font-size: var(--fs-small);
  font-weight: 600;
  color: var(--text-muted-on-dark);
  background: transparent;
  transition: all var(--dur-fast) var(--ease);
}
.pill:hover { color: var(--gold-300); border-color: var(--gold-500); }
.pill[aria-pressed="true"], .pill.is-active {
  background: var(--gold-metallic);
  color: var(--navy-950);
  border-color: transparent;
  box-shadow: 0 6px 20px -8px rgba(201,162,75,.5);
}

/* ===== Jewel card =====================================================
   Royal-blue cards that FLOAT off the canvas (layered soft shadow), with a
   gold edge and a faint nakshi-kantha motif that pools in the centre and
   dissolves well before the border — so the border always reads crisp.
   Alternate cards swap the motif (.motif-b) for gentle variety. */
.card {
  position: relative;
  background:
    linear-gradient(180deg, rgba(30,79,216,.16), rgba(7,28,77,.72) 55%, rgba(4,16,49,.88));
  border: 4.73px solid rgba(201,162,75,.28);
  border-radius: var(--radius-lg);
  box-shadow:
    0 24px 50px -24px rgba(1,5,18,.78),      /* deep floating shadow */
    0 6px 18px -12px rgba(1,5,18,.6),
    inset 0 1px 0 rgba(255,255,255,.07);     /* hairline top sheen */
  overflow: hidden;
  isolation: isolate;                        /* contains the -1 pattern layer */
  transition: transform .55s var(--ease), box-shadow .55s var(--ease), border-color .45s var(--ease);
}
/* Faint motif, radially feathered (and softly blurred) so it never touches the
   gold border. Very low opacity = luxurious, not busy. */
/* The texture is Jamdani — the supplementary-weft figured muslin Bengal was
   famous for. A generic damask would say "luxury template"; the weave says
   where this house is from. */
.card::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: var(--card-pattern, url("../img/patterns/jamdani-gold.svg")) center / 120px repeat;
  opacity: .16;
  -webkit-mask-image: radial-gradient(108% 94% at 50% 44%, #000 24%, rgba(0,0,0,.4) 60%, transparent 84%);
          mask-image: radial-gradient(108% 94% at 50% 44%, #000 24%, rgba(0,0,0,.4) 60%, transparent 84%);
  filter: blur(.4px);
  transition: opacity .55s var(--ease);
}
/* Alternate motif (geometric lotus star). */
.card.motif-b::before { background-image: url("../img/patterns/lotus-gold.svg"); }
/* Static card grids alternate the motif by position (every other card). */
.grid > .card:nth-child(even)::before,
.cap-grid > .card:nth-child(even)::before { background-image: url("../img/patterns/lotus-gold.svg"); }

/* Luxurious lift: rises, gold edge ignites, warm gold halo blooms beneath. */
.card:hover {
  transform: translateY(-10px);
  border-color: rgba(201,162,75,.62);
  box-shadow:
    0 44px 86px -30px rgba(1,5,18,.85),
    0 0 0 1px rgba(201,162,75,.22),
    0 18px 56px -16px rgba(201,162,75,.24);   /* gold ambient glow */
}
.card:hover::before { opacity: .24; }

/* Gold filigree corner ornament (decorative). Add .has-filigree to any box. */
.has-filigree::before, .has-filigree::after {
  content: "";
  position: absolute;
  width: 26px; height: 26px;
  border: 2.03px solid var(--gold-500);
  opacity: .55;
  pointer-events: none;
}
.has-filigree::before { top: 10px; left: 10px; border-right: 0; border-bottom: 0; border-top-left-radius: 6px; }
.has-filigree::after  { bottom: 10px; right: 10px; border-left: 0; border-top: 0; border-bottom-right-radius: 6px; }

/* Framed image with soft gold inner shadow on hover. */
.framed {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1.35px solid var(--line);
}
.framed img { width: 100%; height: 100%; object-fit: cover; transition: transform var(--dur-slow) var(--ease); }
.framed::after {
  content: ""; position: absolute; inset: 0;
  box-shadow: inset 0 0 0 0 rgba(201,162,75,0);
  transition: box-shadow var(--dur) var(--ease);
  pointer-events: none;
}
.framed:hover img { transform: scale(1.05); }
.framed:hover::after { box-shadow: inset 0 0 40px -6px rgba(201,162,75,.4); }

/* ===== Badges ========================================================= */
.badge {
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .3rem .7rem; border-radius: var(--radius-sm);
  font-size: .72rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase;
  background: rgba(201,162,75,.12); color: var(--gold-300); border: 1.35px solid rgba(201,162,75,.3);
}
.badge--ocean { background: rgba(62,147,201,.12); color: var(--ocean-400); border-color: rgba(62,147,201,.3); }

/* ===== Section reveal (JS toggles .is-visible) ========================
   Slightly longer and a touch more travel than a UI fade — reads as a
   considered arrival, not a pop-in. The curve is expo-out with no
   overshoot: it decelerates hard into rest rather than settling with any
   bounce, which is what makes a slow reveal feel weighty instead of lazy. */
[data-reveal] {
  opacity: 0; transform: translateY(30px);
  transition: opacity 760ms cubic-bezier(.16,1,.3,1), transform 760ms cubic-bezier(.16,1,.3,1);
}
[data-reveal].is-visible { opacity: 1; transform: none; }
[data-reveal-stagger] > * {
  opacity: 0; transform: translateY(30px);
  transition: opacity 760ms cubic-bezier(.16,1,.3,1), transform 760ms cubic-bezier(.16,1,.3,1);
}
[data-reveal-stagger].is-visible > * { opacity: 1; transform: none; }
/* Stagger delay applied via inline --i custom property in JS. */
[data-reveal-stagger].is-visible > * { transition-delay: calc(var(--i, 0) * 80ms); }

@media (prefers-reduced-motion: reduce) {
  [data-reveal], [data-reveal-stagger] > * { opacity: 1 !important; transform: none !important; }
}

/* ===== Floating contact dock ========================================= */
.dock {
  position: fixed; right: clamp(1rem, 3vw, 1.75rem); bottom: clamp(1rem, 3vw, 1.75rem);
  display: flex; flex-direction: column; gap: .75rem;
  z-index: var(--z-dock);
}
.dock a {
  display: grid; place-items: center;
  width: 52px; height: 52px; border-radius: 50%;
  box-shadow: var(--shadow-card);
  position: relative;
  transition: transform var(--dur) var(--ease);
}
.dock a:hover { transform: scale(1.08); }
.dock a svg { width: 24px; height: 24px; }
/* No bright green — the dock is gilt on navy. The WhatsApp bubble keeps a slow
   gold halo pulse so it still draws the eye, without the template-green. */
.dock .dock-wa { background: var(--indigo-900); color: var(--gold-300); border: 1.35px solid var(--gold-500); animation: pulse 2.8s var(--ease) infinite; }
.dock .dock-wa:hover { background: var(--gold-metallic); color: var(--indigo-950); border-color: transparent; }
.dock .dock-mail { background: var(--gold-metallic); color: var(--navy-950); }
.dock .dock-tel { background: var(--indigo-900); color: var(--gold-300); border: 1.35px solid var(--gold-500); }
.dock .dock-products { background: var(--royal-700); color: var(--gold-300); border: 1.35px solid var(--gold-500); }
/* Smaller bubbles on phones — less of the page hides behind the dock. */
@media (max-width: 480px) {
  .dock { gap: .55rem; }
  .dock a { width: 46px; height: 46px; }
  .dock a svg { width: 21px; height: 21px; }
}
.dock a[data-tip]::after {
  content: attr(data-tip);
  position: absolute; right: 110%; top: 50%; transform: translateY(-50%);
  background: var(--navy-950); color: var(--frost-100);
  font-size: .72rem; white-space: nowrap; padding: .3rem .6rem; border-radius: var(--radius-sm);
  border: 1.35px solid var(--line);
  opacity: 0; pointer-events: none; transition: opacity var(--dur-fast) var(--ease);
}
.dock a[data-tip]:hover::after { opacity: 1; }

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(200,162,74,.45); }
  50% { box-shadow: 0 0 0 10px rgba(200,162,74,0); }
}
@media (prefers-reduced-motion: reduce) { .dock .dock-wa { animation: none; } }

/* ===== Back-to-top pill ============================================== */
.to-top {
  position: fixed; left: clamp(1rem, 3vw, 1.75rem); bottom: clamp(1rem, 3vw, 1.75rem);
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .6rem 1rem; border-radius: var(--radius-pill);
  background: rgba(7,28,77,.82); border: 1.35px solid var(--line); color: var(--gold-300);
  font-size: .78rem; -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  opacity: 0; pointer-events: none; transform: translateY(10px);
  transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease);
  z-index: var(--z-dock);
}
.to-top.is-shown { opacity: 1; pointer-events: auto; transform: none; }

/* ===== Toasts ======================================================== */
.toast-wrap {
  position: fixed; bottom: 1.5rem; left: 50%; transform: translateX(-50%);
  display: flex; flex-direction: column; gap: .5rem; z-index: var(--z-overlay);
}
.toast {
  padding: .8rem 1.2rem; border-radius: var(--radius);
  background: var(--royal-700); color: var(--frost-100);
  border: 1.35px solid var(--line); box-shadow: var(--shadow-lift);
  font-size: var(--fs-small);
  animation: toast-in var(--dur) var(--ease);
}
.toast--ok { border-color: rgba(62,147,201,.55); }
.toast--err { border-color: rgba(232,106,106,.55); }
@keyframes toast-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

/* ===== Preloader — the overture ======================================
   A ring draws itself closed around the crest; the crest blooms; the wordmark
   opens out of tight tracking; a hairline runs out beneath it. Then the whole
   plate lifts away rather than merely fading — the difference between a curtain
   rising and a light being switched off.
   Everything is a transform/opacity so it stays smooth on a cold first paint. */
.preloader {
  position: fixed; inset: 0; z-index: var(--z-preloader);
  display: grid; place-items: center;
  background:
    radial-gradient(60% 60% at 50% 45%, rgba(20,31,85,.55), transparent 70%),
    var(--indigo-950);
  transition: opacity .8s var(--ease), visibility .8s var(--ease), transform .8s var(--ease);
}
/* Lift, don't just fade. */
.preloader.is-done { opacity: 0; visibility: hidden; transform: translateY(-2%); }
/* The returning visitor already had their greeting: no overture, no fade, gone
   before the first paint (preloader.js adds this on a repeat view). */
.preloader.is-instant, .preloader.is-instant * { animation: none !important; transition: none !important; }

.pre-inner { display: flex; flex-direction: column; align-items: center; }

.pre-mark { position: relative; width: 132px; height: 132px; display: grid; place-items: center; }
.pre-ring { position: absolute; inset: 0; width: 100%; height: 100%; color: var(--gold-500); }
.pre-ring-draw {
  stroke-dasharray: 100;
  stroke-dashoffset: 100;
  animation: pre-draw 1.5s var(--ease) forwards;
}
@keyframes pre-draw { to { stroke-dashoffset: 0; } }

.preloader .emblem {
  height: 84px; width: auto; max-width: 60vw;
  opacity: 0; transform: scale(.88);
  animation: pre-bloom 1.1s var(--ease) .35s forwards;
}
@keyframes pre-bloom { to { opacity: 1; transform: scale(1); } }

/* The wordmark opens out of tight tracking — the most quietly expensive
   typographic move there is. */
.pre-word {
  margin-top: 1.5rem;
  font-family: var(--font-wordmark);
  font-size: .8rem;
  color: var(--gold-100);
  letter-spacing: .05em;
  opacity: 0;
  animation: pre-track 1.6s var(--ease) .7s forwards;
}
@keyframes pre-track {
  from { opacity: 0; letter-spacing: .05em; }
  to   { opacity: 1; letter-spacing: .42em; }
}
/* Tracking adds space to the RIGHT of the last letter, which visually shoves the
   line off-centre. Pull half of it back so it stays truly centred. */
.pre-word { padding-left: .42em; }

.pre-rule {
  width: 0; height: 1px; margin-top: 1rem;
  background: linear-gradient(90deg, transparent, var(--gold-500), transparent);
  animation: pre-rule 1.2s var(--ease) 1.1s forwards;
}
@keyframes pre-rule { to { width: 190px; } }

.pre-tag {
  margin-top: .85rem;
  font-family: var(--font-serif);
  font-style: italic;
  font-size: .82rem;
  color: var(--text-muted-on-dark);
  opacity: 0;
  animation: pre-fade 1s var(--ease) 1.4s forwards;
}
@keyframes pre-fade { to { opacity: 1; } }

/* Reduced motion: show the finished frame immediately. The overture is a
   flourish, and a flourish is exactly what someone with vestibular sensitivity
   asked us not to perform. */
@media (prefers-reduced-motion: reduce) {
  .pre-ring-draw { stroke-dashoffset: 0; animation: none; }
  .preloader .emblem { opacity: 1; transform: none; animation: none; }
  .pre-word { opacity: 1; letter-spacing: .42em; animation: none; }
  .pre-rule { width: 190px; animation: none; }
  .pre-tag { opacity: 1; animation: none; }
}

/* ===== The gold ring (fine-pointer devices only) =====================
   Ring + dot. cursor.js drives both by transform; the ring lags, the dot never
   does. Sizing is fixed here and the ring is SCALED by JS — animating width /
   height would relayout on every frame, animating scale does not.

   No mix-blend-mode: over a page that runs from near-black indigo to warm ivory,
   difference-blending turns the gold to muddy cyan on the light chapters. A real
   gold ring, kept legible on both grounds by its own shadow, is worth more than
   a clever blend. */
.cursor-ring {
  position: fixed; top: 0; left: 0;
  width: 30px; height: 30px;
  border: 1.35px solid var(--gold-500);
  border-radius: 50%;
  pointer-events: none;
  z-index: var(--z-cursor);
  opacity: 0;
  will-change: transform;
  transition: opacity .3s var(--ease), background .35s var(--ease),
              border-color .35s var(--ease);
  box-shadow: 0 0 0 1px rgba(5,8,28,.10), 0 2px 10px -2px rgba(5,8,28,.25);
}
.cursor-dot {
  position: fixed; top: 0; left: 0;
  width: 4px; height: 4px;
  border-radius: 50%;
  background: var(--gold-300);
  pointer-events: none;
  z-index: var(--z-cursor);
  opacity: 0;
  will-change: transform;
  transition: opacity .3s var(--ease);
}
.cursor-ring.is-on, .cursor-dot.is-on { opacity: 1; }
.cursor-ring.is-hover {
  background: rgba(201,162,75,.10);
  border-color: var(--gold-300);
}
/* Press: the ring tightens under the click. The scale is JS-owned, so we cannot
   use transform here — the border does the work instead. */
.cursor-ring.is-down { border-width: 2.7px; background: rgba(201,162,75,.18); }

@media (hover: none), (pointer: coarse) { .cursor-ring, .cursor-dot { display: none; } }
@media (prefers-reduced-motion: reduce) { .cursor-ring, .cursor-dot { display: none; } }

/* ===== "See all markets" modal (opened from any market chip row) ====== */
.markets-modal {
  position: fixed; inset: 0; z-index: var(--z-overlay);
  display: grid; place-items: center;
  padding: var(--gutter);
  background: rgba(2,7,26,.72);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  opacity: 0; visibility: hidden;
  transition: opacity var(--dur) var(--ease), visibility var(--dur) var(--ease);
}
.markets-modal.is-open { opacity: 1; visibility: visible; }
.mm-panel {
  position: relative;
  width: min(560px, 100%);
  max-height: 80vh; overflow-y: auto;
  padding: clamp(1.5rem, 4vw, 2.5rem);
  background: linear-gradient(180deg, rgba(20,54,158,.55), rgba(4,16,49,.96));
  border: 1.35px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lift);
  transform: translateY(16px) scale(.98);
  transition: transform var(--dur-slow) var(--ease);
}
.markets-modal.is-open .mm-panel { transform: none; }
.mm-panel h3 { margin: var(--space-2) 0 var(--space-5); font-size: 1.9rem; font-weight: 300; }
.mm-close {
  position: absolute; top: .75rem; right: 1rem;
  font-size: 1.6rem; line-height: 1; color: var(--gold-300);
}
.mm-list {
  list-style: none; padding: 0; margin: 0;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: .5rem;
}
.mm-list li {
  display: flex; align-items: center; gap: .5rem;
  padding: .5rem .75rem;
  border: 1.35px solid var(--line-blue); border-radius: var(--radius-sm);
  font-size: var(--fs-small);
}
.mm-list .flag { font-size: 1.05rem; }


/* ===== The waterline (ART-VISION #18) ==================================
   A hairline gold river in the left margin: the track is barely there, the
   fill flows down as you read, a small lamp-lit dot rides the tip. The one
   progress indicator on the page; the conventional top bar is retired. */
.scroll-progress { display: none; }
.waterline {
  position: fixed; left: clamp(14px, 1.6vw, 26px); top: 96px; bottom: 28px;
  width: 1px; z-index: var(--z-header);
  background: rgba(200,162,74,.14);
  pointer-events: none;
}
.waterline-fill {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(200,162,74,.25), var(--gold-500));
  transform: scaleY(0); transform-origin: top;
}
.waterline-dot {
  position: absolute; left: 50%; top: 0;
  width: 5px; height: 5px; border-radius: 50%;
  transform: translate(-50%, -50%);
  background: var(--gold-300);
  box-shadow: 0 0 8px 2px rgba(200,162,74,.45);
}
@media (max-width: 1099px) { .waterline { display: none; } }
@media print { .waterline { display: none !important; } }