/* ============================================================
   Dr Shahida Shaheen — design system
   Theme: "Velvet & Verse" — warm ivory, deep burgundy rose, antique gold.
   Zero frameworks. One file. Dark mode via prefers-color-scheme.
   ============================================================ */

/* ---------- fonts (self-hosted) ---------- */
@font-face {
  font-family: 'Playfair Display';
  font-style: normal;
  font-weight: 500 800;
  font-display: swap;
  src: url('../fonts/playfair.woff2') format('woff2');
}
@font-face {
  font-family: 'Playfair Display';
  font-style: italic;
  font-weight: 400 600;
  font-display: swap;
  src: url('../fonts/playfair-italic.woff2') format('woff2');
}
@font-face {
  font-family: 'Noto Nastaliq Urdu';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('../fonts/nastaliq.woff2') format('woff2');
  unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF;
}

/* ---------- tokens ---------- */
:root {
  color-scheme: light dark;
  --bg: #FBF5EE;
  --bg-2: #F5E9DD;
  --bg-3: #EFDFCD;
  --ink: #241419;
  --muted: #6E5A57;
  --accent: #7C1F3D;
  --accent-soft: #7C1F3D16;
  --gold: #B9862F;
  --gold-soft: #B9862F2A;
  --line: #24141922;
  --card: #FFFCF8;
  --shadow: 0 1px 2px #1d191014, 0 12px 32px -12px #1d191033;
  --serif: 'Playfair Display', Georgia, 'Times New Roman', serif;
  --sans: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --urdu: 'Noto Nastaliq Urdu', 'Jameel Noori Nastaleeq', serif;
  --radius: 16px;
  --w: min(1120px, 92vw);
  /* classical mushaira textures — inline SVG, no extra requests */
  --pat-star: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='96' height='96'%3E%3Cg fill='none' stroke='%23B9862F' stroke-opacity='.13'%3E%3Crect x='34' y='34' width='28' height='28'/%3E%3Crect x='34' y='34' width='28' height='28' transform='rotate(45 48 48)'/%3E%3Cpath d='M48 0v20M48 76v20M0 48h20M76 48h20'/%3E%3Ccircle cx='48' cy='48' r='5.5'/%3E%3C/g%3E%3C/svg%3E");
  --pat-scallop: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='56' height='56'%3E%3Cg fill='none' stroke='%23B9862F' stroke-opacity='.14'%3E%3Cpath d='M0 28a28 28 0 0 1 56 0'/%3E%3Cpath d='M-28 56a28 28 0 0 1 56 0M28 56a28 28 0 0 1 56 0'/%3E%3C/g%3E%3C/svg%3E");
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1A1014;
    --bg-2: #23161C;
    --bg-3: #2C1C23;
    --ink: #F2E7E2;
    --muted: #B59A96;
    --accent: #DC8499;
    --accent-soft: #DC849922;
    --gold: #DCAE54;
    --gold-soft: #DCAE5426;
    --line: #F2E7E226;
    --card: #23161C;
    --shadow: 0 1px 2px #00000040, 0 14px 36px -12px #00000080;
    --pat-star: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='96' height='96'%3E%3Cg fill='none' stroke='%23DCAE54' stroke-opacity='.1'%3E%3Crect x='34' y='34' width='28' height='28'/%3E%3Crect x='34' y='34' width='28' height='28' transform='rotate(45 48 48)'/%3E%3Cpath d='M48 0v20M48 76v20M0 48h20M76 48h20'/%3E%3Ccircle cx='48' cy='48' r='5.5'/%3E%3C/g%3E%3C/svg%3E");
    --pat-scallop: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='56' height='56'%3E%3Cg fill='none' stroke='%23DCAE54' stroke-opacity='.11'%3E%3Cpath d='M0 28a28 28 0 0 1 56 0'/%3E%3Cpath d='M-28 56a28 28 0 0 1 56 0M28 56a28 28 0 0 1 56 0'/%3E%3C/g%3E%3C/svg%3E");
  }
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@view-transition { navigation: auto; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
/* ambient page glow + faint girih star lattice, like a diwan's endpapers */
body::before {
  content: '';
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(60rem 38rem at 85% -8%, var(--accent-soft), transparent 65%),
    radial-gradient(48rem 30rem at -10% 28%, var(--gold-soft), transparent 60%),
    var(--pat-star);
  background-size: auto, auto, 96px 96px;
  /* keep the lattice off the page's busy middle; strongest at the edges */
  -webkit-mask: linear-gradient(90deg, #000, #00000055 30%, #00000055 70%, #000);
          mask: linear-gradient(90deg, #000, #00000055 30%, #00000055 70%, #000);
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
h1, h2, h3, h4 { font-family: var(--serif); line-height: 1.18; margin: 0 0 .6em; letter-spacing: -.01em; text-wrap: balance; }
p { margin: 0 0 1em; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; border-radius: 4px; }
::selection { background: var(--gold-soft); }

.wrap { width: var(--w); margin-inline: auto; }
.skip { position: absolute; left: -999px; top: 0; background: var(--accent); color: #fff; padding: .6rem 1rem; z-index: 100; }
.skip:focus { left: .5rem; top: .5rem; }

/* Urdu / Nastaliq */
.ur, .prose [lang="ur"], .prose [lang="ps"] {
  font-family: var(--urdu);
  line-height: 2.35;
  font-size: 1.1em;
}
.couplet {
  font-family: var(--urdu);
  direction: rtl;
  text-align: center;
  font-size: clamp(1.15rem, 1rem + 1vw, 1.5rem);
  line-height: 2.5;
  color: var(--accent);
  margin: 0 0 1.4rem;
  padding: .4rem 1.4rem;
  border-inline-start: 3px solid var(--gold);
  border-inline-end: 3px solid var(--gold);
  /* shama — the candle glow of the mushaira */
  background: radial-gradient(ellipse 65% 130% at 50% 50%, var(--gold-soft), transparent 72%);
}

/* ---------- header ---------- */
.site-head {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(14px) saturate(1.4);
  -webkit-backdrop-filter: blur(14px) saturate(1.4);
  border-bottom: 1px solid var(--line);
}
.nav {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; padding-block: .8rem;
}
.brand { display: flex; flex-direction: column; line-height: 1.15; text-decoration: none !important; }
.brand b { font-family: var(--serif); font-size: 1.28rem; font-weight: 700; color: var(--ink); }
.brand span { font-size: .68rem; letter-spacing: .22em; text-transform: uppercase; color: var(--gold); }
.nav ul { display: flex; gap: .25rem; list-style: none; margin: 0; padding: 0; }
.nav ul a {
  display: block; padding: .45rem .85rem; border-radius: 999px;
  color: var(--ink); font-size: .95rem; font-weight: 500;
}
.nav ul a:hover { background: var(--accent-soft); text-decoration: none; }
.nav ul a[aria-current="page"] { background: var(--accent); color: #fff; }
.nav-toggle { display: none; background: none; border: 1px solid var(--line); border-radius: 10px; padding: .45rem .6rem; color: var(--ink); font-size: 1.1rem; cursor: pointer; }
@media (max-width: 800px) {
  .nav-toggle { display: block; }
  .nav ul {
    display: none; position: absolute; inset-inline: 0; top: 100%;
    flex-direction: column; gap: .2rem; padding: .8rem 4vw 1.1rem;
    background: var(--bg); border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow);
  }
  .nav.open ul { display: flex; }
}

/* ---------- buttons / chips ---------- */
.btn {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .72rem 1.45rem; border-radius: 999px;
  font-weight: 600; font-size: .98rem; border: 1px solid transparent;
  background: var(--accent); color: #fff !important;
  transition: transform .18s ease, box-shadow .18s ease;
}
.btn:hover { text-decoration: none; transform: translateY(-2px); box-shadow: 0 10px 24px -8px var(--accent); }
.btn.ghost { background: transparent; color: var(--ink) !important; border-color: var(--line); }
.btn.ghost:hover { border-color: var(--gold); box-shadow: 0 10px 24px -10px var(--gold); }
.chip {
  display: inline-block; padding: .14rem .7rem; border-radius: 999px;
  font-size: .74rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase;
  background: var(--gold-soft); color: var(--gold); border: 1px solid color-mix(in srgb, var(--gold) 35%, transparent);
}
.chip.jade { background: var(--accent-soft); color: var(--accent); border-color: color-mix(in srgb, var(--accent) 35%, transparent); }

/* ---------- sections ---------- */
.section { padding-block: clamp(3.5rem, 8vw, 6.5rem); }
.section.tint {
  background: var(--bg-2) var(--pat-scallop); /* mughal arch scallops */
  background-size: 56px 56px;
  border-block: 1px solid var(--line);
}
.kicker {
  display: inline-flex; align-items: center; gap: .6rem;
  font-size: .76rem; font-weight: 700; letter-spacing: .24em; text-transform: uppercase;
  color: var(--gold); margin-bottom: .9rem;
}
.kicker::before { content: ''; width: 2.2rem; height: 2px; background: linear-gradient(90deg, transparent, var(--gold)); }
.section-title { font-size: clamp(1.7rem, 1.3rem + 2.2vw, 2.6rem); max-width: 22ch; }
.lede { font-size: 1.12rem; color: var(--muted); max-width: 62ch; }
.flourish { display: flex; align-items: center; gap: .9rem; margin: 2.6rem auto; width: min(280px, 60%); color: var(--gold); }
.flourish::before, .flourish::after { content: ''; flex: 1; height: 1px; background: linear-gradient(90deg, transparent, var(--gold), transparent); }

/* ---------- hero ---------- */
.hero { position: relative; overflow: clip; padding-block: clamp(3rem, 7vw, 6rem) clamp(3.5rem, 8vw, 6.5rem); }
.hero::before { /* patterned medallion glowing behind the portrait */
  content: ''; position: absolute; z-index: -1;
  width: clamp(420px, 48vw, 640px); aspect-ratio: 1;
  right: max(-120px, -8vw); top: -60px;
  background: var(--pat-star); background-size: 96px 96px;
  -webkit-mask: radial-gradient(circle, #000 25%, transparent 68%);
          mask: radial-gradient(circle, #000 25%, transparent 68%);
}
.hero-grid { display: grid; grid-template-columns: 1.08fr .92fr; gap: clamp(2rem, 5vw, 4.5rem); align-items: center; }
.hero h1 { font-size: clamp(2.5rem, 1.6rem + 4.6vw, 4.4rem); margin-bottom: .35em; }
.hero h1 em { font-style: italic; color: var(--accent); }
.hero .roles { display: flex; flex-wrap: wrap; gap: .5rem; margin: 0 0 1.6rem; padding: 0; list-style: none; }
.hero .lede { margin-bottom: 1.8rem; }
.hero .cta { display: flex; flex-wrap: wrap; gap: .8rem; }

.portrait { position: relative; justify-self: center; width: min(380px, 80vw); }
.portrait img {
  width: 100%; aspect-ratio: 38/53; object-fit: cover;
  border-radius: 999px 999px var(--radius) var(--radius);
  box-shadow: var(--shadow);
}
.portrait::before { /* arch ring */
  content: ''; position: absolute; inset: -14px; z-index: -1;
  border: 2px solid var(--gold);
  border-radius: 999px 999px calc(var(--radius) + 10px) calc(var(--radius) + 10px);
  opacity: .55;
  -webkit-mask: linear-gradient(180deg, #000 55%, transparent);
          mask: linear-gradient(180deg, #000 55%, transparent);
}
.portrait::after {
  content: ''; position: absolute; inset: -34px -44px auto auto; width: 110px; height: 110px; z-index: -1;
  background: radial-gradient(circle, var(--gold-soft) 0 30%, transparent 70%);
  border-radius: 50%;
}
.award-chip {
  position: absolute; left: -8%; bottom: 7%;
  background: var(--card); border: 1px solid var(--line); border-radius: 14px;
  padding: .6rem .95rem; box-shadow: var(--shadow);
  display: flex; gap: .6rem; align-items: center; max-width: 240px;
}
.award-chip .medal { font-size: 1.5rem; }
.award-chip b { display: block; font-size: .85rem; line-height: 1.35; }
.award-chip small { color: var(--muted); font-size: .74rem; }
@media (prefers-reduced-motion: no-preference) {
  .award-chip { animation: floaty 5.5s ease-in-out infinite; }
  @keyframes floaty { 50% { transform: translateY(-8px); } }
}
@media (max-width: 880px) {
  .hero-grid { grid-template-columns: 1fr; }
  .portrait { order: -1; width: min(290px, 72vw); }
}

/* ---------- logo strip ---------- */
.logos { display: flex; flex-wrap: wrap; align-items: center; gap: clamp(1.4rem, 4vw, 3rem); justify-content: center; }
.logos img {
  height: 30px; width: auto;
  filter: grayscale(1) opacity(.62);
  transition: filter .25s ease;
}
.logos img:hover { filter: none; }
@media (prefers-color-scheme: dark) { .logos img { filter: grayscale(1) invert(.85) opacity(.6); } .logos img:hover { filter: grayscale(1) invert(.9); } }

/* ---------- stats ---------- */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--line); border-block: 1px solid var(--line); }
.stat { background: var(--bg); padding: clamp(1.4rem, 3vw, 2.4rem) 1rem; text-align: center; }
.stat b { display: block; font-family: var(--serif); font-size: clamp(2rem, 1.4rem + 2.4vw, 3rem); color: var(--accent); }
.stat span { color: var(--muted); font-size: .92rem; }
@media (max-width: 700px) { .stats { grid-template-columns: 1fr 1fr; } }

/* ---------- bookshelf ---------- */
.shelf {
  display: grid; grid-auto-flow: column; grid-auto-columns: clamp(168px, 21vw, 215px);
  gap: clamp(1.1rem, 2.5vw, 1.8rem);
  overflow-x: auto; scroll-snap-type: x mandatory; padding: 1.2rem .3rem 1.6rem;
  scrollbar-width: thin; scrollbar-color: var(--gold) transparent;
}
.shelf > * { scroll-snap-align: start; }
.book-card { display: block; color: var(--ink) !important; }
.book-card:hover { text-decoration: none; }
.book-card .cover { position: relative; perspective: 800px; }
.book-card img {
  width: 100%; aspect-ratio: 460/661; object-fit: cover;
  border-radius: 4px 12px 12px 4px;
  box-shadow: var(--shadow);
  transition: transform .35s ease, box-shadow .35s ease;
}
.book-card .cover::after { /* spine sheen */
  content: ''; position: absolute; inset: 0 auto 0 0; width: 14%;
  background: linear-gradient(90deg, #00000026, #ffffff1f 60%, transparent);
  border-radius: 4px 0 0 4px; pointer-events: none;
}
.book-card:hover img { transform: rotateY(-7deg) translateY(-6px); box-shadow: 0 24px 40px -16px #1d191066; }
.book-card h3 { font-size: 1.04rem; margin: .9rem 0 .1rem; }
.book-card .ur { color: var(--accent); font-size: 1rem; line-height: 2; display: block; }
.book-card .meta { font-size: .8rem; color: var(--muted); }

.books-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: clamp(1.3rem, 3vw, 2.2rem); }

/* ---------- generic cards ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 1.2rem; }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.5rem 1.4rem; box-shadow: var(--shadow);
}
.card .ico { font-size: 1.6rem; display: block; margin-bottom: .6rem; }
.card h3 { font-size: 1.12rem; margin-bottom: .35em; }
.card p { color: var(--muted); font-size: .95rem; margin: 0; }

/* awards */
.awards { display: grid; grid-template-columns: 1fr 1fr; gap: 1.2rem; }
.award {
  position: relative; padding: 1.3rem 1.4rem 1.3rem 2.6rem;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
}
.award::before { content: '◆'; position: absolute; left: 1.05rem; top: 1.25rem; color: var(--gold); font-size: .8rem; }
.award h3 { font-size: 1rem; letter-spacing: .04em; text-transform: uppercase; font-family: var(--sans); font-weight: 700; color: var(--accent); }
.award p { color: var(--muted); font-size: .95rem; margin: 0; }
@media (max-width: 760px) { .awards { grid-template-columns: 1fr; } }

/* split layout */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(2rem, 5vw, 4rem); align-items: center; }
.split .pic img { border-radius: var(--radius); box-shadow: var(--shadow); }
.split .pic { position: relative; }
.split .pic::after {
  content: ''; position: absolute; inset: 14px -14px -14px 14px; z-index: -1;
  border: 2px solid var(--gold); border-radius: var(--radius); opacity: .45;
}
@media (max-width: 820px) { .split { grid-template-columns: 1fr; } }

/* quote */
.bigquote { text-align: center; max-width: 760px; margin-inline: auto; }
.bigquote blockquote {
  font-family: var(--serif); font-style: italic;
  font-size: clamp(1.5rem, 1.1rem + 2vw, 2.3rem); line-height: 1.4;
  margin: 0 0 1rem; color: var(--ink);
}
.bigquote blockquote::before { content: '“'; display: block; font-size: 4.5rem; line-height: .6; color: var(--gold); margin-bottom: 1.2rem; }
.bigquote figcaption { color: var(--muted); letter-spacing: .12em; text-transform: uppercase; font-size: .8rem; }

/* ---------- inner page hero ---------- */
.page-hero {
  padding-block: clamp(3rem, 6vw, 4.5rem) clamp(2rem, 4vw, 3rem);
  border-bottom: 1px solid var(--line);
  background:
    linear-gradient(180deg, transparent, var(--bg)),
    var(--pat-scallop) var(--bg-2);
  background-size: auto, 56px 56px;
}
.page-hero h1 { font-size: clamp(2.1rem, 1.4rem + 3.4vw, 3.4rem); }
.crumbs { font-size: .85rem; color: var(--muted); margin-bottom: 1rem; }
.crumbs a { color: var(--muted); }

/* ---------- prose ---------- */
.prose { max-width: 72ch; }
.prose h2 { font-size: 1.65rem; margin-top: 1.8em; }
.prose h3 { font-size: 1.3rem; margin-top: 1.6em; }
.prose blockquote {
  margin: 1.6rem 0; padding: 1rem 1.5rem;
  border-inline-start: 3px solid var(--gold);
  background: var(--bg-2); border-radius: 0 var(--radius) var(--radius) 0;
  font-family: var(--serif); font-style: italic;
}
.prose .ur { display: block; text-align: center; color: var(--accent); }
.prose ul { padding-inline-start: 1.2rem; }
.prose li { margin-bottom: .4rem; }

/* book detail */
.book-detail { display: grid; grid-template-columns: 300px 1fr; gap: clamp(2rem, 5vw, 4rem); align-items: start; }
.book-detail .side { position: sticky; top: 90px; }
.book-detail .side img { border-radius: 6px 16px 16px 6px; box-shadow: var(--shadow); }
.book-detail .side .panel { margin-top: 1.2rem; font-size: .92rem; color: var(--muted); }
@media (max-width: 820px) {
  .book-detail { grid-template-columns: 1fr; }
  .book-detail .side { position: static; max-width: 250px; }
}

/* gallery */
.gallery { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.gallery img { border-radius: var(--radius); box-shadow: var(--shadow); aspect-ratio: 3/2; object-fit: cover; }
@media (max-width: 700px) { .gallery { grid-template-columns: 1fr; } }

/* ---------- contact ---------- */
.contact-grid { display: grid; grid-template-columns: 1fr 1.2fr; gap: clamp(2rem, 5vw, 4rem); }
@media (max-width: 820px) { .contact-grid { grid-template-columns: 1fr; } }
.field { margin-bottom: 1.1rem; }
.field label { display: block; font-size: .86rem; font-weight: 600; margin-bottom: .35rem; }
.field input, .field textarea {
  width: 100%; padding: .75rem .95rem; font: inherit; color: var(--ink);
  background: var(--card); border: 1px solid var(--line); border-radius: 12px;
}
.field input:focus, .field textarea:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: transparent; }
.form-note { font-size: .9rem; color: var(--muted); }
.form-status { font-weight: 600; color: var(--accent); }

/* ---------- footer ---------- */
.site-foot {
  margin-top: clamp(3rem, 7vw, 5rem);
  background: var(--bg-3) var(--pat-star);
  background-size: 96px 96px;
  border-top: 1px solid var(--line);
}
.foot-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 2.2rem; padding-block: clamp(2.5rem, 5vw, 4rem); }
.site-foot h4 { font-family: var(--sans); font-size: .8rem; letter-spacing: .2em; text-transform: uppercase; color: var(--gold); }
.site-foot ul { list-style: none; margin: 0; padding: 0; }
.site-foot li { margin-bottom: .45rem; }
.site-foot a { color: var(--ink); }
.socials { display: flex; gap: .7rem; margin-top: 1rem; }
.socials a {
  display: grid; place-items: center; width: 40px; height: 40px;
  border-radius: 50%; border: 1px solid var(--line); color: var(--ink);
  transition: all .2s ease;
}
.socials a:hover { background: var(--accent); border-color: var(--accent); color: #fff; transform: translateY(-2px); }
.socials svg { width: 18px; height: 18px; fill: currentColor; }
.foot-bottom { border-top: 1px solid var(--line); padding-block: 1.1rem; font-size: .85rem; color: var(--muted); display: flex; flex-wrap: wrap; gap: .6rem; justify-content: space-between; }
@media (max-width: 760px) { .foot-grid { grid-template-columns: 1fr; gap: 1.6rem; } }

/* ---------- reveal ---------- */
.reveal { opacity: 0; translate: 0 22px; transition: opacity .7s ease, translate .7s ease; }
.reveal.in { opacity: 1; translate: 0 0; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; translate: none; transition: none; }
  html { scroll-behavior: auto; }
}
