:root {
  --paper: #F8F2E3;
  --paper-raised: #FDF9EE;
  --ink: #211D14;
  --ink-soft: #46392A;
  --ink-muted: #7A6E58;
  --hairline: #E4D7B8;

  --emerald: #0B5D42;
  --emerald-deep: #08432F;
  --emerald-soft: #E6EEE7;
  --gold: #A8792E;

  --display-font: 'Fraunces', serif;
  --body-font: 'Plus Jakarta Sans', sans-serif;
  --arabic-font: 'Amiri', serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body-font);
  -webkit-font-smoothing: antialiased;
  position: relative;
}

/* Faint tessellated star pattern, evokes geometric Islamic ornament */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='60' height='60'%3E%3Cg fill='none' stroke='%230B5D42' stroke-width='1'%3E%3Crect x='17' y='17' width='26' height='26'/%3E%3Crect x='17' y='17' width='26' height='26' transform='rotate(45 30 30)'/%3E%3C/g%3E%3C/svg%3E");
  background-size: 120px 120px;
  opacity: 0.045;
}

.page {
  max-width: 640px;
  margin: 0 auto;
  padding: 0 24px 80px;
  position: relative;
}

/* ---------- Header ---------- */

.site-header {
  padding: 40px 0 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.wordmark {
  font-family: var(--display-font);
  font-weight: 500;
  font-size: 20px;
  letter-spacing: 0.02em;
  display: inline-flex;
  align-items: center;
  gap: 9px;
}

.wordmark-mark {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 40'%3E%3Cg fill='none' stroke='%230B5D42' stroke-width='2.6'%3E%3Crect x='9' y='9' width='22' height='22'/%3E%3Crect x='9' y='9' width='22' height='22' transform='rotate(45 20 20)'/%3E%3C/g%3E%3C/svg%3E");
  background-size: contain;
  background-repeat: no-repeat;
}

/* ---------- Language selector ---------- */

.lang-trigger {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: var(--body-font);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--ink-soft);
  background: var(--paper-raised);
  border: 1px solid var(--hairline);
  border-radius: 999px;
  padding: 8px 14px 8px 12px;
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease;
}

.lang-trigger:hover {
  border-color: var(--emerald);
  color: var(--emerald-deep);
}

.lang-trigger-icon {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  border-radius: 50%;
  border: 1.4px solid currentColor;
  position: relative;
}

.lang-trigger-icon::before,
.lang-trigger-icon::after {
  content: "";
  position: absolute;
  border: 1.4px solid currentColor;
  border-radius: 50%;
}

.lang-trigger-icon::before {
  inset: -1.4px 4px;
  border-left: none;
  border-right: none;
}

.lang-trigger-icon::after {
  inset: 4px -1.4px;
  border-top: none;
  border-bottom: none;
}

.lang-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(33, 29, 20, 0.45);
  backdrop-filter: blur(2px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.lang-overlay[hidden] {
  display: none;
}

.lang-modal {
  width: 100%;
  max-width: 360px;
  max-height: 80vh;
  overflow-y: auto;
  background: var(--paper-raised);
  border: 1px solid var(--hairline);
  border-radius: 22px;
  padding: 22px 10px 14px;
  box-shadow: 0 20px 60px rgba(33, 29, 20, 0.22);
}

.lang-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 14px 16px;
  border-bottom: 1px solid var(--hairline);
  margin-bottom: 6px;
}

.lang-modal-header h2 {
  font-family: var(--display-font);
  font-weight: 500;
  font-size: 17px;
  margin: 0;
  color: var(--ink);
}

.lang-close {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  line-height: 1;
  color: var(--ink-muted);
  background: none;
  border: none;
  border-radius: 50%;
  cursor: pointer;
}

.lang-close:hover {
  background: var(--hairline);
  color: var(--ink);
}

.lang-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.lang-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  text-decoration: none;
  color: var(--ink);
  padding: 12px 14px;
  border-radius: 12px;
  transition: background 0.12s ease;
}

.lang-item:hover {
  background: var(--emerald-soft);
}

.lang-item.is-active {
  background: var(--emerald-soft);
}

.lang-item-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.lang-native {
  font-size: 15px;
  font-weight: 500;
}

.lang-native-rtl {
  font-family: var(--arabic-font);
  font-size: 17px;
}

