/* ==========================================================================
   The Roashans — site styles
   Literary / editorial: warm paper, ink, lapis. Light and dark themes.
   ========================================================================== */

/* ---------- Fonts (self-hosted, variable) ---------- */
@font-face {
  font-family: "Newsreader Variable";
  font-style: normal;
  font-display: swap;
  font-weight: 200 800;
  src: url("../fonts/newsreader-latin-normal.woff2") format("woff2-variations");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Newsreader Variable";
  font-style: italic;
  font-display: swap;
  font-weight: 200 800;
  src: url("../fonts/newsreader-latin-italic.woff2") format("woff2-variations");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Newsreader Variable";
  font-style: normal;
  font-display: swap;
  font-weight: 200 800;
  src: url("../fonts/newsreader-latin-ext-normal.woff2") format("woff2-variations");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Newsreader Variable";
  font-style: italic;
  font-display: swap;
  font-weight: 200 800;
  src: url("../fonts/newsreader-latin-ext-italic.woff2") format("woff2-variations");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Inter Variable";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url("../fonts/inter-latin.woff2") format("woff2-variations");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Inter Variable";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url("../fonts/inter-latin-ext.woff2") format("woff2-variations");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Vazirmatn Variable";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url("../fonts/vazirmatn-arabic.woff2") format("woff2-variations");
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC;
}

@font-face {
  font-family: "Noto Nastaliq Urdu";
  font-style: normal;
  font-display: swap;
  font-weight: 400;
  src: url("../fonts/noto-nastaliq-arabic.woff2") format("woff2");
  unicode-range: U+0600-06FF, U+0750-077F, U+200C-200E, U+FB50-FDFF, U+FE70-FEFC;
}

/* ---------- Tokens ---------- */
:root {
  color-scheme: light dark;
  --paper: #fbf8f2;
  --paper-2: #f4efe5;
  --paper-3: #ebe3d5;
  --ink: #1c1a17;
  --ink-2: #3c3731;
  --muted: #6b6458;
  --rule: #e3dacb;
  --lapis: #1f4b8e;
  --lapis-2: #163a70;
  --lapis-soft: #e6edf7;
  --on-lapis: #fff;
  --clay: #9a4426;
  --clay-soft: #f6e8e0;
  --teal: #1b6e6a;
  --teal-soft: #e1efed;
  --saffron: #85660f;
  --saffron-soft: #f4edd7;
  --hero-ink: #fffdf8;
  --shadow: 0 1px 2px rgb(28 26 23 / 0.05), 0 10px 30px -18px rgb(28 26 23 / 0.35);
  --shadow-lift: 0 2px 4px rgb(28 26 23 / 0.06), 0 18px 40px -20px rgb(28 26 23 / 0.45);

  --font-serif: "Newsreader Variable", "Newsreader", "Iowan Old Style", Georgia, "Times New Roman", serif;
  --font-sans: "Inter Variable", "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-fa: "Vazirmatn Variable", "Vazirmatn", Tahoma, "Segoe UI", sans-serif;
  --font-nastaliq: "Noto Nastaliq Urdu", "Vazirmatn Variable", "Vazirmatn", serif;

  /* Ornaments (masks; they take the colour of the element's background) */
  --orn-frieze: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='28' height='16' viewBox='0 0 28 16'%3E%3Cpath d='M0 .5h28M0 15.5h28' stroke='%23000' stroke-width='1'/%3E%3Cpath fill-rule='evenodd' d='M20.20 8.00 18.38 9.82 18.38 12.38 15.82 12.38 14.00 14.20 12.18 12.38 9.62 12.38 9.62 9.82 7.80 8.00 9.62 6.18 9.62 3.62 12.18 3.62 14.00 1.80 15.82 3.62 18.38 3.62 18.38 6.18Z M12.30 8.00a1.7 1.7 0 1 0 3.4 0a1.7 1.7 0 1 0 -3.4 0Z'/%3E%3Cpath d='M2.20 8.00 1.55 8.64 1.56 9.56 0.64 9.55 0.00 10.20 -0.64 9.55 -1.56 9.56 -1.55 8.64 -2.20 8.00 -1.55 7.36 -1.56 6.44 -0.64 6.45 -0.00 5.80 0.64 6.45 1.56 6.44 1.55 7.36Z M30.20 8.00 29.55 8.64 29.56 9.56 28.64 9.55 28.00 10.20 27.36 9.55 26.44 9.56 26.45 8.64 25.80 8.00 26.45 7.36 26.44 6.44 27.36 6.45 28.00 5.80 28.64 6.45 29.56 6.44 29.55 7.36Z'/%3E%3C/svg%3E");
  --orn-star: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='20' viewBox='0 0 160 20'%3E%3Cpath d='M0 10h62M98 10h62' stroke='%23000' stroke-width='1'/%3E%3Cpath fill-rule='evenodd' d='M87.50 10.00 85.30 12.20 85.30 15.30 82.20 15.30 80.00 17.50 77.80 15.30 74.70 15.30 74.70 12.20 72.50 10.00 74.70 7.80 74.70 4.70 77.80 4.70 80.00 2.50 82.20 4.70 85.30 4.70 85.30 7.80Z M77.80 10.00a2.2 2.2 0 1 0 4.4 0a2.2 2.2 0 1 0 -4.4 0Z'/%3E%3Cpath d='M70.40 10.00 69.70 10.70 69.70 11.70 68.70 11.70 68.00 12.40 67.30 11.70 66.30 11.70 66.30 10.70 65.60 10.00 66.30 9.30 66.30 8.30 67.30 8.30 68.00 7.60 68.70 8.30 69.70 8.30 69.70 9.30Z M94.40 10.00 93.70 10.70 93.70 11.70 92.70 11.70 92.00 12.40 91.30 11.70 90.30 11.70 90.30 10.70 89.60 10.00 90.30 9.30 90.30 8.30 91.30 8.30 92.00 7.60 92.70 8.30 93.70 8.30 93.70 9.30Z'/%3E%3C/svg%3E");
  --orn-kilim: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='14' viewBox='0 0 16 14'%3E%3Cpath d='M0 0h16v2h-2v2h-2v2h-2v2H6V6H4V4H2V2H0zM0 6h2v2h2v2h2v2h4v-2h2V8h2V6h2v8H0z'/%3E%3C/svg%3E");

  --step--2: 0.78rem;
  --step--1: 0.875rem;
  --step-0: clamp(1.075rem, 1rem + 0.32vw, 1.2rem);
  --step-1: clamp(1.25rem, 1.12rem + 0.55vw, 1.5rem);
  --step-2: clamp(1.5rem, 1.28rem + 1vw, 2.05rem);
  --step-3: clamp(1.9rem, 1.5rem + 1.9vw, 2.9rem);
  --step-4: clamp(2.6rem, 1.8rem + 3.6vw, 4.6rem);

  --wrap: 74rem;
  --measure: 40rem;
  --gutter: clamp(1rem, 4vw, 2rem);
  --radius: 12px;
  --radius-sm: 8px;
  --accent: var(--lapis);
  --accent-soft: var(--lapis-soft);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #15130f;
    --paper-2: #1d1a15;
    --paper-3: #28231c;
    --ink: #eee7da;
    --ink-2: #d4ccbe;
    --muted: #a59c8d;
    --rule: #342f27;
    --lapis: #93b5ee;
    --lapis-2: #b8cff5;
    --lapis-soft: #1b2537;
    --on-lapis: #0f1724;
    --clay: #e59d7f;
    --clay-soft: #2d1f18;
    --teal: #7fcac2;
    --teal-soft: #14292a;
    --saffron: #dcbb5f;
    --saffron-soft: #2a2414;
    --shadow: 0 1px 2px rgb(0 0 0 / 0.3), 0 10px 30px -18px rgb(0 0 0 / 0.7);
    --shadow-lift: 0 2px 4px rgb(0 0 0 / 0.35), 0 18px 40px -20px rgb(0 0 0 / 0.8);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
    --paper: #15130f;
    --paper-2: #1d1a15;
    --paper-3: #28231c;
    --ink: #eee7da;
    --ink-2: #d4ccbe;
    --muted: #a59c8d;
    --rule: #342f27;
    --lapis: #93b5ee;
    --lapis-2: #b8cff5;
    --lapis-soft: #1b2537;
    --on-lapis: #0f1724;
    --clay: #e59d7f;
    --clay-soft: #2d1f18;
    --teal: #7fcac2;
    --teal-soft: #14292a;
    --saffron: #dcbb5f;
    --saffron-soft: #2a2414;
    --shadow: 0 1px 2px rgb(0 0 0 / 0.3), 0 10px 30px -18px rgb(0 0 0 / 0.7);
    --shadow-lift: 0 2px 4px rgb(0 0 0 / 0.35), 0 18px 40px -20px rgb(0 0 0 / 0.8);
  color-scheme: dark;
}
:root[data-theme="light"] { color-scheme: light; }

