/* Dalil AI: Kufi grid direction. Tokens mirror src/site.mjs (check.mjs fails when they drift). */
@font-face { font-family: "Plex Arabic"; font-weight: 400; font-display: swap; src: url("/fonts/ibm-plex-sans-arabic-arabic-400-normal.woff2") format("woff2"); unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0898-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: "Plex Arabic"; font-weight: 500; font-display: swap; src: url("/fonts/ibm-plex-sans-arabic-arabic-500-normal.woff2") format("woff2"); unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0898-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: "Plex Arabic"; font-weight: 600; font-display: swap; src: url("/fonts/ibm-plex-sans-arabic-arabic-600-normal.woff2") format("woff2"); unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0898-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: "Plex Arabic"; font-weight: 400; font-display: swap; src: url("/fonts/ibm-plex-sans-arabic-latin-400-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Plex Arabic"; font-weight: 500; font-display: swap; src: url("/fonts/ibm-plex-sans-arabic-latin-500-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Plex Arabic"; font-weight: 600; font-display: swap; src: url("/fonts/ibm-plex-sans-arabic-latin-600-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

:root {
  --ink: #14213D;
  --paper: #FAF7F2;
  --surface: #FFFFFF;
  --sand: #F0E9DD;
  --accent: #E4572E;
  --accent-text: #B83A14;
  --teal: #2A9D8F;
  --teal-text: #1B6F65;
  --muted: #4A5670;
  --line: #E2D9C8;
  --u: 8px; /* the Kufi unit: spacing and radii are multiples of it, corners stay square */
  --font: "Plex Arabic", "Noto Sans Arabic", "Segoe UI", Tahoma, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 88px; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--font); font-size: 1.0625rem; line-height: 1.9; }
img, svg { display: block; max-width: 100%; height: auto; }
a { color: var(--accent-text); text-underline-offset: 4px; }
a:hover { color: var(--ink); }
:focus-visible { outline: 3px solid var(--teal); outline-offset: 3px; }
h1, h2, h3 { line-height: 1.35; margin: 0 0 calc(var(--u) * 2); font-weight: 600; letter-spacing: 0; }
h1 { font-size: clamp(2rem, 1.2rem + 3.4vw, 3.5rem); }
h2 { font-size: clamp(1.5rem, 1.2rem + 1.4vw, 2.125rem); }
h3 { font-size: 1.1875rem; }
p { margin: 0 0 calc(var(--u) * 2); }
.wrap { width: min(1180px, 100% - 40px); margin-inline: auto; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip { position: absolute; inset-inline-start: 16px; top: -60px; background: var(--ink); color: var(--paper); padding: 8px 16px; z-index: 20; }
.skip:focus { top: 16px; }
.eyebrow { color: var(--accent-text); font-weight: 600; font-size: .9375rem; margin-bottom: var(--u); }
.eyebrow::before { content: ""; display: inline-block; width: 8px; height: 8px; background: var(--accent); margin-inline-end: 10px; }

/* header */
.site-header { position: sticky; top: 0; z-index: 10; background: color-mix(in srgb, var(--paper) 92%, transparent); backdrop-filter: blur(8px); border-bottom: 2px solid var(--ink); }
.header-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 72px; }
.brand { display: inline-flex; align-items: center; gap: 12px; color: var(--ink); text-decoration: none; font-weight: 600; font-size: 1.25rem; }
.logo-mark { width: 58px; height: auto; fill: var(--ink); background: var(--paper); flex: none; }
.brand:hover .logo-mark { fill: var(--accent-text); }
.nav { display: flex; gap: 8px; }
.nav a { color: var(--ink); text-decoration: none; font-weight: 500; padding: 8px 14px; }
.nav a:hover { background: var(--ink); color: var(--paper); }

/* buttons */
.btn { display: inline-block; background: var(--ink); color: var(--paper); text-decoration: none; font-weight: 600; padding: 14px 28px; border: 2px solid var(--ink); box-shadow: -6px 6px 0 var(--accent); transition: transform .15s, box-shadow .15s; }
.btn:hover { color: var(--paper); transform: translate(-3px, 3px); box-shadow: -3px 3px 0 var(--accent); }
.btn-ghost { background: var(--paper); color: var(--ink); box-shadow: -6px 6px 0 var(--teal); }
.btn-ghost:hover { color: var(--ink); box-shadow: -3px 3px 0 var(--teal); }

/* hero */
.hero { padding-block: clamp(40px, 7vw, 96px); overflow: hidden; }
.hero-grid { display: grid; gap: 48px; align-items: center; }
.hero h1 .mark { background: linear-gradient(transparent 62%, color-mix(in srgb, var(--accent) 38%, transparent) 62%); }
.hero-sub { font-size: 1.1875rem; color: var(--muted); max-width: 34em; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 24px; margin-top: 32px; }
.hero-media { position: relative; }
.hero-media img { position: relative; z-index: 1; border: 2px solid var(--ink); aspect-ratio: 4 / 3; object-fit: cover; width: 100%; }
.hero-kufi { position: absolute; z-index: 0; inset-block-end: -28px; inset-inline-start: -28px; width: 46%; aspect-ratio: 1; }
.hero-kufi .kufi { width: 100%; height: 100%; fill: var(--teal); }
@media (min-width: 900px) { .hero-grid { grid-template-columns: 1.05fr 1fr; } }

/* hello */
.hello { background: var(--sand); padding-block: 56px; border-block: 2px solid var(--ink); }
.hello-grid { display: grid; gap: 32px; align-items: center; }
.portrait { width: min(220px, 50vw); aspect-ratio: 3 / 4; object-fit: cover; border: 2px solid var(--ink); box-shadow: -10px 10px 0 var(--accent); }
.hello-title { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.name-img { height: 1.15em; width: auto; display: inline-block; }
.name-lat { height: 1.1rem; margin-top: 6px; }
.hello p { max-width: 46em; }
@media (min-width: 700px) { .hello-grid { grid-template-columns: 220px 1fr; gap: 56px; } }

/* rooms */
.rooms { padding-block: 64px 0; }
.rooms-grid { display: grid; gap: 24px; }
.room { position: relative; display: block; border: 2px solid var(--ink); overflow: hidden; color: var(--ink); text-decoration: none; }
.room img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; transition: transform .4s; }
.room:hover img { transform: scale(1.04); }
.room-label { position: absolute; inset-block-end: 0; inset-inline-start: 0; background: var(--paper); border-block-start: 2px solid var(--ink); border-inline-end: 2px solid var(--ink); padding: 10px 20px; display: grid; line-height: 1.5; }
.room-label strong { font-size: 1.1875rem; }
.room-label span { color: var(--muted); font-size: .9375rem; }
@media (min-width: 700px) { .rooms-grid { grid-template-columns: 1fr 1fr; } }

/* library */
.library { padding-block: 72px; }
.section-sub { color: var(--muted); }
.filters { display: grid; gap: 16px; margin-block: 28px 12px; }
.search input { width: 100%; font: inherit; color: var(--ink); background: var(--surface); border: 2px solid var(--ink); padding: 14px 18px; border-radius: 0; }
.search input::placeholder { color: var(--muted); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { font: inherit; font-size: .9375rem; font-weight: 500; color: var(--ink); background: var(--surface); border: 2px solid var(--ink); padding: 6px 16px; cursor: pointer; }
.chip:hover { background: var(--sand); }
.chip.is-active { background: var(--ink); color: var(--paper); }
.count { color: var(--muted); font-size: .9375rem; }
.cards { list-style: none; margin: 0; padding: 0; display: grid; gap: 28px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); }
.card { background: var(--surface); border: 2px solid var(--ink); transition: transform .15s, box-shadow .15s; }
.card:hover, .card:focus-within { transform: translate(3px, -3px); box-shadow: -6px 6px 0 var(--ink); }
.card-link { display: grid; grid-template-rows: auto 1fr; height: 100%; color: inherit; text-decoration: none; }
.card-head { display: flex; align-items: center; gap: 12px; margin: 0; padding: 10px 22px; border-bottom: 2px solid var(--ink); color: var(--ink); font-weight: 600; font-size: .9375rem; line-height: 1.6; }
.card-head .tag-new { margin-inline-start: auto; }
.cat-icon { width: 26px; height: 26px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linejoin: miter; stroke-linecap: square; }
.card-head.cover-basics, .card-head.cover-career { color: var(--paper); }
.cover-basics .cat-icon { color: var(--accent); }
.cover-career .cat-icon { color: var(--teal); }
.cover-business .cat-icon { color: var(--accent-text); }
.cover-learning .cat-icon { color: var(--teal-text); }
.cover-basics, .cover-career { background: var(--ink); }
.cover-basics .g-head-kufi svg { fill: var(--accent); }
.cover-career .g-head-kufi svg { fill: var(--teal); }
.cover-work, .cover-business { background: var(--sand); }
.cover-work .g-head-kufi svg { fill: var(--ink); }
.cover-business .g-head-kufi svg { fill: var(--accent-text); }
.cover-learning, .cover-daily { background: #DDEFEB; }
.cover-learning .g-head-kufi svg { fill: var(--teal-text); }
.cover-daily .g-head-kufi svg { fill: var(--ink); }
.card-body { padding: 20px 22px 22px; display: flex; flex-direction: column; }
.card-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.tag { font-size: .8125rem; font-weight: 600; line-height: 1.6; padding: 2px 10px; border: 1.5px solid var(--ink); background: var(--paper); color: var(--ink); }
.tag-new { background: var(--accent-text); border-color: var(--accent-text); color: var(--surface); }
.card-title { font-size: 1.1875rem; margin-bottom: 10px; }
.card-lead { color: var(--muted); font-size: .9688rem; line-height: 1.8; }
.card-meta { margin: auto 0 0; padding-top: 12px; border-top: 1.5px solid var(--line); display: flex; gap: 18px; color: var(--muted); font-size: .875rem; }
.empty { padding: 32px; border: 2px dashed var(--ink); text-align: center; }

/* band */
.band { position: relative; border-block: 2px solid var(--ink); background: var(--sand); }
.band-img { width: 100%; aspect-ratio: 21 / 9; max-height: 420px; object-fit: cover; }
.band-copy { padding-block: 40px; }
.band-copy p { max-width: 44em; color: var(--muted); margin: 0; }

/* guide */
.g-head { position: relative; overflow: hidden; border-bottom: 2px solid var(--ink); }
.g-head-kufi { position: absolute; inset: 0; opacity: .16; }
.g-head-kufi svg { width: 100%; height: 100%; }
.g-head-inner { position: relative; padding-block: 48px 56px; max-width: 900px; }
.g-head.cover-basics, .g-head.cover-career { color: var(--paper); }
.g-head.cover-basics a.back, .g-head.cover-career a.back { color: var(--paper); }
.g-head h1 { font-size: clamp(1.75rem, 1.2rem + 2.2vw, 2.75rem); }
.g-lead { font-size: 1.1875rem; max-width: 40em; }
.back { font-weight: 500; }
.back::before { content: ""; display: inline-block; width: 8px; height: 8px; border-block-start: 2px solid currentColor; border-inline-end: 2px solid currentColor; transform: rotate(45deg); margin-inline-end: 10px; }
.badges { list-style: none; display: flex; flex-wrap: wrap; gap: 10px; padding: 0; margin: 20px 0 12px; }
.badges li { background: var(--paper); color: var(--ink); border: 1.5px solid var(--ink); padding: 2px 14px; font-size: .9375rem; font-weight: 500; }
.badges li::before { content: ""; display: inline-block; width: 8px; height: 8px; background: var(--teal); margin-inline-end: 8px; }
.g-meta { display: flex; flex-wrap: wrap; gap: 8px 24px; font-size: .9375rem; margin: 0; opacity: .9; }
.g-grid { display: grid; gap: 32px; padding-block: 48px 72px; }
.toc { border: 2px solid var(--ink); background: var(--surface); padding: 20px 24px; align-self: start; }
.toc h2 { font-size: 1rem; margin-bottom: 8px; }
.toc ol { margin: 0; padding-inline-start: 1.2em; font-size: .9688rem; }
.toc a { color: var(--ink); text-decoration: none; }
.toc a:hover { text-decoration: underline; }
.g-body { min-width: 0; max-width: 760px; }
.g-intro { font-size: 1.1875rem; border-inline-start: 6px solid var(--accent); padding-inline-start: 20px; }
.g-section { margin-top: 48px; }
.steps { padding-inline-start: 1.4em; }
.steps li { margin-bottom: 10px; padding-inline-start: 6px; }
.steps li::marker { color: var(--accent-text); font-weight: 600; }
.prompt { margin: 24px 0; border: 2px solid var(--ink); background: var(--surface); box-shadow: -6px 6px 0 var(--sand); }
.prompt figcaption { display: flex; align-items: center; justify-content: space-between; gap: 12px; background: var(--ink); color: var(--paper); padding-block: 8px; padding-inline: 16px 8px; font-weight: 500; font-size: .9375rem; }
.copy { font: inherit; font-size: .875rem; font-weight: 600; cursor: pointer; background: var(--paper); color: var(--ink); border: 0; padding: 4px 18px; min-width: 96px; }
.copy:hover { background: var(--accent); color: var(--ink); }
.copy.is-done { background: var(--teal); color: var(--ink); }
.prompt pre { margin: 0; padding: 18px 20px; white-space: pre-wrap; overflow-wrap: anywhere; font-family: var(--font); font-size: 1rem; line-height: 1.95; text-align: start; unicode-bidi: plaintext; }
.g-note { margin-top: 56px; background: var(--sand); border: 2px solid var(--ink); padding: 24px 28px; }
.g-note h2 { font-size: 1.1875rem; }
.g-note p:last-child { margin-bottom: 0; }
.related { background: var(--sand); border-top: 2px solid var(--ink); padding-block: 56px; }
@media (min-width: 960px) { .g-grid { grid-template-columns: 260px 1fr; gap: 56px; } .toc { position: sticky; top: 100px; } }

/* legal */
.legal { padding-block: 48px 80px; max-width: 800px; }
.legal h2 { margin-top: 40px; font-size: 1.375rem; }
.legal h3 { margin-top: 24px; font-size: 1.0625rem; }
.ltr { text-align: left; border: 2px solid var(--ink); background: var(--surface); padding: 8px 28px 24px; margin-block: 24px; line-height: 1.7; }

/* footer */
.site-footer { background: var(--ink); color: var(--paper); }
.kufi-band { width: 100%; height: 24px; fill: var(--accent); background: var(--ink); }
.footer-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 20px; padding-block: 32px 12px; }
.site-footer .brand { color: var(--paper); }
.site-footer .logo-mark { fill: var(--paper); background: transparent; }
.footer-nav { display: flex; flex-wrap: wrap; gap: 8px 24px; }
.footer-nav a { color: var(--paper); }
.footer-note { font-size: .875rem; opacity: .8; padding-bottom: 28px; margin: 0; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }
