/* ==========================================================================
   Aisha Rizvi Artistry — base.css
   Design tokens, reset, theming (light/dark), typography, utilities.
   Loaded first on every page.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Design tokens
   -------------------------------------------------------------------------- */
:root {
  /* Type families */
  --font-display: "Cormorant Garamond", "Iowan Old Style", Georgia, "Times New Roman", serif;
  --font-body: "Jost", "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, Helvetica, Arial, sans-serif;

  /* Fluid type scale (min 360px → max 1600px viewport) */
  --fs-eyebrow: clamp(0.66rem, 0.6rem + 0.22vw, 0.76rem);
  --fs-xs: clamp(0.78rem, 0.75rem + 0.14vw, 0.86rem);
  --fs-sm: clamp(0.88rem, 0.85rem + 0.17vw, 0.98rem);
  --fs-base: clamp(1rem, 0.96rem + 0.2vw, 1.1rem);
  --fs-lg: clamp(1.12rem, 1.03rem + 0.38vw, 1.36rem);
  --fs-xl: clamp(1.4rem, 1.2rem + 0.85vw, 2rem);
  --fs-h3: clamp(1.75rem, 1.4rem + 1.5vw, 2.5rem);
  --fs-h2: clamp(2.4rem, 1.6rem + 3.2vw, 4rem);
  --fs-h1: clamp(2.9rem, 1.8rem + 5.2vw, 5.4rem);
  --fs-display: clamp(3.4rem, 1.6rem + 8.4vw, 7.6rem);

  /* 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: 2.75rem;
  --sp-8: 4rem;
  --sp-9: 6rem;
  --sp-10: 8rem;

  /* Section rhythm */
  --section-y: clamp(4.5rem, 2.5rem + 8vw, 10rem);
  --gutter: clamp(1.15rem, 0.5rem + 2.8vw, 3.5rem);
  --maxw: 1440px;
  --maxw-narrow: 780px;

  /* Radii */
  --r-xs: 4px;
  --r-sm: 8px;
  --r-md: 16px;
  --r-lg: 28px;
  --r-pill: 999px;
  --r-arch: 50% 50% 8px 8px / 34% 34% 8px 8px;

  /* Motion */
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --ease-lux: cubic-bezier(0.16, 1, 0.3, 1);
  --dur-1: 0.18s;
  --dur-2: 0.4s;
  --dur-3: 0.75s;
  --dur-4: 1.2s;

  /* Layering */
  --z-base: 1;
  --z-sticky: 60;
  --z-header: 80;
  --z-drawer: 90;
  --z-modal: 100;
  --z-cursor: 105;
  --z-toast: 110;
  --z-loader: 120;

  color-scheme: light;
}

