:root {
  --paper: #fbf6ec;
  --paper-deep: #efe3cf;
  --surface: #fffdf8;
  --ink: #1f2d28;
  --muted: #68736d;
  --line: #ded2bf;
  --sage: #356653;
  --sage-light: #dfe9df;
  --clay: #c7683e;
  --gold: #d4a94c;
  --shadow: 0 22px 60px rgba(44, 34, 21, .12);
  --radius: 8px;
  --max: 1160px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(90deg, rgba(53, 102, 83, .035) 1px, transparent 1px),
    linear-gradient(0deg, rgba(53, 102, 83, .035) 1px, transparent 1px),
    var(--paper);
  background-size: 42px 42px;
  font-family: "Segoe UI", Tahoma, Arial, sans-serif;
  line-height: 1.65;
}

a {
  color: inherit;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  max-width: calc(var(--max) + 48px);
  margin: 0 auto;
  padding: .9rem 1.5rem;
  background: rgba(251, 246, 236, .86);
  border-bottom: 1px solid rgba(222, 210, 191, .72);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: .65rem;
  color: var(--sage);
  font-size: .82rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-decoration: none;
  text-transform: uppercase;
  white-space: nowrap;
}

.brand-mark {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid var(--sage);
  border-radius: 50%;
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: 0;
}

.topnav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: .35rem .8rem;
}

.topnav a {
  color: var(--muted);
  font-size: .88rem;
  font-weight: 700;
  text-decoration: none;
  padding: .4rem .1rem;
  border-bottom: 2px solid transparent;
}

.topnav a:hover,
.topnav a:focus-visible {
  color: var(--sage);
  border-color: var(--gold);
  outline: 0;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(340px, 450px);
  gap: clamp(2rem, 5vw, 5rem);
  align-items: center;
  max-width: var(--max);
  min-height: calc(100vh - 72px);
  margin: 0 auto;
  padding: clamp(3rem, 8vw, 6rem) 1.5rem clamp(4rem, 8vw, 7rem);
}

.hero-copy {
  position: relative;
}

.hero-copy::before {
  content: "";
  position: absolute;
  top: -2.25rem;
  left: 0;
  width: 82px;
  height: 3px;
  background: var(--gold);
}

.course-label {
  margin: 0 0 1rem;
  color: var(--clay);
  font-size: .82rem;
  font-weight: 900;
  letter-spacing: .18em;
  text-transform: uppercase;
}

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

h1 {
  max-width: 780px;
  margin: 0;
  color: var(--sage);
  font-family: Georgia, "Times New Roman", "Segoe UI", Tahoma, serif;
  font-size: clamp(3rem, 8vw, 6.9rem);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: 0;
}

.hero-subtitle {
  max-width: 620px;
  margin: 1.25rem 0 0;
  color: var(--ink);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.45rem, 3vw, 2.45rem);
  line-height: 1.2;
}

.byline {
  margin: 1rem 0 0;
  color: var(--muted);
  font-weight: 700;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .8rem;
  margin-top: 2rem;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: .75rem 1.1rem;
  border: 1px solid var(--sage);
  border-radius: var(--radius);
  font-size: .94rem;
  font-weight: 800;
  text-decoration: none;
}

.button.primary {
  color: #fffdf8;
  background: var(--sage);
}

.button.secondary {
  color: var(--sage);
  background: transparent;
}

.button:hover,
.button:focus-visible {
  transform: translateY(-1px);
  outline: 2px solid rgba(212, 169, 76, .45);
  outline-offset: 3px;
}

.hero-book {
  align-self: stretch;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 1rem;
}

.cover-frame {
  position: relative;
  overflow: hidden;
  aspect-ratio: 4 / 5;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.cover-frame::after {
  content: "";
  position: absolute;
  inset: 0;
  border: 12px solid rgba(255, 253, 248, .84);
  pointer-events: none;
}

.cover-frame img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: center;
}

