/* ============================================================
   AI Radar — design tokens
   Locked in docs/DESIGN.md. Every value here traces to that spec.

   Dark is the primary theme. The neutral carries a faint cool-green
   cast so it relates to the accent rather than reading as stock grey.
   ============================================================ */

:root {
  /* Light theme lives on the bare :root so the page renders correctly
     before the theme script runs. */
  --bg: #ffffff;
  --surface: #f8f9fa;
  --surface-2: #f1f3f5;
  --border: #e4e7eb;
  --border-lift: #cfd5dc;

  --text: #101418;
  --text-2: #5b6570;
  --text-3: #7c8590;

  /* Radar Green. Darkened here — #3DDC97 fails contrast on white. */
  --accent: #0b8e5c;
  --accent-quiet: #d7f2e6;

  --warn: #9a6410;
  --danger: #c0393d;

  /* Category hues. Label text only — never a fill, border or dot. */
  --cat-model: #6d3fd4;
  --cat-tool: #0a7f95;
  --cat-update: #1d5fd0;
  --cat-pricing: #9a6410;
  --cat-research: #4d5866;
  --cat-news: #0b8e5c;

  /* Newsreader: editorial authority at headline sizes.
     Geist: a clean grotesque with warmer curves and a taller x-height
     than Inter, which is the default of every dashboard on the web and
     made a publication read like an admin panel.
     JetBrains Mono: metadata, which is what creates the instrument feel. */
  --font-serif: 'Newsreader', ui-serif, Georgia, 'Times New Roman', serif;
  --font-sans: 'Geist', -apple-system, BlinkMacSystemFont, 'Segoe UI',
    Roboto, 'Helvetica Neue', Arial, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas,
    monospace;

  --s1: 4px;
  --s2: 8px;
  --s3: 12px;
  --s4: 16px;
  --s5: 20px;
  --s6: 24px;
  --s7: 28px;
  --s8: 32px;
  --s10: 40px;
  --s14: 56px;

  /* Section rhythm is the main instrument of "calm". */
  --section-gap: 56px;

  --radius-card: 10px;
  --radius-chip: 5px;

  /* Reading measures. Applied to PROSE, never to page structure — that
     mistake is what squashed the build-status page into a narrow column. */
  --measure: 66ch;
  --measure-card: 62ch;

  /* Wide enough that a 300px rail still leaves the main column a
     comfortable reading width rather than squeezing it. */
  --page-max: 1340px;
  --rail: 300px;
  --header-h: 60px;

  --t-fast: 120ms ease-out;
  --t-base: 150ms ease-out;
}

/* System dark: no data-theme is stamped, so only the media query
   separates light from dark. Guarded so an explicit light choice still
   beats a dark OS. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --bg: #0b0d11;
    --surface: #12151b;
    --surface-2: #181c23;
    --border: #222731;
    --border-lift: #2e353f;

    --text: #e9ecef;
    --text-2: #9aa3ae;
    --text-3: #6e7681;

    --accent: #3ddc97;
    --accent-quiet: #1c5240;

    --warn: #e8a33d;
    --danger: #e5565b;

    --cat-model: #a78bfa;
    --cat-tool: #22d3ee;
    --cat-update: #60a5fa;
    --cat-pricing: #e8a33d;
    --cat-research: #94a3b8;
    --cat-news: #3ddc97;
  }
}

/* Explicit dark choice wins in the other direction. */
:root[data-theme='dark'] {
  --bg: #0b0d11;
  --surface: #12151b;
  --surface-2: #181c23;
  --border: #222731;
  --border-lift: #2e353f;

  --text: #e9ecef;
  --text-2: #9aa3ae;
  --text-3: #6e7681;

  --accent: #3ddc97;
  --accent-quiet: #1c5240;

  --warn: #e8a33d;
  --danger: #e5565b;

  --cat-model: #a78bfa;
  --cat-tool: #22d3ee;
  --cat-update: #60a5fa;
  --cat-pricing: #e8a33d;
  --cat-research: #94a3b8;
  --cat-news: #3ddc97;
}

