/* ============================================================
   دليل العطور — design system
   Signature device: the fragrance pyramid (top / heart / base),
   reused as the site's one recurring structural motif.
   ============================================================ */

@font-face {
    font-family: 'Thmanyah Serif Display';
    src: url('../fonts/thmanyahserifdisplay-Regular.woff2') format('woff2');
    font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
    font-family: 'Thmanyah Serif Display';
    src: url('../fonts/thmanyahserifdisplay-Medium.woff2') format('woff2');
    font-weight: 500; font-style: normal; font-display: swap;
}
@font-face {
    font-family: 'Thmanyah Serif Display';
    src: url('../fonts/thmanyahserifdisplay-Bold.woff2') format('woff2');
    font-weight: 700; font-style: normal; font-display: swap;
}
@font-face {
    font-family: 'Thmanyah Serif Display';
    src: url('../fonts/thmanyahserifdisplay-Black.woff2') format('woff2');
    font-weight: 900; font-style: normal; font-display: swap;
}
@font-face {
    font-family: 'Thmanyah Sans';
    src: url('../fonts/thmanyahsans-Light.woff2') format('woff2');
    font-weight: 300; font-style: normal; font-display: swap;
}
@font-face {
    font-family: 'Thmanyah Sans';
    src: url('../fonts/thmanyahsans-Regular.woff2') format('woff2');
    font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
    font-family: 'Thmanyah Sans';
    src: url('../fonts/thmanyahsans-Medium.woff2') format('woff2');
    font-weight: 500; font-style: normal; font-display: swap;
}
@font-face {
    font-family: 'Thmanyah Sans';
    src: url('../fonts/thmanyahsans-Bold.woff2') format('woff2');
    font-weight: 700; font-style: normal; font-display: swap;
}

:root {
    --ink: #1a120b;
    --ink-soft: #2b1f16;
    --oud: #3b2416;
    --parchment: #f6efe1;
    --parchment-2: #ede1c8;
    --burgundy: #6e1f3a;
    --burgundy-soft: rgba(110, 31, 58, 0.09);
    --gold: #b9863a;
    --gold-light: #e4c989;
    --gold-ink: #7a5620;
    --muted: #6b5a46;
    --line: rgba(26, 18, 11, 0.14);
    --line-on-dark: rgba(228, 201, 137, 0.25);

    --font-display: 'Thmanyah Serif Display', 'Aref Ruqaa', serif;
    --font-body: 'Thmanyah Sans', 'Tahoma', sans-serif;

    --radius: 10px;
    --shadow: 0 12px 30px -14px rgba(26, 18, 11, 0.35);
    --ease: cubic-bezier(.22, .61, .36, 1);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@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; }
}

body {
    margin: 0;
    background: var(--parchment);
    color: var(--ink);
    font-family: var(--font-body);
    font-size: 1rem;
    line-height: 1.8;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
    font-family: var(--font-display);
    font-weight: 700;
    line-height: 1.25;
    margin: 0 0 .6em;
    color: var(--ink);
}

p { margin: 0 0 1em; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
ul { margin: 0; padding: 0; list-style: none; }
button { font: inherit; }

.wrap { max-width: 1180px; margin-inline: auto; padding-inline: 1.5rem; }

.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; right: 1rem; top: -3rem;
    background: var(--ink); color: var(--gold-light);
    padding: .6rem 1rem; border-radius: 0 0 8px 8px; z-index: 200;
    transition: top .2s var(--ease);
}
.skip-link:focus { top: 0; }

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

/* ---------- eyebrow / section heading ---------- */
.eyebrow {
    display: inline-flex; align-items: center; gap: .6em;
    font-family: var(--font-body); font-weight: 700; font-size: .8rem;
    letter-spacing: .04em; color: var(--gold-ink);
    margin: 0 0 .9rem;
}
.eyebrow::before {
    content: ''; width: 1.6em; height: 1px; background: var(--gold);
}
.section-head { max-width: 62ch; margin-bottom: 2.4rem; }
.section-head h2 { font-size: clamp(1.6rem, 2.6vw, 2.2rem); }
.section-head p { color: var(--muted); }
.section-head--center { margin-inline: auto; text-align: center; }
.section-head--center .eyebrow { justify-content: center; }
.section-head--center .eyebrow::before { display: none; }

