/* Hadef & Partners — Editorial Heritage system */

:root {
  /* Palette: Heritage (default) */
  --ink:        #0F1A2B;
  --ink-2:      #1A2230;
  --ink-3:      #2A364B;
  --paper:      #F4EFE5;
  --paper-2:    #ECE5D6;
  --paper-3:    #FFFFFF;
  --line:       #D8D0BD;
  --line-2:     #26354A;
  --gold:       #A8884F;
  --gold-2:     #8C6E3A;
  --marine:     #1C3A4B;
  --muted:      #6B6452;
  --focus:      #A8884F;

  /* Type */
  --display:    'Cormorant Garamond', 'EB Garamond', 'Times New Roman', serif;
  --display-ar: 'Amiri', 'Reem Kufi', serif;
  --body:       'Inter', system-ui, -apple-system, 'Helvetica Neue', Helvetica, Arial, sans-serif;
  --body-ar:    'Noto Kufi Arabic', 'IBM Plex Sans Arabic', sans-serif;
  --mono:       'JetBrains Mono', 'IBM Plex Mono', ui-monospace, monospace;

  /* Density */
  --section-y:  clamp(80px, 9vw, 160px);
  --gutter:     clamp(20px, 4vw, 56px);
  --container:  1320px;

  /* Motion */
  --ease:       cubic-bezier(.22,.61,.36,1);
}

[data-palette="marine"] {
  --ink:    #0B2330;
  --ink-2:  #143140;
  --ink-3:  #214C5F;
  --paper:  #F1ECE2;
  --paper-2:#E4DDCD;
  --paper-3:#FFFFFF;
  --line:   #CFC6B2;
  --gold:   #3A7E92;
  --gold-2: #235B6B;
  --marine: #0B2330;
  --muted:  #4A5A66;
  --focus:  #3A7E92;
}

[data-palette="sand"] {
  --ink:    #2B2114;
  --ink-2:  #3A2E1E;
  --ink-3:  #5A4628;
  --paper:  #EFE5D2;
  --paper-2:#E2D5B9;
  --paper-3:#FAF6EC;
  --line:   #C9BC9C;
  --gold:   #B86A2C;
  --gold-2: #94531F;
  --marine: #3F2D17;
  --muted:  #6B5A38;
  --focus:  #B86A2C;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--body);
  background: var(--paper);
  color: var(--ink);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

[dir="rtl"] body { font-family: var(--body-ar); }
[dir="rtl"] .display { font-family: var(--display-ar); }

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; background: none; border: 0; color: inherit; }
input, select, textarea { font: inherit; color: inherit; }

/* === Type primitives === */
.display {
  font-family: var(--display);
  font-weight: 400;
  line-height: 0.98;
  letter-spacing: -0.015em;
}
.display em { font-style: italic; color: var(--gold); font-weight: 400; }

.eyebrow {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 500;
}
[dir="rtl"] .eyebrow { letter-spacing: 0; }

.lede {
  font-size: clamp(17px, 1.4vw, 21px);
  line-height: 1.55;
  color: var(--ink-2);
  max-width: 64ch;
  text-wrap: pretty;
}

.h-display { font-size: clamp(48px, 7.4vw, 128px); }
.h-1       { font-size: clamp(40px, 5.4vw, 84px); }
.h-2       { font-size: clamp(30px, 3.6vw, 56px); }
.h-3       { font-size: clamp(22px, 2.2vw, 32px); }

.rule {
  height: 1px;
  background: var(--ink);
  opacity: 0.16;
  border: 0;
}
.rule-thick { height: 1px; background: var(--ink); opacity: 1; }

/* === Layout === */
.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding-inline: var(--gutter);
}
.section { padding-block: var(--section-y); }

.grid-12 {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 24px;
}

/* === Buttons === */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 14px 22px 13px;
  border: 1px solid var(--ink);
  border-radius: 0;
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition: all .35s var(--ease);
  white-space: nowrap;
  background: transparent;
  color: var(--ink);
}
.btn:hover { background: var(--ink); color: var(--paper); }
.btn-primary { background: var(--ink); color: var(--paper); }
.btn-primary:hover { background: var(--gold); border-color: var(--gold); color: var(--paper-3); }
.btn-ghost   { border-color: transparent; padding-inline: 0; }
.btn-ghost:hover { background: transparent; color: var(--gold); }
.btn-gold    { background: var(--gold); border-color: var(--gold); color: var(--paper-3); }
.btn-gold:hover { background: var(--gold-2); border-color: var(--gold-2); }
.btn .arrow { transition: transform .35s var(--ease); }
.btn:hover .arrow { transform: translateX(4px); }
[dir="rtl"] .btn:hover .arrow { transform: translateX(-4px) scaleX(-1); }
[dir="rtl"] .btn .arrow { transform: scaleX(-1); }

