/* Falaqa Apps, October 2026.
   A portfolio of small apps. Each app owns one full-width band in the colour of its icon, with its real
   screens fanned out and cropped by the band's lower edge. Everything else is white (or near-black)
   ground, one sans family set large, and no ornament. */

@font-face { font-family: "Archivo"; src: url("/assets/fonts/archivo-latin.woff2") format("woff2"); font-weight: 100 900; font-stretch: 62% 125%; font-display: swap; }
@font-face {
  font-family: "Noto Kufi Arabic"; src: url("/assets/fonts/noto-kufi-arabic.woff2") format("woff2"); font-weight: 100 900; font-display: swap;
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC;
}

:root {
  --ground: #ffffff;
  --surface: #f3f4f6;
  --ink: #111318;
  --muted: #5c616e;
  --font: "Archivo", "Noto Kufi Arabic", system-ui, sans-serif;
  --edge: clamp(18px, 4vw, 56px);
  --bar: 64px;
  --ease: cubic-bezier(.2, .7, .2, 1);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --ground: #0e0f13; --surface: #181a20; --ink: #f2f3f5; --muted: #a3a8b4; color-scheme: dark; }
}
:root[data-theme="dark"] { --ground: #0e0f13; --surface: #181a20; --ink: #f2f3f5; --muted: #a3a8b4; color-scheme: dark; }

/* Each app's colours, taken from its icon. --field is the band, --on the text on it,
   --act/--act-on the button. White text holds 4.5:1 or better on every field except Card Wallet,
   which takes dark ink. */
[data-app="tv-remote"] { --field: #1c2030; --on: #ffffff; --act: #46e3c8; --act-on: #0b1f1b; --frame: #3a4058; }
[data-app="photo-size"] { --field: #cf3559; --on: #ffffff; --act: #ffffff; --act-on: #b52a4b; }
[data-app="countdown"] { --field: #5b42e0; --on: #ffffff; --act: #ffffff; --act-on: #4a33cf; }
[data-app="doc-scanner"] { --field: #2563eb; --on: #ffffff; --act: #ffffff; --act-on: #1b48c7; }
[data-app="card-wallet"] { --field: #f7a53c; --on: #22140a; --act: #22140a; --act-on: #ffd79a; }
:root[data-theme="dark"] [data-app="tv-remote"] { --field: #222839; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) [data-app="tv-remote"] { --field: #222839; } }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: var(--bar); }
body { margin: 0; background: var(--ground); color: var(--ink); font: 400 1.125rem/1.55 var(--font); -webkit-font-smoothing: antialiased; }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-underline-offset: 4px; text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid currentColor; outline-offset: 4px; border-radius: 4px; }
h1, h2, h3 { margin: 0; font-weight: 800; font-stretch: 112%; letter-spacing: -0.035em; line-height: .98; text-wrap: balance; }
:lang(ar) h1, :lang(ar) h2, :lang(ar) h3 { letter-spacing: 0; line-height: 1.25; font-weight: 700; }
p { margin: 0; text-wrap: pretty; }
[hidden] { display: none !important; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip { position: absolute; top: 8px; inset-inline-start: 8px; z-index: 50; background: var(--ink); color: var(--ground); padding: 10px 16px; border-radius: 999px; transform: translateY(-200%); }
.skip:focus { transform: none; }

/* ---------- Bar: wordmark, a few links, the theme key ---------- */
.bar { position: sticky; top: 0; z-index: 30; height: var(--bar); display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-inline: var(--edge); background: var(--ground); }
.mark { font-weight: 800; font-stretch: 115%; font-size: 1.375rem; letter-spacing: -0.03em; text-decoration: none; min-height: 44px; display: inline-flex; align-items: center; gap: .22em; }
.mark span { color: var(--muted); font-weight: 600; }
.bar nav { display: flex; align-items: center; gap: 2px; }
.bar nav a { text-decoration: none; font-size: 1rem; font-weight: 600; padding: 10px 12px; min-height: 44px; display: inline-flex; align-items: center; white-space: nowrap; border-radius: 999px; transition: background-color .15s, transform .12s var(--ease); }
.bar nav a:hover { background: var(--surface); }
.bar nav a:active { transform: scale(.95); }
.theme-key { width: 44px; height: 44px; border: 0; border-radius: 50%; background: transparent; color: var(--ink); display: inline-grid; place-items: center; cursor: pointer; transition: background-color .15s, transform .12s var(--ease); }
.theme-key:hover { background: var(--surface); }
.theme-key:active { transform: scale(.9); }
.theme-key svg { width: 20px; height: 20px; }
.theme-key .moon, :root[data-theme="dark"] .theme-key .sun { display: none; }
:root[data-theme="dark"] .theme-key .moon { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-key .sun { display: none; }
  :root:not([data-theme="light"]) .theme-key .moon { display: block; }
}
@media (max-width: 560px) { .bar nav a:not(.lang):not(.keep) { display: none; } }

/* ---------- Buttons: fully round, one fill ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 56px; padding: 0 30px; border-radius: 999px; background: var(--act, var(--ink)); color: var(--act-on, var(--ground)); font-weight: 700; font-size: 1.0625rem; text-decoration: none; transition: transform .14s var(--ease); }
a.btn:hover { transform: translateY(-2px); }
a.btn:active { transform: scale(.96); }

/* ---------- Home: headline and the shelf of icons ---------- */
.hero { --pw: clamp(140px, 16vw, 250px); display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: center; gap: clamp(24px, 4vw, 64px); padding: clamp(28px, 4vw, 64px) var(--edge) 0; background: var(--surface); overflow: hidden; }
.hero-copy { padding-bottom: clamp(36px, 4vw, 64px); }
.collage { align-self: end; }
.collage .phone + .phone { margin-inline-start: calc(var(--pw) * -0.3); }
.collage .phone:nth-child(odd) { transform: rotate(-5deg) translateY(10%); }
.collage .phone:nth-child(even) { transform: rotate(4deg); position: relative; z-index: 1; }
.hero:hover .collage .phone:nth-child(odd) { transform: rotate(-8deg) translateY(4%); }
.hero:hover .collage .phone:nth-child(even) { transform: rotate(7deg) translateY(-4%); }
@media (max-width: 900px) {
  .hero { grid-template-columns: minmax(0, 1fr); --pw: min(30vw, 190px); }
  .hero-copy { padding-bottom: 8px; }
}
.hero h1 { font-size: clamp(2.5rem, 1rem + 4.4vw, 5.75rem); max-width: 13ch; }
.lede { font-size: clamp(1.1875rem, 1rem + .6vw, 1.5rem); line-height: 1.45; max-width: 34ch; margin-top: clamp(20px, 2.5vw, 36px); }
.shelf { display: flex; flex-wrap: wrap; gap: clamp(12px, 2.4vw, 36px); margin-top: clamp(36px, 5vw, 72px); }
.shelf-app { display: flex; flex-direction: column; gap: 10px; width: 92px; text-decoration: none; font-weight: 600; font-size: .9375rem; line-height: 1.3; }
.shelf-app .icon { width: 80px; height: 80px; transition: transform .25s var(--ease); }
.shelf-app:hover .icon, .shelf-app:focus-visible .icon { transform: translateY(-6px) rotate(-3deg); }
.shelf-app:active .icon { transform: scale(.94); }
@media (max-width: 600px) {
  .shelf { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; }
  .shelf-app { width: auto; }
  .shelf-app .icon { width: 100%; height: auto; }
  .shelf-app span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
}

/* ---------- Bands: one per app, in its icon colour ---------- */
.band { --pw: clamp(200px, 24vw, 340px); position: relative; overflow: hidden; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: center; gap: clamp(24px, 4vw, 64px); padding: clamp(48px, 5vw, 80px) var(--edge) 0; background: var(--field); color: var(--on); isolation: isolate; }
.band.flip .band-copy { order: 2; }
.band-copy { position: relative; z-index: 4; display: flex; flex-direction: column; align-items: flex-start; gap: 16px; padding-bottom: clamp(40px, 5vw, 72px); max-width: 36rem; }
.band-copy .icon { width: 96px; height: 96px; margin-bottom: 6px; }
/* The icon would melt into a field of its own colour, so it sits on a plate of the text colour. */
.band-copy .icon, .next-name .icon { padding: 5px; border-radius: 30%; background: var(--on); }
.band h3, .band h1 { font-size: clamp(2.5rem, 1rem + 4.6vw, 5.25rem); }
.band-line { font-size: clamp(1.1875rem, 1rem + .5vw, 1.4375rem); line-height: 1.4; max-width: 26ch; }
.band-points { list-style: none; margin: 4px 0 0; padding: 0; display: grid; gap: 6px; font-size: 1.0625rem; font-weight: 600; }
.band-points li { padding-inline-start: 22px; position: relative; }
.band-points li::before { content: ""; position: absolute; inset-inline-start: 0; top: .5em; width: 12px; height: 7px; border-inline-start: 2.5px solid currentColor; border-bottom: 2.5px solid currentColor; transform: rotate(-45deg); }
[dir="rtl"] .band-points li::before { transform: rotate(45deg); }
.band-status { font-weight: 700; }
.band-note { font-size: 1rem; max-width: 34ch; }
.band .btn { margin-top: 8px; }
.band-link { text-decoration: none; }
.band-link::after { content: ""; position: absolute; inset: 0; z-index: 3; }
.band-link:focus-visible { outline: none; }
.band:has(.band-link:focus-visible) { outline: 4px solid var(--ink); outline-offset: -8px; }
.band:hover .btn { transform: translateY(-2px); }
.get { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; margin-top: 8px; }
.get .btn { margin-top: 0; }

/* Backgrounds: the app's icon drawing, huge and faint, behind the phones (bands, next-app strip)
   and in the app's colour behind the features. */
.band::before, .next::before, .points::before { content: ""; position: absolute; z-index: -1; pointer-events: none; background: currentColor; opacity: .09; -webkit-mask: var(--mark) center / contain no-repeat; mask: var(--mark) center / contain no-repeat; }
.band::before { width: clamp(420px, 52vw, 860px); aspect-ratio: 1; inset-inline-end: -8%; top: 50%; translate: 0 -50%; rotate: -12deg; }
.band.flip::before { inset-inline-end: auto; inset-inline-start: -8%; rotate: 12deg; }
.next::before { width: clamp(280px, 34vw, 520px); aspect-ratio: 1; inset-inline-end: -4%; top: 50%; translate: 0 -50%; rotate: -12deg; opacity: .12; }
.points::before { color: var(--field); width: clamp(360px, 46vw, 760px); aspect-ratio: 1; inset-inline-start: -10%; bottom: -20%; rotate: 10deg; opacity: .14; }
@media (max-width: 760px) { .band::before, .band.flip::before { width: 120vw; inset-inline: auto -30%; top: auto; bottom: -10%; translate: none; } }
[data-app="tv-remote"] { --mark: url("/assets/marks/tv-remote.svg"); }
[data-app="photo-size"] { --mark: url("/assets/marks/photo-size.svg"); }
[data-app="countdown"] { --mark: url("/assets/marks/countdown.svg"); }
[data-app="doc-scanner"] { --mark: url("/assets/marks/doc-scanner.svg"); }
[data-app="card-wallet"] { --mark: url("/assets/marks/card-wallet.svg"); }

/* The fan: phones stand on the band's lower edge and are cut by it. */
.fan { align-self: end; display: flex; justify-content: center; align-items: flex-end; margin-bottom: calc(var(--pw) * -0.85); }
.phone { flex: none; width: var(--pw); padding: calc(var(--pw) * .035); border-radius: calc(var(--pw) * .15); background: var(--frame, #0b0c10); transition: transform .5s var(--ease); }
.phone img { width: 100%; aspect-ratio: 720 / 1600; object-fit: cover; object-position: top; border-radius: calc(var(--pw) * .118); }
.phone .for-dark { display: none; }
:root[data-theme="dark"] .phone .for-light { display: none; }
:root[data-theme="dark"] .phone .for-dark { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .phone .for-light { display: none; }
  :root:not([data-theme="light"]) .phone .for-dark { display: block; }
}
.band .fan.n3 { --pw: clamp(170px, 17vw, 260px); }
.fan.n3 .phone:nth-child(1) { transform: translate(18%, 12%) rotate(-7deg); }
.fan.n3 .phone:nth-child(2) { position: relative; z-index: 2; transform: translateY(-4%); }
.fan.n3 .phone:nth-child(3) { transform: translate(-18%, 12%) rotate(7deg); }
.fan.n2 .phone:nth-child(1) { transform: translate(8%, 0) rotate(-4deg); }
.fan.n2 .phone:nth-child(2) { transform: translate(-8%, 14%) rotate(4deg); }
.band:hover .band .fan.n3 { --pw: clamp(170px, 17vw, 260px); }
.fan.n3 .phone:nth-child(1) { transform: translate(8%, 9%) rotate(-10deg); }
.band:hover .fan.n3 .phone:nth-child(2) { transform: translateY(-8%); }
.band:hover .fan.n3 .phone:nth-child(3) { transform: translate(-8%, 9%) rotate(10deg); }
.band:hover .fan.n2 .phone:nth-child(1) { transform: translate(2%, -4%) rotate(-7deg); }
.band:hover .fan.n2 .phone:nth-child(2) { transform: translate(-2%, 10%) rotate(7deg); }
.fan.none { margin-bottom: 0; align-self: center; }
.fan.none .icon { width: clamp(180px, 22vw, 300px); height: auto; transform: rotate(-8deg); transition: transform .5s var(--ease); }
.band:hover .fan.none .icon { transform: rotate(-3deg) scale(1.04); }

@media (max-width: 760px) {
  .band { --pw: min(46vw, 220px); grid-template-columns: minmax(0, 1fr); padding-top: 44px; gap: 4px; }
  .band.flip .band-copy { order: 0; }
  .band-copy { padding-bottom: 24px; }
  .band-copy .icon { width: 72px; height: 72px; }
  .band h3, .band h1 { font-size: clamp(2.125rem, 1rem + 5vw, 2.75rem); font-stretch: 104%; }
  .fan.n3 { --pw: min(40vw, 190px); }
  .fan.none { padding-bottom: 56px; }
}

/* ---------- Home close: what the apps share, and how to write ---------- */
.later { font-size: 1.1875rem; margin-bottom: clamp(36px, 4vw, 56px); }
.later span { font-weight: 700; opacity: .7; margin-inline-end: 8px; }
.close { padding: clamp(56px, 7vw, 104px) var(--edge); background: var(--ink); color: var(--ground); }
.promise { font-size: clamp(1.5rem, 1rem + 1.5vw, 2.25rem); line-height: 1.3; font-weight: 600; letter-spacing: -0.01em; max-width: 40ch; }
.close h2 { font-size: clamp(2rem, 1rem + 3.4vw, 4rem); margin-top: clamp(40px, 5vw, 72px); }
.mail { display: inline-block; transition: opacity .15s; margin-top: 20px; font-size: clamp(1.5rem, 1rem + 2.6vw, 3.25rem); font-weight: 700; letter-spacing: -0.02em; word-break: break-all; }
.mail:hover { opacity: .75; }
.close :focus-visible { outline-color: var(--ground); }

/* ---------- App page: what it does, links, next app ---------- */
.points { --pw: clamp(220px, 24vw, 340px); display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); align-items: center; gap: clamp(32px, 5vw, 96px); padding: clamp(48px, 6vw, 96px) var(--edge); background: color-mix(in srgb, var(--field) 12%, var(--ground)); position: relative; overflow: hidden; isolation: isolate; }
.point-shot { display: flex; justify-content: center; }
.point-shot .phone { transform: rotate(-3deg); }
.point-shot.none .icon { width: clamp(160px, 18vw, 240px); height: auto; transform: rotate(-8deg); }
.point-list { display: grid; gap: clamp(28px, 3.5vw, 52px); }
.point h2 { font-size: clamp(1.75rem, 1rem + 2.2vw, 3rem); }
.point p { font-size: clamp(1.125rem, 1rem + .4vw, 1.375rem); line-height: 1.5; max-width: 40ch; margin-top: 14px; }
@media (max-width: 760px) { .points { grid-template-columns: minmax(0, 1fr); --pw: min(56vw, 240px); } }
.app-links { display: flex; flex-wrap: wrap; gap: 8px 36px; padding: clamp(28px, 3vw, 44px) var(--edge); font-size: 1.25rem; font-weight: 600; }
.app-links a { min-height: 44px; display: inline-flex; align-items: center; transition: color .15s; }
.app-links a:hover { color: var(--muted); }
.next { display: flex; flex-direction: column; gap: 12px; padding: clamp(40px, 5vw, 72px) var(--edge); background: var(--field); position: relative; overflow: hidden; isolation: isolate; color: var(--on); text-decoration: none; }
.next-label { font-weight: 700; font-size: 1.0625rem; }
.next-name { display: flex; align-items: center; gap: clamp(16px, 2vw, 28px); font-weight: 800; font-stretch: 112%; letter-spacing: -0.035em; line-height: 1; font-size: clamp(2.25rem, 1rem + 5vw, 6rem); }
:lang(ar) .next-name { letter-spacing: 0; line-height: 1.3; font-weight: 700; }
.next-name .icon { width: clamp(56px, 6vw, 88px); height: auto; transition: transform .3s var(--ease); }
.next:hover .icon { transform: translateX(10px) rotate(6deg); }
[dir="rtl"] .next:hover .icon { transform: translateX(-10px) rotate(-6deg); }
.next:active { opacity: .9; }

/* ---------- Privacy and help pages ---------- */
.doc { max-width: 46rem; padding: clamp(32px, 4vw, 64px) var(--edge) clamp(56px, 6vw, 96px); }
.doc h1 { font-size: clamp(2.25rem, 1rem + 4vw, 4.25rem); margin-bottom: 20px; }
.doc h2 { font-size: clamp(1.5rem, 1rem + 1.4vw, 2.25rem); margin: 56px 0 14px; }
.doc h3 { font-size: 1.375rem; margin: 32px 0 10px; letter-spacing: -0.02em; }
.doc p, .doc ul, .doc ol { margin: 0 0 1em; max-width: 68ch; }
.doc li { margin-bottom: .4em; }
.doc .meta { color: var(--muted); }
.doc table { border-collapse: collapse; width: 100%; margin: 0 0 1.2em; font-size: 1rem; }
.doc th, .doc td { text-align: start; padding: 10px 12px 10px 0; border-bottom: 1px solid var(--surface); vertical-align: top; }

/* ---------- Footer: the name returns, full width ---------- */
.foot { padding: 28px var(--edge) 0; overflow: hidden; }
.foot-links { display: flex; flex-wrap: wrap; gap: 8px 28px; font-size: 1rem; color: var(--muted); }
.foot-links a { color: var(--ink); font-weight: 600; min-height: 44px; display: inline-flex; align-items: center; }
.foot-links span { min-height: 44px; display: inline-flex; align-items: center; }
.foot-name { font-weight: 800; font-stretch: 118%; letter-spacing: -0.05em; line-height: .8; font-size: clamp(3rem, 12.2vw, 13rem); margin: 12px 0 -0.06em; white-space: nowrap; }

/* ---------- Motion: entrances and the fan rising into the band ---------- */
.js .reveal { opacity: 0; transform: translateY(24px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.js .reveal.in { opacity: 1; transform: none; }
.js .band-copy.reveal > * { opacity: 0; transform: translateY(20px); transition: opacity .6s var(--ease), transform .6s var(--ease); }
.js .band-copy.reveal { opacity: 1; transform: none; }
.js .band-copy.in > * { opacity: 1; transform: none; }
.js .band-copy.in > :nth-child(2) { transition-delay: 70ms; }
.js .band-copy.in > :nth-child(3) { transition-delay: 140ms; }
.js .band-copy.in > :nth-child(4) { transition-delay: 210ms; }
.js .band-copy.in > :nth-child(5) { transition-delay: 280ms; }
.js .fan { translate: 0 18%; opacity: 0; transition: translate .9s var(--ease) .15s, opacity .6s var(--ease) .15s; }
.js .fan.in { translate: 0 0; opacity: 1; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; transition-delay: 0s !important; }
  .js .reveal, .js .band-copy.reveal > *, .js .fan { opacity: 1; transform: none; translate: none; }
}