section { padding: 4.5rem 0; }
.section--tint { background: var(--parchment-2); }
.section--dark {
    background: linear-gradient(160deg, var(--ink) 0%, var(--oud) 100%);
    color: var(--parchment);
}
.section--dark .eyebrow { color: var(--gold-light); }
.section--dark h2, .section--dark h3 { color: var(--parchment); }
.section--dark p { color: rgba(246, 239, 225, 0.78); }

/* ---------- buttons ---------- */
.btn {
    display: inline-flex; align-items: center; gap: .5em; flex-shrink: 0; white-space: nowrap;
    padding: .85rem 1.6rem; border-radius: 999px;
    font-weight: 700; font-size: .95rem;
    border: 1px solid transparent; transition: transform .25s var(--ease), box-shadow .25s var(--ease), background-color .25s var(--ease);
}
.btn--primary { background: var(--gold); color: var(--ink); }
.btn--primary:hover { background: var(--gold-light); transform: translateY(-2px); box-shadow: var(--shadow); }
.btn--ghost { border-color: var(--line-on-dark); color: inherit; }
.btn--ghost:hover { border-color: var(--gold); color: var(--gold-light); }
.section:not(.section--dark) .btn--ghost { border-color: var(--line); color: var(--ink); }
.section:not(.section--dark) .btn--ghost:hover { border-color: var(--gold); color: var(--gold-ink); }

/* ---------- header / nav ---------- */
.site-header {
    position: sticky; top: 0; z-index: 100;
    background: rgba(26, 18, 11, 0.94);
    backdrop-filter: blur(6px);
    border-bottom: 1px solid var(--line-on-dark);
}
.site-header__inner {
    display: flex; align-items: center; justify-content: space-between;
    gap: 1rem; padding-block: .9rem;
}
.logo { display: inline-flex; align-items: center; gap: .55em; color: var(--parchment); }
.logo__mark { display: inline-flex; flex: none; width: 26px; height: 26px; color: var(--gold); }
.logo__mark svg { width: 100%; height: 100%; }
.logo__text { font-family: var(--font-display); font-size: 1.3rem; font-weight: 700; }

.primary-nav { display: flex; gap: 1.9rem; }
.primary-nav a {
    color: rgba(246, 239, 225, 0.82); font-weight: 500; font-size: .96rem;
    padding-bottom: .3rem; border-bottom: 2px solid transparent;
    transition: color .2s, border-color .2s;
}
.primary-nav a:hover, .primary-nav a[aria-current="page"] {
    color: var(--gold-light); border-color: var(--gold);
}

.nav-toggle {
    display: none; flex-direction: column; justify-content: center; align-items: center; gap: 5px;
    width: 44px; height: 44px; background: none; border: none; cursor: pointer;
}
.nav-toggle span { width: 22px; height: 2px; background: var(--gold-light); border-radius: 2px; transition: transform .25s var(--ease), opacity .25s var(--ease); }
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- hero ---------- */
.hero { padding: 4rem 0 3rem; }
.hero__grid {
    display: grid; grid-template-columns: 1.05fr .95fr; gap: 2.5rem; align-items: center; width: 100%;
}
.hero__text { text-align: center; }
.hero__text .eyebrow { justify-content: center; }
.hero__text .eyebrow::before { display: none; }
.hero__text h1 {
    font-size: clamp(2.4rem, 5vw, 3.6rem);
    max-width: 14ch;
    margin-inline: auto;
}
.hero__text p { color: var(--muted); max-width: 48ch; font-size: 1.08rem; margin-inline: auto; }
.hero__cta { display: flex; gap: 1rem; flex-wrap: wrap; justify-content: center; margin-top: 1.6rem; }

.hero__art { position: relative; display: grid; place-items: center; min-height: 320px; }
.hero__wisp {
    position: absolute; border-radius: 50%;
    background: radial-gradient(circle, rgba(185,134,58,.35), transparent 70%);
    filter: blur(18px); z-index: 0;
    animation: drift 14s ease-in-out infinite;
}
.hero__wisp--a { width: 220px; height: 220px; top: 6%; right: 8%; }
.hero__wisp--b { width: 160px; height: 160px; bottom: 4%; left: 10%; animation-delay: -6s; background: radial-gradient(circle, rgba(110,31,58,.25), transparent 70%); }
@keyframes drift {
    0%, 100% { transform: translate(0,0) scale(1); }
    50% { transform: translate(-14px, 16px) scale(1.08); }
}
.hero__bottle { position: relative; z-index: 1; width: min(100%, 260px); }