.book-meta {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  color: var(--muted);
  font-size: .85rem;
  font-weight: 800;
  letter-spacing: .02em;
}

.section {
  max-width: var(--max);
  margin: 0 auto;
  padding: clamp(4rem, 8vw, 6.5rem) 1.5rem;
  border-top: 1px solid var(--line);
}

.section-heading {
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr);
  gap: .35rem 2rem;
  align-items: start;
  margin-bottom: clamp(1.8rem, 4vw, 3rem);
}

.section-heading .section-kicker {
  margin: .45rem 0 0;
  color: var(--clay);
  font-size: clamp(1.2rem, 2vw, 1.55rem);
  font-weight: 800;
  text-align: right;
}

.section-heading h2 {
  margin: 0;
  color: var(--sage);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2rem, 4vw, 3.4rem);
  line-height: 1.05;
  letter-spacing: 0;
}

.section-heading p:not(.section-kicker) {
  grid-column: 2;
  max-width: 720px;
  margin: 0;
  color: var(--muted);
  font-size: 1.05rem;
}

.reader-note,
.text-panel,
.summary-copy,
.reflection-card {
  background: rgba(255, 253, 248, .74);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 14px 42px rgba(44, 34, 21, .06);
}

.reader-note {
  align-self: stretch;
  padding: 1.35rem;
}

.reader-note h3,
.text-panel h3 {
  margin: 0 0 .8rem;
  color: var(--sage);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.4rem;
  line-height: 1.2;
}

.reader-note p {
  color: var(--muted);
  margin: 0 0 1.2rem;
}

.reader-note a {
  color: var(--clay);
  font-weight: 900;
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
}

.spread-reader {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 1.25rem;
  align-items: stretch;
}

.spread-track {
  direction: rtl;
  display: flex;
  gap: 1rem;
  min-width: 0;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  padding: .25rem .25rem 1rem;
  scroll-padding-inline: .25rem;
  scroll-snap-type: x mandatory;
  scrollbar-color: var(--sage) rgba(222, 210, 191, .7);
}

figure {
  margin: 0;
  padding: .55rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.spread-card {
  flex: 0 0 min(860px, 86vw);
  scroll-snap-align: start;
}

.spread-card img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  height: auto;
  object-fit: contain;
  background: #f7f2e9;
  border-radius: 4px;
}

figcaption {
  margin-top: .45rem;
  color: var(--muted);
  font-size: .78rem;
  font-weight: 900;
  letter-spacing: .08em;
  text-align: center;
  text-transform: uppercase;
}

.split-section {
  display: grid;
  grid-template-columns: minmax(0, 360px) minmax(0, 1fr);
  gap: 2rem;
}

.split-section .section-heading {
  display: block;
  margin-bottom: 0;
}

.split-section .section-kicker {
  margin-bottom: .75rem;
  text-align: left;
}

.text-panel,
.summary-copy,
.reflection-card {
  padding: clamp(1.4rem, 3vw, 2.3rem);
}

.text-panel p,
.summary-copy p,
.reflection-card p {
  margin: 0;
  color: #31423b;
  font-size: clamp(1rem, 1.6vw, 1.16rem);
}

.text-panel p + p {
  margin-top: 1rem;
}

.summary-band {
  display: grid;
  grid-template-columns: minmax(0, 360px) minmax(0, 1fr);
  gap: 2rem;
  max-width: 100%;
  padding-left: max(1.5rem, calc((100% - var(--max)) / 2));
  padding-right: max(1.5rem, calc((100% - var(--max)) / 2));
  background: linear-gradient(135deg, rgba(53, 102, 83, .1), rgba(212, 169, 76, .1));
}

.summary-band .section-heading {
  display: block;
  margin: 0;
}

.summary-band .section-kicker {
  margin-bottom: .75rem;
  text-align: left;
}

.comparison-list {
  display: grid;
  gap: 1rem;
}

