/* Aspect pages: a notebook sheet with index tabs, on a desk coloured by the page's card.
   Loads after home.css, which supplies the tokens, fonts, desk bar and footer. */

/* ---------- desk colour per aspect ---------- */

/* a theme sets the desk and its roles; components read the roles (see home.css :root) */
.theme-medicine {
  --desk: var(--red);
  --desk-ink: var(--ink);
  --desk-focus: var(--ink);
  --lang-on-fg: var(--paper);
  --lang-hover-bg: var(--paper);
  --lang-hover-fg: var(--ink);
  --btn-hover: var(--red-ink);
  --tab: var(--red-ink);
}
.theme-web {
  --desk: #2338C9;
  --tab: var(--ink);
  --tab-focus: var(--mustard);
}
.theme-voice {
  --desk: var(--mustard);
  --desk-ink: var(--ink);
  --desk-focus: var(--ink);
  --lang-on-fg: var(--mustard);
  --lang-hover-bg: var(--paper);
  --lang-hover-fg: var(--ink);
  --btn-hover: var(--red-ink);
}
.theme-ventures {
  --desk: var(--green);
  --desk-focus: var(--paper);
  --tab: var(--ink);
  --tab-focus: var(--paper);
}
/* the paper desk: a white sheet on white needs an edge, so this theme sets one more role */
.theme-volunteering {
  --desk: var(--ink);
  --desk-focus: var(--mustard);
  --lang-on-fg: var(--ink);
  --lang-hover-bg: var(--paper);
  --lang-hover-fg: var(--ink);
  --btn-hover: var(--red-ink);
  --tab: var(--paper);
  --tab-focus: var(--mustard);
  scrollbar-color: var(--paper) var(--ink);
}
.theme-learning {
  --desk: var(--paper);
  --desk-ink: var(--ink);
  --desk-focus: var(--red);
  --lang-on-fg: var(--paper);
  --lang-hover-bg: var(--mustard);
  --lang-hover-fg: var(--ink);
  --btn-hover: var(--red-ink);
  --tab-focus: var(--red);
  --sheet-edge: 1.5px solid var(--ink);
}
/* ink-on-desk themes: the brand mark goes fully opaque and selection inverts */
.theme-medicine .brand small, .theme-voice .brand small, .theme-learning .brand small { opacity: 1; }
/* green's paper text has no contrast to spare, so its mark stays opaque too */
.theme-ventures .brand small { opacity: 1; }
.theme-medicine ::selection, .theme-voice ::selection { background: var(--ink); color: var(--paper); }

/* ---------- the sheet and its tabs ---------- */

.notebook {
  position: relative;
  max-width: 1180px;
  margin: 0 auto var(--spread-gap);
  padding-inline-end: 150px;
}
.sheet {
  position: relative;
  outline: var(--sheet-edge, none);
  background: var(--paper);
  padding: clamp(32px, 5vw, 72px) clamp(24px, 5vw, 80px) clamp(40px, 6vw, 88px) clamp(24px, 17vw, 230px);
  min-height: calc(100svh - 84px - var(--spread-gap));
}
/* the notebook's red margin rule */
.sheet::before {
  content: "";
  position: absolute;
  top: 0; bottom: 0;
  inset-inline-start: clamp(16px, 15vw, 200px);
  width: 2px;
  background: var(--red);
}
[dir="rtl"] .sheet { padding: clamp(32px, 5vw, 72px) clamp(24px, 17vw, 230px) clamp(40px, 6vw, 88px) clamp(24px, 5vw, 80px); }

.tabs {
  position: absolute;
  top: 0; bottom: 0;
  inset-inline-end: 0;
  width: 150px;
}
.tabs ol {
  position: sticky;
  top: 24px;
  list-style: none;
  margin: 0; padding: 48px 0 0;
  display: grid;
  gap: 10px;
}
.tabs a {
  display: block;
  padding: 18px 16px;
  min-height: 84px;
  background: var(--tab);
  color: var(--paper);
  font-weight: 700;
  font-size: 1.0625rem;
  text-decoration: none;
  /* no edge on the sheet side: inactive tabs tuck under the sheet */
  border: 1.5px solid var(--ink);
  border-inline-start: 0;
  transition: transform 200ms var(--ease-out);
}
.tabs a:hover { transform: translateX(6px); }
[dir="rtl"] .tabs a:hover { transform: translateX(-6px); }
.tabs a[aria-current="true"] { background: var(--paper); color: var(--ink); transform: translateX(-2px); }
[dir="rtl"] .tabs a[aria-current="true"] { transform: translateX(2px); }
.tabs a:focus-visible { outline: 3px solid var(--tab-focus); outline-offset: 2px; }

/* ---------- the reading column ---------- */

.sheet h1 {
  font-family: var(--f-display);
  font-weight: 400;
  font-size: clamp(3.5rem, 8.4vw, 6rem);
  line-height: 0.92;
  letter-spacing: -0.01em;
}
:lang(ar) .sheet h1 { line-height: 1.15; letter-spacing: 0; }
.opening { margin-top: 24px; max-width: 62ch; font-size: 1.2rem; line-height: 1.6; }
.opening + .opening { margin-top: 14px; font-size: 1.0625rem; }

.entry {
  position: relative;
  margin-top: clamp(48px, 6vw, 80px);
  max-width: 62ch;
  scroll-margin-top: 24px;
}
.entry h2 {
  font-family: var(--f-display);
  font-weight: 400;
  font-size: clamp(2.4rem, 4.8vw, 4rem);
  line-height: 1;
}
:lang(ar) .entry h2 { line-height: 1.25; }
/* pencilled into the margin, left of the red rule */
.margin-note {
  position: absolute;
  inset-inline-end: calc(100% + clamp(24px, 4vw, 56px));
  top: 0.55em;
  width: 140px;
  text-align: end;
  font-family: var(--f-note);
  font-weight: 700;
  font-size: 1.2rem;
  line-height: 1.3;
  color: var(--red-ink);
}
:lang(ar) .margin-note { font-size: 1.4rem; }

.entry > p:not(.aside) { margin-top: 18px; font-size: 1.0625rem; line-height: 1.7; }
.opening .circled { white-space: nowrap; padding-inline: 0.65em; margin-inline: -0.3em; }
/* at body size the ring stays inside its padded box so punctuation and the next word keep their space */
.opening .circled svg { left: 0; width: 100%; }

/* dated log lines: the date leads in pencil */
.log { list-style: none; margin: 20px 0 0; padding: 0; display: grid; gap: 14px; }
.log li { font-size: 1.0625rem; line-height: 1.6; }
.log time, .log .when {
  font-family: var(--f-note);
  font-weight: 700;
  font-size: 1.2rem;
  color: var(--red-ink);
  margin-inline-end: 10px;
}
:lang(ar) .log time, :lang(ar) .log .when { font-size: 1.4rem; }

