/* Ayah Ink marketing site — shared styles.
   Tokens mirror src/theme/tokens.ts; keep the two in step. */

:root {
  --canvas: #e9e4db;
  --paper: #fffdf7;
  --surface: #fffefb;
  --surface-muted: #f5f1e9;
  --surface-strong: #ece6da;
  --ink: #1e1c19;
  --ink-secondary: #706a61;
  --ink-tertiary: #6e675d;
  --border: #d8d1c5;
  --border-strong: #b9b0a3;
  --accent: #5e6450;
  --accent-pressed: #4d5341;
  --accent-soft: #e5e8dc;
  --accent-faint: #f1f2ec;
  --ink-blue: #294b71;
  --ink-red: #91403d;
  --highlighter: #ebcb51;
  --note-paper: #f4e7a4;
  --shadow-subtle: 0 1px 2px rgba(49, 43, 34, 0.06);
  --shadow-lifted: 0 12px 36px rgba(49, 43, 34, 0.12);
  --shadow-page: 0 18px 50px rgba(55, 47, 36, 0.16);
  --radius-s: 6px;
  --radius-m: 10px;
  --radius-l: 14px;
  --font-display: "Cormorant Garamond", "Iowan Old Style", Georgia, serif;
  --font-body: "Source Sans 3", "Helvetica Neue", Arial, sans-serif;
  --font-arabic: "Noto Naskh Arabic", "Geeza Pro", serif;
  --font-hand: "Caveat", "Bradley Hand", cursive;
  --measure: 62ch;
  --page-max: 1120px;
}

* {
  box-sizing: border-box;
}

/* The hidden attribute must always win, even over display:flex containers.
   Without this, the waitlist form stays visible after a successful signup. */
[hidden] {
  display: none !important;
}

/* Smooth scrolling only while the visitor is interacting (an anchor click
   focuses the link, so focus-within holds). Initial navigation — including a
   remembered #waitlist hash from the address bar — jumps instantly instead of
   visibly sailing the whole page on load. */
html:focus-within {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a {
  color: var(--accent-pressed);
  text-decoration-color: var(--border-strong);
  text-underline-offset: 3px;
}

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

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

::selection {
  background: rgba(235, 203, 81, 0.55);
}

.wrap {
  max-width: var(--page-max);
  margin: 0 auto;
  padding: 0 24px;
}

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

.site-header {
  padding: 20px 0;
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 26px;
  letter-spacing: 0.01em;
  color: var(--ink);
  text-decoration: none;
}

.wordmark .logo {
  display: block;
  height: 42px;
  width: auto;
}

.wordmark .gild {
  color: var(--gild);
}

.wordmark .nib {
  color: var(--accent);
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 22px;
}

.site-nav a {
  font-size: 15px;
  font-weight: 500;
  color: var(--ink-secondary);
  text-decoration: none;
}

.site-nav a:hover {
  color: var(--ink);
}

/* ---------- Buttons ---------- */

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 10px 22px;
  white-space: nowrap;
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 600;
  color: #fffdf7;
  background: var(--accent);
  border: 1px solid var(--accent);
  border-radius: var(--radius-m);
  cursor: pointer;
  text-decoration: none;
}

.btn-primary:hover {
  color: #fffdf7;
  background: var(--accent-pressed);
  border-color: var(--accent-pressed);
}

.btn-primary:active {
  background: var(--accent-pressed);
  border-color: var(--accent-pressed);
  transform: translateY(1px);
}

/* Beat .site-nav a's color, which is more specific than .btn-primary. */
.site-nav a.btn-small,
.site-nav a.btn-small:hover {
  color: #fffdf7;
}

.site-nav .btn-small {
  min-height: 0;
  padding: 8px 16px;
  font-size: 14px;
}

/* ---------- Waitlist form ---------- */

.waitlist-form {
  margin: 0 0 24px;
  max-width: 440px;
}

.waitlist-fields {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.waitlist-fields input[type="email"] {
  flex: 1 1 200px;
  min-height: 46px;
  padding: 10px 14px;
  font-family: var(--font-body);
  font-size: 16px;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-m);
}

.waitlist-fields input[type="email"]::placeholder {
  color: var(--ink-tertiary);
}

.waitlist-fields button {
  flex: 0 0 auto;
}

/* Honeypot field: invisible to people, tempting to bots. Clip instead of an
   offscreen offset: in RTL documents a left:-9999px element extends the
   scrollable overflow area and makes the page ~10000px wide. */
.hp {
  position: absolute !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  opacity: 0;
}

.waitlist-status {
  font-size: 14.5px;
  margin: 10px 0 0;
}

.waitlist-status:empty {
  display: none;
}

.waitlist-status.ok {
  color: var(--accent-pressed);
  font-weight: 600;
}

.waitlist-status.err {
  color: var(--ink-red);
}

.waitlist-status.wait {
  color: var(--ink-tertiary);
}

.waitlist-note {
  font-size: 13.5px;
  color: var(--ink-tertiary);
  margin: 8px 0 0;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

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

.hero {
  padding: 56px 0 40px;
}

.hero .wrap {
  display: grid;
  grid-template-columns: minmax(0, 6fr) minmax(0, 5fr);
  gap: 56px;
  align-items: center;
}

.hero h1 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(40px, 5.4vw, 60px);
  line-height: 1.06;
  letter-spacing: -0.01em;
  margin: 0 0 22px;
  text-wrap: balance;
}

/* Hand-drawn ink underline beneath a key phrase. */
.u-ink {
  position: relative;
  white-space: nowrap;
}

.u-ink svg {
  position: absolute;
  left: -2%;
  bottom: -0.14em;
  width: 104%;
  height: 0.22em;
  overflow: visible;
}

.u-ink svg path {
  fill: none;
  stroke: var(--accent);
  stroke-width: 3.2;
  stroke-linecap: round;
}

/* Highlighter swipe behind a key phrase. Painted as a sized gradient so
   scroll-driven browsers can wipe it in as the heading enters the viewport;
   everywhere else it is simply present. */
.u-mark {
  background-image: linear-gradient(rgba(235, 203, 81, 0.5), rgba(235, 203, 81, 0.5));
  background-repeat: no-repeat;
  background-size: 100% 100%;
  border-radius: 4px;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
  padding: 0.02em 0.12em;
  margin: -0.02em -0.12em;
}

@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .u-mark {
      animation: mark-wipe 1ms linear both;
      animation-timeline: view();
      animation-range: entry 50% entry 100%;
    }
  }
}

@keyframes mark-wipe {
  from {
    background-size: 0% 100%;
  }
}

.hero .lede {
  max-width: 46ch;
  font-size: 19px;
  color: var(--ink-secondary);
  margin: 0 0 30px;
}

/* ---------- Hero mockup: an annotated Qur'an page ---------- */

.desk {
  position: relative;
  padding: 12px 8px 40px;
}

.page-sheet {
  position: relative;
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: var(--radius-l);
  box-shadow: var(--shadow-page);
  padding: 30px 34px 26px;
}

/* Second sheet peeking out beneath: the notebook, not a lone page. */
.page-sheet::before {
  content: "";
  position: absolute;
  inset: 10px -7px -10px 7px;
  background: var(--surface-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius-l);
  z-index: -1;
  transform: rotate(0.9deg);
}

.surah-line {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 10px;
  margin-bottom: 20px;
}

.surah-line .surah {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.surah-line .juz {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-tertiary);
}

.ayah {
  font-family: var(--font-arabic);
  font-size: clamp(24px, 2.4vw, 29px);
  line-height: 2.15;
  text-align: center;
  margin: 0 0 14px;
}

.ayah .marker {
  color: var(--accent);
  font-size: 0.75em;
}

/* Highlighter stroke inside the Arabic: wipes in right-to-left. */
.ayah .hl {
  background: rgba(235, 203, 81, 0.55);
  border-radius: 5px;
  padding: 0 0.08em;
}

.ayah .word-underline {
  position: relative;
}

.ayah .word-underline svg {
  position: absolute;
  right: -4%;
  bottom: 0.28em;
  width: 108%;
  height: 8px;
  overflow: visible;
}

.ayah .word-underline svg path {
  fill: none;
  stroke: var(--ink-red);
  stroke-width: 2.6;
  stroke-linecap: round;
}

.translation {
  font-size: 14.5px;
  color: var(--ink-secondary);
  text-align: center;
  max-width: 34ch;
  margin: 0 auto;
}

.translation cite {
  display: block;
  font-style: normal;
  font-size: 12px;
  color: var(--ink-tertiary);
  margin-top: 6px;
}

/* Handwritten margin note with connector stroke, pointing at the underlined
   word ʿalaq on the second line of the āyah. */
.margin-note {
  position: absolute;
  top: 150px;
  left: -54px;
  width: 128px;
  font-family: var(--font-hand);
  font-size: 21px;
  line-height: 1.15;
  color: var(--ink-blue);
  transform: rotate(-3.5deg);
}

.margin-note svg {
  display: block;
  width: 54px;
  height: 20px;
  margin: 4px 0 0 46px;
}

.margin-note svg path {
  fill: none;
  stroke: var(--ink-blue);
  stroke-width: 2;
  stroke-linecap: round;
}