.lang-name {
  font-size: 12px;
  color: var(--ink-muted);
}

.lang-check {
  font-size: 14px;
  color: var(--emerald-deep);
  flex-shrink: 0;
}

/* ---------- Hero ---------- */

.hero {
  position: relative;
  padding: 72px 0 56px;
  border-bottom: 1px solid var(--hairline);
  overflow: hidden;
}

.hero-watermark {
  position: absolute;
  top: -0.15em;
  right: -0.06em;
  font-family: var(--arabic-font);
  font-weight: 700;
  font-size: clamp(140px, 34vw, 220px);
  line-height: 1;
  color: var(--emerald);
  opacity: 0.07;
  pointer-events: none;
  user-select: none;
}

.eyebrow {
  position: relative;
  font-size: 13px;
  color: var(--ink-muted);
  margin: 0 0 20px;
  letter-spacing: 0.01em;
}

.hero h1 {
  position: relative;
  font-family: var(--display-font);
  font-weight: 500;
  font-size: clamp(40px, 8vw, 56px);
  line-height: 1.08;
  margin: 0 0 24px;
  letter-spacing: -0.01em;
  color: var(--ink);
}

.hero-sub {
  position: relative;
  font-size: 17px;
  line-height: 1.6;
  color: var(--ink-muted);
  max-width: 46ch;
  margin: 0 0 28px;
}

.hero-badges {
  position: relative;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0;
  padding: 0;
}

.hero-badges li {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--emerald-deep);
  background: var(--emerald-soft);
  border: 1px solid rgba(11, 93, 66, 0.16);
  border-radius: 999px;
  padding: 7px 14px;
}

/* ---------- Page markers (rub-el-hizb style ayah/juz medallions) ---------- */

.page-marker {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 44px;
  padding-left: 54px;
  margin: 56px 0 20px;
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-muted);
}

.page-marker::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 40'%3E%3Cg fill='none' stroke='%230B5D42' stroke-width='1.5'%3E%3Crect x='9' y='9' width='22' height='22'/%3E%3Crect x='9' y='9' width='22' height='22' transform='rotate(45 20 20)'/%3E%3C/g%3E%3C/svg%3E");
  background-size: contain;
  background-repeat: no-repeat;
}

.page-marker::after {
  content: attr(data-num);
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--display-font);
  font-size: 15px;
  color: var(--emerald-deep);
}

/* ---------- Prose sections ---------- */

.prose p {
  font-size: 16px;
  line-height: 1.75;
  color: var(--ink);
  max-width: 58ch;
  margin: 0 0 18px;
}

.prose p:last-child {
  margin-bottom: 0;
}

/* ---------- Feature grid ---------- */

.features-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.feature-card {
  background: var(--paper-raised);
  border: 1px solid var(--hairline);
  border-radius: 14px;
  padding: 20px 20px 22px;
}

.feature-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--emerald-soft);
  color: var(--emerald-deep);
  font-size: 15px;
  margin-bottom: 12px;
}

.feature-card h3 {
  font-family: var(--display-font);
  font-weight: 500;
  font-size: 16px;
  margin: 0 0 8px;
  color: var(--ink);
}

.feature-card p {
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--ink-muted);
  margin: 0;
}

/* ---------- Compare (Ada / Tidak ada) ---------- */