/* ------------------------------------------------------------ reset */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1,
h2,
h3,
h4 {
  margin: 0;
  font-weight: 500;
  line-height: 1.25;
  text-wrap: balance;
}

p {
  margin: 0;
  text-wrap: pretty;
}

a {
  color: inherit;
  text-decoration: none;
}

img,
svg {
  display: block;
  max-width: 100%;
}

ul,
ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: none;
  cursor: pointer;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 2px;
}

/* ------------------------------------------------------- type scale
   A 1.25 ratio rounded to whole pixels. Nothing off this scale. */

.t-hero {
  font-family: var(--font-serif);
  font-size: 38px;
  line-height: 44px;
  font-weight: 500;
  letter-spacing: -0.015em;
}

.t-display {
  font-family: var(--font-serif);
  font-size: 30px;
  line-height: 36px;
  font-weight: 500;
  letter-spacing: -0.01em;
}

.t-h1 {
  font-family: var(--font-serif);
  font-size: 26px;
  line-height: 32px;
  font-weight: 500;
}

.t-card-lg {
  font-family: var(--font-serif);
  font-size: 20px;
  line-height: 28px;
  font-weight: 500;
}

.t-card {
  font-family: var(--font-sans);
  font-size: 16.5px;
  line-height: 24px;
  font-weight: 550;
}

.t-row {
  font-family: var(--font-sans);
  font-size: 15.5px;
  line-height: 22px;
  font-weight: 500;
}

.t-body {
  font-size: 16px;
  line-height: 27px;
}

.t-body-sm {
  font-size: 14.5px;
  line-height: 23px;
}

/* Secondary but never small enough to strain. */
.t-meta {
  font-family: var(--font-mono);
  font-size: 12.5px;
  line-height: 16px;
  font-weight: 500;
  color: var(--text-2);
}

.t-label {
  font-family: var(--font-mono);
  font-size: 10.5px;
  line-height: 14px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* --------------------------------------------------------- structure */

.page {
  width: 100%;
  max-width: var(--page-max);
  margin-inline: auto;
  /* Side padding set once. padding-block, never a shorthand that would
     zero the sides. */
  padding-inline: var(--s6);
}

@media (max-width: 720px) {
  .page {
    padding-inline: var(--s4);
  }
}

.section {
  margin-top: var(--section-gap);
}

@media (max-width: 720px) {
  .section {
    margin-top: var(--s10);
  }
}

/* Sections separate by space plus a small header — not by boxes. */
.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--s4);
  padding-bottom: var(--s3);
  border-bottom: 1px solid var(--border);
  margin-bottom: var(--s5);
}

.section-title {
  font-family: var(--font-sans);
  font-size: 19px;
  line-height: 26px;
  font-weight: 600;
}

.section-link {
  font-family: var(--font-mono);
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-2);
  transition: color var(--t-fast);
  white-space: nowrap;
}

.section-link:hover {
  color: var(--accent);
}

/* Two-column asymmetric. Not a three-column dashboard. */
.split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--rail);
  gap: var(--s10);
  align-items: start;
}

@media (max-width: 1080px) {
  .split {
    grid-template-columns: minmax(0, 1fr);
  }
}

.prose {
  max-width: var(--measure);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ------------------------------------------------------------ motion
   The LIVE dot is the entire radar motif and the only ambient
   animation on the site. */

.live-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  flex: none;
  animation: live-pulse 2s ease-in-out infinite;
}

@keyframes live-pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.35;
  }
}

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

/* ==========================================================
   COMPONENTS
   Four card treatments, and the densest tier has no card at all.
   That is what enforces "not every item needs a heavy box".
   ========================================================== */

/* ------------------------------------------------------------ header */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--header-h);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}

.site-header-inner {
  height: 100%;
  display: flex;
  align-items: center;
  gap: var(--s8);
}

.brand {
  display: flex;
  align-items: center;
  gap: var(--s2);
  font-family: var(--font-serif);
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.01em;
  flex: none;
}

.nav {
  display: flex;
  align-items: center;
  gap: var(--s5);
  overflow-x: auto;
  scrollbar-width: none;
}

