:root {
  --bg: #f6f3ee;
  --fg: #1a1816;
  --muted: #6f6a63;
  --line: #dcd6cc;
  --accent: #b4532a;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121110;
    --fg: #f1ece4;
    --muted: #9a938a;
    --line: #2b2825;
    --accent: #e0835a;
  }
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  background: var(--bg);
  color: var(--fg);
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  display: grid;
  grid-template-rows: auto 1fr auto;
  min-height: 100vh;
  min-height: 100dvh;
  padding: 0 clamp(16px, 5vw, 64px);
}
header, footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 28px 0;
  font-size: 13px;
  letter-spacing: 0.04em;
  color: var(--muted);
}
header { border-bottom: 1px solid var(--line); }
footer { border-top: 1px solid var(--line); }
.mark {
  font-family: "Fraunces", Georgia, serif;
  font-weight: 500;
  font-size: 18px;
  letter-spacing: 0;
  color: var(--fg);
}
.status { display: inline-flex; align-items: center; gap: 8px; }
.dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--accent);
  animation: pulse 2.4s ease-in-out infinite;
}
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .3; } }
main {
  align-self: center;
  width: 100%;
  max-width: 1040px;
  padding: 56px 0;
}
.intro {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 56px;
  align-items: center;
}
.portrait {
  width: 100%;
  height: auto;
  aspect-ratio: 1;
  object-fit: cover;
  justify-self: start;
  border-radius: 24px;
  border: 1px solid var(--line);
  background: var(--line);
}
@media (max-width: 760px) {
  .intro { grid-template-columns: 1fr; gap: 0; }
  .portrait { order: -1; width: 104px; border-radius: 50%; margin-bottom: 28px; }
}
.eyebrow {
  font-size: 13px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 28px;
}
h1 {
  font-family: "Fraunces", Georgia, serif;
  font-weight: 300;
  font-size: clamp(44px, 7.5vw, 84px);
  line-height: 0.98;
  letter-spacing: -0.03em;
}
h1 em { font-style: italic; color: var(--muted); }
p.lede {
  margin-top: 32px;
  max-width: 520px;
  font-size: clamp(16px, 2vw, 18px);
  line-height: 1.65;
  color: var(--muted);
}
.social {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 28px;
}
.social a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--fg);
  text-decoration: none;
  font-size: 14px;
  transition: border-color .2s, color .2s, transform .2s;
}
.social a:hover, .social a:focus-visible {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-1px);
  outline: none;
}
.social svg { width: 16px; height: 16px; fill: currentColor; flex: none; }
.social svg[fill="none"] { fill: none; }
.ventures { margin-top: 72px; }
.ventures h2 {
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 20px;
}
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 16px;
}
.card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 14px;
  color: var(--fg);
  text-decoration: none;
  transition: border-color .2s, transform .2s;
}
a.card:hover, a.card:focus-visible { border-color: var(--accent); transform: translateY(-2px); outline: none; }
.card-top { display: flex; justify-content: space-between; font-size: 12px; letter-spacing: .06em; text-transform: uppercase; }
.role { color: var(--accent); }
.since { color: var(--muted); }
.card h3 {
  font-family: "Fraunces", Georgia, serif;
  font-weight: 500;
  font-size: 24px;
  letter-spacing: -0.01em;
}
.arrow { font-family: "Inter", sans-serif; font-size: 16px; color: var(--muted); transition: color .2s; }
a.card:hover .arrow { color: var(--accent); }
.card p { font-size: 14.5px; line-height: 1.6; color: var(--muted); flex: 1; }
.url { font-size: 13px; color: var(--muted); }
.fade:nth-child(5) { animation-delay: .48s; }
.fade { opacity: 0; transform: translateY(12px); animation: in .9s cubic-bezier(.2,.7,.2,1) forwards; }
.fade:nth-child(2) { animation-delay: .12s; }
.fade:nth-child(3) { animation-delay: .24s; }
.fade:nth-child(4) { animation-delay: .36s; }
@keyframes in { to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  .fade, .dot { animation: none; opacity: 1; transform: none; }
}
@media (max-width: 480px) {
  footer { flex-direction: column; gap: 6px; align-items: flex-start; }
}

/* Language switch */
.lang {
  color: var(--fg);
  text-decoration: none;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 14px;
  font-size: 14px;
  letter-spacing: 0;
  transition: border-color .2s, color .2s;
}
.lang:hover, .lang:focus-visible { border-color: var(--accent); color: var(--accent); outline: none; }
.lang[lang="ur"] { font-family: "Noto Nastaliq Urdu", serif; font-size: 15px; line-height: 1.9; padding: 0 14px; }

