@import url("assets/forest-palette.css");

@font-face {
  font-family: "Carlito";
  src: url("assets/Carlito-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Carlito";
  src: url("assets/Carlito-Bold.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Carlito";
  src: url("assets/Carlito-Italic.woff2") format("woff2");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "Carlito";
  src: url("assets/Carlito-BoldItalic.woff2") format("woff2");
  font-weight: 700;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "Gulmarg Nastaleeq";
  src: url("assets/GulmargNastaleeq.ttf") format("truetype");
  font-weight: 400;
  font-display: swap;
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-089F, U+08A0-08FF, U+200C-200D, U+FB50-FDFF, U+FE70-FEFF;
}
@font-face {
  font-family: "Koshur Naskh";
  src: url("assets/KeyboardNotoNaskhArabic.ttf") format("truetype");
  font-weight: 400 700;
  font-display: swap;
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-089F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF;
}
:root {
  color-scheme: light;
  --surface: #fff;
  --control-line: #899c8e;
  --writer-font: "Gulmarg Nastaleeq", "Koshur Naskh", "Carlito", sans-serif;
  font-family: var(--writer-font);
  font-size: 100%;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
}
* { box-sizing: border-box; }
body { margin: 0; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--grad-mid); outline-offset: 4px; }
a { color: inherit; text-underline-offset: .22em; }
.skip, .trap { position: absolute; left: -9999px; }
.skip:focus { left: 1rem; top: 1rem; z-index: 5; background: white; padding: .65rem; }
header { background: rgba(255,255,255,.85); border-bottom: 1px solid var(--border); }
.navwrap, main, footer { width: min(1180px, 92%); margin-inline: auto; }
.navwrap, nav, .actions, .sectionhead, footer { display: flex; align-items: center; gap: 1rem; }
.navwrap, .sectionhead, footer { justify-content: space-between; }
.navwrap { min-height: 74px; }
nav { gap: 1.5rem; }
nav a, .brand, .pill, .card { text-decoration: none; }
nav a:hover, .card:hover h3, .brand:hover { text-decoration: underline; }
.brand { display: inline-flex; align-items: center; gap: .65rem; font-weight: 700; }
.brand img { border-radius: 8px; }
.navcta, .pill, button { padding: .65rem 1.2rem; border-radius: 999px; }
.navcta { background: var(--gradient-btn); border: 1px solid transparent; color: white; }
.pill, button { background: var(--gradient-btn); color: #fff; font: inherit; font-weight: 600; border: 1px solid var(--grad-from); cursor: pointer; }
.pill:hover, button:hover { background: var(--grad-mid); }
.secondary { color: var(--grad-from); background: transparent; border-color: var(--control-line); }
.secondary:hover { background: var(--bg-soft); }
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 { font-family: var(--writer-font); font-weight: 500; line-height: 1.16; }
h1 { font-size: clamp(2.8rem, 6.2vw, 5.8rem); letter-spacing: -.045em; margin-bottom: 1rem; }
h2 { font-size: clamp(2rem, 3.7vw, 3.2rem); letter-spacing: -.035em; }
h3 { font-size: 1.55rem; }
[dir=auto] { letter-spacing: normal; overflow-wrap: anywhere; }
:is(h1,h2,h3)[dir=auto] { line-height: 1.5; }
.overline { font-size: .81rem; font-weight: 650; letter-spacing: .1em; text-transform: uppercase; }
.hero {
  position: relative; isolation: isolate; overflow: hidden; margin: 1.4rem 0 2.5rem;
  display: flex; align-items: end; color: var(--text); background: var(--bg-soft); border-radius: 4px;
}
.hero-art { position: absolute; z-index: -2; inset: 0 0 0 auto; width: 80%; height: 100%; object-fit: cover; object-position: center 55%; }
.hero::before { content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(90deg,var(--bg-soft) 17%,rgba(229,236,225,.97) 35%,rgba(229,236,225,.78) 49%,rgba(229,236,225,.05) 75%); }
.hero-copy { padding: clamp(2rem,4.5vw,4.5rem); }
.hero h1 { font-size: clamp(3.1rem,5.4vw,5.3rem); line-height: .99; margin-bottom: 1.35rem; }
.hero h1 em { color: var(--green); font-weight: 400; }
.hero-copy p { font: 1.15rem/1.5 var(--writer-font); max-width: 31ch; margin-bottom: 0; }
.directory { margin-bottom: 4rem; }
.sectionhead { border-bottom: 1px solid var(--border-strong); margin-bottom: 1.4rem; padding-bottom: .85rem; }
.sectionhead h2 { margin: 0; }
.sectionhead span, small, .crumb, .tools label, footer { color: var(--text-muted); }
.tools { display: flex; align-items: end; gap: 1rem; margin: 1.5rem 0; }
.lookup { display: flex; align-items: center; flex: 1; min-width: 0; border: 1px solid var(--control-line); border-radius: 5px; background: var(--surface); }
.tools .search { flex: 1; min-width: 0; }
.tools input[type=search] { border: 0; background: transparent; margin: 0; }
.lookup:focus-within { outline: 2px solid var(--green); outline-offset: 2px; }
.tools button { border-radius: 3px; margin: 3px; padding: .48rem 1rem; }
.tools .order { display: flex; align-items: center; gap: .65rem; white-space: nowrap; }
.tools .order select { margin: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
label { display: block; font-weight: 600; font-size: .94rem; }
label small { display: block; font-size: .87rem; font-weight: 400; }
input:not([type=checkbox]), textarea, select { display: block; width: 100%; padding: .7rem .85rem; margin-top: .34rem; border: 1px solid var(--control-line); border-radius: 6px; color: var(--text); background-color: #fff; font: inherit; font-size: 1rem; font-weight: 400; }
select { appearance: none; padding-right: 2.5rem; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='9' viewBox='0 0 14 9'%3E%3Cpath d='m1 1 6 6 6-6' fill='none' stroke='%23203f2c' stroke-width='1.6'/%3E%3C/svg%3E"); background-position: right .9rem center; background-repeat: no-repeat; }
textarea { resize: vertical; }
.empty { background: var(--bg-soft); border-left: 3px solid var(--grad-to); padding: clamp(1.5rem,3vw,2.7rem); }
.empty h3, .empty p { margin-bottom: .55rem; }
.textlink { font-weight: 650; }
.cards { border-block: 1px solid var(--border-strong); }
.card {
  display: grid; grid-template-columns: auto minmax(0,1fr) minmax(0,.85fr) 1rem;
  align-items: center; gap: .4rem 1.3rem; padding: 1.05rem clamp(.8rem,2vw,1.6rem);
  background: var(--surface);
}
.card + .card { border-top: 1px solid var(--border); }
.card:hover, .card:focus-visible { background: var(--bg-soft); }
.card h3 { font: 500 1.8rem/1.25 var(--writer-font); margin: 0; }
.card-name, .card-meta, .identity h1, .folio-details dd { min-width: 0; overflow-wrap: anywhere; }
.roman-card { font-size: 1rem; line-height: 1.4; color: var(--text-soft); margin: .15rem 0 0; }
.card-meta { font-size: .96rem; color: var(--text-muted); margin: 0; }
.card-chevron { justify-self: center; width: .55rem; height: .55rem; border-block-start: 2px solid var(--green); border-inline-end: 2px solid var(--green); transform: rotate(45deg); }
.excerpt .overline { color: var(--green); margin: 0 0 .8rem; }
.cover-quote { white-space: pre-line; overflow-wrap: anywhere; }
.cover-link { display: inline-block; text-decoration: underline; text-underline-offset: .35em; }
.cardpic, .profile-pic { display: grid; place-items: center; overflow: hidden; background: var(--grad-from); }
.cardpic { width: 4.6rem; aspect-ratio: 1; border-radius: 50%; }
.cardpic .initial { font-size: 2rem; }
.portrait { width: 100%; height: 100%; object-fit: cover; object-position: center 39%; }
.initial { font: italic 4rem var(--writer-font); color: var(--bg); }
.crumb { margin: 1rem 0; font-size: .9rem; }
.crumb span { margin: 0 .35rem; }
.identity {
  position: relative; isolation: isolate; display: grid; grid-template-columns: 1.06fr 1fr;
  overflow: hidden; border-radius: 4px; background: var(--bg-soft); color: var(--text);
}
.profile-pic { grid-area: 1 / 2; position: relative; min-height: 360px; background: var(--grad-from); }
.profile-pic .portrait { position: absolute; inset: 0; object-position: 50% 38%; }
.profile-pic::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg,var(--bg-soft),transparent 16%); }
.monogram { background: linear-gradient(130deg,rgba(6,72,39,.85),rgba(6,53,31,.72)), url("assets/literary-hero.webp") center/cover; }
.profile-pic .initial { font-size: clamp(5rem,12vw,10rem); }
.identity-copy { grid-area: 1 / 1; align-self: center; min-width: 0; padding: clamp(2rem,3.7vw,3.4rem); }
.identity .overline { color: var(--green); margin-bottom: 1.1rem; }
.identity h1 { font-size: clamp(3.2rem,6.6vw,6rem); line-height: 1.2; margin: 0; }
.roman-name { font: italic clamp(1.65rem,2.8vw,2.7rem)/1.2 var(--writer-font); color: var(--green); margin: .25rem 0 0; }
.cover-quote, .cover-intro { margin: 1.65rem 0 0; font: 1.18rem/1.55 var(--writer-font); }
.cover-quote { border-inline-start: 2px solid var(--grad-to); padding-inline-start: .9rem; }
.cover-link { color: var(--grad-from); font-size: .96rem; margin-top: 1.1rem; font-weight: 600; }
.actions, .pages, .tabs { display: flex; gap: .8rem; flex-wrap: wrap; align-items: center; }
.folio-nav { border-block-end: 1px solid var(--border); justify-content: space-between; flex-wrap: wrap; gap: .5rem 1rem; padding-block: .8rem; }
.folio-nav div { display: flex; flex-wrap: wrap; gap: .2rem 1.35rem; }
.folio-nav a, .folio-nav button { font-size: .94rem; }
.folio-nav a { padding: .4rem 0; }
.folio-nav button { padding: .4rem .95rem; }
.profile-body { display: grid; grid-template-columns: minmax(0,2.25fr) minmax(0,1fr); gap: clamp(1.5rem,4.5vw,4rem); align-items: start; margin: 2rem 0 4rem; }
.profile-body.details-only { grid-template-columns: minmax(0, 42rem); }
.profile-body section { scroll-margin-top: 1.2rem; }
.folio-details { padding: 1.3rem 0; border-block: 2px solid var(--grad-mid); }
.folio-details h2 { font-size: 1.9rem; margin-bottom: 1.1rem; }
.folio-details dl { margin: 0; }
.folio-details dt { font-size: .9rem; color: var(--text-muted); }
.folio-details dd { margin: .1rem 0 .8rem; font: 1.17rem/1.5 var(--writer-font); }
.folio-details h3 { margin-bottom: .6rem; font-size: 1.4rem; }
.connections { display: flex; flex-wrap: wrap; gap: .4rem; }
.contactlink { padding: .35rem .7rem; border: 1px solid var(--border-strong); border-radius: 3px; text-decoration: none; font-size: .93rem; overflow-wrap: anywhere; max-width: 100%; }
.contactlink:hover { background: var(--bg-soft); }
.suggest { display: inline-block; margin-top: 1.2rem; font-size: .93rem; }
.preserve { white-space: pre-wrap; overflow-wrap: anywhere; unicode-bidi: plaintext; }
.reading, .excerpt { margin-bottom: 2.5rem; }
.excerpt { position: relative; background: var(--surface); border: 1px solid var(--border); border-top: 3px solid var(--grad-mid); padding: clamp(1.5rem,3.7vw,3.6rem); box-shadow: 3px 4px 0 var(--bg-soft); }
.excerpt h2 { font-size: clamp(2.15rem,3.5vw,3.2rem); line-height: 1.2; margin-bottom: 1.2rem; overflow-wrap: anywhere; }
.excerpt .preserve { font: 1.27rem/1.8 var(--writer-font); }
.reading { max-width: 64ch; }
.reading h2 { margin-bottom: .8rem; font-size: clamp(1.9rem,2.7vw,2.6rem); }
.reading .preserve { font: 1.18rem/1.8 var(--writer-font); }
.writer-bio { margin-bottom: 2.1rem; background: var(--surface); border: 1px solid var(--border); border-radius: 5px; overflow: hidden; }
.bio-heading { position: relative; isolation: isolate; overflow: hidden; padding: 1.6rem clamp(1.1rem,3vw,2.25rem); background: var(--bg-soft); border-block-end: 1px solid var(--border); }
.bio-heading::after { content: ""; position: absolute; z-index: -1; inset: 0 0 0 auto; width: 46%; background: linear-gradient(90deg,var(--bg-soft) 0%,rgba(229,236,225,.7) 20%,rgba(229,236,225,.05) 70%), url("assets/literary-hero.webp") center 29%/cover; }
.bio-heading h2, .publication-section h2 { margin: 0; font: 500 clamp(1.65rem,2.7vw,2.2rem)/1.2 var(--writer-font); letter-spacing: -.035em; }
.bio-heading h2 { max-width: 64%; }
.bio-copy { padding: clamp(1.15rem,3vw,2.25rem); }
.bio-intro { color: var(--text-soft); font: 1.22rem/1.5 var(--writer-font); margin: 0; max-width: 48ch; }
.bio-intro + .bio-story { margin-top: 1.05rem; padding-top: 1rem; border-block-start: 1px solid var(--border); }
.bio-story p { margin: 0 0 .85rem; max-width: 62ch; line-height: 1.65; }
.bio-story p:last-child { margin-bottom: 0; }
.publication-section { margin: 0 0 2.4rem; }
.publication-section h2 { margin-bottom: .9rem; }
.publication-list { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(100%,15rem),1fr)); gap: .7rem; list-style: none; margin: 0; padding: 0; }
.publication { display: grid; grid-template-columns: 2.2rem minmax(0,1fr); gap: .85rem; align-items: center; padding: 1.1rem; border: 1px solid var(--border); border-radius: 4px; background: var(--surface); }
.book-symbol { position: relative; height: 3rem; border-radius: 2px 4px 4px 2px; border-inline-start: 4px solid var(--grad-from); background: var(--grad-mid); box-shadow: inset -2px -3px var(--bg-soft); }
.book-symbol::before { content: ""; position: absolute; inset: 25% 20% auto 17%; height: 12%; border-block: 1px solid var(--bg); }
.publication:nth-child(even) .book-symbol { background: var(--grad-to); border-inline-start-color: var(--grad-from); }
.publication-title { font: 1.25rem/1.35 var(--writer-font); margin: 0; }
.publication-note { font-size: .92rem; color: var(--text-muted); line-height: 1.45; margin: .3rem 0 0; }
.formwrap, .review { max-width: 800px; margin: 2rem auto 4rem; }
.formwrap h1, .review h1 { font-size: clamp(2.8rem,5vw,4.7rem); }
.receipt { padding: 4rem 0; }
.receipt .pill { display: inline-block; }
fieldset { min-width: 0; margin: 2rem 0; border: 1px solid var(--border); padding: clamp(1rem,3vw,2rem); border-radius: 8px; background: #fff; }
legend { padding: 0 .5rem; font: 1.65rem var(--writer-font); }
.fieldgrid, .diffcols { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 1rem; }
.platform-fields { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.wide { grid-column: 1/-1; }
fieldset > label, .emailrow { margin-block: 1rem; }
.check { display: flex; align-items: center; gap: .6rem; }
.check input { width: 1.1rem; height: 1.1rem; accent-color: var(--grad-from); flex-shrink: 0; }
.emailrow { display: flex; align-items: center; gap: 1rem; }
.emailrow > label:first-child { flex: 1; }
.error { background: #fff1ed; padding: .8rem; color: #84241d; }
.note, .diff { padding: 1rem; background: #fff; border: 1px solid var(--border); margin: 1rem 0; }
.diff h3 { margin-bottom: .6rem; }
.diffcols small { font-weight: 600; }
.tabs, .pages { margin: 1.2rem 0; }
.tabs [aria-current="page"] { font-weight: 700; text-decoration: underline; text-underline-offset: .25em; }
.queue { border-bottom: 1px solid var(--border); padding: 1rem 0; display: flex; justify-content: space-between; gap: 1rem; }
.profile-row { align-items: center; flex-wrap: wrap; }
.profile-row small { display: block; }
footer { padding: 1.4rem 0; border-top: 1px solid var(--border); flex-wrap: wrap; font-size: .94rem; }
@media(max-width: 800px) {
  .hero-copy { padding: 2rem; }
  .hero h1 { font-size: 3.1rem; }
}
@media(max-width: 620px) {
  .navwrap { min-height: 61px; gap: .5rem; }
  .brand { gap: .35rem; }
  .brand img { width: 25px; height: 25px; }
  .navwrap nav { gap: .65rem; font-size: .88rem; }
  .navcta { padding: .45rem .65rem; }
  .hero { margin: .85rem 0 1.6rem; min-height: 245px; }
  .hero-copy { padding: 1.35rem; }
  .hero-art { width: 100%; object-position: 50% 48%; }
  .hero::before { background: linear-gradient(0deg,var(--bg-soft) 5%,rgba(229,236,225,.94) 47%,rgba(229,236,225,.68) 76%,rgba(229,236,225,.20) 100%); }
  .hero-copy p { max-width: 25ch; }
  .tools { display: grid; grid-template-columns: minmax(0,1fr); gap: .65rem; margin: 1rem 0; }
  .tools .order { justify-self: start; }
  .tools .order select { padding-block: .45rem; }
  .fieldgrid, .diffcols, .profile-body { grid-template-columns: minmax(0,1fr); }
  .card { grid-template-columns: auto minmax(0,1fr) .7rem; column-gap: .85rem; row-gap: .15rem; }
  .cardpic { grid-row: 1 / 3; width: 3.7rem; }
  .card h3 { font-size: 1.45rem; }
  .card-meta { grid-column: 2; font-size: .9rem; }
  .card-chevron { grid-column: 3; grid-row: 1 / 3; }
  .profile-body { margin-top: 1.4rem; }
  .folio-nav { gap: .3rem .5rem; }
  .folio-nav div { gap: .1rem .9rem; }
  .folio-nav button { padding: .35rem .65rem; }
  .identity-copy { grid-area: auto; padding: 1.3rem; }
  .identity h1 { font-size: 3.5rem; }
  .identity .overline { margin-bottom: .55rem; }
  .cover-quote { margin-top: 1rem; }
  .excerpt { padding: 1.4rem 1.15rem; }
  .excerpt .preserve { font-size: 1.12rem; }
  .profile-pic::after { background: linear-gradient(0deg,var(--bg-soft),transparent 19%); }
  .identity { grid-template-columns: minmax(0,1fr); }
  .profile-pic { grid-area: auto; min-height: 0; height: clamp(205px,62vw,315px); }
  .emailrow { display: block; }
  .emailrow .check { margin-top: .5rem; }
}
@media(max-width: 360px) {
  .navwrap { flex-wrap: wrap; padding: .5rem 0; }
}

/* Give the sloping Nastaliq baseline and stacked marks room on each line. */
bdi:dir(rtl), [dir=auto]:dir(rtl) { letter-spacing: normal; line-height: 2; }
.excerpt .preserve:dir(rtl), .bio-story .preserve:dir(rtl) { line-height: 2.15; }
