@font-face { font-family: "Manrope"; font-weight: 400; font-display: swap; src: url("/fonts/manrope-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Manrope"; font-weight: 500; font-display: swap; src: url("/fonts/manrope-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Manrope"; font-weight: 600; font-display: swap; src: url("/fonts/manrope-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Manrope"; font-weight: 700; font-display: swap; src: url("/fonts/manrope-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Sans 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-08FF, U+FB50-FDFF, U+FE70-FEFF; }
@font-face { font-family: "IBM Plex Sans 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-08FF, U+FB50-FDFF, U+FE70-FEFF; }
@font-face { font-family: "IBM Plex Sans 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-08FF, U+FB50-FDFF, U+FE70-FEFF; }
@font-face { font-family: "IBM Plex Sans Arabic"; font-weight: 700; font-display: swap; src: url("/fonts/ibm-plex-sans-arabic-arabic-700-normal.woff2") format("woff2"); unicode-range: U+0600-06FF, U+0750-077F, U+0870-08FF, U+FB50-FDFF, U+FE70-FEFF; }

:root {
  --ink: #14213D;
  --signal: #1F7A8C;
  --signal-light: #5FC3D2;
  --bg: #F3F5F8;
  --muted: #5B6573;
  --line: #DCE1E8;
  --surface: #FFFFFF;
  --font: "Manrope", "IBM Plex Sans Arabic", system-ui, sans-serif;
  --max: 1040px;
}
html[lang="ar"] { --font: "IBM Plex Sans Arabic", "Manrope", system-ui, sans-serif; }

* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }
html.i18n-pending body { visibility: hidden; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
html[lang="ar"] body { line-height: 1.8; }
a { color: inherit; }
img, svg { display: block; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--signal); outline-offset: 3px; }

.wrap { width: 100%; max-width: var(--max); margin-inline: auto; padding-inline: 16px; }
@media (min-width: 720px) { .wrap { padding-inline: 32px; } }

/* Header */
.site-header { padding-block: 20px; }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand { display: inline-flex; align-items: center; text-decoration: none; }
.brand img { height: 30px; width: auto; }
.nav-toggle { display: none; background: none; border: 1px solid var(--line); border-radius: 8px; padding: 6px 12px; font-size: 14px; cursor: pointer; }
.nav { display: flex; align-items: center; gap: 24px; font-size: 15px; }
.nav a { text-decoration: none; color: var(--muted); }
.nav a:hover, .nav a[aria-current="page"] { color: var(--ink); }
.nav a[aria-current="page"] { font-weight: 600; }
.lang-toggle { background: none; border: 1px solid var(--line); border-radius: 8px; padding: 4px 12px; cursor: pointer; font-size: 14px; color: var(--ink); }
.lang-toggle:hover { border-color: var(--ink); }
.lang-toggle span[lang="ar"] { font-family: "IBM Plex Sans Arabic", sans-serif; }
@media (max-width: 820px) {
  .nav-toggle { display: inline-block; }
  .site-header .wrap { flex-wrap: wrap; }
  .nav { display: none; width: 100%; flex-direction: column; align-items: flex-start; gap: 14px; padding-block: 12px 4px; border-top: 1px solid var(--line); margin-top: 12px; }
  .nav.open { display: flex; }
}

/* Footer */
.site-footer { margin-top: auto; border-top: 1px solid var(--line); padding-block: 28px; font-size: 14px; color: var(--muted); }
.site-footer .wrap { display: flex; flex-wrap: wrap; gap: 12px 28px; align-items: center; justify-content: space-between; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 8px 22px; }
.site-footer a { text-decoration: none; }
.site-footer a:hover { color: var(--ink); text-decoration: underline; }

/* Type */
main { padding-block: 40px 80px; }
.eyebrow { font-size: 13px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--signal); margin-bottom: 14px; }
html[lang="ar"] .eyebrow { letter-spacing: 0; text-transform: none; font-size: 14px; }
h1 { font-size: clamp(34px, 6vw, 56px); line-height: 1.08; letter-spacing: -0.02em; font-weight: 600; max-width: 18ch; }
html[lang="ar"] h1 { letter-spacing: 0; line-height: 1.3; }
h2 { font-size: clamp(24px, 3.4vw, 32px); line-height: 1.2; letter-spacing: -0.01em; font-weight: 600; margin-bottom: 14px; }
html[lang="ar"] h2 { letter-spacing: 0; line-height: 1.4; }
h3 { font-size: 18px; font-weight: 600; margin-bottom: 6px; }
p { max-width: 64ch; }
.lead { font-size: clamp(17px, 2vw, 20px); color: var(--muted); margin-top: 18px; }
.small { font-size: 14px; color: var(--muted); }
.prose p, .prose ul, .prose ol { margin-bottom: 16px; }
.prose ul, .prose ol { padding-inline-start: 22px; max-width: 64ch; }
.prose li { margin-bottom: 6px; }
.prose h2 { margin-top: 44px; }
.prose h3 { margin-top: 28px; }
.prose a { color: var(--signal); }

.section { padding-block: 56px; border-top: 1px solid var(--line); }
.section:first-of-type { border-top: 0; }
.page-head { padding-bottom: 24px; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; background: var(--ink); color: var(--bg); text-decoration: none; border: 0; border-radius: 10px; padding: 14px 26px; font-size: 16px; font-weight: 600; cursor: pointer; }
.btn:hover { background: #0B1426; }
.btn[disabled] { opacity: 0.45; cursor: not-allowed; }
.btn-ghost { background: none; color: var(--ink); border: 1px solid var(--line); }
.btn-ghost:hover { background: var(--surface); }

/* Home */
.hero { padding-block: 40px 64px; }
.hero .actions { margin-top: 32px; display: flex; flex-wrap: wrap; align-items: center; gap: 18px; }
.signal-rule { display: inline-flex; align-items: center; gap: 10px; }
.signal-rule::before { content: ""; width: 24px; height: 2px; background: var(--signal); flex: none; }
.steps { display: grid; gap: 24px; grid-template-columns: 1fr; margin-top: 28px; list-style: none; }
@media (min-width: 720px) { .steps { grid-template-columns: repeat(3, 1fr); } }
.steps li { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 24px; }
.step-n { font-size: 14px; font-weight: 600; color: var(--signal); margin-bottom: 10px; }
.counter { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; }
.counter strong { font-size: clamp(40px, 7vw, 64px); font-weight: 600; letter-spacing: -0.02em; line-height: 1; font-variant-numeric: tabular-nums; }
.note-card { display: block; text-decoration: none; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 24px; max-width: 640px; }
.note-card:hover { border-color: var(--ink); }
.note-card time { font-size: 14px; color: var(--muted); }
.note-card h3 { margin-top: 6px; }

/* Tests hub */
.test-grid { display: grid; gap: 16px; grid-template-columns: 1fr; margin-top: 8px; }
@media (min-width: 720px) { .test-grid { grid-template-columns: repeat(2, 1fr); } }
.test-card { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 24px; display: flex; flex-direction: column; gap: 10px; }
.test-card.soon { background: transparent; }
.test-card .meta { font-size: 14px; color: var(--muted); }
.test-card .btn { align-self: flex-start; margin-top: 8px; }
.badge { align-self: flex-start; font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); }
.badge.live { border-color: var(--signal); color: var(--signal); }

/* Lab notes */
.notes-list { list-style: none; display: grid; gap: 16px; }
.post { max-width: 680px; }
.post time { color: var(--muted); font-size: 14px; display: block; margin-bottom: 8px; }
.post h1 { font-size: clamp(30px, 5vw, 44px); margin-bottom: 28px; }

/* 404 */
.notfound { padding-block: 60px; }
.notfound .actions { margin-top: 28px; }

/* Tests hub: full test */
.full-card { margin-bottom: 40px; border-color: var(--ink); }
.single-head { font-size: 20px; margin-bottom: 16px; }

/* Language picker */
.lang-picker { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.lang-opt { background: none; border: 0; padding: 5px 10px; font-size: 13px; color: var(--muted); cursor: pointer; }
.lang-opt[lang="ar"] { font-family: "IBM Plex Sans Arabic", sans-serif; }
.lang-opt + .lang-opt { border-inline-start: 1px solid var(--line); }
.lang-opt[aria-current="true"] { background: var(--ink); color: var(--bg); }
.lang-opt:hover:not([aria-current="true"]) { color: var(--ink); }
/* Sign in link in the header: a small outlined button, so it doesn't read as a page */
.nav .nav-signin { border: 1px solid var(--line); border-radius: 8px; padding: 5px 12px; font-size: 14px; }
.nav .nav-signin:hover { border-color: var(--ink); }
