/* ==========================================================================
   H.N — Maison de Parfum
   لوحة ألوان هادئة: عاجي، حبري، أخضر زجاجي داكن، ولمسة نحاسية.
   ========================================================================== */

:root {
  --paper: #f5f1ea;
  --paper-2: #ede7dc;
  --paper-3: #e6ded0;
  --card: #faf8f3;
  --ink: #221e19;
  --ink-2: #4f483f;
  --muted: #8a8072;
  --line: #ddd4c5;
  --green: #25322a;
  --green-2: #33443a;
  --brass: #9a8255;

  --f-display: "Amiri", "Noto Naskh Arabic", "Times New Roman", serif;
  --f-body: "IBM Plex Sans Arabic", "Segoe UI", Tahoma, sans-serif;
  --f-latin: "Cormorant Garamond", "Garamond", "Times New Roman", serif;

  --gutter: 20px;
  --max: 1240px;
  --ease: cubic-bezier(.2, .6, .2, 1);
}

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--f-body);
  font-weight: 300;
  font-size: 16px;
  line-height: 1.8;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
body.is-locked { overflow: hidden; }

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
h1, h2, h3 { margin: 0; font-weight: 400; }
p { margin: 0; }

.wrap { width: 100%; max-width: var(--max); margin-inline: auto; padding-inline: var(--gutter); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; inset-inline-start: 12px; top: -60px; background: var(--ink); color: var(--paper); padding: 8px 14px; z-index: 100; }
.skip:focus { top: 12px; }
:focus-visible { outline: 1px solid var(--ink); outline-offset: 3px; }

.latin { font-family: var(--f-latin); direction: ltr; unicode-bidi: isolate; }

.eyebrow {
  font-size: 12px;
  letter-spacing: .18em;
  color: var(--muted);
  font-weight: 400;
}

/* ───────── Header ───────── */
.site-header {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: saturate(1.2) blur(10px);
  -webkit-backdrop-filter: saturate(1.2) blur(10px);
  border-bottom: 1px solid transparent;
  transition: border-color .4s var(--ease);
}
.site-header.is-scrolled { border-bottom-color: var(--line); }
.header-inner {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  height: 64px;
}
.header-link { font-size: 13px; color: var(--ink-2); letter-spacing: .04em; display: inline-flex; align-items: center; gap: 8px; }
.header-link:first-child { justify-self: start; }
.header-wa { justify-self: end; }
.header-wa svg { width: 20px; height: 20px; }
.header-link:hover { color: var(--ink); }

.brandmark { display: inline-flex; flex-direction: column; align-items: center; line-height: 1; }
.brandmark-name {
  font-family: var(--f-latin);
  font-weight: 500;
  font-size: 26px;
  letter-spacing: .32em;
  margin-inline-end: -.32em; /* optical centering of tracking */
  direction: ltr;
}
.brandmark-tag {
  font-family: var(--f-latin);
  font-style: italic;
  font-size: 11px;
  letter-spacing: .12em;
  color: var(--muted);
  margin-top: 4px;
  direction: ltr;
}
.brandmark img { height: 34px; width: auto; }

/* ───────── Hero ───────── */
.hero { padding: 40px 0 28px; }
.hero-inner { display: grid; gap: 24px; align-items: center; }
.hero-copy { text-align: center; max-width: 560px; margin-inline: auto; }
.hero-title {
  font-family: var(--f-display);
  font-size: clamp(34px, 9vw, 64px);
  line-height: 1.45;
  margin: 18px 0 18px;
  white-space: pre-line;
  color: var(--ink);
}
.hero-text { color: var(--ink-2); font-size: 15.5px; max-width: 30em; margin-inline: auto; }
.text-cta {
  display: inline-flex; align-items: center; gap: 10px;
  margin-top: 28px; padding-bottom: 6px;
  font-size: 14px; letter-spacing: .06em;
  border-bottom: 1px solid var(--ink);
}
.text-cta svg { width: 18px; height: 18px; transition: transform .5s var(--ease); }
.text-cta:hover svg { transform: translateX(-4px); }