/* Sticky note. */
.sticky {
  position: absolute;
  right: -20px;
  bottom: -16px;
  width: 128px;
  background: var(--note-paper);
  border-radius: var(--radius-s);
  box-shadow: var(--shadow-lifted);
  padding: 10px 12px;
  font-family: var(--font-hand);
  font-size: 17px;
  line-height: 1.2;
  color: #4a4230;
  transform: rotate(2.4deg);
}

/* Layers card floating below the sheet. */
.layers-card {
  position: absolute;
  left: 22px;
  bottom: -6px;
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-m);
  box-shadow: var(--shadow-lifted);
  padding: 9px 14px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-secondary);
}

.layers-card .dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  margin-right: 5px;
  vertical-align: 1px;
}

.layers-card .label {
  letter-spacing: 0.09em;
  text-transform: uppercase;
  font-size: 10.5px;
  color: var(--ink-tertiary);
}

/* Ink drawn over the real page. The viewBox matches the screenshot's pixels,
   so stroke coordinates track the image at every size. Base state is fully
   drawn; ink.js hides the marks and replays the choreography once the figure
   scrolls into view, and only for motion-tolerant visitors. */
.ink-frame {
  position: relative;
}

.ink-overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.ink-overlay path {
  fill: none;
  stroke-linecap: round;
}

.ink-hl {
  stroke: rgba(235, 203, 81, 0.55);
  stroke-width: 46;
  mix-blend-mode: multiply;
}

.ink-under {
  stroke: var(--ink-red);
  stroke-width: 3.4;
}

.ink-connector {
  stroke: var(--ink-blue);
  stroke-width: 2.4;
}

.ink-note text {
  font-family: var(--font-hand);
  font-size: 34px;
  fill: var(--ink-blue);
}

@media (prefers-reduced-motion: no-preference) {
  .js-ink .ink-hl,
  .js-ink .ink-under,
  .js-ink .ink-connector {
    stroke-dasharray: 1;
    stroke-dashoffset: 1;
  }

  .js-ink .ink-note {
    opacity: 0;
  }

  .is-inked .ink-hl {
    animation: draw 0.7s ease-out 0.2s forwards;
  }

  .is-inked .ink-under {
    animation: draw 0.6s ease-out 1.1s forwards;
  }

  .is-inked .ink-connector {
    animation: draw 0.5s ease-out 1.7s forwards;
  }

  .is-inked .ink-note {
    animation: note-fade 0.5s ease-out 1.6s forwards;
  }
}

@keyframes note-fade {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

/* Draw-in choreography for the hero vignette and headline underline. */
@media (prefers-reduced-motion: no-preference) {
  .ayah .hl {
    animation: wipe-rtl 0.7s cubic-bezier(0.2, 0.7, 0.2, 1) 0.5s backwards;
  }

  .u-ink svg path,
  .ayah .word-underline svg path,
  .margin-note svg path {
    stroke-dasharray: 1;
    stroke-dashoffset: 1;
    animation: draw 0.8s ease-out forwards;
  }

  .u-ink svg path {
    animation-delay: 0.35s;
  }

  .ayah .word-underline svg path {
    animation-delay: 1.15s;
  }

  .margin-note svg path {
    animation-delay: 1.7s;
  }

  .margin-note,
  .sticky,
  .layers-card {
    animation: settle 0.55s ease-out backwards;
  }

  .margin-note {
    animation-delay: 1.55s;
    animation-name: settle-note;
  }

  .sticky {
    animation-delay: 1.9s;
    animation-name: settle-sticky;
  }

  .layers-card {
    animation-delay: 2.1s;
  }

  @keyframes settle-note {
    from {
      opacity: 0;
      transform: rotate(-3.5deg) translateY(6px);
    }

    to {
      opacity: 1;
      transform: rotate(-3.5deg);
    }
  }

  @keyframes settle-sticky {
    from {
      opacity: 0;
      transform: rotate(2.4deg) translateY(6px);
    }

    to {
      opacity: 1;
      transform: rotate(2.4deg);
    }
  }
}

@keyframes draw {
  to {
    stroke-dashoffset: 0;
  }
}

@keyframes wipe-rtl {
  from {
    clip-path: inset(0 0 0 100%);
  }

  to {
    clip-path: inset(0);
  }
}

@keyframes settle {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
}

/* ---------- Corpus band ---------- */

.corpus {
  padding: 44px 0 8px;
}

.corpus p {
  font-family: var(--font-display);
  font-size: clamp(23px, 3vw, 30px);
  font-weight: 500;
  line-height: 1.45;
  max-width: 30em;
  margin: 0 auto;
  text-align: center;
  text-wrap: balance;
}

.corpus .num {
  font-style: italic;
  color: var(--accent-pressed);
  font-weight: 600;
}

/* Must out-rank `.corpus p`, which would otherwise set the display serif. */
.corpus p.fine-sources {
  font-family: var(--font-body);
  font-size: 13.5px;
  font-weight: 400;
  line-height: 1.55;
  color: var(--ink-tertiary);
  text-align: center;
  max-width: 74ch;
  margin: 16px auto 0;
}

/* ---------- Sections ---------- */

.section {
  padding: 72px 0 0;
}

.section-head {
  max-width: var(--measure);
  margin-bottom: 36px;
}

.section-head h2 {
  font-family: var(--font-display);
  font-size: clamp(30px, 3.6vw, 40px);
  font-weight: 600;
  line-height: 1.12;
  margin: 0 0 12px;
  text-wrap: balance;
}

.section-head .lede {
  font-size: 18px;
  color: var(--ink-secondary);
  margin: 0;
  max-width: 56ch;
}

/* Feature entries. */
/* Ruled grid entries, not boxed cards: the app's design language avoids generic
   card chrome, so features are grouped by a top hairline and negative space.
   The lead entry sits on a tinted panel so the grid has one anchor, not six
   identical cells. */
.feature-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr) minmax(0, 1fr);
  column-gap: 44px;
  row-gap: 12px;
}

