/* LA Daverne — shared tokens and components */
:root {
  /* champagne & deep green, taken from the LA Daverne banner */
  --champ: #e7dcc3;      /* paper */
  --champ-hi: #f5efe1;   /* sheen */
  --champ-lo: #d8c9a8;
  --gold: #a8925f;       /* ornament lines */
  --gold-hi: #c9b27a;
  --green: #12403a;      /* crest green: text + primary */
  --green-2: #0b2b27;    /* deep sections */
  --teal: #138a92;       /* FIKR teal, artwork only */
  --line: #c4b28a;
  --stone: #6f6a58;
  --flash: #f1fbf8;
  --on-dark: #eadfc6;
  --on-dark-dim: #a9b7a8;
  --danger: #a3402c;
  --ok: #2e6b4f;

  /* aliases used across pages */
  --ink: var(--green-2);
  --pine: var(--green);
  --bone: var(--champ-hi);
  --parch: var(--champ);
  --on-ink: var(--on-dark);
  --on-ink-dim: var(--on-dark-dim);
  --teal-hi: #1fb0b9;

  /* fixed brand colours (same in both themes) */
  --cream: #e7dcc3; --cream-hi: #f5efe1; --pine: #12403a; --pine-2: #0b2b27;
  /* surfaces that change with the theme */
  --text-2: #3e544e;
  --stage-1: #f8f3e8; --stage-2: #efe6d4; --stage-3: #e2d6bc;

  --f-display: "Gloock", "Times New Roman", serif;
  --f-sans: "Montserrat", system-ui, sans-serif;
  --r-sm: 6px;
  --r-md: 14px;
  --r-lg: 22px;
  --ease: cubic-bezier(.2, .7, .1, 1);
  --gutter: clamp(16px, 3vw, 32px);
  --wrap: 1160px;
  --paper: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.75' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .45 0 0 0 0 .38 0 0 0 0 .22 0 0 0 .09 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
/* ---------- dark theme ---------- */
:root[data-theme="dark"] {
  --champ: #0f1b18; --champ-hi: #172722; --champ-lo: #13221e;
  --green: #ebe1c9; --green-2: #060d0b;
  --gold: #b89d62; --gold-hi: #cdb37a;
  --line: #34463e; --stone: #95a398; --text-2: #b6c0b4;
  --stage-1: #22352f; --stage-2: #172822; --stage-3: #0f1c18;
  --danger: #e0806b; --ok: #6cc398;
  color-scheme: dark;
}
:root[lang="ar"] {
  --f-display: "Markazi Text", "IBM Plex Sans Arabic", serif;
  --f-sans: "IBM Plex Sans Arabic", "Montserrat", system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; background: var(--champ); min-height: 100%; }
html.theme-anim, html.theme-anim *, html.theme-anim *::before, html.theme-anim *::after { transition: background-color .5s ease, color .5s ease, border-color .5s ease, fill .5s ease !important; }
body {
  margin: 0;
  font-family: var(--f-sans);
  font-size: 15px;
  line-height: 1.55;
  color: var(--green);
  background: var(--champ) var(--paper);
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
  min-height: 100svh; display: flex; flex-direction: column;
}
body > main { flex: 1 0 auto; width: 100%; }
body > .footer, body > .page-end { flex-shrink: 0; }
/* light page ending: just a line */
.page-end { width: min(100% - 2 * var(--gutter), var(--wrap)); margin: 0 auto; padding: 18px 0 calc(22px + env(safe-area-inset-bottom)); border-top: 1px solid color-mix(in srgb, var(--line) 70%, transparent); display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; font-size: 12.5px; color: var(--stone); }
.page-end nav { display: flex; gap: 18px; }
.page-end a { text-decoration: none; } .page-end a:hover { color: var(--green); }
img, svg { display: block; max-width: 100%; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--teal-hi); outline-offset: 3px; border-radius: 4px; }
[hidden] { display: none !important; }
.wrap { width: min(100% - 2 * var(--gutter), var(--wrap)); margin-inline: auto; }
.plus { font-family: "Montserrat", sans-serif; font-weight: 800; font-size: .95em; color: var(--green); margin-inline-end: 1px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- nav ---------- */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 10px max(var(--gutter), (100% - var(--wrap)) / 2);
  color: var(--green); height: 58px;
  transition: background .4s var(--ease), color .4s var(--ease), box-shadow .4s, padding .4s;
}
.nav.is-light { background: color-mix(in srgb, var(--champ-hi) 82%, transparent); backdrop-filter: blur(14px) saturate(1.2); -webkit-backdrop-filter: blur(14px); box-shadow: 0 1px 0 color-mix(in srgb, var(--gold) 45%, transparent); }
.nav.is-dark { background: color-mix(in srgb, var(--green-2) 82%, transparent); color: var(--on-dark); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand img { width: 30px; height: 30px; transition: filter .4s; }
.nav.is-dark .brand img { filter: brightness(0) invert(.9) sepia(.3); }
.brand span { font-family: "Gloock", serif; font-size: 19px; letter-spacing: .01em; }
.nav-links { display: flex; align-items: center; gap: clamp(10px, 2vw, 24px); font-size: 13.5px; font-weight: 500; }
.nav-links a:not(.btn) { text-decoration: none; opacity: .85; }
.nav-links a:not(.btn):hover { opacity: 1; text-decoration: underline; text-underline-offset: 6px; }
.lang-btn {
  border: 1px solid currentColor; background: none; border-radius: 99px; padding: 5px 12px; font-size: 13px;
  font-family: "IBM Plex Sans Arabic", "Montserrat", sans-serif;
}
.lang-btn { border-color: color-mix(in srgb, currentColor 40%, transparent) !important; }
.theme-btn { width: 36px; height: 36px; border-radius: 50%; border: 1px solid color-mix(in srgb, currentColor 40%, transparent); background: none; display: grid; place-items: center; padding: 0; position: relative; overflow: hidden; }
.theme-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; position: absolute; transition: transform .5s cubic-bezier(.34, 1.56, .64, 1), opacity .3s; }
.theme-btn .moon { transform: translateY(28px) rotate(-40deg); opacity: 0; }
:root[data-theme="dark"] .theme-btn .sun { transform: translateY(-28px) rotate(40deg); opacity: 0; }
:root[data-theme="dark"] .theme-btn .moon { transform: none; opacity: 1; }
@media (max-width: 720px) { .nav-links .hide-sm { display: none; } .brand span { font-size: 17px; } .nav-links { gap: 8px; } .nav .btn-sm { padding: 0 14px; min-height: 36px; font-size: 13px; } .theme-btn { width: 34px; height: 34px; } .lang-btn { padding: 5px 10px; } }
@media (max-width: 370px) { .brand span { display: none; } }
.brand span, .nav .btn { white-space: nowrap; }

