/* =========================================================
   MAISON BENIKHLEF — DESIGN SYSTEM
   Editorial, architectural, warm. Tokens first, then base.
   ========================================================= */

:root {
  /* --- Neutrals — warm ivory base --------------------- */
  --ivory-100: #FBF8F2;
  --ivory-200: #F5F0E6;
  --ivory-300: #ECE4D3;
  --stone-400: #C9BFA9;
  --stone-500: #8A8271;
  --stone-600: #5D574A;
  --charcoal-700: #2E2A25;
  --charcoal-800: #1E1B18;
  --charcoal-900: #14110F;

  /* --- Brand accents — sophisticated, restrained ------ */
  --purple-signature: #4A2456;   /* deep, editorial — from logo, muted */
  --purple-deep: #331935;
  --gold-warm: #B08A5C;           /* warm, muted — never bling */
  --gold-soft: #C9A87A;

  /* --- Semantic ---------------------------------------- */
  --bg: var(--ivory-100);
  --bg-soft: var(--ivory-200);
  --bg-alt: var(--ivory-300);
  --bg-inverse: var(--charcoal-900);
  --fg: var(--charcoal-800);
  --fg-muted: var(--stone-600);
  --fg-inverse: var(--ivory-100);
  --accent: var(--purple-signature);
  --accent-soft: var(--gold-warm);
  --line: rgba(30, 27, 24, 0.08);
  --line-strong: rgba(30, 27, 24, 0.16);

  /* --- Typography -------------------------------------- */
  --font-display: "Cormorant Garamond", "Playfair Display", Georgia, serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;

  --fs-eyebrow: 0.72rem;
  --fs-body-sm: 0.875rem;
  --fs-body: 1rem;
  --fs-body-lg: 1.125rem;
  --fs-lede: clamp(1.125rem, 1.6vw, 1.375rem);
  --fs-h4: clamp(1.25rem, 2vw, 1.5rem);
  --fs-h3: clamp(1.5rem, 2.8vw, 2.125rem);
  --fs-h2: clamp(2rem, 4.2vw, 3.5rem);
  --fs-h1: clamp(2.5rem, 6.5vw, 5.5rem);
  --fs-display: clamp(3rem, 9vw, 8rem);

  --lh-tight: 1.05;
  --lh-snug: 1.2;
  --lh-normal: 1.55;
  --lh-relaxed: 1.7;

  --ls-eyebrow: 0.24em;
  --ls-heading: -0.015em;
  --ls-display: -0.03em;

  /* --- Layout ------------------------------------------ */
  --container: min(1440px, 100% - 3rem);
  --container-narrow: min(1080px, 100% - 3rem);
  --container-wide: min(1720px, 100% - 3rem);
  --gutter: clamp(1.5rem, 3vw, 3rem);

  /* --- Spacing scale ----------------------------------- */
  --sp-1: 0.25rem;
  --sp-2: 0.5rem;
  --sp-3: 0.75rem;
  --sp-4: 1rem;
  --sp-5: 1.5rem;
  --sp-6: 2rem;
  --sp-7: 3rem;
  --sp-8: 4rem;
  --sp-9: 6rem;
  --sp-10: 8rem;
  --sp-11: 10rem;

  --section-py: clamp(4rem, 9vw, 8rem);

  /* --- Radii ------------------------------------------- */
  --radius-sm: 2px;
  --radius: 4px;
  --radius-lg: 12px;
  --radius-full: 999px;

  /* --- Motion ------------------------------------------ */
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --ease-natural: cubic-bezier(0.32, 0.72, 0, 1);
  --dur-quick: 240ms;
  --dur-base: 480ms;
  --dur-slow: 900ms;
  --dur-scene: 1400ms;

  /* --- Elevation --------------------------------------- */
  --shadow-soft: 0 2px 30px rgba(20, 17, 15, 0.06);
  --shadow-lifted: 0 30px 80px -30px rgba(20, 17, 15, 0.35);
}

/* Style variants — scoped compound selectors so the tokens
   win over any .style-explorer fallback (higher specificity). */

.style-explorer[data-style="modern"],
[data-style="modern"] {
  --style-bg: #F4EFE7;
  --style-bg-alt: #E6DFD1;
  --style-fg: #1E1B18;
  --style-fg-muted: #5D574A;
  --style-accent: #4A2456;
  --style-tint: rgba(74, 36, 86, 0.06);
}
.style-explorer[data-style="rustic"],
[data-style="rustic"] {
  --style-bg: #EEE4D0;
  --style-bg-alt: #DCCFB4;
  --style-fg: #3B2E20;
  --style-fg-muted: #6B5A44;
  --style-accent: #7A4B1F;
  --style-tint: rgba(122, 75, 31, 0.08);
}
.style-explorer[data-style="minimal"],
[data-style="minimal"] {
  --style-bg: #FAF7F0;
  --style-bg-alt: #F0EAE0;
  --style-fg: #2A2622;
  --style-fg-muted: #7A736A;
  --style-accent: #8A8271;
  --style-tint: rgba(138, 130, 113, 0.05);
}
.style-explorer[data-style="luxury"],
[data-style="luxury"] {
  --style-bg: #2A2320;
  --style-bg-alt: #1C1614;
  --style-fg: #F0E6D3;
  --style-fg-muted: #A89B84;
  --style-accent: #B08A5C;
  --style-tint: rgba(176, 138, 92, 0.12);
}

