/* طراز — tiraz.app
   Tokens mirror Tiraz-iOS/Tiraz/Theme/TirazColors.swift. */
:root {
  --bg: #F4F0E8;
  --bg-deep: #EAE5DB;
  --surface: #FFFFFF;
  --ink: #14120F;
  --ink-2: #67625A;
  --gold: #C9A961;
  --gold-deep: #9A7B3C;
  --gold-text: #7A6130;
  --line: #E4DFD4;
  --shadow: 0 18px 50px rgba(20, 18, 15, .14);
  --radius: 18px;
  --display: "Amiri", "Noto Naskh Arabic", serif;
  --body: "IBM Plex Sans Arabic", -apple-system, "SF Arabic", "Segoe UI", Tahoma, sans-serif;
  --max: 1180px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #100F0D; --bg-deep: #161512; --surface: #1C1A16;
    --ink: #F4F0E8; --ink-2: #9C948A; --gold-text: #C9A961; --line: #332F28;
    --shadow: 0 18px 50px rgba(0, 0, 0, .5);
  }
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { animation: none !important; transition: none !important; } }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--body); line-height: 1.85; font-size: 17px; }
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
a:focus-visible, button:focus-visible, input:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; border-radius: 6px; }
h1, h2, h3 { font-family: var(--display); font-weight: 700; line-height: 1.35; margin: 0; letter-spacing: 0; }
h1 { font-size: clamp(38px, 6.2vw, 72px); }
h2 { font-size: clamp(30px, 4vw, 44px); }
h3 { font-size: 22px; }
p { margin: 0; }
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 20px; }
.muted { color: var(--ink-2); }
.eyebrow { font-size: 13px; letter-spacing: .08em; color: var(--gold-text); font-weight: 600; text-transform: uppercase; }
.k { font-variant-numeric: tabular-nums; }

/* The kashida rule: a heading that "stretches" into its section. */
.sec-head { display: flex; align-items: baseline; gap: 18px; margin-bottom: 28px; }
.sec-head h2 { flex: 0 1 auto; min-width: 0; }
.sec-head::after { content: ""; flex: 1; height: 2px; background: linear-gradient(to left, var(--gold), transparent); transform-origin: right; animation: stretch 1.1s cubic-bezier(.2,.8,.2,1) both; }
.sec-head .more { flex: none; font-size: 15px; color: var(--gold-text); font-weight: 600; }
@keyframes stretch { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@media (max-width: 760px) { .sec-head { flex-wrap: wrap; gap: 10px 14px; } .sec-head::after { order: 3; flex-basis: 100%; height: 1px; } }

/* Header */
.top { position: sticky; top: 0; z-index: 40; background: color-mix(in srgb, var(--bg) 86%, transparent); backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px); border-bottom: 1px solid var(--line); }
.top .wrap { display: flex; align-items: center; justify-content: space-between; height: 66px; gap: 16px; }
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--display); font-weight: 700; font-size: 26px; }
.brand img { width: 34px; height: 34px; border-radius: 9px; }
.nav { display: flex; gap: 26px; font-size: 15px; font-weight: 500; }
.nav a { color: var(--ink-2); }
.nav a:hover, .nav a[aria-current] { color: var(--ink); }
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 12px 22px; border-radius: 999px; font-weight: 600; font-size: 15px; border: 1px solid transparent; transition: transform .15s, background .15s; white-space: nowrap; }
.btn:hover { transform: translateY(-1px); }
.btn-ink { background: var(--ink); color: var(--bg); }
.btn-gold { background: var(--gold); color: #14120F; }
.btn-line { border-color: var(--line); color: var(--ink); background: transparent; }
.btn-soon { background: var(--bg-deep); color: var(--ink-2); cursor: default; }
.btn-soon:hover { transform: none; }
.btn svg { width: 18px; height: 18px; }
.top .btn { padding: 9px 16px; font-size: 14px; }
.menu-btn { display: none; background: none; border: 0; color: var(--ink); padding: 6px; }
@media (max-width: 860px) {
  .nav, .top .btn { display: none; }
  .menu-btn { display: block; }
  .top.open .nav { display: flex; flex-direction: column; position: absolute; inset-inline: 0; top: 66px; background: var(--bg); padding: 18px 20px 24px; border-bottom: 1px solid var(--line); gap: 14px; font-size: 17px; }
}

/* Hero */
.hero { padding: 64px 0 40px; overflow: hidden; }
.hero .wrap { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); gap: 40px; align-items: center; }
.hero h1 { margin: 12px 0 18px; }
.hero h1 .madd { color: var(--gold-text); }
.hero .lead { font-size: 19px; color: var(--ink-2); max-width: 520px; }
.hero .cta { display: flex; gap: 12px; margin-top: 30px; flex-wrap: wrap; align-items: center; }
.hero .note { font-size: 13px; color: var(--ink-2); margin-top: 12px; }
.fan { position: relative; height: 560px; }
.fan a { position: absolute; width: 230px; border-radius: 16px; overflow: hidden; box-shadow: var(--shadow); background: var(--surface); transition: transform .3s cubic-bezier(.2,.8,.2,1); will-change: transform; }
.fan a img { width: 100%; aspect-ratio: 9/16; object-fit: cover; }
.fan a:nth-child(1) { right: 50%; top: 20px; transform: translateX(50%) rotate(0deg); z-index: 3; width: 250px; }
.fan a:nth-child(2) { right: 8%; top: 60px; transform: rotate(8deg); z-index: 2; }
.fan a:nth-child(3) { left: 8%; top: 60px; transform: rotate(-8deg); z-index: 2; }
.fan a:nth-child(4) { right: -6%; top: 140px; transform: rotate(16deg); z-index: 1; opacity: .9; }
.fan a:nth-child(5) { left: -6%; top: 140px; transform: rotate(-16deg); z-index: 1; opacity: .9; }
.fan a:hover { z-index: 5; transform: translateY(-10px) rotate(0) !important; }
.fan a:nth-child(1):hover { transform: translateX(50%) translateY(-10px) !important; }
@media (max-width: 960px) {
  .hero .wrap { grid-template-columns: minmax(0, 1fr); }
  .fan { height: auto; display: flex; gap: 14px; overflow-x: auto; padding: 10px 4px 24px; scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch; }
  .fan a { position: static !important; transform: none !important; flex: 0 0 180px; width: 180px !important; opacity: 1 !important; scroll-snap-align: start; }
}