.nav::-webkit-scrollbar {
  display: none;
}

.nav a {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-2);
  white-space: nowrap;
  transition: color var(--t-fast);
}

.nav a:hover {
  color: var(--text);
}

.nav a[aria-current='page'] {
  color: var(--accent);
}

.header-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: var(--s3);
  flex: none;
}

.icon-btn {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: var(--radius-chip);
  color: var(--text-2);
  transition: background var(--t-fast), color var(--t-fast);
}

.icon-btn:hover {
  background: var(--surface-2);
  color: var(--text);
}

@media (max-width: 720px) {
  .site-header {
    height: 52px;
  }
  .nav {
    display: none;
  }
}

/* ------------------------------------------------- daily overview
   Tier 1. Full width, no card. The answer to "what happened today?" */

.overview {
  padding-top: var(--s10);
}

.overview-meta {
  display: flex;
  align-items: center;
  gap: var(--s4);
  flex-wrap: wrap;
  margin-bottom: var(--s4);
}

.live {
  display: inline-flex;
  align-items: center;
  gap: var(--s2);
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}

.overview-headline {
  max-width: 22ch;
}

/* Numbered list. The numbers encode rank by importance — real
   information, not decoration. */
.top-list {
  margin-top: var(--s7);
  border-top: 1px solid var(--border);
}

.top-item {
  border-bottom: 1px solid var(--border);
}

.top-item a {
  display: grid;
  grid-template-columns: 2.5rem minmax(0, 1fr) auto;
  align-items: baseline;
  gap: var(--s4);
  padding: var(--s4) 0;
  transition: color var(--t-fast);
}

.top-item a:hover {
  color: var(--accent);
}

.top-num {
  font-family: var(--font-mono);
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
}

.top-title {
  font-size: 17px;
  line-height: 25px;
  font-weight: 500;
}

@media (max-width: 720px) {
  .top-item a {
    grid-template-columns: 1.9rem minmax(0, 1fr);
    gap: var(--s3);
    padding: var(--s3) 0;
  }
  .top-title {
    font-size: 16px;
    line-height: 23px;
  }
  .top-item .cat {
    grid-column: 2;
    margin-top: var(--s1);
  }
}

/* Counters: a quiet line of text, not a grid of stat tiles. */
.counts {
  margin-top: var(--s5);
  display: flex;
  flex-wrap: wrap;
  gap: var(--s2) var(--s5);
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--text-2);
}

.counts b {
  color: var(--text);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

/* -------------------------------------------------- category label
   Colour lives on the label text only. Never a fill or a dot. */

.cat {
  font-family: var(--font-mono);
  font-size: 10.5px;
  line-height: 14px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}

.cat-model { color: var(--cat-model); }
.cat-tool { color: var(--cat-tool); }
.cat-update { color: var(--cat-update); }
.cat-pricing { color: var(--cat-pricing); }
.cat-research { color: var(--cat-research); }
.cat-news { color: var(--cat-news); }
.cat-sponsored { color: var(--text-3); }

/* ------------------------------------------------------------- cards */

/* Tier 2: hero. The only element with both a surface and an accent. */
.card-hero {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: var(--s6);
  overflow: hidden;
  transition: border-color var(--t-base);
}

/* A 1px rule, not a 4px bar. */
/* A 1px rule, not a 4px bar. Inset by the border width so it is not
   clipped by the card's own border at the reading-start edge — in RTL
   that edge is on the right, where the clipping was visible. */
.card-hero::before {
  content: '';
  position: absolute;
  inset-block: -1px;
  inset-inline-start: -1px;
  width: 2px;
  background: var(--accent);
}

.card-hero:hover {
  border-color: var(--border-lift);
}

.card-hero .card-title {
  margin-top: var(--s3);
}

/* Tier 3: standard. Surface, no accent. */
.card-std {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: var(--s5);
  transition: border-color var(--t-base);
  display: flex;
  flex-direction: column;
  gap: var(--s3);
}

.card-std:hover {
  border-color: var(--border-lift);
}

/* Tier 4: compact. Border only, no fill. */
.card-compact {
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: var(--s4);
  transition: border-color var(--t-base);
  display: flex;
  flex-direction: column;
  gap: var(--s2);
  height: 100%;
}

.card-compact:hover {
  border-color: var(--border-lift);
}

.card-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--s3);
}