/* Section accents */
.accent-lapis, .section-country-corner { --accent: var(--lapis); --accent-soft: var(--lapis-soft); }
.accent-clay, .section-my-ancestral-home { --accent: var(--clay); --accent-soft: var(--clay-soft); }
.accent-teal, .section-art-and-culture { --accent: var(--teal); --accent-soft: var(--teal-soft); }
.accent-saffron, .section-resources { --accent: var(--saffron); --accent-soft: var(--saffron-soft); }

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: 5rem; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-serif);
  font-size: var(--step-0);
  line-height: 1.6;
  font-optical-sizing: auto;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img, svg, picture { display: block; max-width: 100%; }
img { height: auto; }
a { color: var(--lapis); text-decoration-thickness: 0.07em; text-underline-offset: 0.18em; }
a:hover { color: var(--lapis-2); }
:focus-visible { outline: 3px solid var(--lapis); outline-offset: 3px; border-radius: 3px; }
h1, h2, h3, h4 { font-family: var(--font-serif); line-height: 1.15; font-weight: 560; letter-spacing: -0.01em; margin: 0 0 0.5em; text-wrap: balance; }
p { margin: 0 0 1em; }
hr { border: 0; border-top: 1px solid var(--rule); margin: 2.5rem 0; }
::selection { background: var(--lapis-soft); }
:lang(fa) { font-family: var(--font-fa); }

.sr-only {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: 1rem; top: -4rem; z-index: 100;
  background: var(--ink); color: var(--paper); padding: 0.6rem 1rem; border-radius: var(--radius-sm);
  font-family: var(--font-sans); font-size: var(--step--1); text-decoration: none;
}
.skip-link:focus { top: 1rem; color: var(--paper); }

.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gutter); }
.measure { max-width: var(--measure); margin-inline: auto; }

.kicker {
  font-family: var(--font-sans); font-size: var(--step--2); font-weight: 650; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--accent); margin: 0 0 0.75rem;
}
.kicker a { color: inherit; text-decoration: none; }
.kicker a:hover { text-decoration: underline; }
.meta { font-family: var(--font-sans); font-size: var(--step--1); color: var(--muted); }
.meta a { color: inherit; }
.dot::before { content: "·"; margin-inline: 0.45em; color: var(--muted); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 0.5em;
  font-family: var(--font-sans); font-size: var(--step--1); font-weight: 600; line-height: 1;
  padding: 0.85em 1.25em; border-radius: 999px; text-decoration: none; border: 1px solid transparent;
  transition: background-color 0.15s, color 0.15s, border-color 0.15s, transform 0.15s;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--lapis); color: var(--on-lapis); }
.btn-primary:hover { background: var(--lapis-2); color: var(--on-lapis); }
.btn-outline { border-color: var(--rule); color: var(--ink); background: var(--paper); }
.btn-outline:hover { border-color: var(--ink); color: var(--ink); }
.btn-light { background: var(--hero-ink); color: #1c1a17; }
.btn-light:hover { background: #fff; color: #1c1a17; }
.btn-ghost-light { border-color: rgb(255 255 255 / 0.55); color: #fff; }
.btn-ghost-light:hover { background: rgb(255 255 255 / 0.12); color: #fff; }
.link-arrow { font-family: var(--font-sans); font-size: var(--step--1); font-weight: 600; text-decoration: none; white-space: nowrap; }
.link-arrow::after { content: " →"; }
[dir="rtl"] .link-arrow::after { content: " ←"; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--paper) 90%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  -webkit-backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--rule);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 4rem; }
.brand { display: inline-flex; align-items: center; gap: 0.6rem; color: var(--ink); text-decoration: none; }
.brand:hover { color: var(--ink); }
.brand-mark { width: 1.6rem; height: 1.6rem; color: var(--lapis); flex: none; }
.brand-name { font-family: var(--font-serif); font-size: 1.32rem; font-weight: 600; letter-spacing: -0.01em; }
.brand-name em { font-style: italic; font-weight: 450; }
.site-nav ul { list-style: none; margin: 0; padding: 0; display: flex; align-items: center; gap: 0.15rem; }
.site-nav a {
  display: inline-flex; align-items: center; gap: 0.4rem;
  font-family: var(--font-sans); font-size: 0.9rem; font-weight: 520; color: var(--ink-2);
  text-decoration: none; padding: 0.5rem 0.7rem; border-radius: 999px;
}
.site-nav a:hover { background: var(--paper-2); color: var(--ink); }
.site-nav a[aria-current="page"], .site-nav a[aria-current="true"] { color: var(--ink); background: var(--paper-3); }
.nav-search svg { width: 1.05rem; height: 1.05rem; }
.nav-toggle {
  display: none; align-items: center; justify-content: center; width: 2.75rem; height: 2.75rem;
  border: 1px solid var(--rule); border-radius: 999px; background: var(--paper); color: var(--ink); cursor: pointer;
}
.nav-toggle svg { width: 1.25rem; height: 1.25rem; }
.nav-toggle .icon-close { display: none; }
.nav-toggle[aria-expanded="true"] .icon-open { display: none; }
.nav-toggle[aria-expanded="true"] .icon-close { display: block; }

@media (max-width: 62rem) {
  .js .nav-toggle { display: inline-flex; }
  .js .site-nav {
    position: absolute; inset: 100% 0 auto 0; background: var(--paper);
    border-bottom: 1px solid var(--rule); box-shadow: var(--shadow-lift);
    display: none; padding: 0.5rem var(--gutter) 1rem;
  }
  .js .site-nav.is-open { display: block; }
  .site-nav ul { flex-wrap: wrap; }
  .js .site-nav ul { flex-direction: column; align-items: stretch; gap: 0; }
  .js .site-nav a { display: flex; width: 100%; font-size: 1.05rem; padding: 0.85rem 0.25rem; border-radius: 0; border-bottom: 1px solid var(--rule); }
  .js .site-nav li:last-child a { border-bottom: 0; }
  .js .site-nav a:hover, .js .site-nav a[aria-current] { background: none; color: var(--lapis); }
  .no-js .header-inner { flex-wrap: wrap; padding-block: 0.5rem; }
}

/* reading progress */
.progress { position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 60; pointer-events: none; }
.progress span { display: block; height: 100%; width: 0; background: var(--accent); transition: width 0.1s linear; }

/* ---------- Footer ---------- */
.site-footer { margin-top: clamp(4rem, 9vw, 7rem); border-top: 1px solid var(--rule); background: var(--paper-2); }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 2.5rem; padding-block: 3.5rem 2.5rem; }
.footer-about p { color: var(--ink-2); max-width: 26rem; margin-top: 1rem; }
.footer-title { font-family: var(--font-sans); font-size: var(--step--2); font-weight: 650; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); margin: 0 0 0.9rem; }
.footer-links { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.55rem; }
.footer-links a { font-family: var(--font-sans); font-size: 0.95rem; color: var(--ink-2); text-decoration: none; }
.footer-links a:hover { color: var(--lapis); text-decoration: underline; }
.footer-base { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem; padding-block: 1.25rem 2rem; border-top: 1px solid var(--rule); font-family: var(--font-sans); font-size: var(--step--1); color: var(--muted); }
.footer-base p { margin: 0; }
.footer-base a { color: inherit; }
@media (max-width: 48rem) { .footer-grid { grid-template-columns: 1fr 1fr; } .footer-about { grid-column: 1 / -1; } }

