:root {
  --paper: #f7f5ef;
  --paper-2: #efede5;
  --ink: #171817;
  --soft-ink: #424640;
  --muted: #73776f;
  --line: #d8d3c7;
  --surface: #fffdf8;
  --teal: #245b55;
  --blue: #314f73;
  --oxblood: #713c46;
  --brass: #8a672c;
  --max: 1160px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 17px;
  line-height: 1.68;
  letter-spacing: 0;
}

html[lang="ar"] body {
  font-family: "IBM Plex Sans Arabic", Tahoma, Arial, sans-serif;
}

bdi {
  unicode-bidi: isolate;
}

a {
  color: inherit;
  text-decoration-color: rgba(36, 91, 85, 0.42);
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.2em;
}

a:hover {
  color: var(--teal);
}

img {
  display: block;
  max-width: 100%;
}

.wrap {
  width: min(var(--max), calc(100% - 48px));
  margin: 0 auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(247, 245, 239, 0.94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
}

.nav {
  width: min(var(--max), calc(100% - 48px));
  min-height: 64px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  font-weight: 760;
  text-decoration: none;
}

.brand-mark {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  color: var(--surface);
  background: var(--ink);
  border-radius: 6px;
  font-size: 0.78rem;
  letter-spacing: 0;
}

.nav-links {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 2px;
}

.nav-links a {
  padding: 7px 10px;
  border-radius: 6px;
  color: var(--soft-ink);
  font-size: 0.92rem;
  font-weight: 650;
  text-decoration: none;
}

.nav-links a:hover,
.nav-links a[aria-current="page"] {
  color: var(--ink);
  background: var(--paper-2);
}

.hero {
  padding: 88px 0 72px;
  border-bottom: 1px solid var(--line);
}

.hero.compact {
  padding: 76px 0 64px;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) 360px;
  gap: 76px;
  align-items: end;
}

.eyebrow {
  margin: 0 0 16px;
  color: var(--teal);
  font-size: 0.84rem;
  font-weight: 760;
  letter-spacing: 0;
}

h1,
h2,
h3,
p,
li,
dd {
  overflow-wrap: anywhere;
}

h1,
h2,
h3 {
  font-family: Georgia, "Times New Roman", serif;
  letter-spacing: 0;
}

h1 {
  max-width: 920px;
  margin: 0;
  font-size: 5.15rem;
  line-height: 0.95;
  font-weight: 700;
}

h2 {
  margin: 0;
  font-size: 2.65rem;
  line-height: 1.08;
  font-weight: 700;
}

h3 {
  margin: 0 0 9px;
  font-size: 1.18rem;
  line-height: 1.25;
}

.lead {
  max-width: 790px;
  margin: 28px 0 0;
  color: var(--soft-ink);
  font-size: 1.27rem;
  line-height: 1.62;
}

.hero-facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin: 34px 0 0;
}

.hero-facts div {
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.hero-facts dt {
  margin: 0 0 3px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 720;
}

.hero-facts dd {
  margin: 0;
  color: var(--ink);
  font-size: 0.96rem;
  line-height: 1.38;
}

.portrait-frame {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
}

.portrait {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  object-position: 50% 18%;
  border-radius: 4px;
}

.side-note {
  margin-top: 14px;
  padding: 16px 0 0;
  border-top: 1px solid var(--line);
}

.side-note strong {
  display: block;
  margin-bottom: 5px;
  font-size: 0.95rem;
}

.side-note span {
  display: block;
  color: var(--muted);
  font-size: 0.94rem;
  line-height: 1.55;
}

.section {
  padding: 72px 0;
  border-bottom: 1px solid var(--line);
}

.section.alt {
  background: var(--paper-2);
}

.page-hero {
  padding: 74px 0 62px;
  border-bottom: 1px solid var(--line);
}

.section-head {
  display: grid;
  grid-template-columns: minmax(0, 0.58fr) minmax(300px, 0.42fr);
  gap: 56px;
  align-items: start;
  margin-bottom: 34px;
}

.section-head p,
.section-head .tag-list,
.section-head .principle-list {
  margin: 0;
}

.section-head p {
  color: var(--muted);
}

.edge-grid,
.proof-grid,
.project-grid,
.post-grid {
  display: grid;
  gap: 14px;
}

.edge-grid,
.project-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.proof-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.post-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.feature-note {
  display: grid;
  grid-template-columns: minmax(0, 0.56fr) minmax(320px, 0.44fr);
  gap: 34px;
  align-items: center;
}

.feature-media {
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  overflow: hidden;
}

.feature-media img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.feature-copy {
  padding: 8px 0;
}

.feature-copy p {
  margin: 18px 0 0;
  color: var(--muted);
}

.feature-copy .button {
  margin-top: 24px;
}

.card {
  min-width: 0;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
}

.edge-card {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  column-gap: 16px;
}

.edge-card::before {
  content: "";
  width: 34px;
  height: 2px;
  margin-top: 12px;
  background: var(--teal);
}

.edge-card p {
  grid-column: 2;
}

.card p {
  margin: 0;
  color: var(--muted);
}

.card .meta,
.meta {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 680;
}

.proof-card {
  min-height: 160px;
}

.proof-card strong {
  display: block;
  margin-bottom: 14px;
  color: var(--ink);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 2.25rem;
  line-height: 1;
}

.proof-card:nth-child(1) {
  border-top: 3px solid var(--teal);
}

.proof-card:nth-child(2) {
  border-top: 3px solid var(--blue);
}

.proof-card:nth-child(3) {
  border-top: 3px solid var(--oxblood);
}

.proof-card:nth-child(4) {
  border-top: 3px solid var(--brass);
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0;
  margin: 0;
  list-style: none;
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 33px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--soft-ink);
  background: var(--surface);
  font-size: 0.88rem;
  font-weight: 650;
}

