/* ==========================================================
   bismahrizwan.com — all colours, fonts and spacing live here.
   To change a colour everywhere, edit it once in :root below.
   ========================================================== */

:root {
  /* Pond palette */
  --bg: #22261a;          /* page background (dark olive) */
  --panel: #2c3121;       /* slightly lighter olive */
  --line: #3b4029;        /* divider lines */
  --line-strong: #6b7148;
  --text: #ece3cf;        /* main text (parchment) */
  --text-soft: #cfc6ae;   /* paragraphs */
  --muted: #a39b84;       /* captions, dates */
  --link: #e3a5ad;        /* links (dusty rose) */
  --link-hover: #f2c8cd;
  --gold: #d4b15f;
  --burgundy: #7b2232;
  --olive: #5f6b3a;
  --pad: #4f5d33;         /* lily pads */
  --pad-dark: #3f4a2a;    /* big background lily pads */
  --shelf: #4a3a24;       /* wooden shelf */

  /* Type */
  --serif-display: 'Fraunces', Georgia, serif;
  --serif-body: 'Newsreader', Georgia, serif;

  --max: 1120px;
}

/* ---------- Base ---------- */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--serif-body);
  font-size: 19px;
  line-height: 1.6;
}
a { color: var(--link); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--link-hover); }
a:focus-visible, button:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
h1, h2, h3 { font-family: var(--serif-display); font-weight: 400; line-height: 1.15; margin: 0; }
h1 { font-size: clamp(40px, 6vw, 60px); }
h2 { font-size: clamp(28px, 3.4vw, 38px); margin-bottom: 20px; }
h3 { font-size: 22px; font-weight: 600; margin-bottom: 6px; }
p { margin: 0 0 16px; }
img { max-width: 100%; }

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 32px; }
.muted { color: var(--muted); }
.small { font-size: 16px; }
.body-small { font-size: 17px; }
.hl { color: var(--text); }
.me { color: var(--text); }
.item-title { font-family: var(--serif-display); font-size: 20px; color: var(--text); }
.item-title.big { font-size: 22px; }
a.quiet { color: var(--text); text-decoration-color: var(--line-strong); }
a.quiet:hover { color: var(--link); }

.skip-link { position: absolute; left: -9999px; }
.skip-link:focus { left: 16px; top: 16px; background: var(--text); color: var(--bg); padding: 8px 12px; z-index: 10; }

ul.plain { list-style: none; margin: 0; padding: 0; }
ul.stack { display: flex; flex-direction: column; gap: 20px; }
ul.lined li { padding: 16px 0; border-bottom: 1px solid var(--line); }
ul.lined li:last-child { border-bottom: 0; }