/* ---- Light palette (default) ---- */
:root {
  --bg: #f8f4ec;
  --bg-alt: #efe5d5;
  --bg-deep: #140e12;
  --surface: #fffdf9;
  --surface-2: #f4ecdd;
  --surface-sunk: #ece1cf;

  --ink: #1c1418;
  --ink-soft: #4e4249;
  --ink-mute: #8a7b84;
  --ink-onDeep: #f7efe6;

  --gold: #8f631d;
  --gold-bright: #c9a24e;
  --gold-lite: #e8d4a8;
  --gold-soft: #e6d3a8;
  --on-gold: #ffffff;
  --rose: #8e2f47;
  --rose-soft: #d9a3ae;
  --plum: #3d2431;

  --grad-gold: linear-gradient(100deg, #c9a24e 0%, #8f631d 38%, #b08737 62%, #d9b46c 100%);

  --line: rgba(28, 20, 24, 0.13);
  --line-strong: rgba(28, 20, 24, 0.26);
  --line-gold: rgba(143, 99, 29, 0.3);

  --shadow-sm: 0 1px 2px rgba(45, 30, 38, 0.05), 0 4px 14px rgba(45, 30, 38, 0.05);
  --shadow-md: 0 14px 40px -16px rgba(45, 30, 38, 0.28);
  --shadow-lg: 0 40px 90px -38px rgba(45, 30, 38, 0.42);
  --shadow-xl: 0 60px 130px -50px rgba(45, 30, 38, 0.5);

  --overlay: rgba(20, 14, 18, 0.6);
  --glass: rgba(248, 244, 236, 0.93);
}

/* ---- Dark palette ---- */
:root[data-theme="dark"] {
  color-scheme: dark;

  --bg: #0c0810;
  --bg-alt: #130d15;
  --bg-deep: #070409;
  --surface: #17111a;
  --surface-2: #1f1723;
  --surface-sunk: #110c14;

  --ink: #f6efe6;
  --ink-soft: #c7b7be;
  --ink-mute: #95848d;
  --ink-onDeep: #f7efe6;

  --gold: #e2bd66;
  --gold-bright: #f2d79b;
  --gold-lite: #6d5628;
  --gold-soft: #6b5424;
  --on-gold: #1c1216;
  --rose: #e693a7;
  --rose-soft: #7c3a4c;
  --plum: #e9d9e0;

  --grad-gold: linear-gradient(100deg, #f3d99b 0%, #d9b05c 38%, #f0d193 68%, #c9a24e 100%);

  --line: rgba(246, 239, 230, 0.12);
  --line-strong: rgba(246, 239, 230, 0.26);
  --line-gold: rgba(226, 189, 102, 0.3);

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.5), 0 4px 16px rgba(0, 0, 0, 0.35);
  --shadow-md: 0 16px 40px -16px rgba(0, 0, 0, 0.8);
  --shadow-lg: 0 40px 90px -38px rgba(0, 0, 0, 0.95);
  --shadow-xl: 0 60px 130px -50px rgba(0, 0, 0, 1);

  --overlay: rgba(4, 2, 5, 0.72);
  --glass: rgba(12, 8, 16, 0.92);
}

/* System preference honoured when the visitor has not chosen a theme. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;

    --bg: #0c0810;
    --bg-alt: #130d15;
    --bg-deep: #070409;
    --surface: #17111a;
    --surface-2: #1f1723;
    --surface-sunk: #110c14;

    --ink: #f6efe6;
    --ink-soft: #c7b7be;
    --ink-mute: #95848d;

    --gold: #e2bd66;
    --gold-bright: #f2d79b;
    --gold-lite: #6d5628;
    --gold-soft: #6b5424;
    --on-gold: #1c1216;
    --rose: #e693a7;
    --rose-soft: #7c3a4c;
    --plum: #e9d9e0;

    --grad-gold: linear-gradient(100deg, #f3d99b 0%, #d9b05c 38%, #f0d193 68%, #c9a24e 100%);

    --line: rgba(246, 239, 230, 0.12);
    --line-strong: rgba(246, 239, 230, 0.26);
    --line-gold: rgba(226, 189, 102, 0.3);

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.5), 0 4px 16px rgba(0, 0, 0, 0.35);
    --shadow-md: 0 16px 40px -16px rgba(0, 0, 0, 0.8);
    --shadow-lg: 0 40px 90px -38px rgba(0, 0, 0, 0.95);
    --shadow-xl: 0 60px 130px -50px rgba(0, 0, 0, 1);

    --overlay: rgba(4, 2, 5, 0.72);
    --glass: rgba(12, 8, 16, 0.92);
  }
}

/* --------------------------------------------------------------------------
   2. Reset
   -------------------------------------------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

* {
  margin: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--topbar-h, 7rem) + 1.5rem);
}

body {
  min-height: 100vh;
  background-color: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--fs-base);
  font-weight: 300;
  line-height: 1.68;
  letter-spacing: 0.004em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  /* `hidden` turns the body into a scroll container and silently breaks every
     `position: sticky` inside it; `clip` prevents the sideways scroll without
     that side effect. The first line is the fallback for older engines. */
  overflow-x: hidden;
  overflow-x: clip;
  transition: background-color var(--dur-2) var(--ease-out), color var(--dur-2) var(--ease-out);
}

/* The header/footer mounts must not form a box of their own — a sticky child
   can only travel inside its parent, and these wrappers are exactly as tall as
   their contents. `display: contents` hands the children straight to <body>. */
#site-header,
#site-footer {
  display: contents;
}

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

img {
  height: auto;
}

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

button {
  background: none;
  border: 0;
  cursor: pointer;
}

ul,
ol {
  list-style: none;
  padding: 0;
}

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

table {
  border-collapse: collapse;
  width: 100%;
}

hr {
  border: 0;
  border-top: 1px solid var(--line);
}

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

::selection {
  background: var(--gold);
  color: var(--on-gold);
}

@supports (scrollbar-color: red blue) {
  html {
    scrollbar-color: var(--line-strong) transparent;
    scrollbar-width: thin;
  }
}

/* --------------------------------------------------------------------------
   3. Typography
   -------------------------------------------------------------------------- */
h1,
h2,
h3,
h4 {
  font-family: var(--font-display);
  font-weight: 300;
  line-height: 1.02;
  letter-spacing: -0.022em;
  text-wrap: balance;
  color: var(--ink);
}

