/* QuranXT site, "Product" design: white and light-gray sections, one emerald accent. */
:root {
  --ink: #0d1614;
  --muted: #4a5551;
  --rule: #e1e6e4;
  --white: #fff;
  --gray: #f3f5f4;
  --accent: #047857;
  --accent-strong: #065f46;
  --accent-soft: #e6f5ee;
  --accent-bright: #34d399;
  --accent-ink: #fff;
  --dark: #0b1a16;
  --dark-2: #12261f;
  --warn: #8a3f00;
  --warn-bg: #fff6e8;
  --warn-rule: #f3d3a4;
  --radius: 18px;
  --nav-h: 64px;
  --shadow-sm: 0 1px 2px rgba(13, 22, 20, 0.06), 0 2px 8px rgba(13, 22, 20, 0.04);
  --shadow-lg: 0 2px 4px rgba(13, 22, 20, 0.04), 0 24px 48px -16px rgba(6, 60, 45, 0.22);
  --esp-tools-button-color: var(--accent);
  --esp-tools-button-text-color: var(--accent-ink);
  --esp-tools-button-border-radius: 12px;
  color-scheme: light;  /* light only, whatever the system or browser prefers */
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

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

body {
  margin: 0;
  background: var(--white);
  color: var(--ink);
  font: 17px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.wrap { max-width: 1180px; margin: 0 auto; padding: 0 28px; }

a { color: var(--accent); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: var(--accent-strong); text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

code, pre { font-family: ui-monospace, "SFMono-Regular", "Cascadia Mono", Menlo, Consolas, monospace; font-size: 0.86em; }
code { background: rgba(4, 120, 87, 0.06); border: 1px solid rgba(4, 120, 87, 0.2); border-radius: 6px; padding: 1px 6px; white-space: nowrap; color: var(--ink); }

h1, h2, h3 { line-height: 1.12; color: var(--ink); }
h1 { font-weight: 800; letter-spacing: -0.035em; }
h2 { font-size: clamp(2rem, 1.4rem + 2.2vw, 2.9rem); font-weight: 800; letter-spacing: -0.03em; margin: 0 0 16px; }
h3 { font-size: 1.2rem; font-weight: 700; letter-spacing: -0.01em; margin: 0 0 8px; }

svg { flex: none; }

/* ---------- Navigation ---------- */
.topnav {
  position: sticky; top: 0; z-index: 20;
  background: rgba(255, 255, 255, 0.88);
  -webkit-backdrop-filter: saturate(1.6) blur(14px);
  backdrop-filter: saturate(1.6) blur(14px);
  border-bottom: 1px solid var(--rule);
}
.topnav .wrap { display: flex; align-items: center; justify-content: space-between; gap: 0 24px; min-height: var(--nav-h); }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.2rem; letter-spacing: -0.02em; color: var(--ink); text-decoration: none; }
.brand:hover { color: var(--ink); }
.brand .logo { width: 28px; height: 28px; color: var(--accent); }
.topnav .links { display: flex; gap: 4px; }
.topnav .links a {
  position: relative; color: var(--muted); text-decoration: none; font-weight: 600; font-size: 0.95rem;
  padding: 8px 14px; border-radius: 999px; white-space: nowrap;
}
.topnav .links a:hover { color: var(--ink); background: var(--gray); }
.topnav .links a[aria-current="page"] { color: var(--accent-strong); background: var(--accent-soft); }
.topnav .links a.external { display: inline-flex; align-items: center; gap: 7px; }
.topnav .links .gh { width: 17px; height: 17px; }
section[id] { scroll-margin-top: calc(var(--nav-h) + 8px); }

/* ---------- Buttons ---------- */
.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  font: inherit; font-weight: 700; font-size: 1rem; line-height: 1.2;
  padding: 14px 24px; border-radius: 12px; border: 1.5px solid var(--accent);
  background: var(--accent); color: var(--accent-ink); text-decoration: none; cursor: pointer;
  box-shadow: 0 1px 2px rgba(6, 60, 45, 0.2), 0 8px 20px -8px rgba(4, 120, 87, 0.55);
  transition: background-color 0.15s, box-shadow 0.15s, transform 0.15s;
}
.button svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.button:hover { background: var(--accent-strong); border-color: var(--accent-strong); color: var(--accent-ink); text-decoration: none; transform: translateY(-1px); }
.button.ghost { background: var(--white); color: var(--ink); border-color: #cdd5d2; box-shadow: var(--shadow-sm); }
.button.ghost:hover { border-color: var(--ink); background: var(--white); color: var(--ink); }
.button:disabled { background: #e6ebe9; border-color: #d3dbd8; color: #5f6b67; box-shadow: none; cursor: not-allowed; transform: none; }

/* ---------- Hero ---------- */
.hero {
  position: relative; overflow: hidden;
  background:
    radial-gradient(900px 480px at 85% 30%, rgba(52, 211, 153, 0.16), transparent 70%),
    linear-gradient(180deg, #fff 0%, #f7f9f8 100%);
  border-bottom: 1px solid var(--rule);
}
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr); align-items: center; gap: 48px; padding-top: 72px; padding-bottom: 80px; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 10px; margin: 0;
  padding: 6px 14px 6px 10px; border: 1px solid #bfe5d3; border-radius: 999px; background: var(--accent-soft);
  color: var(--accent-strong); font-size: 0.88rem; font-weight: 700;
}
.pulse { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px rgba(4, 120, 87, 0.18); }
.hero h1 { font-size: clamp(3.4rem, 2rem + 6vw, 6.4rem); margin: 22px 0 18px; line-height: 0.95; }
.hero h1 span { color: var(--accent); }
.lead { font-size: 1.22rem; line-height: 1.55; max-width: 600px; color: var(--muted); margin: 0 0 32px; }
.actions { display: flex; gap: 12px; flex-wrap: wrap; margin: 0; }
.hero-alt { margin: 22px 0 0; }
.hero-alt a { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; text-decoration: none; }
.hero-alt a:hover { text-decoration: underline; }
.hero-alt svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transition: transform 0.15s; }
.hero-alt a:hover svg { transform: translateX(3px); }

/* The X4 drawn around a screenshot. */
.device-stage { position: relative; margin: 0; display: grid; justify-items: center; gap: 22px; }
.device-stage::before {
  content: ""; position: absolute; left: 50%; top: 46%; width: 118%; aspect-ratio: 1; transform: translate(-50%, -50%);
  background:
    radial-gradient(closest-side, rgba(52, 211, 153, 0.42), rgba(52, 211, 153, 0.12) 60%, transparent),
    repeating-radial-gradient(circle, transparent 0 38px, rgba(4, 120, 87, 0.10) 38px 39px);
  border-radius: 50%;
  -webkit-mask: radial-gradient(closest-side, #000 70%, transparent);
  mask: radial-gradient(closest-side, #000 70%, transparent);
}
.device {
  position: relative; width: min(330px, 74vw);
  padding: 16px 16px 62px; border-radius: 30px;
  background: linear-gradient(155deg, #fbfcfc 0%, #eef1f0 55%, #e2e7e5 100%);
  box-shadow:
    0 0 0 1px #cfd7d4,
    inset 0 1px 0 #fff,
    inset 0 -3px 8px rgba(0, 0, 0, 0.06),
    0 50px 90px -40px rgba(6, 60, 45, 0.55),
    0 22px 40px -22px rgba(0, 0, 0, 0.35);
  transform: rotate(-2deg);
}
/* side keys and the power key */
.device::before { content: ""; position: absolute; right: -5px; top: 96px; width: 5px; height: 84px; border-radius: 0 4px 4px 0; background: linear-gradient(#d6dcda, #c3cbc8); box-shadow: 0 -0 0 1px #c3cbc8; }
.device::after { content: ""; position: absolute; top: -5px; right: 54px; width: 48px; height: 5px; border-radius: 4px 4px 0 0; background: linear-gradient(90deg, #d6dcda, #c3cbc8); }
.device .screen { position: relative; border-radius: 6px; overflow: hidden; background: #fbfbf8; box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.14), inset 0 2px 6px rgba(0, 0, 0, 0.12); }
.device .screen::after { content: ""; position: absolute; inset: 0; background: linear-gradient(125deg, rgba(255, 255, 255, 0.28) 0%, rgba(255, 255, 255, 0) 38%); pointer-events: none; }
.device img { display: block; width: 100%; height: auto; }
.device-keys { position: absolute; left: 50%; bottom: 23px; transform: translateX(-50%); display: flex; gap: 10px; }
.device-keys i { display: block; width: 38px; height: 9px; border-radius: 5px; background: linear-gradient(#d9dfdd, #cbd2cf); box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.16), 0 1px 0 #fff; }
.device-stage figcaption {
  position: relative; font-size: 0.85rem; font-weight: 700; color: var(--muted);
  background: var(--white); border: 1px solid var(--rule); border-radius: 999px; padding: 4px 14px; box-shadow: var(--shadow-sm);
}

/* ---------- Sections ---------- */
.section { padding: 96px 0; }
.section.alt { background: var(--gray); border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.section + .section.alt, .section.alt + .section { border-top: 0; }
.section-head { margin-bottom: 44px; }
.section-head h2::before { content: ""; display: block; width: 44px; height: 5px; border-radius: 3px; background: var(--accent); margin-bottom: 20px; }
.kicker { margin: 0 0 12px; font-size: 0.85rem; font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent); }

.icon {
  display: inline-grid; place-items: center; flex: none; width: 48px; height: 48px; border-radius: 14px;
  background: var(--accent-soft); color: var(--accent); box-shadow: inset 0 0 0 1px #c9eadb;
}
.icon svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* Screens gallery */
.shots .section-head { margin-bottom: 36px; }
.gallery { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 32px; }
.gallery:focus-visible { outline-offset: 8px; }
.gallery figure { margin: 0; text-align: center; }
.mini {
  max-width: 240px; margin: 0 auto; padding: 9px 9px 28px; border-radius: 18px; position: relative;
  background: linear-gradient(155deg, #fff, #e9edec);
  box-shadow: 0 0 0 1px #d3dbd8, inset 0 1px 0 #fff, 0 26px 40px -24px rgba(6, 60, 45, 0.45);
  transition: transform 0.2s;
}
.mini::after { content: ""; position: absolute; left: 50%; bottom: 11px; width: 64px; height: 5px; margin-left: -32px; border-radius: 3px; background: #cdd5d2; }
.mini img { display: block; width: 100%; height: auto; border-radius: 4px; box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.12); background: #fbfbf8; }
.gallery figure:hover .mini { transform: translateY(-4px); }
.gallery figcaption { color: var(--ink); font-weight: 650; font-size: 0.95rem; margin-top: 16px; }

/* Features */
.features { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.features article {
  background: var(--white); border: 1px solid var(--rule); border-radius: var(--radius); padding: 30px 28px;
  box-shadow: var(--shadow-sm); transition: box-shadow 0.2s, transform 0.2s, border-color 0.2s;
}
.features article:hover { box-shadow: var(--shadow-lg); border-color: #cfe3da; transform: translateY(-2px); }
.features .icon { margin-bottom: 22px; }
.features h3 { font-size: 1.25rem; margin-bottom: 10px; }
.features p { margin: 0; color: var(--muted); font-size: 0.97rem; }
.features b { color: var(--ink); }

/* Install timeline */
.timeline { list-style: none; margin: 0; padding: 0; counter-reset: step; }
.timeline > li { position: relative; counter-increment: step; padding: 0 0 56px 84px; }
.timeline > li:last-child { padding-bottom: 0; }
.timeline > li::before {
  content: counter(step); position: absolute; left: 0; top: -6px;
  width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center;
  background: var(--accent); color: #fff; font-weight: 800; font-size: 1.3rem;
  box-shadow: 0 0 0 6px var(--gray), 0 0 0 7px #c9eadb;
}
.timeline > li::after { content: ""; position: absolute; left: 25px; top: 58px; bottom: 6px; width: 2px; background: linear-gradient(var(--accent-bright), #cfe3da); border-radius: 1px; }
.timeline > li:last-child::after { display: none; }
.timeline h3 { font-size: 1.5rem; letter-spacing: -0.02em; margin: 4px 0 14px; }
.timeline p { margin: 0 0 16px; max-width: 760px; }
.step-split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 440px); gap: 36px; align-items: start; }
.step-split > p { margin: 0; font-size: 1.05rem; }

.flash {
  position: relative; background: var(--white); border-radius: 22px; padding: 26px 28px 24px;
  border: 1px solid #bfe5d3; box-shadow: var(--shadow-lg), 0 0 0 5px rgba(52, 211, 153, 0.12);
}
.flash-head { display: flex; align-items: center; gap: 12px; margin: 0 0 18px; font-weight: 800; font-size: 1.05rem; letter-spacing: -0.01em; }
.flash-head .icon { width: 40px; height: 40px; border-radius: 12px; }
.flash-head .icon svg { width: 22px; height: 22px; }
.flash esp-web-install-button { display: block; }
.flash esp-web-install-button .button { width: 100%; font-size: 1.1rem; padding: 17px 24px; }
.flash .small { margin: 16px 0 0; }
.note { display: block; color: var(--warn); font-weight: 700; background: var(--warn-bg); border: 1px solid var(--warn-rule); border-radius: 12px; padding: 12px 14px; }
.small { font-size: 0.9rem; color: var(--muted); margin: 12px 0 0; }
.small a, .flash .small a { overflow-wrap: anywhere; }

.warns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 28px; }
.warn {
  margin: 0; padding: 16px 18px 16px 50px; border-radius: 14px; position: relative;
  background: var(--warn-bg); border: 1px solid var(--warn-rule); color: #4a3a2a; font-size: 0.93rem; max-width: none !important;
}
.warn::before {
  content: "!"; position: absolute; left: 16px; top: 16px; width: 22px; height: 22px; border-radius: 50%;
  display: grid; place-items: center; background: #b45309; color: #fff; font-weight: 800; font-size: 0.8rem; line-height: 1;
}
.warn b { color: var(--warn); }
.warn a { color: var(--warn); }

.tree {
  background: var(--dark); color: #d6efe4; border-radius: 16px; padding: 22px 24px; margin: 4px 0 18px;
  line-height: 1.6; overflow-x: auto; max-width: 760px; box-shadow: var(--shadow-lg);
}

/* Dark band */
.band {
  position: relative; overflow: hidden; color: #cfe0d9;
  background:
    radial-gradient(700px 400px at 90% 110%, rgba(52, 211, 153, 0.22), transparent 70%),
    radial-gradient(500px 300px at 0% 0%, rgba(52, 211, 153, 0.08), transparent 70%),
    var(--dark);
  padding: 100px 0;
}
.band-grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr); gap: 56px; align-items: center; }
.band h2 { color: #fff; font-size: clamp(2.1rem, 1.4rem + 2.6vw, 3.3rem); }
.band p { font-size: 1.12rem; max-width: 620px; margin: 0 0 30px; }
.band .kicker { color: var(--accent-bright); margin-bottom: 16px; }
.band a:not(.button) { color: var(--accent-bright); }
.band :focus-visible { outline-color: var(--accent-bright); }
.button.bright { background: var(--accent-bright); border-color: var(--accent-bright); color: #052e22; box-shadow: 0 10px 30px -10px rgba(52, 211, 153, 0.6); }
.button.bright:hover { background: #6ee7b7; border-color: #6ee7b7; color: #052e22; }
.band-art { position: relative; height: 340px; }
.book {
  position: absolute; width: 170px; padding: 7px 7px 22px; border-radius: 16px;
  background: linear-gradient(155deg, #26392f, #12201b); box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08), 0 30px 50px -20px rgba(0, 0, 0, 0.7);
}
.book img { display: block; width: 100%; height: auto; border-radius: 4px; opacity: 0.94; }
.book.b1 { left: 8%; top: 20px; transform: rotate(-8deg); }
.book.b2 { left: 42%; top: 0; transform: rotate(5deg); }
.badge {
  position: absolute; left: 30%; bottom: 0; padding: 8px 16px; border-radius: 999px;
  background: var(--accent-bright); color: #052e22; font: 800 1rem/1 ui-monospace, Menlo, Consolas, monospace; letter-spacing: 0.02em;
  box-shadow: 0 10px 30px -8px rgba(52, 211, 153, 0.7);
}

/* Using it + more */
.cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.panel { background: var(--white); border: 1px solid var(--rule); border-radius: var(--radius); padding: 28px; box-shadow: var(--shadow-sm); }
.panel.wide { grid-column: 1 / -1; }
.panel > p + .keys { margin-top: 12px; }
.panel > h3 { display: flex; align-items: center; gap: 14px; font-size: 1.3rem; margin-bottom: 16px; }
.panel > h3 .icon { width: 40px; height: 40px; border-radius: 12px; }
.panel > h3 .icon svg { width: 21px; height: 21px; }
.panel p { margin: 0; color: var(--muted); }
.panel code { color: var(--ink); white-space: normal; overflow-wrap: anywhere; }

table { border-collapse: collapse; width: 100%; }
th, td { text-align: left; vertical-align: top; }
.keys td { padding: 12px 0; border-top: 1px solid var(--rule); color: var(--muted); }
.keys tr:first-child td { border-top: 0; }
.keys td:first-child { width: 38%; padding-right: 16px; }
.panel.wide .keys td:first-child { width: 26%; }
.panel kbd {
  display: inline-block; white-space: nowrap; font-family: inherit; font-weight: 700; font-size: 0.84rem; line-height: 1.3; color: var(--ink);
  padding: 4px 10px; border-radius: 8px; background: linear-gradient(#fff, #f1f4f3);
  border: 1px solid #cdd5d2; box-shadow: 0 2px 0 #cdd5d2;
}

/* Footer */
.site-footer { background: var(--white); border-top: 1px solid var(--rule); padding: 48px 0 56px; color: var(--muted); font-size: 0.86rem; }
.section.alt + .site-footer, main + .site-footer { margin-top: 0; }
.site-footer .wrap { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 24px; align-items: start; }
.site-footer p { margin: 0; max-width: 820px; }

/* ---------- Sub-pages (card, xtch) ---------- */
.hero.compact .wrap { padding-top: 60px; padding-bottom: 56px; }
.hero.compact h1 { font-size: clamp(2.4rem, 1.6rem + 3.4vw, 4rem); margin: 20px 0 14px; line-height: 1.02; }
.hero.compact .lead { margin: 0; max-width: 700px; }

/* Card maker */
.maker { padding-top: 48px; padding-bottom: 96px; }
.maker form { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 24px 32px; align-items: start; counter-reset: part; }
.maker fieldset {
  grid-column: 1; margin: 0; min-width: 0; counter-increment: part;
  background: var(--white); border: 1px solid var(--rule); border-radius: var(--radius); padding: 26px 28px 28px; box-shadow: var(--shadow-sm);
}
.maker legend { float: left; width: 100%; padding: 0; display: flex; align-items: center; flex-wrap: wrap; gap: 6px 12px; font-size: 1.3rem; font-weight: 800; letter-spacing: -0.02em; }
.maker legend::before {
  content: counter(part); display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%;
  background: var(--accent); color: #fff; font-size: 0.95rem; font-weight: 800; letter-spacing: 0;
}
.maker legend + * { clear: both; }
.maker .count:not(:empty) { font-size: 0.82rem; font-weight: 700; letter-spacing: 0; color: var(--accent-strong); background: var(--accent-soft); border-radius: 999px; padding: 3px 10px; }
.maker fieldset > .small { margin: 10px 0 18px; padding-top: 0; }

.choices { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.choices label {
  display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; cursor: pointer;
  background: var(--white); border: 1.5px solid var(--rule); border-radius: 12px; color: var(--muted); font-size: 0.9rem; line-height: 1.4;
  transition: border-color 0.12s, background-color 0.12s;
}
.choices label:hover { border-color: #a7d8c2; }
.choices label:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.choices label:has(input:focus-visible) { outline: 3px solid var(--accent); outline-offset: 2px; }
.choices label:has(input:disabled) { cursor: not-allowed; background: var(--gray); border-color: var(--rule); }
.choices label[hidden] { display: none; }
.choices input { flex: none; width: 18px; height: 18px; margin: 1px 0 0; accent-color: var(--accent); cursor: inherit; }
.choices input:focus-visible { outline: none; }
.choices label b { display: block; color: var(--ink); font-weight: 700; font-size: 0.97rem; }
.choices input:disabled + span { opacity: 0.5; }
.choices.list { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); max-height: 30rem; overflow-y: auto; padding: 4px; margin: -4px; scrollbar-width: thin; }
#sizes { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
#languages { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }

.search { position: relative; margin: 0 0 14px; }
.search svg { position: absolute; left: 14px; top: 50%; width: 20px; height: 20px; transform: translateY(-50%); fill: none; stroke: var(--muted); stroke-width: 2; stroke-linecap: round; pointer-events: none; }
.maker input[type="search"] {
  font: inherit; width: 100%; padding: 12px 14px 12px 44px; border: 1.5px solid #cdd5d2; border-radius: 12px; background: var(--white); color: var(--ink);
}
.maker input[type="search"]:focus { border-color: var(--accent); outline: 3px solid rgba(4, 120, 87, 0.25); outline-offset: 0; }

.maker .flash { grid-column: 2; grid-row: 1 / span 4; position: sticky; top: calc(var(--nav-h) + 24px); }
.maker #summary { margin: 0 0 18px; font-weight: 700; font-size: 1.05rem; line-height: 1.45; }
.maker .flash .button { width: 100%; font-size: 1.08rem; padding: 16px 22px; }
.maker progress:not([hidden]) { display: block; width: 100%; height: 10px; margin-top: 16px; accent-color: var(--accent); }
.status { color: var(--muted); font-weight: 600; }
.status:empty { display: none; }
.maker > noscript .warn, .maker > .warn { margin-bottom: 24px; }

/* XTCH books */
.books { padding-top: 64px; padding-bottom: 96px; }
.books > section + section { margin-top: 80px; }
.books h2::before { content: ""; display: block; width: 44px; height: 5px; border-radius: 3px; background: var(--accent); margin-bottom: 20px; }
.books .intro { color: var(--muted); font-size: 1.08rem; max-width: 760px; margin: 0 0 28px; }

.howto { list-style: none; margin: 28px 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; counter-reset: how; }
.howto li {
  position: relative; counter-increment: how; padding: 26px 24px 24px; border-radius: var(--radius);
  background: var(--gray); border: 1px solid var(--rule); font-weight: 600; line-height: 1.5;
}
.howto .icon { display: grid; margin-bottom: 18px; background: var(--white); }
.howto li::after { content: "0" counter(how); position: absolute; top: 22px; right: 24px; font-weight: 800; font-size: 1.6rem; color: #c3cdc9; letter-spacing: -0.02em; }
.books .howto + .small { margin-top: 20px; }

/* Mushaf books as plan cards */
.plans, .plans tbody { display: block; }
.plans thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.plans tbody { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; margin-top: 28px; }
.plans tr {
  display: flex; flex-direction: column; padding: 30px; border-radius: 22px;
  background: var(--white); border: 1px solid var(--rule); box-shadow: var(--shadow-sm); transition: box-shadow 0.2s, border-color 0.2s;
}
.plans tr:hover { box-shadow: var(--shadow-lg); border-color: #bfe5d3; }
.plans td { display: block; padding: 0; border: 0; }
.plans .plan { flex: 1; }
.plans .plan .icon { display: grid; margin-bottom: 20px; }
.plans .plan b { display: block; font-size: 1.35rem; letter-spacing: -0.02em; line-height: 1.2; }
.plans .plan .desc { display: block; margin-top: 6px; color: var(--muted); }
.plans .plan .desc::first-letter { text-transform: uppercase; }
.plans .unzipped { order: 1; margin-top: 22px; padding: 12px 0; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); color: var(--ink); font-weight: 700; display: flex; justify-content: space-between; }
.plans .unzipped::before { content: "Unzipped"; color: var(--muted); font-weight: 500; }
.plans .get { order: 2; display: flex; flex-direction: column; gap: 16px; margin-top: 22px; }
.price { font-size: 2.4rem; font-weight: 800; letter-spacing: -0.03em; line-height: 1; }
.price small { font-size: 1rem; font-weight: 600; letter-spacing: 0; color: var(--muted); }
.plans .get .button { width: 100%; }

/* Translations: a pricing-style comparison table */
.table-card { border: 1px solid var(--rule); border-radius: var(--radius); overflow: clip; box-shadow: var(--shadow-sm); background: var(--white); }
.price-table th {
  position: sticky; top: var(--nav-h); z-index: 2; background: var(--gray);
  font-size: 0.78rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted);
  padding: 14px 20px; border-bottom: 1px solid var(--rule);
}
.price-table td { padding: 12px 20px; border-top: 1px solid var(--rule); vertical-align: middle; color: var(--muted); }
.price-table tbody tr:first-child td { border-top: 0; }
.price-table tbody tr:nth-child(even) td { background: #fafbfb; }
.price-table tbody tr:hover td { background: var(--accent-soft); }
.price-table td:first-child { width: 20%; }
.price-table td:first-child b { color: var(--ink); }
.price-table th:nth-child(3), .price-table td:nth-child(3) { white-space: nowrap; width: 1%; }
.price-table th:last-child, .price-table td:last-child { text-align: right; white-space: nowrap; width: 1%; font-variant-numeric: tabular-nums; color: var(--ink); font-weight: 600; }
.price-table td:nth-child(3) { font-variant-numeric: tabular-nums; font-size: 0.9rem; }
.price-table td:nth-child(3) a {
  display: inline-block; margin-right: 6px; padding: 6px 14px; border-radius: 999px; border: 1.5px solid var(--accent);
  font-size: 0.88rem; font-weight: 700; text-decoration: none; color: var(--accent);
}
.price-table td:nth-child(3) a:hover { background: var(--accent); color: #fff; }

/* ---------- Responsive ---------- */
@media (max-width: 1020px) {
  .features { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .step-split { grid-template-columns: 1fr; gap: 24px; }
  .step-split .flash { max-width: 520px; }
  .maker form { grid-template-columns: minmax(0, 1fr) 300px; }
}

@media (max-width: 860px) {
  .hero-grid { grid-template-columns: 1fr; gap: 40px; padding-top: 48px; padding-bottom: 64px; }
  .gallery {
    display: flex; overflow-x: auto; scroll-snap-type: x mandatory; gap: 20px;
    margin: 0 -28px; padding: 6px 28px 28px; scroll-padding: 0 28px; scrollbar-width: thin;
  }
  .gallery figure { flex: 0 0 210px; scroll-snap-align: start; }
  .band-grid { grid-template-columns: 1fr; }
  .band-art { height: 300px; max-width: 420px; }
  .warns, .cols { grid-template-columns: 1fr; }
  .maker form { grid-template-columns: 1fr; }
  .maker .flash { grid-column: 1; grid-row: auto; position: static; }
  .howto { grid-template-columns: 1fr; }
  .plans tbody { grid-template-columns: 1fr; }
  .site-footer .wrap { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  :root { --nav-h: 100px; }
  body { font-size: 16px; }
  .wrap { padding: 0 20px; }
  .topnav .wrap { flex-direction: column; align-items: stretch; justify-content: center; gap: 4px; padding-top: 10px; padding-bottom: 8px; }
  .topnav .links { overflow-x: auto; scrollbar-width: none; margin: 0 -20px; padding: 0 16px; gap: 2px; }
  .topnav .links::-webkit-scrollbar { display: none; }
  .topnav .links a { padding: 7px 11px; font-size: 0.9rem; }
  .section { padding: 64px 0; }
  .section-head { margin-bottom: 28px; }
  .hero-grid { padding-top: 36px; }
  .lead { font-size: 1.08rem; }
  .actions .button { flex: 1 1 auto; }
  .gallery { margin: 0 -20px; padding: 6px 20px 24px; scroll-padding: 0 20px; }
  .gallery figure { flex-basis: 64%; }
  .features { grid-template-columns: 1fr; gap: 16px; }
  .features article { padding: 24px 22px; }
  .timeline > li { padding: 0 0 48px 0; display: grid; grid-template-columns: 44px minmax(0, 1fr); column-gap: 14px; align-items: center; }
  .timeline > li > * { grid-column: 1 / -1; }
  .timeline > li::before { position: static; grid-column: 1; width: 44px; height: 44px; font-size: 1.1rem; box-shadow: 0 0 0 4px var(--gray), 0 0 0 5px #c9eadb; }
  .timeline > li > h3 { grid-column: 2; margin: 0; }
  .timeline > li > h3 + * { margin-top: 16px; }
  .timeline > li::after { display: none; }
  .timeline h3 { font-size: 1.3rem; }
  .flash { padding: 22px 20px 20px; }
  .tree { font-size: 0.75rem; padding: 18px; }
  .band { padding: 72px 0; }
  .band-art { height: 250px; }
  .book { width: 130px; }
  .panel { padding: 22px 20px; }
  .keys td:first-child { width: 1%; padding-right: 14px; }
  .panel.wide .keys td, .panel.wide .keys td:first-child { display: block; width: auto; padding-right: 0; }
  .panel.wide .keys td + td { border-top: 0; padding-top: 0; }
  .panel kbd { font-size: 0.8rem; padding: 3px 8px; }
  .hero.compact .wrap { padding-top: 40px; padding-bottom: 40px; }
  .maker { padding-top: 28px; padding-bottom: 64px; }
  .maker fieldset { padding: 20px 18px 22px; }
  #languages { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .choices label { padding: 11px 12px; }
  .howto { gap: 12px; }
  .howto li { display: flex; align-items: center; gap: 16px; padding: 16px 52px 16px 16px; }
  .howto .icon { margin: 0; }
  .howto li::after { top: 50%; right: 18px; transform: translateY(-50%); font-size: 1.2rem; }
  .books { padding-top: 40px; padding-bottom: 64px; }
  .books > section + section { margin-top: 56px; }
  .plans tr { padding: 24px 22px; }

  /* Translation rows become compact cards. */
  .price-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .price-table, .price-table tbody { display: block; }
  .price-table tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "lang get" "who get" "unz get"; column-gap: 12px; padding: 14px 16px; border-top: 1px solid var(--rule); }
  .price-table tbody tr:first-child { border-top: 0; }
  .price-table tbody tr:nth-child(even) { background: #fafbfb; }
  .price-table td { display: block; padding: 0; border: 0; background: none !important; width: auto !important; text-align: left !important; }
  .price-table td:nth-child(1) { grid-area: lang; }
  .price-table td:nth-child(2) { grid-area: who; font-size: 0.92rem; }
  .price-table td:nth-child(3) { grid-area: get; align-self: center; display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 0.8rem; }
  .price-table td:nth-child(3) a { margin: 0; }
  .price-table td:nth-child(4) { grid-area: unz; font-size: 0.82rem; font-weight: 500; color: var(--muted); }
  .price-table td:nth-child(4)::before { content: "Unzipped "; }
}