/* ---------- Hero (home) ---------- */
.hero { position: relative; isolation: isolate; color: var(--hero-ink); min-height: clamp(28rem, 72vh, 44rem); display: flex; align-items: flex-end; overflow: hidden; background: #2b3a45; }
.hero picture, .hero img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 45%; z-index: -2; }
.hero::after {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background:
    linear-gradient(180deg, rgb(10 14 20 / 0.12) 0%, rgb(10 14 20 / 0.02) 38%, rgb(10 14 20 / 0.62) 100%),
    linear-gradient(90deg, rgb(10 14 20 / 0.42) 0%, rgb(10 14 20 / 0) 58%);
}
.hero-inner { padding-block: clamp(3rem, 8vw, 5.5rem); }
.hero-kicker { font-family: var(--font-sans); font-size: var(--step--2); font-weight: 650; letter-spacing: 0.16em; text-transform: uppercase; opacity: 0.92; margin: 0 0 1rem; }
.hero-title { font-size: var(--step-4); font-weight: 520; line-height: 1; letter-spacing: -0.025em; margin: 0 0 1.1rem; text-shadow: 0 2px 24px rgb(0 0 0 / 0.35); }
.hero-lede { font-size: var(--step-1); max-width: 34rem; line-height: 1.45; margin: 0 0 2rem; text-shadow: 0 1px 12px rgb(0 0 0 / 0.4); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; }
.hero-meta { position: absolute; top: 1rem; right: var(--gutter); z-index: 1; display: flex; align-items: center; gap: 0.6rem; }
.hero-caption { margin: 0; font-family: var(--font-sans); font-size: 0.72rem; letter-spacing: 0.04em; opacity: 0.85; text-shadow: 0 1px 6px rgb(0 0 0 / 0.5); }
.hero-canvas { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -2; opacity: 0; transition: opacity 1.4s ease; }
.hero-canvas.is-ready { opacity: 1; }
.hero-motion {
  display: inline-grid; place-items: center; width: 2rem; height: 2rem; padding: 0; cursor: pointer;
  border-radius: 999px; border: 1px solid rgb(255 255 255 / 0.5); background: rgb(10 14 20 / 0.28); color: #fff;
  -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); transition: background-color 0.2s;
}
.hero-motion:hover { background: rgb(10 14 20 / 0.5); }
.hero-motion[hidden] { display: none; }
.hero-motion svg { width: 0.85rem; height: 0.85rem; fill: currentColor; }
.hero-motion .i-play, .hero-motion[aria-pressed="true"] .i-pause { display: none; }
.hero-motion[aria-pressed="true"] .i-play { display: inline; }

/* ---------- Home ---------- */
.section-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; margin-top: -2.75rem; position: relative; z-index: 2; }
.section-card {
  display: flex; flex-direction: column; gap: 0.35rem; padding: 1.35rem 1.35rem 1.25rem; background: var(--paper);
  border: 1px solid var(--rule); border-top: 3px solid var(--accent); border-radius: var(--radius);
  box-shadow: var(--shadow); color: var(--ink); text-decoration: none; transition: transform 0.2s, box-shadow 0.2s;
}
.section-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lift); color: var(--ink); }
.section-card h2 { font-size: 1.3rem; margin: 0; }
.section-card p { font-size: 0.98rem; color: var(--ink-2); margin: 0; line-height: 1.45; }
.section-card .meta { margin-top: auto; padding-top: 0.6rem; }
@media (max-width: 62rem) { .section-cards { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 34rem) { .section-cards { grid-template-columns: 1fr; margin-top: -2rem; } }

.home-block { margin-top: clamp(3.5rem, 8vw, 5.5rem); }
.block-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; border-bottom: 1px solid var(--rule); padding-bottom: 0.9rem; margin-bottom: 1.75rem; }
.block-head h2 { font-size: var(--step-2); margin: 0; }
.block-head .kicker { margin-bottom: 0.35rem; }

.intro { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); gap: clamp(1.5rem, 5vw, 4rem); align-items: start; }
.intro h2 { font-size: var(--step-3); font-weight: 480; }
.intro p { color: var(--ink-2); }
@media (max-width: 48rem) { .intro { grid-template-columns: 1fr; } }

/* Cards */
.card-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.25rem; }
@media (max-width: 62rem) { .card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 40rem) { .card-grid { grid-template-columns: 1fr; } }
.card {
  position: relative; display: flex; flex-direction: column; gap: 0.5rem; padding: 1.4rem;
  background: var(--paper); border: 1px solid var(--rule); border-radius: var(--radius);
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
}
.card:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--rule)); box-shadow: var(--shadow); transform: translateY(-1px); }
.card h3 { font-size: 1.28rem; margin: 0; line-height: 1.22; }
.card h3 a { color: var(--ink); text-decoration: none; }
.card h3 a::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.card h3 a:hover { color: var(--accent); }
.card p { margin: 0; color: var(--ink-2); font-size: 1rem; line-height: 1.5; }
.card .meta { margin-top: auto; padding-top: 0.5rem; }
.card .card-top { margin: 0; padding: 0; order: -1; }
.card .card-gloss { font-family: var(--font-sans); font-size: var(--step--1); color: var(--muted); font-style: normal; }
.card[lang="fa-AF"] h3, .card .title-fa { font-family: var(--font-fa); font-weight: 600; }

.card-poem .first-lines { font-style: italic; color: var(--ink-2); font-size: 1.02rem; line-height: 1.6; }
.card-poem .first-lines span { display: block; }
.card-poem .first-lines:lang(fa) { font-style: normal; font-size: 1.02rem; line-height: 1.95; }