.feature {
  padding: 24px 0 6px;
  border-top: 1px solid var(--border-strong);
}

.feature-lead {
  border-top: 0;
  background: var(--accent-faint);
  border: 1px solid var(--accent-soft);
  border-radius: var(--radius-l);
  padding: 26px 28px 22px;
}

.feature-lead h3 {
  font-size: 26px;
}

.feature-lead p {
  font-size: 16.5px;
}

.feature svg {
  display: block;
  width: 24px;
  height: 24px;
  stroke: var(--accent-pressed);
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
  margin-bottom: 14px;
}

.feature h3 {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 600;
  margin: 0 0 8px;
}

.feature p {
  font-size: 15.5px;
  color: var(--ink-secondary);
  margin: 0;
}

/* Full app screenshot, presented as a figure that speaks for itself. */

.app-figure {
  margin: 0;
}

.app-shot {
  display: block;
  width: 100%;
  height: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-l);
  box-shadow: var(--shadow-page);
}

.app-figure figcaption {
  font-size: 13.5px;
  color: var(--ink-tertiary);
  text-align: center;
  margin-top: 14px;
}

/* Closing waitlist band. */

.cta-band {
  padding-bottom: 8px;
}

.cta-sheet {
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: var(--radius-l);
  box-shadow: var(--shadow-subtle);
  padding: 48px;
  text-align: center;
}

.cta-sheet h2 {
  font-family: var(--font-display);
  font-size: clamp(28px, 3.2vw, 36px);
  font-weight: 600;
  line-height: 1.14;
  margin: 0 0 12px;
  text-wrap: balance;
}

.cta-sheet .lede {
  font-size: 18px;
  color: var(--ink-secondary);
  max-width: 52ch;
  margin: 0 auto 24px;
}

.cta-sheet .waitlist-form {
  margin: 0 auto;
}

.cta-sheet .waitlist-fields {
  justify-content: center;
}

/* Desk band — stylus specifics on a muted sheet. */
.desk-band {
  margin-top: 72px;
  background: var(--surface-muted);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 60px 0 64px;
}

.desk-band .cols {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  gap: 48px;
  align-items: start;
}

.desk-band h2 {
  font-family: var(--font-display);
  font-size: clamp(28px, 3.2vw, 36px);
  font-weight: 600;
  line-height: 1.14;
  margin: 0 0 14px;
}

.desk-band .lede {
  color: var(--ink-secondary);
  margin: 0;
}

/* Three plain clusters instead of one ruled list: grouped, no row hairlines. */
.spec-groups {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px 32px;
}

.spec-group h3 {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 600;
  margin: 0 0 8px;
}

.spec-group ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.spec-group li {
  font-size: 15px;
  color: var(--ink-secondary);
  padding: 5px 0;
}

/* ---------- Pro table ---------- */

