/* ============================================
   NEST · نيست — Home & Furniture
   Palette: Warm Linen + Walnut + Sage Green + Clay
   ============================================ */

:root {
  --bg:          #f6f2ea;
  --bg-soft:     #ece5d8;
  --bg-card:     #fffdf8;
  --ink:         #2c2620;
  --ink-soft:    #574e44;
  --ink-mute:    #8a7f70;
  --ink-faint:   #b3a896;
  --line:        #e3dac9;
  --line-strong: #d0c4ad;

  --walnut:      #6b4f3a;   /* wood */
  --walnut-soft: #ede2d3;
  --sage:        #7e9072;   /* sage green */
  --sage-soft:   #e4ebdd;
  --clay:        #c08457;   /* terracotta clay */
  --clay-soft:   #f3e3d4;
  --sale:        #b9533f;

  --ff-display: 'Fraunces', 'Cormorant Garamond', Georgia, serif;
  --ff-head:    'Outfit', '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(2.75rem, 6.5vw, 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: 74px;
  --max-w: 1360px;
  --gutter: 1.25rem;
  --r: 18px;
  --r-sm: 10px;
  --r-pill: 999px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --shadow-sm: 0 3px 12px rgba(44,38,32,0.06);
  --shadow-md: 0 18px 44px -18px rgba(44,38,32,0.2);
  --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.65;
  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: 2px solid var(--sage); outline-offset: 3px; }
::selection { background: var(--sage-soft); color: var(--walnut); }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: var(--r-pill); }

.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: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--clay);
}
.mono { font-family: var(--ff-mono); font-variant-numeric: tabular-nums; }