.hero-art { color: var(--brass); display: flex; justify-content: center; }
.arch { width: min(46vw, 300px); height: auto; }
.arch-mark { font-family: var(--f-latin); font-size: 15px; letter-spacing: .3em; fill: var(--brass); }

.houses {
  margin-top: 36px; padding-top: 22px;
  border-top: 1px solid var(--line);
  text-align: center;
  font-family: var(--f-latin);
  font-size: 15px;
  letter-spacing: .08em;
  color: var(--muted);
  direction: ltr;
  line-height: 2.1;
}
.houses span + span::before { content: "·"; margin: 0 .8em; color: var(--line); }

@media (min-width: 900px) {
  .hero { padding: 72px 0 40px; }
  .hero-inner { grid-template-columns: 1.15fr .85fr; gap: 64px; }
  .hero-copy { text-align: start; margin: 0; }
  .hero-text { margin: 0; }
  .arch { width: 320px; }
}

/* ───────── Section heads ───────── */
.collection { padding: 56px 0 72px; }
.section-head { text-align: center; margin-bottom: 28px; }
.section-title { font-family: var(--f-display); font-size: clamp(28px, 6vw, 40px); margin-top: 8px; }

/* ───────── Tools: search + filters ───────── */
.tools { display: grid; gap: 18px; margin-bottom: 32px; }
.search {
  display: flex; align-items: center; gap: 10px;
  border-bottom: 1px solid var(--line);
  padding: 6px 2px 10px;
  max-width: 520px; width: 100%; margin-inline: auto;
  transition: border-color .3s var(--ease);
}
.search:focus-within { border-color: var(--ink); }
.search svg { width: 20px; height: 20px; color: var(--muted); flex: none; }
.search input {
  flex: 1; min-width: 0;
  border: 0; background: transparent; outline: none;
  font: inherit; font-size: 16px; color: var(--ink);
  padding: 4px 0;
}
.search input::placeholder { color: var(--muted); }
.search input::-webkit-search-cancel-button { filter: grayscale(1); opacity: .5; }

.filters {
  display: flex; gap: 8px;
  overflow-x: auto; scrollbar-width: none;
  margin-inline: calc(var(--gutter) * -1);
  padding: 2px var(--gutter);
  scroll-snap-type: x proximity;
}
.filters::-webkit-scrollbar { display: none; }
.chip {
  flex: none; scroll-snap-align: start;
  font-family: var(--f-latin);
  font-size: 15px; letter-spacing: .04em;
  padding: 7px 16px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink-2);
  white-space: nowrap;
  transition: background .3s var(--ease), color .3s var(--ease), border-color .3s var(--ease);
}
.chip--ar { font-family: var(--f-body); font-size: 13px; }
.chip:hover { border-color: var(--ink-2); }
.chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--paper); }
@media (min-width: 900px) {
  .filters { flex-wrap: wrap; justify-content: center; overflow: visible; margin: 0; padding: 0; }
}
.count { text-align: center; font-size: 12.5px; color: var(--muted); letter-spacing: .04em; }

/* ───────── Grid & cards ───────── */
.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 28px 14px;
}
@media (min-width: 700px) { .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 44px 22px; } }
@media (min-width: 1100px) { .grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 56px 28px; } }