h1 { font-size: var(--fs-h1); }
h2 { font-size: var(--fs-h2); }

h3 {
  font-size: var(--fs-h3);
  line-height: 1.1;
}

h4 {
  font-size: var(--fs-xl);
  line-height: 1.2;
  font-weight: 400;
}

h5,
h6 {
  font-family: var(--font-body);
  font-size: var(--fs-sm);
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

p { text-wrap: pretty; }

strong,
b {
  font-weight: 500;
  color: var(--ink);
}

em,
i { font-style: italic; }

/* Display accents ---------------------------------------------------------- */
.u-italic {
  font-style: italic;
  font-weight: 300;
  background: var(--grad-gold);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  padding-right: 0.06em;
}

/* Gold-foil text on any element */
.u-foil {
  background: var(--grad-gold);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

/* Engines without background-clip:text get solid gold instead of nothing. */
@supports not ((-webkit-background-clip: text) or (background-clip: text)) {
  .u-italic,
  .u-foil {
    background: none;
    color: var(--gold);
    -webkit-text-fill-color: currentColor;
  }
}

.u-thin { font-weight: 300; }
.u-serif { font-family: var(--font-display); }
.u-gold { color: var(--gold); }
.u-rose { color: var(--rose); }
.u-muted { color: var(--ink-mute); }
.u-soft { color: var(--ink-soft); }

.lead {
  font-size: var(--fs-lg);
  line-height: 1.62;
  color: var(--ink-soft);
  font-weight: 300;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.75em;
  font-size: var(--fs-eyebrow);
  font-weight: 500;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: var(--sp-5);
}

.eyebrow::before {
  content: "";
  width: 2.4rem;
  height: 1px;
  background: currentColor;
  opacity: 0.65;
  flex: none;
}

.eyebrow--center { justify-content: center; }

.eyebrow--center::after {
  content: "";
  width: 2.4rem;
  height: 1px;
  background: currentColor;
  opacity: 0.65;
  flex: none;
}

.eyebrow--plain::before,
.eyebrow--plain::after { display: none; }

/* --------------------------------------------------------------------------
   4. Layout utilities
   -------------------------------------------------------------------------- */
.container {
  width: min(100% - var(--gutter) * 2, var(--maxw));
  margin-inline: auto;
}

.container--wide {
  width: min(100% - var(--gutter) * 2, 1680px);
}

.container--narrow {
  width: min(100% - var(--gutter) * 2, var(--maxw-narrow));
}

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

.section--tight { padding-block: calc(var(--section-y) * 0.6); }
.section--alt { background: var(--bg-alt); }
.section--sunk { background: var(--surface-sunk); }

/* Onyx section — every token flips so children need no special classes */
.section--deep {
  background: var(--bg-deep);
  color: var(--ink-onDeep);
  --ink: #f8f1e8;
  --ink-soft: rgba(248, 241, 232, 0.74);
  --ink-mute: rgba(248, 241, 232, 0.5);
  --line: rgba(248, 241, 232, 0.14);
  --line-strong: rgba(248, 241, 232, 0.3);
  --surface: rgba(255, 255, 255, 0.035);
  --surface-2: rgba(255, 255, 255, 0.06);
  --gold: #dfb765;
  --gold-bright: #f2d79b;
  --line-gold: rgba(223, 183, 101, 0.34);
  --on-gold: #17100f;
  --grad-gold: linear-gradient(100deg, #f3d99b 0%, #d9b05c 38%, #f0d193 68%, #c9a24e 100%);
}

.section--deep h1,
.section--deep h2,
.section--deep h3,
.section--deep h4 { color: var(--ink); }

.section-head {
  max-width: 60ch;
  margin-bottom: clamp(2.5rem, 1.5rem + 3vw, 4.5rem);
}

.section-head--center {
  margin-inline: auto;
  text-align: center;
}

.section-head p { margin-top: var(--sp-5); }

.stack > * + * { margin-top: var(--sp-4); }
.stack-lg > * + * { margin-top: var(--sp-6); }

.grid {
  display: grid;
  gap: clamp(1.15rem, 0.7rem + 1.8vw, 2.25rem);
}

.cluster {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-4);
  align-items: center;
}

.u-center { text-align: center; }
.u-mt-0 { margin-top: 0; }
.u-mt-4 { margin-top: var(--sp-4); }
.u-mt-6 { margin-top: var(--sp-6); }
.u-mt-8 { margin-top: var(--sp-8); }
.u-mb-4 { margin-bottom: var(--sp-4); }
.u-mb-6 { margin-bottom: var(--sp-6); }
.u-hide { display: none !important; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  top: 0;
  left: var(--sp-4);
  transform: translateY(-140%);
  z-index: var(--z-toast);
  background: var(--ink);
  color: var(--bg);
  padding: 0.7rem 1.2rem;
  border-radius: 0 0 var(--r-sm) var(--r-sm);
  font-size: var(--fs-sm);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition: transform var(--dur-2) var(--ease-out);
}

.skip-link:focus-visible { transform: translateY(0); }

/* Decorative rules -------------------------------------------------------- */
.rule {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--line-gold), transparent);
  border: 0;
}