/* Book feature */
.book-band { margin-top: clamp(4rem, 9vw, 6rem); background: var(--paper-2); border-block: 1px solid var(--rule); }
.book-feature { display: grid; grid-template-columns: minmax(14rem, 19rem) minmax(0, 1fr); gap: clamp(2rem, 6vw, 5rem); align-items: center; padding-block: clamp(3rem, 7vw, 5rem); }
.book-feature h2 { font-size: var(--step-3); font-weight: 480; }
.book-feature blockquote { margin: 1.5rem 0; padding-left: 1.25rem; border-left: 3px solid var(--clay); font-style: italic; color: var(--ink-2); font-size: var(--step-1); line-height: 1.5; }
.book-feature .actions { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: center; margin-top: 1.75rem; }
@media (max-width: 48rem) { .book-feature { grid-template-columns: 1fr; } .book-cover { max-width: 16rem; } }

.book-cover {
  --c1: #7f3a22; --c2: #5d2917; text-decoration: none;
  aspect-ratio: 2 / 3; border-radius: 4px 14px 14px 4px; color: #f7efe3; position: relative; overflow: hidden;
  background: radial-gradient(120% 80% at 30% 15%, rgb(255 255 255 / 0.12), transparent 60%), linear-gradient(160deg, var(--c1), var(--c2));
  box-shadow: inset 6px 0 0 rgb(0 0 0 / 0.18), inset 8px 0 0 rgb(255 255 255 / 0.08), 0 30px 50px -25px rgb(40 20 10 / 0.7);
  display: flex; flex-direction: column; justify-content: space-between; padding: 1.75rem 1.5rem 1.5rem 1.9rem;
}
.book-cover::before {
  content: ""; position: absolute; inset: 0.85rem 0.85rem 0.85rem 1.15rem; border: 1px solid rgb(247 239 227 / 0.35); border-radius: 2px 10px 10px 2px; pointer-events: none;
}
a.book-cover { transition: transform 0.25s, box-shadow 0.25s; }
a.book-cover:hover { color: #f7efe3; transform: translateY(-3px) rotate(-0.5deg); }
.book-cover .cover-mark { width: 2.4rem; height: 2.4rem; color: #e9c87c; }
.book-cover .cover-title { font-family: var(--font-serif); font-size: clamp(1.45rem, 1.2rem + 1vw, 1.9rem); line-height: 1.12; font-weight: 520; margin: 0; }
.book-cover .cover-title em { display: block; font-size: 0.62em; font-style: italic; font-weight: 420; opacity: 0.9; margin-bottom: 0.2em; }
.book-cover .cover-author { font-family: var(--font-sans); font-size: 0.72rem; letter-spacing: 0.18em; text-transform: uppercase; opacity: 0.9; margin: 0; }

/* Writers strip */
.people { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1.25rem; }
@media (max-width: 62rem) { .people { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 30rem) { .people { grid-template-columns: 1fr; } }
.person { display: flex; gap: 1rem; align-items: flex-start; padding: 1.25rem; border: 1px solid var(--rule); border-radius: var(--radius); background: var(--paper); position: relative; }
.person h3 { font-size: 1.15rem; margin: 0 0 0.15rem; }
.person h3 a { color: var(--ink); text-decoration: none; }
.person h3 a::after { content: ""; position: absolute; inset: 0; }
.person h3 a:hover { color: var(--lapis); }
.person p { margin: 0; font-size: 0.95rem; color: var(--ink-2); line-height: 1.45; }

.avatar {
  flex: none; width: 3.5rem; height: 3.5rem; border-radius: 50%; object-fit: cover; object-position: 50% 20%;
  background: var(--paper-3); border: 2px solid var(--paper); box-shadow: 0 0 0 1px var(--rule);
}
.avatar-lg { width: 7.5rem; height: 7.5rem; }
.avatar-sm { width: 2.6rem; height: 2.6rem; }
.avatar-initials { display: inline-grid; place-items: center; font-family: var(--font-serif); font-weight: 600; color: var(--lapis); background: var(--lapis-soft); font-size: 1.15rem; }
.avatar-lg.avatar-initials { font-size: 2.4rem; }
.avatar-sm.avatar-initials { font-size: 0.95rem; }

/* ---------- Page head (listing pages) ---------- */
.page-head { padding-block: clamp(2.75rem, 7vw, 4.75rem) clamp(1.75rem, 4vw, 2.5rem); border-bottom: 1px solid var(--rule); }
.page-head h1 { font-size: var(--step-4); font-weight: 480; letter-spacing: -0.02em; margin-bottom: 0.4em; }
.page-head .lede { font-size: var(--step-1); color: var(--ink-2); max-width: 44rem; line-height: 1.5; margin: 0; }
.page-head .meta { margin-top: 1.25rem; display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem 0; }
.page-head-split { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2rem; align-items: end; }
@media (max-width: 48rem) { .page-head-split { grid-template-columns: 1fr; } }

.chip-nav { display: flex; flex-wrap: wrap; gap: 0.5rem; padding-block: 1.25rem; border-bottom: 1px solid var(--rule); }
.chip-nav a { font-family: var(--font-sans); font-size: 0.85rem; font-weight: 550; color: var(--ink-2); text-decoration: none; padding: 0.4rem 0.8rem; border: 1px solid var(--rule); border-radius: 999px; background: var(--paper); }
.chip-nav a:hover { border-color: var(--accent); color: var(--accent); }
.chip-nav .chip-label { font-family: var(--font-sans); font-size: 0.85rem; color: var(--muted); padding: 0.4rem 0.25rem 0.4rem 0; }

/* Year-grouped lists */
.year-group { display: grid; grid-template-columns: 7rem minmax(0, 1fr); gap: 1.5rem; padding-block: 2.25rem; border-bottom: 1px solid var(--rule); }
.year-group:last-child { border-bottom: 0; }
.year-label { font-size: var(--step-2); font-weight: 450; color: var(--accent); margin: 0; position: sticky; top: 5.5rem; align-self: start; font-variant-numeric: lining-nums; }
@media (max-width: 40rem) { .year-group { grid-template-columns: 1fr; gap: 0.75rem; } .year-label { position: static; } }
.entry-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 1.75rem; }
.entry h3 { font-size: 1.32rem; margin: 0 0 0.3rem; line-height: 1.25; }
.entry h3 a { color: var(--ink); text-decoration: none; }
.entry h3 a:hover { color: var(--accent); text-decoration: underline; text-decoration-thickness: 1px; }
.entry p { margin: 0.35rem 0 0; color: var(--ink-2); max-width: 46rem; line-height: 1.55; }
.entry .gloss { font-family: var(--font-sans); font-size: var(--step--1); color: var(--muted); margin-inline-start: 0.5rem; }
.entry .h-fa { font-family: var(--font-fa); font-weight: 600; }
.badge { display: inline-block; font-family: var(--font-sans); font-size: 0.7rem; font-weight: 650; letter-spacing: 0.06em; text-transform: uppercase; color: var(--accent); background: var(--accent-soft); padding: 0.18rem 0.5rem; border-radius: 4px; vertical-align: 0.15em; }

/* ---------- Article ---------- */
.article-head { padding-block: clamp(2.5rem, 7vw, 4.5rem) 1.75rem; text-align: center; }
.article-title { font-size: var(--step-3); font-weight: 500; letter-spacing: -0.015em; margin-bottom: 0.35em; }
.article-head [dir="rtl"] { text-align: center; }
.article-title:lang(fa) { font-family: var(--font-fa); font-weight: 700; line-height: 1.45; letter-spacing: 0; }
.article-subtitle { font-size: var(--step-1); font-style: italic; color: var(--muted); margin: -0.1em 0 0.5em; }
.byline { display: inline-flex; align-items: center; gap: 0.8rem; margin-top: 1rem; text-align: start; }
.byline-name { display: block; font-family: var(--font-sans); font-weight: 620; font-size: 0.95rem; color: var(--ink); }
.byline-name a { color: inherit; text-decoration: none; }
.byline-name a:hover { color: var(--lapis); text-decoration: underline; }
.byline-name .native { font-family: var(--font-fa); font-weight: 500; color: var(--muted); }
.byline .meta { display: block; margin-top: 0.1rem; }

.prose { max-width: var(--measure); margin-inline: auto; padding-inline: var(--gutter); box-sizing: content-box; }
.prose > * + * { margin-top: 0; }
.prose p { margin: 0 0 1.15em; hyphens: auto; -webkit-hyphens: auto; }
.prose a { word-break: break-word; }
.prose hr { margin: 2.25rem auto; width: 6rem; border-top: 1px solid var(--rule); }
.prose blockquote { margin: 1.5em 0; padding-left: 1.25em; border-left: 3px solid var(--accent); color: var(--ink-2); font-style: italic; }
.prose ol, .prose ul { padding-left: 1.4em; margin: 0 0 1.15em; }
.article-body { padding-bottom: 1rem; }
.prose.has-dropcap > p:first-of-type::first-letter {
  float: left; font-size: 3.6em; line-height: 0.85; font-weight: 520; padding: 0.06em 0.09em 0 0; color: var(--accent);
}

/* poems */
.poem { font-size: calc(var(--step-0) * 1.02); }
.poem p { white-space: pre-line; line-height: 1.62; margin: 0 0 1.45em; hyphens: none; -webkit-hyphens: none; }
.poem .note p, .note p { font-style: italic; color: var(--muted); font-size: 0.95em; }
.poem .note { margin-bottom: 1.75em; }
.poem .signature p { white-space: pre-line; }
.poem-centered { text-align: center; }

/* right-to-left (Dari) */
.rtl, [dir="rtl"] { text-align: right; }
.prose:lang(fa), .prose .rtl { font-family: var(--font-fa); font-size: calc(var(--step-0) * 1.02); line-height: 2.05; }
.prose:lang(fa) p { hyphens: none; }
.poem:lang(fa), .poem .rtl { text-align: center; line-height: 2.2; }
.poem:lang(fa) p, .poem .rtl p { line-height: 2.25; margin-bottom: 1.35em; }
.translation { margin-top: 2.5rem; padding-top: 2rem; border-top: 1px solid var(--rule); text-align: left; font-family: var(--font-serif); }
.translation p { font-style: italic; line-height: 1.7; }
.translation .translation-label { font-family: var(--font-sans); font-style: normal; font-size: var(--step--2); font-weight: 650; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); margin-bottom: 1rem; }

.signature { margin-top: 2.5rem; text-align: end; font-style: italic; color: var(--muted); }
.signature p { margin: 0; white-space: pre-line; line-height: 1.6; }
.signature::before { content: ""; display: block; width: 3rem; margin-inline-start: auto; border-top: 1px solid var(--rule); margin-bottom: 1rem; }
.poem-centered .signature { text-align: center; }
.poem-centered .signature::before { margin-inline: auto; }

.notice {
  max-width: var(--measure); margin: 0 auto 2rem; padding: 1rem 1.2rem; border-radius: var(--radius-sm);
  background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 25%, transparent);
  font-family: var(--font-sans); font-size: 0.92rem; line-height: 1.55; color: var(--ink-2);
}
.notice strong { color: var(--ink); }
.notice-wrap { padding-inline: var(--gutter); }

