/* ============================================
   MAYSA · ميسا — Fine Jewelry
   Palette: Obsidian Black + Metallic Gold + Ivory
   ============================================ */

:root {
  --bg:          #0f0d0b;
  --bg-soft:     #16130f;
  --bg-card:     #1a1612;
  --bg-elev:     #221d17;
  --ink:         #f3ece0;
  --ink-soft:    #c4b8a6;
  --ink-mute:    #8a7e6c;
  --ink-faint:   #5e5546;
  --line:        #2a241c;
  --line-strong: #3d3528;

  --gold:        #c9a44c;   /* metallic gold */
  --gold-bright: #e3c878;
  --gold-deep:   #9a7a32;
  --gold-soft:   rgba(201,164,76,0.14);
  --ivory:       #f3ece0;
  --rose-gold:   #d7a08c;

  --ff-display: 'Cormorant Garamond', 'Playfair Display', Georgia, serif;
  --ff-head:    'Jost', 'Inter', system-ui, sans-serif;
  --ff-sans:    'Inter', system-ui, sans-serif;
  --ff-ar:      'Vazirmatn', 'Tajawal', system-ui, sans-serif;
  --ff-mono:    'JetBrains Mono', ui-monospace, monospace;

  --t-eyebrow: 0.6875rem;
  --t-xs: 0.75rem; --t-sm: 0.875rem; --t-base: 1rem;
  --t-md: 1.125rem; --t-lg: 1.375rem; --t-xl: 1.75rem;
  --t-2xl: 2.25rem; --t-3xl: 3rem;
  --t-hero: clamp(3rem, 8vw, 6.5rem);

  --s-1: 0.25rem; --s-2: 0.5rem; --s-3: 0.75rem; --s-4: 1rem;
  --s-5: 1.25rem; --s-6: 1.5rem; --s-8: 2rem; --s-10: 2.5rem;
  --s-12: 3rem; --s-16: 4rem; --s-20: 5rem; --s-24: 6rem;

  --header-h: 76px;
  --max-w: 1360px;
  --gutter: 1.25rem;
  --r: 4px;
  --r-pill: 999px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --safe-top:    env(safe-area-inset-top, 0);
  --safe-bottom: env(safe-area-inset-bottom, 0);
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  font-family: var(--ff-ar);
  font-size: var(--t-base);
  line-height: 1.7;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  min-height: 100dvh;
}
img, svg, picture, video { display: block; max-width: 100%; height: auto; }
button { background: none; border: none; cursor: pointer; font: inherit; color: inherit; -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }
input { font: inherit; color: inherit; background: transparent; border: none; outline: none; }
:focus-visible { outline: 1px solid var(--gold); outline-offset: 4px; }
::selection { background: var(--gold); color: var(--bg); }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--bg-soft); }
::-webkit-scrollbar-thumb { background: var(--line-strong); }

.shell { max-width: var(--max-w); margin: 0 auto; padding-inline: var(--gutter); }
@media (min-width: 768px) { .shell { padding-inline: 2rem; } }

.eyebrow {
  font-family: var(--ff-head);
  font-size: var(--t-eyebrow);
  font-weight: 500;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--gold);
}
.gold-text { color: var(--gold); }
.mono { font-family: var(--ff-mono); font-variant-numeric: tabular-nums; }
.gline { width: 48px; height: 1px; background: linear-gradient(90deg, var(--gold), transparent); }

/* ── Top bar ── */
.topbar {
  background: var(--bg-soft);
  border-bottom: 1px solid var(--line);
  color: var(--ink-soft);
  font-family: var(--ff-head);
  font-size: var(--t-xs);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 9px var(--gutter);
  padding-top: calc(9px + var(--safe-top));
  text-align: center;
}
.topbar b { color: var(--gold); }

