/* ==========================================================================
   THE QUARTERLY  ·  design system for 02-journal
   --------------------------------------------------------------------------
   Voice     A peer-reviewed monograph set by a fine press. Ink on cool paper,
             one vermilion accent used like a printer's second colour: rules,
             note numbers, the full stop of the headline. Nothing else is red.
   Type      Newsreader (variable wght 200-800, no opsz axis in this build, so
             optical sizing is emulated: lighter weight + tighter tracking as
             size grows). IBM Plex Sans Condensed for apparatus (labels, meta,
             running heads) in tracked caps; it stands in for small caps,
             which this Newsreader subset lacks. Noto Naskh Arabic, 1.4x size,
             line-height 2.1 for vocalised Uthmani text.
   Scale     Fluid, ratio about 1.25: xs .8125 / sm .9375 / base 1.125-1.25 /
             md 1.25-1.5 / lg 1.6-2.25 / xl 2.2-3.5 / display 3.25-9 (rem).
   Rhythm    Body line-height 1.55; vertical space in multiples of --lh.
   Grid      12 columns inside an 84rem frame; article uses a named 5-track
             grid: contents | gutter | text (66ch) | gutter | margin notes.
   Radius    One system: 0. Hairlines (1px) do all the structural work.
   Modes     Light default (paper #f5f5f1). Dark = warm lamp-black, never pure.
   ========================================================================== */

/* ---------- Tokens ---------- */
:root {
  color-scheme: light dark;
  --paper: #f5f5f1;
  --paper-2: #ebeae4;
  --ink: #141413;
  --ink-2: #474742;
  --ink-3: #66655f;
  --rule: #d3d1c8;
  --accent: #c4341b;
  --on-accent: #fff;
  --scrim: rgba(12, 12, 11, .55);
  --plate: #141413;

  --f-serif: "Newsreader", "Iowan Old Style", "Charter", "Georgia", serif;
  --f-sans: "IBM Plex Sans Condensed", "Avenir Next Condensed", "Arial Narrow", "Roboto Condensed", system-ui, sans-serif;
  --f-ar: "Noto Naskh Arabic", "Geeza Pro", "Arabic Typesetting", "Times New Roman", serif;

  --t-xs: .8125rem;
  --t-sm: .9375rem;
  --t-base: clamp(1.125rem, 1.06rem + .28vw, 1.25rem);
  --t-md: clamp(1.25rem, 1.13rem + .55vw, 1.5rem);
  --t-lg: clamp(1.6rem, 1.3rem + 1.3vw, 2.25rem);
  --t-xl: clamp(2.2rem, 1.55rem + 2.7vw, 3.5rem);
  --t-display: clamp(4.25rem, 1.2rem + 9.2vw, 9.25rem);

  --lh: 1.55;
  --s1: .5rem; --s2: 1rem; --s3: 1.5rem; --s4: 2rem; --s5: 3rem; --s6: 4.5rem; --s7: clamp(4.5rem, 3rem + 6vw, 8.5rem);
  --gutter: clamp(1rem, .4rem + 3vw, 3rem);
  --max: 84rem;
  --measure: 66ch;
  --radius: 0;
  --mast: 3.5rem;
}
/* Dark tokens: system preference unless the reader chose light; or the reader chose dark */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #131312; --paper-2: #1c1c1a; --ink: #ebe8e0; --ink-2: #bdb9ae; --ink-3: #929087;
    --rule: #34332f; --accent: #ee6c4e; --on-accent: #131312; --scrim: rgba(0, 0, 0, .6); --plate: #1c1c1a;
  }
}
:root[data-theme="dark"] {
  --paper: #131312; --paper-2: #1c1c1a; --ink: #ebe8e0; --ink-2: #bdb9ae; --ink-3: #929087;
  --rule: #34332f; --accent: #ee6c4e; --on-accent: #131312; --scrim: rgba(0, 0, 0, .6); --plate: #1c1c1a;
}
:root[data-theme="light"] { color-scheme: light; }
:root[data-theme="dark"] { color-scheme: dark; }

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: calc(var(--mast) + 1.5rem); }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font: 400 var(--t-base)/var(--lh) var(--f-serif);
  font-kerning: normal; font-variant-ligatures: common-ligatures;
  hanging-punctuation: first allow-end last;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  overflow-x: clip;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: .18em; text-decoration-color: var(--rule); transition: text-decoration-color .2s, color .2s; }