.aside { margin-top: 18px; font-size: 0.95rem; color: var(--pencil); max-width: 58ch; }

/* ---------- the way back ---------- */

.sheet-close {
  margin-top: clamp(56px, 7vw, 96px);
  padding-top: 32px;
  border-top: 2px solid var(--gutter);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 18px 28px;
}
.sheet-close p { font-family: var(--f-note); font-weight: 700; font-size: 1.4rem; color: var(--ink); }
:lang(ar) .sheet-close p { font-size: 1.75rem; }

/* ---------- pasteboard: real screenshots pasted onto the sheet ---------- */

.pasteboard {
  display: grid;
  gap: clamp(32px, 3.5vw, 48px);
  margin-top: clamp(28px, 4vw, 48px);
  max-width: none;
}
/* rows swap their large and small sides, so no column runs out and leaves a hole */
.pb-row { display: grid; grid-template-columns: 1.45fr 1fr; gap: clamp(24px, 3.5vw, 48px); align-items: start; }
.pb-row--flip { grid-template-columns: 1fr 1.45fr; }
.pb-row .pasted:nth-child(even) { transform: rotate(1.1deg); }
.pb-row--flip .pasted:nth-child(odd) { transform: rotate(-0.8deg); }
.pb-row--flip .pasted:nth-child(even) { transform: rotate(0.7deg); }
.pasteboard .side { display: grid; gap: clamp(24px, 3vw, 36px); align-content: start; }
.pasted { position: relative; margin: 0; }
.pasted a { display: block; color: inherit; text-decoration: none; }
.pasted img { width: 100%; outline: 1.5px solid var(--ink); background: var(--paper); padding: 6px; }
.pasted .tape { width: 22%; height: 9%; left: 38%; top: -4%; transform: rotate(-4deg); }
.pasted.big { transform: rotate(-1.2deg); }
.side .pasted:nth-of-type(1) { transform: rotate(1.1deg); }
.side .pasted:nth-of-type(2) { transform: rotate(-0.8deg); }
.side .pasted:nth-of-type(3) { transform: rotate(0.7deg); }
.pasted figcaption {
  margin-top: 10px;
  font-family: var(--f-note);
  font-weight: 700;
  font-size: 1.2rem;
  line-height: 1.3;
  color: var(--red-ink);
}
:lang(ar) .pasted figcaption { font-size: 1.4rem; }
.pasted a:hover figcaption { text-decoration: underline; }

/* ---------- ledger: every project on a ruled line ---------- */

.entry h3 {
  font-family: var(--f-display);
  font-weight: 400;
  font-size: 1.75rem;
  line-height: 1.1;
  margin-top: 36px;
}
.ledger { list-style: none; margin: 16px 0 0; padding: 0; counter-reset: line; }
.ledger.cont { counter-reset: none; }
.ledger li { counter-increment: line; border-bottom: 1px solid var(--grid); }
.ledger li:first-child { border-top: 2px solid var(--ink); }
.ledger a {
  display: grid;
  grid-template-columns: 2.4em 1fr auto;
  gap: 2px 18px;
  padding: 13px 0;
  color: inherit;
  text-decoration: none;
  align-items: baseline;
}
.ledger a::before {
  content: counter(line, decimal-leading-zero);
  grid-row: span 2;
  font-family: var(--f-note);
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--pencil);
}
:lang(ar) .ledger a::before { content: counter(line, arabic-indic); font-size: 1.2rem; }
.l-name { font-family: var(--f-display); font-weight: 400; font-size: 1.4rem; line-height: 1.15; }
.l-note {
  grid-column: 3; grid-row: 1;
  font-family: var(--f-note);
  font-weight: 700;
  font-size: 1.0625rem;
  color: var(--red-ink);
  white-space: nowrap;
}
:lang(ar) .l-note { font-size: 1.2rem; }
.l-what { grid-column: 2 / span 2; font-size: 0.95rem; color: var(--pencil); line-height: 1.5; }
.ledger a:hover .l-name { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 0.2em; }
.ledger a:focus-visible { outline-offset: 2px; }

/* practice groups: collapsed behind one line on phones, plain open lists on desktop (notebook.js) */
.more-lines summary { display: block; list-style: none; }
.more-lines summary::-webkit-details-marker { display: none; }
.ml-show { display: none; }

/* ---------- Voice: programme card, waveform, takes ---------- */

/* a page whose contents is a programme card instead of index tabs */
.notebook--untabbed { padding-inline-end: var(--spread-gap); }

.voice-open {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 380px);
  gap: clamp(32px, 4vw, 56px);
  align-items: start;
}
.stage-note {
  margin-top: 28px;
  max-width: 34ch;
  font-family: var(--f-note);
  font-weight: 700;
  font-size: 1.2rem;
  line-height: 1.4;
}
:lang(ar) .stage-note { font-size: 1.4rem; line-height: 1.5; }
.stage-note mark { background: none; color: inherit; box-shadow: inset 0 -0.35em 0 rgba(233, 178, 28, 0.75); }
.stage-note + .link-pencil { margin-top: 10px; }

/* the running order, taped to the sheet like a ceremony programme */
.programme {
  position: relative;
  margin-top: 12px;
  padding: 30px 28px 18px;
  background: var(--paper);
  border: 1.5px solid var(--ink);
  transform: rotate(1.4deg);
}
[dir="rtl"] .programme { transform: rotate(-1.4deg); }
.programme .tape { width: 30%; height: 22px; left: 35%; top: -12px; transform: rotate(-3deg); }
.programme h2 {
  font-family: var(--f-display);
  font-weight: 400;
  font-size: 1.75rem;
  line-height: 1.1;
  text-align: center;
}
:lang(ar) .programme h2 { line-height: 1.4; }
.programme ol { list-style: none; margin: 16px 0 0; padding: 0; border-top: 2px solid var(--ink); }
.programme li { border-bottom: 1px solid var(--grid); }
.programme li:last-child { border-bottom: 0; }
.programme a {
  display: grid;
  grid-template-columns: 2.2em 1fr;
  gap: 0 10px;
  padding: 12px 0;
  text-decoration: none;
  align-items: baseline;
}
.p-no { grid-row: span 2; font-family: var(--f-note); font-weight: 700; font-size: 1.2rem; color: var(--red-ink); }
:lang(ar) .p-no { font-size: 1.4rem; }
.p-name { font-family: var(--f-display); font-weight: 400; font-size: 1.4rem; line-height: 1.15; }
:lang(ar) .p-name { line-height: 1.4; }
.p-count { font-size: 0.95rem; color: var(--pencil); }
.programme a:hover .p-name { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 0.2em; }
.programme a:focus-visible { outline-offset: 2px; }

