/* ==========================================================================
   auture — design tokens
   Derived strictly from "auture Mini Guidelines" (palette + Kufam typeface).
   ========================================================================== */

@font-face {
  font-family: 'Kufam';
  font-style: normal;
  font-weight: 400 900;
  font-display: swap;
  src: url('../fonts/kufam-arabic.woff2') format('woff2');
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1,
                 U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41,
                 U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC;
}
@font-face {
  font-family: 'Kufam';
  font-style: normal;
  font-weight: 400 900;
  font-display: swap;
  src: url('../fonts/kufam-latinext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF,
                 U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF,
                 U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Kufam';
  font-style: normal;
  font-weight: 400 900;
  font-display: swap;
  src: url('../fonts/kufam-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
                 U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122,
                 U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  /* ---- brand palette (guidelines, p.17) ---- */
  --ink:        #000000;
  --walnut:     #592600;   /* primary brown  */
  --sand:       #E4DCCA;   /* primary light  */
  --emerald:    #00522C;   /* heritage green */
  --brass:      #DA9E3C;   /* accent gold    */
  --garnet:     #66001B;   /* reserved       */

  /* ---- derived surface ramp (same hue family, for depth only) ---- */
  --espresso:   #2A1206;
  --espresso-2: #1A0B03;
  --bark:       #3D1A02;
  --parchment:  #F2EDE3;
  --sand-deep:  #D2C6AC;

  /* ---- semantic ---- */
  --bg:            var(--parchment);
  --bg-alt:        var(--sand);
  --surface-dark:  var(--espresso);
  --text:          #23140A;
  --text-muted:    #6B584A;
  --text-on-dark:  var(--sand);
  --text-on-dark-muted: #B9AC96;
  --rule:          rgba(89, 38, 0, 0.18);
  --rule-on-dark:  rgba(228, 220, 202, 0.22);

  /* ---- type ---- */
  --font: 'Kufam', 'Segoe UI', system-ui, -apple-system, sans-serif;

  --step--1: clamp(0.82rem, 0.79rem + 0.14vw, 0.92rem);
  --step-0:  clamp(1rem,    0.96rem + 0.2vw,  1.13rem);
  --step-1:  clamp(1.2rem,  1.11rem + 0.44vw, 1.5rem);
  --step-2:  clamp(1.5rem,  1.31rem + 0.93vw, 2.13rem);
  --step-3:  clamp(1.9rem,  1.53rem + 1.83vw, 3.15rem);
  --step-4:  clamp(2.4rem,  1.72rem + 3.4vw,  4.7rem);
  --step-5:  clamp(3rem,    1.75rem + 6.2vw,  7.2rem);

  /* ---- rhythm ---- */
  --gutter:  clamp(1.25rem, 0.9rem + 1.8vw, 2.75rem);
  --section: clamp(4.5rem, 3rem + 7vw, 10rem);
  --measure: 62ch;
  --shell:   1440px;

  /* ---- motion ---- */
  --ease:      cubic-bezier(0.22, 0.61, 0.36, 1);
  --ease-out:  cubic-bezier(0.16, 1, 0.3, 1);
  --t-fast:    200ms;
  --t-base:    420ms;
  --t-slow:    900ms;

  /* ---- z-scale ---- */
  --z-base: 1; --z-rail: 10; --z-nav: 20; --z-overlay: 30; --z-modal: 50;
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: var(--step-0);
  font-weight: 400;
  line-height: 1.75;
  letter-spacing: 0.005em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

h1, h2, h3, h4 {
  margin: 0;
  font-weight: 600;
  line-height: var(--lh-head);
  letter-spacing: -0.015em;
  text-wrap: balance;
}

/* Arabic carries ascenders and full harakat, so a Latin display leading of
   ~1.1 makes the tashkeel of one line land on the letters of the next.
   Every display line-height goes through these two tokens. */
:root { --lh-head: 1.40; --lh-display: 1.34; }
:root[lang="en"] { --lh-head: 1.14; --lh-display: 1.02; }
p { margin: 0; text-wrap: pretty; }
img, svg, video { display: block; max-width: 100%; }
a { color: inherit; }

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

::selection { background: var(--brass); color: var(--espresso-2); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
