:root {
  --ink: #151b36;
  --paper: #f1ece2;
  --paper-2: #e8e1d3;
  --muted: #5b6075;
  --line: rgba(21, 27, 54, .16);
  --blue: #2f7fc1;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root { --ink: #f1ece2; --paper: #121733; --paper-2: #1a2040; --muted: #a2a7bd; --line: rgba(241, 236, 226, .18); --blue: #6fb3ea; }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 17px/1.6 var(--sans); }
a { color: inherit; text-decoration-color: var(--line); text-underline-offset: 3px; }
a:hover { text-decoration-color: currentColor; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; border-radius: 2px; }
.wrap { width: min(1080px, 100% - 40px); margin-inline: auto; }

header.top { display: flex; align-items: center; justify-content: space-between; padding: 22px 0; position: relative; z-index: 2; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 800; font-size: 20px; letter-spacing: -.01em; }
.brand .mark { width: 30px; height: 35px; }
nav.main { display: flex; gap: 22px; font-size: 15px; }
nav.main a { text-decoration: none; padding: 6px 0; border-bottom: 1px solid transparent; }
nav.main a:hover, nav.main a[aria-current="page"] { border-bottom-color: currentColor; }

.hero { position: relative; overflow: hidden; padding: clamp(40px, 9vw, 110px) 0 clamp(56px, 10vw, 130px); }
.hero .big-mark { position: absolute; right: 2%; top: 50%; width: clamp(300px, 40vw, 600px); aspect-ratio: 660 / 768; transform: translateY(-50%); color: var(--ink); pointer-events: none; }
.hero .copy { position: relative; max-width: min(620px, 54%); }
.eyebrow { font-size: 13px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin: 0 0 22px; }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; letter-spacing: -.02em; line-height: 1.06; margin: 0; }
h1 { font-size: clamp(42px, 8vw, 84px); }
.lead { font-size: clamp(18px, 2.4vw, 22px); color: var(--muted); max-width: 34em; margin: 26px 0 0; }
.lead strong { color: var(--ink); font-weight: 600; }
.actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 34px; }
.btn { display: inline-block; padding: 13px 22px; border-radius: 999px; background: var(--ink); color: var(--paper); text-decoration: none; font-weight: 600; font-size: 16px; }
.btn.ghost { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--ink); }
.btn { transition: transform .15s ease; }
.btn:hover { transform: translateY(-1px); }
@media (prefers-reduced-motion: reduce) { .btn { transition: none; } .btn:hover { transform: none; } }

section { padding: clamp(48px, 8vw, 96px) 0; border-top: 1px solid var(--line); }
section .label { font-size: 13px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin: 0 0 28px; }

ol.principles { list-style: none; counter-reset: p; margin: 0; padding: 0; display: grid; gap: 0; }
ol.principles li { counter-increment: p; display: grid; grid-template-columns: 64px 1fr; gap: 12px; padding: 24px 0; border-top: 1px solid var(--line); }
ol.principles li:first-child { border-top: 0; padding-top: 0; }
ol.principles li::before { content: counter(p, decimal-leading-zero); font-family: var(--serif); font-size: 26px; color: var(--muted); }
ol.principles h3 { font-size: clamp(24px, 3.2vw, 34px); }
ol.principles p { margin: 8px 0 0; color: var(--muted); max-width: 36em; }

footer.bottom { padding: 34px 0 48px; border-top: 1px solid var(--line); font-size: 15px; color: var(--muted); }
footer.bottom .wrap { display: flex; flex-wrap: wrap; gap: 14px 32px; justify-content: space-between; align-items: center; }
footer.bottom nav { display: flex; gap: 22px; flex-wrap: wrap; }

/* inner pages */
.page-head { padding: clamp(36px, 7vw, 84px) 0 clamp(20px, 4vw, 40px); }
.page-head h1 { font-size: clamp(38px, 7vw, 68px); max-width: 14em; }
.page-head .lead { margin-top: 20px; }
.prose { max-width: 40em; padding-bottom: 64px; }
.prose h2 { font-size: clamp(24px, 3vw, 32px); margin: 48px 0 12px; }
.prose p, .prose li { color: var(--ink); }
.prose p { margin: 0 0 16px; }
.prose ul { margin: 0 0 16px; padding-left: 1.2em; }
.prose li { margin: 6px 0; }
.prose .meta { color: var(--muted); font-size: 15px; }
dl.facts { margin: 0; display: grid; grid-template-columns: minmax(0, 1fr); }
dl.facts div { padding: 18px 0; border-top: 1px solid var(--line); display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); gap: 8px 24px; }
dl.facts dt { font-family: var(--serif); font-size: 22px; }
dl.facts dd { margin: 0; color: var(--muted); }

