/* Amānah — shared foundations for amaneh.app
   Tokens mirror the app design system (amanah.css). */

@import url('https://fonts.googleapis.com/css2?family=Amiri:ital,wght@0,400;0,700;1,400&family=Tajawal:wght@300;400;500;700;800&family=Cormorant+Garamond:ital,wght@0,400;0,500;0,600;0,700;1,400&family=Albert+Sans:wght@300;400;500;600;700;800&display=swap');

:root {
  /* surfaces */
  --paper: #f3ede0;
  --paper-2: #f8f3e8;
  --card: #fbf7ee;
  --sunk: #efe7d6;
  /* ink */
  --ink: #21251f;
  --soft: #5d6157;
  --faint: #8b8d80;
  /* green */
  --green: #16382c;
  --green-2: #1d4836;
  --green-deep: #0f271e;
  --on-green: #efe6d2;
  --on-green-soft: #b9c5b4;
  /* the single sacred accent */
  --gold: #ab8232;
  --gold-press: #946d24;
  --gold-soft: #c8a868;
  --gold-tint: rgba(171, 130, 50, 0.12);
  /* semantic */
  --ok: #2f7d4f;
  --warn: #b5832b;
  --bad: #b23b2e;
  /* line */
  --line: rgba(33, 37, 31, 0.10);
  --line-green: rgba(239, 230, 210, 0.16);

  /* type */
  --display: 'Cormorant Garamond', 'Amiri', Georgia, serif;
  --body: 'Albert Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --arabic: 'Amiri', 'Cormorant Garamond', Georgia, serif;
  --arabic-ui: 'Tajawal', 'Albert Sans', sans-serif;

  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --shadow-soft: 0 1px 2px rgba(33,37,31,.04), 0 8px 24px rgba(33,37,31,.06);
  --shadow-lift: 0 2px 6px rgba(33,37,31,.06), 0 24px 60px rgba(33,37,31,.12);
  --shadow-phone: 0 30px 80px rgba(15,39,30,.28), 0 8px 24px rgba(15,39,30,.16);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }

/* ── language ───────────────────────────────────────────── */
html[lang="ar"] body { font-family: var(--arabic-ui); }
html[lang="ar"] .display,
html[lang="ar"] h1, html[lang="ar"] h2, html[lang="ar"] h3 { font-family: var(--arabic); font-weight: 700; }
html[lang="ar"] .label { letter-spacing: 0 !important; text-transform: none !important; font-family: var(--arabic-ui); font-weight: 700; }
html[lang="ar"] .dot-en { display: none; }
html[lang="en"] .dot-en { color: var(--gold); }

.display, h1, h2, h3 { font-family: var(--display); font-weight: 600; line-height: 1.02; letter-spacing: -0.01em; }
html[lang="ar"] .display, html[lang="ar"] h1, html[lang="ar"] h2, html[lang="ar"] h3 { line-height: 1.35; letter-spacing: 0; }

/* latin fragments inside an RTL page must stay LTR */
code, .ltr, .mono { direction: ltr; unicode-bidi: isolate; }
html[dir="rtl"] .ltr { text-align: right; }

.label {
  font-family: var(--body);
  font-weight: 700;
  font-size: 10.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold);
}

/* ── layout helpers ─────────────────────────────────────── */
.wrap { width: min(1180px, 92vw); margin-inline: auto; }
.narrow { width: min(760px, 92vw); margin-inline: auto; }
.grain { position: relative; }
.grain::before {
  content: ''; position: absolute; inset: 0; pointer-events: none; opacity: .5;
  background-image: radial-gradient(rgba(33,37,31,.055) 1px, transparent 1px);
  background-size: 22px 22px;
}
.on-green .grain::before, .green-panel::before {
  background-image: radial-gradient(rgba(239,230,210,.05) 1px, transparent 1px);
}

