/* FlySalah site — direction A, "Window seat".
   Layout: pine-green masthead built around the app's window art, then calm mint
   reading sections. Colours and type come from the app itself (src/ui/palette.ts,
   Atkinson Hyperlegible), so the site and the app read as one product. */
:root {
  --pine: #0E3B2C;        /* app splash / icon ground */
  --pine-deep: #0B3125;
  --pine-line: #2A5A47;
  --on-pine: #EAF1EC;
  --on-pine-muted: #B9D2C6;
  --dawn: #FFD27A;        /* the sun in the icon */
  --bg: #EAF1EC;          /* app light background */
  --surface: #F6FAF7;
  --ink: #0C1612;
  --muted: #4A6157;
  --line: #C9D5CE;
  --accent: #0B7A52;      /* app light accent */
  --now: #D9561E;         /* app "now" orange, darkened for text */
  --sans: "Atkinson Hyperlegible", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "Atkinson Hyperlegible Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --arabic: "Noto Naskh Arabic", "Geeza Pro", "Times New Roman", serif;
  --measure: 64ch;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0C1612; --surface: #13211B; --ink: #E3ECE7; --muted: #93A79D;
    --line: #24362D; --accent: #3CC98A; --now: #FF7A45; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0C1612; --surface: #13211B; --ink: #E3ECE7; --muted: #93A79D;
  --line: #24362D; --accent: #3CC98A; --now: #FF7A45; color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 17px/1.6 var(--sans); }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-underline-offset: 3px; }
a:focus-visible, button:focus-visible, summary:focus-visible { outline: 3px solid var(--dawn); outline-offset: 3px; border-radius: 4px; }
h1, h2, h3 { line-height: 1.12; text-wrap: balance; margin: 0; }
p { margin: 0; max-width: var(--measure); }
.wrap { max-width: 1120px; margin: 0 auto; padding-inline: clamp(16px, 4vw, 40px); }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 16px; top: 16px; background: var(--dawn); color: var(--ink); padding: 8px 12px; z-index: 10; }

/* ---- masthead ---- */
.mast { background: var(--pine); color: var(--on-pine); }
.nav { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-block: 20px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--on-pine); text-decoration: none; font-weight: 700; font-size: 19px; }
.brand img { width: 32px; height: 32px; border-radius: 8px; }
.nav ul { display: flex; flex-wrap: wrap; gap: 6px 24px; list-style: none; margin: 0; padding: 0; font-size: 15px; }
.nav a { color: var(--on-pine-muted); text-decoration: none; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--on-pine); }

