/* Adjoin brand stylesheet - see docs/brand-spec.md. All colours are tokens; dark theme overrides them. */
:root {
  color-scheme: light;
  /* brand tokens */
  --navy: #0F1E2E;
  --teal: #2AAFAF;
  --teal-dark: #23989A;
  --emerald: #0B5D4D;
  --sand: #D8B48E;
  --soft-sand: #F5E7D3;
  --sage: #8CBBA6;
  --warm-gray: #F2F2F2;
  --slate: #5A6473;
  --white: #FFFFFF;
  /* semantic tokens (light) */
  --bg: #FFFFFF;
  --bg-alt: #F2F2F2;
  --surface: #FFFFFF;
  --surface-2: #F2F2F2;
  --ink: #0F1E2E;
  --muted: #5A6473;
  --line: #E3E6EA;
  --link: #0B5D4D;
  --eyebrow: #0B5D4D;
  --brand-text: #0F1E2E;
  --btn-primary-bg: #2AAFAF;
  --btn-primary-bg-hover: #23989A;
  --btn-primary-fg: #0F1E2E;
  --btn-secondary-fg: #0F1E2E;
  --icon-bg: #F5E7D3;
  --icon-fg: #0B5D4D;
  --chat-bg: #0F1E2E;
  --chat-fg: #FFFFFF;
  --chat-muted: rgba(255,255,255,0.7);
  --chat-user: rgba(255,255,255,0.08);
  --chat-assistant: rgba(42,175,175,0.16);
  --chat-assistant-line: rgba(42,175,175,0.35);
  --chat-line: rgba(255,255,255,0.1);
  --ok-fg: #1A6F50;
  --ok-bg: #EEF6F1;
  --ok-line: #8CBBA6;
  --warn-fg: #8A5A1E;
  --warn-bg: #F5E7D3;
  --err-fg: #B3261E;
  --err-bg: #FBEEED;
  --err-line: #E8B4B0;
  --info-fg: #0F1E2E;
  --info-bg: #F5E7D3;
  --info-line: #D8B48E;
  --badge-muted-fg: #5A6473;
  --badge-muted-bg: #F2F2F2;
  --shadow: 0 20px 50px rgba(15, 30, 46, 0.25);
  --radius: 12px;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-arabic: "IBM Plex Sans Arabic", var(--font);
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0B1622;
  --bg-alt: #0F1E2E;
  --surface: #0F1E2E;
  --surface-2: #16293D;
  --ink: #F5E7D3;
  --muted: #A6B1BF;
  --line: #2C3D52;
  --link: #5FD0CF;
  --eyebrow: #8CBBA6;
  --brand-text: #FFFFFF;
  --btn-primary-bg: #2AAFAF;
  --btn-primary-bg-hover: #3DC2C2;
  --btn-primary-fg: #0B1622;
  --btn-secondary-fg: #F5E7D3;
  --icon-bg: #16293D;
  --icon-fg: #8CBBA6;
  --chat-bg: #16293D;
  --chat-fg: #F5E7D3;
  --chat-muted: rgba(245,231,211,0.7);
  --chat-user: rgba(255,255,255,0.06);
  --chat-assistant: rgba(42,175,175,0.14);
  --chat-assistant-line: rgba(42,175,175,0.4);
  --chat-line: rgba(255,255,255,0.1);
  --ok-fg: #8CE0B8;
  --ok-bg: #12352A;
  --ok-line: #1E7F5C;
  --warn-fg: #F0C690;
  --warn-bg: #3B2A14;
  --err-fg: #F5A09A;
  --err-bg: #3E1A17;
  --err-line: #7A2E28;
  --info-fg: #F5E7D3;
  --info-bg: #16293D;
  --info-line: #D8B48E;
  --badge-muted-fg: #A6B1BF;
  --badge-muted-bg: #16293D;
  --shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--bg); }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--bg);
  font-feature-settings: "tnum" 1, "cv11" 1;
}
h1, h2, h3, h4 { font-weight: 800; letter-spacing: -0.02em; line-height: 1.15; margin: 0 0 0.5em; }
h1 { font-size: clamp(2rem, 5vw, 3.25rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2rem); }
h3 { font-size: 1.2rem; font-weight: 700; }
p { margin: 0 0 1em; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
code, pre, .mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.92em; }
pre { background: var(--surface-2); padding: 12px 14px; border-radius: 8px; overflow: auto; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.small { font-size: 0.875rem; }
.arabic { font-family: var(--font-arabic); color: var(--sand); direction: rtl; }

.container { width: min(1120px, 100% - 32px); margin: 0 auto; }
.narrow { width: min(760px, 100% - 32px); margin: 0 auto; }

/* Nav */
.nav { display: flex; align-items: center; justify-content: space-between; padding: 18px 0; gap: 16px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; letter-spacing: -0.02em; font-size: 1.25rem; color: var(--brand-text); }
.brand:hover { text-decoration: none; }
.brand .mark { width: 32px; height: 32px; color: var(--teal); }
.nav-links { display: flex; align-items: center; gap: 22px; }
.nav-links a { color: var(--ink); font-weight: 500; }
.nav-links .sep { width: 1px; height: 22px; background: var(--line); }
@media (max-width: 720px) { .nav-links .hide-sm { display: none; } .nav-links { gap: 14px; } }

/* Theme toggle */
.theme-toggle { width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); display: inline-grid; place-items: center; cursor: pointer; padding: 0; }
.theme-toggle:hover { border-color: var(--muted); }
.theme-toggle:focus-visible { outline: 2px solid var(--teal); outline-offset: 1px; }
.theme-toggle svg { width: 18px; height: 18px; }
.theme-toggle .icon-moon { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-moon { display: block; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 12px 20px; border-radius: 10px; font-weight: 600; border: 1px solid transparent; cursor: pointer; font-family: inherit; font-size: 1rem; line-height: 1; white-space: nowrap; }
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--btn-primary-bg); color: var(--btn-primary-fg); }
.btn-primary:hover { background: var(--btn-primary-bg-hover); }
.btn-secondary { background: var(--surface); color: var(--btn-secondary-fg); border-color: var(--line); }
.btn-secondary:hover { border-color: var(--muted); }
.btn-ghost { background: transparent; color: var(--ink); }
.btn-danger { background: var(--surface); color: var(--err-fg); border-color: var(--err-fg); }
.btn-sm { padding: 8px 14px; font-size: 0.9rem; }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; }