.card-title {
  transition: color var(--t-fast);
}

a:hover .card-title {
  color: var(--accent);
}

.card-summary {
  color: var(--text-2);
  /* min() so the measure caps wide cards without fighting a narrow grid
     track — a hard ch value inside a 240px column forces ragged wrapping. */
  max-width: min(var(--measure-card), 100%);
}

/* Why-it-matters: the product differentiator, so it gets a distinct
   but quiet treatment. The mono label does the work — no icon, no
   coloured box, no left border. */
.why {
  margin-top: var(--s1);
}

.why-label {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: var(--s1);
}

.why-text {
  color: var(--text);
  max-width: min(var(--measure-card), 100%);
}

.card-foot {
  display: flex;
  align-items: center;
  gap: var(--s4);
  flex-wrap: wrap;
  margin-top: var(--s2);
  padding-top: var(--s3);
  border-top: 1px solid var(--border);
}

.card-compact .card-foot {
  margin-top: auto;
  border-top: none;
  padding-top: var(--s1);
}

.worth {
  display: inline-flex;
  align-items: center;
  gap: var(--s1);
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 600;
  color: var(--accent);
  white-space: nowrap;
}

.source-link {
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--text-2);
  transition: color var(--t-fast);
}

.source-link:hover {
  color: var(--accent);
}

.dot-sep {
  color: var(--text-3);
}

/* Tier 5: editorial rows. No card at all. */
.row-list {
  border-top: 1px solid var(--border);
}

.story-row {
  border-bottom: 1px solid var(--border);
}

.story-row a {
  display: grid;
  grid-template-columns: 3.2rem 6.5rem minmax(0, 1fr) auto;
  align-items: baseline;
  gap: var(--s4);
  padding: var(--s4) 0;
  transition: color var(--t-fast);
}

.story-row a:hover {
  color: var(--accent);
}

.row-time {
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
}

@media (max-width: 720px) {
  .story-row a {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: var(--s1) var(--s3);
    padding: var(--s3) 0;
  }
  .story-row .row-time {
    grid-row: 2;
  }
  .story-row .cat {
    grid-row: 2;
    justify-self: start;
  }
  .story-row .t-row {
    grid-column: 1 / -1;
  }
  .story-row .source-link {
    display: none;
  }
}

/* ------------------------------------------------------------- grids */

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--s4);
}

/* auto-fill with a sensible minimum, not a fixed four tracks: with two
   items a rigid 4-up grid produced columns so narrow that titles wrapped
   every two words. Cards now size to their content and the row fills. */
.grid-4 {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: var(--s4);
}

.stack {
  display: flex;
  flex-direction: column;
  gap: var(--s4);
}

@media (max-width: 900px) {
  .grid-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .grid-2,
  .grid-4 {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* -------------------------------------------------------------- rail
   Secondary by construction. Starts below the daily overview so the
   overview reads full width. */

.rail {
  display: flex;
  flex-direction: column;
  gap: var(--s8);
}

.rail-head {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-3);
  padding-bottom: var(--s3);
  border-bottom: 1px solid var(--border);
  margin-bottom: var(--s3);
}

.rail-list li + li {
  margin-top: var(--s3);
  padding-top: var(--s3);
  border-top: 1px solid var(--border);
}

.rail-list a {
  display: grid;
  grid-template-columns: 1.4rem minmax(0, 1fr);
  gap: var(--s2);
  align-items: baseline;
  font-size: 14.5px;
  line-height: 21px;
  transition: color var(--t-fast);
}

.rail-list a:hover {
  color: var(--accent);
}

.rail-num {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
}

.rail-tick {
  color: var(--accent);
  font-size: 12px;
}

@media (max-width: 1080px) {
  .rail {
    flex-direction: row;
    flex-wrap: wrap;
    gap: var(--s8);
  }
  .rail > * {
    flex: 1 1 260px;
  }
}

/* --------------------------------------------------------------- ads
   56px clear space above and below. Never crowded against content. */

.ad-slot {
  margin-block: var(--s14);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--s2);
}

