/* Maison d'Mist — site stylesheet
   One stylesheet serves English (LTR) and Arabic (RTL): every directional rule
   uses logical properties (inline-start/end) so nothing needs mirroring by hand.
   Palette is sampled from the logo artwork. */

:root {
  /* Brand */
  --cream:      #fefdf9;
  --cream-warm: #f6f3e8;
  --cream-deep: #efebdc;
  --olive:      #656430;
  --olive-deep: #41411c;
  --olive-soft: #7c7b44;
  --sage:       #8f8d60;
  --sage-pale:  #c3c1a3;
  --ink:        #33321f;
  --muted:      #6e6c55;
  --line:       #ddd9c6;

  /* Type */
  --display: "Cormorant Garamond", "Times New Roman", serif;
  --body: "Jost", "Segoe UI", system-ui, -apple-system, sans-serif;
  --tracking: 0.18em;

  /* Space */
  --gutter: clamp(1.25rem, 5vw, 4rem);
  --section: clamp(4rem, 9vw, 7.5rem);
  --maxw: 1180px;

  --radius: 2px;
  --shadow: 0 1px 2px rgba(65, 65, 28, .04), 0 12px 32px rgba(65, 65, 28, .07);
  --ease: cubic-bezier(.22, .61, .36, 1);

  color-scheme: light;
}

html[lang="ar"] {
  --display: "Amiri", "Cormorant Garamond", serif;
  --body: "Tajawal", "Segoe UI", system-ui, sans-serif;
  --tracking: 0;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--body);
  font-weight: 300;
  font-size: clamp(1rem, .96rem + .2vw, 1.075rem);
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

h1, h2, h3, h4 {
  font-family: var(--display);
  font-weight: 400;
  line-height: 1.12;
  color: var(--olive-deep);
  margin: 0;
  letter-spacing: .005em;
}
html[lang="ar"] h1, html[lang="ar"] h2, html[lang="ar"] h3 { line-height: 1.4; }

p { margin: 0 0 1.1em; }
img { max-width: 100%; height: auto; display: block; }

a { color: var(--olive); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--olive-deep); }

:focus-visible {
  outline: 2px solid var(--olive);
  outline-offset: 3px;
  border-radius: var(--radius);
}

.skip {
  position: absolute; inset-inline-start: 1rem; top: -4rem; z-index: 999;
  background: var(--olive); color: var(--cream);
  padding: .7rem 1.2rem; border-radius: var(--radius);
  transition: top .2s var(--ease);
}
.skip:focus { top: 1rem; color: var(--cream); }

.wrap { width: min(100% - (var(--gutter) * 2), var(--maxw)); margin-inline: auto; }

/* ---------- Shared bits ---------- */

.eyebrow {
  font-size: .72rem;
  letter-spacing: var(--tracking);
  text-transform: uppercase;
  color: var(--sage);
  margin: 0 0 1.1rem;
  font-weight: 400;
}
html[lang="ar"] .eyebrow { text-transform: none; font-size: .85rem; }

.rule {
  display: flex; align-items: center; gap: 1rem;
  color: var(--sage-pale); font-size: .75rem; line-height: 1;
}
.rule::before, .rule::after {
  content: ""; height: 1px; background: currentColor; flex: 1;
}

.btn {
  display: inline-flex; align-items: center; gap: .6rem;
  font-family: var(--body);
  font-size: .8rem; font-weight: 400;
  letter-spacing: var(--tracking); text-transform: uppercase;
  padding: .95rem 1.9rem;
  border: 1px solid var(--olive);
  border-radius: var(--radius);
  background: var(--olive); color: var(--cream);
  text-decoration: none; cursor: pointer;
  transition: background .25s var(--ease), color .25s var(--ease), transform .25s var(--ease);
}
.btn:hover { background: var(--olive-deep); border-color: var(--olive-deep); color: var(--cream); transform: translateY(-2px); }
.btn--ghost { background: transparent; color: var(--olive); }
.btn--ghost:hover { background: var(--olive); color: var(--cream); }
.btn--sm { padding: .7rem 1.3rem; font-size: .72rem; }
html[lang="ar"] .btn { text-transform: none; font-size: .95rem; letter-spacing: 0; }

.btn svg { width: 1.05em; height: 1.05em; fill: currentColor; flex: none; }

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

.site-header {
  position: sticky; top: 0; z-index: 50;
  border-block-end: 1px solid transparent;
  transition: border-color .3s var(--ease);
}
/* The frosted backdrop sits on a pseudo-element: a backdrop-filter on the header
   itself would make it the containing block for the fixed mobile menu. */