.principle-list {
  display: grid;
  gap: 10px;
  padding: 0;
  list-style: none;
}

.principle-list li {
  padding: 0 0 10px;
  border-bottom: 1px solid var(--line);
  color: var(--soft-ink);
}

.experience-list,
.publication-list {
  display: grid;
  gap: 0;
  margin-top: 34px;
}

.experience-item,
.publication-item {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  gap: 28px;
  padding: 22px 0;
  border-top: 1px solid var(--line);
}

.experience-item p,
.publication-item p {
  margin: 0;
  color: var(--muted);
}

.note-facts {
  grid-template-columns: 160px 180px minmax(0, 1fr);
}

.note-layout {
  display: grid;
  grid-template-columns: minmax(0, 0.62fr) minmax(300px, 0.38fr);
  gap: 56px;
  align-items: start;
}

.note-copy p {
  margin: 0 0 22px;
  color: var(--soft-ink);
  font-size: 1.08rem;
}

.note-themes {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.gallery-item {
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  overflow: hidden;
}

.gallery-item img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.gallery-item figcaption {
  padding: 11px 12px 13px;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.35;
}

.link-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 28px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--ink);
  font-size: 0.92rem;
  font-weight: 700;
  text-decoration: none;
}

.button:hover {
  border-color: var(--teal);
}

.post-card {
  display: flex;
  min-height: 252px;
  flex-direction: column;
  justify-content: space-between;
  color: inherit;
  text-decoration: none;
}

.post-card h3 {
  font-size: 1.18rem;
}

.post-card .meta {
  display: block;
  margin-bottom: 10px;
}

.post-card .tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 18px;
}

.mini-tag {
  display: inline-flex;
  padding: 4px 7px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--muted);
  font-size: 0.78rem;
}

.article {
  width: min(820px, calc(100% - 48px));
  margin: 0 auto;
  padding: 72px 0;
}

.article h1 {
  font-size: 3.45rem;
  line-height: 1.03;
}

.article .meta {
  margin: 20px 0 18px;
}

.article-body {
  margin-top: 36px;
}

.article-body p {
  margin: 0 0 24px;
  color: var(--soft-ink);
  font-size: 1.08rem;
}

.hash {
  color: var(--teal);
}

.footer {
  padding: 28px 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.footer .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 14px;
}

.footer-links a {
  color: var(--soft-ink);
  font-weight: 650;
  text-decoration: none;
}

html[dir="rtl"] .edge-card {
  grid-template-columns: minmax(0, 1fr) 34px;
}

html[dir="rtl"] .edge-card::before {
  grid-column: 2;
}

html[dir="rtl"] .edge-card h3,
html[dir="rtl"] .edge-card p {
  grid-column: 1;
}

html[dir="rtl"] .footer-links {
  justify-content: flex-start;
}

@media (max-width: 980px) {
  .hero-grid,
  .section-head {
    grid-template-columns: 1fr;
    gap: 34px;
  }

  .hero-grid {
    align-items: start;
  }

  .hero-grid aside {
    max-width: 360px;
  }

  h1 {
    font-size: 4rem;
  }

  h2 {
    font-size: 2.2rem;
  }

  .hero-facts,
  .note-facts,
  .proof-grid,
  .post-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .feature-note,
  .note-layout {
    grid-template-columns: 1fr;
  }

  .gallery-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  body {
    font-size: 16px;
  }

  .wrap,
  .nav,
  .article {
    width: min(var(--max), calc(100% - 28px));
  }

  .site-header {
    position: static;
  }

  .nav {
    min-height: auto;
    padding: 14px 0;
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }

  .nav-links {
    width: 100%;
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .hero,
  .hero.compact {
    padding: 54px 0 50px;
  }

  .section,
  .page-hero {
    padding: 48px 0;
  }

  h1 {
    font-size: 3.25rem;
  }

  h2 {
    font-size: 1.82rem;
  }

  .lead {
    font-size: 1.1rem;
  }

  .hero-facts,
  .note-facts,
  .edge-grid,
  .proof-grid,
  .project-grid,
  .post-grid,
  .gallery-grid {
    grid-template-columns: 1fr;
  }

  .experience-item,
  .publication-item {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .article h1 {
    font-size: 2.5rem;
  }

  .footer .wrap {
    align-items: flex-start;
    flex-direction: column;
  }
}