.ad-label {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-3);
}

.rail .ad-slot {
  margin-block: 0;
}

/* --------------------------------------------------- empty & loading
   A quiet day is a valid outcome, so it gets written copy rather than
   an apology or an illustration. */

.empty {
  padding: var(--s10) 0;
  color: var(--text-2);
  max-width: var(--measure);
}

.empty-title {
  font-family: var(--font-serif);
  font-size: 20px;
  line-height: 28px;
  color: var(--text);
  margin-bottom: var(--s2);
}

.skeleton {
  background: var(--surface-2);
  border-radius: var(--radius-chip);
  animation: skel 1.4s ease-in-out infinite;
}

@keyframes skel {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.55; }
}

/* ------------------------------------------------------------ footer */

.site-footer {
  margin-top: var(--s14);
  padding-block: var(--s8);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--s5);
  flex-wrap: wrap;
}

.footer-links {
  display: flex;
  gap: var(--s5);
  flex-wrap: wrap;
}

.footer-links a {
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--text-2);
  transition: color var(--t-fast);
}

.footer-links a:hover {
  color: var(--accent);
}

.footer-promise {
  font-family: var(--font-serif);
  font-size: 14.5px;
  color: var(--text-3);
}

/* ==========================================================
   ARABIC / RTL
   See docs/DESIGN.md section 11.

   Almost nothing here is a layout override: the whole stylesheet
   uses logical properties (padding-inline, inset-inline-start,
   margin-inline), so dir="rtl" mirrors the page on its own. What
   follows is the part that genuinely differs — typefaces, size,
   line height, and the handful of glyphs that must flip.
   ========================================================== */

:root[lang='ar'] {
  /* The Latin pairing does not carry over. Noto Kufi Arabic is
     geometric and editorial at headline weight; IBM Plex Sans
     Arabic has the best screen legibility in the range we need. */
  --font-serif: 'Noto Kufi Arabic', 'IBM Plex Sans Arabic', system-ui, sans-serif;
  --font-sans: 'IBM Plex Sans Arabic', 'Geist', system-ui, -apple-system, sans-serif;
  /* Arabic has no mono tradition for metadata, and forcing a Latin
     mono onto Arabic text looks wrong. The mono role is dropped. */
  --font-mono: 'IBM Plex Sans Arabic', system-ui, sans-serif;
}

/* Arabic letterforms carry more detail at the same nominal size, and
   ascenders/descenders need more room. Both adjustments are
   legibility, not preference. */
:root[lang='ar'] body {
  font-size: 17px;
  line-height: 1.85;
}

:root[lang='ar'] .t-hero {
  font-size: 40px;
  line-height: 60px;
  letter-spacing: 0;
}

:root[lang='ar'] .t-display {
  font-size: 32px;
  line-height: 50px;
  letter-spacing: 0;
}

:root[lang='ar'] .t-h1 {
  font-size: 28px;
  line-height: 44px;
}

:root[lang='ar'] .t-card-lg {
  font-size: 21px;
  line-height: 36px;
}

:root[lang='ar'] .t-card {
  font-size: 17px;
  line-height: 30px;
}

:root[lang='ar'] .t-row,
:root[lang='ar'] .top-title {
  font-size: 16.5px;
  line-height: 28px;
}

:root[lang='ar'] .t-body {
  font-size: 17px;
  line-height: 31px;
}

:root[lang='ar'] .t-body-sm {
  font-size: 15.5px;
  line-height: 28px;
}

:root[lang='ar'] .t-meta,
:root[lang='ar'] .row-time,
:root[lang='ar'] .source-link,
:root[lang='ar'] .counts,
:root[lang='ar'] .rail-num,
:root[lang='ar'] .top-num {
  font-size: 13.5px;
  line-height: 22px;
}