.site-header::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: rgba(254, 253, 249, .92);
  background: color-mix(in srgb, var(--cream) 88%, transparent);
  -webkit-backdrop-filter: saturate(140%) blur(10px);
  backdrop-filter: saturate(140%) blur(10px);
  transition: background .3s var(--ease);
}
.site-header.is-stuck { border-block-end-color: var(--line); }
.site-header.is-stuck::before { background: color-mix(in srgb, var(--cream) 96%, transparent); }

.site-header__inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; padding-block: .85rem;
}

.brand { display: inline-flex; align-items: center; flex: none; }
.brand img { height: clamp(30px, 4.6vw, 42px); width: auto; }

.nav { display: flex; align-items: center; gap: clamp(1rem, 2.4vw, 2.1rem); }
.nav a {
  font-size: .76rem; letter-spacing: var(--tracking); text-transform: uppercase;
  color: var(--muted); text-decoration: none; white-space: nowrap;
  position: relative; padding-block: .3rem;
}
html[lang="ar"] .nav a { text-transform: none; font-size: .95rem; letter-spacing: 0; }
.nav a::after {
  content: ""; position: absolute; inset-inline: 0; bottom: 0; height: 1px;
  background: var(--olive); transform: scaleX(0); transform-origin: inline-start;
  transition: transform .3s var(--ease);
}
.nav a:hover { color: var(--olive-deep); }
.nav a:hover::after, .nav a[aria-current="true"]::after { transform: scaleX(1); }

.lang {
  font-size: .74rem; letter-spacing: .1em; text-decoration: none;
  color: var(--olive); border: 1px solid var(--line);
  padding: .4rem .75rem; border-radius: var(--radius); white-space: nowrap;
  transition: border-color .25s var(--ease), background .25s var(--ease);
}
.lang:hover { border-color: var(--olive); background: var(--cream-warm); }

.nav-toggle {
  display: none; background: none; border: 0; cursor: pointer;
  padding: .55rem; color: var(--olive-deep);
}
.nav-toggle svg { width: 24px; height: 24px; stroke: currentColor; fill: none; stroke-width: 1.4; }

@media (max-width: 860px) {
  .nav-toggle { display: inline-flex; }
  .nav {
    position: fixed; inset: 0; z-index: 60;
    flex-direction: column; justify-content: center; gap: 1.6rem;
    background: var(--cream);
    transform: translateY(-100%);
    visibility: hidden;
    transition: transform .4s var(--ease), visibility 0s linear .4s;
  }
  .nav[data-open="true"] { transform: translateY(0); visibility: visible; transition: transform .4s var(--ease), visibility 0s; }
  .nav a { font-size: 1.05rem; }
  html[lang="ar"] .nav a { font-size: 1.2rem; }
  .nav__close { position: absolute; top: 1rem; inset-inline-end: 1.2rem; }
}

/* ---------- Hero ---------- */

.hero {
  position: relative; overflow: hidden;
  padding-block: clamp(3.5rem, 11vw, 8rem) clamp(3rem, 8vw, 6rem);
  text-align: center;
  background: linear-gradient(180deg, var(--cream) 0%, var(--cream-warm) 100%);
}
.hero::before, .hero::after {
  content: ""; position: absolute; border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle, rgba(143,141,96,.16) 0%, rgba(143,141,96,0) 70%);
  animation: drift 22s ease-in-out infinite alternate;
}
.hero::before { width: 46vw; height: 46vw; inset-block-start: -12vw; inset-inline-start: -10vw; }
.hero::after  { width: 38vw; height: 38vw; inset-block-end: -14vw; inset-inline-end: -8vw; animation-delay: -11s; }

@keyframes drift {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to   { transform: translate3d(2.5vw, 3vw, 0) scale(1.12); }
}

.hero__title { margin: 0; }
.hero__logo { width: min(640px, 82%); margin-inline: auto; }
.hero__tagline {
  font-family: var(--display); font-style: italic;
  font-size: clamp(1.35rem, 1rem + 1.7vw, 2.1rem);
  color: var(--olive); margin: 1.6rem 0 0;
}
html[lang="ar"] .hero__tagline { font-style: normal; }
.hero__lead {
  max-width: 44ch; margin: 1.4rem auto 2.4rem;
  color: var(--muted); font-size: 1.05rem;
}
.hero__cta { display: flex; flex-wrap: wrap; gap: .9rem; justify-content: center; }

