/* CHERT Learning Hub — public landing page.
 *
 * Every value here comes from branding/CHERT-Design-System.md (rule 2: the design
 * system is the single source of truth; never invent values). Logical properties
 * only — this is what makes the Arabic page mirror without a second stylesheet
 * (mandatory rule 14, DS §7.1).
 *
 * Fonts are the PROV-004 vendored files, self-hosted (Phase 05: zero external
 * font hosts). Playfair Display is not yet vendored, so the hero renders the
 * design system's own fallback (Georgia) until it is — see the Phase 10m record.
 */

@font-face {
  font-family: 'Inter';
  src: url('/landing-assets/fonts/InterVariable.woff2') format('woff2');
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: 'IBM Plex Sans Arabic';
  src: url('/landing-assets/fonts/IBMPlexSansArabic-Regular.woff2') format('woff2');
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: 'IBM Plex Sans Arabic';
  src: url('/landing-assets/fonts/IBMPlexSansArabic-SemiBold.woff2') format('woff2');
  font-weight: 600;
  font-display: swap;
}
@font-face {
  font-family: 'IBM Plex Sans Arabic';
  src: url('/landing-assets/fonts/IBMPlexSansArabic-Bold.woff2') format('woff2');
  font-weight: 700;
  font-display: swap;
}

:root {
  --chert-orange: #FF8651;
  --chert-orange-deep: #F26B33;
  --chert-tan: #D2B082;
  --chert-cream: #FFFAE4;
  --chert-ink: #1A1A18;
  --chert-surface: #FFFFFF;
  --chert-border: #ECE0C2;
  --chert-muted: #6B6B66;
  --chert-orange-tint: #FDEEE4;
  --chert-dark: #151311;
  --chert-dark-text: #F3EDE0;
  --chert-dark-muted: #A89E8D;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-card: 16px;
  --radius-pill: 40px;
  --shadow-card: 0 10px 30px -18px rgba(0, 0, 0, .2);
  --shadow-hover: 0 20px 40px -20px rgba(242, 107, 51, .4);
  --ease: cubic-bezier(.4, 0, .2, 1);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--chert-cream);
  color: var(--chert-ink);
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  font-size: 16px;
  line-height: 1.5;
}

/* DS §7.4 — Arabic: Plex, +1px, 1.7 line height, no italics, no letter-spacing. */
:lang(ar) body,
body:lang(ar) {
  font-family: 'IBM Plex Sans Arabic', 'Cairo', sans-serif;
  font-size: 17px;
  line-height: 1.7;
}
:lang(ar) em, :lang(ar) i { font-style: normal; font-weight: 700; }

a { color: var(--chert-ink); text-decoration: none; }
a:hover { color: var(--chert-orange-deep); }

.wrap { max-width: 1200px; margin-inline: auto; padding-inline: 24px; }

/* --- Buttons (DS §6.1: primary is ink text on orange — never white) ------------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border-radius: var(--radius-sm); font-size: 14px; font-weight: 700;
  padding: 11px 22px; transition: transform 150ms var(--ease), background 150ms var(--ease); }
.btn-primary { background: var(--chert-orange); color: var(--chert-ink); }
.btn-primary:hover { background: var(--chert-orange-deep); color: var(--chert-ink); transform: translateY(-1px); }
.btn-secondary { border: 1.5px solid var(--chert-ink); color: var(--chert-ink); padding: 10px 20px; }
.btn-secondary:hover { background: var(--chert-ink); color: var(--chert-cream); }
.btn-ghost { font-weight: 700; padding: 11px 8px; }
.btn-lg { padding: 14px 28px; font-size: 16px; }
.btn:focus-visible { outline: 2px solid var(--chert-ink); outline-offset: 2px; }

/* --- Header --------------------------------------------------------------------- */
.site-header { position: sticky; inset-block-start: 0; z-index: 100; background: var(--chert-cream);
  border-block-end: 1px solid var(--chert-border); }
.site-header .wrap { display: flex; align-items: center; gap: 24px; min-block-size: 72px; }
.lockup { display: flex; align-items: center; gap: 12px; }
.lockup img { block-size: 32px; inline-size: 32px; }
.lockup .wordmark { font-size: 18px; font-weight: 800; letter-spacing: .5px; direction: ltr; unicode-bidi: isolate; }
.lockup .wordmark span { font-weight: 500; }
.site-nav { display: flex; gap: 24px; margin-inline-start: 12px; }
.site-nav a { font-size: 14px; font-weight: 600; color: rgba(26, 26, 24, .85); }
.site-nav a:hover { color: var(--chert-ink); box-shadow: 0 2px 0 0 var(--chert-orange-deep); }
.header-actions { margin-inline-start: auto; display: flex; align-items: center; gap: 16px; }
.lang-switch { font-size: 14px; font-weight: 600; }