/* ── Top bar ── */
.topbar {
  background: var(--walnut);
  color: var(--bg-soft);
  font-family: var(--ff-head);
  font-size: var(--t-xs);
  letter-spacing: 0.05em;
  padding: 9px var(--gutter);
  padding-top: calc(9px + var(--safe-top));
  text-align: center;
}
.topbar b { color: #fff; }

/* ── Header ── */
.header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(246,242,234,0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.header__row { height: var(--header-h); display: flex; align-items: center; gap: var(--s-5); }
.brand {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  font-family: var(--ff-display);
  font-size: 1.75rem;
  font-weight: 600;
  color: var(--walnut);
  white-space: nowrap;
}
.brand svg { color: var(--sage); }
.nav { display: none; gap: 1.75rem; margin-inline-start: var(--s-6); }
@media (min-width: 1024px) { .nav { display: flex; } }
.nav a {
  font-family: var(--ff-head);
  font-size: var(--t-sm);
  font-weight: 500;
  color: var(--ink-soft);
  transition: color 180ms;
}
.nav a:hover, .nav a.is-active { color: var(--clay); }
.header__actions { margin-inline-start: auto; display: flex; align-items: center; gap: var(--s-1); }
.icon-btn {
  width: 44px; height: 44px;
  border-radius: var(--r-pill);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-soft);
  position: relative;
  transition: background 180ms, color 180ms;
}
.icon-btn:hover { background: var(--bg-soft); color: var(--clay); }
.icon-btn__count {
  position: absolute;
  top: 5px; inset-inline-end: 5px;
  min-width: 18px; height: 18px;
  padding: 0 5px;
  background: var(--clay);
  color: #fff;
  font-family: var(--ff-mono);
  font-size: 0.625rem;
  font-weight: 600;
  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(--walnut);
  --fg: #fff;
  --bd: var(--walnut);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-2);
  padding: 0 var(--s-6);
  min-height: 52px;
  background: var(--bg);
  color: var(--fg);
  border: 1px solid var(--bd);
  border-radius: var(--r-pill);
  font-family: var(--ff-head);
  font-size: var(--t-sm);
  font-weight: 600;
  transition: all 180ms var(--ease);
  cursor: pointer;
  white-space: nowrap;
}
.btn:hover { --bg: #543c2c; --bd: #543c2c; transform: translateY(-1px); }
.btn:active { transform: scale(0.98); }
.btn--sage { --bg: var(--sage); --bd: var(--sage); }
.btn--sage:hover { --bg: #6b7c5f; --bd: #6b7c5f; }
.btn--clay { --bg: var(--clay); --bd: var(--clay); }
.btn--clay:hover { --bg: #a86d44; --bd: #a86d44; }
.btn--light { --bg: #fff; --fg: var(--walnut); --bd: #fff; box-shadow: var(--shadow-sm); }
.btn--light:hover { --bg: var(--walnut); --fg: #fff; --bd: var(--walnut); }
.btn--outline { --bg: transparent; --fg: var(--walnut); --bd: var(--line-strong); }
.btn--outline:hover { --bg: var(--walnut); --fg: #fff; --bd: var(--walnut); }
.btn--lg { min-height: 58px; padding-inline: var(--s-8); font-size: var(--t-md); }

.linkline {
  font-family: var(--ff-head);
  font-size: var(--t-sm);
  font-weight: 600;
  color: var(--clay);
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  transition: gap 180ms;
}
.linkline:hover { gap: var(--s-3); }
[dir="rtl"] .linkline svg { transform: scaleX(-1); }

/* ── HERO ── */
.hero {
  position: relative;
  margin: var(--s-4) var(--gutter) 0;
  border-radius: var(--r);
  overflow: hidden;
  min-height: clamp(520px, 76vh, 720px);
  display: flex;
  align-items: center;
}
@media (min-width: 768px) { .hero { margin-inline: 2rem; } }
.hero__img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hero::after { content: ''; position: absolute; inset: 0; background: linear-gradient(100deg, rgba(44,38,32,0.6) 0%, rgba(44,38,32,0.15) 55%, transparent 100%); }
[dir="rtl"] .hero::after { background: linear-gradient(-100deg, rgba(44,38,32,0.6) 0%, rgba(44,38,32,0.15) 55%, transparent 100%); }
.hero__content { position: relative; z-index: 2; padding: clamp(2rem, 6vw, 4.5rem); max-width: 600px; color: #fff; }
.hero__title { font-family: var(--ff-display); font-size: var(--t-hero); font-weight: 500; line-height: 1.02; color: #fff; margin-block: var(--s-4); }
.hero__title em { font-style: italic; color: var(--clay-soft); }
.hero__sub { font-size: var(--t-md); color: rgba(255,255,255,0.9); max-width: 42ch; margin-bottom: var(--s-6); line-height: 1.7; }
.hero__cta { display: flex; gap: var(--s-3); flex-wrap: wrap; }

/* ── Rooms (shop by room) ── */
.rooms { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--s-3); }
@media (min-width: 768px) { .rooms { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1024px) { .rooms { grid-template-columns: repeat(5, 1fr); } }
.room {
  position: relative;
  aspect-ratio: 3 / 4;
  border-radius: var(--r);
  overflow: hidden;
  display: flex;
  align-items: end;
  color: #fff;
  cursor: pointer;
}
.room img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform 700ms var(--ease); }
.room:hover img { transform: scale(1.06); }
.room::after { content: ''; position: absolute; inset: 0; background: linear-gradient(to top, rgba(44,38,32,0.7) 0%, transparent 60%); }
.room__name { position: relative; z-index: 2; padding: var(--s-4); font-family: var(--ff-display); font-size: var(--t-lg); font-weight: 500; color: #fff; width: 100%; }

/* ── Section head ── */
.s-head { display: flex; align-items: end; justify-content: space-between; gap: var(--s-4); margin-bottom: var(--s-6); flex-wrap: wrap; }
.s-head__title { display: flex; flex-direction: column; gap: var(--s-2); }
.s-head__title h2 { font-family: var(--ff-display); font-size: var(--t-3xl); font-weight: 500; letter-spacing: -0.01em; line-height: 1; }
.s-head__title h2 em { font-style: italic; color: var(--clay); }

/* ── Product grid ── */
.prod-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--s-5); }
@media (min-width: 640px) { .prod-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1024px) { .prod-grid { grid-template-columns: repeat(4, 1fr); } }

.prod {
  background: var(--bg-card);
  border-radius: var(--r);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: box-shadow 220ms, transform 250ms var(--ease);
  position: relative;
  border: 1px solid var(--line);
}
.prod:hover { box-shadow: var(--shadow-md); transform: translateY(-4px); border-color: var(--line-strong); }
.prod__media { position: relative; aspect-ratio: 4 / 3; background: var(--bg-soft); overflow: hidden; }
.prod__media img { width: 100%; height: 100%; object-fit: cover; transition: transform 500ms var(--ease); }
.prod:hover .prod__media img { transform: scale(1.05); }
.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.625rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 4px 9px;
  line-height: 1;
  border-radius: var(--r-pill);
}
.tag--walnut { background: var(--walnut); color: #fff; }
.tag--sage   { background: var(--sage); color: #fff; }
.tag--clay   { background: var(--clay); color: #fff; }
.tag--sale   { background: var(--sale); color: #fff; }
.prod__wish {
  position: absolute;
  top: var(--s-3);
  inset-inline-end: var(--s-3);
  width: 36px; height: 36px;
  border-radius: var(--r-pill);
  background: rgba(255,255,255,0.92);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-mute);
  z-index: 2;
  transition: all 180ms;
}
.prod__wish:hover { color: var(--sale); transform: scale(1.08); }
.prod__wish.is-active { color: var(--sale); }
.prod__body { padding: var(--s-4); display: flex; flex-direction: column; gap: 5px; flex: 1; }
.prod__cat { font-family: var(--ff-head); font-size: var(--t-2xs); font-weight: 600; letter-spacing: 0.1em; 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.3; }
.prod__rating { display: inline-flex; align-items: center; gap: 4px; font-family: var(--ff-mono); font-size: var(--t-xs); color: var(--ink-mute); margin-top: 2px; }
.prod__rating svg { fill: var(--clay); }
.prod__swatches { display: flex; gap: 5px; margin-top: var(--s-2); align-items: center; }
.sw { width: 16px; height: 16px; border-radius: var(--r-pill); box-shadow: inset 0 0 0 1px rgba(0,0,0,0.12); cursor: pointer; transition: transform 150ms; }
.sw:hover, .sw.is-active { transform: scale(1.2); box-shadow: inset 0 0 0 1px rgba(0,0,0,0.12), 0 0 0 1.5px var(--walnut); }
.sw-more { font-family: var(--ff-mono); font-size: 0.6875rem; color: var(--ink-mute); }
.prod__foot { display: flex; align-items: center; justify-content: space-between; gap: var(--s-2); margin-top: auto; padding-top: var(--s-3); }
.prod__price { font-family: var(--ff-display); font-size: var(--t-lg); font-weight: 600; color: var(--ink); }
.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__add {
  width: 42px; height: 42px;
  border-radius: var(--r-pill);
  background: var(--walnut-soft);
  color: var(--walnut);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 180ms;
  flex-shrink: 0;
}
.prod__add:hover { background: var(--walnut); color: #fff; transform: scale(1.08); }

/* ── Feature room scene ── */
.scene {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  border-radius: var(--r);
  overflow: hidden;
  margin-block: var(--s-20);
  background: var(--sage);
  color: #fff;
  align-items: center;
}
@media (min-width: 900px) { .scene { grid-template-columns: 1fr 1fr; } }
.scene__body { padding: clamp(2.5rem, 5vw, 4rem); }
.scene__body .eyebrow { color: var(--clay-soft); }
.scene__body h2 { font-family: var(--ff-display); font-size: clamp(2rem, 4vw, 3rem); font-weight: 500; color: #fff; margin-block: var(--s-3) var(--s-3); line-height: 1.05; }
.scene__body h2 em { font-style: italic; }
.scene__body p { color: rgba(255,255,255,0.88); margin-bottom: var(--s-6); max-width: 40ch; line-height: 1.75; }
.scene__img { position: relative; min-height: 380px; }
.scene__img img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

/* ── Categories strip ── */
.catstrip { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--s-4); margin-block: var(--s-16); }
@media (min-width: 768px) { .catstrip { grid-template-columns: repeat(4, 1fr); } }
.catcard {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--r);
  overflow: hidden;
  transition: box-shadow 200ms, transform 250ms var(--ease);
}
.catcard:hover { box-shadow: var(--shadow-md); transform: translateY(-3px); }
.catcard__img { aspect-ratio: 4 / 3; overflow: hidden; background: var(--bg-soft); }
.catcard__img img { width: 100%; height: 100%; object-fit: cover; transition: transform 500ms var(--ease); }
.catcard:hover .catcard__img img { transform: scale(1.06); }
.catcard__body { padding: var(--s-4); display: flex; align-items: center; justify-content: space-between; gap: var(--s-2); }
.catcard__name { font-family: var(--ff-display); font-size: var(--t-md); font-weight: 500; }
.catcard__count { font-family: var(--ff-mono); font-size: var(--t-xs); color: var(--ink-mute); }

/* ── Promise ── */
.promise { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--s-6); margin-block: var(--s-16); padding: var(--s-8); background: var(--walnut-soft); border-radius: var(--r); }
@media (min-width: 768px) { .promise { grid-template-columns: repeat(4, 1fr); } }
.promise__item { display: flex; align-items: center; gap: var(--s-3); }
.promise__icon { width: 46px; height: 46px; border-radius: var(--r-pill); background: var(--bg-card); color: var(--walnut); display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.promise__item strong { display: block; font-family: var(--ff-display); font-size: var(--t-md); font-weight: 500; }
.promise__item span { font-size: var(--t-xs); color: var(--ink-mute); }

/* ── Newsletter ── */
.news {
  border-radius: var(--r);
  margin-block: var(--s-16);
  padding: clamp(2.5rem, 6vw, 4.5rem);
  text-align: center;
  background: var(--clay-soft);
}
.news__inner { max-width: 540px; margin-inline: auto; }
.news h2 { font-family: var(--ff-display); font-size: clamp(2rem, 4.5vw, 3rem); font-weight: 500; color: var(--ink); margin-bottom: var(--s-3); }
.news h2 em { font-style: italic; color: var(--clay); }
.news p { color: var(--ink-soft); margin-bottom: var(--s-6); }
.news__form { display: flex; gap: var(--s-2); max-width: 440px; margin-inline: auto; background: #fff; border-radius: var(--r-pill); padding: 6px; box-shadow: var(--shadow-sm); }
.news__form input { flex: 1; padding: 0 var(--s-5); min-height: 48px; }
.news__form input::placeholder { color: var(--ink-faint); }

/* ── Footer ── */
.foot { background: var(--walnut); color: rgba(255,255,255,0.75); padding-block: var(--s-12) var(--s-5); }
.foot__top { display: grid; grid-template-columns: 1fr; gap: var(--s-8); margin-bottom: var(--s-10); }
@media (min-width: 768px) { .foot__top { grid-template-columns: 1.6fr 1fr 1fr 1fr; } }
.foot__brand { display: inline-flex; align-items: center; gap: var(--s-2); font-family: var(--ff-display); font-size: 1.75rem; font-weight: 600; color: #fff; margin-bottom: var(--s-3); }
.foot__col p { font-size: var(--t-sm); line-height: 1.7; max-width: 34ch; margin-bottom: var(--s-4); }
.foot__col h4 { font-family: var(--ff-head); font-size: var(--t-eyebrow); font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--clay-soft); 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: rgba(255,255,255,0.75); transition: color 180ms; }
.foot__col a:hover { color: #fff; }
.foot__social { display: flex; gap: var(--s-2); }
.foot__social a { width: 38px; height: 38px; border-radius: var(--r-pill); background: rgba(255,255,255,0.1); display: inline-flex; align-items: center; justify-content: center; color: rgba(255,255,255,0.75); transition: all 180ms; }
.foot__social a:hover { background: var(--clay); color: #fff; }
.foot__bottom { padding-top: var(--s-5); border-top: 1px solid rgba(255,255,255,0.12); display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: var(--s-3); font-size: var(--t-xs); color: rgba(255,255,255,0.55); }
.foot__pay { display: flex; gap: var(--s-2); }
.foot__pay span { background: rgba(255,255,255,0.12); padding: 5px 10px; border-radius: var(--r-sm); font-family: var(--ff-mono); font-size: 0.625rem; font-weight: 600; }

@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="dark"] {
  --bg:          #14110d;
  --bg-soft:     #1e1a14;
  --bg-card:     #1e1a14;
  --ink:         #f4ebd9;
  --ink-soft:    #d6c8b1;
  --ink-mute:    #968a76;
  --ink-faint:   #6a6051;
  --line:        #2c2620;
  --line-strong: #443a2d;
  --walnut:      #b08868;
  --walnut-soft: #2a201a;
  --sage:        #9aac8a;
  --sage-soft:   #1f2a1a;
  --clay:        #d99e70;
  --clay-soft:   #34221a;
  --sale:        #e26b54;
  --shadow-sm: 0 3px 12px rgba(0,0,0,0.4);
  --shadow-md: 0 18px 44px -18px rgba(0,0,0,0.6);
}
html { color-scheme: dark; }
[data-theme="dark"] body { background: var(--bg); color: var(--ink); }