/* ---------- Values strip ---------- */

.strip {
  background: var(--olive); color: var(--cream-warm);
  padding-block: 1.3rem;
}
.strip__inner {
  display: flex; flex-wrap: wrap; justify-content: center;
  gap: .6rem clamp(1.5rem, 5vw, 4rem);
  font-size: .75rem; letter-spacing: var(--tracking); text-transform: uppercase;
}
html[lang="ar"] .strip__inner { text-transform: none; font-size: .95rem; letter-spacing: 0; }
.strip__inner span { display: inline-flex; align-items: center; gap: .7rem; }
.strip__inner span::before { content: "✦"; color: var(--sage-pale); font-size: .7em; }

/* ---------- Sections ---------- */

.section { padding-block: var(--section); }
.section--warm { background: var(--cream-warm); }
.section__head { text-align: center; max-width: 54ch; margin-inline: auto; margin-block-end: clamp(2.5rem, 5vw, 4rem); }
.section__head h2 { font-size: clamp(2rem, 1.3rem + 2.6vw, 3.1rem); }
.section__head p { color: var(--muted); margin-block-start: 1rem; }

/* ---------- Products ---------- */

/* Equal cards in centred rows: 1 across on phones, 2 on tablets, 3 on larger
   screens. A short last row (or a two-product collection) sits in the middle at
   the same card size as the rows above it. */
.grid {
  --cols: 1; --gap: clamp(1.5rem, 3vw, 2.4rem);
  display: flex; flex-wrap: wrap; justify-content: center; gap: var(--gap);
}
.grid > .card { flex: 0 0 calc((100% - (var(--cols) - 1) * var(--gap)) / var(--cols)); max-width: 380px; }
.grid > .empty-note { flex: 1 1 100%; }
@media (min-width: 600px) { .grid { --cols: 2; } }
@media (min-width: 960px) { .grid { --cols: 3; } }

.card {
  background: var(--cream);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  display: flex; flex-direction: column;
  overflow: hidden;
  transition: transform .35s var(--ease), box-shadow .35s var(--ease), border-color .35s var(--ease);
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: var(--sage-pale); }

.card__media {
  position: relative; aspect-ratio: 4 / 5;
  background: var(--cream-deep);
  display: grid; place-items: center; overflow: hidden;
}
.card__media img { width: 100%; height: 100%; object-fit: cover; }
.card__media svg { width: 42%; opacity: .5; }

.badge {
  position: absolute; inset-block-start: .85rem; inset-inline-start: .85rem;
  background: var(--cream); color: var(--olive);
  border: 1px solid var(--sage-pale);
  font-size: .62rem; letter-spacing: .14em; text-transform: uppercase;
  padding: .3rem .65rem; border-radius: var(--radius);
}
html[lang="ar"] .badge { text-transform: none; font-size: .78rem; letter-spacing: 0; }
.badge--muted { color: var(--muted); }

.card__body { padding: 1.4rem 1.4rem 1.6rem; display: flex; flex-direction: column; flex: 1; gap: .55rem; }
.card__name { font-size: 1.5rem; }
.card__notes { font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; color: var(--sage); }
html[lang="ar"] .card__notes { text-transform: none; font-size: .9rem; letter-spacing: 0; }
.card__desc { color: var(--muted); font-size: .95rem; margin: 0; }
.card__meta {
  margin-block-start: auto; padding-block-start: 1rem;
  display: flex; align-items: baseline; justify-content: space-between; gap: .75rem;
  border-block-start: 1px solid var(--line);
}
.card__price { font-family: var(--display); font-size: 1.25rem; color: var(--olive-deep); }
.card__size { font-size: .78rem; color: var(--muted); letter-spacing: .06em; }
/* "100 ml" or "45,000 SYP" inside an Arabic page would otherwise read "ml 100":
   each value takes its direction from its own first letter. */
.card__price, .card__size { unicode-bidi: plaintext; }
.card__action { margin-block-start: 1rem; }
.card__action .btn { width: 100%; justify-content: center; }

.empty-note {
  grid-column: 1 / -1; text-align: center; color: var(--muted);
  border: 1px dashed var(--line); border-radius: var(--radius);
  padding: clamp(2rem, 6vw, 3.5rem);
}

/* ---------- Ritual steps ---------- */