.plans {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.plan {
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: var(--radius-l);
  box-shadow: var(--shadow-subtle);
  padding: 26px 26px 28px;
}

.plan.pro {
  border-color: var(--accent);
  box-shadow: var(--shadow-lifted);
}

.plan h3 {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 600;
  margin: 0 0 4px;
}

.plan .tag {
  font-size: 13.5px;
  color: var(--ink-tertiary);
  margin: 0 0 18px;
}

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

.plan li {
  display: flex;
  gap: 10px;
  align-items: baseline;
  font-size: 15.5px;
  padding: 7px 0;
}

.plan li svg {
  flex: none;
  width: 14px;
  height: 14px;
  stroke: var(--accent-pressed);
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
  transform: translateY(1px);
}

.plan .muted {
  color: var(--ink-secondary);
}

.plan-note {
  font-size: 14px;
  color: var(--ink-tertiary);
  max-width: 60ch;
  margin: 18px 0 0;
}

/* ---------- Privacy band ---------- */

.privacy-band {
  margin-top: 72px;
  padding: 0 0 8px;
}

.privacy-band .sheet {
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: var(--radius-l);
  box-shadow: var(--shadow-subtle);
  padding: 44px 48px;
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  gap: 40px;
  align-items: center;
}

.privacy-band h2 {
  font-family: var(--font-display);
  font-size: clamp(28px, 3.2vw, 36px);
  font-weight: 600;
  line-height: 1.14;
  margin: 0;
}

.privacy-band p {
  color: var(--ink-secondary);
  margin: 0 0 12px;
}

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

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

.site-footer {
  margin-top: 84px;
  border-top: 1px solid var(--border);
  padding: 30px 0 44px;
}

.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
}

.site-footer .fine {
  font-size: 14px;
  color: var(--ink-tertiary);
}

.site-footer nav {
  display: flex;
  gap: 20px;
  font-size: 14px;
}

/* ---------- Cookie consent banner ---------- */

.cookie-banner {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 50;
  display: flex;
  justify-content: center;
  padding: 16px;
}

.cookie-banner:focus {
  outline: none;
}

.cookie-banner-inner {
  width: 100%;
  max-width: var(--page-max);
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 18px 24px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-l);
  box-shadow: var(--shadow-lifted);
  padding: 16px 20px;
}

.cookie-banner-text {
  flex: 1 1 320px;
  margin: 0;
  font-size: 14.5px;
  line-height: 1.5;
  color: var(--ink-secondary);
}

.cookie-banner-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 10px;
}

.cookie-btn {
  min-height: 44px;
  padding: 10px 22px;
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 600;
  border-radius: var(--radius-m);
  border: 1px solid transparent;
  cursor: pointer;
}

.cookie-btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fffdf7;
}

.cookie-btn-primary:hover {
  background: var(--accent-pressed);
  border-color: var(--accent-pressed);
}

.cookie-btn-ghost {
  background: transparent;
  border-color: var(--border-strong);
  color: var(--ink);
}

.cookie-btn-ghost:hover {
  background: var(--surface-muted);
}

.cookie-btn:active {
  transform: translateY(1px);
}

.cookie-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

@media (prefers-reduced-motion: no-preference) {
  .cookie-banner {
    animation: cookie-rise 0.3s ease-out;
  }

  @keyframes cookie-rise {
    from {
      transform: translateY(14px);
      opacity: 0;
    }
  }
}

@media (max-width: 640px) {
  .cookie-banner {
    padding: 10px;
  }

  .cookie-banner-inner {
    padding: 14px 16px;
    gap: 14px;
  }

  .cookie-banner-actions {
    flex: 1 1 100%;
  }

  .cookie-btn {
    flex: 1;
  }
}

/* Footer control that behaves like a link but triggers JS (cookie settings). */
.footer-link-button {
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--accent-pressed);
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  text-decoration: underline;
  text-decoration-color: var(--border-strong);
  text-underline-offset: 3px;
}

.footer-link-button:hover {
  color: var(--ink);
}

/* ---------- Legal pages (terms / privacy) ---------- */

.prose {
  max-width: calc(var(--measure) + 48px);
  margin: 0 auto;
  padding: 40px 24px 24px;
}

.prose h1 {
  font-family: var(--font-display);
  font-size: clamp(34px, 4vw, 44px);
  font-weight: 600;
  line-height: 1.1;
  margin: 0 0 8px;
}

.prose .updated {
  font-size: 14px;
  color: var(--ink-tertiary);
  margin: 0 0 32px;
}

.prose h2 {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 600;
  margin: 40px 0 10px;
}

.prose h2:first-of-type {
  margin-top: 24px;
}

.prose h3 {
  font-family: var(--font-body);
  font-size: 17px;
  font-weight: 600;
  margin: 26px 0 6px;
}

.prose p,
.prose li {
  color: #3a362f;
}

.prose p {
  margin: 0 0 16px;
}

.prose .lead {
  font-size: 19px;
  color: var(--ink-secondary);
  margin-bottom: 28px;
}

.prose ul {
  margin: 0 0 16px;
  padding-left: 22px;
}

.prose li {
  margin-bottom: 8px;
}

.prose li::marker {
  color: var(--border-strong);
}

.prose strong {
  font-weight: 600;
  color: var(--ink);
}

.prose hr {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 40px 0;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-secondary);
  text-decoration: none;
  margin-bottom: 28px;
}

.back-link:hover {
  color: var(--ink);
}