@media (max-width: 900px) {
  .hero .big-mark { right: -22%; top: 8%; width: 90vw; transform: none; opacity: .09; }
  .hero .copy { max-width: 620px; }
}
@media (max-width: 760px) {
  dl.facts div { grid-template-columns: 1fr; }
  ol.principles li { grid-template-columns: 44px 1fr; }
}
@media (prefers-reduced-motion: reduce) { .btn:hover { transform: none; } }
.prose.flush { padding-bottom: 0; }
.brand, nav.main a { white-space: nowrap; }
@media (max-width: 560px) {
  header.top { padding: 16px 0; }
  .brand { font-size: 17px; gap: 8px; }
  .brand .mark { width: 24px; height: 28px; }
  nav.main { gap: 14px; font-size: 14px; }
}

/* contact form */
form.contact { display: grid; gap: 8px; max-width: 40em; padding-bottom: 72px; }
form.contact label { font-family: var(--serif); font-size: 20px; margin-top: 18px; }
form.contact input[type="text"], form.contact input[type="email"], form.contact textarea {
  width: 100%; padding: 14px 16px; font: inherit; color: var(--ink); background: var(--paper-2);
  border: 1.5px solid transparent; border-radius: 10px; resize: vertical;
}
form.contact input:focus, form.contact textarea:focus { outline: none; border-color: var(--ink); }
form.contact .note { color: var(--muted); font-size: 15px; margin: 14px 0 10px; }
form.contact .btn { justify-self: start; border: 0; cursor: pointer; font: inherit; font-weight: 600; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }

/* phone mockups */
.phone { margin: 0; }
.phone .frame { position: relative; border: 9px solid var(--ink); border-radius: 38px; background: #eff1f6; overflow: hidden; box-shadow: 0 18px 40px -22px rgba(21, 27, 54, .55); }
.phone .frame img { display: block; width: 100%; height: auto; }
.phone figcaption { margin-top: 14px; font-size: 15px; color: var(--muted); text-align: center; }
.phone figcaption strong { display: block; color: var(--ink); font-family: var(--serif); font-size: 20px; font-weight: 600; margin-bottom: 2px; }
.shots { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: clamp(14px, 2.4vw, 32px); align-items: start; }
@media (max-width: 760px) {
  .shots { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; gap: 18px; padding-bottom: 10px; margin: 0 -20px; padding-inline: 20px; }
  .shots .phone { flex: 0 0 72%; scroll-snap-align: center; }
}
.badges { display: flex; flex-wrap: wrap; gap: 8px; margin: 28px 0 0; padding: 0; list-style: none; }
.badges li { padding: 6px 14px; border-radius: 999px; background: var(--paper-2); font-size: 14px; }

.sub { font-family: var(--sans); font-size: 14px; color: var(--muted); font-weight: 400; letter-spacing: 0; }
.note { margin: 22px 0 0; color: var(--muted); font-size: 15px; }
.more { margin: 22px 0 0; }
@media (max-width: 560px) {
  header.top { flex-wrap: wrap; row-gap: 6px; }
  nav.main { width: 100%; justify-content: space-between; border-top: 1px solid var(--line); padding-top: 4px; }
}

/* work / case studies */
.work { padding: 8px 0 44px; }
.work + .work { border-top: 1px solid var(--line); padding-top: 40px; }
.work h2 { font-size: clamp(28px, 4vw, 40px); }
.work .sub { margin: 6px 0 14px; }
.work > p:not(.sub) { max-width: 44em; color: var(--muted); margin: 0 0 26px; }
.work-shots { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)) minmax(0, .42fr); gap: 22px; align-items: start; }
.browser { margin: 0; }
.browser .bar { height: 22px; background: var(--paper-2); border: 1px solid var(--line); border-bottom: 0; border-radius: 10px 10px 0 0; position: relative; }
.browser .bar::before { content: ""; position: absolute; left: 10px; top: 7px; width: 8px; height: 8px; border-radius: 50%; background: var(--line); box-shadow: 14px 0 0 var(--line), 28px 0 0 var(--line); }
.browser img { display: block; width: 100%; height: auto; border: 1px solid var(--line); border-radius: 0 0 10px 10px; }
.browser figcaption { margin-top: 10px; font-size: 14px; color: var(--muted); }
.work-shots .phone { grid-column: 3; grid-row: 1 / span 2; }
.work-shots .phone .frame { border-width: 7px; border-radius: 28px; background: #fff; }
@media (max-width: 760px) {
  .work-shots { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; gap: 16px; padding-bottom: 10px; margin: 0 -20px; padding-inline: 20px; }
  .work-shots > figure { flex: 0 0 86%; scroll-snap-align: center; }
  .work-shots .phone { flex-basis: 56%; }
}

/* language switcher + RTL */
.langs { display: flex; flex-wrap: wrap; gap: 2px 2px; font-size: 14px; flex-basis: 100%; margin-top: 4px; }
.langs a { text-decoration: none; padding: 4px 9px; border-radius: 6px; color: var(--muted); }
.langs a:hover { color: var(--ink); }
.langs a[aria-current="true"] { background: var(--ink); color: var(--paper); }
.note.courtesy { margin: 14px 0 0; padding: 10px 14px; border-radius: 10px; background: var(--paper-2); font-size: 15px; max-width: 40em; }
.prose ul { padding-left: 0; padding-inline-start: 1.2em; }
:lang(ar) { --serif: "Geeza Pro", "Noto Naskh Arabic", "Traditional Arabic", "Segoe UI", system-ui, serif; }
:lang(ar) h1, :lang(ar) h2, :lang(ar) h3 { letter-spacing: 0; line-height: 1.3; font-weight: 700; }
:lang(ar) .eyebrow, :lang(ar) .label, :lang(ar) .langs { letter-spacing: 0; text-transform: none; }
:lang(ar) body, body:lang(ar) { line-height: 1.8; }
[dir="rtl"] .hero .big-mark { right: auto; left: 2%; }
@media (max-width: 900px) { [dir="rtl"] .hero .big-mark { right: auto; left: -22%; } }
[dir="rtl"] .browser .bar::before { left: auto; right: 10px; box-shadow: -14px 0 0 var(--line), -28px 0 0 var(--line); }
[dir="rtl"] .hp { left: auto; right: -9999px; }

/* privacy index: one policy per app */
.policies { list-style: none; padding: 0; margin: 0 0 16px; padding-inline-start: 0 !important; }
.policies li { margin: 0; padding: 16px 0; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 4px; }
.policies li:last-child { border-bottom: 1px solid var(--line); }
.policies a { font-family: var(--serif); font-size: 22px; }
.policies span { color: var(--muted); font-size: 15px; }
.crumb { text-decoration: none; }
.crumb:hover { text-decoration: underline; }

/* apps list */
.apps { list-style: none; margin: 0; padding: 0; }
.apps li { border-top: 1px solid var(--line); }
.apps li:last-child { border-bottom: 1px solid var(--line); }
.app-link { display: grid; grid-template-columns: 72px minmax(0, 1fr); gap: 22px; padding: 30px 0; text-decoration: none; align-items: start; }
.app-link img { display: block; border-radius: 16px; }
.app-info { display: block; }
.app-info > span { display: block; }
.app-name { font-family: var(--serif); font-size: clamp(28px, 4vw, 40px); font-weight: 600; letter-spacing: -.02em; line-height: 1.1; }
.app-link:hover .app-name, .app-link:focus-visible .app-name { text-decoration: underline; text-underline-offset: 5px; }
.app-text { margin-top: 8px; color: var(--muted); max-width: 36em; }
.app-meta { margin-top: 14px; font-size: 14px; color: var(--muted); }
.app-meta .tag { display: inline-block; margin-inline-end: 10px; padding: 3px 10px; border-radius: 999px; background: var(--paper-2); color: var(--ink); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
@media (max-width: 560px) { .app-link { grid-template-columns: 56px minmax(0, 1fr); gap: 16px; } .app-link img { width: 56px; height: 56px; border-radius: 13px; } }

/* home: app cards */
.apps-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(28px, 5vw, 64px); align-items: start; }
.app-card figure { margin: 0 0 22px; }
.app-card img { display: block; width: 100%; height: auto; border-radius: 14px; box-shadow: 0 18px 36px -24px rgba(21, 27, 54, .5); }
.app-card h2 { font-size: clamp(30px, 4vw, 44px); }
.app-card .tag { display: inline-block; margin-top: 14px; padding: 5px 12px; border-radius: 999px; background: var(--paper-2); font-size: 14px; }
.app-card p { margin: 16px 0 0; color: var(--muted); max-width: 30em; }
.app-card .go { margin-top: 14px; }
@media (max-width: 760px) { .apps-grid { grid-template-columns: 1fr; } }