/* the story as one recorded line: quiet where nothing happened */
.entry--wide { max-width: none; }
.entry--wide > .entry-head, .entry--wide > .log { max-width: 62ch; }
.wave {
  container-type: inline-size;
  position: relative;
  margin: 28px 0 0;
  padding: 44px 0 72px;
}
.wave svg { display: block; width: 100%; height: 150px; overflow: visible; }
[dir="rtl"] .wave svg { transform: scaleX(-1); }
.wave-line { fill: none; stroke: var(--ink); stroke-width: 2; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.wave-base { stroke: var(--gutter); stroke-width: 1.5; vector-effect: non-scaling-stroke; }
.wave-paid { fill: var(--mustard); mix-blend-mode: multiply; opacity: 0.85; }
.wave .cue, .wave .yr { position: absolute; inset-inline-start: var(--x); white-space: nowrap; font-family: var(--f-note); font-weight: 700; }
.wave .cue { font-size: 1.0625rem; color: var(--red-ink); padding-inline-start: 8px; }
:lang(ar) .wave .cue { font-size: 1.2rem; }
/* a dashed cue line runs from each label to the waveform */
.wave .cue::before {
  content: "";
  position: absolute;
  inset-inline-start: 0;
  height: 64px;
  border-inline-start: 1.5px dashed var(--red);
}
.cue--top { top: 6px; }
.cue--top::before { top: 0.4em; }
.cue--bottom { bottom: 32px; }
.cue--bottom::before { bottom: 0.6em; }
.wave .yr { bottom: 0; font-size: 0.95rem; color: var(--pencil); }
:lang(ar) .wave .yr { font-size: 1.2rem; }
/* too narrow for cue labels: the log below carries every date, the line keeps only its two ends */
@container (max-width: 640px) {
  .wave .cue, .wave .yr:not(.yr--end) { display: none; }
  .wave svg { height: 110px; }
}
@media (max-width: 760px) {
  .wave { padding: 8px 0 36px; }
}
/* the one authored moment: the line records itself once, left to right (right to left in Arabic, through the mirrored svg) */
.wave.is-waiting svg { clip-path: inset(0 100% 0 0); }
.wave.is-playing svg { clip-path: inset(0 0 0 0); transition: clip-path 1800ms var(--ease-out); }

/* takes: every job on a ruled line, its name opening the project and its recordings one tap away */
.takes { list-style: none; margin: 20px 0 0; padding: 0; counter-reset: line; }
.takes li {
  counter-increment: line;
  display: grid;
  grid-template-columns: 2.4em 1fr auto;
  gap: 2px 18px;
  padding: 14px 0;
  border-bottom: 1px solid var(--grid);
  align-items: baseline;
}
.takes li:first-child { border-top: 2px solid var(--ink); }
.takes li::before {
  content: counter(line, decimal-leading-zero);
  grid-row: span 3;
  font-family: var(--f-note);
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--pencil);
}
:lang(ar) .takes li::before { content: counter(line, arabic-indic); font-size: 1.2rem; }
.t-name { font-family: var(--f-display); font-weight: 400; font-size: 1.4rem; line-height: 1.15; text-decoration: none; justify-self: start; }
:lang(ar) .t-name { line-height: 1.4; }
.t-name:hover { text-decoration: underline; text-decoration-thickness: 2px; }
.t-note { grid-column: 3; grid-row: 1; font-family: var(--f-note); font-weight: 700; font-size: 1.0625rem; color: var(--red-ink); white-space: nowrap; }
:lang(ar) .t-note { font-size: 1.2rem; }
.t-what { grid-column: 2 / span 2; font-size: 0.95rem; color: var(--pencil); line-height: 1.5; }
.t-listen { grid-column: 2 / span 2; display: flex; flex-wrap: wrap; gap: 4px 22px; margin-top: 6px; }
.t-listen a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 0;
  font-family: var(--f-note);
  font-weight: 700;
  font-size: 1.0625rem;
  text-decoration: none;
  border-bottom: 2px solid var(--ink);
}
:lang(ar) .t-listen a { font-size: 1.2rem; }
.t-listen a:hover { color: var(--red-ink); border-color: var(--red-ink); }
.i-play { width: 0.85em; height: 0.85em; flex: none; color: var(--red); }
.sheet-close .link-pencil { margin-inline-start: 6px; }
/* the programme numeral sits on its own line above the margin note */
.m-no { display: block; }

/* ---------- Ventures: company papers taped to the sheet, each stamped with its status ---------- */

.papers {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: clamp(32px, 4vw, 44px);
  margin-top: clamp(32px, 4vw, 48px);
  align-items: start;
}
.papers-side { display: grid; gap: clamp(32px, 4vw, 44px); }
.co { position: relative; padding: 28px 26px 22px; background: var(--paper); border: 1.5px solid var(--ink); }
.co--big { transform: rotate(-1.1deg); }
.co--one { transform: rotate(1.2deg); }
.co--two { transform: rotate(-0.8deg); }
[dir="rtl"] .co--big { transform: rotate(1.1deg); }
[dir="rtl"] .co--one { transform: rotate(-1.2deg); }
[dir="rtl"] .co--two { transform: rotate(0.8deg); }
.co .tape { width: 26%; height: 20px; left: 37%; top: -11px; transform: rotate(-3deg); }
.co h2 { font-family: var(--f-display); font-weight: 400; font-size: 1.75rem; line-height: 1.1; text-align: start; }
[dir="rtl"] .co h2 { text-align: right; }
.co--big h2 { font-size: clamp(2.4rem, 4.8vw, 4rem); line-height: 1; }
.co dl { display: grid; grid-template-columns: 4.6em 1fr; margin: 14px 0 0; }
.co dt, .co dd { margin: 0; padding: 9px 0; border-top: 1px solid var(--grid); }
.co dt { font-family: var(--f-note); font-weight: 700; font-size: 1.0625rem; line-height: 1.4; color: var(--pencil); }
:lang(ar) .co dt { font-size: 1.2rem; line-height: 1.3; }
.co dd { font-size: 0.95rem; line-height: 1.5; }
.co dd { min-width: 0; }
.co dd [dir="ltr"], .entry [dir="ltr"] { white-space: nowrap; }
.co dd a[dir="ltr"] { white-space: normal; }
.co-link { margin-top: 14px; }
.co-note { margin-top: 24px; max-width: 30ch; font-family: var(--f-note); font-weight: 700; font-size: 1.2rem; line-height: 1.35; color: var(--red-ink); }
:lang(ar) .co-note { font-size: 1.4rem; line-height: 1.45; }
/* straddles the paper's corner, opaque so the outline never runs through the word */
.stamp {
  position: absolute;
  inset-inline-end: -12px;
  top: -16px;
  padding: 4px 12px;
  background: var(--paper);
  border: 2.5px solid var(--red-ink);
  color: var(--red-ink);
  font-weight: 700;
  font-size: 1.0625rem;
  letter-spacing: 0.06em;
  transform: rotate(-7deg);
}
:lang(ar) .stamp { letter-spacing: 0; }
[dir="rtl"] .stamp { transform: rotate(7deg); }
/* the one authored moment: each stamp lands once as the page opens */
@media (prefers-reduced-motion: no-preference) {
  .stamp { animation: stamp-land 280ms var(--ease-out) backwards; }
  .co--big .stamp { animation-delay: 350ms; }
  .co--one .stamp { animation-delay: 600ms; }
  .co--two .stamp { animation-delay: 850ms; }
}
@keyframes stamp-land { from { opacity: 0; scale: 1.5; } }
.plan-note { margin-top: 16px; max-width: 46ch; font-family: var(--f-note); font-weight: 700; font-size: 1.2rem; line-height: 1.35; color: var(--red-ink); }
:lang(ar) .plan-note { font-size: 1.4rem; line-height: 1.45; }
.entry > p.plan-note { font-size: 1.2rem; line-height: 1.35; }
:lang(ar) .entry > p.plan-note { font-size: 1.4rem; line-height: 1.45; }