.card { display: flex; flex-direction: column; text-align: center; }
.card-open { display: flex; flex-direction: column; text-align: center; width: 100%; }
.card-media {
  position: relative;
  aspect-ratio: 4 / 5;
  background: var(--paper-2);
  overflow: hidden;
  display: grid; place-items: center;
}
.card-media img {
  width: 100%; height: 100%; object-fit: contain;
  padding: 10%;
  mix-blend-mode: multiply;
  transition: transform 1.2s var(--ease);
}
.card-open:hover .card-media img { transform: scale(1.03); }
.card-body { padding: 16px 4px 0; display: grid; gap: 4px; }
.card-brand {
  font-family: var(--f-latin);
  font-size: 12px; letter-spacing: .2em; text-transform: uppercase;
  color: var(--muted);
}
.card-name {
  font-family: var(--f-latin);
  font-size: 19px; line-height: 1.3; font-weight: 500;
  color: var(--ink);
}
.card-short {
  font-size: 13px; line-height: 1.75; color: var(--ink-2);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  margin-top: 4px;
}
.card-meta {
  margin-top: 8px;
  display: flex; justify-content: center; align-items: baseline; gap: 10px; flex-wrap: wrap;
  font-size: 13px; color: var(--muted);
}
.card-price { color: var(--ink); font-weight: 400; font-size: 14.5px; }
.card-price--ask { color: var(--muted); font-size: 12.5px; }
.card-order {
  margin-top: 12px; align-self: center;
  font-size: 12.5px; letter-spacing: .04em; color: var(--green);
  padding-bottom: 3px; border-bottom: 1px solid color-mix(in srgb, var(--green) 35%, transparent);
  transition: border-color .3s var(--ease);
}
.card-order:hover { border-bottom-color: var(--green); }

@media (max-width: 420px) {
  .card-name { font-size: 16.5px; }
  .card-short { font-size: 12.5px; }
  .card-brand { font-size: 10.5px; letter-spacing: .16em; }
}

/* placeholder art for products without a verified photo */
.ph { width: 100%; height: 100%; display: grid; place-items: center; color: var(--brass); }
.ph svg { width: 46%; height: auto; opacity: .85; }
.ph-mark { font-family: var(--f-latin); font-size: 11px; letter-spacing: .24em; fill: var(--brass); text-transform: uppercase; }

.empty { text-align: center; padding: 48px 0; color: var(--ink-2); display: grid; gap: 12px; justify-items: center; }
.empty[hidden] { display: none; }
.link-btn { border-bottom: 1px solid var(--ink); padding-bottom: 3px; font-size: 14px; }

/* ───────── Buttons ───────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 52px; padding: 0 28px;
  font-size: 15px; font-weight: 400; letter-spacing: .03em;
  border-radius: 2px;
  transition: background .3s var(--ease), color .3s var(--ease), border-color .3s var(--ease);
}
.btn svg { width: 20px; height: 20px; }
.btn--primary { background: var(--green); color: #f3efe6; }
.btn--primary:hover { background: var(--green-2); }
.btn--ghost { border: 1px solid var(--ink); color: var(--ink); min-height: 46px; }
.btn--ghost:hover { background: var(--ink); color: var(--paper); }

/* ───────── Promise ───────── */
.promise { border-top: 1px solid var(--line); padding: 56px 0; }
.promise-grid { display: grid; gap: 36px; text-align: center; }
.promise-num { font-family: var(--f-latin); font-size: 14px; color: var(--brass); letter-spacing: .1em; }
.promise h3 { font-family: var(--f-display); font-size: 22px; margin: 6px 0 8px; }
.promise p { color: var(--ink-2); font-size: 14.5px; max-width: 26em; margin-inline: auto; }
@media (min-width: 800px) { .promise-grid { grid-template-columns: repeat(3, 1fr); gap: 48px; } .promise { padding: 80px 0; } }

/* ───────── Footer ───────── */
.site-footer { background: var(--paper-2); padding: 56px 0 calc(40px + env(safe-area-inset-bottom)); }
.footer-inner { display: grid; justify-items: center; gap: 20px; text-align: center; }
.brandmark--footer .brandmark-name { font-size: 30px; }
.footer-note { font-size: 13px; color: var(--ink-2); max-width: 34em; }
.copyright { font-size: 12px; color: var(--muted); letter-spacing: .06em; }

/* ───────── Product sheet (dialog) ───────── */
.sheet {
  border: 0; padding: 0; margin: 0;
  width: 100%; max-width: 100%; height: 100%; max-height: 100%;
  background: var(--card); color: var(--ink);
  overflow: hidden;
}
.sheet::backdrop { background: rgba(28, 24, 19, .42); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); }
.sheet[open] { animation: sheet-in .5s var(--ease); }
.sheet[open]::backdrop { animation: fade-in .5s var(--ease); }
@keyframes sheet-in { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }

