/* Finishing layer shared by every page: depth, motion and browser surfaces on top of
   the page templates. Colours, type and layout stay those of the templates; !important
   only where an inline template style has to yield. Loaded after responsive.css. */

:root {
  --athar-ease: cubic-bezier(.22, 1, .36, 1);
  /* Shadows are tinted from the bordo, never grey, so depth reads as part of the palette. */
  --athar-shadow-rest: 0 1px 2px rgba(54, 10, 18, 0.05), 0 10px 24px -16px rgba(54, 10, 18, 0.22);
  --athar-shadow-lift: 0 2px 6px rgba(54, 10, 18, 0.06), 0 26px 48px -22px rgba(54, 10, 18, 0.42);
}

/* ---- Browser surfaces ---------------------------------------------------- */

html {
  text-rendering: optimizeLegibility;
  font-kerning: normal;
  -webkit-text-size-adjust: 100%;
  scrollbar-color: #8d343d #eee8dd;
}
input, textarea { caret-color: #6d1423; }
main :is(h1, h2, h3) { text-wrap: balance; }
main p { text-wrap: pretty; }

/* Counts, ratings and percentages line up when they sit in a row. */
.athar-home-stats, .athar-collection-stats, .athar-about-stats,
.athar-product-facts dd, .athar-card-rating, .athar-performance-grid {
  font-variant-numeric: lining-nums tabular-nums;
}

/* ---- Header -------------------------------------------------------------- */

/* hidden made .athar-site a scroll container, which stopped the collection toolbar and
   the product section bar from sticking on desktop. clip crops the same overflow. */
.athar-site { overflow-x: clip !important; }

@media (min-width: 1024px) {
  /* Lets the header settle from 92px to its intended 70px once the page scrolls. */
  .athar-site > header > .athar-container { min-height: 0 !important; }
}

.athar-site > header {
  transition:
    background 0.5s var(--athar-ease), color 0.5s var(--athar-ease),
    border-color 0.5s var(--athar-ease), box-shadow 0.6s var(--athar-ease) !important;
}
html[data-athar-scrolled] .athar-site > header {
  box-shadow: 0 14px 34px -26px rgba(54, 10, 18, 0.55);
}

/* Menu links arrive one after another when the panel opens. */
#athar-menu nav a {
  transition: opacity 0.6s var(--athar-ease), transform 0.6s var(--athar-ease), color 0.3s var(--athar-ease);
}
#athar-menu[aria-hidden="true"] nav a { opacity: 0; transform: translateX(28px); }
#athar-menu[aria-hidden="false"] nav a:nth-child(1) { transition-delay: 0.12s; }
#athar-menu[aria-hidden="false"] nav a:nth-child(2) { transition-delay: 0.17s; }
#athar-menu[aria-hidden="false"] nav a:nth-child(3) { transition-delay: 0.22s; }
#athar-menu[aria-hidden="false"] nav a:nth-child(4) { transition-delay: 0.27s; }
html[dir="rtl"] #athar-menu[aria-hidden="true"] nav a { transform: translateX(-28px); }
/* The panel's small "Menu" label and closing line were faded below readable contrast. */
#athar-menu .athar-eyebrow { opacity: 0.66 !important; }

/* Rows start on the right in Arabic, so the back-to-top branch moves to the free side. */
html[dir="rtl"] .athar-scroll-controller {
  right: auto;
  left: calc(clamp(14px, 2.4vw, 34px) + env(safe-area-inset-left, 0px));
}
html[dir="rtl"] .athar-scroll-controller__branch { transform: scaleX(-1); }
@media (max-width: 767px) {
  html[dir="rtl"] .athar-scroll-controller { left: max(8px, env(safe-area-inset-left)); }
}

/* ---- Heroes -------------------------------------------------------------- */

/* A warm light behind the visual and a deeper corner give the flat bordo some depth. */
.athar-hero {
  background-image:
    radial-gradient(56% 64% at 76% 42%, rgba(197, 160, 89, 0.12), transparent 70%),
    radial-gradient(70% 80% at 0% 100%, rgba(38, 4, 11, 0.4), transparent 68%) !important;
}
html[dir="rtl"] .athar-hero {
  background-image:
    radial-gradient(56% 64% at 24% 42%, rgba(197, 160, 89, 0.12), transparent 70%),
    radial-gradient(70% 80% at 100% 100%, rgba(38, 4, 11, 0.4), transparent 68%) !important;
}
/* The SVG logo (athar-logo.js) takes the whole visual on phones, as the image did. */
@media (max-width: 767px) {
  .athar-home-visual > athar-logo { width: 85% !important; height: 100% !important; }
}
/* Once the home hero is a single column, the logo leads and the text follows. */
@media (max-width: 1023px) {
  .athar-home-visual { order: -1; }
}

/* The four counts follow each other instead of landing together. */
.athar-home-stats > div:nth-child(2), .athar-collection-stats > div:nth-child(2) { animation-delay: 0.08s !important; }
.athar-home-stats > div:nth-child(3), .athar-collection-stats > div:nth-child(3) { animation-delay: 0.16s !important; }
.athar-home-stats > div:nth-child(4), .athar-collection-stats > div:nth-child(4) { animation-delay: 0.24s !important; }

