/* Sharif Kazemi: minimal site. Self-contained (no imports): the design-system tokens it uses are copied here.
   One column, system type, hairline rules. The colours are the charts' and the deck template's: sand page (the carousel
   background), cream cards, umber ink, terracotta. One light version for everyone, whatever the reader's system setting. */

:root {
  --bg: #EAE2CD;            /* sand: the page behind the charts' cards */
  --card: #FBF9F2;          /* cream: the charts' own surface */
  --text: #262115;
  --muted: #6E6450;         /* 4.5:1 on sand */
  --rule: #D6CBB0;          /* hairlines, a step darker than the page */
  --accent: #C05F21;        /* terracotta, for marks and focus; too light for text on sand */
  --accent-hover: #9C4A17;
  --link: #9C4A17;          /* deep terracotta: 4.8:1 on sand */
  --link-hover: #7A3912;
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --measure: 38rem;
  color-scheme: light;
}
:root {   /* motif palette (motifs/RULES.md §1); never chart colours */
  --gold-deep: #8A6814; --gold: #A8842A; --gold-light: #C9A84C; --gold-pale: #E2C87E;
  --strand: #C9BC9C; --strand2: #E0D6BC; --tint-back: #EAE2CD; --tint-mid: #E3D9BF;
}

* { box-sizing: border-box; }
html { background: var(--bg); color: var(--text); font-family: var(--font); font-size: 17px; line-height: 1.6;
       -webkit-text-size-adjust: 100%; }
body { margin: 0; }
a { color: var(--link); text-decoration: none; }
a:hover { color: var(--link-hover); text-decoration: underline; text-underline-offset: 3px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.page { max-width: var(--measure); margin: 0 auto; padding: 0 1.25rem; }

/* top bar: name left, two links right */
.top { display: flex; justify-content: space-between; align-items: center; padding: 2rem 0 0; font-size: 0.95rem; }
.top__name { display: inline-flex; align-items: center; gap: 0.5rem; color: var(--text); font-weight: 600; }
.top__name:hover { color: var(--text); text-decoration: none; }
.top__name img { width: 22px; height: 22px; display: block; }
.top nav a { color: var(--muted); margin-left: 1.25rem; }
.top nav a[aria-current] { color: var(--text); }

/* type */
h1 { font-size: 2rem; line-height: 1.2; letter-spacing: -0.015em; margin: 0 0 0.75rem; font-weight: 650; }
h2 { font-size: 1.25rem; line-height: 1.3; margin: 2.5rem 0 0.5rem; font-weight: 650; }
p { margin: 0 0 1.1rem; }
.lead { font-size: 1.15rem; color: var(--muted); }
.meta { font-size: 0.85rem; color: var(--muted); }
.label { font-size: 0.75rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin: 3.5rem 0 0.75rem; }
.ph { color: var(--muted); letter-spacing: 0.03em; }   /* caps placeholders, to be replaced */

/* sections */
.intro { padding: 5rem 0 0; }

/* list of writing: hairlines, nothing boxed */
.list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--rule); }
.list li { border-bottom: 1px solid var(--rule); }
.list a { display: block; padding: 1.1rem 0; color: var(--text); }
.list a:hover { text-decoration: none; }
.list a:hover .list__title { color: var(--link-hover); }
.list__title { display: block; font-weight: 600; line-height: 1.35; }
.list .meta { display: block; margin-top: 0.25rem; }
.list__authors { display: block; margin-top: 0.3rem; font-size: 0.85rem; line-height: 1.45; color: var(--muted); }
.list__authors b { font-weight: 650; color: var(--text); }   /* his name */
.list__authors + .meta { margin-top: 0.1rem; }

.list__item { display: block; padding: 1.1rem 0; }   /* entries with no link */
.sublabel { font-size: 0.85rem; color: var(--muted); margin: 1.75rem 0 0.5rem; }
.note { font-size: 0.85rem; color: var(--muted); margin: -0.25rem 0 0.75rem; }
.note--group { margin: 2.25rem 0 0; padding-top: 1rem; }   /* heads the writing-group lists that follow */

/* currently: dot map, current place in the accent */
.map { margin: 2.5rem 0 0; }
.map svg { width: 100%; height: auto; display: block; overflow: visible; }
.map__land { fill: none; stroke: var(--muted); stroke-opacity: 0.4; stroke-width: 1.15; stroke-linecap: round; }
.map__now { fill: var(--accent); }
.map__ring { fill: var(--accent); fill-opacity: 0.18; }
.map__pin { fill: var(--text); }