/* ── Header ── */
.header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(15,13,11,0.9);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line);
}
.header__row { height: var(--header-h); display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: var(--s-6); }
.brand {
  font-family: var(--ff-display);
  font-size: 1.9rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  color: var(--ink);
  white-space: nowrap;
}
.brand span { color: var(--gold); }
.nav { display: none; justify-content: center; gap: 2rem; }
@media (min-width: 1024px) { .nav { display: flex; } }
.nav a {
  font-family: var(--ff-head);
  font-size: var(--t-eyebrow);
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-soft);
  position: relative;
  padding: var(--s-2) 0;
  transition: color 220ms;
}
.nav a::after { content: ''; position: absolute; bottom: 0; inset-inline: 50% 50%; height: 1px; background: var(--gold); transition: inset 320ms var(--ease); }
.nav a:hover { color: var(--gold); }
.nav a:hover::after { inset-inline: 0; }
.header__actions { display: flex; align-items: center; gap: var(--s-1); justify-self: end; }
.icon-btn {
  width: 44px; height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-soft);
  position: relative;
  transition: color 200ms;
}
.icon-btn:hover { color: var(--gold); }
.icon-btn__count {
  position: absolute;
  top: 6px; inset-inline-end: 4px;
  min-width: 17px; height: 17px;
  padding: 0 4px;
  background: var(--gold);
  color: var(--bg);
  font-family: var(--ff-mono);
  font-size: 0.6rem;
  font-weight: 700;
  border-radius: var(--r-pill);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.burger { width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center; color: var(--ink); }
@media (min-width: 1024px) { .burger { display: none; } }

/* ── Buttons ── */
.btn {
  --bg: var(--gold);
  --fg: var(--bg);
  --bd: var(--gold);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-2);
  padding: 0 var(--s-8);
  min-height: 52px;
  background: var(--bg);
  color: #0f0d0b;
  border: 1px solid var(--bd);
  border-radius: var(--r);
  font-family: var(--ff-head);
  font-size: var(--t-eyebrow);
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  transition: all 220ms var(--ease);
  cursor: pointer;
  white-space: nowrap;
}
.btn:hover { background: var(--gold-bright); border-color: var(--gold-bright); }
.btn:active { transform: scale(0.98); }
.btn--outline { background: transparent; color: var(--gold); border-color: var(--gold); }
.btn--outline:hover { background: var(--gold); color: var(--bg); }
.btn--ivory { background: var(--ivory); color: var(--bg); border-color: var(--ivory); }
.btn--ivory:hover { background: var(--gold); border-color: var(--gold); }
.btn--lg { min-height: 58px; padding-inline: var(--s-10); }

.linkline {
  font-family: var(--ff-head);
  font-size: var(--t-eyebrow);
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold);
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  border-bottom: 1px solid var(--gold-deep);
  padding-bottom: 3px;
  transition: gap 200ms;
}
.linkline:hover { gap: var(--s-3); }
[dir="rtl"] .linkline svg { transform: scaleX(-1); }

/* ── HERO ── */
.hero {
  position: relative;
  min-height: clamp(560px, 86vh, 840px);
  display: flex;
  align-items: center;
  overflow: hidden;
}
.hero__img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; filter: brightness(0.5); }
.hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 30% 50%, rgba(15,13,11,0.7), rgba(15,13,11,0.4) 70%);
}
.hero__content { position: relative; z-index: 2; padding: clamp(2rem, 6vw, 5rem); max-width: 680px; }
.hero__content .gline { margin-bottom: var(--s-6); }
.hero__title {
  font-family: var(--ff-display);
  font-size: var(--t-hero);
  font-weight: 500;
  line-height: 1;
  letter-spacing: 0.01em;
  color: var(--ivory);
  margin-block: var(--s-4);
}
.hero__title em { font-style: italic; color: var(--gold); }
.hero__sub { font-size: var(--t-md); color: var(--ink-soft); max-width: 42ch; margin-bottom: var(--s-8); line-height: 1.8; }
.hero__cta { display: flex; gap: var(--s-4); flex-wrap: wrap; }

/* ── Marquee trust ── */
.trustline {
  border-block: 1px solid var(--line);
  padding: var(--s-5) 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: clamp(1.5rem, 5vw, 4rem);
}
.trustline__item { display: inline-flex; align-items: center; gap: var(--s-2); font-family: var(--ff-head); font-size: var(--t-xs); letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink-soft); }
.trustline__item svg { color: var(--gold); }

/* ── Section head ── */
.s-head { display: flex; flex-direction: column; align-items: center; gap: var(--s-3); margin-bottom: var(--s-10); text-align: center; }
.s-head h2 { font-family: var(--ff-display); font-size: var(--t-3xl); font-weight: 500; letter-spacing: 0.02em; line-height: 1; }
.s-head h2 em { font-style: italic; color: var(--gold); }
.s-head .gline { margin-top: var(--s-2); }