a:hover { text-decoration-color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
::selection { background: color-mix(in srgb, var(--accent) 22%, transparent); }
h1, h2, h3, h4 { margin: 0; font-weight: 400; text-wrap: balance; letter-spacing: -.01em; }
p, li, dd, figcaption { text-wrap: pretty; }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; }
.nw { white-space: nowrap; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
.wrap { width: min(100% - 2 * var(--gutter), var(--max)); margin-inline: auto; }
[lang="ar"] { font-family: var(--f-ar); font-weight: 400; letter-spacing: 0; line-height: 2.1; hanging-punctuation: none; text-wrap: balance; }

/* Apparatus voice: tracked condensed caps (labels, meta, running heads) */
.label, .meta, .btn, .chip, .mast nav, .mast .tools, .toc-title, .yt-cap, .runhead, .foot-nav {
  font-family: var(--f-sans); font-size: var(--t-xs); font-weight: 500; letter-spacing: .09em; text-transform: uppercase; line-height: 1.4;
}
.meta { color: var(--ink-3); font-weight: 400; }
.label { color: var(--ink-2); }
.label--accent { color: var(--accent); }
.sep::before { content: "·"; margin-inline: .55em; color: var(--ink-3); }

.skip { position: absolute; inset-inline-start: var(--gutter); top: -4rem; z-index: 100; background: var(--ink); color: var(--paper); padding: .75rem 1rem; font-family: var(--f-sans); text-decoration: none; }
.skip:focus { top: .5rem; }

/* ---------- Buttons: ink-filled primary, hairline secondary ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .6em;
  min-height: 2.875rem; padding: .7rem 1.25rem; border: 1px solid var(--ink); border-radius: var(--radius);
  background: var(--ink); color: var(--paper); text-decoration: none; cursor: pointer; font-weight: 600;
  transition: background-color .2s, color .2s, border-color .2s;
}
.btn:hover { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn--line { background: transparent; color: var(--ink); }
.btn--line:hover { background: transparent; color: var(--accent); border-color: var(--accent); }
.btn .arr { font-family: var(--f-serif); font-size: 1.15em; letter-spacing: 0; text-transform: none; transition: transform .2s; }
.btn:hover .arr { transform: translateX(3px); }
.link-arr { font-family: var(--f-sans); font-size: var(--t-xs); font-weight: 600; letter-spacing: .09em; text-transform: uppercase; text-decoration: none; display: inline-flex; gap: .5em; align-items: center; min-height: 2.75rem; }
.link-arr::after { content: "→"; font-family: var(--f-serif); font-size: 1.2em; letter-spacing: 0; color: var(--accent); transition: transform .2s; }
.link-arr:hover::after { transform: translateX(3px); }

/* ---------- Masthead (doubles as running head) ---------- */
.mast { position: sticky; top: 0; z-index: 50; background: color-mix(in srgb, var(--paper) 94%, transparent); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); border-bottom: 1px solid var(--rule); }
.mast-in { display: flex; align-items: center; gap: var(--s3); min-height: var(--mast); }
.brand { display: inline-flex; align-items: center; gap: .65rem; text-decoration: none; font-size: 1.2rem; font-weight: 500; letter-spacing: -.005em; white-space: nowrap; min-height: 2.75rem; }
.brand img { width: 1.75rem; height: 1.75rem; filter: grayscale(.2); }
.runhead { flex: 1; min-width: 0; text-align: center; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: none; }
.mast nav { margin-inline-start: auto; }
.mast nav ul { list-style: none; display: flex; gap: clamp(.75rem, 2vw, 1.75rem); }
.mast nav a, .tools a, .tools button { display: inline-flex; align-items: center; min-height: 2.75rem; text-decoration: none; color: var(--ink-2); }
.mast nav a:hover, .mast nav a[aria-current="page"] { color: var(--ink); }
.mast nav a[aria-current="page"] { box-shadow: inset 0 -1px 0 var(--accent); }
.tools { display: flex; align-items: center; gap: 1rem; padding-inline-start: var(--s3); border-inline-start: 1px solid var(--rule); }
.tools button { background: none; border: 0; padding: 0; font: inherit; letter-spacing: inherit; text-transform: inherit; cursor: pointer; }
.tools button:hover { color: var(--ink); }
.exit { color: var(--accent) !important; }
.exit::after { content: "↗"; font-family: var(--f-serif); margin-inline-start: .35em; letter-spacing: 0; }
@media (min-width: 72rem) { .runhead { display: block; } .mast nav { margin-inline-start: 0; } }
@media (max-width: 46rem) {
  .mast-in { flex-wrap: wrap; row-gap: 0; padding-block: .25rem; }
  .brand { flex: 1; }
  .tools { padding-inline-start: 0; border: 0; }
  .mast nav { order: 3; flex-basis: 100%; margin: 0; border-top: 1px solid var(--rule); }
  .mast nav ul { justify-content: space-between; gap: .5rem; }
  .mast { position: static; }
  html { scroll-padding-top: 1rem; }
}

/* ---------- Section frame ---------- */
.section { padding-block: var(--s7); }
.section + .section { border-top: 1px solid var(--rule); }
.sec-head { display: flex; justify-content: space-between; align-items: baseline; gap: var(--s3); flex-wrap: wrap; margin-bottom: var(--s5); padding-bottom: var(--s2); border-bottom: 1px solid var(--ink); }
.h2 { font-size: var(--t-xl); line-height: 1.08; font-weight: 350; letter-spacing: -.022em; }
.h3 { font-size: var(--t-md); line-height: 1.25; font-weight: 500; }
.lede { font-size: var(--t-md); line-height: 1.45; color: var(--ink-2); }
.grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gutter); }