/* Arabic has no case, so uppercase is a no-op at best. Letter-spacing
   actively breaks Arabic letter joining, so both are removed wherever
   the Latin design applied them. */
:root[lang='ar'] .cat,
:root[lang='ar'] .t-label,
:root[lang='ar'] .why-label,
:root[lang='ar'] .rail-head,
:root[lang='ar'] .live,
:root[lang='ar'] .ad-label {
  text-transform: none;
  letter-spacing: 0;
  font-size: 12px;
}

:root[lang='ar'] .worth {
  font-size: 13px;
  letter-spacing: 0;
}

/* Western numerals throughout: this audience reads version numbers and
   prices as 0-9, and Eastern Arabic numerals would make "GPT-5" odd. */
:root[lang='ar'] {
  font-variant-numeric: normal;
}

:root[lang='ar'] .top-num,
:root[lang='ar'] .rail-num,
:root[lang='ar'] .counts b,
:root[lang='ar'] .row-time {
  font-feature-settings: 'tnum';
}

/* ------------------------------------------------------ direction */

/* Arrow glyphs are content, not layout, so they do not mirror on
   their own. The pseudo-elements let the same component markup serve
   both directions. */
[dir='rtl'] .section-link .arrow,
[dir='rtl'] .source-link .arrow {
  display: inline-block;
  transform: scaleX(-1);
}

/* The brand mark keeps its own orientation — a radar is symmetrical,
   and flipping it would only shift the accent dot. */
[dir='rtl'] .brand svg {
  transform: none;
}

/* Latin runs inside Arabic prose (product names, version numbers)
   stay LTR. The browser bidi algorithm already does this correctly;
   isolate prevents a trailing number from dragging punctuation. */
[dir='rtl'] .card-title,
[dir='rtl'] .top-title,
[dir='rtl'] .t-row,
[dir='rtl'] .card-summary,
[dir='rtl'] .why-text {
  unicode-bidi: isolate;
}

/* Outbound host names are always Latin, so they read LTR even in an
   RTL line. */
[dir='rtl'] .source-link {
  direction: ltr;
  unicode-bidi: embed;
}

/* ------------------------------------------------ language switcher */

.lang-switch {
  display: inline-flex;
  align-items: center;
  height: 34px;
  padding-inline: var(--s3);
  border-radius: var(--radius-chip);
  border: 1px solid var(--border);
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-2);
  white-space: nowrap;
  transition: border-color var(--t-fast), color var(--t-fast);
}

.lang-switch:hover {
  border-color: var(--border-lift);
  color: var(--text);
}

/* The switcher always renders the OTHER language's name in that
   language, so it is legible to the reader who wants it. */
:root[lang='ar'] .lang-switch {
  font-family: 'Inter Tight', system-ui, sans-serif;
}

/* The meta line mixes an RTL company name with an LTR time token. In
   RTL the two collided ("2س - Mistral AI" ran together), so isolate the
   whole line and let the bidi algorithm order the runs properly. */
/* Same bidi fix as .card-head: a mixed RTL company name and LTR time
   token ran together without isolation. Applied to the story header
   too, which has the same shape. */
[dir='rtl'] .story-meta .t-meta,
[dir='rtl'] .card-head .t-meta {
  unicode-bidi: isolate;
  display: inline-flex;
  align-items: baseline;
  gap: 0.35em;
  white-space: nowrap;
}

[dir='rtl'] .story-meta .t-meta time,
[dir='rtl'] .card-head .t-meta time {
  unicode-bidi: isolate;
}

/* ==========================================================
   STORY PAGE
   Calmer than the homepage: one column, no rail, no competing
   cards. It should read as a briefing, not a blog post.
   ========================================================== */

.story {
  padding-block: var(--s8) var(--s10);
  /* Wider than the reading measure so the field labels have room, but
     the prose inside is still capped. Re-declare the centering: this
     narrows .page's max-width, and without it the column sits against
     the start edge with dead space beside it. */
  max-width: 760px;
  margin-inline: auto;
}

.story-back {
  display: inline-flex;
  align-items: center;
  gap: var(--s2);
  font-family: var(--font-mono);
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-2);
  transition: color var(--t-fast);
}