/* photographs: wider page, masonry columns, small captions */
.page--wide { max-width: 72rem; }
.page--wide .intro { max-width: var(--measure); }
.photos { columns: 3 18rem; column-gap: 1.25rem; margin-top: 3rem; }
.photos figure { break-inside: avoid; margin: 0 0 1.5rem; }
.photos img { width: 100%; height: auto; display: block; background: var(--rule);
               transition: transform 0.25s ease, box-shadow 0.25s ease; }
.photos a { display: block; position: relative; }
.photos a:hover, .photos a:focus-visible { z-index: 2; }   /* the hovered photo grows over its neighbours */
.photos a:hover img, .photos a:focus-visible img { transform: scale(1.045); box-shadow: 0 10px 28px rgba(38, 33, 21, 0.22); }
@media (prefers-reduced-motion: reduce) { .photos img { transition: none; } }
/* the closing pair: two frames at one height, across the full width, so their film burns run as one line;
   hovering grows the pair together, so the line stays whole */
.photos__pair { column-span: all; display: grid; column-gap: 6px; margin: 1rem 0 0; transition: transform 0.25s ease; }
.photos__pair figure { margin: 0; }
.photos__pair a:hover img, .photos__pair a:focus-visible img { transform: none; box-shadow: none; }
.photos__pair:hover { transform: scale(1.015); }
@media (prefers-reduced-motion: reduce) { .photos__pair { transition: none; } }
.photos a:hover { text-decoration: none; }
.photos figcaption { font-size: 0.8rem; color: var(--muted); margin-top: 0.4rem; }

/* photos: the in-place viewer (assets/lightbox.js) */
.lightbox { border: 0; padding: 0; margin: 0; width: 100vw; height: 100vh; max-width: none; max-height: none;
            background: var(--bg); color: var(--text); }
.lightbox::backdrop { background: var(--bg); }
html:has(.lightbox[open]) { overflow: hidden; }
.lightbox[open] { display: grid; place-items: center; }
.lightbox figure { margin: 0; padding: 3.5rem 4.5rem 2.5rem; display: grid; justify-items: center; gap: 0.75rem; pointer-events: none; }
.lightbox img { max-width: calc(100vw - 9rem); max-height: calc(100vh - 8rem); width: auto; height: auto; display: block; pointer-events: auto; }
.lightbox figcaption { font-size: 0.85rem; color: var(--muted); }
.lightbox__btn { position: fixed; background: none; border: 0; color: var(--muted); font: 300 2.25rem/1 var(--font); padding: 0.75rem 1rem; cursor: pointer; }
.lightbox__btn:hover { color: var(--text); }
.lightbox__prev { left: 0.5rem; top: 50%; transform: translateY(-50%); }
.lightbox__next { right: 0.5rem; top: 50%; transform: translateY(-50%); }
.lightbox__close { right: 0.5rem; top: 0.5rem; font-size: 2rem; }
@media (max-width: 560px) {
  .lightbox figure { padding: 3.5rem 0.75rem 3rem; }
  .lightbox img { max-width: calc(100vw - 1.5rem); max-height: calc(100vh - 9rem); }
  .lightbox__prev, .lightbox__next { top: auto; bottom: 0.5rem; transform: none; }
}