.comparison-row {
  display: grid;
  grid-template-columns: minmax(210px, .5fr) minmax(220px, .55fr) minmax(0, 1fr);
  gap: 1rem;
  padding: 1rem;
  background: rgba(255, 253, 248, .78);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.source-spread {
  align-self: stretch;
}

.source-spread a {
  display: block;
  height: 100%;
}

.source-spread img {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 190px;
  object-fit: cover;
  object-position: center;
  background: #f7f2e9;
  border-radius: 4px;
}

.arabic-sentence {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  min-height: 100%;
  margin: 0;
  padding: 1.2rem;
  color: var(--sage);
  background: var(--sage-light);
  border-radius: calc(var(--radius) - 2px);
  font-size: clamp(1.35rem, 2.5vw, 2rem);
  font-weight: 800;
  line-height: 1.75;
}

.translation-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .75rem;
}

.translation-grid p {
  margin: 0;
  padding: .85rem .95rem;
  color: #354840;
  background: #fffaf1;
  border: 1px solid rgba(222, 210, 191, .78);
  border-radius: 6px;
  font-size: .96rem;
}

.translation-grid span {
  display: block;
  margin-bottom: .35rem;
  color: var(--clay);
  font-size: .72rem;
  font-weight: 900;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.tool-note {
  max-width: 780px;
  margin: 1.1rem 0 0;
  color: var(--muted);
}

.language-section {
  max-width: 100%;
  padding-left: max(1.5rem, calc((100% - var(--max)) / 2));
  padding-right: max(1.5rem, calc((100% - var(--max)) / 2));
  background: #f5ebda;
}

.phrase-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.phrase {
  min-height: 170px;
  padding: 1.3rem;
  background: var(--surface);
}

.phrase span {
  display: block;
  color: var(--sage);
  font-size: clamp(1.35rem, 2.2vw, 1.85rem);
  font-weight: 900;
  line-height: 1.5;
}

.phrase p {
  margin: 1rem 0 0;
  color: var(--muted);
  font-weight: 750;
}

.reflection-section {
  padding-bottom: clamp(5rem, 9vw, 8rem);
}

.reflection-card {
  position: relative;
  max-width: 880px;
  margin-left: auto;
}

.reflection-card::before {
  content: "";
  position: absolute;
  left: -58px;
  top: 2rem;
  bottom: 2rem;
  width: 3px;
  background: var(--gold);
}

.site-footer {
  padding: 2rem 1.5rem;
  color: var(--muted);
  border-top: 1px solid var(--line);
  text-align: center;
}

.site-footer p {
  margin: 0;
  font-size: .92rem;
  font-weight: 800;
}

@media (max-width: 980px) {
  .site-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .topnav {
    justify-content: flex-start;
  }

  .hero,
  .spread-reader,
  .split-section,
  .summary-band,
  .comparison-row {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: auto;
  }

  .hero-book {
    max-width: 540px;
  }

  .section-heading,
  .section-heading p:not(.section-kicker) {
    display: block;
  }

  .section-heading .section-kicker {
    margin-bottom: .55rem;
    text-align: left;
  }

  .translation-grid,
  .phrase-grid {
    grid-template-columns: 1fr;
  }

  .reflection-card {
    margin-left: 0;
  }

  .reflection-card::before {
    display: none;
  }
}

@media (max-width: 620px) {
  .site-header {
    padding: .85rem 1rem;
  }

  .brand {
    font-size: .76rem;
  }

  .topnav {
    gap: .25rem .65rem;
  }

  .topnav a {
    font-size: .82rem;
  }

  .hero,
  .section,
  .summary-band,
  .language-section {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  h1 {
    font-size: clamp(2.6rem, 17vw, 4.4rem);
  }

  .hero-subtitle {
    font-size: 1.35rem;
  }

  .hero-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .button {
    width: 100%;
  }

  .book-meta {
    flex-direction: column;
    gap: .25rem;
  }

  .spread-card {
    flex-basis: 92vw;
  }

  .comparison-row {
    padding: .7rem;
  }

  .arabic-sentence {
    padding: 1rem;
  }
}