/* Stat strip */
.stats { border-block: 1px solid var(--line); background: var(--bg-deep); }
.stats .wrap { display: flex; justify-content: space-between; gap: 20px; padding: 18px 20px; flex-wrap: wrap; }
.stats div { display: flex; align-items: baseline; gap: 8px; }
.stats b { font-family: var(--display); font-size: 30px; font-weight: 700; }
.stats span { color: var(--ink-2); font-size: 14px; }

section.block { padding: 80px 0; }
section.block.tight { padding-top: 48px; }

/* Kashida demo */
.madd-demo { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 40px; align-items: center; }
.madd-stage { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 40px 32px; text-align: center; box-shadow: var(--shadow); }
.madd-word { font-family: var(--display); font-size: clamp(44px, 7vw, 84px); line-height: 1.4; color: var(--ink); white-space: nowrap; overflow: hidden; }
.madd-ctl { display: flex; align-items: center; gap: 14px; margin-top: 22px; font-size: 14px; color: var(--ink-2); }
.madd-ctl input { flex: 1; accent-color: var(--gold); }
.madd-pick { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin-top: 16px; }
.madd-pick button { font: inherit; font-size: 14px; padding: 6px 14px; border-radius: 999px; border: 1px solid var(--line); background: transparent; color: var(--ink); cursor: pointer; }
.madd-pick button[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.madd-copy h2 { margin-bottom: 14px; }
.madd-copy p + p { margin-top: 12px; }
.madd-copy ul { margin: 18px 0 0; padding: 0; list-style: none; display: grid; gap: 8px; color: var(--ink-2); }
.madd-copy li::before { content: "ـــ"; color: var(--gold); margin-inline-end: 8px; font-family: var(--display); }
@media (max-width: 860px) { .madd-demo { grid-template-columns: minmax(0, 1fr); } }

/* Category cards */
.cats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.cat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; transition: transform .2s, box-shadow .2s; }
.cat:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.cat .pics { display: grid; grid-template-columns: 1.4fr 1fr; grid-template-rows: 1fr 1fr; gap: 3px; aspect-ratio: 4/3; background: var(--bg-deep); }
.cat .pics img { width: 100%; height: 100%; object-fit: cover; }
.cat .pics img:first-child { grid-row: 1 / 3; }
.cat .t { padding: 14px 16px 16px; display: flex; justify-content: space-between; align-items: baseline; }
.cat h3 { font-size: 20px; }
.cat .n { font-size: 13px; color: var(--ink-2); }
@media (max-width: 960px) { .cats { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .cats { grid-template-columns: 1fr 1fr; gap: 12px; } .cat h3 { font-size: 17px; } }

/* Template grid */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 18px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; transition: transform .2s, box-shadow .2s; position: relative; }
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.card img { width: 100%; aspect-ratio: 9/16; object-fit: cover; background: var(--bg-deep); }
.card.post img { aspect-ratio: 4/5; }
.card .t { padding: 10px 12px 12px; font-size: 14px; font-weight: 500; line-height: 1.5; }
.card .plus { position: absolute; top: 10px; inset-inline-start: 10px; background: var(--gold); color: #14120F; font-size: 11px; font-weight: 700; padding: 2px 9px; border-radius: 999px; }

/* Font rows */
.fonts-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.font { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; transition: transform .2s, box-shadow .2s; }
.font:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.font img { width: 100%; aspect-ratio: 640/220; object-fit: cover; }
.font .t { padding: 10px 14px 12px; display: flex; justify-content: space-between; align-items: baseline; gap: 10px; font-size: 14px; }
.font .t b { font-weight: 600; }
.font .t span { color: var(--ink-2); font-size: 12px; white-space: nowrap; }
.scripts { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.script { display: flex; gap: 14px; align-items: center; padding: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; }
.script img { width: 128px; aspect-ratio: 640/220; object-fit: cover; border-radius: 8px; flex: none; }
.script h3 { font-size: 19px; }
.script span { font-size: 13px; color: var(--ink-2); }

/* Feature grid */
.feats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.feat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px 22px; }
.feat .ic { width: 42px; height: 42px; border-radius: 12px; background: var(--bg-deep); display: grid; place-items: center; color: var(--gold-text); margin-bottom: 14px; }
.feat .ic svg { width: 22px; height: 22px; }
.feat h3 { font-family: var(--body); font-size: 18px; font-weight: 700; margin-bottom: 6px; }
.feat p { color: var(--ink-2); font-size: 15px; }
@media (max-width: 860px) { .feats { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .feats { grid-template-columns: 1fr; } }

/* Steps (a real sequence) */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; counter-reset: s; }
.step { padding: 26px 22px; border: 1px solid var(--line); border-radius: var(--radius); position: relative; }
.step::before { counter-increment: s; content: counter(s, arabic-indic); font-family: var(--display); font-size: 46px; color: var(--gold); line-height: 1; display: block; margin-bottom: 10px; }
.step h3 { font-family: var(--body); font-size: 18px; margin-bottom: 6px; }
.step p { color: var(--ink-2); font-size: 15px; }
@media (max-width: 760px) { .steps { grid-template-columns: 1fr; } }

/* Plus */
.plus-box { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: 40px; align-items: center; background: var(--ink); color: var(--bg); border-radius: 26px; padding: 48px 44px; }
.plus-box h2 { color: var(--gold); }
.plus-box ul { margin: 18px 0 0; padding: 0; list-style: none; display: grid; gap: 8px; color: color-mix(in srgb, var(--bg) 78%, transparent); font-size: 15px; }
.plus-box li::before { content: "✓"; color: var(--gold); margin-inline-end: 10px; font-weight: 700; }
.plans { display: grid; gap: 12px; }
.plan { border: 1px solid rgba(244,240,232,.18); border-radius: 16px; padding: 18px 20px; display: flex; justify-content: space-between; align-items: center; }
.plan.best { border-color: var(--gold); background: rgba(201,169,97,.08); }
.plan b { font-size: 17px; display: block; }
.plan small { color: rgba(244,240,232,.65); font-size: 13px; }
.plan .pr { font-family: var(--display); font-size: 30px; color: var(--gold); white-space: nowrap; }
.plan .pr span { font-family: var(--body); font-size: 13px; color: rgba(244,240,232,.65); }
.plus-box .fine { font-size: 12px; color: rgba(244,240,232,.5); margin-top: 10px; }
@media (max-width: 860px) { .plus-box { grid-template-columns: minmax(0, 1fr); padding: 32px 22px; } }

/* FAQ */
.faq { max-width: 820px; }
.faq details { border-top: 1px solid var(--line); padding: 16px 0; }
.faq details:last-child { border-bottom: 1px solid var(--line); }
.faq summary { cursor: pointer; font-weight: 600; font-size: 17px; list-style: none; display: flex; justify-content: space-between; gap: 16px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--gold-text); font-size: 22px; line-height: 1; }
.faq details[open] summary::after { content: "–"; }
.faq .a { color: var(--ink-2); padding-top: 10px; font-size: 15.5px; }

