@font-face {
  font-family: "Cairo";
  src: url("assets/fonts/cairo-400.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Cairo";
  src: url("assets/fonts/cairo-500.ttf") format("truetype");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Cairo";
  src: url("assets/fonts/cairo-600.ttf") format("truetype");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Cairo";
  src: url("assets/fonts/cairo-700.ttf") format("truetype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #f5efe4;
  --bg-top: #faf6ef;
  --paper: rgba(255, 251, 244, 0.72);
  --text: #181411;
  --muted: #7b7062;
  --line: rgba(24, 20, 17, 0.1);
  --line-strong: rgba(24, 20, 17, 0.18);
  --shadow: 0 18px 40px rgba(25, 20, 15, 0.06);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  color: var(--text);
  background:
    radial-gradient(circle at top, rgba(255, 255, 255, 0.62), transparent 36%),
    linear-gradient(180deg, var(--bg-top) 0%, var(--bg) 30%, #f0e8da 100%);
  font-family: "Cairo", "SF Arabic", "Geeza Pro", sans-serif;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

a {
  color: inherit;
  text-decoration: none;
}

.page,
.site-header__inner,
.site-footer {
  width: min(100% - 48px, 1240px);
  margin: 0 auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  padding-top: 14px;
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 16px 22px;
  border: 1px solid var(--line);
  background: rgba(248, 243, 236, 0.84);
  backdrop-filter: blur(18px);
}

.site-header__title,
.eyebrow,
.book-section__index,
.cover-note,
.site-footer__meta,
.hero__meta {
  color: var(--muted);
  font-family: "Cairo", "SF Arabic", "Geeza Pro", sans-serif;
}

.site-header__title {
  margin: 0;
  font-size: 0.94rem;
  letter-spacing: 0;
}

.site-nav {
  display: flex;
  gap: 20px;
  overflow-x: auto;
  white-space: nowrap;
  scrollbar-width: none;
}

.mobile-nav {
  display: none;
  position: relative;
}

.mobile-nav summary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid var(--line);
  background: rgba(255, 252, 247, 0.86);
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}

.mobile-nav summary::-webkit-details-marker {
  display: none;
}

.mobile-nav__panel {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  right: auto;
  width: min(280px, calc(100vw - 40px));
  display: grid;
  gap: 0;
  border: 1px solid var(--line);
  background: rgba(250, 246, 239, 0.98);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.mobile-nav__panel a {
  padding: 12px 14px;
  border-top: 1px solid var(--line);
  font-size: 0.95rem;
}

.mobile-nav__panel a:first-child {
  border-top: 0;
}

.site-nav::-webkit-scrollbar {
  display: none;
}

.site-nav a {
  position: relative;
  padding-bottom: 5px;
  font-size: 0.9rem;
  color: rgba(24, 20, 17, 0.8);
  font-weight: 500;
}

.site-nav a::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 1px;
  background: var(--line-strong);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 180ms ease;
}

.site-nav a:hover::after,
.site-nav a:focus-visible::after {
  transform: scaleX(1);
}

.hero {
  display: grid;
  grid-template-columns: minmax(280px, 0.68fr) minmax(0, 1fr);
  gap: 86px;
  align-items: center;
  min-height: calc(100vh - 96px);
  padding: 92px 0 84px;
}

.hero__cover {
  width: min(100%, 360px);
  justify-self: center;
}

.cover-frame {
  padding: 16px;
  border: 1px solid var(--line);
  background: var(--paper);
  box-shadow: var(--shadow);
}

.hero__content {
  max-width: 640px;
}

.eyebrow {
  margin: 0 0 24px;
  font-size: 0.86rem;
  letter-spacing: 0.02em;
}

.hero__heading {
  margin-bottom: 14px;
}

.hero__meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  font-size: 0.96rem;
}

.hero__lead {
  margin: 0 0 20px;
  font-size: clamp(1.36rem, 1.8vw, 1.6rem);
  line-height: 1.9;
  font-weight: 600;
}

.hero__text,
.prose {
  max-width: 38rem;
}

.hero__text p,
.prose p,
.section-intro {
  margin: 0;
  font-size: clamp(1.08rem, 1vw, 1.2rem);
  line-height: 2.15;
  letter-spacing: 0;
  font-weight: 400;
}

.hero__text p + p,
.prose p + p {
  margin-top: 18px;
}

.cover-note {
  max-width: 25rem;
  margin: 26px 0 0;
  font-size: 0.88rem;
  line-height: 2;
  font-weight: 400;
}

.opening-note,
.site-footer {
  padding-top: 18px;
}

.opening-note p {
  max-width: 34rem;
  margin: 22px 0 0;
  font-size: 1rem;
  line-height: 2.05;
  color: rgba(24, 20, 17, 0.8);
}

.rule {
  width: 100%;
  height: 1px;
  background: linear-gradient(90deg, transparent 0%, var(--line-strong) 14%, var(--line-strong) 86%, transparent 100%);
}

.book-section {
  display: grid;
  grid-template-columns: minmax(220px, 300px) minmax(0, 1fr);
  gap: 56px;
  padding: 86px 0;
  border-bottom: 1px solid var(--line);
}

.book-section__head {
  display: grid;
  align-content: start;
  gap: 12px;
  position: sticky;
  top: 110px;
  align-self: start;
}

.book-section__index {
  margin: 0;
  font-size: 0.88rem;
  letter-spacing: 0.08em;
}

.book-section__title-group h2 {
  margin: 0;
  max-width: 12ch;
  font-size: clamp(1.9rem, 3vw, 2.8rem);
  line-height: 1.24;
  font-weight: 700;
  letter-spacing: 0;
  font-family: "Cairo", "SF Arabic", "Geeza Pro", sans-serif;
}

.book-section__body {
  max-width: 44rem;
}

.section-intro {
  margin-bottom: 28px;
  color: rgba(24, 20, 17, 0.84);
}

.list-grid,
.guide-grid {
  display: grid;
  gap: 0;
}

.list-item,
.guide-item {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  gap: 18px;
  padding: 24px 0;
  border-top: 1px solid var(--line);
}

.guide-item {
  grid-template-columns: 1fr;
  gap: 10px;
}

.list-item:first-child,
.guide-item:first-child {
  padding-top: 0;
  border-top: 0;
}

.list-item__index {
  margin: 6px 0 0;
  font-size: 0.88rem;
  color: var(--muted);
}

.list-item__content h3,
.guide-item h3 {
  margin: 0 0 10px;
  font-size: 1.04rem;
  line-height: 1.9;
  font-weight: 700;
  font-family: "Cairo", "SF Arabic", "Geeza Pro", sans-serif;
}

.media-section {
  display: grid;
  gap: 24px;
}

.audio-card,
.pdf-frame {
  border: 1px solid var(--line);
  background: rgba(255, 252, 247, 0.58);
  box-shadow: var(--shadow);
}

.audio-card {
  padding: 24px;
}

.media-title {
  margin: 0 0 14px;
  font-size: 1rem;
  font-weight: 600;
}

.audio-player {
  width: 100%;
}

.presentation-mobile {
  display: grid;
  gap: 14px;
}

.presentation-mobile--visible {
  max-width: 30rem;
}

.presentation-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 18px;
  border: 1px solid var(--line-strong);
  background: rgba(255, 252, 247, 0.9);
  font-size: 0.96rem;
  font-weight: 600;
}

.media-note {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.95;
  color: var(--muted);
}

.presentation-page {
  min-height: 100vh;
}

.presentation-layout {
  width: min(100% - 24px, 1100px);
  margin: 0 auto;
  padding: 18px 0 24px;
}

.presentation-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  background: rgba(248, 243, 236, 0.84);
}