/* Hero */
.hero { padding: 72px 0 48px; display: grid; grid-template-columns: 1.1fr 1fr; gap: 48px; align-items: center; }
@media (max-width: 860px) { .hero { grid-template-columns: 1fr; padding-top: 40px; } }
.hero .sub { font-size: 1.2rem; color: var(--muted); max-width: 34rem; }
.hero .cta { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-top: 24px; }
.hero .note { color: var(--muted); font-size: 0.95rem; }
.h1-sub { display: block; font-size: 1.05rem; font-weight: 600; letter-spacing: 0; color: var(--muted); margin-top: 12px; line-height: 1.4; }
.eyebrow { display: inline-block; font-size: 0.8rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--eyebrow); margin-bottom: 12px; }

/* Chat panel */
.chat { background: var(--chat-bg); color: var(--chat-fg); border-radius: 16px; padding: 20px; box-shadow: var(--shadow); border: 1px solid transparent; }
:root[data-theme="dark"] .chat { border-color: var(--line); }
.chat .bar { display: flex; align-items: center; gap: 8px; font-size: 0.8rem; color: var(--chat-muted); margin-bottom: 14px; }
.chat .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--teal); }
.chat .msg { padding: 12px 14px; border-radius: 12px; margin-bottom: 10px; font-size: 0.95rem; line-height: 1.5; }
.chat .user { background: var(--chat-user); }
.chat .assistant { background: var(--chat-assistant); border: 1px solid var(--chat-assistant-line); }
.chat table { width: 100%; border-collapse: collapse; font-size: 0.88rem; margin-top: 8px; }
.chat td, .chat th { padding: 6px 4px; border-bottom: 1px solid var(--chat-line); text-align: left; }
.chat th { color: var(--chat-muted); font-weight: 500; }
.chat td.num, .chat th.num { text-align: right; }
.chat .tool { font-size: 0.75rem; color: var(--sage); margin: 6px 0 10px; }

/* Integrations strip */
.strip { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 22px 0; }
.strip .row { display: flex; flex-wrap: wrap; gap: 14px 32px; align-items: center; justify-content: center; color: var(--muted); font-weight: 600; }
.strip .row .arrow { color: var(--sand); }
.strip .row .soon { font-weight: 500; font-size: 0.8rem; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 2px 8px; margin-left: 6px; }

/* Sections */
.section { padding: 64px 0; }
.section-alt { background: var(--bg-alt); }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
@media (max-width: 860px) { .grid-3 { grid-template-columns: 1fr; } }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }
.card h3 { margin-top: 8px; }
.card .icon { width: 40px; height: 40px; border-radius: 10px; background: var(--icon-bg); color: var(--icon-fg); display: grid; place-items: center; font-weight: 800; }