/* ---------- Learning: library cards filed under subject tabs ---------- */

.drawer { display: grid; gap: clamp(40px, 5vw, 56px); margin-top: clamp(32px, 4vw, 48px); }
.shelf { scroll-margin-top: 24px; }
/* the subject's tab sticks up from the top of its cards */
.shelf > h2 {
  display: inline-block;
  max-width: calc(100% - 14px);
  margin-inline-start: 14px;
  padding: 6px 14px 3px;
  background: var(--mustard);
  border: 1.5px solid var(--ink);
  border-bottom: 0;
  position: relative;
  z-index: 1;
  margin-bottom: -3px;
  padding-bottom: 6px;
  font-family: var(--f-display);
  font-weight: 400;
  font-size: 1.2rem;
  line-height: 1.25;
}
:lang(ar) .shelf > h2 { line-height: 1.5; padding-block: 3px 5px; }
.lib-cards { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); gap: 14px; align-items: start; }
.lib { padding: 16px 16px 12px; background: var(--paper); border: 1.5px solid var(--ink); }
.lib:nth-child(odd) { transform: rotate(-0.6deg); }
.lib:nth-child(even) { transform: rotate(0.5deg); }
[dir="rtl"] .lib:nth-child(odd) { transform: rotate(0.6deg); }
[dir="rtl"] .lib:nth-child(even) { transform: rotate(-0.5deg); }
.lib h3 { padding-bottom: 8px; font-family: var(--f-display); font-weight: 400; font-size: 1.4rem; line-height: 1.15; border-bottom: 2px solid var(--red); }
:lang(ar) .lib h3 { line-height: 1.4; }
/* the real certificate, pasted to the card; it opens full size, where a phone can pinch and zoom */
.cert { display: block; margin-top: 12px; }
.cert img { width: 100%; padding: 4px; background: var(--paper); outline: 1.5px solid var(--ink); }
.cert:hover img { outline-color: var(--red); }
.lib dl { display: grid; grid-template-columns: 4.6em minmax(0, 1fr); margin: 6px 0 0; }
.lib dt, .lib dd { margin: 0; padding: 7px 0; border-bottom: 1px solid var(--grid); }
.lib dt:last-of-type, .lib dd:last-of-type { border-bottom: 0; }
.lib dt { font-family: var(--f-note); font-weight: 700; font-size: 1.0625rem; line-height: 1.4; color: var(--pencil); }
:lang(ar) .lib dt { font-size: 1.2rem; line-height: 1.3; }
.lib dd { font-size: 0.95rem; line-height: 1.5; }
.lib-links { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.lib-links a { display: inline-block; font-weight: 600; }
[dir="rtl"] .lib-links li { text-align: right; }
.shelf-note { max-width: 62ch; margin-top: 16px; }
.shelf-links { margin-top: 6px; }

/* ---------- narrow: tabs become a strip across the top ---------- */

@media (max-width: 900px) {
  .notebook { padding-inline-end: var(--spread-gap); }
  .tabs { position: sticky; top: 0; width: auto; z-index: 5; background: var(--desk); padding: 8px 0 10px; }
  .tabs ol { position: static; padding: 0; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 6px; }
  .tabs a { min-height: 0; padding: 10px 4px; text-align: center; font-size: 0.85rem; border-inline-start: 1.5px solid var(--ink); }
  .tabs a:hover, .tabs a[aria-current="true"] { transform: none; }
  .sheet, [dir="rtl"] .sheet { padding: 32px 20px 48px 20px; min-height: 0; }
  .sheet::before { display: none; }
  .entry { scroll-margin-top: 72px; }
  .entry-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 16px; }
  .pb-row, .pb-row--flip { grid-template-columns: minmax(0, 1fr); }
  .more-lines { margin-top: 36px; }
  .more-lines summary { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 44px; padding: 12px 0; border-block: 2px solid var(--ink); cursor: pointer; }
  .more-lines summary h3 { margin: 0; font-size: 1.4rem; }
  :lang(ar) .more-lines summary h3 { line-height: 1.4; }
  .ml-show { flex: none; display: inline-flex; align-items: center; gap: 8px; font-family: var(--f-note); font-weight: 700; font-size: 1.2rem; color: var(--red-ink); white-space: nowrap; }
  :lang(ar) .ml-show { font-size: 1.4rem; }
  .ml-show svg { width: 16px; height: 10px; transition: transform 200ms var(--ease-out); }
  .ml-less, .more-lines[open] .ml-more { display: none; }
  .more-lines[open] .ml-less { display: inline; }
  .more-lines[open] .ml-show svg { transform: rotate(180deg); }
  .more-lines .ledger { margin-top: 0; }
  .more-lines .ledger li:first-child { border-top: 0; }
  .ledger a { grid-template-columns: 2.4em 1fr; }
  .ledger a::before { grid-row: span 3; }
  .l-note { grid-column: 2; grid-row: 2; white-space: normal; }
  .l-what { grid-column: 2; }
  .pb-row .pasted:nth-child(n), .pasted.big, .side .pasted:nth-of-type(1), .side .pasted:nth-of-type(2), .side .pasted:nth-of-type(3) { transform: none; }
  .margin-note { position: static; width: auto; text-align: start; }
  .programme, [dir="rtl"] .programme { transform: none; }
  .papers { grid-template-columns: minmax(0, 1fr); }
  .co--big, .co--one, .co--two, [dir="rtl"] .co--big, [dir="rtl"] .co--one, [dir="rtl"] .co--two { transform: none; }
  .stamp { inset-inline-end: -6px; top: -24px; animation: none; }
  /* thumb-sized targets */
  .t-name { padding-block: 10px; margin-block: -10px; }
  .t-listen a { min-height: 44px; padding-block: 0; }
  .aside a, .co dd a { display: inline-block; padding-block: 12px; margin-block: -12px; }
  .lib dd > a { display: inline-block; padding-block: 12px; margin-block: -12px; }
  .lib-links a { padding-block: 11px; }
  .lib-links { gap: 0; margin-block: -11px; }
  .shelf-links { margin-block: 0; }
  .takes li { grid-template-columns: 2.4em 1fr; }
  .t-note { grid-column: 2; grid-row: 2; white-space: normal; }
  .t-what, .t-listen { grid-column: 2; }
  .takes li::before { grid-row: span 4; }
}