.rule--solid { background: var(--line); }

.ornament {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.85rem;
  color: var(--gold);
}

.ornament::before,
.ornament::after {
  content: "";
  height: 1px;
  width: clamp(2.5rem, 8vw, 6rem);
  background: currentColor;
  opacity: 0.45;
}

.ornament span {
  font-size: 0.7rem;
  letter-spacing: 0.35em;
  text-transform: uppercase;
}

/* --------------------------------------------------------------------------
   5. Scroll-reveal primitives
   -------------------------------------------------------------------------- */
[data-reveal] {
  opacity: 0;
  transform: translateY(30px);
  transition:
    opacity 1s var(--ease-lux),
    transform 1s var(--ease-lux);
  transition-delay: var(--reveal-delay, 0ms);
  will-change: opacity, transform;
}

[data-reveal="fade"] { transform: none; }
[data-reveal="left"] { transform: translateX(-36px); }
[data-reveal="right"] { transform: translateX(36px); }
[data-reveal="zoom"] { transform: scale(0.94); }

[data-reveal].is-visible {
  opacity: 1;
  transform: none;
}

/* Clip-path curtain reveal for imagery */
.reveal-mask {
  position: relative;
  overflow: hidden;
  clip-path: inset(0 0 100% 0);
  transition: clip-path 1.35s var(--ease-lux) var(--reveal-delay, 0ms);
}

.reveal-mask.is-visible { clip-path: inset(0 0 0 0); }

.reveal-mask img {
  transform: scale(1.16);
  transition: transform 1.6s var(--ease-lux) var(--reveal-delay, 0ms);
}

.reveal-mask.is-visible img { transform: scale(1); }

/* Word-by-word heading reveal (wrapped by effects.js).
   NB: `.split` is already the two-column layout component — this is
   deliberately a different name. */
.reveal-text .word {
  display: inline-block;
  overflow: hidden;
  vertical-align: top;
  /* room for italic descenders inside the clipping box */
  padding-bottom: 0.14em;
  margin-bottom: -0.14em;
}

.reveal-text .word > span {
  display: inline-block;
  transform: translateY(105%);
  transition: transform 1.05s var(--ease-lux);
  transition-delay: calc(var(--i, 0) * 55ms + var(--reveal-delay, 0ms));
  will-change: transform;
}

.reveal-text.is-visible .word > span { transform: translateY(0); }

/* Word spans get promoted to their own compositing layers while they animate,
   and a background-clip:text gradient will not paint into such a layer — the
   text would simply stay invisible. Inside an animated heading the accent is
   therefore a solid gold; the foil gradient lives on static display type
   (prices, stat numerals, the signature) where it always renders. */
.reveal-text .u-italic,
.reveal-text .u-foil {
  background: none;
  color: var(--gold);
  -webkit-text-fill-color: currentColor;
}

/* On dark grounds the accent needs the brighter gold to stay legible. */
.page-hero .reveal-text .u-italic,
.section--deep .reveal-text .u-italic,
.cta-band .reveal-text .u-italic,
.coverage .reveal-text .u-italic {
  color: var(--gold-bright);
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }

  [data-reveal] { opacity: 1; transform: none; }
  .reveal-mask { clip-path: none; }
  .reveal-mask img { transform: none; }
  .reveal-text .word > span { transform: none; }
}

/* --------------------------------------------------------------------------
   6. Page-level texture
   -------------------------------------------------------------------------- */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 3;
  opacity: 0.032;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)'/%3E%3C/svg%3E");
}

:root[data-theme="dark"] body::before { opacity: 0.05; }

/* Print ------------------------------------------------------------------- */
@media print {
  .site-header,
  .site-footer,
  .mobile-bar,
  .to-top,
  .loader,
  .cursor,
  body::before {
    display: none !important;
  }

  body { background: #fff; color: #000; }
}