/* === Chips === */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-2);
  background: var(--paper-3);
}
.chip-gold { color: var(--gold); border-color: var(--gold); }
.chip-dark { background: var(--ink); color: var(--paper); border-color: var(--ink); }

/* === Nav === */
.navbar {
  position: sticky; top: 0; z-index: 50;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
  transition: background .3s var(--ease), color .3s var(--ease);
}
.navbar-inner {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 32px;
  padding-block: 18px;
}
.nav-links {
  display: flex;
  gap: 28px;
  justify-content: center;
  font-size: 13px;
  letter-spacing: 0.04em;
  font-weight: 500;
}
.nav-links button { padding: 6px 0; position: relative; }
.nav-links button.active::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -2px; height: 1px; background: var(--ink);
}
.nav-links button:hover { color: var(--gold); }
.nav-right { display: flex; align-items: center; gap: 14px; }

.lang-toggle {
  display: inline-flex;
  border: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 11px;
}
.lang-toggle button {
  padding: 6px 10px;
  border-right: 1px solid var(--line);
  letter-spacing: 0.08em;
}
.lang-toggle button:last-child { border-right: 0; }
[dir="rtl"] .lang-toggle button { border-right: 0; border-left: 1px solid var(--line); }
[dir="rtl"] .lang-toggle button:last-child { border-left: 0; }
.lang-toggle button.active { background: var(--ink); color: var(--paper); }

.logo svg { display: block; height: 36px; width: auto; }
.logo path { fill: var(--ink) !important; }
.logo path:last-of-type { fill: var(--ink) !important; }
.logo .accent { fill: var(--gold) !important; }

/* === Footer === */
.footer {
  background: var(--ink);
  color: var(--paper);
  padding-block: 80px 28px;
}
.footer a:hover { color: var(--gold); }
.footer .rule { background: var(--paper); opacity: 0.16; }

/* === Forms === */
.field {
  display: flex; flex-direction: column;
  gap: 6px;
}
.field label {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}
.field input, .field select, .field textarea {
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--line-2, var(--ink));
  padding: 10px 0;
  font-size: 15px;
  color: var(--ink);
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: 0;
  border-bottom-color: var(--gold);
}

/* === Page transitions === */
.page-enter {
  animation: pageIn .6s var(--ease) both;
}
@keyframes pageIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* === Utility === */
.cap { font-feature-settings: "smcp"; font-variant: small-caps; letter-spacing: 0.06em; }
.num { font-family: var(--mono); font-feature-settings: "tnum"; }
.muted { color: var(--muted); }
.gold { color: var(--gold); }

/* placeholder striped frame */
.placeholder {
  background:
    linear-gradient(135deg, transparent 49%, rgba(15,26,43,.06) 49% 51%, transparent 51%) 0 0/14px 14px,
    var(--paper-2);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--mono); font-size: 11px; color: var(--muted);
  letter-spacing: 0.08em; text-transform: uppercase;
  border: 1px solid var(--line);
}

/* hover lift for cards */
.card-link { display: block; transition: transform .5s var(--ease); }
.card-link:hover { transform: translateY(-4px); }

/* image fade */
.img-fade { transition: filter .6s var(--ease), transform .8s var(--ease); }
.card-link:hover .img-fade { filter: brightness(0.92); transform: scale(1.02); }
.img-wrap { overflow: hidden; }

/* big vertical year rail */
.year-rail {
  writing-mode: vertical-rl;
  text-orientation: mixed;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.2em;
  color: var(--muted);
  transform: rotate(180deg);
}

/* responsive */
@media (max-width: 880px) {
  .grid-12 { grid-template-columns: repeat(6, 1fr); gap: 16px; }
  .nav-links { display: none; }
  .navbar-inner { grid-template-columns: auto 1fr; }
}