.article-foot { max-width: var(--measure); margin: 3rem auto 0; padding-inline: var(--gutter); box-sizing: content-box; }
.article-tools { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: center; justify-content: space-between; padding-block: 1.25rem; border-block: 1px solid var(--rule); }
.tool-btn { display: inline-flex; align-items: center; gap: 0.4rem; font-family: var(--font-sans); font-size: 0.85rem; font-weight: 550; color: var(--ink-2); background: none; border: 1px solid var(--rule); border-radius: 999px; padding: 0.45rem 0.85rem; cursor: pointer; text-decoration: none; }
.tool-btn:hover { border-color: var(--ink-2); color: var(--ink); }
.tool-btn svg { width: 1rem; height: 1rem; }

.author-card { display: flex; gap: 1.25rem; align-items: flex-start; margin-top: 2rem; padding: 1.5rem; background: var(--paper-2); border-radius: var(--radius); }
.author-card h2 { font-size: 1.2rem; margin: 0 0 0.35rem; }
.author-card h2 a { color: var(--ink); text-decoration: none; }
.author-card h2 a:hover { color: var(--lapis); }
.author-card p { margin: 0 0 0.75rem; font-size: 1rem; color: var(--ink-2); line-height: 1.55; }
@media (max-width: 30rem) { .author-card { flex-direction: column; } }

.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-top: 2rem; }
.pager a { display: block; padding: 1.1rem 1.2rem; border: 1px solid var(--rule); border-radius: var(--radius); text-decoration: none; color: var(--ink); background: var(--paper); }
.pager a:hover { border-color: var(--accent); }
.pager .pager-label { display: block; font-family: var(--font-sans); font-size: var(--step--2); font-weight: 650; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); margin-bottom: 0.35rem; }
.pager .pager-title { display: block; font-size: 1.08rem; line-height: 1.3; }
.pager .pager-title:lang(fa) { font-family: var(--font-fa); }
.pager .next { text-align: right; grid-column: 2; }
@media (max-width: 34rem) { .pager { grid-template-columns: 1fr; } .pager .next { grid-column: 1; } }

.related { margin-top: 3.5rem; }
.related h2 { font-size: var(--step-1); margin-bottom: 1.25rem; }