/* ---------- Frogs & lily pads ---------- */
.frog path, .frog circle { fill: var(--olive); stroke: var(--gold); stroke-width: 2.5; stroke-linecap: round; }
.frog .pupil { fill: var(--bg); stroke: none; }
.frog .line { fill: none; }
.frog-logo path, .frog-logo circle { stroke-width: 5; }
.frog-logo .pupil, .frog-logo .line { display: none; }
.pad path, .pad-olive { fill: var(--pad); }
.pad-burgundy path, path.pad-burgundy { fill: var(--burgundy); }
.pad-gold path { fill: #b08a3e; }
.pad-fill { fill: var(--pad-dark); }

/* ---------- Header & footer ---------- */
.site-header { border-bottom: 1px solid var(--line); }
.header-inner { display: flex; flex-wrap: wrap; gap: 8px 32px; align-items: center; justify-content: space-between; padding-top: 16px; padding-bottom: 16px; }
.site-name { display: flex; align-items: center; gap: 10px; min-height: 44px; color: var(--text); text-decoration: none; font-family: var(--serif-display); font-size: 22px; font-weight: 600; }
.site-header nav { display: flex; flex-wrap: wrap; gap: 0 22px; font-size: 17px; }
.site-header nav a { display: inline-flex; align-items: center; min-height: 44px; color: var(--text-soft); text-decoration: none; }
.site-header nav a:hover { color: var(--link); }
.site-header nav a[aria-current="page"] { color: var(--link); text-decoration: underline; text-underline-offset: 6px; }

.site-footer { color: var(--muted); font-size: 16px; }
.footer-inner { position: relative; border-top: 1px solid var(--line); padding: 28px 0 36px; display: flex; flex-wrap: wrap; gap: 8px 32px; justify-content: space-between; align-items: center; }
.footer-pads { position: absolute; top: -26px; right: 24px; }
.footer-pads .frog path, .footer-pads .frog circle { stroke-width: 6; }

/* ---------- Sections ---------- */
.section { padding: 64px 0; border-top: 1px solid var(--line); }
.section-tight { padding: 24px 0 72px; }
.section-head { display: flex; flex-wrap: wrap; gap: 12px 24px; justify-content: space-between; align-items: baseline; margin-bottom: 32px; }
.section-head h2 { margin: 0; }
.split { display: flex; flex-wrap: wrap; gap: 56px; }
.split-main { flex: 3 1 460px; min-width: 0; }
.split-side { flex: 2 1 300px; min-width: 0; }

.page-intro { padding: 80px 0 48px; max-width: 760px; }
.page-intro h1 { margin-bottom: 24px; }
.page-intro-row { max-width: none; display: flex; flex-wrap: wrap; gap: 16px 40px; align-items: flex-end; justify-content: space-between; padding-bottom: 40px; }
.page-intro-row h1, .page-intro-row p { margin: 0; }
.page-intro-split { max-width: none; display: flex; flex-wrap: wrap; gap: 32px 64px; }
.page-intro-split > div { flex: 1 1 460px; }
.page-intro-split .aside { flex: 1 1 300px; align-self: flex-end; font-size: 17px; }
.lede { color: var(--text-soft); margin: 0; }
.lede-after { margin: -24px 0 40px; color: var(--text-soft); max-width: 760px; }

/* ---------- Home ---------- */
.hero { display: flex; flex-wrap: wrap; gap: 64px; align-items: center; padding: 96px 0 88px; }
.hero-text { flex: 999 1 500px; min-width: 0; }
.hero-text h1 { font-size: clamp(44px, 6vw, 64px); margin-bottom: 28px; }
.hero-text p { max-width: 580px; color: var(--text-soft); margin-bottom: 18px; }
.hero-links { font-size: 17px; margin-top: 28px; }
.hero-photo { flex: 1 1 300px; max-width: 380px; margin: 0; }
.hero-photo figcaption { margin-top: 14px; font-style: italic; font-size: 15px; color: var(--muted); text-align: center; }

.photo-pond { position: relative; aspect-ratio: 1 / 1; }
.big-pad { position: absolute; inset: 0; width: 100%; height: 100%; }
.big-pad .veins line { stroke: #55623a; stroke-width: 1.2; }
.photo-pond .photo { position: absolute; top: 9%; left: 9%; width: 70%; aspect-ratio: 1 / 1; object-fit: cover; border-radius: 50%; border: 2px solid var(--line-strong); background: var(--panel); }
.photo-frog { position: absolute; bottom: 4%; right: 2%; }
.small-pond .photo { top: 14%; left: 14%; width: 72%; }

.working { display: flex; flex-wrap: wrap; gap: 48px; align-items: center; }
.pad-network { flex: 1 1 340px; max-width: 440px; height: auto; }
.pad-network .edges line { stroke: var(--line-strong); stroke-width: 1.5; stroke-dasharray: 4 5; }
.pad-network .labels text { font-family: var(--serif-body); font-style: italic; font-size: 17px; fill: var(--text-soft); text-anchor: middle; }
.working-list { flex: 999 1 420px; min-width: 0; display: flex; flex-direction: column; gap: 26px; font-size: 17px; }
.working-list p { color: var(--text-soft); margin: 0; }

.closing { padding: 56px 0 80px; }
.closing p { max-width: 760px; font-family: var(--serif-display); font-size: 26px; line-height: 1.45; color: var(--text-soft); margin: 0; }

/* ---------- Bookshelf ---------- */
.shelf-row { display: flex; flex-wrap: wrap; gap: 40px; align-items: flex-end; }
.shelf-row-big { gap: 48px; padding: 8px 0 64px; }
.shelf { flex: 999 1 520px; min-width: 0; display: flex; align-items: flex-end; gap: 8px; padding: 20px 0 10px; border-bottom: 10px solid var(--shelf); overflow-x: auto; }
.spine {
  writing-mode: vertical-rl; transform: rotate(180deg);
  flex: 0 0 auto; border: 0; border-radius: 4px; padding: 16px 0;
  display: flex; align-items: center; justify-content: space-between;
  font-family: var(--serif-display); font-size: 17px; text-decoration: none;
  color: #f6eedb; transition: transform 160ms ease;
}
.spine-author { font-family: var(--serif-body); font-size: 13px; }
.spine-burgundy { background: var(--burgundy); }
.spine-olive { background: var(--olive); }
.spine-gold { background: #b08a3e; color: var(--bg); }
.spine-plum { background: #4b2a2f; }
.spine-rust { background: #8c4a2f; }
a.spine:hover { color: #fff; transform: rotate(180deg) translateY(8px); }
.shelf-interactive .spine { cursor: pointer; }
.shelf-interactive .spine[aria-pressed="true"] { transform: rotate(180deg) translateY(14px); }
.shelf-frog { flex: 0 0 auto; margin-left: 12px; }
.book-detail { flex: 1 1 320px; min-width: 0; padding-bottom: 12px; }
.book-detail .rank { color: var(--gold); font-family: var(--serif-display); font-size: 20px; margin: 0; }
.book-detail h2 { margin: 4px 0 2px; font-size: 32px; }
.book-detail p:last-child { color: var(--text-soft); font-size: 18px; }
.current-book { flex: 1 1 260px; }
.current-book p { margin: 0; }
.current-title { font-family: var(--serif-display); font-size: 24px; line-height: 1.25; }
.progress { height: 6px; background: var(--line); border-radius: 3px; margin: 12px 0 6px; }
.progress div { height: 6px; background: var(--link); border-radius: 3px; }
li.finished { display: flex; justify-content: space-between; gap: 16px; font-size: 18px; }
.stars { color: var(--gold); white-space: nowrap; }

/* ---------- Research ---------- */
.topics { padding-bottom: 48px; }
.topic { display: flex; flex-wrap: wrap; gap: 16px 40px; padding: 36px 0; border-top: 1px solid var(--line); }
.topic:last-child { border-bottom: 1px solid var(--line); }
.topic-head { flex: 1 1 260px; display: flex; gap: 14px; align-items: flex-start; }
.topic-head .pad { flex: 0 0 auto; margin-top: 4px; }
.topic-head h2 { font-size: 26px; font-weight: 600; margin: 0; }
.topic-head p { margin: 6px 0 0; font-size: 16px; }
.topic-body { flex: 2 1 460px; min-width: 0; color: var(--text-soft); }
.topic-body p { margin: 0; }

/* ---------- Lists with dates (papers, talks, teaching) ---------- */
.year-groups { padding-bottom: 56px; }
.year-group { display: flex; flex-wrap: wrap; gap: 8px 40px; padding: 28px 0; border-top: 1px solid var(--line); }
.year-group:last-child { border-bottom: 1px solid var(--line); }
.year { flex: 0 0 120px; font-size: 28px; color: var(--gold); margin: 0; }
.year-group ul { flex: 1 1 560px; min-width: 0; font-size: 17px; }
.paper .item-title { font-size: 21px; }
ul.rows .row { display: flex; flex-wrap: wrap; gap: 4px 40px; padding: 22px 0; border-top: 1px solid var(--line); }
ul.rows .row:last-child { border-bottom: 1px solid var(--line); }
.row-date { flex: 0 0 120px; color: var(--muted); font-size: 17px; }
.row-main { flex: 1 1 420px; min-width: 0; font-size: 17px; }
.row-simple { display: flex; justify-content: space-between; gap: 16px; padding: 12px 0; border-top: 1px solid var(--line); font-size: 18px; }
.row-simple:last-child { border-bottom: 1px solid var(--line); }

/* ---------- Writing & interests ---------- */
.writing-pond { display: block; margin-top: 40px; }
.frog-month { margin: 0; max-width: 340px; }
.frog-month h2 { font-size: 28px; margin-bottom: 16px; }
.frog-month figcaption { margin-top: 14px; text-align: center; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 40px; font-size: 18px; }
.grid-3 p { color: var(--text-soft); margin: 0; }

/* ---------- Phones ---------- */
@media (max-width: 640px) {
  body { font-size: 18px; }
  .wrap { padding: 0 20px; }
  .hero { padding: 56px 0 48px; gap: 40px; }
  .page-intro { padding: 48px 0 32px; }
  .section { padding: 48px 0; }
  .year { flex-basis: 100%; }
  .row-date { flex-basis: 100%; }
  .closing p { font-size: 22px; }
}

/* Hide the alt text if a photo hasn't been uploaded yet */
.photo { color: transparent; overflow: hidden; }
@media (max-width: 640px) {
  .hero-photo { max-width: 300px; margin: 0 auto; }
}
