/* base.css — shared foundation for every site. Don't edit per site:
   override the tokens and add site styles in style.css. */

/* ---------- fonts (self-hosted, OFL licensed) ---------- */
@font-face { font-family: 'Instrument Serif'; src: url('../fonts/instrument-serif-400.woff2?v=37ddf465') format('woff2'); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: 'Instrument Serif'; src: url('../fonts/instrument-serif-400-italic.woff2?v=24e6c99c') format('woff2'); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: 'Manrope'; src: url('../fonts/manrope-400.woff2?v=5296100b') format('woff2'); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: 'Manrope'; src: url('../fonts/manrope-600.woff2?v=c3ddfb1b') format('woff2'); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: 'IBM Plex Sans Arabic'; src: url('../fonts/ibm-plex-sans-arabic-400.woff2?v=a9cefdca') format('woff2'); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: 'IBM Plex Sans Arabic'; src: url('../fonts/ibm-plex-sans-arabic-600.woff2?v=9e5c019d') format('woff2'); font-weight: 600; font-style: normal; font-display: swap; }

/* ---------- tokens (override in style.css) ---------- */
:root {
  --bg: #0d1110;           /* page background (dark) */
  --fg: #f3f1ec;           /* text on bg */
  --paper: #f3f1ec;        /* light surface */
  --ink: #141816;          /* text on paper */
  --muted: #8a8f8b;
  --accent: #d6c7a1;
  --line: rgba(255, 255, 255, .12);
  --serif: 'Instrument Serif', Georgia, 'Times New Roman', serif;
  --sans: 'Manrope', Arial, Helvetica, sans-serif;
  --arabic: 'IBM Plex Sans Arabic', Tahoma, Arial, sans-serif;
  --gutter: clamp(20px, 5vw, 80px);
  --radius: 18px;
  --ease: cubic-bezier(.16, 1, .3, 1);
}

/* ---------- reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--fg); font: 17px/1.65 var(--sans); -webkit-font-smoothing: antialiased; overflow-x: hidden; }
img, video, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; background: none; border: 0; padding: 0; }
a, button { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
h1, h2, h3, h4, p { margin: 0; }
::selection { background: var(--accent); color: var(--ink); }
[hidden] { display: none !important; } /* component display rules must not override the hidden attribute */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip { position: fixed; top: -100px; inset-inline-start: 12px; z-index: 120; padding: 12px 18px; border-radius: 999px; background: var(--accent); color: var(--ink); font-weight: 600; }
.skip:focus { top: 12px; }

/* Hide everything but the preloader until the kit has split text and set start states. */
html.js-loading body > *:not(.preloader) { visibility: hidden; }
.kit-off .preloader { display: none; }

/* ---------- type ---------- */
.display { font: 400 clamp(64px, 11vw, 190px)/.92 var(--serif); letter-spacing: -.025em; }
.h1 { font: 400 clamp(52px, 7.5vw, 128px)/.96 var(--serif); letter-spacing: -.02em; }
.h2 { font: 400 clamp(40px, 5vw, 84px)/1 var(--serif); letter-spacing: -.015em; }
.h3 { font: 400 clamp(28px, 2.6vw, 40px)/1.1 var(--serif); }
.display em, .h1 em, .h2 em, .h3 em { color: var(--accent); }
.eyebrow { display: block; font-size: 12px; font-weight: 600; letter-spacing: .2em; text-transform: uppercase; }
.lead { font-size: clamp(17px, 1.35vw, 21px); line-height: 1.6; max-width: 34em; }
.muted { color: var(--muted); }
.split-line-mask { padding: 0 .1em .12em; margin: 0 -.1em -.12em; } /* room for italics and descenders */

/* ---------- layout ---------- */
.container { width: 100%; max-width: 1480px; margin-inline: auto; padding-inline: var(--gutter); }
.section { position: relative; padding-block: clamp(96px, 16vh, 190px); }
.grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: clamp(16px, 2vw, 32px); }