/* ---------- Memoir ---------- */
.book-head { text-align: center; padding-block: clamp(2.5rem, 6vw, 4rem) 1.5rem; }
.book-head .book-title { font-family: var(--font-sans); font-size: var(--step--2); font-weight: 650; letter-spacing: 0.14em; text-transform: uppercase; color: var(--clay); margin: 0 0 1rem; }
.book-head .book-title a { color: inherit; text-decoration: none; }
.book-head .chapter-no { font-style: italic; color: var(--muted); font-size: var(--step-1); margin: 0 0 0.35rem; }
.book-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, var(--measure)) minmax(0, 1fr); column-gap: 2rem; }
.book-layout .book-main { grid-column: 2; }
.book-layout .book-toc { grid-column: 3; }
.book-toc { position: sticky; top: 5.5rem; align-self: start; max-height: calc(100vh - 7rem); overflow: auto; font-family: var(--font-sans); font-size: 0.85rem; padding-inline-end: var(--gutter); }
.book-toc h2 { font-family: var(--font-sans); font-size: var(--step--2); font-weight: 650; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); margin: 0 0 0.75rem; }
.book-toc ol { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--rule); }
.book-toc a { display: block; padding: 0.32rem 0 0.32rem 0.85rem; color: var(--ink-2); text-decoration: none; margin-left: -1px; border-left: 2px solid transparent; line-height: 1.35; }
.book-toc a:hover { color: var(--clay); }
.book-toc a[aria-current="page"] { color: var(--clay); border-left-color: var(--clay); font-weight: 620; }
.toc-mobile { display: none; }
@media (max-width: 75rem) {
  .book-layout { grid-template-columns: 1fr; }
  .book-layout .book-main { grid-column: 1; }
  .book-layout .book-toc { display: none; }
  .toc-mobile { display: block; max-width: var(--measure); margin: 0 auto 2rem; padding-inline: var(--gutter); box-sizing: content-box; }
}
.toc-mobile details { border: 1px solid var(--rule); border-radius: var(--radius-sm); background: var(--paper); }
.toc-mobile summary { cursor: pointer; padding: 0.75rem 1rem; font-family: var(--font-sans); font-size: 0.9rem; font-weight: 600; }
.toc-mobile ol { margin: 0; padding: 0 1rem 1rem 2.25rem; font-family: var(--font-sans); font-size: 0.92rem; line-height: 1.9; }
.toc-mobile a[aria-current="page"] { font-weight: 650; color: var(--clay); }

.toc-list { list-style: none; margin: 0; padding: 0; counter-reset: ch -1; }
.toc-list li { counter-increment: ch; border-bottom: 1px solid var(--rule); }
.toc-list a { display: grid; grid-template-columns: 3rem minmax(0, 1fr) auto; gap: 1rem; align-items: baseline; padding: 1rem 0.25rem; text-decoration: none; color: var(--ink); }
.toc-list a::before { content: counter(ch, decimal-leading-zero); font-family: var(--font-sans); font-size: 0.85rem; font-weight: 600; color: var(--clay); font-variant-numeric: tabular-nums; }
.toc-list li.preface a::before { content: "—"; }
.toc-list .toc-title { font-size: 1.25rem; }
.toc-list a:hover .toc-title { color: var(--clay); text-decoration: underline; text-decoration-thickness: 1px; }

/* ---------- Further reading ---------- */
.fr-entry { padding-block: 1.6rem; border-bottom: 1px solid var(--rule); scroll-margin-top: 6rem; }
.fr-entry:last-child { border-bottom: 0; }
.fr-entry:target { background: linear-gradient(90deg, var(--accent-soft), transparent 70%); margin-inline: -1rem; padding-inline: 1rem; border-radius: var(--radius-sm); }
.fr-entry h3 { font-size: 1.3rem; margin: 0 0 0.35rem; }
.fr-entry h3 a { text-decoration: none; }
.fr-entry h3 a:hover { text-decoration: underline; }
.fr-entry h3 .ext { font-family: var(--font-sans); font-size: 0.8em; }
.fr-entry blockquote { margin: 0.85rem 0 0; padding-left: 1rem; border-left: 2px solid var(--rule); color: var(--ink-2); font-size: 1.02rem; }
.fr-entry details { margin-top: 0.85rem; font-size: 0.98rem; }
.fr-entry summary { cursor: pointer; font-family: var(--font-sans); font-size: 0.85rem; font-weight: 600; color: var(--ink-2); }
.fr-entry details p { margin: 0.6rem 0 0; color: var(--ink-2); }
.fr-unavailable { font-family: var(--font-sans); font-size: 0.82rem; color: var(--muted); }

/* ---------- Authors ---------- */
.author-hero { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 2rem; align-items: center; }
@media (max-width: 34rem) { .author-hero { grid-template-columns: 1fr; } }
.author-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.25rem; }
@media (max-width: 48rem) { .author-grid { grid-template-columns: 1fr; } }
.author-tile { display: flex; gap: 1.25rem; padding: 1.5rem; border: 1px solid var(--rule); border-radius: var(--radius); background: var(--paper); position: relative; }
.author-tile h3 { font-size: 1.35rem; margin: 0 0 0.25rem; }
.author-tile h3 a { color: var(--ink); text-decoration: none; }
.author-tile h3 a::after { content: ""; position: absolute; inset: 0; }
.author-tile h3 a:hover { color: var(--lapis); }
.author-tile p { margin: 0.5rem 0 0; color: var(--ink-2); font-size: 1rem; line-height: 1.5; }
.contrib-list { columns: 2 18rem; column-gap: 2rem; list-style: none; margin: 0; padding: 0; }
.contrib-list li { break-inside: avoid; padding: 0.7rem 0; border-bottom: 1px solid var(--rule); display: flex; justify-content: space-between; gap: 1rem; }
.contrib-list .native { font-family: var(--font-fa); color: var(--muted); }

/* ---------- Search ---------- */
.search-wrap { max-width: 46rem; margin: 2rem auto 0; }
.search-wrap .pagefind-ui {
  --pagefind-ui-scale: 0.95;
  --pagefind-ui-primary: var(--lapis);
  --pagefind-ui-text: var(--ink);
  --pagefind-ui-background: var(--paper);
  --pagefind-ui-border: var(--rule);
  --pagefind-ui-tag: var(--paper-2);
  --pagefind-ui-border-width: 1px;
  --pagefind-ui-border-radius: 10px;
  --pagefind-ui-font: var(--font-sans);
}
.search-wrap .pagefind-ui__result-title { font-family: var(--font-serif); }
.search-wrap .pagefind-ui__result-excerpt { font-family: var(--font-serif); font-size: 1rem; }
.noscript-note { font-family: var(--font-sans); color: var(--muted); }

/* ---------- Generic page (About) ---------- */
.page-body { padding-top: 2.5rem; }
.page-body h2 { font-size: var(--step-2); margin-top: 2.2em; }
.page-body h3 { font-size: var(--step-1); margin-top: 1.8em; }

/* ---------- 404 ---------- */
.not-found { text-align: center; padding-block: clamp(4rem, 12vw, 8rem) 2rem; }
.not-found .big { font-size: clamp(4rem, 3rem + 6vw, 8rem); font-weight: 400; color: var(--paper-3); line-height: 1; margin: 0; }
.not-found form { display: flex; gap: 0.5rem; max-width: 28rem; margin: 2rem auto 0; }
.input { flex: 1; min-width: 0; font: inherit; font-family: var(--font-sans); font-size: 1rem; padding: 0.75rem 1rem; border: 1px solid var(--rule); border-radius: 999px; background: var(--paper); color: var(--ink); }

/* ---------- Motion & print ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}
@media print {
  .site-header, .site-footer, .article-tools, .pager, .related, .book-toc, .toc-mobile, .progress, .skip-link, .author-card .btn { display: none !important; }
  body { background: #fff; color: #000; font-size: 11.5pt; }
  .article-head { padding-top: 0; }
  .prose { max-width: none; padding: 0; }
  a { color: #000; }
  .prose a[href^="http"]::after { content: " (" attr(href) ")"; font-size: 0.85em; }
}

/* memoir layout refinements */
.book-main { min-width: 0; }
.book-layout .prose, .book-layout .article-foot { max-width: none; padding-inline: 0; box-sizing: border-box; }
.book-layout .toc-mobile { padding-inline: 0; }
@media (max-width: 75rem) {
  .book-layout .book-main { width: 100%; max-width: calc(var(--measure) + 2 * var(--gutter)); margin-inline: auto; padding-inline: var(--gutter); }
}