/* Final CTA */
.cta-band { text-align: center; padding: 70px 0; border-top: 1px solid var(--line); }
.cta-band h2 { margin-bottom: 10px; }
.cta-band .cta { display: flex; justify-content: center; gap: 12px; margin-top: 26px; flex-wrap: wrap; }

/* Footer */
footer { border-top: 1px solid var(--line); background: var(--bg-deep); padding: 44px 0 34px; font-size: 14px; }
footer .cols { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 28px; }
footer h4 { margin: 0 0 10px; font-size: 14px; color: var(--ink); }
footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
footer a { color: var(--ink-2); }
footer a:hover { color: var(--ink); }
footer .bottom { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-top: 30px; padding-top: 18px; border-top: 1px solid var(--line); color: var(--ink-2); font-size: 13px; }
@media (max-width: 760px) { footer .cols { grid-template-columns: 1fr 1fr; } }

/* Inner pages */
.page-head { padding: 48px 0 28px; }
.page-head h1 { font-size: clamp(32px, 5vw, 52px); margin: 6px 0 12px; }
.page-head .lead { color: var(--ink-2); font-size: 18px; max-width: 760px; }
.crumbs { font-size: 13px; color: var(--ink-2); display: flex; gap: 8px; flex-wrap: wrap; }
.crumbs a:hover { color: var(--ink); }
.crumbs span::before { content: "‹"; margin-inline-end: 8px; opacity: .5; }
.crumbs span:first-child::before { content: none; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin: 6px 0 26px; }
.chips a { font-size: 14px; padding: 6px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); }
.chips a:hover, .chips a[aria-current] { color: var(--ink); border-color: var(--ink); }
.group-title { margin: 44px 0 16px; }