/* a moving field across the full window (assets/flow.js), fading in and out at its edges */
html { overflow-x: clip; }   /* 100vw counts the scrollbar; this keeps it from adding a sideways scroll */
.flow-band { width: 100vw; margin: 4.5rem 0 0 calc(50% - 50vw); height: 260px; }
.flow-band canvas { display: block; width: 100%; height: 100%;
  -webkit-mask-image: linear-gradient(transparent, #000 28%, #000 72%, transparent); mask-image: linear-gradient(transparent, #000 28%, #000 72%, transparent); }
.flow-band + footer { margin-top: 1rem; }
@media (max-width: 560px) { .flow-band { height: 200px; margin-top: 3.5rem; } }

/* motifs drawn by assets/paths.js */
.p-deep { stroke: var(--gold-deep); } .p-gold { stroke: var(--gold); } .p-light { stroke: var(--gold-light); } .p-pale { stroke: var(--gold-pale); }
.p-grey { stroke: var(--strand); } .p-grey2 { stroke: var(--strand2); }
.p-ink-fill { fill: var(--text); }
.p-tint-back { fill: var(--tint-back); } .p-tint-mid { fill: var(--tint-mid); } .p-tint-front { fill: var(--strand); fill-opacity: 0.45; }
.motif { display: block; width: 100%; height: auto; overflow: visible; }

/* home: the overview. Face, name, what he does, where he is now, the way in */
.overview { padding: 4.5rem 0 0; }
.overview__portrait { display: block; width: 176px; height: 176px; border-radius: 50%; margin: 0 0 2rem; }
.overview h1 { font-size: 2.4rem; margin: 0 0 0.6rem; }
.overview .lead { font-size: 1.2rem; color: var(--text); max-width: 32rem; }
.overview__now { margin: 1.75rem 0 0; padding: 0.9rem 0; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.overview__tag { font-size: 0.75rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin-right: 0.6rem; }
.overview p { position: relative; }

/* side notes: in the right margin on wide screens, under their line on narrow ones */
.sn-ref { font-size: 0.7em; line-height: 0; color: var(--link); margin-left: 0.1em; }
.sidenote { position: absolute; left: calc(100% + 2.25rem); top: 0.15rem; width: 12rem;
            font-size: 0.8rem; line-height: 1.45; color: var(--muted); }
.sidenote sup { font-size: 0.8em; color: var(--link); }
@media (max-width: 1180px) {   /* no margin to hold it: the note sits under its paragraph, without splitting the sentence */
  p:has(> .sidenote) { padding-bottom: 1.55rem; }
  .sidenote { left: 0; top: auto; bottom: 0; width: auto; white-space: nowrap; font-size: 0.8rem; }
}
.overview__links { margin: 2rem 0 0; font-size: 1.05rem; }
.overview__links a { margin-right: 1.5rem; }
.overview__links a::after { content: " →"; }
.overview__contact { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem 1.1rem; margin: 1.6rem 0 0; }
.button { display: inline-block; padding: 0.6rem 1.25rem; border-radius: 6px; background: var(--link); color: var(--card);
          font-weight: 600; text-decoration: none; transition: background 0.15s ease; }
.button:hover, .button:focus-visible { background: var(--link-hover); color: var(--card); text-decoration: none; }
.overview__email { font-size: 0.9rem; color: var(--muted); }
.overview__email:hover { color: var(--link-hover); }
@media (max-width: 560px) {
  .overview { padding-top: 2.75rem; }
  .overview__portrait { width: 136px; height: 136px; }
  .overview h1 { font-size: 2rem; }
}

/* the portrait elsewhere: home intro, post byline */
.intro__portrait { display: inline-block; margin: 0 0 1.5rem; border-radius: 50%; }
.intro__portrait img { display: block; width: 64px; height: 64px; border-radius: 50%; }
.byline { display: flex; align-items: center; gap: 0.5rem; font-size: 0.85rem; color: var(--muted); }
.byline img { width: 28px; height: 28px; border-radius: 50%; }

/* 404 */
.lost { text-align: center; padding: 4rem 0 0; }
.lost .tondo { width: 15rem; margin: 0 auto; }
.lost h1 { margin-top: 2.25rem; }

/* about: the portrait hero, the work trail, the painting */
.intro--about { padding-top: 3.5rem; }
.hero-paths { height: 160px; margin: 0 0 1.75rem; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.hero-paths:focus { outline: none; }
.hero-paths:focus-visible { outline: 2px solid var(--accent); outline-offset: 6px; border-radius: 4px; }
.portrait { display: block; border-radius: 50%; margin: 0 0 1.75rem; }

/* the work trail (waypoints, in time order): when | the trail | what. The first stage is the origin (ink dot), the
   stations deepen down the trail, the latest is the destination (open ring, deepest gold). Markers sit on the first
   line of each stage's text; the dotted gold trail (the kit's 1 8 dash) joins them. */
.trail { list-style: none; margin: 1.5rem 0 0.5rem; padding: 0; --when: 6.4rem; --rail: 2.2rem; --mid: calc(var(--when) + var(--rail) / 2); }
.trail li { position: relative; display: grid; grid-template-columns: var(--when) var(--rail) 1fr; padding-bottom: 1.6rem;
            --station: var(--gold); }
.trail li { --station: var(--gold-deep); }   /* newest first: stations deepen up the trail towards the latest */
.trail li:nth-last-child(2) { --station: var(--gold-light); }
.trail li:nth-last-child(3) { --station: var(--gold); }
.trail__when { grid-column: 1; margin: 0; padding-top: 0.32rem; text-align: right; font-size: 0.75rem; line-height: 1.4;
               letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.trail li > p:last-child { grid-column: 3; margin: 0; }
.trail li::before {   /* a station: filled with the page, stroked in its shade */
  content: ""; position: absolute; left: var(--mid); top: 0.8em; width: 11px; height: 11px; transform: translate(-50%, -50%);
  box-sizing: border-box; border-radius: 50%; border: 1.9px solid var(--station); background: var(--bg); z-index: 1;
}
.trail li:first-child::before { width: 9px; height: 9px; border-width: 2.1px; border-color: var(--gold-deep); }   /* the destination: the latest stage */
.trail li:last-child::before { width: 6px; height: 6px; border: 0; background: var(--text); }   /* the origin: the first stage */
.trail li:not(:last-child)::after {
  content: ""; position: absolute; left: var(--mid); transform: translateX(-50%); top: calc(0.8em + 7px); bottom: calc(7px - 0.8em);
  width: 2.2px; background: radial-gradient(circle, var(--gold) 1.05px, transparent 1.25px) center 3px / 2.2px 8px repeat-y;
}
@media (max-width: 560px) {   /* one column: the trail on the left, the date above each stage */
  .trail { --mid: 7px; }
  .trail li { grid-template-columns: 1fr; padding-left: 1.9rem; }
  .trail__when { text-align: left; padding-top: 0.15rem; }
  .trail li > p:last-child { grid-column: 1; }
  .trail li::before { top: 0.75em; }
}

.tondo { margin: 0; }
.tondo__frame { display: block; border-radius: 50%; overflow: hidden; aspect-ratio: 1; }
.tondo__frame img { display: block; width: 100%; height: 100%; transform: scale(1.12); }   /* crops to the painted circle */
.tondo figcaption { font-size: 0.8rem; color: var(--muted); margin-top: 0.6rem; text-align: center; }
.tondo--aside { float: right; width: 11rem; margin: 0.35rem 0 1rem 1.75rem; }
.tondo--aside + p { margin-top: 0; }
.label { clear: both; }
@media (max-width: 560px) {
  .hero-paths { height: 130px; }
  .tondo--aside { float: none; width: 12rem; margin: 0.5rem auto 1.75rem; }
}

/* links inside running text are underlined, so they read as links on the sand (whole-entry list links are not) */
.note a, .bullets a, main p:not(.elsewhere):not(.overview__links):not(.overview__contact) > a {
  text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px;
  text-decoration-color: rgba(156, 74, 23, 0.45);
}
.note a { color: var(--link-hover); font-weight: 600; }   /* small grey text: the darker terracotta, semibold */
.note a:hover, .bullets a:hover, main p:not(.elsewhere):not(.overview__links):not(.overview__contact) > a:hover { text-decoration-color: currentColor; }

/* a plain list inside running text */
.bullets { margin: -0.4rem 0 1.1rem; padding-left: 1.15rem; }
.bullets li { margin: 0.2rem 0; padding-left: 0.2rem; }
.bullets li::marker { color: var(--muted); }

/* selected writing: groups and sub-groups. A group is a section heading over a heavy rule; a sub-group is a small
   capitals label inside it */
.group { font-size: 1.35rem; font-weight: 650; line-height: 1.25; letter-spacing: -0.01em; color: var(--text);
         margin: 4rem 0 0.9rem; padding-top: 0.9rem; border-top: 2px solid var(--text); }
.intro + .group { margin-top: 2.75rem; }
.subgroup { font-size: 0.75rem; font-weight: 600; letter-spacing: 0.09em; text-transform: uppercase; color: var(--muted);
            margin: 2rem 0 0.35rem; }
.group + .subgroup { margin-top: 0.4rem; }
.group + .list, .subgroup + .list { border-top: 0; }

/* links elsewhere: one line */
.elsewhere a { margin-right: 1.25rem; }

/* article */
article { padding: 4rem 0 0; }
article h1 { margin-top: 0.5rem; }
article figure { margin: 2rem 0; }
article figure img { width: 100%; display: block; border-radius: 10px; background: var(--card);
                     box-shadow: 0 2px 12px rgba(38, 33, 21, 0.10); }   /* charts sit on cream cards, as in the carousel */
article figcaption { font-size: 0.85rem; color: var(--muted); margin-top: 0.5rem; }
.end { display: block; width: 72px; margin: 3rem auto 0; }

/* footer */
footer { margin: 5rem 0 0; padding: 1.5rem 0 3rem; border-top: 1px solid var(--rule); font-size: 0.85rem; color: var(--muted);
         display: flex; justify-content: space-between; flex-wrap: wrap; gap: 0.5rem; }
footer a { color: var(--muted); margin-left: 1rem; }

@media (max-width: 480px) {
  html { font-size: 16px; }
  .intro { padding-top: 3rem; }
  h1 { font-size: 1.7rem; }
  .top { flex-wrap: wrap; row-gap: 0.75rem; }   /* four nav links: drop them under the name */
  .top nav { width: 100%; }
  .top nav a { margin: 0 1.25rem 0 0; }
}

/* published copy only: placeholders not yet written are not shown */
.ph { display: none !important; }