.compare {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.compare-col {
  background: var(--paper-raised);
  border: 1px solid var(--hairline);
  border-radius: 14px;
  padding: 20px 22px;
}

.compare-col h3 {
  font-family: var(--display-font);
  font-weight: 500;
  font-size: 18px;
  margin: 0 0 14px;
}

.compare-col ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.compare-col li {
  font-size: 14.5px;
  line-height: 1.6;
  padding: 7px 0;
  border-top: 1px solid var(--hairline);
  color: var(--ink-muted);
}

.compare-col li:first-child {
  border-top: none;
}

/* ---------- Theme swatches ---------- */

.theme-copy {
  font-size: 16px;
  line-height: 1.7;
  color: var(--ink-muted);
  max-width: 54ch;
  margin: 0 0 24px;
}

.swatch-row {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.swatch {
  width: 68px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.swatch::before {
  content: "";
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--c);
  border: 1px solid rgba(0, 0, 0, 0.08);
}

.swatch span {
  font-size: 11.5px;
  color: var(--ink-muted);
  text-align: center;
}

.swatch-amoled::before {
  background: #000;
}

/* ---------- Status ---------- */

.status-line {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 16px;
  font-weight: 500;
  margin: 0 0 10px;
  color: var(--ink);
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--emerald);
  flex-shrink: 0;
}

.status-sub {
  font-size: 14.5px;
  line-height: 1.6;
  color: var(--ink-muted);
  max-width: 52ch;
  margin: 0;
}

/* ---------- Download ---------- */

.download {
  background: var(--paper-raised);
  border: 1px solid var(--hairline);
  border-radius: 20px;
  padding: 28px 28px 26px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}

.download p {
  font-size: 15.5px;
  line-height: 1.65;
  color: var(--ink-soft);
  max-width: 40ch;
  margin: 0;
  flex: 1 1 260px;
}

.download-links {
  flex: 0 0 auto;
}

.download-links a {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 14.5px;
  font-weight: 500;
  color: var(--paper);
  background: var(--emerald-deep);
  text-decoration: none;
  border-radius: 999px;
  padding: 13px 22px 13px 44px;
  white-space: nowrap;
  transition: background 0.15s ease;
}

.download-links a::before {
  content: "";
  position: absolute;
  left: 18px;
  top: 50%;
  transform: translateY(-50%);
  width: 15px;
  height: 15px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23F8F2E3' d='M3.6 2.3c-.4.3-.6.8-.6 1.4v16.6c0 .6.2 1.1.6 1.4l9.4-9.7-9.4-9.7Z'/%3E%3Cpath fill='%23F8F2E3' d='m14 12.6 3-3.1-11.6-6.6c-.4-.2-.8-.3-1.1-.2l9.7 9.9ZM4.3 21.3c.3.1.7 0 1.1-.2l11.6-6.6-3-3.1-9.7 9.9Z'/%3E%3Cpath fill='%23F8F2E3' d='m17.9 9-3.3 1.9 3.3 1.9 3.6-2c.6-.4.6-1.4 0-1.8l-3.6-2Z' opacity='.85'/%3E%3C/svg%3E");
  background-size: contain;
  background-repeat: no-repeat;
}

.download-links a:hover {
  background: var(--emerald);
}

@media (max-width: 480px) {
  .download {
    padding: 24px 22px 22px;
  }

  .download-links a {
    width: 100%;
    justify-content: center;
  }
}

/* ---------- Colophon (creator credit, framed like a manuscript niche) ---------- */

.colophon {
  margin-top: 64px;
  padding: 48px 32px 40px;
  text-align: center;
  background: var(--emerald-deep);
  border-radius: 130px 130px 16px 16px;
  color: var(--paper);
}

.colophon-label {
  font-size: 12px;
  letter-spacing: 0.02em;
  color: rgba(248, 242, 227, 0.6);
  margin: 0 0 18px;
}

.colophon-lead {
  font-size: 14px;
  color: rgba(248, 242, 227, 0.75);
  margin: 0 0 6px;
}

.colophon-name {
  font-family: var(--display-font);
  font-weight: 500;
  font-size: 26px;
  margin: 0 0 16px;
  color: var(--paper);
}

.colophon-bio {
  font-size: 14.5px;
  line-height: 1.7;
  color: rgba(248, 242, 227, 0.82);
  max-width: 42ch;
  margin: 0 auto 26px;
}

.colophon-links {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

.colophon-links a {
  font-size: 13px;
  font-weight: 500;
  color: var(--emerald-deep);
  background: var(--paper);
  text-decoration: none;
  border-radius: 999px;
  padding: 9px 18px;
  transition: opacity 0.15s ease;
}

.colophon-links a:hover {
  opacity: 0.85;
}

/* ---------- Footer ---------- */

.site-footer {
  margin-top: 40px;
  padding-top: 24px;
}

.site-footer p {
  font-size: 13.5px;
  color: var(--ink-muted);
  margin: 0;
  text-align: center;
}

/* ---------- Responsive ---------- */

@media (max-width: 480px) {
  .compare {
    grid-template-columns: 1fr;
  }

  .features-grid {
    grid-template-columns: 1fr;
  }

  .swatch {
    width: 60px;
  }

  .colophon {
    border-radius: 90px 90px 16px 16px;
    padding: 40px 22px 34px;
  }
}

/* ---------- Reduced motion / focus ---------- */

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--emerald);
  outline-offset: 2px;
}

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