.sheet-body { height: 100%; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
.sheet-close {
  position: fixed; top: calc(12px + env(safe-area-inset-top)); inset-inline-end: 12px; z-index: 3;
  width: 44px; height: 44px; border-radius: 50%;
  display: grid; place-items: center;
  background: color-mix(in srgb, var(--card) 85%, transparent);
  border: 1px solid var(--line);
}
.sheet-close svg { width: 18px; height: 18px; }

.detail { display: grid; grid-template-columns: minmax(0, 1fr); }
.detail-media, .detail-info { min-width: 0; }
.detail-media { background: var(--paper-2); aspect-ratio: 1 / 1; display: grid; place-items: center; overflow: hidden; }
.detail-media img { max-height: 100%; }
.detail-media img { width: 100%; height: 100%; object-fit: contain; padding: 12%; mix-blend-mode: multiply; }
.detail-media .ph svg { width: 38%; }
.detail-info { padding: 28px var(--gutter) calc(110px + env(safe-area-inset-bottom)); display: grid; gap: 22px; }
.detail-brand, .detail-title, .detail-fullname { text-align: right; }
.detail-brand { font-family: var(--f-latin); font-size: 13px; letter-spacing: .24em; text-transform: uppercase; color: var(--muted); }
.detail-title { font-family: var(--f-latin); font-weight: 500; font-size: clamp(28px, 7vw, 40px); line-height: 1.2; margin-top: 6px; }
.detail-fullname { font-family: var(--f-latin); font-style: italic; color: var(--muted); font-size: 16px; margin-top: 6px; }
.detail-price { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.detail-price strong { font-weight: 400; font-size: 24px; }
.detail-price small { font-size: 12px; color: var(--muted); }
.specs { display: grid; grid-template-columns: repeat(3, 1fr); border-block: 1px solid var(--line); }
.spec { padding: 14px 6px; text-align: center; display: grid; gap: 2px; }
.spec + .spec { border-inline-start: 1px solid var(--line); }
.spec dt { font-size: 11.5px; color: var(--muted); letter-spacing: .06em; }
.spec dd { margin: 0; font-size: 14px; }
.spec dd.latin { font-size: 16px; }
.detail-desc { font-size: 15.5px; color: var(--ink-2); line-height: 2; }
.block-title { font-size: 12px; letter-spacing: .16em; color: var(--muted); margin-bottom: 10px; font-weight: 400; }
.notes { display: grid; gap: 0; margin: 0; }
.note-row { display: grid; grid-template-columns: 88px 1fr; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.note-row:first-child { border-top: 1px solid var(--line); }
.note-row dt { font-size: 13px; color: var(--muted); }
.note-row dd { margin: 0; font-size: 14.5px; }
.tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tag { font-size: 13px; padding: 5px 14px; border: 1px solid var(--line); border-radius: 999px; color: var(--ink-2); }
.character { font-family: var(--f-display); font-size: 22px; }

.detail-cta {
  position: fixed; inset-inline: 0; bottom: 0; z-index: 2;
  padding: 12px var(--gutter) calc(12px + env(safe-area-inset-bottom));
  background: linear-gradient(to top, var(--card) 70%, color-mix(in srgb, var(--card) 0%, transparent));
}
.detail-cta .btn { width: 100%; }

@media (min-width: 900px) {
  .sheet {
    width: min(1080px, calc(100% - 64px)); height: min(720px, calc(100% - 64px));
    margin: auto;
  }
  .sheet-close { position: absolute; }
  .sheet-body { overflow: hidden; }
  .detail { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); height: 100%; }
  .detail-media { aspect-ratio: auto; height: 100%; }
  .detail-info { overflow-y: auto; padding: 56px 48px 40px; align-content: start; }
  .detail-cta { position: sticky; bottom: -40px; padding: 16px 0 40px; margin-bottom: -40px; }
}

/* ───────── Reveal (very subtle) ───────── */
.reveal { opacity: 0; transform: translateY(10px); transition: opacity 1s var(--ease), transform 1s var(--ease); }
.reveal.is-in { opacity: 1; transform: none; }
.no-js .reveal { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .sheet[open], .sheet[open]::backdrop { animation: none; }
}