.back-link::before {
  content: "\2190";
}

/* Processor disclosure table. */
.data-table {
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 20px;
  font-size: 15px;
}

.data-table th,
.data-table td {
  text-align: left;
  vertical-align: top;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
}

.data-table th {
  font-family: var(--font-body);
  font-weight: 600;
  color: var(--ink);
  border-bottom: 1.5px solid var(--border-strong);
  font-size: 13px;
  letter-spacing: 0.02em;
}

.data-table td {
  color: #3a362f;
}

.table-scroll {
  overflow-x: auto;
  margin: 0 0 20px;
}

.table-scroll .data-table {
  margin-bottom: 0;
  min-width: 520px;
}

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

@media (max-width: 980px) {
  .hero .wrap {
    grid-template-columns: 1fr;
    gap: 48px;
  }

  .desk {
    max-width: 560px;
    margin: 0 auto;
    padding-inline: 40px;
  }

  .margin-note {
    left: -30px;
  }

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

  .feature-lead {
    grid-column: 1 / -1;
    grid-row: auto;
  }

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

  .desk-band .cols,
  .privacy-band .sheet {
    grid-template-columns: 1fr;
    gap: 24px;
  }
}

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

  .site-nav {
    gap: 16px;
  }

  /* The hero's own waitlist form sits directly under the header on phones,
     and the section anchors are one thumb-scroll away: keep only the wordmark
     and the language menu so the header can never overflow the viewport. */
  .site-nav .nav-link,
  .site-nav .btn-small {
    display: none;
  }

  .wordmark {
    font-size: 22px;
    gap: 8px;
  }

  .wordmark .logo {
    height: 34px;
  }

  .hero {
    padding-top: 36px;
  }

  .feature-grid,
  .plans,
  .spec-groups {
    grid-template-columns: 1fr;
  }

  .feature-lead {
    padding: 22px 20px 18px;
  }

  .desk {
    padding-inline: 8px;
  }

  .page-sheet {
    padding: 22px 20px 20px;
  }

  .margin-note {
    display: none;
  }

  .surah-line .juz {
    display: none;
  }

  .sticky {
    top: -14px;
    right: -6px;
    bottom: auto;
  }

  .privacy-band .sheet {
    padding: 30px 24px;
  }
}

/* ---------- Verse band (Ṣād 38:29 — the license for slow, annotated study) ---------- */

.verse-band {
  padding: 64px 0 4px;
  text-align: center;
}

.verse-arabic {
  font-family: var(--font-arabic);
  font-size: clamp(26px, 4vw, 38px);
  line-height: 2;
  color: var(--ink);
  max-width: 26em;
  margin: 0 auto;
  text-wrap: balance;
}

.verse-translation {
  font-family: var(--font-display);
  font-style: italic;
  font-size: clamp(17px, 2vw, 20px);
  line-height: 1.6;
  color: var(--ink-secondary);
  max-width: 52ch;
  margin: 18px auto 0;
  text-wrap: balance;
}

.verse-ref {
  font-size: 13.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-tertiary);
  margin: 14px 0 0;
}

/* ---------- Script specimens ---------- */

.script-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
}

.script-card {
  display: flex;
  flex-direction: column;
  margin: 0;
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: var(--radius-m);
  box-shadow: var(--shadow-subtle);
  padding: 26px 18px 18px;
  text-align: center;
}

/* The samples wrap to different line counts per face; centering the sample in
   a stretchable slot keeps all four captions on one shared baseline row. */
.script-sample {
  flex: 1;
  display: grid;
  place-items: center;
  margin: 0;
  font-size: 27px;
  line-height: 2.1;
  color: var(--ink);
}

.script-naskh { font-family: "Noto Naskh Arabic", serif; }
.script-amiri { font-family: "Amiri Quran", "Noto Naskh Arabic", serif; }
.script-scheherazade { font-family: "Scheherazade New", "Noto Naskh Arabic", serif; font-size: 29px; }
.script-lateef { font-family: "Lateef", "Noto Naskh Arabic", serif; font-size: 30px; }

.script-card figcaption {
  margin-top: 12px;
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-tertiary);
}

@media (max-width: 900px) {
  .script-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* ---------- Three promises, in ink ---------- */

.promises {
  margin-top: 72px;
}

/* Open band, not another card: the sheets around it (plans, privacy, letter)
   already carry the paper texture, so the promises sit directly on the canvas
   anchored by a single hairline. */
.promise-sheet {
  position: relative;
  border-top: 1px solid var(--border);
  padding: 44px 0 8px;
}

.promise-sheet h2 {
  font-family: var(--font-display);
  font-size: clamp(28px, 3.2vw, 36px);
  font-weight: 600;
  line-height: 1.14;
  margin: 0 0 20px;
  max-width: 14em;
}

.promise-sheet ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 14px;
  max-width: 58ch;
}