/* Urdu (RTL) page */
html[lang="ur"] body { font-family: "Noto Nastaliq Urdu", "Inter", serif; }
html[lang="ur"] .eyebrow,
html[lang="ur"] .ventures h2,
html[lang="ur"] .card-top { letter-spacing: 0; text-transform: none; font-size: 15px; }
html[lang="ur"] h1 {
  font-family: "Noto Nastaliq Urdu", serif;
  font-weight: 400;
  font-size: clamp(30px, 5vw, 52px);
  line-height: 1.9;
  letter-spacing: 0;
}
html[lang="ur"] h1 em { font-style: normal; }
html[lang="ur"] p.lede { line-height: 2.3; font-size: clamp(16px, 2vw, 18px); }
html[lang="ur"] .card h3 { font-family: "Noto Nastaliq Urdu", serif; font-weight: 400; font-size: 21px; line-height: 2; }
html[lang="ur"] .card p { line-height: 2.2; }
html[lang="ur"] .social a { font-size: 14px; line-height: 1.9; padding: 4px 14px; }
html[lang="ur"] .ltr { direction: ltr; unicode-bidi: isolate; font-family: "Inter", sans-serif; }
html[lang="ur"] .arrow { display: inline-block; transform: scaleX(-1); }
html[lang="ur"] header, html[lang="ur"] footer { font-size: 14px; letter-spacing: 0; }
html[lang="ur"] .mark { font-family: "Noto Nastaliq Urdu", serif; font-weight: 400; font-size: 18px; }
html[lang="ur"] .lang { font-family: "Inter", sans-serif; }

/* Writing: index + articles */
.mark a { color: inherit; text-decoration: none; }
.draft-banner {
  margin: 24px 0 0;
  padding: 12px 16px;
  border: 1px dashed var(--accent);
  border-radius: 10px;
  color: var(--accent);
  font-size: 14px;
}
.article { max-width: 680px; margin: 0 auto; padding: 56px 0 72px; align-self: start; }
.article .eyebrow { margin-bottom: 20px; }
.article h1 { font-size: clamp(36px, 6vw, 56px); line-height: 1.08; }
.article .meta { margin-top: 20px; color: var(--muted); font-size: 14px; }
.prose { margin-top: 40px; font-size: 17.5px; line-height: 1.75; }
.prose > * + * { margin-top: 1.1em; }
.prose h2 {
  font-family: "Fraunces", Georgia, serif;
  font-weight: 500;
  font-size: 26px;
  line-height: 1.25;
  letter-spacing: -0.01em;
  margin-top: 2em;
}
.prose a { color: var(--accent); text-underline-offset: 3px; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li + li { margin-top: .4em; }
.prose blockquote {
  border-left: 2px solid var(--accent);
  padding-left: 18px;
  color: var(--muted);
  font-family: "Fraunces", Georgia, serif;
  font-style: italic;
  font-size: 20px;
  line-height: 1.5;
}
.prose table { width: 100%; border-collapse: collapse; font-size: 15px; }
.prose th, .prose td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); }
.prose th { color: var(--muted); font-weight: 500; }
.prose td.num { font-variant-numeric: tabular-nums; }
.prose code { font-family: ui-monospace, "Cascadia Code", Consolas, monospace; font-size: .9em; background: var(--line); padding: 1px 6px; border-radius: 5px; }
.post-list { list-style: none; margin-top: 40px; display: grid; gap: 14px; padding: 0; }
.post-list a {
  display: block; padding: 22px; border: 1px solid var(--line); border-radius: 14px;
  color: var(--fg); text-decoration: none; transition: border-color .2s, transform .2s;
}
.post-list a:hover, .post-list a:focus-visible { border-color: var(--accent); transform: translateY(-2px); outline: none; }
.post-list h2 { font-family: "Fraunces", Georgia, serif; font-weight: 500; font-size: 24px; line-height: 1.25; }
.post-list p { margin-top: 8px; color: var(--muted); font-size: 15px; line-height: 1.6; }
.post-list .date { font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--accent); margin-bottom: 8px; display: block; }
.back { display: inline-block; margin-top: 56px; color: var(--muted); text-decoration: none; font-size: 14px; }
.back:hover { color: var(--accent); }