/* author chip (listing headers) */
.author-chip { display: inline-flex; align-items: center; gap: 0.9rem; padding: 0.8rem 1.1rem 0.8rem 0.8rem; border: 1px solid var(--rule); border-radius: 999px; background: var(--paper); color: var(--ink); text-decoration: none; transition: border-color 0.2s, box-shadow 0.2s; }
.author-chip:hover { border-color: var(--accent); color: var(--ink); box-shadow: var(--shadow); }
.author-chip strong { display: block; font-family: var(--font-sans); font-size: 0.95rem; font-weight: 620; }
.author-chip .meta { display: block; font-size: 0.82rem; }
.group-head { display: flex; align-items: center; gap: 0.85rem; }
.block-head:has(.group-head) { align-items: center; }
.group-head h2 { margin: 0; }

.page-head-narrow { max-width: calc(var(--measure) + 2 * var(--gutter)); }
.page-head-narrow h1 { font-size: var(--step-3); }

/* utility classes for listing pages */
.not-found .lede { margin-inline: auto; max-width: 34rem; color: var(--ink-2); }
.block-head .meta.sub { margin: 0.2rem 0 0; }
.lede-native { text-align: start; font-family: var(--font-fa); }
.book-band.is-top { margin-top: 0; border-top: 0; }
.book-h1 { font-size: var(--step-4); font-weight: 480; letter-spacing: -0.02em; }
.book-lede { font-size: var(--step-1); color: var(--ink-2); line-height: 1.5; }
.narrow-wrap { max-width: 52rem; }
.block-head.is-spaced { margin-top: clamp(3rem, 7vw, 4.5rem); }

/* ==========================================================================
   Afghan accents: tile ornaments, kilim borders, calligraphy, pictures
   ========================================================================== */

/* Ornament masks paint with the element's background colour */
@supports ((mask-image: url("")) or (-webkit-mask-image: url(""))) {
  .prose hr, hr.ornament {
    border: 0; height: 20px; width: 10rem; margin: 2.75rem auto; opacity: 0.75;
    background: var(--accent);
    -webkit-mask: var(--orn-star) center / contain no-repeat; mask: var(--orn-star) center / contain no-repeat;
  }
  .kilim, .page-banner::after, .site-footer::before {
    background: var(--accent);
    -webkit-mask: var(--orn-kilim) left center / auto 100% repeat-x; mask: var(--orn-kilim) left center / auto 100% repeat-x;
  }
  .frieze {
    background: var(--lapis);
    -webkit-mask: var(--orn-frieze) left center / auto 100% repeat-x; mask: var(--orn-frieze) left center / auto 100% repeat-x;
  }
}
.kilim { display: block; height: 10px; opacity: 0.8; }
.frieze { display: block; height: 16px; opacity: 0.45; }

/* Footer: a woven border along the top */
.site-footer { border-top: 0; position: relative; }
.site-footer::before { content: ""; display: block; height: 10px; --accent: var(--clay); opacity: 0.55; }

/* ---------- Calligraphy band (home) ---------- */
.verse-band { margin-top: clamp(3.5rem, 8vw, 5.5rem); background: var(--paper-2); border-block: 1px solid var(--rule); padding-block: 0.9rem; }
.verse { text-align: center; padding-block: clamp(2.25rem, 6vw, 3.75rem); margin-block: 0; }
.verse blockquote { margin: 0; }
.verse-fa {
  font-family: var(--font-nastaliq); font-size: clamp(1.55rem, 1.05rem + 2.3vw, 2.75rem); line-height: 2.3;
  color: var(--ink); margin: 0; display: flex; flex-wrap: wrap; justify-content: center; column-gap: 2.2em;
}
.verse-fa span { white-space: nowrap; font-family: inherit; } /* :lang(fa) would otherwise reset the font */
.verse-en { font-style: italic; font-size: var(--step-1); line-height: 1.5; color: var(--ink-2); max-width: 42rem; margin: 0.6rem auto 0; text-wrap: balance; }
.verse-cite { font-family: var(--font-sans); font-size: var(--step--1); color: var(--muted); margin: 1.1rem auto 0; max-width: 40rem; }
.verse-cite cite { font-style: italic; }