/* ── Categories (collection cards) ── */
.cols { display: grid; grid-template-columns: 1fr; gap: var(--s-4); margin-bottom: var(--s-20); }
@media (min-width: 640px) { .cols { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .cols { grid-template-columns: repeat(4, 1fr); } }
.col {
  position: relative;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  display: flex;
  align-items: end;
  color: var(--ivory);
  cursor: pointer;
  border: 1px solid var(--line);
}
.col img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform 900ms var(--ease); filter: brightness(0.78); }
.col:hover img { transform: scale(1.06); filter: brightness(0.9); }
.col::after { content: ''; position: absolute; inset: 0; background: linear-gradient(to top, rgba(15,13,11,0.85) 0%, transparent 55%); }
.col__body { position: relative; z-index: 2; padding: var(--s-5); width: 100%; text-align: center; }
.col__body h3 { font-family: var(--ff-display); font-size: var(--t-xl); font-weight: 500; color: var(--ivory); letter-spacing: 0.04em; }
.col__body span { font-family: var(--ff-head); font-size: var(--t-2xs); letter-spacing: 0.2em; text-transform: uppercase; color: var(--gold); }

/* ── Product grid ── */
.prod-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--s-5); }
@media (min-width: 768px) { .prod-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1200px) { .prod-grid { grid-template-columns: repeat(4, 1fr); } }

.prod {
  background: var(--bg-card);
  border: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  transition: border-color 300ms, transform 300ms var(--ease);
  position: relative;
}
.prod:hover { border-color: var(--gold-deep); transform: translateY(-4px); }
.prod__media {
  position: relative;
  aspect-ratio: 1;
  overflow: hidden;
  background: var(--bg-elev);
}
.prod__media img { width: 100%; height: 100%; object-fit: cover; transition: transform 700ms var(--ease); }
.prod:hover .prod__media img { transform: scale(1.07); }
.prod__tags { position: absolute; top: var(--s-3); inset-inline-start: var(--s-3); display: flex; flex-direction: column; gap: 4px; z-index: 2; }
.tag {
  font-family: var(--ff-head);
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 4px 9px;
  line-height: 1;
  background: var(--gold);
  color: var(--bg);
}
.tag--ivory { background: var(--ivory); color: var(--bg); }
.tag--outline { background: transparent; color: var(--gold); border: 1px solid var(--gold); }
.prod__wish {
  position: absolute;
  top: var(--s-3);
  inset-inline-end: var(--s-3);
  width: 36px; height: 36px;
  background: rgba(15,13,11,0.6);
  backdrop-filter: blur(6px);
  border: 1px solid var(--line-strong);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-soft);
  z-index: 2;
  transition: all 200ms;
}
.prod__wish:hover { color: var(--gold); border-color: var(--gold); }
.prod__wish.is-active { color: var(--gold); }
.prod__body { padding: var(--s-5) var(--s-4); display: flex; flex-direction: column; gap: 6px; flex: 1; text-align: center; align-items: center; }
.prod__brand { font-family: var(--ff-head); font-size: var(--t-2xs); font-weight: 500; letter-spacing: 0.2em; text-transform: uppercase; color: var(--ink-mute); }
.prod__name { font-family: var(--ff-display); font-size: var(--t-md); font-weight: 500; color: var(--ink); line-height: 1.35; }
.prod__material { font-family: var(--ff-head); font-size: var(--t-2xs); letter-spacing: 0.1em; text-transform: uppercase; color: var(--gold); }
.prod__price { font-family: var(--ff-display); font-size: var(--t-lg); font-weight: 500; color: var(--ink); margin-top: var(--s-2); }
.prod__price .was { font-family: var(--ff-mono); font-size: var(--t-xs); color: var(--ink-faint); text-decoration: line-through; margin-inline-start: var(--s-2); }
.prod__cta {
  margin-top: var(--s-3);
  font-family: var(--ff-head);
  font-size: var(--t-2xs);
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold);
  border-bottom: 1px solid transparent;
  padding-bottom: 2px;
  transition: border-color 200ms;
}
.prod:hover .prod__cta { border-bottom-color: var(--gold); }

/* ── Editorial feature (gold split) ── */
.feature {
  display: grid;
  grid-template-columns: 1fr;
  margin-block: var(--s-24);
  border: 1px solid var(--line);
}
@media (min-width: 900px) { .feature { grid-template-columns: 1fr 1fr; } }
.feature--rev .feature__img { order: -1; }
@media (min-width: 900px) { .feature--rev .feature__img { order: 1; } }
.feature__img { position: relative; min-height: 420px; overflow: hidden; }
.feature__img img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.feature__body { padding: clamp(2.5rem, 6vw, 5rem); display: flex; flex-direction: column; justify-content: center; gap: var(--s-4); }
.feature__body h2 { font-family: var(--ff-display); font-size: clamp(2rem, 4.5vw, 3.25rem); font-weight: 500; line-height: 1.05; color: var(--ink); }
.feature__body h2 em { font-style: italic; color: var(--gold); }
.feature__body p { color: var(--ink-soft); line-height: 1.85; max-width: 42ch; }

