/* HelalScan marketing + compliance site — static, no cookies, no trackers.
   Skinned from the app's own tokens (artifacts/halal-scanner/constants/colors.ts):
   emerald/teal trust palette, Inter, radii 20/28/pill, girih lattice, and the
   حلال rosette logomark the app draws in components/Seal.tsx. Light AND dark —
   the site follows the device, exactly like the app's "system" theme mode. */
:root {
  /* Tell the browser we support both, so it themes its OWN widgets to match:
     form controls, scrollbars, the text caret and the default canvas. Without
     this the page is dark but the scrollbar and inputs stay light. */
  color-scheme: light dark;

  --emerald: #0E8A63;
  --emerald-deep: #0A6B4D;
  --teal: #155E63;
  --bg: #F5F4EF;
  --fg: #1B2A24;
  --body: #2B3A33;
  --muted-fg: #68766E;
  --card: #FFFFFF;
  --wash: #E7F1EC;
  --wash-border: #CFE3D8;
  --border: #E6E2D8;
  --chip: #F1EFE8;
  --footer-bg: #EFEDE6;

  --halal: #0E8A63;      --halal-bg: #DCEFE7;
  --noconcern: #5E9E74;  --noconcern-bg: #E7F0EA;
  --doubtful: #C4871B;   --doubtful-bg: #F8EEDA;
  --doubtful-border: #EAD3A0;
  --haram: #B94A4A;      --haram-bg: #F6E4E4;
  --utv: #7F8A86;        --utv-bg: #ECEEED;

  --plate-from: #0E8A63;
  --plate-to: #0A6B4D;
  --on-plate: #FFFFFF;
  --on-plate-dim: rgba(255, 255, 255, 0.82);

  --radius: 20px;        /* app cards */
  --radius-lg: 28px;     /* app verdict card / hero plate */
  --radius-pill: 999px;
  --maxw: 900px;
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --emerald: #2FAF86;
    --emerald-deep: #268F6E;
    --teal: #3E9BA3;
    --bg: #101713;
    --fg: #ECF2EE;
    --body: #C9D5CE;
    --muted-fg: #96A69C;
    --card: #182119;
    --wash: #1C2C24;
    --wash-border: #26332B;
    --border: #26332B;
    --chip: #1F2A22;
    --footer-bg: #0C110E;

    --halal: #2FAF86;      --halal-bg: #17281F;
    --noconcern: #77B389;  --noconcern-bg: #1E2A22;
    --doubtful: #D8A544;   --doubtful-bg: #332A14;
    --doubtful-border: #4A3D1E;
    --haram: #CF6B6B;      --haram-bg: #33201F;
    --utv: #8D9994;        --utv-bg: #232A27;

    /* The emerald plate stays deep and saturated in dark, like the app hero. */
    --plate-from: #0F5E44;
    --plate-to: #0A4433;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; font-family: var(--font); color: var(--fg); background: var(--bg);
  line-height: 1.65; font-size: 17px; -webkit-font-smoothing: antialiased;
}
a { color: var(--emerald-deep); text-decoration: none; }
@media (prefers-color-scheme: dark) { a { color: var(--emerald); } }
a:hover { text-decoration: underline; }
img { max-width: 100%; }

/* ---- header ---- */
.site-header {
  position: sticky; top: 0; z-index: 10;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(140%) blur(8px);
  border-bottom: 1px solid var(--border);
}
.nav {
  max-width: var(--maxw); margin: 0 auto; padding: 13px 20px;
  display: flex; align-items: center; gap: 18px;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; color: var(--fg); font-size: 18px; letter-spacing: -0.2px; }
.brand:hover { text-decoration: none; }
.brand .seal { width: 32px; height: 32px; flex: none; color: var(--emerald); }
.nav .spacer { flex: 1; }
.nav a.navlink { color: var(--muted-fg); font-weight: 500; font-size: 15px; }
.nav a.navlink:hover { color: var(--emerald); text-decoration: none; }
.nav a.navlink.lang {
  border: 1px solid var(--border); border-radius: var(--radius-pill);
  padding: 5px 12px; font-size: 13.5px;
}
@media (max-width: 560px) { .nav a.navlink { display: none; } .nav a.navlink.lang { display: inline-block; } }

/* ---- layout ---- */
main { max-width: var(--maxw); margin: 0 auto; padding: 0 20px 64px; }