.steps { display: grid; gap: clamp(1.8rem, 4vw, 3rem); grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); }
.step { text-align: center; }
.step__n {
  font-family: var(--display); font-size: 2.6rem; color: var(--sage-pale);
  display: block; line-height: 1; margin-block-end: .7rem;
}
.step h3 { font-size: 1.35rem; margin-block-end: .5rem; }
.step p { color: var(--muted); font-size: .96rem; margin: 0; }

/* ---------- Story ---------- */

.story { display: grid; gap: clamp(2rem, 5vw, 4rem); align-items: center; grid-template-columns: 1fr; }
@media (min-width: 900px) { .story { grid-template-columns: 1fr 1fr; } }
.story__art {
  background: var(--cream-warm); border: 1px solid var(--line);
  border-radius: var(--radius); padding: clamp(2rem, 5vw, 3.5rem);
  display: grid; place-items: center;
}
.story__art img { width: min(420px, 100%); }
.story h2 { font-size: clamp(1.9rem, 1.3rem + 2.2vw, 2.8rem); margin-block-end: 1.2rem; }
.story p { color: var(--muted); }

/* ---------- Contact ---------- */

.contact { display: grid; gap: clamp(1.5rem, 3vw, 2.5rem); grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr)); }
.contact__item {
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.8rem 1.5rem; text-align: center; background: var(--cream);
}
.contact__item h3 { font-size: 1.25rem; margin-block-end: .45rem; }
.contact__item p { color: var(--muted); font-size: .95rem; margin-block-end: 1.1rem; }
.contact__item a.value { font-size: 1.02rem; word-break: break-word; }

.socials { display: flex; flex-wrap: wrap; gap: .75rem; justify-content: center; margin-block-start: 1.4rem; }
.socials a {
  display: inline-grid; place-items: center;
  width: 44px; height: 44px; border-radius: 50%;
  border: 1px solid var(--line); color: var(--olive);
  transition: background .25s var(--ease), color .25s var(--ease), border-color .25s var(--ease), transform .25s var(--ease);
}
.socials a:hover { background: var(--olive); color: var(--cream); border-color: var(--olive); transform: translateY(-2px); }
.socials svg { width: 19px; height: 19px; fill: currentColor; }

.notice {
  text-align: center; color: var(--muted);
  border: 1px dashed var(--line); border-radius: var(--radius);
  padding: 1.6rem; margin-block-start: 1.5rem; font-size: .95rem;
}

/* ---------- Footer ---------- */

.site-footer {
  background: var(--olive-deep); color: var(--cream-warm);
  padding-block: clamp(3rem, 6vw, 4.5rem) 2rem; text-align: center;
}
.site-footer img { width: min(300px, 70%); margin-inline: auto; opacity: .96; }
.site-footer a { color: var(--cream-warm); }
.site-footer .socials a { border-color: rgba(246,243,232,.3); color: var(--cream-warm); }
.site-footer .socials a:hover { background: var(--cream-warm); color: var(--olive-deep); border-color: var(--cream-warm); }
.footer__nav {
  display: flex; flex-wrap: wrap; gap: .6rem 2rem; justify-content: center;
  margin-block: 2rem 1.6rem; font-size: .76rem; letter-spacing: var(--tracking); text-transform: uppercase;
}
html[lang="ar"] .footer__nav { text-transform: none; font-size: .95rem; letter-spacing: 0; }
.footer__nav a { text-decoration: none; opacity: .82; }
.footer__nav a:hover { opacity: 1; }
.footer__fine {
  border-block-start: 1px solid rgba(246,243,232,.18);
  margin-block-start: 2.2rem; padding-block-start: 1.6rem;
  font-size: .8rem;
  display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; justify-content: center;
}
.footer__fine > :not(.footer__version) { opacity: .72; }

/* ---------- Reveal on scroll ----------
   Content is hidden only once site.js has started (it sets .js-reveal), so if
   the script never runs the page is still fully readable. */

.js-reveal .reveal { opacity: 0; transform: translateY(18px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.js-reveal .reveal.is-in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  .js-reveal .reveal { opacity: 1; transform: none; transition: none; }
  .hero::before, .hero::after { animation: none; }
  .btn:hover, .card:hover, .socials a:hover { transform: none; }
  * { scroll-behavior: auto !important; }
}

@media print {
  .site-header, .hero::before, .hero::after, .nav-toggle { display: none; }
  body { background: #fff; }
}

/* Footer logo: the artwork is olive on cream, so it is knocked out to the
   footer's cream tone rather than shipped as a second colour file. */
.site-footer__logo { filter: brightness(0) invert(1); opacity: .92; }

[data-product-video] { cursor: pointer; }
