/* Home (English and Arabic): hero, selected work, the career chart with the next role after Now, short About.
   Loads after tokens.css and base.css, which hold the type, colours, header, footer and the tear-off strip. */

:root { --gutter: clamp(150px, 15vw, 230px); }

/* ---------- hero: who, level and focus, then the actions ---------- */
.hero { padding-top: clamp(40px, 7vh, 84px); align-items: end; row-gap: 36px; }
.hero-main { grid-column: 1 / 9; }
.hero-name { font-size: 17px; font-weight: 540; line-height: 1.3; }
.hero h1 { margin-top: 12px; font-weight: 440; font-size: clamp(40px, 4.2vw, 64px); line-height: 1.04; letter-spacing: -.024em;
  font-variation-settings: "wght" 440; text-wrap: balance; max-width: 15.5em; }
.hero-sub { margin-top: 18px; font-size: clamp(19px, 1.45vw, 22px); line-height: 1.35; color: var(--ink-2); text-wrap: balance; }
.hero-meta { margin-top: 14px; font-size: 16px; line-height: 1.5; color: var(--ink); }
.skills-row { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.skills-row li { font-size: 14px; line-height: 1.3; padding: 6px 11px; border: 1px solid var(--rule-2); white-space: nowrap; }
.hero .actions { margin-top: 28px; }
.hero-side { grid-column: 9 / 13; border-top: 1px solid var(--ink); padding-top: 12px; }
.hero-side-k { font-family: var(--mono); font-size: 12px; line-height: 1.45; color: var(--ink-2); }
.hero-side .avail { margin-top: 10px; font-size: 14.5px; gap: 8px; }
.hero-side time { font-variant-numeric: tabular-nums; }

/* ---------- timeline figure ---------- */
.tl-sec { padding-top: clamp(24px, 4vh, 56px); scroll-margin-top: 16px; }
.tl-head { display: flex; align-items: baseline; gap: 12px 28px; flex-wrap: wrap; padding-bottom: 12px; border-bottom: 1px solid var(--ink);
  font-family: var(--mono); font-size: 12px; color: var(--ink-2); }
.tl-head .fig { color: var(--ink); margin-inline-end: 10px; }
.legend { display: flex; gap: 18px; margin-inline-start: auto; align-items: center; }
.legend span { display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; }
.k-role { width: 16px; height: 6px; background: var(--data); }
.k-proj { width: 16px; height: 2px; background: var(--data-2); }
.k-res { width: 7px; height: 7px; border-radius: 50%; background: var(--paper); box-shadow: inset 0 0 0 1.5px var(--data); }
.k-next { width: 16px; height: 7px; border: 1.25px dashed var(--data); }
.hint { color: var(--ink-3); white-space: nowrap; }

.tl-body { position: relative; padding-top: 18px; }
.tl-frame { position: relative; --fw: clamp(268px, calc(27vw - 10px), 400px); }
.tl-plot { position: relative; width: calc(100% - var(--fw)); min-height: 200px; }

.tl-grid i { position: absolute; top: 0; bottom: 0; inset-inline-start: calc(var(--p) * 100%); width: 0;
  border-inline-start: 1px dotted var(--rule-2); opacity: .7; }
.tl-grid i:first-child { opacity: 0; }
.tl-now { position: absolute; top: -22px; bottom: -14px; inset-inline-start: 100%; width: 0;
  border-inline-start: 1px dashed var(--ink-3); z-index: 0; }
/* the Now cursor reads today: date, then the two clocks that matter for working hours */
.now-l { position: absolute; top: 4px; inset-inline-start: 9px; display: grid; gap: 1px;
  font-family: var(--mono); font-size: 11.5px; line-height: 1.45; color: var(--ink-2); white-space: nowrap; }
.now-l b { font-weight: 400; font-size: 12px; color: var(--ink); }
.now-c { display: flex; gap: 14px; color: var(--ink-3); }
.now-c time { color: var(--ink-2); font-variant-numeric: tabular-nums; }
.now-h { color: var(--ink-3); }

/* role rows (horizontal mode) */
.role { position: absolute; top: var(--y, 0); inset-inline-start: calc(var(--s) * 100%); width: calc((var(--e) - var(--s)) * 100%);
  transition: opacity .16s var(--ease); z-index: 1; }
.role-hit, .proj-hit { display: block; width: 100%; position: relative; }
.role-label { display: block; padding-bottom: 8px; white-space: nowrap; }
.co { display: block; font-size: 15px; font-weight: 520; line-height: 1.25; }
.rm { display: block; width: fit-content; font-family: var(--mono); font-size: 11.5px; color: var(--ink-3); line-height: 1.45; margin-top: 2px; }
.rm .rt::after { content: " · "; }
.bar { display: block; height: 8px; background: var(--data); transform-origin: left center; position: relative; }
.bar::before { content: ""; position: absolute; inset-inline-start: 0; top: -5px; height: 18px; width: 1px; background: var(--data); }
.role[data-id="jt"] .bar::after { content: ""; position: absolute; inset-inline-end: -1px; top: 0; bottom: 0; width: 10px;
  background: repeating-linear-gradient(90deg, var(--paper) 0 1px, transparent 1px 3px); }
[dir="rtl"] .bar { transform-origin: right center; }
.role-hit:hover .co, .role.is-on .co { text-decoration: underline; text-decoration-thickness: 1.5px; text-underline-offset: 4px; text-decoration-color: var(--data); }
.role-hit[aria-pressed="true"] .co { text-decoration: underline; text-decoration-thickness: 1.5px; text-underline-offset: 4px; text-decoration-color: var(--data); }

.proj { position: relative; margin-top: 9px; }
.proj-name { display: block; font-size: 12.5px; line-height: 1.3; color: var(--ink-2); white-space: nowrap; padding-bottom: 4px; transition: color .15s; }
.proj-line { display: block; height: 2px; background: var(--data-2); transform-origin: left center; transition: background-color .15s; }
[dir="rtl"] .proj-line { transform-origin: right center; }
.proj-hit:hover .proj-name, .proj.is-on .proj-name { color: var(--ink); }
.proj.wrap-name .proj-name { white-space: normal; }
.proj.res-tight .result span { max-width: 6.5em; }
.proj-hit:hover .proj-line, .proj.is-on .proj-line { background: var(--data); }

.proj.has-result::after { content: ""; position: absolute; inset-inline-end: -4px; bottom: -3.5px; width: 9px; height: 9px; border-radius: 50%;
  background: var(--paper); box-shadow: inset 0 0 0 1.5px var(--data); z-index: 1; }
.result { position: absolute; inset-inline-start: calc(100% + 14px + var(--rx, 0px)); bottom: -14px; height: 30px; width: max-content; display: flex; align-items: center; gap: 9px; white-space: nowrap; pointer-events: none; }
.result::before { content: ""; position: absolute; top: 50%; inset-inline-start: calc(-10px - var(--rx, 0px)); width: calc(4px + var(--rx, 0px)); height: 1px; background: var(--data-2); }
.result b { font-family: var(--mono); font-weight: 400; font-size: 21px; line-height: 1; color: var(--data-ink); letter-spacing: -.01em; }
.result span { font-size: 12.5px; line-height: 1.25; color: var(--ink-2); max-width: 16.5em; white-space: normal; }

/* labels knock out the year gridlines behind them */
.co, .rm, .proj-name { width: fit-content; max-width: 100%; }
@media (min-width: 721px) {
  .co, .rm, .proj-name, .result span, .result b { background: var(--paper); box-shadow: 4px 0 0 var(--paper), -4px 0 0 var(--paper); }
  .proj-name, .co { max-width: none; flex-shrink: 0; }
}

/* focus + context: hovering one role quiets the rest */
.tl-frame.is-focus .role:not(.is-on) { opacity: .26; }
.tl-frame.is-focus .tl-grid, .tl-frame.is-focus .tl-now { opacity: .6; }

/* readout */
.readout { position: absolute; inset-inline-start: 0; top: var(--ry, 0); width: var(--rw, 520px); z-index: 2; }
.ro-in { border-top: 1px solid var(--ink); padding-top: 12px; background: var(--paper); box-shadow: 0 0 0 10px var(--paper); }
.ro-k { display: flex; flex-wrap: wrap; gap: 4px 16px; font-family: var(--mono); font-size: 11.5px; color: var(--ink-3); line-height: 1.5; }
.ro-k span:first-child { color: var(--data-ink); }
.ro-t { font-weight: 500; font-size: 23px; line-height: 1.2; letter-spacing: -.01em; margin-top: 10px; }
.ro-m { font-size: 13.5px; color: var(--ink-2); margin-top: 4px; line-height: 1.4; }
.ro-b { list-style: none; margin-top: 12px; display: grid; gap: 5px; }
.ro-b li { position: relative; font-size: 13.5px; line-height: 1.42; padding-inline-start: 18px; max-width: 62ch; }
.ro-b li::before { content: ""; position: absolute; inset-inline-start: 0; top: .66em; width: 9px; height: 1px; background: var(--ink-3); }
.ro-w { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 18px; margin-top: 12px; font-size: 14px; }
.ro-w > span { font-family: var(--mono); font-size: 11.5px; color: var(--ink-3); }
.ro-w a { white-space: nowrap; }
.ro-close { display: none; }
.ro-more { margin-inline-start: auto; font-family: var(--mono); font-size: 11.5px; color: var(--ink-2); min-height: 24px; text-decoration: underline; text-underline-offset: .25em; text-decoration-color: var(--rule-2); }
.ro-more:hover { color: var(--ink); text-decoration-color: currentColor; }

.tl-frame.ro-below .readout { position: relative; top: auto; width: auto; max-width: 760px; margin-top: 64px; }

/* axis */
.tl-axis { display: flex; width: 100%; height: 44px; position: relative; }
.yr { flex: var(--mo-n, 12) 1 0; position: relative; min-width: 0; border-top: 1px solid var(--ink);
  background-image:
    linear-gradient(to right, var(--ink-2) 1px, transparent 1px),
    linear-gradient(to right, var(--rule-2) 1px, transparent 1px);
  background-size: calc(300% / var(--mo-n, 12)) 8px, calc(100% / var(--mo-n, 12)) 4px;
  background-repeat: repeat-x; background-position: 0 0, 0 0; }
.yr-short b { display: none; }
/* after Now the axis keeps going, dashed and undated */
.yr.yr-next { flex: 0 0 var(--fw); border-top: 1px dashed var(--ink-3); background: none; }
[dir="rtl"] .yr { background-image:
    linear-gradient(to left, var(--ink-2) 1px, transparent 1px),
    linear-gradient(to left, var(--rule-2) 1px, transparent 1px);
  background-position: 100% 0, 100% 0; }
.yr::before { content: ""; position: absolute; inset-inline-start: 0; top: 0; height: 14px; width: 1px; background: var(--ink); }
.yr b { position: absolute; top: 19px; inset-inline-start: 6px; font: 400 12px/1 var(--mono); color: var(--ink); }
.yr.yr-next b { color: var(--data-ink); }

.tl-foot { display: flex; flex-wrap: wrap; align-items: baseline; gap: 10px 28px; margin-top: 30px; padding-top: 12px; border-top: 1px solid var(--rule);
  font-size: 13px; color: var(--ink-2); }
.u-label { font-family: var(--mono); font-size: 11.5px; color: var(--ink-3); }
.undated { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 22px; }
.u-item { display: inline-flex; align-items: baseline; gap: 8px; white-space: nowrap; font-size: 13.5px; color: var(--ink); padding-block: 4px; }
.u-item::before { content: ""; width: 8px; height: 8px; border: 1.5px solid var(--data); align-self: center; transition: background-color .15s; }
.u-item:hover::before, .u-item.is-on::before { background: var(--data); }
.u-item span { color: var(--ink-3); font-size: 12.5px; }
.u-item .u-n { color: var(--ink); font-size: 13.5px; }
.tl-note { margin-inline-start: auto; font-family: var(--mono); font-size: 11.5px; color: var(--ink-3); }
.tl-fallback { list-style: none; display: grid; gap: 8px; }

/* draw once on load */
.tl-frame.is-drawing .bar { animation: draw .46s var(--ease) both; animation-delay: calc(var(--s) * 620ms); }
.tl-frame.is-drawing .proj-line { animation: draw .42s var(--ease) both; animation-delay: calc(var(--s) * 620ms + 90ms + var(--k) * 50ms); }
.tl-frame.is-drawing .role-label, .tl-frame.is-drawing .proj-name { animation: fade .26s linear both; animation-delay: calc(var(--s) * 620ms); }
.tl-frame.is-drawing .result, .tl-frame.is-drawing .proj.has-result::after { animation: fade .22s linear both; animation-delay: calc(var(--s) * 620ms + 470ms); }
.tl-frame.is-drawing .tl-axis { animation: drawAxis .5s var(--ease) both; }
.tl-frame.is-drawing .tl-now, .tl-frame.is-drawing .readout { animation: fade .3s linear both; animation-delay: .75s; }
.tl-frame.is-drawing .next { animation: fade .34s linear both; animation-delay: .95s; }
@keyframes draw { from { transform: scaleX(0); } to { transform: none; } }
@keyframes drawV { from { transform: scaleY(0); } to { transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes drawAxis { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }
[dir="rtl"] .tl-frame.is-drawing .tl-axis { animation-name: drawAxisR; }
@keyframes drawAxisR { from { clip-path: inset(0 0 0 100%); } to { clip-path: inset(0 0 0 0); } }


/* ---------- the next role: one more step of the staircase, after Now ---------- */
.tl-frame .next { position: absolute; top: var(--ny, 0); inset-inline-start: 100%; width: var(--fw); z-index: 1; background: var(--paper); }
.next-label { display: block; padding-bottom: 8px; }
.next-co { font-size: 15px; font-weight: 520; line-height: 1.25; letter-spacing: 0; }
.next-rm { font-family: var(--mono); font-size: 11.5px; line-height: 1.45; color: var(--ink-3); margin-top: 2px; white-space: nowrap; }
@media (min-width: 1281px) {
  .next-label { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 12px; }
  .next-co { white-space: nowrap; }
  .next-rm { margin-top: 0; }
}

.next-go { font-size: 14px; margin-top: 2px; }
.next-go a { white-space: nowrap; padding-block: 4px; display: inline-block; }
.next-body { margin-top: 14px; display: grid; gap: 8px; }
.next-seek, .next-terms { font-size: 14px; line-height: 1.45; text-wrap: pretty; }
.next-seek { color: var(--ink-2); }
.next-terms { color: var(--ink); }
.next-links { display: flex; flex-wrap: wrap; gap: 4px 18px; font-size: 14px; margin-top: 2px; }
.next-links a { white-space: nowrap; }
.next-links a[href^="tel"] { font-variant-numeric: tabular-nums; }

/* ---------- sections ---------- */
.sec { padding-top: clamp(88px, 10vw, 144px); scroll-margin-top: 8px; }
.sec--work { padding-top: clamp(72px, 8vw, 120px); }

/* ---------- work: the case study cards (rendered by home.js from work-data.js), then text-only projects ---------- */
.hcases { list-style: none; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: var(--g); row-gap: clamp(48px, 5vw, 72px); }
.hc { display: flex; flex-direction: column; min-width: 0; }
.hc-plate { position: relative; display: grid; place-items: center; aspect-ratio: 16 / 10; overflow: hidden; background: var(--paper-2);
  text-decoration: none; box-shadow: inset 0 0 0 1px var(--rule); }
.hc-img { width: 100%; height: 100%; object-fit: cover; object-position: top left; transition: transform .3s var(--ease); }
[data-theme="dark"] .hc-img { filter: brightness(.92); }
.hc-plate { transition: transform .3s var(--ease), box-shadow .3s var(--ease); }
.hc:hover .hc-plate { transform: translateY(-3px); box-shadow: inset 0 0 0 1px var(--rule), 0 18px 36px -26px rgba(0, 0, 0, .45); }
/* the case study's own colour, as a rule along the top of its card (accents live in tokens.css) */
.hc[data-accent] .hc-plate::before { content: ""; position: absolute; inset: 0 0 auto; height: 3px; background: var(--accent); z-index: 1; }
.hc-plate.is-phones .cc-phones { width: 60%; }
.hc:hover .cc-phones img { transform: translateY(-4px); }
.hc-cap { flex: 1; display: flex; flex-direction: column; padding-top: 20px; }
.hc-k { font-size: 14px; line-height: 1.4; color: var(--ink-2); }
.hc-k b { font-weight: 540; color: var(--ink); }
.hc-t { margin-top: 8px; font-weight: 460; font-size: clamp(22px, 1.75vw, 27px); line-height: 1.18; letter-spacing: -.012em; text-wrap: pretty; }
.hc-t a { text-decoration: none; }
.hc-t a:hover { text-decoration: underline; text-decoration-thickness: 1.5px; text-underline-offset: 5px; text-decoration-color: var(--data); }
.hc-meta { margin-top: 10px; margin-bottom: 20px; display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 14px; line-height: 1.45; color: var(--ink); }
.hc-meta span { white-space: nowrap; }
.hc-meta span + span { color: var(--ink-2); }
.hc-meta + .case-tags { margin-top: -6px; margin-bottom: 20px; }
/* brand and graphic work: its own row under the product case studies */
.hc-group { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 24px;
  margin-top: clamp(64px, 7vw, 104px); margin-bottom: clamp(24px, 3vw, 36px); padding-top: 12px; border-top: 1px solid var(--ink); }
.hc-group-h { font-size: clamp(22px, 1.9vw, 28px); font-weight: 460; line-height: 1.2; letter-spacing: -.012em; }
.hc-group .sec-go { font-size: 15px; white-space: nowrap; }
.hc-foot { margin-top: auto; padding-top: 14px; border-top: 1px solid var(--rule); display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px 24px; }
.hc-r { display: grid; gap: 4px; min-width: 0; }
.hc-rk { font-family: var(--mono); font-size: 11.5px; line-height: 1.4; color: var(--ink-3); }
.hc-rv { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; font-size: 14px; line-height: 1.35; color: var(--ink-2); }
.hc-rv b { font-family: var(--mono); font-weight: 400; font-size: 24px; line-height: 1.1; color: var(--data-ink); white-space: nowrap; }
.hc-r.is-target .hc-rv b { color: var(--ink); font-family: var(--sans); font-size: 22px; font-weight: 480; line-height: 1.2; letter-spacing: -.01em; }
[lang="ar"] .hc-r.is-target .hc-rv b { font-family: inherit; font-size: 22px; font-weight: 500; line-height: 1.3; }
.hc-go { font-size: 15px; line-height: 1.4; white-space: nowrap; padding-block: 4px; }
.more-h { margin-top: clamp(64px, 7vw, 104px); font-size: 15px; font-weight: 540; line-height: 1.3; }
.plist { list-style: none; margin-top: 12px; border-top: 1px solid var(--ink); }
.plist > li { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--g); row-gap: 6px; align-items: baseline;
  padding: 18px 0 20px; border-bottom: 1px solid var(--rule); }
.pl-t { grid-column: 1 / 5; }
.pl-t h4 { font-size: 18px; font-weight: 520; line-height: 1.3; letter-spacing: -.005em; text-wrap: pretty; }
.pl-m { margin-top: 4px; font-size: 14px; line-height: 1.45; color: var(--ink-2); }
.pl-m > span { display: block; }
.pl-d { grid-column: 5 / 10; font-size: 15px; line-height: 1.5; color: var(--ink-2); text-wrap: pretty; max-width: 34em; }
.pl-r { grid-column: 10 / 13; display: flex; align-items: baseline; gap: 10px; font-size: 14px; line-height: 1.35; color: var(--ink-2); }
.pl-r b { font-family: var(--mono); font-weight: 400; font-size: 24px; line-height: 1; color: var(--data-ink); white-space: nowrap; }
.pl-r.is-none { color: var(--ink-3); }
.quiet { margin-top: 18px; font-size: 15px; line-height: 1.5; color: var(--ink-2); }

/* ---------- career: the chart on wide screens; a short list with a toggle on phones ---------- */
.career-sum, .tl-toggle { display: none; }
.about-go { grid-column: 1 / 9; font-size: 15px; }

/* ---------- about ---------- */
.about-body { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--g); row-gap: 40px; }
.lead { grid-column: 1 / 10; font-weight: 400; font-size: clamp(24px, 2.35vw, 36px); line-height: 1.28; letter-spacing: -.012em; text-wrap: pretty; }
.prose { grid-column: 1 / 9; columns: 2; column-gap: var(--g); }
.prose p { font-size: 16.5px; line-height: 1.6; color: var(--ink-2); break-inside: avoid; margin-bottom: 1em; text-wrap: pretty; }
.facts { grid-column: 10 / 13; grid-row: 1 / span 2; align-self: start; border-top: 1px solid var(--rule); margin-top: 8px; }
.facts div { display: grid; gap: 3px; padding: 12px 0; border-bottom: 1px solid var(--rule); }
.facts dt { font-family: var(--mono); font-size: 11.5px; color: var(--ink-3); }
.facts dd { font-size: 14px; line-height: 1.45; }

/* ---------- Arabic ---------- */
/* Arabic labels: Alyamama for the letters and Host Grotesk for spaces and Latin, so word gaps stay normal
   (a monospace space between Arabic words reads as a hole) */
[lang="ar"] { --mono: "Alyamama", "Host Grotesk", sans-serif; }
[lang="ar"] body { line-height: 1.75; font-size: 17px; }
[lang="ar"] .hero h1 { letter-spacing: 0; line-height: 1.3; font-weight: 560; font-variation-settings: "wght" 560; font-size: clamp(38px, 4.2vw, 64px); max-width: 14em; }
[lang="ar"] .hero-sub { font-size: clamp(20px, 1.6vw, 24px); line-height: 1.6; }
[lang="ar"] .hero-meta, [lang="ar"] .avail, [lang="ar"] .pl-d, [lang="ar"] .pl-m, [lang="ar"] .cc-desc, [lang="ar"] .contact-seek, [lang="ar"] .cs-m, [lang="ar"] .quiet { line-height: 1.75; }
[lang="ar"] .hero-name, [lang="ar"] .me-n, [lang="ar"] .pl-t h4, [lang="ar"] .cs-co, [lang="ar"] .cc-k, [lang="ar"] .cc-meta, [lang="ar"] .hc-k, [lang="ar"] .hc-meta, [lang="ar"] .hc-rv, [lang="ar"] .hc-go, [lang="ar"] .hc-rk, [lang="ar"] .skills-row li, [lang="ar"] .btn { line-height: 1.5; letter-spacing: 0; }
[lang="ar"] .me-n { font-size: 17px; }
[lang="ar"] .me-r, [lang="ar"] .hero-side-k, [lang="ar"] .tear-k { line-height: 1.6; }
[lang="ar"] .cc-cap h3, [lang="ar"] .hc-t, [lang="ar"] .contact-h, [lang="ar"] .hc-group-h { letter-spacing: 0; line-height: 1.4; font-weight: 540; }
[lang="ar"] .mail-big, [lang="ar"] .reach-mail { letter-spacing: -.01em; }
[lang="ar"] .intro { font-size: 17px; line-height: 1.8; }
[lang="ar"] .sec-head h2, [lang="ar"] .lead, [lang="ar"] .ro-t, [lang="ar"] .cap h3, [lang="ar"] .reach-mail { letter-spacing: 0; }
[lang="ar"] .sec-head h2 { line-height: 1.3; font-weight: 540; }
[lang="ar"] .lead { line-height: 1.6; }
[lang="ar"] .prose p { line-height: 1.85; }
[lang="ar"] .co { font-size: 15px; }
[lang="ar"] .rm, [lang="ar"] .tl-head, [lang="ar"] .ro-k, [lang="ar"] .u-label, [lang="ar"] .tl-note, [lang="ar"] .facts dt,
[lang="ar"] .cap .meta, [lang="ar"] .foot .row { line-height: 1.6; }
[lang="ar"] .proj-name { font-size: 13px; line-height: 1.5; padding-bottom: 2px; }
[lang="ar"] .result span { font-size: 13px; line-height: 1.45; max-width: 11em; }
[lang="ar"] .ro-b li { font-size: 14px; line-height: 1.6; }
[lang="ar"] .ro-b li::before { top: .82em; }
[lang="ar"] .ro-t { line-height: 1.4; }
[lang="ar"] .cap .desc { line-height: 1.8; }
[lang="ar"] .nav a, [lang="ar"] .me { font-size: 16px; }
[lang="ar"] .lang[lang="en"] { font-size: 15px; }
.latin { font-family: "Host Grotesk", sans-serif; }
[lang="ar"] .next-co { font-size: 16px; line-height: 1.5; }
[lang="ar"] .next-rm, [lang="ar"] .tear-status, [lang="ar"] .now-l, [lang="ar"] .place, [lang="ar"] .reprint { line-height: 1.6; }
[lang="ar"] .next-seek, [lang="ar"] .next-terms { font-size: 14.5px; line-height: 1.75; }
[lang="ar"] .next-links, [lang="ar"] .reach { font-size: 15px; }
[lang="ar"] .now-l b { font-size: 13px; }

@media (min-width: 1281px) {
  .role-label { display: flex; align-items: baseline; gap: 12px; }
  .rm { margin-top: 0; }
}

/* phone-only parts of the chart, built by timeline.js */
.tlv, .hint-v, .u-det { display: none; }

/* ---------- tablet ---------- */
@media (max-width: 1100px) {
  .hero-main { grid-column: 1 / -1; }
  .hero-side { grid-column: 1 / 9; }
  .legend { margin-inline-start: 0; }
  .hint { margin-inline-start: auto; }
  .hc-foot { flex-direction: column; align-items: flex-start; justify-content: flex-start; gap: 10px; }
  .pl-t { grid-column: 1 / 6; }
  .pl-d { grid-column: 6 / 13; }
  .pl-r { grid-column: 6 / 13; margin-top: 6px; }
  .lead { grid-column: 1 / -1; }
  .prose { grid-column: 1 / -1; }
  .facts { grid-column: 1 / -1; grid-row: auto; display: grid; grid-template-columns: 1fr 1fr; column-gap: var(--g); }
}

/* ---------- phone: the chart turns vertical ---------- */
@media (max-width: 720px) {
  .hero { padding-top: 28px; row-gap: 28px; }
  .hero-name { font-size: 16px; }
  .hero h1 { font-size: clamp(31px, 8.6vw, 40px); line-height: 1.08; margin-top: 8px; }
  [lang="ar"] .hero h1 { font-size: clamp(29px, 8.2vw, 40px); line-height: 1.35; }
  .hero-sub { font-size: 18px; margin-top: 14px; }
  .hero-meta { font-size: 15px; }
  .skills-row { gap: 6px; margin-top: 14px; }
  .skills-row li { font-size: 13.5px; padding: 5px 9px; }
  .hero .actions { margin-top: 22px; }
  .hero-side { grid-column: 1 / -1; }

  .hcases { grid-template-columns: minmax(0, 1fr); row-gap: 44px; }
  .hc-cap { padding-top: 16px; }
  .hc-t { font-size: 22px; }
  .hc-meta { margin-bottom: 16px; }
  .hc-meta + .case-tags { margin-top: -4px; margin-bottom: 16px; }
  .hc-foot { gap: 6px 20px; }
  .hc-go { min-height: 44px; display: inline-flex; align-items: center; gap: .3em; }
  .plist > li { display: block; padding: 16px 0 18px; }
  .cs-go { margin-top: 8px; font-size: 14px; line-height: 1.4; }
  .cs-go a { display: inline-flex; align-items: center; gap: .3em; min-height: 32px; }
  .pl-d { margin-top: 8px; }
  .pl-r { margin-top: 10px; }
  .more-h { margin-top: 56px; }

  /* career: a short list first, the full chart one tap away */
  .career-sum { display: block; list-style: none; border-top: 1px solid var(--ink); }
  .career-sum li { padding: 14px 0 16px; border-bottom: 1px solid var(--rule); }
  .cs-co { font-size: 17px; font-weight: 520; line-height: 1.3; }
  .cs-m { margin-top: 2px; font-size: 14px; line-height: 1.45; color: var(--ink-2); }
  .cs-r { margin-top: 8px; display: flex; align-items: baseline; gap: 10px; font-size: 14px; line-height: 1.35; color: var(--ink-2); }
  .cs-r b { font-family: var(--mono); font-weight: 400; font-size: 22px; line-height: 1; color: var(--data-ink); }
  .tl-toggle { display: flex; margin-top: 18px; width: 100%; }
  .tl-sec .tl[data-collapsed] { display: none; }
  .tl-sec .tl { margin-top: 28px; }
  .tl-head { gap: 8px 16px; }
  .tl-head > span:first-child { flex-basis: 100%; }
  .legend { gap: 14px; }
  .hint { margin-inline-start: 0; flex-basis: 100%; }

  .tl-body { padding-top: 0; }
  .hint-h { display: none; }
  .hint-v { display: inline; }
  .tl-frame { display: block; }
  .tl-plot, .tl-axis, .readout { display: none !important; }
  .next-co { font-size: 15.5px; }

  /* ---------- the phone chart: vertical, to scale, one month = --mo ---------- */
  .tlv { display: block; position: relative; --mo: 12px; --rx: 48px; --bx: 56px; --bw: 18px; --px: 82px; --pk: 7px; --tx: 108px; }

  /* overview strip: the whole career at a glance; sticks while the chart scrolls */
  .vmap { position: sticky; top: 0; z-index: 6; background: var(--paper); padding: 10px var(--m) 2px; margin-inline: calc(-1 * var(--m)); margin-bottom: 26px; }
  .vmap::after { content: ""; position: absolute; inset-inline: var(--m); bottom: 0; height: 1px; background: var(--rule); }
  .vmap-read { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; font: 400 11.5px/1.45 var(--mono); min-height: 17px; }
  .vmap-m { color: var(--data-ink); white-space: nowrap; font-variant-numeric: tabular-nums; }
  .vmap-co { color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
  .vmap-track { position: relative; display: flex; height: 34px; margin-top: 10px; }
  .vmap-past { position: relative; flex: 1 1 auto; }
  .vmap-past::before { content: ""; position: absolute; inset-inline: 0; top: 11px; height: 1px; background: var(--rule-2); }
  .vmap-past::after { content: ""; position: absolute; inset-inline-end: 0; top: -5px; height: 22px; width: 0; border-inline-end: 1px dashed var(--ink-3); }
  .vmap-yr { position: absolute; top: 11px; height: 6px; inset-inline-start: calc(var(--p) * 100%); border-inline-start: 1px solid var(--ink-3); }
  .vmap-yr span { position: absolute; top: 6px; inset-inline-start: 3px; font: 400 10px/1.3 var(--mono); color: var(--ink-3); white-space: nowrap; }
  .vmap-seg { position: absolute; top: -10px; height: 44px; inset-inline-start: calc(var(--s) * 100%); width: calc((var(--e) - var(--s)) * 100%); z-index: 1; -webkit-tap-highlight-color: transparent; }
  .vmap-seg::before { content: ""; position: absolute; top: 10px; height: 8px; inset-inline: 0 2px; background: var(--data); transition: background-color .15s; }
  .tlv.is-reading .vmap-seg:not(.is-here)::before { background: var(--data-2); }
  .vmap-seg:focus-visible, .vmap-next:focus-visible { outline-offset: -2px; }
  .vmap-next { position: relative; flex: 0 0 17%; height: 44px; margin-top: -10px; -webkit-tap-highlight-color: transparent; }
  .vmap-next::before { content: ""; position: absolute; top: 10px; height: 8px; inset-inline: 4px 0; border: 1.25px dashed var(--data); transition: background-color .15s; }
  .vmap-next.is-here::before { background: color-mix(in srgb, var(--data) 22%, var(--paper)); }
  .vmap-next span { position: absolute; top: 23px; inset-inline-start: 4px; font: 400 10px/1.3 var(--mono); color: var(--data-ink); }
  .vmap-cur { position: absolute; top: -6px; height: 21px; width: 0; border-inline-start: 1.5px solid var(--ink); inset-inline-start: calc(var(--vp, 0) * 100%); z-index: 2; pointer-events: none; }
  .vmap-cur::before { content: ""; position: absolute; top: -1px; inset-inline-start: -4.75px; border: 4px solid transparent; border-top: 5px solid var(--ink); border-bottom: 0; }
  .tlv:not(.is-reading) .vmap-cur { opacity: 0; }

  /* the plot */
  .vplot { position: relative; padding-top: 12px; overflow-y: clip; }
  .vplot::before { content: ""; position: absolute; top: 0; height: 12px; inset-inline-start: calc(var(--rx) - 3px); width: 6px; background: var(--paper); z-index: 5; }
  .vroles { list-style: none; }
  .vs { position: relative; height: calc(var(--n) * var(--mo)); }
  .vrail { position: absolute; inset-block: 0; inset-inline-start: 0; width: var(--rx); border-inline-end: 1px solid var(--ink);
    background-image: repeating-linear-gradient(to bottom, var(--rule-2) 0 1px, transparent 1px var(--mo)),
      repeating-linear-gradient(to bottom, var(--ink-3) 0 1px, transparent 1px calc(var(--mo) * 3));
    background-size: 5px 100%, 9px 100%; background-repeat: no-repeat;
    background-position: right 0 top 0, right 0 top calc(var(--qo, 0) * var(--mo)); }
  [dir="rtl"] .vrail { background-position: left 0 top 0, left 0 top calc(var(--qo, 0) * var(--mo)); }
  .vy { position: absolute; top: calc(var(--o) * var(--mo)); inset-inline-end: 0; width: 15px; height: 1px; background: var(--ink); }
  .vy b { position: absolute; inset-inline-end: 19px; top: -8px; font: 400 12px/16px var(--mono); color: var(--ink); }
  .vy::after { content: ""; position: absolute; inset-inline-start: 100%; top: 0; width: calc(var(--tx) - var(--rx) - 10px); border-top: 1px dotted var(--rule-2); }

  /* each role: a ruled row; the start rule, the bar with its length, project lines, the result on the closing rule */
  .vspan::before { content: ""; position: absolute; top: 0; inset-inline: var(--rx) 0; height: 1px; background: var(--rule); }
  .vstart { position: absolute; top: 0; inset-inline-start: calc(var(--rx) - 7px); width: calc(var(--px) + var(--pk) + 9px - var(--rx)); height: 1px; background: var(--ink); z-index: 2; }
  .vstart b { position: absolute; inset-inline-end: calc(100% + 4px); top: -8px; font: 400 11px/16px var(--mono); color: var(--data-ink); }
  .vbar { position: absolute; top: 3px; bottom: 0; inset-inline-start: var(--bx); width: var(--bw); background: var(--data); z-index: 1; }
  .vdur { position: absolute; top: 8px; left: 0; width: 100%; writing-mode: vertical-rl; font: 400 10.5px/16px var(--mono); color: var(--paper); white-space: nowrap; }
  .is-open-ended .vbar::after { content: ""; position: absolute; inset-inline: 0; bottom: 0; height: 10px;
    background: repeating-linear-gradient(180deg, var(--paper) 0 1px, transparent 1px 3px); }
  .vpl { position: absolute; top: 0; bottom: 0; inset-inline-start: calc(var(--px) + var(--k) * var(--pk)); width: 2px; background: var(--data-2); z-index: 1; }
  .vpl.has-pin::after { content: ""; position: absolute; bottom: -4.5px; inset-inline-start: -3.5px; width: 9px; height: 9px; border-radius: 50%;
    background: var(--paper); box-shadow: inset 0 0 0 1.5px var(--data); z-index: 3; }
  .vtx { position: relative; z-index: 2; padding: 10px 0 0; padding-inline-start: var(--tx); }
  .vtog { display: block; width: 100%; min-height: 44px; position: relative; padding-inline-end: 46px; -webkit-tap-highlight-color: transparent; }
  .vco { display: block; font-size: 17px; font-weight: 520; line-height: 1.25; text-wrap: balance; }
  .vrm { display: block; font: 400 11.5px/1.5 var(--mono); color: var(--ink-3); margin-top: 3px; }
  .vrm > span { display: block; text-wrap: balance; }
  .vpm { position: absolute; top: -10px; inset-inline-end: -6px; width: 44px; height: 44px; }
  .vpm::before, .vpm::after { content: ""; position: absolute; top: 21px; inset-inline-start: 15px; width: 13px; height: 1.5px; background: var(--ink); transition: transform .18s var(--ease); }
  .vpm::after { transform: rotate(90deg); }
  .vtog[aria-expanded="true"] .vpm::after { transform: rotate(0deg); }
  .vtog[aria-expanded="true"] .vco, .vtog:hover .vco { text-decoration: underline; text-decoration-thickness: 1.5px; text-underline-offset: 4px; text-decoration-color: var(--data); }
  .vtog:focus-visible { outline-offset: 2px; }
  .vprj { list-style: none; margin-top: 8px; display: grid; gap: 5px; }
  .vprj li { position: relative; font-size: 13.5px; line-height: 1.35; color: var(--ink-2); text-wrap: pretty; }
  .vprj li::before { content: ""; position: absolute; top: .68em; height: 1px; background: var(--data-2);
    inset-inline-start: calc(var(--px) + var(--k) * var(--pk) + 2px - var(--tx)); width: calc(var(--tx) - var(--px) - var(--k) * var(--pk) - 8px); }
  .vres { position: absolute; bottom: 10px; inset-inline: var(--tx) 0; z-index: 2; display: grid; gap: 6px; }
  .vres p { display: flex; align-items: flex-end; gap: 10px; }
  .vres b { font: 400 31px/.78 var(--mono); color: var(--data-ink); letter-spacing: -.02em; }
  .vres p > span { font-size: 13px; line-height: 1.3; color: var(--ink-2); max-width: 15em; }

  /* the reading line: a sticky marker on the rail, the month under it is the one in the strip */
  .vhere { display: block; position: sticky; top: 30vh; top: 30svh; height: 0; z-index: 4; pointer-events: none; }
  .vhere::before { content: ""; position: absolute; bottom: 0; inset-inline-start: calc(var(--rx) - 2px); width: 3px; height: 200vh; background: var(--data); }
  .vhere::after { content: ""; position: absolute; top: -5px; inset-inline-start: calc(var(--rx) + 1px); border: 5px solid transparent; border-inline-end: 6px solid var(--data); border-inline-start: 0; z-index: 3; }
  .tlv:not(.is-reading) .vhere { visibility: hidden; }

  /* details open in place: the rail breaks above and below, because this part is not to scale */
  .vdet { position: relative; padding: 22px 0 30px; }
  .vdet .vrail { background: none; border-inline-end: 1px dotted var(--ink-3); }
  .vbrk { position: absolute; top: 4px; inset-inline-end: -8px; width: 15px; height: 6px; border-block: 1px solid var(--ink); background: var(--paper); transform: skewY(-24deg); }
  .vbrk-end { top: auto; bottom: 14px; }
  .vdet-l { position: absolute; top: 30px; left: 18px; writing-mode: vertical-rl; transform: rotate(180deg);
    font: 400 10px/1.3 var(--mono); color: var(--ink-3); white-space: nowrap; }
  [dir="rtl"] .vdet-l { left: auto; right: 18px; transform: none; }
  .vdet-in { padding-inline-start: var(--tx); }
  .vdet-k { display: flex; flex-wrap: wrap; gap: 2px 14px; font: 400 11.5px/1.5 var(--mono); color: var(--ink-3); }
  .vdet .ro-b { margin-top: 12px; gap: 8px; }
  .vdet .ro-b li { font-size: 14.5px; line-height: 1.45; }
  .vdet .ro-w { margin-top: 14px; }
  .vdet .ro-w a { padding-block: 10px; white-space: normal; }
  .vr.is-open .vdet-in { animation: fade .2s linear both; }

  /* Now, then the next role */
  .vnext { position: relative; padding-bottom: 10px; }
  .vnext:focus { outline: none; }
  .vnext .vrail { background: none; border-inline-end: 1px dashed var(--ink-3); }
  .vbar-next { position: absolute; top: 0; bottom: 0; inset-inline-start: var(--bx); width: var(--bw); border: 1.25px dashed var(--data); border-top: 0; }
  .vnow { position: relative; padding-top: 8px; border-top: 1px dashed var(--ink-3); }
  .vnow > b { position: absolute; top: 7px; inset-inline-start: 0; font: 400 12px/16px var(--mono); color: var(--ink); }
  .vnow-l { display: grid; padding-inline-start: var(--tx); font: 400 11.5px/1.5 var(--mono); color: var(--ink-2); }
  .vnow-c { display: flex; flex-wrap: wrap; gap: 0 14px; color: var(--ink-3); }
  .vnow-c time { color: var(--ink-2); font-variant-numeric: tabular-nums; }
  .vnext-k { position: absolute; inset-inline-start: 0; margin-top: 30px; font: 400 12px/16px var(--mono); color: var(--data-ink); }
  .vnext-slot { padding-top: 28px; padding-inline-start: var(--tx); }
  .tlv .next { position: static; width: auto; background: none; padding: 0; margin: 0; }
  .tlv .next-rm { white-space: normal; text-wrap: balance; }

  .u-item { min-height: 44px; align-items: center; padding-block: 0; }
  .u-item::before { align-self: center; }
  .u-det:not([hidden]) { display: block; }
  .u-det { padding: 12px 0 6px; border-top: 1px solid var(--rule); color: var(--ink); }
  .u-det .ro-t { font-size: 21px; margin-top: 6px; }
  .u-det .ro-w a { padding-block: 10px; }
  .tl-foot { margin-top: 26px; display: grid; gap: 10px; }
  .undated { display: grid; gap: 2px; }
  .tl-note { margin-inline-start: 0; }

  .sec { padding-top: 80px; }
  .sec--work { padding-top: 52px; }
  .facts { grid-template-columns: 1fr; }
  .prose { columns: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .tl-frame.is-drawing * { animation: none !important; }
  .readout { transition: none !important; }
  .vdet-in { animation: none !important; }
  .vpm::before, .vpm::after, .vmap-seg::before, .vmap-next::before { transition: none !important; }
  .hc-img, .hc .cc-phones img, .hc-plate { transition: none; }
  .hc:hover .hc-img, .hc:hover .cc-phones img, .hc:hover .hc-plate { transform: none; }
}
@media print {
  .tl-scrim, .hint { display: none; }
}