@media (max-width: 1100px) {
  .voice-open { grid-template-columns: 1fr; }
  .programme { max-width: 440px; }
}

/* ---------- snapshots and rotations (Medicine) ---------- */

/* real photos as prints on the sheet: paper mat, ink outline, a small tilt, a pencilled caption */
.snaps { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 14px; align-items: start; max-width: 620px; margin-top: 22px; }
.snaps--one { grid-template-columns: minmax(0, 1fr); max-width: min(320px, 78%); }
.snaps--lead .snap:first-child { grid-column: 1 / -1; width: min(320px, 78%); }
.snap { margin: 0; }
.snap:nth-child(odd) { transform: rotate(-1.1deg); }
.snap:nth-child(even) { transform: rotate(0.9deg); }
[dir="rtl"] .snap:nth-child(odd) { transform: rotate(1.1deg); }
[dir="rtl"] .snap:nth-child(even) { transform: rotate(-0.9deg); }
.snap img { width: 100%; padding: 5px; background: var(--paper); outline: 1.5px solid var(--ink); }
.snap figcaption { margin-top: 8px; font-family: var(--f-note); font-weight: 700; font-size: 1.0625rem; line-height: 1.3; color: var(--pencil); }
:lang(ar) .snap figcaption { font-size: 1.2rem; }
.snap figcaption [dir="ltr"] { white-space: normal; overflow-wrap: anywhere; }
.rota { list-style: none; max-width: 62ch; margin: 12px 0 0; padding: 0; border-top: 2px solid var(--ink); }
.rota li { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--grid); font-weight: 600; }
.rota-st { flex: none; font-family: var(--f-note); font-weight: 700; font-size: 1.0625rem; color: var(--pencil); }
:lang(ar) .rota-st { font-size: 1.2rem; }
.rota .is-now .rota-st { color: var(--red-ink); }

/* a side note's print, kept small so the running order stays near the top */
.stage-print { max-width: 180px; margin-top: 14px; }

/* ---------- event badges (Volunteering) ---------- */

/* what he wore at each thing: the role leads in a colour band, the story sits under it */
/* the one word that outgrows the sheet at the standard minimum: it fits whole down to 320px */
html[lang="en"].theme-volunteering .sheet h1 { font-size: min(14vw, clamp(3.5rem, 8.4vw, 6rem)); }
.ev-badges, .ev-minis { list-style: none; margin: 0; padding: 0; }
.ev-badges { display: grid; gap: 26px; margin-top: 30px; }
.ev-badge { position: relative; background: var(--paper); border: 1.5px solid var(--ink); }
.ev-badge:nth-child(odd) { transform: rotate(-0.8deg); }
.ev-badge:nth-child(even) { transform: rotate(0.7deg); }
html[dir="rtl"] .ev-badge:nth-child(odd) { transform: rotate(0.8deg); }
html[dir="rtl"] .ev-badge:nth-child(even) { transform: rotate(-0.7deg); }
.ev-slot { position: absolute; top: 9px; inset-inline-start: 50%; width: 46px; height: 9px; margin-inline-start: -23px; background: var(--ink); }
.ev-role {
  padding: 30px 16px 12px;
  color: var(--ink);
  font-family: var(--f-display);
  font-weight: 400;
  font-size: clamp(2.2rem, 11vw, 3rem);
  line-height: 1.02;
  text-transform: uppercase;
}
html[lang="ar"] .ev-role { line-height: 1.3; }
.ev-badge--mustard .ev-role { background: var(--mustard); }
.ev-badge--red .ev-role { background: var(--red); }
.ev-badge--green .ev-role { background: var(--green); color: var(--paper); }
.ev-body { padding: 12px 16px 16px; }
.ev-body h2 { font-family: var(--f-display); font-weight: 400; font-size: 1.4rem; line-height: 1.15; }
html[lang="ar"] .ev-body h2 { line-height: 1.4; }
.ev-meta { font-family: var(--f-note); font-weight: 700; font-size: 1.0625rem; line-height: 1.4; color: var(--pencil); }
html[lang="ar"] .ev-meta { font-size: 1.2rem; line-height: 1.3; }
.ev-body p:not(.ev-meta) { margin-top: 8px; font-size: 0.95rem; line-height: 1.55; }
.ev-rest { margin-top: 36px; }
.ev-rest > h2 { padding-bottom: 8px; border-bottom: 2px solid var(--red); font-family: var(--f-display); font-weight: 400; font-size: 1.4rem; line-height: 1.15; }
html[lang="ar"] .ev-rest > h2 { line-height: 1.4; }
.ev-minis { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(240px, 100%), 1fr)); gap: 14px; margin-top: 16px; }
.ev-mini { padding: 12px 14px; border: 1.5px solid var(--ink); }
.ev-mini h3 { font-family: var(--f-display); font-weight: 400; font-size: 1.2rem; line-height: 1.15; }
html[lang="ar"] .ev-mini h3 { line-height: 1.4; }
.ev-label { margin-top: 2px; font-family: var(--f-note); font-weight: 700; font-size: 1.0625rem; line-height: 1.4; color: var(--pencil); }
html[lang="ar"] .ev-label { font-size: 1.2rem; line-height: 1.3; }
.ev-mini p:not(.ev-label) { margin-top: 6px; font-size: 0.95rem; line-height: 1.5; }
.ev-body .ev-photo { margin-top: 12px; transform: none; }
.ev-body .ev-photo--tall { width: min(230px, 72%); }
.ev-body a { font-weight: 600; }
@media (max-width: 900px) {
  /* links inside running text reach 44px without moving the lines */
  .ev-body a { display: inline-block; padding-block: 11px; margin-block: -11px; }
}
@media (min-width: 901px) {
  .ev-badges { grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: start; }
  .ev-role { min-height: 148px; font-size: 2.2rem; display: flex; align-items: flex-end; }
}