/* ---------- buttons ---------- */
.btn {
  --b: var(--green);
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 46px; padding: 0 24px; border-radius: 99px; border: 0;
  background: var(--b); color: var(--champ-hi); text-decoration: none; font-weight: 600; font-size: 14px; letter-spacing: .02em;
  transition: transform .25s var(--ease), background .25s, box-shadow .25s;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--gold-hi) 45%, transparent);
}
.btn:hover { transform: translateY(-1px); background: color-mix(in srgb, var(--b) 86%, var(--gold)); }
.btn:active { transform: translateY(0); }
.btn[disabled] { opacity: .55; cursor: not-allowed; transform: none; }
.btn-sm { min-height: 38px; padding: 0 18px; font-size: 14px; }
.btn-ghost { background: transparent; color: inherit; box-shadow: inset 0 0 0 1px currentColor; }
.btn-ghost:hover { background: color-mix(in srgb, currentColor 8%, transparent); }
.btn-pine { --b: var(--green); }
.btn-gold { --b: var(--gold); color: var(--green-2); }
.btn-ghost { box-shadow: inset 0 0 0 1px color-mix(in srgb, currentColor 55%, transparent); }

/* ---------- type ---------- */
.display { font-family: var(--f-display); font-weight: 400; line-height: .92; letter-spacing: -.01em; margin: 0; }
.h2 { font-family: var(--f-display); font-weight: 400; font-size: clamp(28px, 3.2vw, 42px); line-height: 1.08; margin: 0 0 .5em; }
.lede { font-size: 15.5px; max-width: 56ch; margin: 0; }
.fikr-type { font-family: "Montserrat", sans-serif; font-weight: 800; letter-spacing: .02em; line-height: .82; }

/* ---------- reveal ---------- */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .9s var(--ease), transform .9s var(--ease); }
.reveal.in { opacity: 1; transform: none; }

/* ---------- footer ---------- */
.footer { background: var(--pine-2); color: var(--on-dark-dim); padding: 22px 0 calc(22px + env(safe-area-inset-bottom)); font-size: 13px; }
.footer-inner { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.footer nav { display: flex; gap: 20px; }
.footer a { text-decoration: none; } .footer a:hover { color: var(--on-dark); }


/* ---------- ornamental frame: notched double line, 9-slice SVG ---------- */
.frame { position: relative; }
.frame::before {
  content: ""; position: absolute; pointer-events: none; z-index: 1;
  inset: var(--frame-top, var(--frame-inset, 14px)) var(--frame-inset, 14px) var(--frame-inset, 14px);
  border: var(--frame-size, 60px) solid transparent;
  border-image: url("/assets/frame.svg") 60 stretch;
  transition: opacity 1.2s, filter 1.2s;
}
.frame.frame-dark::before { border-image-source: url("/assets/frame-dark.svg"); }
@media (max-width: 700px) { .frame { --frame-size: 44px; } }
.sheen { background: radial-gradient(900px 420px at 50% -6%, var(--champ-hi) 0%, transparent 70%), var(--champ) var(--paper); }
.smallcaps { font-size: 13px; letter-spacing: .26em; text-transform: uppercase; line-height: 1.7; }
:root[lang="ar"] .smallcaps { letter-spacing: 0; text-transform: none; font-size: 15px; }

/* Arabic headings (Markazi Text): a touch heavier and larger so they sit level with the Latin serif */
:root[lang="ar"] .sec-title, :root[lang="ar"] .order-title, :root[lang="ar"] .display,
:root[lang="ar"] .steps h3, :root[lang="ar"] .opt h3, :root[lang="ar"] .night-copy h2,
:root[lang="ar"] .facts dt, :root[lang="ar"] .hero-points b, :root[lang="ar"] .done h2 {
  font-weight: 600; letter-spacing: 0; word-spacing: .06em; line-height: 1.2;
}
:root[lang="ar"] .sec-title { font-size: clamp(34px, 3.8vw, 50px); }
:root[lang="ar"] .order-title { font-size: clamp(40px, 4.8vw, 64px); }
:root[lang="ar"] .steps h3, :root[lang="ar"] .opt h3 { font-size: 24px; }