/* Detail pages */
.detail { display: grid; grid-template-columns: minmax(280px, 420px) minmax(0, 1fr); gap: 44px; align-items: start; padding: 40px 0 60px; }
.detail .pic { border-radius: 18px; overflow: hidden; box-shadow: var(--shadow); background: var(--surface); }
.detail h1 { font-size: clamp(30px, 4vw, 46px); margin: 8px 0 14px; }
.detail .meta { display: flex; gap: 10px; flex-wrap: wrap; margin: 18px 0; }
.detail .meta span { font-size: 13px; padding: 5px 12px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); color: var(--ink-2); }
.detail .desc { color: var(--ink-2); max-width: 560px; }
.detail .desc p + p { margin-top: 10px; }
.detail .cta { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 26px; }
.faces { margin-top: 22px; display: grid; gap: 6px; font-size: 14px; }
.faces div { display: flex; justify-content: space-between; border-bottom: 1px solid var(--line); padding: 6px 0; }
.faces code { font-family: ui-monospace, Menlo, monospace; font-size: 12px; color: var(--ink-2); direction: ltr; }
@media (max-width: 760px) { .detail { grid-template-columns: minmax(0, 1fr) !important; } .detail .pic { max-width: 360px; } }

/* Elements */
.els { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
.el { aspect-ratio: 1; background: var(--surface); background-image: linear-gradient(45deg, var(--bg-deep) 25%, transparent 25%, transparent 75%, var(--bg-deep) 75%), linear-gradient(45deg, var(--bg-deep) 25%, transparent 25%, transparent 75%, var(--bg-deep) 75%); background-size: 18px 18px; background-position: 0 0, 9px 9px; border: 1px solid var(--line); border-radius: 12px; display: grid; place-items: center; padding: 12px; }
.el img { max-height: 100%; object-fit: contain; }
.el-cat { display: flex; align-items: center; gap: 14px; padding: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; }
.el-cat .th { width: 72px; height: 72px; flex: none; display: grid; place-items: center; }
.el-cat .th img { max-width: 100%; max-height: 100%; }
.el-cat h3 { font-size: 18px; }
.el-cat span { font-size: 13px; color: var(--ink-2); }

/* Docs (privacy/terms/support) */
.doc { max-width: 780px; padding: 40px 0 70px; }
.doc h1 { font-size: 36px; margin: 0 0 4px; }
.doc .date { color: var(--ink-2); font-size: 14px; margin-bottom: 26px; }
.doc h2 { font-size: 22px; margin: 30px 0 8px; }
.doc section + section { margin-top: 56px; padding-top: 40px; border-top: 1px solid var(--line); }
.doc [dir="ltr"] { font-family: -apple-system, "Segoe UI", Helvetica, Arial, sans-serif; line-height: 1.7; }
.doc a { color: var(--gold-text); text-decoration: underline; text-underline-offset: 3px; }
.doc p + p { margin-top: 10px; }

/* Reveal on scroll */
.rv { opacity: 0; transform: translateY(14px); transition: opacity .6s ease, transform .6s cubic-bezier(.2,.8,.2,1); }
.rv.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .rv { opacity: 1; transform: none; } }