/* ---------- certificate viewer (Learning) ---------- */

/* the certificate lifted off the card onto a flat ink desk. No touch-action here: a phone must still pinch to zoom. */
.viewer-open { overflow: hidden; }
.viewer { position: fixed; inset: 0; width: 100%; height: 100%; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; color: var(--paper); background: var(--ink); }
.viewer::backdrop { background: var(--ink); }
.viewer[open] { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; }
.viewer-title {
  max-width: 60ch;
  margin: 14px 16px 0;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--red);
  font-family: var(--f-display);
  font-weight: 400;
  font-size: 1.4rem;
  line-height: 1.15;
}
html[lang="ar"] .viewer-title { line-height: 1.4; }
.viewer-stage { container-type: size; display: grid; place-items: center; min-height: 0; margin: 16px 20px; }
.viewer-img {
  width: 100%;
  width: min(100cqw, 100cqh * var(--ratio), 1400px);
  max-width: none;
  height: auto;
  aspect-ratio: var(--ratio);
  background: var(--paper);
  outline: 4px solid var(--paper);
}
.viewer-bar { display: flex; gap: 8px; padding: 0 16px 16px; }
.viewer-btn, .viewer-close { min-height: 48px; border: 1.5px solid var(--paper); cursor: pointer; }
.viewer-btn {
  display: flex;
  flex: 1 1 0;
  align-items: center;
  justify-content: center;
  padding: 8px 10px;
  color: var(--paper);
  font-weight: 700;
  font-size: 0.95rem;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
}
.viewer-btn[hidden] { display: none; }
.viewer-download { color: var(--ink); background: var(--mustard); border-color: var(--mustard); }
.viewer-close { order: 1; display: grid; flex: none; place-items: center; width: 48px; padding: 0; color: var(--paper); background: transparent; }
.viewer-close svg { width: 20px; height: 20px; }
@media (hover: hover) {
  .viewer-btn:hover, .viewer-close:hover { color: var(--ink); background: var(--paper); border-color: var(--paper); }
}
.viewer a:focus-visible, .viewer button:focus-visible { outline: 3px solid var(--mustard); outline-offset: 3px; }
@media (min-width: 901px) and (min-height: 501px) {
  .viewer-title { margin: 20px 96px 0 32px; font-size: 1.75rem; }
  html[dir="rtl"] .viewer-title { margin: 20px 32px 0 96px; }
  .viewer-stage { margin: 20px 36px; }
  .viewer-bar { justify-content: center; padding-bottom: 24px; }
  .viewer-btn { flex: 0 1 240px; }
  .viewer-close { position: absolute; inset-block-start: 20px; inset-inline-end: 32px; }
}
/* a phone turned sideways: title and actions move beside the certificate, so turning it makes the certificate bigger */
@media (orientation: landscape) and (max-height: 500px) {
  .viewer[open] { grid-template-columns: minmax(0, 1fr) 200px; grid-template-rows: minmax(0, 1fr) auto; }
  .viewer-stage { grid-column: 1; grid-row: 1 / -1; margin: 12px 16px; }
  .viewer-title { grid-column: 2; grid-row: 1; align-self: start; margin: 12px 16px 0 0; font-size: 1.2rem; }
  html[dir="rtl"] .viewer-title { margin: 12px 0 0 16px; }
  .viewer-bar { grid-column: 2; grid-row: 2; flex-wrap: wrap; padding-block: 8px 12px; padding-inline: 0 16px; }
  .viewer-btn { flex: 1 1 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .tabs a { transition: none; }
  .wave.is-waiting svg { clip-path: none; }
  .ml-show svg { transition: none; }
}

/* ---------- Project pages: a job card stamped with the status, screenshots in a strip you swipe on phones ---------- */

.pd-back { display: inline-flex; align-items: center; min-height: 44px; font-weight: 600; font-size: 0.95rem; color: var(--pencil); }
.pd-kind { font-family: var(--f-note); font-weight: 700; font-size: 1.2rem; color: var(--red-ink); }
:lang(ar) .pd-kind { font-size: 1.4rem; }
.pd h1 { font-size: clamp(2.5rem, 5.4vw, 4.5rem); line-height: 1.05; overflow-wrap: anywhere; }
:lang(ar) .pd h1 { line-height: 1.2; }
.pd-lead { margin-top: 14px; font-size: 1.2rem; line-height: 1.6; max-width: 56ch; }
.pd-go { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 20px; }
.pd-card { position: relative; margin-top: 34px; padding: 34px 20px 10px; border: 1.5px solid var(--ink); background: var(--paper); }
.pd-card:not(:has(dl)) { padding: 14px 20px; }
.pd-card:not(:has(.stamp)) { padding-top: 10px; }
.pd-card dl { display: grid; grid-template-columns: 5.4em minmax(0, 1fr); margin: 0; }
.pd-card dt, .pd-card dd { margin: 0; padding: 10px 0; border-top: 1px solid var(--grid); }
.pd-card dt:first-of-type, .pd-card dd:first-of-type { border-top: 0; }
.pd-card dt { font-family: var(--f-note); font-weight: 700; font-size: 1.0625rem; line-height: 1.4; color: var(--pencil); }
:lang(ar) .pd-card dt { font-size: 1.2rem; line-height: 1.3; }
.pd-card dd { font-size: 0.95rem; line-height: 1.5; }
.pd-strip { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; gap: 28px 24px; margin-top: 44px; }
.pd-strip:has(.pd-shot--phone) { grid-template-columns: repeat(2, minmax(0, 1fr)) 200px; }
.pd-strip:has(.pd-shot--phone) .pd-shot:first-child { grid-column: 1 / span 2; }
.pd-shot { position: relative; min-width: 0; margin: 0; transform: rotate(-1deg); }
.pd-shot:nth-child(even) { transform: rotate(0.8deg); }
[dir="rtl"] .pd-shot { transform: rotate(1deg); }
[dir="rtl"] .pd-shot:nth-child(even) { transform: rotate(-0.8deg); }
.pd-shot img { display: block; width: 100%; height: auto; padding: 6px; background: var(--paper); outline: 1.5px solid var(--ink); }
.pd-shot .tape { width: 64px; height: 20px; inset-inline-start: 40%; top: -9px; transform: rotate(-4deg); }
.pd-shot figcaption { margin-top: 10px; font-family: var(--f-note); font-weight: 700; font-size: 1.0625rem; line-height: 1.35; color: var(--pencil); }
:lang(ar) .pd-shot figcaption { font-size: 1.2rem; }
.pd-strip .pd-shot--phone { grid-column: 3; grid-row: 1 / span 3; }
.pd-strip--one { grid-template-columns: minmax(0, 1fr); }
.pd-hint { display: none; }
.pd-notes { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 28px 40px; margin-top: 44px; }
.pd-notes h2 { font-family: var(--f-display); font-weight: 400; font-size: 1.75rem; line-height: 1.15; }
.pd-notes p { margin-top: 8px; font-size: 1.0625rem; line-height: 1.7; }
.pd-notes a, .pd-lead a, .pd-card a { text-decoration: underline; text-underline-offset: 0.2em; }
@media (min-width: 1100px) {
  .pd h1 { font-size: clamp(2.5rem, 4vw, 3.5rem); text-wrap: balance; }
  .pd-top { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 56px; align-items: start; }
  .pd-card { margin-top: 24px; }
}
@media (max-width: 899px) {
  .pd-strip, .pd-strip:has(.pd-shot--phone) { display: flex; align-items: center; gap: 16px; margin: 36px -20px 0; padding: 12px 20px 8px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
  .pd-strip::-webkit-scrollbar { display: none; }
  .pd-shot { flex: 0 0 84%; scroll-snap-align: center; }
  .pd-shot--phone { flex: 0 0 auto; order: -1; }
  .pd-shot--phone img { width: 42vw; height: auto; }
  .pd-strip--one .pd-shot { flex: 0 0 100%; }
  .pd-hint { display: block; margin-top: 4px; font-family: var(--f-note); font-weight: 700; font-size: 1.0625rem; color: var(--red-ink); }
  :lang(ar) .pd-hint { font-size: 1.2rem; }
  .pd-go .btn { width: 100%; }
  .pd-go:has(.btn:nth-child(2)) .btn { width: auto; flex: 1 1 auto; }
  .pd-lead { font-size: 1.0625rem; }
  .pd-card { margin-top: 44px; }
  .pd-card a, .pd-notes a, .pd-lead a { display: inline-block; padding-block: 11px; margin-block: -11px; }
  .pd-notes { grid-template-columns: minmax(0, 1fr); margin-top: 36px; }
}

/* ---------- About: four stamped papers, with an ECG across the top and a trace on each paper ---------- */

.ab-head { display: flex; align-items: center; gap: 18px; }
.ab-print { position: relative; flex: 0 0 118px; margin: 0; transform: rotate(1.6deg); }
[dir="rtl"] .ab-print { transform: rotate(-1.6deg); }
.ab-print img { display: block; width: 100%; height: auto; padding: 6px; background: var(--paper); outline: 1.5px solid var(--ink); }
.ab-print .tape { width: 56px; height: 18px; inset-inline-start: 30%; top: -9px; transform: rotate(-4deg); }
.ab-tag { margin-top: 10px; font-family: var(--f-note); font-weight: 700; font-size: 1.2rem; line-height: 1.3; color: var(--red-ink); }
:lang(ar) .ab-tag { font-size: 1.4rem; }
.ab-ecg-wrap { position: relative; height: 72px; margin-top: 22px; overflow: hidden; }
.ab-ecg { display: block; width: 100%; height: 100%; }
.ab-ecg-win { position: absolute; top: 0; bottom: 0; left: 0; width: 12%; overflow: hidden; opacity: 0; }
.ab-ecg-red { position: absolute; left: 0; top: 0; width: 833.33%; height: 100%; }
.ab-ecg-red path { stroke: var(--red); stroke-width: 3; }
.ab-ecg path, .ab-ecg-red path, .ab-trace path { fill: none; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.ab-ecg-base { stroke: var(--ink); stroke-width: 2; }
.ab-body { margin-top: 16px; font-size: 1.0625rem; line-height: 1.7; max-width: 60ch; }
.ab-body a { text-decoration: underline; text-underline-offset: 0.2em; }
.ab h2 { margin-top: 44px; font-family: var(--f-display); font-weight: 400; font-size: clamp(1.75rem, 3.4vw, 2.5rem); line-height: 1.15; }
.ab-key { margin-top: 18px; font-size: 1.2rem; font-weight: 500; line-height: 1.55; max-width: 52ch; }
.ab-cards { display: grid; gap: 40px; margin: 42px 0 36px; }
.ab-cd { isolation: isolate; position: relative; padding: 26px 20px 18px; background: var(--paper); border: 1.5px solid var(--ink); transform: rotate(-0.6deg); }
.ab-cd:nth-child(even) { transform: rotate(0.5deg); }
[dir="rtl"] .ab-cd { transform: rotate(0.6deg); }
[dir="rtl"] .ab-cd:nth-child(even) { transform: rotate(-0.5deg); }
.ab-cd .tape { width: 56px; height: 18px; inset-inline-start: 12%; top: -9px; transform: rotate(-3deg); }
.ab-cd h3 { font-family: var(--f-display); font-weight: 400; font-size: 1.4rem; line-height: 1.15; }
.ab-cd h3 a { text-decoration: underline; text-underline-offset: 0.2em; }
.ab-cd .stamp { animation: none; }
.ab-trace { display: block; width: 100%; height: 44px; margin-top: 12px; }
.ab-trace path { stroke: var(--red-ink); stroke-width: 2; }
.ab-cd--3 .ab-trace path { stroke-dasharray: 4 3; }
.ab-cd p { margin-top: 10px; font-size: 1rem; line-height: 1.6; }
.ab-link { display: grid; grid-template-columns: auto minmax(40px, 1fr) auto; align-items: center; gap: 10px; margin-top: 24px; max-width: 560px; font-family: var(--f-note); font-weight: 700; font-size: 1.0625rem; line-height: 1.25; color: var(--pencil); }
:lang(ar) .ab-link { font-size: 1.2rem; }
.ab-link-track { position: relative; height: 4px; overflow: hidden; border-top: 2px dashed var(--ink); }
.ab-link-track i { position: absolute; top: -2px; left: 0; width: 12%; height: 4px; background: var(--red); opacity: 0; }
[dir="rtl"] .ab-link-track { transform: scaleX(-1); }
@media (min-width: 1000px) {
  .ab-print { flex-basis: 190px; }
  .ab-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 44px 34px; }
}
@media (prefers-reduced-motion: no-preference) {
  .ab-ecg-base { animation: ab-draw 1400ms var(--ease-out) backwards; }
  .ab-anim [data-reveal] .ab-trace { clip-path: inset(0 100% 0 0); }
  .ab-anim [data-reveal].in .ab-trace { clip-path: inset(0); transition: clip-path 1100ms var(--ease-out); }
  .ab-anim [data-reveal]:not(.in) .stamp { opacity: 0; }
  .ab-anim [data-reveal].in .stamp { animation: ab-stamp 260ms var(--ease-out) 350ms backwards; }
  /* the sweep is a moving window onto a red copy of the line: transforms only, so phones don't repaint the path */
  .ab-anim .running .ab-ecg-win { opacity: 1; will-change: transform; animation: ab-win 4200ms linear 1400ms infinite backwards; }
  .ab-anim .running .ab-ecg-red { will-change: transform; animation: ab-win-in 4200ms linear 1400ms infinite backwards; }
  .ab-anim .running .ab-link-track i { opacity: 1; will-change: transform; animation: ab-win 2600ms linear infinite; }
}
@media (max-width: 900px) {
  .ab-cd, .ab-cd:nth-child(even), [dir="rtl"] .ab-cd, [dir="rtl"] .ab-cd:nth-child(even) { transform: none; }
  .ab-body a, .ab-cd h3 a { padding-block: 11px; }
}
@keyframes ab-draw { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0); } }
@keyframes ab-stamp { from { opacity: 0; } }
@keyframes ab-win { from { transform: translateX(-100%); } to { transform: translateX(833.33%); } }
@keyframes ab-win-in { from { transform: translateX(12%); } to { transform: translateX(-100%); } }