.promise-sheet li {
  color: var(--ink-secondary);
  padding-left: 22px;
  position: relative;
}

.promise-sheet li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.6em;
  width: 10px;
  height: 3px;
  border-radius: 2px;
  background: var(--accent);
  transform: rotate(-4deg);
}

.promise-sheet li strong {
  color: var(--ink);
}

.promise-seal {
  position: absolute;
  top: 40px;
  right: 0;
  width: 96px;
  height: 96px;
  transform: rotate(8deg);
}

.promise-seal path {
  fill: none;
  stroke: var(--accent);
  stroke-width: 2.4;
  stroke-linecap: round;
}

.promise-seal text {
  font-family: var(--font-arabic);
  font-size: 24px;
  fill: var(--accent);
  text-anchor: middle;
}

/* The seal draws itself in as it scrolls into view; otherwise it is simply present. */
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .promise-seal path {
      stroke-dasharray: 1;
      animation: draw 1ms linear both;
      animation-timeline: view();
      animation-range: entry 40% entry 90%;
    }
  }
}

@media (max-width: 720px) {
  .promise-sheet {
    padding: 92px 0 8px;
  }

  .promise-seal {
    top: 28px;
    right: 0;
  }
}

/* ---------- A letter from the team ---------- */

.letter-band {
  margin-top: 72px;
}

.letter-sheet {
  background: var(--surface-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius-l);
  padding: 44px 48px;
  max-width: 720px;
  margin: 0 auto;
}

.letter-salaam {
  font-family: var(--font-arabic);
  font-size: 24px;
  line-height: 1.9;
  color: var(--ink);
  margin: 0 0 18px;
}

.letter-sheet p {
  color: var(--ink-secondary);
  margin: 0 0 14px;
  max-width: 62ch;
}

.letter-sign {
  font-family: var(--font-hand);
  font-size: 24px;
  color: var(--ink);
  margin-top: 22px;
}

@media (max-width: 720px) {
  .letter-sheet {
    padding: 32px 26px;
  }
}

/* ---------- Manuscript illumination layer ----------
   Antique gold is the historically literal tone of mushaf illumination
   (gold-leaf ruled frames, shamsa medallions, corner finials). It is an
   ornament-only material: rules, stars, diamonds, and the seal. It never
   colors text, buttons, or interactive states; olive remains the single
   interactive accent. */

:root {
  --gild: #a8894e;
  --gild-soft: #c4ab7a;
  --gild-faint: rgba(168, 137, 78, 0.36);
}

/* Illuminated frame: outer gold rule, inset inner rule, corner finials.
   Mirrors the app's own page chrome (outer border + inset rule). */
.illuminated {
  position: relative;
  background: var(--paper);
  border: 1px solid var(--gild-soft);
  border-radius: 3px;
}

.illuminated::before {
  content: "";
  position: absolute;
  inset: 9px;
  border: 1px solid var(--gild-faint);
  pointer-events: none;
}

.illuminated::after {
  content: "";
  position: absolute;
  inset: -5px;
  background-image: url(ornament-diamond.svg), url(ornament-diamond.svg), url(ornament-diamond.svg), url(ornament-diamond.svg);
  background-position: left top, right top, left bottom, right bottom;
  background-repeat: no-repeat;
  pointer-events: none;
}

.verse-panel {
  max-width: 780px;
  margin: 0 auto;
  padding: 52px 48px 40px;
}

.frame-medallion {
  position: absolute;
  top: -14px;
  left: 50%;
  width: 28px;
  height: 28px;
  transform: translateX(-50%);
  fill: var(--paper);
  stroke: var(--gild);
  stroke-width: 1.4;
}

@media (max-width: 720px) {
  .verse-panel {
    padding: 44px 22px 30px;
  }
}

/* Star medallion dividers between the page's major movements. */
.ornament-divider {
  display: flex;
  align-items: center;
  gap: 16px;
  max-width: 340px;
  margin: 0 auto 56px;
}

.ornament-divider::before,
.ornament-divider::after {
  content: "";
  height: 1px;
  flex: 1;
}

.ornament-divider::before {
  background: linear-gradient(to right, transparent, var(--gild-faint));
}

.ornament-divider::after {
  background: linear-gradient(to left, transparent, var(--gild-faint));
}

.ornament-divider svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: var(--gild);
  stroke-width: 1.5;
}

/* The stylus band carries the girih star-and-cross lattice, barely above
   the paper: heritage as texture, not wallpaper. */
.desk-band {
  background-image: url(ornament-girih.svg);
}

/* The seal is gold wax now, star and all. */
.promise-seal path {
  stroke: var(--gild);
}