/* ---------- cards ---------- */
.card {
    display: flex; align-items: flex-start; gap: 1rem;
    background: var(--parchment); border: 1px solid var(--line);
    border-radius: var(--radius); padding: 1.4rem;
    transition: transform .25s var(--ease), box-shadow .25s var(--ease), border-color .25s var(--ease);
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: var(--gold); }

.grid { display: grid; gap: 1.4rem; }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--4 { grid-template-columns: repeat(4, 1fr); }

/* brand card */
.monogram {
    flex: none; width: 52px; height: 52px; border-radius: 50%;
    display: grid; place-items: center; border: 1px solid var(--gold);
    background: radial-gradient(circle at 32% 28%, var(--oud), var(--ink));
    color: var(--gold-light); font-family: var(--font-display); font-weight: 700; font-size: 1.02rem;
}
.brand-card__body { display: flex; flex-direction: column; gap: .25rem; flex: 1; }
.brand-card__name { font-weight: 700; font-size: 1.05rem; }
.brand-card__tagline { color: var(--muted); font-size: .9rem; }
.card__arrow { color: var(--gold-ink); font-size: 1.1rem; align-self: center; }

/* type card */
.type-card__icon { flex: none; width: 42px; height: 42px; color: var(--burgundy); }
.type-card__icon svg { width: 100%; height: 100%; }
.type-card__body { display: flex; flex-direction: column; gap: .3rem; }
.type-card__name { font-weight: 700; }
.type-card__short { color: var(--muted); font-size: .9rem; }

/* article card */
.article-card { flex-direction: column; gap: .6rem; }
.article-card__tag {
    align-self: flex-start; font-size: .75rem; font-weight: 700; color: var(--gold-ink);
    background: var(--burgundy-soft); padding: .25em .8em; border-radius: 999px;
}
.article-card__title { font-family: var(--font-display); font-size: 1.15rem; font-weight: 700; }
.article-card__excerpt { color: var(--muted); font-size: .92rem; }
.article-card__meta { font-size: .82rem; color: var(--gold-ink); margin-top: auto; }

/* ---------- pyramid (signature component) ----------
   One shared card language for all three tiers (not three unrelated
   solid-color blocks) — differentiated by a numbered badge, a soft color
   wash, and the tapering width that reads as a pyramid silhouette. A thin
   vertical spine ties the three tiers together as one diagram. Works on
   both the light detail-page context and the dark homepage section via
   the .section--dark overrides below. */
.pyramid__heading { text-align: center; justify-content: center; }
.pyramid__heading::before { display: none; }

.pyramid__tiers { position: relative; display: flex; flex-direction: column; gap: 1rem; max-width: 620px; margin-inline: auto; }
.pyramid__tiers::before {
    content: ''; position: absolute; top: 6px; bottom: 6px; inset-inline-start: 50%;
    width: 2px; margin-inline-start: -1px;
    background: linear-gradient(to bottom, var(--gold-light), var(--burgundy) 50%, var(--ink));
    opacity: .3; z-index: 0;
}

.pyramid__tier {
    position: relative; z-index: 1;
    display: flex; align-items: flex-start; gap: 1rem;
    padding: 1.1rem 1.3rem; border-radius: 12px;
    border: 1px solid var(--line);
    box-shadow: 0 8px 20px -16px rgba(26,18,11,.4);
}
.pyramid__tier--top { width: 100%; background: linear-gradient(135deg, rgba(228,201,137,.16), rgba(228,201,137,.05)); border-color: rgba(201,154,66,.35); }
.pyramid__tier--heart { width: 87%; margin-inline: auto; background: linear-gradient(135deg, rgba(110,31,58,.12), rgba(110,31,58,.04)); border-color: rgba(110,31,58,.3); }
.pyramid__tier--base { width: 74%; margin-inline: auto; background: linear-gradient(135deg, rgba(26,18,11,.12), rgba(26,18,11,.05)); border-color: rgba(26,18,11,.3); }