.story-back:hover {
  color: var(--accent);
}

.story-head {
  margin-top: var(--s6);
  padding-bottom: var(--s6);
  border-bottom: 1px solid var(--border);
}

.story-meta {
  display: flex;
  align-items: baseline;
  gap: var(--s4);
  flex-wrap: wrap;
  margin-bottom: var(--s4);
}

.story-title {
  max-width: 24ch;
}

/* The summary sits between the title and the fields, so it carries
   slightly more weight than body copy without competing with the
   heading. */
.story-summary {
  margin-top: var(--s4);
  font-size: 19px;
  line-height: 31px;
  color: var(--text-2);
  max-width: var(--measure);
}

:root[lang='ar'] .story-summary {
  font-size: 19.5px;
  line-height: 36px;
}

/* Fields are separated by space and a small mono label — no boxes,
   no rules between them. The label does the work. */
.story-fields {
  display: flex;
  flex-direction: column;
  gap: var(--s7);
  margin-top: var(--s7);
}

.story-field p {
  max-width: var(--measure);
}

.audience-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s2);
  margin-top: var(--s1);
}

/* Chips, not buttons: these are labels, not controls. */
.audience-chip {
  padding: 3px var(--s3);
  border: 1px solid var(--border);
  border-radius: var(--radius-chip);
  font-size: 13.5px;
  color: var(--text-2);
}

.worth-yes {
  color: var(--accent);
  font-weight: 600;
}

.worth-other {
  color: var(--text-2);
  font-weight: 500;
}

.story-source {
  margin-top: var(--s10);
  padding-top: var(--s6);
  border-top: 1px solid var(--border);
}

.source-out {
  /* inline-flex, not inline-block: the icon and the name have to sit on a
     shared centre line. Baseline alignment drifts as the icon grows. */
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: var(--s1);
  font-size: 15px;
  font-weight: 500;
  transition: color var(--t-fast);
}

.source-out:hover {
  color: var(--accent);
}

/* Source icons ------------------------------------------------------
   Small brand badges beside a source or company name. The radius is
   proportional rather than fixed so a 14px badge in a meta line and an
   18px one on the story page keep the same shape. */
.source-icon {
  flex: 0 0 auto;
  border-radius: 22%;
  object-fit: contain;
  /* The badges carry their own background, so on a dark page they would
     otherwise float as bright tiles; a hairline settles them onto the
     surface without drawing a visible border in light mode. */
  box-shadow: 0 0 0 1px rgb(0 0 0 / 6%);
}

/* The meta line is plain inline text elsewhere, so it only becomes a flex
   row where an icon actually sits in it. */
.meta-line {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* Shown only when the item actually passed verification, so the badge
   means something rather than decorating every page. */
.verified {
  display: inline-flex;
  align-items: center;
  gap: var(--s2);
  margin-top: var(--s4);
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--accent);
}

:root[lang='ar'] .verified {
  font-size: 13px;
}

@media (max-width: 720px) {
  .story {
    padding-block: var(--s6) var(--s8);
  }
  .story-title {
    font-size: 23px;
    line-height: 30px;
    max-width: none;
  }
  :root[lang='ar'] .story-title {
    font-size: 24px;
    line-height: 40px;
  }
  .story-summary {
    font-size: 17px;
    line-height: 28px;
  }
  .story-fields {
    gap: var(--s6);
  }
}

/* About page list: editorial, not a feature grid. */
.about-list {
  margin-top: var(--s3);
  display: flex;
  flex-direction: column;
  gap: var(--s2);
  max-width: var(--measure);
}

.about-list li {
  position: relative;
  padding-inline-start: var(--s4);
  font-size: 15.5px;
  line-height: 26px;
  color: var(--text-2);
}

.about-list li::before {
  content: '';
  position: absolute;
  inset-inline-start: 0;
  top: 11px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--text-3);
}

:root[lang='ar'] .about-list li {
  font-size: 16.5px;
  line-height: 30px;
}

:root[lang='ar'] .about-list li::before {
  top: 13px;
}