/* =========================================================
   RESET & BASE
   ========================================================= */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  hanging-punctuation: first last;
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: var(--lh-normal);
  color: var(--fg);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img,
picture,
video,
svg {
  display: block;
  max-width: 100%;
  height: auto;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

h1, h2, h3, h4 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 400;
  line-height: var(--lh-tight);
  letter-spacing: var(--ls-heading);
}

p { margin: 0 0 1em; }

::selection {
  background: var(--purple-signature);
  color: var(--ivory-100);
}

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

/* =========================================================
   LAYOUT PRIMITIVES
   ========================================================= */
.container { width: var(--container); margin-inline: auto; }
.container-narrow { width: var(--container-narrow); margin-inline: auto; }
.container-wide { width: var(--container-wide); margin-inline: auto; }

section { padding-block: var(--section-py); position: relative; }

.grid { display: grid; gap: var(--sp-6); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 900px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: var(--sp-2); }
.gap-4 { gap: var(--sp-4); }
.gap-6 { gap: var(--sp-6); }

/* =========================================================
   TYPOGRAPHY UTILITIES
   ========================================================= */
.eyebrow {
  font-family: var(--font-body);
  font-size: var(--fs-eyebrow);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: var(--ls-eyebrow);
  color: var(--accent-soft);
  display: inline-flex;
  align-items: center;
  gap: 0.75em;
}
.eyebrow::before {
  content: "";
  width: 2rem;
  height: 1px;
  background: currentColor;
  display: inline-block;
}

.display {
  font-family: var(--font-display);
  font-size: var(--fs-display);
  font-style: italic;
  font-weight: 300;
  line-height: 0.95;
  letter-spacing: var(--ls-display);
}

.h1 { font-size: var(--fs-h1); }
.h2 { font-size: var(--fs-h2); }
.h3 { font-size: var(--fs-h3); }
.h4 { font-size: var(--fs-h4); }
.lede { font-size: var(--fs-lede); line-height: var(--lh-normal); color: var(--fg-muted); max-width: 60ch; }

.serif-italic { font-family: var(--font-display); font-style: italic; font-weight: 400; }

/* =========================================================
   BUTTONS
   ========================================================= */
.btn {
  --btn-fg: var(--fg-inverse);
  --btn-bg: var(--charcoal-900);
  --btn-border: var(--charcoal-900);

  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1.1rem 2rem;
  font-family: var(--font-body);
  font-size: var(--fs-body-sm);
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  background: var(--btn-bg);
  color: var(--btn-fg);
  border: 1px solid var(--btn-border);
  border-radius: var(--radius-full);
  cursor: pointer;
  transition:
    background var(--dur-quick) var(--ease-out),
    color var(--dur-quick) var(--ease-out),
    transform var(--dur-quick) var(--ease-out);
  position: relative;
  overflow: hidden;
}

.btn::after {
  content: "→";
  transition: transform var(--dur-quick) var(--ease-out);
  display: inline-block;
}
.btn:hover::after { transform: translateX(4px); }
.btn:hover { transform: translateY(-1px); }

.btn-ghost {
  --btn-fg: var(--fg);
  --btn-bg: transparent;
  --btn-border: var(--line-strong);
}
.btn-ghost:hover {
  --btn-fg: var(--fg-inverse);
  --btn-bg: var(--charcoal-900);
  --btn-border: var(--charcoal-900);
}

.btn-invert {
  --btn-fg: var(--charcoal-900);
  --btn-bg: var(--ivory-100);
  --btn-border: var(--ivory-100);
}

.link-underline {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: var(--fs-body-sm);
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding-bottom: 4px;
  border-bottom: 1px solid currentColor;
  transition: opacity var(--dur-quick) var(--ease-out);
}
.link-underline:hover { opacity: 0.6; }

/* =========================================================
   MOTION — reveal on scroll
   ========================================================= */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition:
    opacity var(--dur-slow) var(--ease-natural),
    transform var(--dur-slow) var(--ease-natural);
  will-change: opacity, transform;
}
.reveal.in-view {
  opacity: 1;
  transform: none;
}
.reveal.delay-1 { transition-delay: 80ms; }
.reveal.delay-2 { transition-delay: 160ms; }
.reveal.delay-3 { transition-delay: 240ms; }
.reveal.delay-4 { transition-delay: 320ms; }

.mask-reveal {
  overflow: hidden;
  display: block;
}
.mask-reveal > * {
  display: block;
  transform: translateY(110%);
  transition: transform 1s var(--ease-natural);
}
.mask-reveal.in-view > * {
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .reveal { opacity: 1; transform: none; }
  .mask-reveal > * { transform: none; }
}