/* Pricing */
.pricing { display: grid; place-items: center; }
.price-card { max-width: 440px; width: 100%; border: 2px solid var(--teal); border-radius: 16px; padding: 32px; text-align: center; background: var(--surface); }
.price-card .amount { font-size: 2.6rem; font-weight: 800; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; margin-top: 18px; }
.price-card .amount span { font-size: 1rem; font-weight: 500; color: var(--muted); letter-spacing: 0; }
.price-card .usd-equiv { color: var(--muted); font-size: 0.95rem; font-weight: 500; margin: 0 0 4px; }
.price-card .cycle-note { margin-top: 0; }
.price-card ul { list-style: none; padding: 0; margin: 20px 0; text-align: left; }
.price-card li { padding: 8px 0; border-bottom: 1px solid var(--line); }
.price-card li:last-child { border-bottom: 0; }
.price-card .compare { color: var(--muted); font-size: 0.95rem; margin-top: 16px; }
.cycle-toggle { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; background: var(--surface-2); border-radius: 12px; padding: 4px; margin-top: 8px; }
.cycle-toggle button { position: relative; font: inherit; font-weight: 600; font-size: 0.9rem; border: 0; border-radius: 9px; background: transparent; color: var(--muted); padding: 10px 6px 8px; cursor: pointer; display: grid; gap: 2px; justify-items: center; }
.cycle-toggle button small { font-weight: 500; font-size: 0.78rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.cycle-toggle button.active { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,0.15); }
.cycle-toggle button.active small { color: var(--eyebrow); }
.cycle-toggle button:focus-visible { outline: 2px solid var(--teal); outline-offset: 1px; }
.cycle-toggle .best { position: absolute; top: -10px; right: 6px; background: var(--emerald); color: var(--white); font-size: 0.65rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; padding: 2px 7px; border-radius: 999px; }
:root[data-theme="dark"] .cycle-toggle .best { background: var(--sage); color: var(--navy); }

/* Footer */
.footer { border-top: 1px solid var(--line); padding: 32px 0; color: var(--muted); font-size: 0.9rem; }
.footer .row { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; align-items: center; }
.footer a { color: var(--muted); }
.footer .lockup { display: inline-flex; align-items: center; gap: 10px; color: var(--brand-text); font-weight: 700; }
.footer .lockup .mark { width: 22px; height: 22px; color: var(--teal); }

/* Forms */
.form { display: grid; gap: 14px; }
.field { display: grid; gap: 6px; }
.field label { font-weight: 600; font-size: 0.95rem; }
.field .help { color: var(--muted); font-size: 0.85rem; }
input[type=text], input[type=email], input[type=password], textarea, select {
  font: inherit; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; width: 100%; background: var(--surface); color: var(--ink);
}
input:focus, textarea:focus, select:focus { outline: 2px solid var(--teal); outline-offset: 1px; border-color: var(--teal); }
textarea { min-height: 120px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.9rem; }

/* Alerts */
.alert { padding: 12px 14px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface-2); margin-bottom: 16px; }
.alert-ok { border-color: var(--ok-line); background: var(--ok-bg); color: var(--ok-fg); }
.alert-error { border-color: var(--err-line); background: var(--err-bg); color: var(--err-fg); }
.alert-info { border-color: var(--info-line); background: var(--info-bg); color: var(--info-fg); }

/* Dashboard */
.dash { display: grid; grid-template-columns: 240px 1fr; gap: 32px; padding: 32px 0 64px; }
@media (max-width: 860px) { .dash { grid-template-columns: 1fr; } }
.side a { display: block; padding: 8px 10px; border-radius: 8px; color: var(--ink); }
.side a.active, .side a:hover { background: var(--surface-2); text-decoration: none; }
.badge { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 0.78rem; font-weight: 600; }
.badge-ok { background: var(--ok-bg); color: var(--ok-fg); }
.badge-warn { background: var(--warn-bg); color: var(--warn-fg); }
.badge-err { background: var(--err-bg); color: var(--err-fg); }
.badge-muted { background: var(--badge-muted-bg); color: var(--badge-muted-fg); }
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { padding: 12px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.table th { font-size: 0.85rem; color: var(--muted); font-weight: 600; }
.stack { display: grid; gap: 24px; }
.inline { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.copy { display: flex; gap: 8px; align-items: center; }
.copy input { flex: 1; }
.checklist { list-style: none; padding: 0; margin: 0; }
.checklist li { display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); align-items: flex-start; }
.checklist .tick { width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--line); flex: 0 0 24px; display: grid; place-items: center; font-size: 0.8rem; font-weight: 700; }
.checklist .done .tick { background: var(--teal); border-color: var(--teal); color: var(--navy); }
.steps { counter-reset: step; list-style: none; padding: 0; }
.steps li { counter-increment: step; padding-left: 36px; position: relative; margin-bottom: 12px; }
.steps li::before { content: counter(step); position: absolute; left: 0; top: 0; width: 24px; height: 24px; border-radius: 50%; background: var(--ink); color: var(--bg); font-size: 0.8rem; font-weight: 700; display: grid; place-items: center; }

/* Legal */
.legal h2 { font-size: 1.35rem; margin-top: 2em; }
.legal h3 { font-size: 1.05rem; margin-top: 1.5em; }
.legal .draft { border-left: 4px solid var(--sand); }

/* Coming soon */
.coming { min-height: 70vh; display: grid; place-items: center; text-align: center; padding: 48px 0; }
.coming .mark { width: 64px; height: 64px; color: var(--teal); margin-bottom: 16px; }