/* ── Promise (assurance) ── */
.promise { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--s-8); margin-block: var(--s-20); }
@media (min-width: 768px) { .promise { grid-template-columns: repeat(4, 1fr); } }
.promise__item { text-align: center; display: flex; flex-direction: column; align-items: center; gap: var(--s-3); }
.promise__icon { width: 52px; height: 52px; border: 1px solid var(--gold-deep); border-radius: var(--r-pill); color: var(--gold); display: inline-flex; align-items: center; justify-content: center; }
.promise__item h4 { font-family: var(--ff-display); font-size: var(--t-lg); font-weight: 500; }
.promise__item p { font-size: var(--t-sm); color: var(--ink-mute); max-width: 24ch; }

/* ── Newsletter ── */
.news {
  margin-block: var(--s-20);
  padding: clamp(3rem, 7vw, 5rem) var(--gutter);
  text-align: center;
  border-block: 1px solid var(--line);
  background:
    radial-gradient(ellipse at 50% 0%, var(--gold-soft), transparent 60%);
}
.news__inner { max-width: 540px; margin-inline: auto; }
.news h2 { font-family: var(--ff-display); font-size: clamp(2rem, 5vw, 3rem); font-weight: 500; color: var(--ink); margin-bottom: var(--s-3); }
.news h2 em { font-style: italic; color: var(--gold); }
.news p { color: var(--ink-soft); margin-bottom: var(--s-8); }
.news__form { display: flex; gap: 0; border-bottom: 1px solid var(--gold-deep); max-width: 420px; margin-inline: auto; }
.news__form input { flex: 1; padding: var(--s-3) 0; color: var(--ink); }
.news__form input::placeholder { color: var(--ink-faint); }
.news__form button { padding: var(--s-3) var(--s-4); font-family: var(--ff-head); font-size: var(--t-2xs); font-weight: 600; letter-spacing: 0.2em; text-transform: uppercase; color: var(--gold); }
[dir="rtl"] .news__form button svg { transform: scaleX(-1); }

/* ── Footer ── */
.foot { border-top: 1px solid var(--line); padding-block: var(--s-16) var(--s-5); }
.foot__brand { font-family: var(--ff-display); font-size: clamp(2.5rem, 8vw, 5rem); font-weight: 500; letter-spacing: 0.16em; color: var(--ink); text-align: center; margin-bottom: var(--s-3); }
.foot__brand span { color: var(--gold); }
.foot__tag { text-align: center; font-family: var(--ff-head); font-size: var(--t-xs); letter-spacing: 0.3em; text-transform: uppercase; color: var(--ink-mute); margin-bottom: var(--s-12); }
.foot__grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--s-8); margin-bottom: var(--s-10); }
@media (min-width: 768px) { .foot__grid { grid-template-columns: repeat(4, 1fr); } }
.foot__col h4 { font-family: var(--ff-head); font-size: var(--t-2xs); font-weight: 500; letter-spacing: 0.2em; text-transform: uppercase; color: var(--gold); margin-bottom: var(--s-4); }
.foot__col ul { display: flex; flex-direction: column; gap: var(--s-2); }
.foot__col a { font-size: var(--t-sm); color: var(--ink-soft); transition: color 180ms; }
.foot__col a:hover { color: var(--gold); }
.foot__bottom { padding-top: var(--s-6); border-top: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: var(--s-4); font-family: var(--ff-head); font-size: var(--t-xs); letter-spacing: 0.08em; color: var(--ink-mute); }
.foot__social { display: flex; gap: var(--s-3); }
.foot__social a { color: var(--ink-soft); transition: color 180ms; }
.foot__social a:hover { color: var(--gold); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* TK-DARK-INJECTED */
[data-theme="light"] {
  --bg:          #faf6ee;
  --bg-soft:     #f3ebda;
  --bg-card:     #ffffff;
  --bg-elev:     #fdfbf5;
  --ink:         #1a1510;
  --ink-soft:    #3e3526;
  --ink-mute:    #6e6450;
  --ink-faint:   #a89c84;
  --line:        #e1d8c3;
  --line-strong: #cabb9e;
  --gold:        #9a7a32;
  --gold-bright: #c9a44c;
  --gold-deep:   #6a5418;
  --gold-soft:   rgba(154,122,50,0.12);
  --ivory:       #1a1510;
  --rose-gold:   #b87a64;
}
html { color-scheme: light; }
[data-theme="light"] body { background: var(--bg); color: var(--ink); }