/* ---- Links and buttons --------------------------------------------------- */

/* Arrow glyphs lean toward where the link goes (tagged by enhancements.js). */
[data-athar-arrow] { display: inline-block; transition: transform 0.45s var(--athar-ease); }
@media (hover: hover) and (pointer: fine) {
  :is(a, button):hover > [data-athar-arrow="ne"] { transform: translate(3px, -3px); }
  :is(a, button):hover > [data-athar-arrow="e"] { transform: translateX(4px); }
  :is(a, button):hover > [data-athar-arrow="w"] { transform: translateX(-4px); }
  :is(a, button):hover > [data-athar-arrow="s"] { transform: translateY(3px); }
  :is(a, button):hover > [data-athar-arrow="n"] { transform: translateY(-3px); }
}

/* Bordered buttons (WhatsApp, filters, form submit) settle when pressed. */
main :is(button, a[data-athar-wa], [role="button"]) { -webkit-tap-highlight-color: transparent; }
main :is(button:not([disabled]), a[data-athar-wa]):active { transform: scale(0.98); }
a[data-athar-wa] { transition-property: background-size, color, transform, box-shadow !important; }
@media (hover: hover) and (pointer: fine) {
  a[data-athar-wa]:hover { box-shadow: 0 16px 30px -18px rgba(197, 160, 89, 0.55); }
}

/* ---- Scent characters (home) -------------------------------------------- */

.athar-accord-grid > a {
  box-shadow: 0 0 0 rgba(54, 10, 18, 0);
  transition:
    background 0.5s var(--athar-ease), box-shadow 0.6s var(--athar-ease),
    transform 0.6s var(--athar-ease) !important;
}
@media (hover: hover) and (pointer: fine) {
  .athar-accord-grid > a:hover { transform: translateY(-4px); box-shadow: var(--athar-shadow-lift); }
}

/* ---- Editorial images ---------------------------------------------------- */

/* Photographs drift closer while the pointer rests on their block. */
[data-screen-label="Day and Night"] .athar-content-gap > div > div:first-child img,
.athar-secondary-visual img {
  transition: transform 1.6s var(--athar-ease), filter 1.2s var(--athar-ease);
}
@media (hover: hover) and (pointer: fine) {
  [data-screen-label="Day and Night"] .athar-content-gap > div:hover > div:first-child img,
  .athar-secondary-visual:hover img { transform: scale(1.045); }
}

/* ---- Product page -------------------------------------------------------- */

@media (min-width: 1024px) {
  /* Four facts share a narrow column: the labels fit on one line and the values align. */
  .athar-product-facts > div { display: flex; flex-direction: column; }
  .athar-product-facts dt { font-size: 14px !important; letter-spacing: 0.16em !important; white-space: nowrap; }
  .athar-product-facts dd { margin-top: auto !important; padding-top: 9px; }
  html[dir="rtl"] .athar-product-facts dt { font-size: 18px !important; letter-spacing: normal !important; }
}
.athar-product-visual > [role="img"] { filter: drop-shadow(0 30px 36px rgba(30, 3, 9, 0.38)); }

/* ---- Lazy images (lazy-images.js) --------------------------------------- */

/* An image waits invisible while it downloads, then fades in. An animation rather
   than a transition, so the elements keep their own transitions (card zoom). */
@keyframes atharImageIn {
  from { opacity: 0; }
}
[data-athar-bg-state="loading"] { opacity: 0; }
[data-athar-bg-state="loaded"] { animation: atharImageIn 0.6s ease-out; }

/* ---- Scroll reveal (enhancements.js marks the elements) ----------------- */

@keyframes atharRevealUp {
  from { opacity: 0; transform: translateY(28px); filter: blur(6px); }
}
@keyframes atharRevealClip {
  from { clip-path: inset(0 0 100% 0); }
}
/* Waiting elements stay invisible only while the script is running the reveal. */
html.athar-motion [data-athar-reveal]:not([data-athar-in]) { opacity: 0; }
html.athar-motion [data-athar-reveal="up"][data-athar-in] {
  animation: atharRevealUp 0.95s var(--athar-ease) calc(var(--athar-i, 0) * 80ms) backwards !important;
}
html.athar-motion [data-athar-reveal="clip"][data-athar-in] {
  animation: atharRevealClip 1.15s var(--athar-ease) calc(var(--athar-i, 0) * 80ms) backwards !important;
}

@media (prefers-reduced-motion: reduce) {
  #athar-menu nav a, [data-athar-arrow], .athar-accord-grid > a,
  [data-screen-label="Day and Night"] img, .athar-secondary-visual img { transition: none !important; }
  #athar-menu[aria-hidden="true"] nav a { transform: none; }
  .athar-accord-grid > a:hover { transform: none; }
}

@media print {
  html.athar-motion [data-athar-reveal] { opacity: 1 !important; animation: none !important; }
}