/* ---------- Home: hero (title page) ---------- */
.hero { min-height: min(calc(86dvh - var(--mast)), 56rem); display: grid; align-content: end; padding-block: var(--s6) var(--s5); }
.hero h1 { grid-column: 1 / -1; font-size: var(--t-display); line-height: .9; font-weight: 300; letter-spacing: -.045em; margin-inline-start: -.05em; padding-bottom: .12em; }
.hero h1 .stop, .stop { color: var(--accent); }
.hero-foot { grid-column: 1 / -1; display: grid; grid-template-columns: subgrid; align-items: end; row-gap: var(--s4); border-top: 1px solid var(--ink); padding-top: var(--s3); margin-top: var(--s3); }
.hero-sub { grid-column: 1 / span 6; font-size: var(--t-md); line-height: 1.4; font-style: italic; color: var(--ink-2); max-width: 30ch; }
.hero-cta { grid-column: 8 / -1; display: flex; gap: .75rem; justify-content: flex-end; flex-wrap: wrap; }
@media (max-width: 46rem) { .hero-sub, .hero-cta { grid-column: 1 / -1; justify-content: flex-start; } .hero { min-height: min(calc(78dvh - 6rem), 40rem); } }

/* Entry motion: reveals the reading order once, then gets out of the way */
@media (prefers-reduced-motion: no-preference) {
  .rise { animation: rise .9s cubic-bezier(.2, .7, .2, 1) both; }
  .rise-2 { animation-delay: .12s; } .rise-3 { animation-delay: .24s; }
  @keyframes rise { from { opacity: 0; transform: translateY(14px); } }
}

