/* InventWise site — plain CSS, no build step. Colours follow apps/web/src/styles.css. */
:root {
  color-scheme: light dark;
  --bg: #f4f6f8;
  --surface: #ffffff;
  --surface-2: #f9fbfb;
  --text: #162b36;
  --heading: #173e47;
  --body: #344c56;
  --muted: #73848c;
  --border: #e5eaed;
  --accent: #0d766e;
  --accent-hover: #095f59;
  --accent-text: #075f59;
  --accent-tint: #e9f4f2;
  --on-accent: #ffffff;
  --hero-glow: #e6f1f0;
  --shadow: 0 8px 30px rgb(21 43 54 / 5%);
  --radius: 12px;
  --gutter: 16px;
  --max: 1080px;
  font-family: "Segoe UI", Tahoma, "Noto Sans Arabic", "Noto Sans", system-ui, -apple-system, Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e171c;
    --surface: #152229;
    --surface-2: #1a2a32;
    --text: #e3ebee;
    --heading: #eef4f6;
    --body: #c3d0d5;
    --muted: #93a5ac;
    --border: #263840;
    --accent: #3cb4a8;
    --accent-hover: #5cc6bb;
    --accent-text: #6fd0c5;
    --accent-tint: #173832;
    --on-accent: #06211e;
    --hero-glow: #12302d;
    --shadow: 0 8px 30px rgb(0 0 0 / 25%);
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-width: 320px;
  background: var(--bg);
  color: var(--text);
  line-height: 1.75;
  font-size: 16px;
  text-rendering: optimizeLegibility;
  overflow-wrap: break-word;
}
img, svg { max-width: 100%; }
a { color: var(--accent-text); text-underline-offset: 3px; }
a:hover { color: var(--accent-hover); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

.wrap { width: min(100% - 2 * var(--gutter), var(--max)); margin-inline: auto; }
.narrow { width: min(100% - 2 * var(--gutter), 780px); margin-inline: auto; }

.skip { position: absolute; inset-inline-start: -9999px; }
.skip:focus { inset-inline-start: var(--gutter); top: 8px; z-index: 10; padding: 8px 12px; background: var(--surface); }

/* Header */
.site-header { background: var(--surface); border-bottom: 1px solid var(--border); }
.header-row { display: flex; align-items: center; justify-content: space-between; gap: 12px 20px; flex-wrap: wrap; padding-block: 14px; }
.brand { display: flex; align-items: center; gap: 12px; color: var(--heading); text-decoration: none; min-width: 0; }
.brand:hover { color: var(--heading); }
.brand picture { display: block; flex: none; }
.brand-logo { display: block; width: auto; height: 48px; max-width: 100%; }
.site-nav { display: flex; align-items: center; gap: 4px 6px; flex-wrap: wrap; }
.site-nav a { padding: 6px 10px; border-radius: 8px; color: var(--body); text-decoration: none; font-size: 14.5px; }
.site-nav a:hover { background: var(--accent-tint); color: var(--accent-text); }
.site-nav a[aria-current="page"] { background: var(--accent-tint); color: var(--accent-text); font-weight: 600; }
.site-nav .lang { border: 1px solid var(--border); }

/* Hero */
.hero { background: radial-gradient(ellipse at 50% 0%, var(--hero-glow) 0%, var(--bg) 62%); padding-block: 56px 40px; }
.eyebrow { margin: 0 0 10px; color: var(--accent-text); font-weight: 700; font-size: 14px; }
.hero h1 { margin: 0 0 14px; color: var(--heading); font-size: clamp(28px, 6vw, 44px); line-height: 1.25; letter-spacing: -.01em; max-width: 20ch; }
.lead { margin: 0 0 26px; font-size: clamp(16px, 2.4vw, 19px); color: var(--body); max-width: 62ch; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; }
.button { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 18px; border-radius: 8px; font-weight: 600; text-decoration: none; border: 1px solid transparent; }
.button.primary { background: var(--accent); color: var(--on-accent); }
.button.primary:hover { background: var(--accent-hover); color: var(--on-accent); }
.button.secondary { background: var(--surface); color: var(--body); border-color: var(--border); }
.button.secondary:hover { background: var(--surface-2); color: var(--accent-text); }

/* Sections */
main { display: block; }
.section { padding-block: 44px; }
.section + .section { padding-top: 8px; }
.section h2 { margin: 0 0 8px; color: var(--heading); font-size: clamp(22px, 3.6vw, 28px); line-height: 1.35; }
.section > .wrap > p.sub, .section-intro { margin: 0 0 24px; color: var(--muted); max-width: 64ch; }

.grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); min-width: 0; }
.card h3 { margin: 0 0 6px; color: var(--heading); font-size: 17px; line-height: 1.45; }
.card p { margin: 0; color: var(--body); font-size: 15px; }
.icon { width: 36px; height: 36px; display: grid; place-items: center; margin-bottom: 12px; border-radius: 50%; background: var(--accent-tint); color: var(--accent-text); }
.icon svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); counter-reset: step; }
.steps li { counter-increment: step; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; }
.steps li::before { content: counter(step); display: grid; place-items: center; width: 30px; height: 30px; margin-bottom: 10px; border-radius: 50%; background: var(--accent); color: var(--on-accent); font-weight: 700; font-size: 14px; }
.steps h3 { margin: 0 0 6px; font-size: 17px; color: var(--heading); }
.steps p { margin: 0; font-size: 15px; color: var(--body); }