/* ---------- Clinic websites: a pencil plan of a clinic's first screen, with numbered notes ---------- */

.cl h1 { font-size: clamp(2.6rem, 6.4vw, 4.75rem); line-height: 1.05; }
:lang(ar) .cl h1 { line-height: 1.2; }
.cl-tag { margin-top: 8px; font-family: var(--f-note); font-weight: 700; font-size: 1.4rem; line-height: 1.3; color: var(--red-ink); }
:lang(ar) .cl-tag { font-size: 1.6rem; }
.cl-lead { margin-top: 14px; font-size: 1.0625rem; line-height: 1.65; max-width: 56ch; }
.cl h2 { margin-top: 44px; font-family: var(--f-display); font-weight: 400; font-size: clamp(1.75rem, 3.4vw, 2.5rem); line-height: 1.15; }
.cl-note { margin-top: 6px; font-family: var(--f-note); font-weight: 700; font-size: 1.0625rem; line-height: 1.35; color: var(--red-ink); }
:lang(ar) .cl-note { font-size: 1.2rem; }
.cl-plan { display: grid; gap: 28px; margin-top: 24px; }
.cl-wf { display: grid; gap: 8px; width: 230px; max-width: 70%; margin-inline: auto; padding: 14px 12px 18px; border: 2.5px solid var(--ink); border-radius: 22px; background: var(--paper); transform: rotate(-1.4deg); }
[dir="rtl"] .cl-wf { transform: rotate(1.4deg); }
.cl-wf span { position: relative; display: block; padding: 9px 10px; border: 1.5px dashed var(--pencil); font-family: var(--f-note); font-weight: 700; font-size: 0.95rem; line-height: 1.2; color: var(--pencil); }
:lang(ar) .cl-wf span { font-size: 1.1rem; }
.cl-wf .fill { background: var(--ink); border: 1.5px solid var(--ink); color: var(--paper); }
.cl-wf .tall { min-height: 64px; }
.cl-wf i, .cl-pins b { display: block; width: 24px; height: 24px; border-radius: 50%; background: var(--red-ink); color: var(--paper); font: 700 0.8rem/24px var(--f-body); text-align: center; }
.cl-wf i { position: absolute; inset-inline-end: -13px; top: 50%; margin-top: -12px; }
.cl-wf > i { top: auto; bottom: -11px; margin-top: 0; }
.cl-proof .stamp { top: 30px; inset-inline-end: 8px; animation: none; }
.cl-pins { display: grid; gap: 14px; margin: 0; padding: 0; list-style: none; }
.cl-pins li { display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 10px; }
.cl-pins h3 { font-family: var(--f-display); font-weight: 400; font-size: 1.4rem; line-height: 1.15; }
.cl-pins p { margin-top: 3px; font-size: 1rem; line-height: 1.5; }
.cl-proof { display: grid; gap: 30px; margin-top: 26px; }
.cl-proof .pd-shot:first-child { grid-column: 1 / -1; }
.cl-proof figcaption a { text-decoration: underline; text-underline-offset: 0.2em; }
.cl-cz { margin-top: 30px; font-size: 1.0625rem; line-height: 1.65; max-width: 60ch; }
.cl-cz a { text-decoration: underline; text-underline-offset: 0.2em; }
.cl-close { margin-top: 40px; padding-top: 24px; border-top: 2px solid var(--gutter); }
.cl-close > p { font-family: var(--f-note); font-weight: 700; font-size: 1.4rem; line-height: 1.35; }
:lang(ar) .cl-close > p { font-size: 1.75rem; }
.cl-close .pd-go { margin-top: 14px; }
@media (max-width: 899px) {
  .cl-close .pd-go .btn { width: 100%; flex: 1 1 100%; }
  .cl-proof figcaption a, .cl-cz a { padding-block: 11px; }
}
@media (min-width: 1000px) {
  .cl-plan { grid-template-columns: 260px minmax(0, 1fr); gap: 48px; align-items: start; }
  .cl-wf { width: 100%; max-width: none; }
  .cl-proof { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px 24px; }
}

/* ---------- 404: one file for both languages, because any address can land here ---------- */

html:not(.nf-en) [data-en], html.nf-en [data-ar] { display: none; }
.nf-code { font-family: var(--f-note); font-weight: 700; font-size: 1.4rem; color: var(--red-ink); }
:lang(ar) .nf-code { font-size: 1.6rem; }
.nf h1 { font-size: clamp(2.5rem, 6vw, 4.5rem); line-height: 1.1; }
:lang(ar) .nf h1 { line-height: 1.2; }
.nf-lead { margin-top: 14px; font-size: 1.0625rem; line-height: 1.65; max-width: 52ch; }
.nf-links { display: grid; gap: 4px; margin: 20px 0 0; padding: 0; list-style: none; }
.nf-links a { display: inline-flex; align-items: center; min-height: 44px; font-weight: 600; text-decoration: underline; text-underline-offset: 0.2em; }