/* ---------- Section banners ---------- */
.page-banner { position: relative; margin: 0; background: var(--paper-3); }
.page-banner picture, .page-banner img { display: block; width: 100%; height: clamp(10.5rem, 24vw, 21rem); object-fit: cover; }
.page-banner::after { content: ""; display: block; height: 10px; opacity: 0.85; }
.page-banner figcaption {
  position: absolute; right: var(--gutter); bottom: calc(10px + 0.65rem); max-width: calc(100% - 2 * var(--gutter));
  font-family: var(--font-sans); font-size: 0.72rem; line-height: 1.35; color: #fff;
  background: rgb(12 14 18 / 0.45); padding: 0.3rem 0.7rem; border-radius: 999px;
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
.page-banner figcaption a { color: inherit; text-decoration-color: rgb(255 255 255 / 0.5); }
.page-banner figcaption .dot::before { color: rgb(255 255 255 / 0.7); }
.page-banner + .page-head { padding-top: clamp(2rem, 5vw, 3.25rem); }
.page-banner + .book-band.is-top { border-top: 0; }
@media (max-width: 34rem) { .page-banner figcaption { left: var(--gutter); right: auto; border-radius: 8px; } }

/* ---------- Figures (chapters and articles) ---------- */
.figure { margin: 0 0 2rem; }
.prose .figure-inline { margin: 2.5rem 0 2.75rem; }
.figure picture { display: block; }
.figure img { display: block; width: auto; max-width: 100%; max-height: 34rem; height: auto; margin-inline: auto; border-radius: 6px; background: var(--paper-3); }
.figure figcaption { margin-top: 0.8rem; padding-left: 0.85rem; border-left: 2px solid var(--accent); font-family: var(--font-sans); font-size: 0.86rem; line-height: 1.5; color: var(--ink-2); text-align: left; }
.figure .figure-text { display: block; }
.figure .credit { display: block; margin-top: 0.25rem; font-size: 0.76rem; color: var(--muted); }
.figure .credit a { color: inherit; }
.chapter-figure { margin-top: 0.5rem; }

/* ---------- Gallery ---------- */
.gallery-group { padding-block: clamp(2.25rem, 5vw, 3.25rem) 0.5rem; scroll-margin-top: 5rem; }
.gallery-group .block-head { margin-bottom: 1.4rem; }
.gallery-group .block-head > .meta { white-space: nowrap; }
.gallery-group .group-intro { margin: 0.35rem 0 0; color: var(--ink-2); font-size: 1.02rem; max-width: 46rem; line-height: 1.5; }
.gallery { display: flex; flex-wrap: wrap; gap: 1.6rem 1rem; list-style: none; margin: 0; padding: 0; }
.gallery::after { content: ""; flex: 100000 1 0; } /* keeps the last row at its natural size */
.g-item { flex: calc(var(--ar) * 100) 1 calc(var(--ar) * 14rem); min-width: 0; margin: 0; scroll-margin-top: 6rem; }
.g-item figure { margin: 0; }
.g-link { display: block; position: relative; overflow: hidden; border-radius: 6px; background: var(--paper-3); }
.g-link img { display: block; width: 100%; height: auto; aspect-ratio: var(--ar); object-fit: cover; transition: transform 0.5s ease, filter 0.3s; }
.g-link:hover img { transform: scale(1.025); }
.g-link:focus-visible { outline-offset: 3px; }
.g-item figcaption { margin-top: 0.55rem; font-family: var(--font-sans); line-height: 1.4; }
.g-title { display: block; font-size: 0.9rem; font-weight: 620; color: var(--ink); }
.g-meta { display: block; font-size: 0.78rem; color: var(--muted); margin-top: 0.1rem; }
.g-meta a { color: inherit; }
.g-item:target .g-link { outline: 3px solid var(--accent); outline-offset: 3px; }
@media (max-width: 30rem) { .g-item { flex-basis: 100%; } }

/* ---------- Lightbox ---------- */
.lightbox {
  width: 100vw; height: 100vh; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0;
  background: #0f0d0b; color: #f4efe6; overflow: hidden;
}
.lightbox::backdrop { background: rgb(14 12 10 / 0.85); }
.lightbox[open] { display: flex; flex-direction: column; }
.lb-stage { position: relative; flex: 1 1 auto; min-height: 0; display: flex; align-items: center; justify-content: center; padding: 3.75rem clamp(3.5rem, 7vw, 5.5rem) 0.5rem; }
.lb-stage img { display: block; max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; border-radius: 3px; box-shadow: 0 20px 60px -20px rgb(0 0 0 / 0.8); }
.lb-caption { flex: none; padding: 0.75rem var(--gutter) 1.25rem; text-align: center; max-width: 50rem; margin: 0 auto; font-family: var(--font-sans); font-size: 0.9rem; line-height: 1.5; }
.lb-title { display: block; font-family: var(--font-serif); font-size: 1.2rem; font-weight: 560; color: #fff; margin-bottom: 0.2rem; }
.lb-text { display: block; color: #ddd5c8; }
.lb-credit { display: block; margin-top: 0.35rem; font-size: 0.78rem; color: #b6ad9f; }
.lb-credit a, .lb-text a { color: inherit; }
.lb-credit .dot::before { color: #8f877b; }
.lb-count { display: block; margin-top: 0.35rem; font-size: 0.72rem; letter-spacing: 0.08em; color: #8f877b; }
.lb-btn {
  position: absolute; display: inline-grid; place-items: center; width: 2.75rem; height: 2.75rem; padding: 0; cursor: pointer;
  border-radius: 999px; border: 1px solid rgb(255 255 255 / 0.25); background: rgb(255 255 255 / 0.08); color: #fff;
}
.lb-btn:hover { background: rgb(255 255 255 / 0.18); }
.lb-btn:focus-visible { outline: 3px solid #93b5ee; outline-offset: 2px; }
.lb-btn svg { width: 1.2rem; height: 1.2rem; }
.lb-close { top: 0.75rem; right: 0.75rem; }
.lb-prev, .lb-next { top: 50%; transform: translateY(-50%); }
.lb-prev { left: 0.6rem; }
.lb-next { right: 0.6rem; }
@media (max-width: 40rem) {
  .lb-stage { padding: 3.75rem 0.5rem 4rem; }
  .lb-prev, .lb-next { top: auto; bottom: 0.4rem; transform: none; }
  .lb-prev { left: calc(50% - 3.25rem); }
  .lb-next { right: calc(50% - 3.25rem); }
}
.no-scroll { overflow: hidden; }

/* ---------- Picture mosaic (home) and gallery teaser ---------- */
.mosaic { display: grid; grid-template-columns: 2fr 1fr 1fr; grid-template-rows: repeat(2, clamp(9rem, 18vw, 14.5rem)); gap: 0.75rem; }
.mosaic-item { position: relative; display: block; overflow: hidden; border-radius: 8px; background: var(--paper-3); color: #fff; text-decoration: none; }
.mosaic-item.is-large { grid-row: span 2; }
.mosaic-item picture, .mosaic-item img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.6s ease; }
.mosaic-item:hover img { transform: scale(1.04); }
.mosaic-item::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 55%, rgb(10 12 16 / 0.7)); }
.mosaic-label { position: absolute; left: 0.9rem; right: 0.9rem; bottom: 0.75rem; z-index: 1; font-family: var(--font-sans); font-size: 0.85rem; font-weight: 600; line-height: 1.3; text-shadow: 0 1px 8px rgb(0 0 0 / 0.5); }
.mosaic-label small { display: block; font-weight: 450; font-size: 0.75rem; opacity: 0.85; }
.mosaic-item:hover { color: #fff; }
@media (max-width: 48rem) {
  .mosaic { grid-template-columns: 1fr 1fr; grid-template-rows: clamp(12rem, 50vw, 18rem) repeat(2, clamp(8rem, 30vw, 11rem)); }
  .mosaic-item.is-large { grid-column: 1 / -1; grid-row: auto; }
}

.teaser { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); gap: clamp(1.25rem, 4vw, 2.5rem); align-items: center; padding: clamp(1.25rem, 3vw, 1.75rem); border: 1px solid var(--rule); border-radius: var(--radius); background: var(--paper-2); }
.teaser h2 { font-size: var(--step-2); margin: 0 0 0.4rem; }
.teaser p { color: var(--ink-2); margin: 0 0 1rem; }
.teaser-strip { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.5rem; }
.teaser-strip a { display: block; overflow: hidden; border-radius: 6px; aspect-ratio: 1; background: var(--paper-3); }
.teaser-strip picture { height: 100%; }
.teaser-strip img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s ease; }
.teaser-strip a:hover img { transform: scale(1.05); }
@media (max-width: 48rem) { .teaser { grid-template-columns: 1fr; } }

/* ---------- Picture credits ---------- */
.credits-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; }
.credits-list li { display: grid; grid-template-columns: 5.5rem minmax(0, 1fr); gap: 1.1rem; align-items: start; padding-block: 1.1rem; border-bottom: 1px solid var(--rule); scroll-margin-top: 6rem; }
.credits-list li:last-child { border-bottom: 0; }
.credits-list .thumb { display: block; width: 5.5rem; height: 4.2rem; border-radius: 4px; overflow: hidden; background: var(--paper-3); }
.credits-list .thumb picture, .credits-list .thumb img { width: 100%; height: 100%; object-fit: cover; }
.credits-list h3 { font-size: 1.1rem; margin: 0 0 0.2rem; }
.credits-list p { margin: 0; font-family: var(--font-sans); font-size: 0.85rem; line-height: 1.5; color: var(--ink-2); }
.credits-list .used { color: var(--muted); }
.credits-list a { word-break: break-word; }

@media print {
  .page-banner, .lightbox, .mosaic, .verse-band .frieze, .site-footer::before { display: none !important; }
  .figure img { max-height: 12cm; }
}
.article-figure { max-width: var(--measure); margin: 0 auto 2rem; padding-inline: var(--gutter); box-sizing: content-box; }
.gallery-foot { margin-top: 2.5rem; padding-top: 1.25rem; border-top: 1px solid var(--rule); }