.presentation-title {
  margin: 0;
  font-size: 0.96rem;
  color: var(--muted);
}

.presentation-viewer {
  margin-top: 16px;
  border: 1px solid var(--line);
  background: #fff;
  box-shadow: var(--shadow);
}

.presentation-viewer iframe {
  display: block;
  width: 100%;
  height: calc(100vh - 96px);
  min-height: 720px;
  border: 0;
}

.closing-line {
  font-size: 1.28rem;
}

.book-section--closing {
  border-bottom: 0;
}

.site-footer {
  padding-bottom: 72px;
  text-align: center;
}

.site-footer__title {
  margin: 28px 0 10px;
  font-size: 1.25rem;
}

.site-footer__meta {
  margin: 0;
  font-size: 0.94rem;
  letter-spacing: 0.08em;
}

.site-footer__meta span,
.hero__meta span {
  padding: 0 2px;
}

body.has-motion .reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 780ms ease, transform 780ms ease;
}

body.has-motion .reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 1080px) {
  .hero {
    grid-template-columns: 1fr;
    gap: 42px;
    min-height: auto;
    padding-top: 56px;
  }

  .hero__cover {
    order: 1;
    width: min(100%, 300px);
  }

  .hero__content {
    order: 2;
    max-width: 100%;
  }

  .book-section {
    grid-template-columns: 1fr;
    gap: 18px;
    padding: 64px 0;
  }

  .book-section__head {
    position: static;
  }

  .book-section__title-group h2 {
    max-width: none;
  }
}

@media (max-width: 720px) {
  .page,
  .site-header__inner,
  .site-footer {
    width: min(100% - 20px, 1240px);
  }

  .site-header__inner {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
  }

  .site-nav {
    display: none;
  }

  .mobile-nav {
    display: block;
  }

  .hero {
    padding-top: 34px;
    gap: 34px;
  }

  .eyebrow {
    margin-bottom: 16px;
    font-size: 0.8rem;
  }

  .hero__meta {
    font-size: 0.88rem;
  }

  .hero__heading {
    margin-bottom: 14px;
  }

  .hero__text p,
  .prose p,
  .section-intro,
  .hero__lead {
    font-size: 1.02rem;
    line-height: 2.05;
  }

  .book-section__title-group h2 {
    font-size: clamp(1.65rem, 8.4vw, 2.15rem);
    line-height: 1.24;
  }

  .book-section {
    padding: 48px 0;
  }

  .cover-note {
    margin-top: 18px;
    font-size: 0.88rem;
  }

  .audio-card {
    padding: 18px;
  }

  .presentation-viewer iframe {
    height: calc(100vh - 88px);
    min-height: 0;
  }

  .presentation-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .presentation-title {
    font-size: 0.9rem;
    line-height: 1.8;
  }

  .list-item,
  .guide-item {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .cover-frame {
    padding: 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  body.has-motion .reveal,
  body.has-motion .reveal.is-visible,
  .site-nav a::after {
    opacity: 1;
    transform: none;
    transition: none;
  }
}