/* ---------- Video facade ---------- */
.yt { position: relative; display: block; aspect-ratio: 16 / 9; background: #0d0d0c; color: #fff; text-decoration: none; overflow: hidden; isolation: isolate; }
.yt img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s cubic-bezier(.2, .7, .2, 1), opacity .3s; }
.yt::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, rgba(0, 0, 0, .62), rgba(0, 0, 0, 0) 45%); z-index: 1; }
.yt-play { position: absolute; z-index: 2; inset: 50% auto auto 50%; width: 4.5rem; height: 4.5rem; margin: -2.25rem 0 0 -2.25rem; border-radius: 50%; background: rgba(245, 245, 241, .94); transition: transform .25s, background-color .25s; }
.yt-play::before { content: ""; position: absolute; inset: 50% auto auto 54%; transform: translate(-50%, -50%); border-style: solid; border-width: .62rem 0 .62rem 1.05rem; border-color: transparent transparent transparent #141413; }
.yt:hover .yt-play, .yt:focus-visible .yt-play { transform: scale(1.06); background: #c4341b; }
.yt:hover .yt-play::before, .yt:focus-visible .yt-play::before { border-left-color: #fff; }
.yt:hover img { transform: scale(1.015); }
.yt-cap { position: absolute; z-index: 2; inset: auto 1rem 1rem 1rem; display: flex; justify-content: space-between; gap: 1rem; color: #fff; text-shadow: 0 1px 2px rgba(0, 0, 0, .4); }
.yt-cap b { font-weight: 600; }
.yt-frame { aspect-ratio: 16 / 9; background: #000; }
.yt-frame iframe { width: 100%; height: 100%; border: 0; display: block; }
.thumb { aspect-ratio: 16 / 9; object-fit: cover; width: 100%; background: var(--paper-2); }

/* ---------- Home: featured debunk ---------- */
.feature { align-items: start; row-gap: var(--s4); }
.feature .media { grid-column: 1 / span 7; }
.feature .fcopy { grid-column: 9 / -1; display: grid; gap: var(--s3); align-content: start; }
.feature h2 { font-size: var(--t-xl); line-height: 1.06; font-weight: 350; letter-spacing: -.025em; }
.feature h2 a { text-decoration: none; }
.feature h2 a:hover { color: var(--accent); }
.dek { color: var(--ink-2); }
@media (max-width: 62rem) { .feature .media, .feature .fcopy { grid-column: 1 / -1; } }

/* ---------- Epigraph band: the verse as the visual hero ---------- */
.epigraph { background: var(--paper-2); padding-block: var(--s7); border-block: 1px solid var(--rule); }
.epigraph figure { margin: 0 auto; max-width: 52rem; text-align: center; display: grid; gap: var(--s4); justify-items: center; }
.epigraph [lang="ar"] { font-size: clamp(1.6rem, 1.1rem + 2.2vw, 2.75rem); line-height: 2.05; color: var(--ink); }
.epigraph .tr { margin: 0; }
.epigraph .tr p { font-size: var(--t-md); font-style: italic; line-height: 1.5; color: var(--ink-2); max-width: 40ch; }
.epigraph figcaption { display: flex; gap: .25rem; align-items: center; }
.rule-accent { width: 3rem; height: 1px; background: var(--accent); border: 0; margin: 0; }

/* ---------- Home: pillars as statement + ruled list ---------- */
.pillars { row-gap: var(--s5); }
.pillars .stmt { grid-column: 1 / span 5; display: grid; gap: var(--s4); align-content: start; }
.pillars .stmt blockquote { margin: 0; font-size: var(--t-lg); line-height: 1.3; font-weight: 350; letter-spacing: -.012em; }
.pillars dl { grid-column: 7 / -1; margin: 0; border-top: 1px solid var(--ink); }
.pillars dl div { display: grid; grid-template-columns: minmax(9rem, 2fr) 3fr; gap: var(--s3); padding-block: var(--s4); border-bottom: 1px solid var(--rule); }
.pillars dt { font-size: var(--t-md); line-height: 1.25; font-weight: 500; }
.pillars dd { margin: 0; color: var(--ink-2); }
@media (max-width: 62rem) { .pillars .stmt, .pillars dl { grid-column: 1 / -1; } }
@media (max-width: 34rem) { .pillars dl div { grid-template-columns: 1fr; gap: var(--s1); } }

/* ---------- Home: latest videos as a table of contents ---------- */
.lead-vid { grid-column: 1 / span 6; display: grid; gap: var(--s2); align-content: start; text-decoration: none; }
.lead-vid h3 { font-size: var(--t-lg); line-height: 1.15; font-weight: 400; letter-spacing: -.015em; }
.lead-vid:hover h3 { color: var(--accent); }
.vlist { grid-column: 8 / -1; list-style: none; border-top: 1px solid var(--rule); }
.vlist li { border-bottom: 1px solid var(--rule); }
.vlist a { display: grid; grid-template-columns: 7.5rem 1fr; gap: var(--s2); padding-block: var(--s2); text-decoration: none; align-items: start; }
.vlist a:hover .vt { color: var(--accent); }
.vt { display: block; font-size: 1.0625rem; line-height: 1.35; font-weight: 450; margin-top: .3rem; }
@media (max-width: 62rem) { .lead-vid, .vlist { grid-column: 1 / -1; } .vlist { margin-top: var(--s4); } }
@media (max-width: 26rem) { .vlist a { grid-template-columns: 5.5rem 1fr; gap: .75rem; } .vt { font-size: 1rem; } }

/* ---------- Home: stories, inverted plate ---------- */
.stories { --ink: #ebe8e0; --ink-2: #bdb9ae; --ink-3: #9a978e; --rule: #3a3935; --accent: #ee6c4e; background: var(--plate); color: var(--ink); }
.stories .intro { grid-column: 1 / span 4; display: grid; gap: var(--s3); align-content: start; }
.stories .intro p { font-size: var(--t-md); line-height: 1.45; font-style: italic; color: var(--ink-2); }
.story-lead { grid-column: 6 / -1; display: grid; grid-template-columns: 3fr 2fr; gap: var(--gutter); text-decoration: none; align-items: end; }
.story-lead h3 { font-size: var(--t-lg); line-height: 1.15; font-weight: 400; letter-spacing: -.015em; margin-top: var(--s1); }
.story-lead:hover h3 { color: var(--accent); }
.story-list { grid-column: 6 / -1; list-style: none; display: grid; grid-template-columns: 1fr 1fr; column-gap: var(--gutter); margin-top: var(--s5); border-top: 1px solid var(--rule); }
.story-list a { display: block; padding-block: var(--s3); border-bottom: 1px solid var(--rule); text-decoration: none; font-size: 1.0625rem; line-height: 1.35; min-height: 100%; }
.story-list a:hover { color: var(--accent); }
.story-list .meta { display: block; margin-top: .5rem; }
@media (max-width: 62rem) { .stories .intro, .story-lead, .story-list { grid-column: 1 / -1; } .story-lead { margin-top: var(--s4); } }
@media (max-width: 40rem) { .story-lead, .story-list { grid-template-columns: 1fr; } }

/* ---------- Bibliography (home teaser + article reading lists) ---------- */
.biblio { list-style: none; }
.biblio li { padding-block: var(--s3); border-bottom: 1px solid var(--rule); padding-inline-start: 2rem; text-indent: -2rem; }
.biblio li:first-child { border-top: 1px solid var(--ink); }
.biblio .ref { font-weight: 600; }
.biblio li:has(> .label) { display: grid; grid-template-columns: 6.5rem 1fr; gap: var(--s2); padding-inline-start: 0; text-indent: 0; }
.biblio li:has(> .label) > span:last-child { padding-inline-start: 1.5rem; text-indent: -1.5rem; }
.biblio .label { text-indent: 0; padding-top: .3em; }
.biblio [lang="ar"] { display: block; text-indent: 0; font-size: 1.3em; margin-block: .5rem; text-align: start; }
.biblio a { text-decoration-color: var(--accent); }
.lib .head { grid-column: 1 / span 4; display: grid; gap: var(--s3); align-content: start; }
.lib .biblio { grid-column: 6 / -1; }
@media (max-width: 62rem) { .lib .head, .lib .biblio { grid-column: 1 / -1; } .lib .biblio { margin-top: var(--s4); } }

/* ---------- Home: support / colophon ---------- */
.support { align-items: end; row-gap: var(--s5); }
.support .big { grid-column: 1 / span 7; display: grid; gap: var(--s4); }
.support .big h2 { font-size: clamp(3rem, 1.4rem + 6vw, 7rem); line-height: .92; font-weight: 300; letter-spacing: -.04em; }
.support .big p { max-width: 44ch; color: var(--ink-2); }
.support .act { grid-column: 9 / -1; display: grid; gap: var(--s4); }
.support .row { display: flex; gap: .75rem; flex-wrap: wrap; }
@media (max-width: 62rem) { .support .big, .support .act { grid-column: 1 / -1; } }

/* ---------- Forms: label above input, helper, error ---------- */
.field { display: grid; gap: .4rem; }
.field label { font-family: var(--f-sans); font-size: var(--t-xs); line-height: 1.4; font-weight: 600; letter-spacing: .09em; text-transform: uppercase; }
.field .opt { color: var(--ink-3); font-weight: 400; }
.field input, .field textarea {
  width: 100%; font: 400 1.0625rem/1.5 var(--f-serif); color: var(--ink); background: var(--paper);
  border: 1px solid var(--ink-3); border-radius: var(--radius); padding: .7rem .85rem; min-height: 2.875rem;
}
.field textarea { min-height: 8rem; resize: vertical; }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); }
.field input:focus-visible, .field textarea:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.help { font-family: var(--f-sans); font-size: var(--t-xs); color: var(--ink-3); letter-spacing: .02em; }
.err { font-family: var(--f-sans); font-size: var(--t-xs); color: var(--accent); font-weight: 600; letter-spacing: .02em; }
.field.invalid input, .field.invalid textarea { border-color: var(--accent); }
.inline-form { display: grid; grid-template-columns: 1fr auto; align-items: end; row-gap: .4rem; }
.inline-form .field { grid-column: 1; grid-row: 1; }
.inline-form .field input { border-inline-end: 0; }
.inline-form .btn { grid-column: 2; grid-row: 1; align-self: start; margin-top: calc(var(--t-xs) * 1.4 + .4rem); }
.inline-form .help, .inline-form .status { grid-column: 1 / -1; }
.status { font-family: var(--f-sans); font-size: var(--t-xs); color: var(--ink-2); min-height: 1.2em; }

/* ---------- Footer ---------- */
.foot { border-top: 1px solid var(--ink); padding-block: var(--s5) var(--s4); font-size: var(--t-sm); color: var(--ink-2); }
.foot .grid { row-gap: var(--s4); }
.foot .brand { color: var(--ink); }
.foot .about { grid-column: 1 / span 5; display: grid; gap: var(--s2); align-content: start; }
.foot-nav { grid-column: 7 / span 3; list-style: none; display: grid; gap: 0; align-content: start; }
.foot-nav a { display: inline-flex; min-height: 2.5rem; align-items: center; text-decoration: none; color: var(--ink-2); }
.foot-nav a:hover { color: var(--ink); }
.foot .legal { grid-column: 10 / -1; display: grid; gap: var(--s2); align-content: start; }
.foot .colo { grid-column: 1 / -1; border-top: 1px solid var(--rule); padding-top: var(--s3); display: flex; justify-content: space-between; gap: var(--s2); flex-wrap: wrap; }
@media (max-width: 52rem) { .foot .about { grid-column: 1 / -1; } .foot-nav { grid-column: 1 / span 6; } .foot .legal { grid-column: 7 / -1; } }

/* ==========================================================================
   ARTICLE
   ========================================================================== */
.paper-head { padding-block: var(--s6) var(--s5); }
.paper-head .inner { display: grid; gap: var(--s3); }
.paper-head h1 { max-width: 17ch; }
.paper-head h1 { font-size: var(--t-xl); font-size: clamp(2.5rem, 1.4rem + 4.4vw, 5.25rem); line-height: 1; font-weight: 330; letter-spacing: -.035em; }
.paper-head .dek { font-size: var(--t-md); line-height: 1.45; max-width: 46ch; font-style: italic; }
.byline { display: flex; flex-wrap: wrap; align-items: center; row-gap: .25rem; padding-top: var(--s2); border-top: 1px solid var(--ink); }
.byline .label { color: var(--ink); }

/* Citation record: the journal's title-page metadata */
.record { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-block: 1px solid var(--rule); margin-top: var(--s4); }
.record div { padding: var(--s2) var(--s2) var(--s2) 0; display: grid; gap: .25rem; min-width: 0; }
.record div + div { padding-inline-start: var(--s2); border-inline-start: 1px solid var(--rule); }
.record dt { font-family: var(--f-sans); font-size: var(--t-xs); letter-spacing: .09em; text-transform: uppercase; color: var(--ink-3); }
.record dd { margin: 0; font-size: var(--t-sm); overflow-wrap: break-word; }
@media (max-width: 46rem) { .record { grid-template-columns: 1fr 1fr; } .record div:last-child { grid-column: 1 / -1; padding-inline-start: 0; border-inline-start: 0; } .hero-cta .btn { flex: 1 1 100%; } .record div:nth-child(3) { padding-inline-start: 0; border-inline-start: 0; } .record div:nth-child(n+3) { border-top: 1px solid var(--rule); } }

/* The five-track page: contents | g | text | g | margin */
.page { display: grid; grid-template-columns: [full-start] minmax(0, 1fr) [text-start] minmax(0, var(--measure)) [text-end] minmax(0, 1fr) [full-end]; padding-bottom: var(--s7); }
.page > * { grid-column: text; }
.toc { grid-column: text; margin-bottom: var(--s5); }
@media (min-width: 75rem) {
  .page { grid-template-columns: [full-start toc-start] 13rem [toc-end] minmax(2rem, 1fr) [text-start] minmax(0, var(--measure)) [text-end] 3rem [note-start] 15rem [note-end full-end]; }
  .toc { grid-column: toc; grid-row: 1 / span 40; align-self: start; position: sticky; top: calc(var(--mast) + 2rem); margin: 0; }
  .wide { grid-column: text-start / note-end; }
}

.toc-title { color: var(--ink-3); padding-bottom: .6rem; border-bottom: 1px solid var(--ink); margin-bottom: .25rem; }
.toc ol { list-style: none; counter-reset: toc; }
.toc li { counter-increment: toc; border-bottom: 1px solid var(--rule); }
.toc a { display: grid; grid-template-columns: 1.5rem 1fr; padding-block: .6rem; font-size: var(--t-sm); line-height: 1.35; text-decoration: none; color: var(--ink-2); min-height: 2.75rem; align-items: baseline; transition: color .2s; }
.toc a::before { content: counter(toc); font-family: var(--f-sans); font-size: var(--t-xs); color: var(--ink-3); font-variant-numeric: tabular-nums; }
.toc a:hover { color: var(--ink); }
.toc a.on { color: var(--ink); }
.toc a.on::before { color: var(--accent); }

/* Video plate */
.plate { margin: 0 0 var(--s5); display: grid; gap: var(--s2); }
.plate figcaption { display: flex; justify-content: space-between; gap: var(--s2); flex-wrap: wrap; padding-top: .25rem; }

/* Abstract box */
.abstract { border: 1px solid var(--ink); padding: var(--s4); margin-bottom: var(--s5); background: var(--paper); }
.abstract h2 { font-family: var(--f-sans); font-size: var(--t-xs); font-weight: 600; letter-spacing: .12em; text-transform: uppercase; margin-bottom: var(--s2); }
.abstract p { font-size: var(--t-sm); line-height: 1.6; }
.abstract .kw { margin-top: var(--s3); padding-top: var(--s2); border-top: 1px solid var(--rule); font-size: var(--t-sm); color: var(--ink-2); }
.abstract .kw b { font-family: var(--f-sans); font-size: var(--t-xs); letter-spacing: .09em; text-transform: uppercase; font-weight: 600; color: var(--ink); margin-inline-end: .5em; }

/* Body copy with numbered paragraphs */
.body { counter-reset: para; }
.body > h2:first-child { margin-top: 0; }
.body h2 { font-size: var(--t-lg); line-height: 1.15; font-weight: 400; letter-spacing: -.018em; margin: var(--s6) 0 var(--s3); padding-top: var(--s3); border-top: 1px solid var(--ink); }
.body h2 .n { font-family: var(--f-sans); font-size: var(--t-xs); font-weight: 500; letter-spacing: .09em; color: var(--accent); display: block; margin-bottom: .6rem; }
.body > p { position: relative; counter-increment: para; margin-bottom: calc(var(--lh) * 1rem * .8); }
.body > p::before { content: counter(para); position: absolute; inset-inline-end: calc(100% + 1.25rem); top: .3em; font-family: var(--f-sans); font-size: .6875rem; letter-spacing: .04em; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.body > .first::first-line { font-variant-caps: all-small-caps; letter-spacing: .04em; font-weight: 500; }
.body > .first::first-letter { float: left; font-variant-caps: normal; font-size: 5.15em; line-height: .76; font-weight: 300; letter-spacing: 0; margin: .06em .09em 0 -.04em; color: var(--ink); }
@media (max-width: 46rem) { .body > p::before { position: static; display: inline-block; margin-inline-end: .5rem; vertical-align: .1em; } .body > .first::before { display: none; } .abstract { padding: var(--s3); } }

/* Note references + Tufte sidenotes */
.fn { font-family: var(--f-sans); font-size: .68em; font-weight: 600; line-height: 0; vertical-align: .55em; margin-inline-start: .08em; }
.fn a { text-decoration: none; color: var(--accent); padding: .3em .15em; }
.sn { display: none; }
@media (min-width: 75rem) {
  .sn { display: block; float: right; clear: right; width: 15rem; margin-inline-end: -18rem; margin-top: .3rem; margin-bottom: 1rem; font-size: .875rem; line-height: 1.5; color: var(--ink-2); position: relative; text-indent: 0; }
  .sn b { font-family: var(--f-sans); font-weight: 600; color: var(--accent); margin-inline-end: .4em; font-size: .78rem; }
  .sn a { text-decoration-color: var(--accent); }
}

/* Primary-source blocks: Quran + hadith */
.src { margin: var(--s5) 0; padding: var(--s4) 0 var(--s3); border-top: 1px solid var(--accent); border-bottom: 1px solid var(--rule); }
.src [lang="ar"] { font-size: clamp(1.45rem, 1.2rem + .9vw, 1.9rem); line-height: 2.15; text-align: right; margin-bottom: var(--s3); color: var(--ink); }
.src .tr { margin: 0; font-size: var(--t-base); font-style: italic; color: var(--ink-2); }
.src .tr p { text-indent: -.4em; }
.src .tr p::before { content: "“"; } .src .tr p::after { content: "”"; }
.src figcaption, .src .src-foot { margin-top: var(--s3); display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem var(--s3); }
.src .cite-ref { font-weight: 600; letter-spacing: .1em; }
.src a.go { color: var(--ink); text-decoration-color: var(--accent); }
.hadith dl { display: grid; grid-template-columns: repeat(3, auto); justify-content: start; gap: .25rem var(--s4); margin: 0 0 var(--s3); }
.hadith dt { font-family: var(--f-sans); font-size: var(--t-xs); letter-spacing: .09em; text-transform: uppercase; color: var(--ink-3); grid-row: 1; }
.hadith dd { margin: 0; font-size: var(--t-sm); font-weight: 600; grid-row: 2; }
.hadith .tr { font-style: normal; color: var(--ink); }
.hadith .tr p { text-indent: 0; }
.hadith .tr p::before, .hadith .tr p::after { content: none; }
.slot { font-family: var(--f-sans); font-size: var(--t-xs); letter-spacing: .09em; text-transform: uppercase; color: var(--accent); border: 1px solid currentColor; padding: .1rem .4rem; }

/* Pull-quote: breaks into the margin on wide screens */
.pq { margin: var(--s5) 0; padding: var(--s3) 0; border-block: 1px solid var(--ink); }
.pq p { font-size: var(--t-lg); line-height: 1.22; font-weight: 350; font-style: italic; letter-spacing: -.012em; text-indent: -.42em; }
.pq p::before { content: "“"; } .pq p::after { content: "”"; }
.pq cite { display: block; margin-top: var(--s2); font-style: normal; }

/* Back matter */
.back h2 { font-family: var(--f-sans); font-size: var(--t-xs); font-weight: 600; letter-spacing: .12em; text-transform: uppercase; padding-bottom: .6rem; margin: var(--s6) 0 0; border-bottom: 1px solid var(--ink); }
.back .biblio li:first-child { border-top: 0; }
.notes { list-style: none; counter-reset: note; }
.notes li { counter-increment: note; position: relative; padding: .85rem 0 .85rem 2rem; border-bottom: 1px solid var(--rule); font-size: var(--t-sm); line-height: 1.55; color: var(--ink-2); }
.notes li::before { content: counter(note); position: absolute; inset-inline-start: 0; top: 1.05rem; font-family: var(--f-sans); font-size: var(--t-xs); font-weight: 600; color: var(--accent); }
.notes li:target { background: color-mix(in srgb, var(--accent) 8%, transparent); }
.notes .back-ref { text-decoration: none; color: var(--accent); margin-inline-start: .35em; padding: .2em; }

.citebox { margin-top: var(--s6); border: 1px solid var(--ink); }
.citebox .top { display: flex; justify-content: space-between; align-items: center; gap: var(--s2); padding: .5rem .5rem .5rem var(--s3); border-bottom: 1px solid var(--rule); }
.citebox h2 { margin: 0; padding: 0; border: 0; }
.citebox p { padding: var(--s3); font-size: var(--t-sm); line-height: 1.6; overflow-wrap: anywhere; }
.copy { font-family: var(--f-sans); font-size: var(--t-xs); font-weight: 600; letter-spacing: .09em; text-transform: uppercase; background: none; color: var(--ink); border: 1px solid var(--rule); border-radius: var(--radius); min-height: 2.75rem; padding: 0 1rem; cursor: pointer; transition: border-color .2s, color .2s; }
.copy:hover { border-color: var(--accent); color: var(--accent); }
.copy[data-done] { color: var(--accent); border-color: var(--accent); }

.share { display: flex; flex-wrap: wrap; align-items: center; gap: .25rem 1.5rem; margin-top: var(--s4); padding-block: var(--s2); border-block: 1px solid var(--rule); }
.share .label { margin-inline-end: auto; }
.share a, .share button { font-family: var(--f-sans); font-size: var(--t-xs); font-weight: 600; letter-spacing: .09em; text-transform: uppercase; text-decoration: none; background: none; border: 0; color: var(--ink); cursor: pointer; padding: 0; min-height: 2.75rem; display: inline-flex; align-items: center; }
.share a:hover, .share button:hover { color: var(--accent); }

.related { list-style: none; display: grid; grid-template-columns: 1fr 1fr; gap: var(--s4) var(--gutter); margin-top: var(--s3); }
.related a { display: grid; gap: .75rem; text-decoration: none; font-size: 1.0625rem; line-height: 1.35; }
.related a:hover .vt { color: var(--accent); }
@media (max-width: 34rem) { .related { grid-template-columns: 1fr; } }

.pn { display: grid; grid-template-columns: 1fr 1fr; margin-top: var(--s6); border-top: 1px solid var(--ink); }
.pn a { display: grid; gap: .4rem; padding: var(--s3) var(--s2) var(--s3) 0; text-decoration: none; font-size: var(--t-md); line-height: 1.25; min-width: 0; }
.pn a + a { text-align: end; padding-inline: var(--s2) 0; border-inline-start: 1px solid var(--rule); }
.pn a:hover span:last-child { color: var(--accent); }

/* ==========================================================================
   SOURCES
   ========================================================================== */
.lib-head { padding-block: var(--s6) var(--s5); border-bottom: 1px solid var(--ink); }
.lib-head h1 { grid-column: 1 / span 7; font-size: clamp(2.75rem, 1.3rem + 5.6vw, 6.5rem); line-height: .95; font-weight: 300; letter-spacing: -.04em; }
.lib-head p { grid-column: 9 / -1; align-self: end; color: var(--ink-2); font-size: var(--t-md); line-height: 1.45; font-style: italic; }
@media (max-width: 62rem) { .lib-head h1, .lib-head p { grid-column: 1 / -1; } .lib-head p { margin-top: var(--s3); } }

.catalog { padding-block: var(--s5) var(--s7); align-items: start; }
.filters { grid-column: 1 / span 3; position: sticky; top: calc(var(--mast) + 2rem); display: grid; gap: var(--s3); }
.chips { display: flex; flex-wrap: wrap; gap: .5rem; }
.chip { min-height: 2.75rem; padding: 0 .9rem; border: 1px solid var(--rule); border-radius: var(--radius); background: transparent; color: var(--ink-2); cursor: pointer; transition: border-color .2s, color .2s, background-color .2s; }
.chip:hover { border-color: var(--ink); color: var(--ink); }
.chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.count { color: var(--ink-3); }
.entries { grid-column: 5 / -1; list-style: none; border-top: 1px solid var(--ink); }
.entry { display: grid; grid-template-columns: 7rem 1fr; gap: .5rem var(--s3); padding-block: var(--s4); border-bottom: 1px solid var(--rule); }
.entry .label { padding-top: .35rem; }
.entry h2 { font-size: var(--t-md); line-height: 1.25; font-weight: 500; }
.entry [lang="ar"] { font-size: 1.45rem; margin-top: var(--s2); color: var(--ink); }
.entry .note { color: var(--ink-2); font-size: var(--t-sm); line-height: 1.6; margin-top: .5rem; max-width: 60ch; }
.entry .acts { grid-column: 2; display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; align-items: center; margin-top: .25rem; }
.entry .acts .copy { border: 0; padding: 0; color: var(--ink-2); }
.entry .acts .copy:hover { color: var(--accent); }
.entry:target { background: linear-gradient(to right, color-mix(in srgb, var(--accent) 7%, transparent), transparent 70%); }
.empty { grid-column: 5 / -1; padding-block: var(--s5); border-bottom: 1px solid var(--rule); display: grid; gap: var(--s2); justify-items: start; }
.empty p:first-child { font-size: var(--t-md); font-style: italic; }
@media (max-width: 62rem) { .filters, .entries, .empty { grid-column: 1 / -1; } .filters { position: static; margin-bottom: var(--s4); } }
@media (max-width: 34rem) { .entry { grid-template-columns: 1fr; } .entry .acts { grid-column: 1; } .entry .label { padding: 0; } }

.submit .head { grid-column: 1 / span 4; display: grid; gap: var(--s3); align-content: start; }
.submit form { grid-column: 6 / span 6; display: grid; gap: var(--s4); }
@media (max-width: 62rem) { .submit .head, .submit form { grid-column: 1 / -1; } .submit form { margin-top: var(--s4); } }

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* ---------- Print: a clean offprint ---------- */
@media print {
  :root { --paper: #fff; --paper-2: #fff; --ink: #000; --ink-2: #222; --ink-3: #444; --rule: #bbb; --accent: #9c2410; }
  @page { margin: 2cm 2.2cm; }
  body { font-size: 11pt; line-height: 1.45; background: #fff; }
  .mast, .skip, .toc, .share, .related-wrap, .pn, .copy, .foot, .yt-play, .tools { display: none !important; }
  .page { display: block; padding: 0; }
  .paper-head { padding: 0 0 1cm; }
  .yt { aspect-ratio: auto; background: none; color: #000; }
  .yt img, .yt::after { display: none; }
  .yt-cap { position: static; color: #000; text-shadow: none; }
  .yt::before { content: "Video: " attr(href); font-family: var(--f-sans); font-size: 9pt; }
  .sn { display: none !important; }
  .body > p::before { position: static; margin-inline-end: .5em; }
  .src, .pq, .abstract, .citebox, .entry { break-inside: avoid; }
  h2 { break-after: avoid; }
  .body a[href^="http"]::after, .biblio a[href^="http"]::after { content: " (" attr(href) ")"; font-size: 8.5pt; color: #444; overflow-wrap: anywhere; }
  .stories { background: #fff; color: #000; }
}
.submit { border-top: 1px solid var(--ink); }
@media (max-width: 34rem) { .biblio li:has(> .label) { grid-template-columns: 1fr; gap: .35rem; } }
.entry .note .meta { display: block; margin-top: .4rem; }
@media (max-width: 22rem) { .brand { font-size: 1.02rem; gap: .5rem; } .brand img { width: 1.5rem; height: 1.5rem; } .tools { gap: .75rem; } .mast-in { gap: .75rem; } }
@media (max-width: 34rem) { .yt-play { width: 3.25rem; height: 3.25rem; margin: -1.625rem 0 0 -1.625rem; } .yt-play::before { border-width: .45rem 0 .45rem .75rem; } }