/* ---- index hero: the app's emerald trust plate, girih lattice and all ---- */
.hero { padding: 40px 0 8px; }
.hero-plate {
  position: relative; overflow: hidden; text-align: center;
  background: linear-gradient(160deg, var(--plate-from), var(--plate-to));
  border-radius: var(--radius-lg);
  padding: 56px 28px 48px;
  color: var(--on-plate);
}
.hero-plate::before {
  /* GirihOverlay.tsx: two nested 8-point stars on a 96px lattice. */
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='96' height='96'%3E%3Cpath d='M48 8 58 38 88 48 58 58 48 88 38 58 8 48 38 38Z' fill='none' stroke='%23FFFFFF' stroke-opacity='0.12'/%3E%3Cpath d='M48 24 55 41 72 48 55 55 48 72 41 55 24 48 41 41Z' fill='none' stroke='%23FFFFFF' stroke-opacity='0.12'/%3E%3C/svg%3E");
}
.hero-plate .mark { width: 84px; height: 84px; margin: 0 auto 18px; display: block; color: var(--on-plate); }
.hero-plate h1 { font-size: 40px; line-height: 1.12; letter-spacing: -0.6px; margin: 0 0 12px; color: var(--on-plate); }
.hero-plate p.lede { font-size: 19px; color: var(--on-plate-dim); max-width: 640px; margin: 0 auto 26px; }
@media (max-width: 560px) {
  .hero-plate { padding: 40px 20px 36px; }
  .hero-plate h1 { font-size: 29px; }
  .hero-plate p.lede { font-size: 17px; }
}