/* ── buttons ────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 15px 28px; border-radius: 999px;
  font-weight: 700; font-size: 15px; letter-spacing: .01em;
  transition: transform .18s var(--ease), background .18s var(--ease), box-shadow .18s var(--ease);
}
.btn:active { transform: scale(.975); }
.btn-gold { background: var(--gold); color: #fff; box-shadow: 0 8px 26px rgba(171,130,50,.32); }
.btn-gold:hover { background: var(--gold-press); }
.btn-ghost { border: 1px solid var(--line); color: var(--ink); }
.btn-ghost:hover { background: var(--sunk); }
.btn-ghost-green { border: 1px solid var(--line-green); color: var(--on-green); }
.btn-ghost-green:hover { background: rgba(239,230,210,.07); }
html[lang="ar"] .btn .arrow { transform: scaleX(-1); }

/* ── the iPhone frame ───────────────────────────────────
   Frame art is 1350×2760; the live screen sits at
   x 72 → 1277, y 68 → 2690 (1206×2623). Percentages below
   are derived from those measurements. */
.phone {
  position: relative;
  width: var(--pw, 280px);
  aspect-ratio: 1350 / 2760;
  flex: none;
}
.phone .screen {
  position: absolute;
  left: 5.333%; top: 2.464%;
  width: 89.333%; height: 95.036%;
  object-fit: cover; object-position: top center;
  border-radius: 10.4% / 4.78%;
  background: var(--paper);
  z-index: 1;
}
.phone .frame {
  position: absolute; inset: 0; width: 100%; height: 100%;
  z-index: 2; pointer-events: none;
  filter: drop-shadow(0 24px 50px rgba(15,39,30,.30));
}
.phone.floats { transition: transform .5s var(--ease); }
.phone.floats:hover { transform: translateY(-8px); }

/* phones in a row: same size, same baseline — never staggered */
.phones { display: flex; gap: 42px; flex-wrap: wrap; justify-content: center; align-items: flex-start; }
.phones .pcol { display: flex; flex-direction: column; align-items: center; }

/* ── ornament: eight-point star tile ─────────────────────── */
.pattern { position: relative; }
.pattern::after {
  content: ''; position: absolute; inset: 0; pointer-events: none; opacity: .5;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='72' height='72' viewBox='0 0 72 72'%3E%3Cpath d='M36 6 44 14h11v11l8 11-8 11v11H44l-8 8-8-8H17V47L9 36l8-11V14h11z' fill='none' stroke='%23ab8232' stroke-opacity='.16' stroke-width='1'/%3E%3C/svg%3E");
  background-size: 72px 72px;
}
.pattern.on-dark::after {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='72' height='72' viewBox='0 0 72 72'%3E%3Cpath d='M36 6 44 14h11v11l8 11-8 11v11H44l-8 8-8-8H17V47L9 36l8-11V14h11z' fill='none' stroke='%23c8a868' stroke-opacity='.14' stroke-width='1'/%3E%3C/svg%3E");
}

/* ── graphic bits ────────────────────────────────────────── */
.hairline { height: 1px; background: linear-gradient(90deg, transparent, var(--line), transparent); }
.orn { display: flex; align-items: center; gap: 14px; color: var(--gold); }
/* rules fade out at both ends — no hard seam */
.orn::before, .orn::after {
  content: ''; height: 1px; flex: 1;
  background: linear-gradient(90deg, transparent, currentColor 45%, transparent);
  opacity: .55;
}
.orn svg { width: 18px; height: 18px; flex: none; }
.bignum { font-family: var(--display); font-size: clamp(56px, 8vw, 104px); line-height: .9; color: var(--gold); }
html[lang="ar"] .bignum { font-family: var(--arabic); }

/* screen caption */
.phone-cap {
  margin-top: 18px; text-align: center;
  font-size: 12.5px; color: var(--faint); letter-spacing: .02em;
}
.phone-cap b { display: block; color: var(--ink); font-size: 14.5px; font-weight: 700; letter-spacing: 0; margin-bottom: 3px; }

/* ── language switch ────────────────────────────────────── */
.langswitch {
  display: inline-flex; align-items: center;
  background: rgba(33,37,31,.06); border-radius: 999px; padding: 3px;
  font-size: 12.5px; font-weight: 700;
}
.on-green .langswitch, .langswitch.on-dark { background: rgba(239,230,210,.12); }
.langswitch button { padding: 6px 14px; border-radius: 999px; color: inherit; opacity: .6; }
.langswitch button[aria-pressed="true"] { background: var(--gold); color: #fff; opacity: 1; }

/* ── reveal on scroll ───────────────────────────────────── */
.reveal { opacity: 0; transform: translateY(18px); }
.reveal.in { opacity: 1; transform: none; transition: opacity .7s var(--ease), transform .7s var(--ease); }

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
  html { scroll-behavior: auto; }
}