.promise-seal .seal-star {
  stroke-width: 1.4;
  opacity: 0.55;
}

.promise-seal text {
  fill: var(--gild);
}

/* ---------- Transliteration lines ----------
   Corpus-sourced romanization (same word-by-word corpus as the app; never
   hand-transliterated). Small sans, tertiary: it reads as a study aid between
   the Arabic and the display-italic translation, not as a competing voice. */

.verse-transliteration {
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.6;
  color: var(--ink-tertiary);
  max-width: 58ch;
  margin: 14px auto 0;
  text-wrap: balance;
}

.script-transliteration {
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--ink-tertiary);
  text-align: match-parent;
  max-width: 56ch;
  margin: 8px 0 0;
}

.desk .translit {
  font-size: 11.5px;
  line-height: 1.5;
  color: var(--ink-tertiary);
  margin: 10px 0 4px;
}

.letter-salaam-latin {
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--ink-tertiary);
  margin: -12px 0 18px;
}

/* ---------- Language switcher ---------- */

.lang-menu {
  position: relative;
}

.lang-menu summary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  list-style: none;
  cursor: pointer;
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--ink-secondary);
  padding: 6px 8px;
  border-radius: var(--radius-s);
}

.lang-menu summary::-webkit-details-marker {
  display: none;
}

.lang-menu summary:hover {
  color: var(--ink);
  background: var(--accent-faint);
}

.lang-menu summary svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
}

.lang-menu ul {
  position: absolute;
  top: calc(100% + 8px);
  inset-inline-end: 0;
  z-index: 40;
  margin: 0;
  padding: 6px;
  list-style: none;
  min-width: 176px;
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: var(--radius-m);
  box-shadow: var(--shadow-lifted);
}

.lang-menu ul a {
  display: block;
  padding: 8px 12px;
  border-radius: var(--radius-s);
  font-size: 14.5px;
  color: var(--ink-secondary);
  text-decoration: none;
}

.lang-menu ul a:hover {
  background: var(--accent-faint);
  color: var(--ink);
}

.lang-menu ul a[aria-current="true"] {
  color: var(--accent-pressed);
  font-weight: 600;
}

.footer-langs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 18px;
  margin-top: 14px;
  font-size: 14px;
}

.footer-langs a {
  color: var(--ink-tertiary);
  text-decoration: none;
}

.footer-langs a:hover {
  color: var(--ink);
}

.footer-langs a[aria-current="true"] {
  color: var(--accent-pressed);
  font-weight: 600;
}

/* ---------- RTL (ar, ur, fa) ----------
   Flex rows and grid tracks mirror automatically under dir="rtl"; these
   overrides cover the physical-property remainders. The desk vignette and
   the screenshot ink-frame stay LTR: they are product art whose absolute
   positions and baked coordinates must not mirror. */

[dir="rtl"] .desk {
  direction: ltr;
}

[dir="rtl"] .u-ink svg {
  left: auto;
  right: -2%;
}

[dir="rtl"] .promise-sheet li {
  padding-left: 0;
  padding-right: 22px;
}

[dir="rtl"] .promise-sheet li::before {
  left: auto;
  right: 0;
  transform: rotate(4deg);
}

[dir="rtl"] .promise-seal {
  right: auto;
  left: 0;
  transform: rotate(-8deg);
}

/* Arabic script must never be letter-spaced: tracking breaks glyph joining.
   Kill tracking on every tracked label whose content is translated. */
[dir="rtl"] .plan .tag,
[dir="rtl"] .site-nav a,
[dir="rtl"] .lang-menu summary {
  letter-spacing: 0;
}

/* ---------- Per-script typography ----------
   Every hosted face is unicode-ranged, so stack composition does the script
   switching: Latin runs keep the brand faces, Arabic-script runs fall
   through to Naskh, Bengali to Noto Sans Bengali. */

html:lang(ar),
html:lang(ur),
html:lang(fa) {
  --font-display: "Noto Naskh Arabic Display", "Cormorant Garamond", "Noto Naskh Arabic", "Geeza Pro", serif;
  --font-body: "Source Sans 3", "Noto Naskh Arabic", "Geeza Pro", sans-serif;
  --font-hand: "Noto Naskh Arabic", "Geeza Pro", cursive;
}

html:lang(ar) body,
html:lang(ur) body,
html:lang(fa) body {
  line-height: 1.8;
}

html:lang(bn) {
  --font-display: "Cormorant Garamond", "Noto Sans Bengali", serif;
  --font-body: "Source Sans 3", "Noto Sans Bengali", sans-serif;
  --font-hand: "Noto Sans Bengali", cursive;
}

html:lang(bn) body {
  line-height: 1.75;
}