.badge-row { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--emerald); color: #fff; font-weight: 600; font-size: 16px;
  padding: 13px 26px; border-radius: var(--radius-pill); border: 0; cursor: pointer;
}
.btn:hover { background: var(--emerald-deep); text-decoration: none; }
.btn.secondary { background: transparent; color: var(--emerald-deep); border: 1px solid var(--border); }
@media (prefers-color-scheme: dark) { .btn.secondary { color: var(--emerald); } }
/* on the emerald plate, buttons invert */
.hero-plate .btn { background: #FFFFFF; color: var(--emerald-deep); }
.hero-plate .btn:hover { background: #E7F1EC; }
.hero-plate .btn.secondary { background: transparent; color: var(--on-plate); border: 1px solid rgba(255,255,255,0.45); }

.plate-search {
  flex: 1; min-width: 220px; max-width: 380px;
  font: inherit; font-size: 16px; color: var(--fg);
  background: #FFFFFF; border: 0; border-radius: var(--radius-pill);
  padding: 13px 22px; outline: none;
}
.plate-search::placeholder { color: #68766E; }
@media (prefers-color-scheme: dark) { .plate-search { background: #101713; color: var(--fg); } .plate-search::placeholder { color: var(--muted-fg); } }

/* the app home's verdict chips */
.chips { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin: 22px 0 0; padding: 0; list-style: none; }
.chip {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 14px; font-weight: 600;
  padding: 7px 15px; border-radius: var(--radius-pill);
}
.chip::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.chip.halal { background: var(--halal-bg); color: var(--halal); }
.chip.doubtful { background: var(--doubtful-bg); color: var(--doubtful); }
.chip.haram { background: var(--haram-bg); color: var(--haram); }

.page-title { padding: 48px 0 8px; }
.page-title h1 { font-size: 32px; margin: 0 0 6px; letter-spacing: -0.3px; }
.page-title .updated { color: var(--muted-fg); font-size: 14px; }

h2 { font-size: 22px; margin: 40px 0 10px; letter-spacing: -0.2px; }
h3 { font-size: 17px; margin: 22px 0 6px; }
p, li { color: var(--body); }
.muted { color: var(--muted-fg); }

/* cards / grid */
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 16px; margin: 28px 0; }
.card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 22px;
}
.card .ic {
  width: 44px; height: 44px; border-radius: 14px;
  background: var(--wash); color: var(--emerald);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; line-height: 1; margin-bottom: 12px;
}
.card h3 { margin: 0 0 6px; font-size: 17px; }
.card p { margin: 0; font-size: 15px; color: var(--muted-fg); }

/* verdict legend — styled like the app's verdict cards */
.verdicts { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px; margin: 20px 0; }
.verdict {
  border-radius: var(--radius); padding: 16px 18px; font-size: 14.5px;
  border: 1px solid transparent;
}
.verdict strong { display: block; font-size: 15.5px; margin-bottom: 3px; }
.verdict span { color: inherit; opacity: 0.85; }
.verdict.halal { background: var(--halal-bg); color: var(--halal); }
.verdict.noconcern { background: var(--noconcern-bg); color: var(--noconcern); }
.verdict.doubtful { background: var(--doubtful-bg); color: var(--doubtful); }
.verdict.haram { background: var(--haram-bg); color: var(--haram); }

.flow-ic { display: inline-block; width: 17px; height: 17px; vertical-align: -3px; margin-right: 7px; color: var(--emerald); }
.flow-ic svg { width: 100%; height: 100%; }
.ic svg { width: 22px; height: 22px; }

.brand-text { display: flex; flex-direction: column; line-height: 1.05; }
.brand-text small { font-size: 10px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted-fg); }

/* E-number tool */
.tool-search { margin: 6px 0 18px; }
.tool-search input {
  width: 100%; font: inherit; font-size: 16px; color: var(--fg);
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 14px 18px; outline: none;
}
.tool-search input:focus { border-color: var(--emerald); box-shadow: 0 0 0 3px color-mix(in srgb, var(--emerald) 22%, transparent); }
.tool-search input::placeholder { color: var(--muted-fg); }

.enum { width: 100%; table-layout: fixed; border-collapse: collapse; margin: 6px 0 18px; font-size: 15px; }
.enum col.c-num { width: 110px; }
.enum col.c-status { width: 190px; }
.enum td, .enum th { overflow-wrap: anywhere; }
.enum th, .enum td { text-align: left; padding: 12px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
.enum th { color: var(--muted-fg); font-weight: 600; font-size: 13.5px; text-transform: uppercase; letter-spacing: 0.4px; }
.enum td:first-child { font-weight: 700; }
.enum .chip { font-size: 12.5px; padding: 5px 12px; white-space: nowrap; }
.enum tr:target td { background: var(--wash); }
.enum-link { color: inherit; }
.enum-link:hover { color: var(--emerald); text-decoration: none; }
.enum tbody tr:hover td { background: color-mix(in srgb, var(--wash) 55%, transparent); }
.enum tbody tr[aria-expanded="true"] td { background: var(--wash); }
.enum tr.more td { padding: 0; border-bottom: 1px solid var(--border); }
.more-body {
  background: var(--wash); border-left: 4px solid var(--emerald);
  border-radius: 12px; margin: 4px 0 14px; padding: 16px 18px;
}
.more-body .more-head { font-weight: 700; font-size: 15px; margin-bottom: 8px; color: var(--fg); }
.more-body p { margin: 0 0 8px; font-size: 15px; line-height: 1.6; }
.more-body p:last-child { margin-bottom: 0; }
.more-body strong { color: var(--fg); }
.hint { color: var(--muted-fg); font-size: 13.5px; margin: -6px 0 16px; }
@media (max-width: 640px) {
  .enum { font-size: 14.5px; }
  .enum col.c-num { width: 74px; }
  .enum col.c-status { width: 132px; }
  .enum th, .enum td { padding: 11px 6px; }
  .enum .chip {
    font-size: 11.5px; padding: 4px 8px; gap: 5px;
    max-width: 100%; white-space: normal; text-align: left;
  }
  .enum .chip::before { flex: none; }
}
.chip.noconcern { background: var(--noconcern-bg); color: var(--noconcern); }
.chip.utv { background: var(--utv-bg); color: var(--utv); }


/* Chip text is small and bold on a tinted background, where the brand colours
   land at 2.7-4.1:1 — below the 4.5:1 WCAG AA needs. Same hues, darkened just
   far enough to pass. Measured, not eyeballed: see tools/qa-contrast output. */
.chip.noconcern { color: #467657; }
.chip.doubtful  { color: #916313; }
.chip.haram     { color: #AF4646; }
.chip.halal     { color: #0C7957; }
@media (prefers-color-scheme: dark) {
  /* Dark chips already pass except Not halal, a hair under at 4.37:1. */
  .chip.noconcern { color: #77B389; }
  .chip.doubtful  { color: #D8A544; }
  .chip.haram     { color: #D06F6F; }
  .chip.halal     { color: #2FAF86; }
}

/* Touch targets: the language pill and the E-number link were under 40px. */
.nav a.navlink.lang { padding: 9px 14px; }
.enum-link { display: inline-block; padding: 6px 2px; }

/* callout / disclaimer */
.callout {
  background: var(--wash); border: 1px solid var(--wash-border); border-left: 4px solid var(--emerald);
  border-radius: 12px; padding: 16px 18px; margin: 24px 0; font-size: 15.5px;
}
.callout.warn { background: var(--doubtful-bg); border-color: var(--doubtful-border); border-left-color: var(--doubtful); }

/* privacy "what we do / don't" table */
.pp { width: 100%; border-collapse: collapse; margin: 18px 0; font-size: 15.5px; }
.pp th, .pp td { text-align: left; padding: 11px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
.pp th { color: var(--muted-fg); font-weight: 600; width: 38%; }
@media (max-width: 560px) {
  /* A 38% label column squeezes "A random device identifier" into three lines.
     Stack the pairs instead: label, then value, full width. */
  .pp, .pp tbody, .pp tr, .pp th, .pp td { display: block; width: auto; }
  .pp tr { padding: 12px 0; border-bottom: 1px solid var(--border); }
  .pp th, .pp td { border: 0; padding: 0; }
  .pp th { margin-bottom: 4px; color: var(--fg); }
}
.tag { display: inline-block; font-size: 12px; font-weight: 700; padding: 2px 9px; border-radius: var(--radius-pill); }
.tag.no { background: var(--wash); color: var(--emerald-deep); }
@media (prefers-color-scheme: dark) { .tag.no { color: var(--emerald); } }
.tag.yes { background: var(--chip); color: var(--fg); }

/* data-flow steps */
.flow { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 20px 0; }
.flow .step { background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; font-size: 14.5px; flex: 1; min-width: 150px; }
.flow .arrow { color: var(--muted-fg); font-size: 20px; }

/* footer */
.site-footer { border-top: 1px solid var(--border); background: var(--footer-bg); }
.foot { max-width: var(--maxw); margin: 0 auto; padding: 30px 20px; display: flex; flex-wrap: wrap; gap: 18px; align-items: center; }
.foot .links { display: flex; gap: 16px; flex-wrap: wrap; }
.foot a { color: var(--muted-fg); font-size: 14px; }
.foot .fine { color: var(--muted-fg); font-size: 13px; width: 100%; margin-top: 6px; }
