/* ============================================================================
   Foglal — landing + legal. Premium, calm, salon-not-startup.
   Tokens are lifted verbatim from packages/foglal_design:
     foglal_colors.dart  → palette (light + dark)
     foglal_text_styles  → Tajawal (Arabic/body) + Playfair Display (Latin)
   ========================================================================== */

:root {
  /* Brand palette — foglal_colors.dart */
  --bg: #F7F2EE;
  --surface: #FDE7E0;
  --muted: #E7C6BB;
  --accent: #D4A373;
  --accent-deep: #B9895C;      /* darkened accent for text on light, hover */
  --text: #3A3A3A;
  --on-accent: #FFFFFF;

  /* Derived warm neutrals (kept within the brand's warm family) */
  --card: #FFFCFA;             /* warm white lift for elevated cards */
  --muted-text: #927e77;       /* legible secondary text on light */
  --line: rgba(58, 58, 58, 0.10);
  --shadow-sm: 0 2px 10px rgba(58, 42, 32, 0.06);
  --shadow-md: 0 14px 40px rgba(58, 42, 32, 0.10);
  --shadow-lg: 0 30px 70px rgba(58, 42, 32, 0.16);

  /* Type */
  --font-body: "Tajawal", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-display: "Playfair Display", Georgia, serif;

  /* Rhythm */
  --maxw: 1180px;
  --gutter: 22px;
  --radius: 20px;
  --radius-sm: 14px;
  --section-y: 72px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1E1A18;
    --surface: #2A2320;
    --muted: #3a302c;
    --accent: #D4A373;
    --accent-deep: #E0B588;
    --text: #F0EDE9;
    --card: #2F2723;
    --muted-text: #A79389;
    --line: rgba(240, 237, 233, 0.10);
    --shadow-sm: 0 2px 10px rgba(0, 0, 0, 0.30);
    --shadow-md: 0 14px 40px rgba(0, 0, 0, 0.42);
    --shadow-lg: 0 30px 70px rgba(0, 0, 0, 0.55);
  }
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }

/* ── Bilingual visibility — both langs in DOM, one shown ─────────────────── */
body.show-en .lang-ar { display: none !important; }
body:not(.show-en) .lang-en { display: none !important; }

/* Arabic needs more air than English. */
body:not(.show-en) { line-height: 1.9; }
body:not(.show-en) p { line-height: 2.0; }

/* ── Typography ─────────────────────────────────────────────────────────── */
h1, h2, h3 { margin: 0 0 0.4em; font-weight: 700; letter-spacing: -0.01em; }
/* Latin headings use Playfair; Arabic headings stay Tajawal (heavier weight). */
body.show-en h1, body.show-en h2, body.show-en h3 { font-family: var(--font-display); }
body:not(.show-en) h1,
body:not(.show-en) h2,
body:not(.show-en) h3 { font-family: var(--font-body); font-weight: 800; letter-spacing: 0; }

h1 { font-size: clamp(2rem, 6vw, 3.4rem); line-height: 1.15; }
h2 { font-size: clamp(1.5rem, 4vw, 2.3rem); line-height: 1.2; }
h3 { font-size: 1.15rem; }
p { margin: 0 0 1rem; }
a { color: var(--accent-deep); text-decoration: none; }
a:hover { text-decoration: underline; }

.eyebrow {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent-deep);
  margin-bottom: 14px;
}
body:not(.show-en) .eyebrow { letter-spacing: 0.08em; }

.lead { font-size: 1.12rem; color: var(--muted-text); max-width: 60ch; }

/* ── Layout ─────────────────────────────────────────────────────────────── */
.wrap { max-width: var(--maxw); margin-inline: auto; padding-inline: var(--gutter); }
section { padding-block: var(--section-y); }
.band { background: var(--surface); }
.section-head { max-width: 62ch; margin-bottom: 40px; }