/* ---------- components ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 14px; min-height: 52px; padding: 15px 28px;
  border-radius: 999px; background: var(--fg); color: var(--bg); font-size: 14px; font-weight: 600; letter-spacing: .02em;
  transition: background .4s var(--ease), color .4s var(--ease), gap .4s var(--ease);
}
.btn:hover { background: var(--accent); color: var(--ink); gap: 20px; }
.btn--ghost { background: transparent; color: var(--fg); box-shadow: inset 0 0 0 1px var(--line); }
.btn--ghost:hover { background: var(--fg); color: var(--bg); }
.link {
  background: linear-gradient(currentColor, currentColor) 0 100% / 0 1px no-repeat;
  transition: background-size .5s var(--ease); padding-bottom: 2px;
}
.link:hover { background-size: 100% 1px; }
[dir=rtl] .link { background-position: 100% 100%; }

/* Media frame: image or video covering its box. Add data-parallax to the img inside for drift. */
.media { position: relative; overflow: hidden; background: #1b201e; }
.media > img, .media > video, .media > .ph { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.media > [data-parallax] { inset: -10% 0; height: 120%; }

/* ---------- forms (inherit the section's text color) ---------- */
.form { display: grid; gap: 26px; max-width: 760px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 26px; }
.field { display: grid; gap: 8px; }
.field label { font-size: 12px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; opacity: .6; }
.field input, .field select, .field textarea {
  width: 100%; padding: 10px 0 12px; border: 0; border-bottom: 1px solid currentColor; border-radius: 0;
  background: transparent; color: inherit; font: 17px/1.5 var(--sans); outline: none; opacity: .9;
  border-bottom-color: color-mix(in srgb, currentColor 30%, transparent); transition: border-color .3s;
}
.field textarea { resize: vertical; min-height: 110px; }
.field input:focus, .field select:focus, .field textarea:focus { border-bottom-color: var(--accent); }
.hp { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.form-foot { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; padding-top: 6px; }
.form-foot [type="submit"]:disabled { opacity: .6; cursor: wait; }
.form-status { font-size: 14px; opacity: .75; }
.form-status[data-state="ok"] { color: #3f7a4f; opacity: 1; }
.form-status[data-state="error"] { color: #b4442f; opacity: 1; }
@media (max-width: 767px) { .field-row { grid-template-columns: 1fr; } }

/* ---------- header ---------- */
.site-header {
  position: fixed; inset: 0 0 auto; z-index: 50; height: 84px; display: flex; align-items: center;
  padding-inline: var(--gutter); justify-content: space-between; color: var(--fg);
  transition: background .5s var(--ease), height .5s var(--ease);
}
.site-header.is-solid { height: 68px; background: color-mix(in srgb, var(--bg) 92%, transparent); }
@media (hover: hover) and (pointer: fine) { /* frosted glass on desktop only: on phones re-blurring every frame costs smoothness */
  .site-header.is-solid { background: color-mix(in srgb, var(--bg) 78%, transparent); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); }
}

/* ---------- marquee ---------- */
[data-marquee] { overflow: hidden; white-space: nowrap; }
.marquee-track { display: flex; width: max-content; will-change: transform; } /* keep the endless band on the GPU */
.marquee-track > * { flex: none; padding-inline-end: .35em; }

/* ---------- stacking panels ---------- */
[data-stack] { position: relative; }
[data-stack] > * { position: relative; height: 100vh; height: 100svh; overflow: hidden; background: var(--bg); }
.stack-inner { position: absolute; inset: 0; overflow: hidden; transform-origin: 50% 0; will-change: transform; }
[data-zoom], [data-parallax], .h-track { will-change: transform; } /* scroll-driven: keep them on the GPU, no repaints */
.stack-dim { position: absolute; inset: 0; z-index: 5; background: #000; opacity: 0; pointer-events: none; }
[data-stack] + * { position: relative; z-index: 2; } /* the section after a stack slides over its last panel */

/* ---------- horizontal track ---------- */
[data-horizontal] { overflow: hidden; }
.h-track { display: flex; gap: clamp(16px, 2vw, 32px); width: max-content; height: 100vh; height: 100svh; align-items: center; padding-inline: var(--gutter); }

/* Touch screens: pin with CSS sticky (kit.js skips its JS pins there). The compositor moves sticky elements in step
   with native scrolling, so nothing trails the finger on iOS. overflow: clip (not hidden) keeps sticky working. */
@media not all and (hover: hover) and (pointer: fine) {
  [data-stack] > * { position: sticky; top: 0; }
  [data-horizontal] { overflow: clip; }
  [data-horizontal] .h-track { position: sticky; top: 0; }
}

/* Reduced motion: nothing pins, so horizontal tracks become native swipe rows (otherwise the cards are unreachable). */
@media (prefers-reduced-motion: reduce) {
  [data-horizontal] { overflow: visible; }
  .h-track {
    width: auto; height: auto; align-items: stretch; overflow-x: auto; overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory; scroll-padding-inline: var(--gutter); padding-block: clamp(72px, 12vh, 120px); scrollbar-width: none;
  }
  .h-track::-webkit-scrollbar { display: none; }
  .h-track > * { scroll-snap-align: start; }
}

/* ---------- preloader ---------- */
.preloader {
  position: fixed; inset: 0; z-index: 100; display: flex; align-items: flex-end; justify-content: space-between;
  padding: var(--gutter); background: var(--bg); color: var(--fg);
}
.preloader.is-done { display: none; }
.preloader-count { font: 400 clamp(80px, 16vw, 260px)/.8 var(--serif); font-variant-numeric: tabular-nums; }

/* ---------- cursor ---------- */
.kit-cursor {
  position: fixed; top: 0; left: 0; z-index: 90; width: 12px; height: 12px; margin: -6px 0 0 -6px;
  border-radius: 50%; background: var(--fg); pointer-events: none; mix-blend-mode: difference;
  opacity: 0; display: grid; place-items: center;
  transition: width .4s var(--ease), height .4s var(--ease), margin .4s var(--ease), opacity .3s;
}
.kit-cursor.is-visible { opacity: 1; }
.kit-cursor.is-hover { width: 44px; height: 44px; margin: -22px 0 0 -22px; }
.kit-cursor.has-label { width: 92px; height: 92px; margin: -46px 0 0 -46px; mix-blend-mode: normal; background: var(--accent); }
.kit-cursor-label { font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--ink); opacity: 0; transition: opacity .3s; }
.kit-cursor.has-label .kit-cursor-label { opacity: 1; }

/* ---------- film grain (add class "grain" to body) ---------- */
.grain::after {
  content: ''; position: fixed; inset: 0; z-index: 80; pointer-events: none; opacity: .06;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- placeholders (swap for real media) ---------- */
.ph { background: linear-gradient(135deg, #2b3a35, #121816 60%, #3d3427); }
.ph--2 { background: linear-gradient(160deg, #3a2f2a, #141110 55%, #2a3b44); }
.ph--3 { background: linear-gradient(200deg, #263447, #0f1216 60%, #46392b); }
.ph--4 { background: linear-gradient(120deg, #40382c, #131512 50%, #2c4038); }

/* ---------- Arabic / RTL ---------- */
[dir=rtl] body, body[dir=rtl] { font-family: var(--arabic); }
[dir=rtl] * { letter-spacing: 0 !important; } /* letter-spacing breaks Arabic joining */
[dir=rtl] .display, [dir=rtl] .h1, [dir=rtl] .h2, [dir=rtl] .h3 { font-family: var(--arabic); line-height: 1.3; }
[dir=rtl] em { font-style: normal; }

/* ---------- motion preferences ---------- */
@media (prefers-reduced-motion: reduce) {
  .preloader, .kit-cursor { display: none !important; }
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
@media (hover: none) { .kit-cursor, .grain::after { display: none; } } /* no cursor, no full-screen grain layer on touch screens */