/* --- Hero ------------------------------------------------------------------------ */
.hero { text-align: center; padding-block: 96px; }
.hero .badge { display: inline-flex; padding: 6px 16px; border-radius: var(--radius-pill);
  background: var(--chert-orange-tint); font-size: 13px; font-weight: 600; }
.hero h1 { margin: 24px auto 0; max-width: 20ch;
  font-family: 'Playfair Display', Georgia, serif;
  font-size: clamp(36px, 5vw, 56px); font-weight: 700; line-height: 1.05; letter-spacing: -1.5px; }
:lang(ar) .hero h1 { font-family: inherit; line-height: 1.3; letter-spacing: normal; }
.hero p { margin: 24px auto 0; max-width: 60ch; font-size: 18px; color: var(--chert-muted); }
.hero-ctas { margin-block-start: 32px; display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }

/* --- Feature cards (DS §6.2) ----------------------------------------------------- */
.features { padding-block-end: 96px; }
.cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.card { background: var(--chert-surface); border: 1px solid var(--chert-border);
  border-radius: var(--radius-card); padding: 28px; box-shadow: var(--shadow-card);
  display: flex; flex-direction: column; gap: 16px;
  transition: transform 150ms var(--ease), box-shadow 150ms var(--ease); }
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-hover); }
.iconbox { inline-size: 46px; block-size: 46px; border-radius: var(--radius-md);
  background: var(--chert-orange-tint); display: flex; align-items: center; justify-content: center;
  color: var(--chert-ink); }
.card h3 { margin: 0; font-size: 22px; font-weight: 700; line-height: 1.25; }
:lang(ar) .card h3 { line-height: 1.4; }
.card p { margin: 0; font-size: 14px; color: var(--chert-muted); }
:lang(ar) .card p { font-size: 15px; }

/* --- How it works (white section — DS §5.7: alternate cream and white) ----------- */
.how { background: var(--chert-surface); padding-block: 96px; }
.overline { font-size: 12px; font-weight: 600; letter-spacing: 3px; text-transform: uppercase;
  color: var(--chert-muted); text-align: center; }
:lang(ar) .overline { letter-spacing: normal; text-transform: none; font-size: 13px; }
.how h2 { margin: 12px auto 0; text-align: center; font-size: 30px; font-weight: 700;
  line-height: 1.15; letter-spacing: -.5px; max-width: 30ch; }
:lang(ar) .how h2 { line-height: 1.4; letter-spacing: normal; }
.steps { margin-block-start: 48px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.step { display: flex; flex-direction: column; gap: 12px; }
.stepnum { font-family: 'JetBrains Mono', 'Consolas', monospace; font-size: 40px; font-weight: 600;
  color: var(--chert-tan); line-height: 1; direction: ltr; unicode-bidi: isolate; }
.step h3 { margin: 0; font-size: 22px; font-weight: 700; }
.step p { margin: 0; font-size: 14px; color: var(--chert-muted); }
:lang(ar) .step p { font-size: 15px; }

/* --- CTA band (tan) -------------------------------------------------------------- */
.cta-band { background: var(--chert-tan); padding-block: 64px; }
.cta-band .wrap { display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.cta-band h2 { margin: 0; font-size: 30px; font-weight: 700; letter-spacing: -.5px; }
:lang(ar) .cta-band h2 { letter-spacing: normal; }
.cta-band p { margin: 8px 0 0; color: rgba(26, 26, 24, .8); }

/* --- Footer (ink) ----------------------------------------------------------------- */
.site-footer { background: var(--chert-dark); color: var(--chert-dark-text); padding-block: 48px; }
.site-footer .wrap { display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.site-footer .star { color: var(--chert-orange); }
.footer-links { display: flex; gap: 24px; font-size: 14px; font-weight: 500; }
.footer-links a { color: var(--chert-dark-muted); }
.footer-links a:hover { color: var(--chert-dark-text); }
.copyright { font-size: 13px; color: var(--chert-dark-muted); }
.copyright .num { direction: ltr; unicode-bidi: isolate; }

/* --- Responsive (DS §5.3: 1 col under 640, 2 cols to 1023) ------------------------ */
@media (max-width: 1023px) {
  .cards, .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 639px) {
  .cards, .steps { grid-template-columns: 1fr; }
  .site-nav { display: none; }
  .hero { padding-block: 48px; }
  .features { padding-block-end: 48px; }
  .how { padding-block: 48px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}