.contact { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 28px; box-shadow: var(--shadow); }
.contact h2 { margin-top: 0; }
.contact p { margin: 0 0 18px; color: var(--body); max-width: 64ch; }

/* Long-form pages (privacy, support) */
.doc { padding-block: 36px 56px; }
.doc h1 { margin: 0 0 6px; color: var(--heading); font-size: clamp(26px, 5vw, 36px); line-height: 1.3; }
.doc .meta { margin: 0 0 24px; color: var(--muted); font-size: 14px; }
.doc h2 { margin: 34px 0 10px; color: var(--heading); font-size: 21px; line-height: 1.4; scroll-margin-top: 16px; }
.doc h3 { margin: 22px 0 6px; color: var(--heading); font-size: 17px; }
.doc p, .doc li { color: var(--body); }
.doc p { margin: 0 0 12px; }
.doc ul, .doc ol { margin: 0 0 14px; padding-inline-start: 22px; }
.doc li { margin-bottom: 6px; }
.doc code { font-family: ui-monospace, Consolas, monospace; font-size: .92em; background: var(--surface-2); border: 1px solid var(--border); border-radius: 5px; padding: 0 5px; }
.summary { background: var(--accent-tint); border-radius: var(--radius); padding: 16px 20px; margin: 0 0 24px; }
.summary p:last-child, .summary ul:last-child { margin-bottom: 0; }
.toc { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 20px; margin: 0 0 8px; }
.toc strong { display: block; margin-bottom: 6px; color: var(--heading); }
.toc ol { margin: 0; columns: 2 220px; column-gap: 28px; }
.toc li { margin-bottom: 2px; break-inside: avoid; }

.table-wrap { overflow-x: auto; margin: 0 0 16px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
table { width: 100%; border-collapse: collapse; font-size: 15px; }
th, td { padding: 10px 14px; text-align: start; vertical-align: top; border-bottom: 1px solid var(--border); color: var(--body); }
th { color: var(--heading); background: var(--surface-2); font-weight: 700; }
tr:last-child td { border-bottom: 0; }

/* Stacked tables on narrow screens: each row becomes a small card, so no sideways scrolling. */
@media (max-width: 640px) {
  .stack thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .stack tr { display: block; padding: 12px 14px; border-bottom: 1px solid var(--border); }
  .stack tr:last-child { border-bottom: 0; }
  .stack td { display: block; padding: 2px 0; border: 0; }
  .stack td::before { content: attr(data-label); display: block; font-size: 12.5px; font-weight: 700; color: var(--muted); }
  .stack td:first-child { color: var(--heading); font-weight: 700; }
  .stack td:first-child::before { display: none; }
}

details.faq { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); margin: 0 0 10px; }
details.faq summary { cursor: pointer; padding: 14px 18px; font-weight: 600; color: var(--heading); list-style-position: inside; }
details.faq[open] summary { border-bottom: 1px solid var(--border); }
details.faq > div { padding: 12px 18px 4px; }

.note { border-inline-start: 4px solid var(--accent); background: var(--surface); padding: 12px 16px; border-radius: 8px; margin: 0 0 16px; }
.note p:last-child { margin-bottom: 0; }

/* 404 */
.notfound { min-height: 60vh; display: grid; place-items: center; text-align: center; padding-block: 48px; }
.notfound .code { margin: 0; font-size: 64px; font-weight: 800; color: var(--accent); line-height: 1; }
.notfound h1 { margin: 12px 0 6px; color: var(--heading); font-size: 24px; }
.notfound p { margin: 0 0 6px; color: var(--muted); }
.notfound .actions { justify-content: center; margin-top: 18px; }

/* Footer */
.site-footer { border-top: 1px solid var(--border); background: var(--surface); padding-block: 22px; font-size: 14px; color: var(--muted); }
.footer-row { display: flex; gap: 10px 20px; flex-wrap: wrap; align-items: center; justify-content: space-between; }
.footer-row nav { display: flex; gap: 6px 16px; flex-wrap: wrap; }
.footer-row a { color: var(--body); }
.footer-row p { margin: 0; }

[dir="ltr"] bdi, bdi { unicode-bidi: isolate; }
.ltr { direction: ltr; unicode-bidi: isolate; }

@media (max-width: 520px) {
  .hero { padding-block: 36px 28px; }
  .section { padding-block: 32px; }
  .site-nav a { padding: 6px 8px; font-size: 14px; }
  .contact { padding: 20px; }
}

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

@media print {
  .site-header nav, .site-footer nav, .skip { display: none; }
  body { background: #fff; color: #000; }
}