/* ── Buttons ────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: inherit; font-size: 1rem; font-weight: 700;
  padding: 14px 26px; border-radius: 999px; cursor: pointer;
  border: 1px solid transparent; transition: transform .15s ease, box-shadow .15s ease;
}
.btn-primary { background: var(--accent); color: var(--on-accent); box-shadow: var(--shadow-sm); }
.btn-primary:hover { text-decoration: none; transform: translateY(-2px); box-shadow: var(--shadow-md); }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--muted); }
.btn-ghost:hover { text-decoration: none; border-color: var(--accent); color: var(--accent-deep); }

/* App-store badges */
.stores { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.store-badge {
  display: inline-flex; align-items: center; gap: 10px;
  background: var(--text); color: var(--bg);
  padding: 10px 18px; border-radius: 14px; min-width: 158px;
  box-shadow: var(--shadow-sm);
}
.store-badge:hover { text-decoration: none; transform: translateY(-2px); box-shadow: var(--shadow-md); transition: transform .15s ease, box-shadow .15s ease; }
.store-badge svg { width: 24px; height: 24px; flex: none; fill: var(--bg); }
.store-badge .lines { display: flex; flex-direction: column; line-height: 1.1; text-align: start; }
.store-badge .lines small { font-size: 0.62rem; opacity: 0.8; font-weight: 500; letter-spacing: 0.02em; }
.store-badge .lines b { font-size: 0.98rem; font-weight: 700; }
.stores-note { font-size: 0.8rem; color: var(--muted-text); margin-top: 10px; }

/* ── Header ─────────────────────────────────────────────────────────────── */
.site-header {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; height: 72px; }
.brand { display: inline-flex; align-items: center; gap: 12px; }
.brand:hover { text-decoration: none; }
.brand img { width: 38px; height: 38px; border-radius: 10px; box-shadow: var(--shadow-sm); }
.brand .word { font-size: 1.5rem; color: var(--text); font-weight: 700; }
body.show-en .brand .word { font-family: var(--font-display); letter-spacing: 0.01em; }
body:not(.show-en) .brand .word { font-family: var(--font-body); font-weight: 800; }

.lang-toggle {
  font-family: var(--font-body); font-size: 0.9rem; font-weight: 700;
  color: var(--accent-deep); background: transparent;
  border: 1px solid var(--muted); border-radius: 999px;
  padding: 8px 18px; cursor: pointer; transition: all .15s ease;
}
.lang-toggle:hover { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }

/* ── Hero ───────────────────────────────────────────────────────────────── */
.hero {
  position: relative; overflow: hidden;
  background:
    radial-gradient(120% 90% at 85% -10%, color-mix(in srgb, var(--surface) 90%, var(--accent) 10%) 0%, transparent 55%),
    radial-gradient(100% 80% at 0% 0%, var(--surface) 0%, transparent 50%),
    var(--bg);
}
.hero .wrap { display: grid; grid-template-columns: 1fr; gap: 40px; padding-block: 56px 64px; align-items: center; }
.hero-copy h1 { margin-bottom: 0.3em; }
.hero-copy .lead { margin-bottom: 28px; }
.hero-visual { display: flex; justify-content: center; }

/* decorative leaf sprig echoing the logo */
.leaf-deco { position: absolute; inset-inline-end: -40px; top: 40px; width: 220px; opacity: 0.14; color: var(--accent); pointer-events: none; }
body:not(.show-en) .leaf-deco { transform: scaleX(-1); }

/* ── Phone mockup (placeholder for a real app screenshot) ───────────────── */
.device {
  width: 260px; padding: 12px; border-radius: 42px;
  background: linear-gradient(160deg, #2b2320, #17130f);
  box-shadow: var(--shadow-lg);
  position: relative;
}
.device::before {
  content: ""; position: absolute; top: 20px; left: 50%; transform: translateX(-50%);
  width: 92px; height: 22px; background: #17130f; border-radius: 0 0 14px 14px; z-index: 3;
}
.device .screen {
  border-radius: 32px; overflow: hidden; background: var(--bg);
  aspect-ratio: 9 / 19.5; display: flex; flex-direction: column;
}
.appbar { flex: none; padding: 40px 18px 12px; }
.appbar .row { display: flex; align-items: center; justify-content: space-between; }
.appbar .b { font-family: var(--font-display); font-size: 1.25rem; color: var(--text); font-weight: 700; }
body:not(.show-en) .appbar .b { font-family: var(--font-body); font-weight: 800; }
.appbar .loc { font-size: 0.62rem; color: var(--muted-text); }
.chips { flex: none; display: flex; gap: 7px; padding: 4px 18px 14px; overflow: hidden; }
.chip { font-size: 0.6rem; padding: 6px 12px; border-radius: 999px; background: var(--surface); color: var(--text); white-space: nowrap; }
.chip.on { background: var(--accent); color: var(--on-accent); }
.applist { flex: 1 1 auto; min-height: 0; padding: 0 18px; display: flex; flex-direction: column; gap: 12px; }
.scard { flex: none; background: var(--card); border-radius: 16px; box-shadow: var(--shadow-sm); overflow: hidden; }
/* Default "photo coming" state — mirrors the app's _ImagePlaceholder
   (muted block + storefront icon). Cards with a photo use .img.s1/.s2/.s3
   below, which override this. */
.scard .img {
  height: 88px;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 9.5V20h16V9.5'/%3E%3Cpath d='M3 4h18l1 5a3 3 0 0 1-6 0 3 3 0 0 1-6 0 3 3 0 0 1-6 0z'/%3E%3Cpath d='M10 20v-4.6h4V20'/%3E%3C/svg%3E") center / 30px no-repeat,
    linear-gradient(160deg, var(--muted), color-mix(in srgb, var(--accent) 42%, var(--muted)));
}

/* Salon photos — WebP with JPG fallback. To swap for a real partner photo,
   replace the file at the same path (e.g. assets/salon-1.webp + .jpg). The
   first background-image is the fallback for browsers without image-set(). */
.scard .img.s1, .scard .img.s2, .scard .img.s3 {
  background-size: cover; background-position: center; background-repeat: no-repeat;
}
.scard .img.s1 {
  background-image: url("/assets/salon-1.jpg");
  background-image: image-set(url("/assets/salon-1.webp") type("image/webp"), url("/assets/salon-1.jpg") type("image/jpeg"));
}
.scard .img.s2 {
  background-image: url("/assets/salon-2.jpg");
  background-image: image-set(url("/assets/salon-2.webp") type("image/webp"), url("/assets/salon-2.jpg") type("image/jpeg"));
}
.scard .img.s3 {
  background-image: url("/assets/salon-3.jpg");
  background-image: image-set(url("/assets/salon-3.webp") type("image/webp"), url("/assets/salon-3.jpg") type("image/jpeg"));
}
.scard .body { padding: 9px 11px; }
.scard .t { font-size: 0.72rem; font-weight: 700; color: var(--text); }
.scard .m { font-size: 0.58rem; color: var(--muted-text); margin-top: 3px; display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.scard .m .loc { display: inline-flex; align-items: center; gap: 4px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.scard .m .loc svg { width: 11px; height: 11px; flex: none; }
.scard .m .dist { flex: none; }

/* ── Feature grid ───────────────────────────────────────────────────────── */
.grid { display: grid; grid-template-columns: 1fr; gap: 18px; }
.feature {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 26px 24px; box-shadow: var(--shadow-sm);
  transition: transform .18s ease, box-shadow .18s ease;
}
.feature:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.feature .ico {
  width: 52px; height: 52px; border-radius: 15px; margin-bottom: 16px;
  display: grid; place-items: center;
  background: color-mix(in srgb, var(--accent) 16%, transparent);
  color: var(--accent-deep);
}
.feature .ico svg { width: 26px; height: 26px; }
.feature h3 { color: var(--text); margin-bottom: 6px; }
.feature p { color: var(--muted-text); margin: 0; font-size: 0.96rem; }

/* ── Salons CTA panel ───────────────────────────────────────────────────── */
.salon-panel {
  background: linear-gradient(150deg, color-mix(in srgb, var(--accent) 22%, var(--surface)), var(--surface));
  border: 1px solid var(--line); border-radius: calc(var(--radius) + 6px);
  padding: 40px 30px; box-shadow: var(--shadow-sm);
}
.salon-panel .grid { margin-top: 26px; }
.salon-panel .feature { background: color-mix(in srgb, var(--card) 78%, transparent); }

/* ── Trust band ─────────────────────────────────────────────────────────── */
.trust { display: grid; grid-template-columns: 1fr; gap: 18px; }
.trust .item { display: flex; gap: 16px; align-items: flex-start; }
.trust .ico {
  width: 46px; height: 46px; border-radius: 13px; flex: none; display: grid; place-items: center;
  background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--accent-deep);
}
.trust .ico svg { width: 24px; height: 24px; }
.trust h3 { margin-bottom: 4px; }
.trust p { margin: 0; color: var(--muted-text); font-size: 0.95rem; }

/* ── Footer ─────────────────────────────────────────────────────────────── */
.site-footer { background: var(--surface); border-top: 1px solid var(--line); padding-block: 44px; }
.site-footer .top { display: flex; flex-wrap: wrap; gap: 28px; justify-content: space-between; margin-bottom: 28px; }
.site-footer .brand .word { font-size: 1.3rem; }
.site-footer .tag { color: var(--muted-text); font-size: 0.9rem; margin-top: 8px; max-width: 34ch; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 20px; align-items: center; }
.site-footer nav a { color: var(--text); font-size: 0.95rem; }
.site-footer nav a:hover { color: var(--accent-deep); }
.site-footer .entity { color: var(--muted-text); font-size: 0.82rem; border-top: 1px solid var(--line); padding-top: 20px; }

/* ── Legal pages ────────────────────────────────────────────────────────── */
.legal { max-width: 820px; padding-block: 48px 72px; }
.legal h1 { margin-bottom: 6px; }
.legal .updated { color: var(--muted-text); font-size: 0.88rem; margin-bottom: 30px; }
.legal h2 { font-size: 1.3rem; margin-top: 36px; }
.legal ul { padding-inline-start: 22px; }
.legal li { margin-bottom: 8px; }
.legal .draft-note {
  background: color-mix(in srgb, var(--accent) 12%, var(--bg));
  border: 1px dashed var(--accent); border-radius: var(--radius-sm);
  padding: 14px 18px; font-size: 0.88rem; color: var(--muted-text); margin-bottom: 28px;
}
.back-link { display: inline-flex; align-items: center; gap: 8px; margin-top: 12px; font-weight: 700; }
.back-link .arrow::before { content: "\2192"; }           /* → */
body:not(.show-en) .back-link .arrow::before { content: "\2190"; }  /* ← flipped for RTL */

/* ── Responsive ─────────────────────────────────────────────────────────── */
@media (min-width: 768px) {
  :root { --section-y: 96px; }
  .grid { grid-template-columns: repeat(2, 1fr); gap: 22px; }
  .trust { grid-template-columns: repeat(3, 1fr); gap: 28px; }
  .hero .wrap { grid-template-columns: 1.05fr 0.95fr; gap: 48px; padding-block: 72px 88px; }
  .device { width: 288px; }
  .salon-panel { padding: 52px 44px; }
}

@media (min-width: 1100px) {
  .grid { grid-template-columns: repeat(4, 1fr); }
  .salon-panel .grid { grid-template-columns: repeat(4, 1fr); }
  .device { width: 300px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; scroll-behavior: auto; }
}