.hero { display: grid; grid-template-columns: 1.15fr .85fr; gap: 40px; align-items: end; padding-top: 40px; }
.hero > * { min-width: 0; }
.hero-copy { padding-bottom: 56px; }
.hero h1 { font-size: clamp(36px, 5.4vw, 64px); letter-spacing: -.015em; line-height: 1.02; margin-bottom: 22px; }
.hero h1 em { font-style: normal; color: var(--dawn); }
.hero p { color: var(--on-pine-muted); font-size: 19px; max-width: 40ch; margin-bottom: 28px; }
.hero .meta { font: 14px/1.5 var(--mono); color: #8FB3A3; margin-top: 18px; max-width: none; }

.stores { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.store { display: inline-flex; flex-direction: column; justify-content: center; min-height: 52px; padding: 6px 18px; border-radius: 10px; background: #000; color: #fff; border: 1px solid #555; text-decoration: none; font-size: 11px; line-height: 1.15; }
.store b { font-size: 18px; }
.store.soon { background: transparent; border: 1px dashed var(--on-pine-muted); color: var(--on-pine); }
.store.soon b { font-size: 15px; }


/* ---- reading sections ---- */
section { padding-block: clamp(56px, 8vw, 96px); }
section + section { border-top: 1px solid var(--line); }
.eyebrow { font: 500 13px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: 14px; }
section h2 { font-size: clamp(28px, 3.6vw, 42px); letter-spacing: -.01em; margin-bottom: 16px; }
.lede { font-size: 19px; color: var(--muted); }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(28px, 5vw, 64px); align-items: center; }
.split > * { min-width: 0; }
.split.flip > :first-child { order: 2; }
.art { border-radius: 14px; overflow: hidden; }

.steps { list-style: none; margin: 28px 0 0; padding: 0; display: grid; gap: 22px; counter-reset: step; }
.steps li { display: grid; grid-template-columns: 40px 1fr; gap: 14px; counter-increment: step; }
.steps li::before { content: counter(step); font: 700 15px/40px var(--mono); text-align: center; width: 40px; height: 40px; border-radius: 50%; border: 1.5px solid var(--accent); color: var(--accent); }
.steps b { display: block; font-size: 18px; margin-bottom: 2px; }
.steps span { color: var(--muted); }

/* the altitude fact, set like an instrument readout */
.readout { display: grid; grid-template-columns: repeat(3, auto); justify-content: start; gap: 8px 40px; margin-top: 28px; font-family: var(--mono); }
.readout dt { font-size: 13px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.readout dd { margin: 0; font-size: clamp(26px, 3vw, 34px); font-weight: 700; font-variant-numeric: tabular-nums; }

.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 36px 40px; margin-top: 40px; }
.grid > div { min-width: 0; }
.grid h3 { font-size: 19px; margin-bottom: 8px; }
.grid p { color: var(--muted); font-size: 16px; }
.note { font-size: 14px; color: var(--muted); margin-top: 18px; }

.platforms { display: grid; grid-template-columns: 1fr 1fr; gap: 0; margin-top: 36px; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.platforms > div { padding: 28px clamp(20px, 3vw, 34px); background: var(--surface); min-width: 0; }
.platforms > div + div { border-left: 1px solid var(--line); }
.platforms h3 { font-size: 19px; margin-bottom: 12px; }
.platforms ul { margin: 0; padding-left: 20px; color: var(--muted); display: grid; gap: 6px; }

.price { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 26px; }
.price div { border-top: 2px solid var(--accent); padding-top: 12px; }
.price b { display: block; font-size: 18px; }
.price span { color: var(--muted); font-size: 15px; }

.faq { margin-top: 28px; border-top: 1px solid var(--line); max-width: 820px; }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary { cursor: pointer; padding: 18px 0; font-weight: 700; font-size: 18px; list-style: none; display: flex; justify-content: space-between; gap: 16px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-family: var(--mono); color: var(--accent); }
.faq details[open] summary::after { content: "–"; }
.faq details p { padding-bottom: 20px; color: var(--muted); }

.cta { background: var(--pine); color: var(--on-pine); border-radius: 18px; padding: clamp(28px, 5vw, 56px); display: grid; grid-template-columns: 1fr auto; gap: 24px; align-items: center; }
.cta h2 { margin: 0 0 8px; font-size: clamp(26px, 3vw, 36px); }
.cta p { color: var(--on-pine-muted); }

footer.site { padding-block: 36px 48px; color: var(--muted); font-size: 15px; border-top: 1px solid var(--line); }
footer.site .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px 32px; }
footer.site ul { display: flex; flex-wrap: wrap; gap: 8px 22px; list-style: none; margin: 0; padding: 0; }
.ar { font-family: var(--arabic); }

/* ---- document pages (privacy, support) ---- */
.doc-head { padding-block: 36px 44px; }
.doc-head h1 { font-size: clamp(32px, 4.4vw, 48px); margin-bottom: 8px; }
.doc-head p { color: var(--on-pine-muted); }
.doc { padding-block: 48px 72px; max-width: 760px; }
.doc h2 { font-size: 23px; margin: 40px 0 10px; }
.doc p, .doc li { color: var(--ink); }
.doc p + p { margin-top: 12px; }
.doc ul, .doc ol { padding-left: 22px; display: grid; gap: 6px; }
.doc .box { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 18px 22px; margin: 20px 0; }
.doc .tbl { overflow-x: auto; margin: 16px 0; }
.doc table { border-collapse: collapse; width: 100%; font-size: 15px; min-width: 520px; }
.doc th, .doc td { text-align: left; vertical-align: top; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.doc th { font: 500 12px var(--mono); text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.updated { font: 14px var(--mono); color: var(--on-pine-muted); }
.contact-card { display: grid; gap: 6px; background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: 10px; padding: 20px 22px; margin-top: 8px; }
.contact-card .addr { font: 700 20px var(--mono); }
.copy { font: inherit; font-size: 14px; border: 1px solid var(--line); background: var(--bg); color: var(--ink); border-radius: 6px; padding: 4px 10px; cursor: pointer; justify-self: start; }

.lost { min-height: 70vh; display: grid; place-items: center; text-align: center; padding-block: 48px; }
.lost img { width: 220px; margin: 0 auto 28px; border-radius: 110px 110px 0 0; }
.lost h1 { font-size: clamp(30px, 4vw, 44px); margin-bottom: 12px; }
.lost p { margin: 0 auto 22px; color: var(--muted); }

@media (max-width: 820px) {
  .hero, .split { grid-template-columns: 1fr; }
  .split.flip > :first-child { order: 0; }
  .hero-copy { padding-bottom: 8px; }
      .grid { grid-template-columns: 1fr; }
  .platforms { grid-template-columns: 1fr; }
  .platforms > div + div { border-left: 0; border-top: 1px solid var(--line); }
  .cta { grid-template-columns: 1fr; }
  .readout { grid-template-columns: 1fr 1fr; }
  .nav ul { gap: 4px 16px; font-size: 14px; }
}
@media (max-width: 420px) {
  .price { grid-template-columns: 1fr; }
}

/* official App Store badge: Apple asks for clear space and a minimum 40px height */
.badge-apple { display: inline-block; line-height: 0; padding: 2px; }
.badge-apple img { height: 52px; width: auto; }

/* rakʿah table for travellers */
.rakah { border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: var(--surface); font-variant-numeric: tabular-nums; }
.rakah > div { display: grid; grid-template-columns: 1.2fr .8fr 1.4fr; gap: 12px; padding: 14px 20px; border-top: 1px solid var(--line); align-items: baseline; }
.rakah > div:first-child { border-top: 0; }
.rakah .rk-head { font: 500 12px var(--mono); text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.rakah span:nth-child(2), .rakah span:nth-child(3) { font-family: var(--mono); }
.rakah b { color: var(--accent); }
.rakah small { display: block; font-family: var(--sans); font-size: 13px; color: var(--muted); }
.rakah .rk-foot { grid-template-columns: 1.2fr 2.2fr; font-size: 14px; color: var(--muted); }
.rakah .rk-foot .rk-span { font-family: var(--sans); }

/* advantages band: continues the masthead so it is the first thing read after the hero */
.edge { background: var(--pine-deep); border-top: 1px solid var(--pine-line); padding-block: clamp(40px, 6vw, 64px); }
.edge h2 { color: var(--on-pine); font-size: clamp(26px, 3.2vw, 38px); margin-bottom: 28px; max-width: 22ch; }
.edge-grid { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--pine-line); }
.edge-grid > div { padding: 22px 24px 24px 0; border-bottom: 1px solid var(--pine-line); color: var(--on-pine-muted); font-size: 16px; min-width: 0; }
.edge-grid > div:not(:nth-child(3n+1)) { padding-left: 24px; border-left: 1px solid var(--pine-line); }
.edge-grid b { display: block; color: var(--dawn); font-size: 19px; line-height: 1.25; margin-bottom: 6px; }
.edge-note { font: 13px var(--mono); color: #8FB3A3; margin-top: 18px; max-width: none; }
@media (max-width: 820px) {
  .edge-grid { grid-template-columns: 1fr; }
  .edge-grid > div, .edge-grid > div:not(:nth-child(3n+1)) { padding: 18px 0; border-left: 0; }
}

/* ---- real app screenshots ---- */
figure { margin: 0; }
.phone { background: #0A1410; border-radius: 34px; padding: 8px; box-shadow: 0 24px 50px -28px rgba(0,0,0,.55); max-width: 270px; }
.phone img { border-radius: 27px; width: 100%; height: auto; }
.phone-c { margin-inline: auto; }
.hero-shot { position: relative; display: flex; justify-content: center; align-items: flex-end; min-height: 420px; }
.hero-window { position: absolute; bottom: 0; left: 50%; transform: translateX(-62%); width: 300px; border-radius: 150px 150px 0 0; opacity: .55; }
.hero-shot .phone { position: relative; width: 250px; margin-bottom: -60px; }
.mast .hero { padding-bottom: 0; }
.shots { display: flex; gap: 18px; align-items: flex-end; margin-bottom: 22px; flex-wrap: wrap; }
.shots .phone.sm { width: 150px; border-radius: 22px; padding: 5px; }
.shots .phone.sm img { border-radius: 18px; }
.watch img { width: 150px; border-radius: 34px; }
.round img { width: 140px; border-radius: 50%; border: 6px solid #0A1410; }
figcaption { font: 12px var(--mono); color: var(--muted); text-align: center; margin-top: 8px; text-transform: uppercase; letter-spacing: .05em; }
.phone figcaption { color: #8FB3A3; padding-bottom: 2px; }
@media (max-width: 820px) {
  .hero-shot { min-height: 0; padding-top: 12px; }
  .hero-window { width: 220px; }
  .hero-shot .phone { width: 210px; margin-bottom: -40px; }
}

.langs { list-style: none; margin: 26px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 10px; }
.langs li { border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 6px 16px; font-size: 18px; }
.langs li.ar { font-size: 21px; line-height: 1.3; }
.la { flex: 1 1 100%; max-width: 380px; }
.la img { width: 100%; border-radius: 22px; }

/* ---- phone-size fixes (tested at 375px) ---- */
@media (max-width: 820px) {
  /* one swipeable row of 44px-tall links instead of a wrapped block of tiny ones */
  .nav { flex-wrap: nowrap; flex-direction: column; align-items: stretch; gap: 4px; padding-block: 14px 4px; }
  .nav ul { flex-wrap: nowrap; overflow-x: auto; gap: 0 20px; -webkit-overflow-scrolling: touch; scrollbar-width: none; margin-inline: calc(-1 * clamp(16px, 4vw, 40px)); padding-inline: clamp(16px, 4vw, 40px); }
  .nav ul::-webkit-scrollbar { display: none; }
  .nav li { flex: none; }
  .nav a { display: inline-flex; align-items: center; min-height: 44px; font-size: 15px; }
  footer.site a { display: inline-flex; align-items: center; min-height: 44px; }
  /* a smaller phone in the hero so the advantages arrive sooner */
  .hero { padding-top: 16px; gap: 20px; }
  .hero-shot .phone { width: 180px; margin-bottom: -36px; }
  .hero-window { width: 170px; transform: translateX(-70%); }
  /* the rakʿah table: tighter columns, footer row stacked */
  .rakah > div { grid-template-columns: 1.15fr .75fr 1.3fr; gap: 8px; padding: 12px 14px; font-size: 15px; }
  .rakah .rk-foot { grid-template-columns: 1fr; gap: 2px; }
  .store.soon b { font-size: 14px; }
}
@media (max-width: 820px) { .phone-c { max-width: 220px; } }
.copy { min-height: 44px; padding-inline: 14px; }
@media (max-width: 600px) {
  /* privacy permissions table becomes one card per permission */
  .doc .tbl { overflow: visible; }
  .doc table, .doc tbody, .doc tr, .doc td { display: block; min-width: 0; width: 100%; }
  .doc tr:first-child { display: none; }
  .doc tr { border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; margin-bottom: 12px; background: var(--surface); }
  .doc td { border: 0; padding: 2px 0; }
  .doc td:nth-child(1) { font-size: 17px; }
  .doc td:nth-child(2) { color: var(--muted); font-size: 14px; margin-bottom: 6px; }
  .doc td:nth-child(2)::before { content: "When: "; font-weight: 700; }
}
.cta a.on-dark { color: var(--dawn); }
.doc h2.first { margin-top: 0; }
.contact-card .hint { color: var(--muted); font-size: 15px; }
.bigscreen { margin-top: 20px; border: 1px solid var(--line); border-radius: 14px; padding: 24px clamp(20px, 3vw, 34px); background: var(--surface); }
.bigscreen h3 { font-size: 19px; margin-bottom: 12px; }
.bigscreen ul { margin: 0; padding: 0; list-style: none; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px 28px; color: var(--muted); }
.bigscreen b { display: block; color: var(--ink); }
@media (max-width: 820px) { .bigscreen ul { grid-template-columns: 1fr; } }
.doc .follow { margin-top: 16px; color: var(--muted); font-size: 15px; }

/* real screenshots, round 2 */
.stack { display: grid; gap: 16px; }
.card-shot img { width: 100%; border-radius: 16px; border: 1px solid var(--line); }
.art-sm { max-width: 60%; }
.tablets { display: grid; grid-template-columns: 0.66fr 1.34fr; gap: 18px; align-items: end; margin-bottom: 20px; }
.tablets img { width: 100%; border-radius: 14px; border: 6px solid #0A1410; }
.bigscreen ul.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 820px) {
  .art-sm { max-width: 100%; }
  .tablets { grid-template-columns: 1fr; }
  .tablets figure:first-child { max-width: 70%; margin-inline: auto; }
  .bigscreen ul.two { grid-template-columns: 1fr; }
}