.pyramid__badge {
    flex: none; width: 34px; height: 34px; border-radius: 50%;
    display: grid; place-items: center; font-family: var(--font-display); font-weight: 700; font-size: 1rem;
}
.pyramid__tier--top .pyramid__badge { color: var(--gold-ink); background: rgba(201,154,66,.18); }
.pyramid__tier--heart .pyramid__badge { color: var(--burgundy); background: rgba(110,31,58,.14); }
.pyramid__tier--base .pyramid__badge { color: var(--ink); background: rgba(26,18,11,.1); }

.pyramid__body { flex: 1; min-width: 0; }
.pyramid__label { display: flex; align-items: baseline; flex-wrap: wrap; gap: .6em; margin-bottom: .55rem; }
.pyramid__name { font-weight: 700; font-family: var(--font-display); font-size: 1.03rem; }
.pyramid__hint { font-size: .78rem; color: var(--muted); }
.pyramid__notes { display: flex; flex-wrap: wrap; gap: .5rem; }
.pyramid__notes li {
    font-size: .85rem; padding: .3em 1em; border-radius: 999px;
    background: rgba(255,255,255,.55); border: 1px solid var(--line);
}

/* dark-section context (homepage "هرم واحد، ثلاث طبقات" explainer) */
.section--dark .pyramid__tier { box-shadow: none; border-color: rgba(246,239,225,.14); }
.section--dark .pyramid__name { color: var(--parchment); }
.section--dark .pyramid__hint { color: rgba(246,239,225,.6); }
.section--dark .pyramid__notes li { background: rgba(246,239,225,.06); border-color: rgba(246,239,225,.16); color: var(--parchment); }
.section--dark .pyramid__tier--top .pyramid__badge { color: var(--gold-light); background: rgba(228,201,137,.18); }
.section--dark .pyramid__tier--heart .pyramid__badge { color: #f0aec7; background: rgba(110,31,58,.3); }
.section--dark .pyramid__tier--base .pyramid__badge { color: var(--parchment); background: rgba(246,239,225,.1); }

/* ---------- detail page chapter header ---------- */
.chapter-head {
    background: linear-gradient(160deg, var(--ink) 0%, var(--oud) 100%);
    color: var(--parchment); padding: 3.4rem 0 3rem;
}
.breadcrumb { font-size: .85rem; color: rgba(246,239,225,.65); margin-bottom: 1.2rem; }
.breadcrumb ol { display: flex; flex-wrap: wrap; list-style: none; margin: 0; padding: 0; }
.breadcrumb li { display: flex; align-items: center; }
.breadcrumb li:not(:last-child)::after { content: '/'; margin: 0 .5em; color: var(--gold); }
.breadcrumb a { color: var(--gold-light); }
.breadcrumb [aria-current] { color: rgba(246,239,225,.65); }
.chapter-head__row { display: flex; align-items: center; gap: 1.4rem; margin-bottom: 1rem; }
.chapter-head__row .monogram, .chapter-head__row .type-card__icon { width: 64px; height: 64px; font-size: 1.3rem; }
.chapter-head h1 { color: var(--parchment); font-size: clamp(1.9rem, 4vw, 2.6rem); margin: 0; }
.chapter-head__meta { color: rgba(246,239,225,.72); font-size: .95rem; }
.chapter-head__desc { max-width: 68ch; color: rgba(246,239,225,.85); font-size: 1.05rem; }

.detail-body { padding: 3.5rem 0; }
.detail-body__grid { display: grid; grid-template-columns: 1.5fr 1fr; gap: 3rem; align-items: start; }
.prose p { color: var(--ink); font-size: 1.03rem; }
.prose p + p { margin-top: 1.1em; }

/* ---------- long-form guide content (Markdown-rendered) ---------- */
.guide-prose h3 { margin-top: 2.2rem; font-size: 1.3rem; }
.guide-prose h4 { margin-top: 1.6rem; font-size: 1.1rem; color: var(--gold-ink); }
.guide-prose p { margin-bottom: 1.1em; line-height: 1.85; }
.guide-prose ul, .guide-prose ol { margin: 0 0 1.3em; padding-inline-start: 1.4rem; }
.guide-prose li { margin-bottom: .5em; line-height: 1.75; }
.guide-prose ul { list-style: disc; }
.guide-prose ol { list-style: decimal; }
.guide-prose a { color: var(--gold-ink); text-decoration: underline; text-decoration-color: var(--gold-light); text-underline-offset: 2px; }
.guide-prose strong { color: var(--ink); font-weight: 700; }
.table-scroll { overflow-x: auto; margin: 1.4rem 0; border: 1px solid var(--line); border-radius: 8px; }
.table-scroll table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.table-scroll th, .table-scroll td { padding: .65rem .9rem; text-align: right; border-bottom: 1px solid var(--line); white-space: normal; }
.table-scroll th { background: var(--parchment-2); font-weight: 700; color: var(--ink); }
.table-scroll tr:last-child td { border-bottom: none; }

.source-list { display: flex; flex-direction: column; gap: .6rem; font-size: .88rem; }
.source-list a { color: var(--gold-ink); }
.source-list a:hover { text-decoration: underline; }
.aside-card {
    background: var(--parchment-2); border: 1px solid var(--line); border-radius: var(--radius);
    padding: 1.4rem; margin-bottom: 1.4rem;
}
.aside-card h2 { font-size: 1.05rem; }
.aside-card dl { display: grid; grid-template-columns: auto 1fr; gap: .4rem 1rem; font-size: .92rem; }
.aside-card dt { color: var(--muted); }
.aside-card dd { margin: 0; font-weight: 700; }

.related-list { display: flex; flex-direction: column; gap: .8rem; }
.related-list a {
    display: block; padding: .8rem 1rem; border: 1px solid var(--line); border-radius: 8px;
    transition: border-color .2s, background-color .2s;
}
.related-list a:hover { border-color: var(--gold); background: var(--parchment-2); }
.related-list .tag { font-size: .78rem; color: var(--gold-ink); font-weight: 700; }
.related-list .title { display: block; font-weight: 700; margin-top: .2rem; }
.related-list .note { display: block; color: var(--muted); font-size: .88rem; margin-top: .2rem; }

/* ---------- footer ---------- */
.site-footer { background: var(--ink); color: rgba(246,239,225,.75); padding: 3.4rem 0 2rem; }
.site-footer__inner { display: grid; grid-template-columns: 1.2fr 1fr; gap: 2rem 3rem; }
.site-footer__brand .logo__text { color: var(--parchment); }
.site-footer__brand p { margin-top: .6rem; max-width: 40ch; font-size: .92rem; }
.site-footer__links { display: flex; flex-direction: column; gap: .7rem; align-self: start; }
.site-footer__links a:hover { color: var(--gold-light); }
.site-footer__note { grid-column: 1 / -1; font-size: .82rem; border-top: 1px solid var(--line-on-dark); padding-top: 1.4rem; max-width: 80ch; }
.site-footer__copy { grid-column: 1 / -1; font-size: .8rem; color: rgba(246,239,225,.45); margin: 0; }

/* ---------- scroll reveal ----------
   Gated behind .js (set by an inline script in <head>) so content is fully
   visible by default: if JavaScript fails or is blocked, nothing here ever
   depends on it to become visible — a real progressive-enhancement fix,
   not just an animation nicety. */
.js [data-reveal] { opacity: 0; transform: translateY(16px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.js [data-reveal].is-visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
    .js [data-reveal] { opacity: 1; transform: none; }
}

/* ---------- responsive ---------- */
@media (max-width: 960px) {
    .grid--4 { grid-template-columns: repeat(2, 1fr); }
    .grid--3 { grid-template-columns: repeat(2, 1fr); }
    .detail-body__grid { grid-template-columns: 1fr; }
    .site-footer__inner { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
    /* No-JS default: nav shows as a plain stacked list, always visible —
       nothing is hidden behind a toggle that JavaScript might never run. */
    .primary-nav { flex-direction: column; gap: 0; }
    .primary-nav a { padding: 1rem 1.5rem; border-bottom: 1px solid var(--line-on-dark); }
    .js .primary-nav {
        position: absolute; inset-inline: 0; top: 100%;
        background: var(--ink);
        max-height: 0; overflow: hidden; border-bottom: 1px solid var(--line-on-dark);
        transition: max-height .3s var(--ease);
    }
    .js .primary-nav.is-open { max-height: 300px; }
    .js .nav-toggle { display: flex; }
    .hero__grid { grid-template-columns: 1fr; }
    .hero__art { min-height: 220px; }
    .hero__cta { flex-direction: column; align-items: stretch; }
    .hero__cta .btn { justify-content: center; }
    .grid--4, .grid--3 { grid-template-columns: 1fr; }
    .pyramid__tier { width: 100% !important; }
    section { padding: 3rem 0; }
}
