/* khazen.net landing. Tokens follow MAGHZAN_DESIGN.md ("the ledger"). */
:root {
  --paper: #ffffff;
  --ink: #13201b;
  --ink-muted: #4f5d57;
  --ink-faint: #606e68;
  --ground: #f1f4f2;
  --sunken: #f5f7f6;
  --line: #e3e8e5;
  --line-strong: #c3ccc8;
  --rule: #13201b;
  --accent: #047857;
  --accent-hover: #065f46;
  --accent-soft: #eef6f2;
  --forest: #0c2b23;
  --forest-2: #143a30;
  --forest-muted: #9cbcb0;
  --amber: #d97706;
  --warn: #a14a05;

  --f-ui: 'Cairo', system-ui, sans-serif;
  --f-body: 'Almarai', 'Cairo', system-ui, sans-serif;
  --f-num: 'IBM Plex Sans', system-ui, sans-serif;

  --gutter: 16px;
  --ease: cubic-bezier(0.23, 1, 0.32, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--f-body);
  font-size: 16px;
  line-height: 1.75;
  overflow-x: hidden;
}
h1, h2, h3 { font-family: var(--f-ui); font-weight: 700; margin: 0; line-height: 1.35; }
p { margin: 0; }
a { color: var(--accent); }
.num {
  font-family: var(--f-num);
  font-variant-numeric: tabular-nums lining-nums;
  direction: ltr;
  unicode-bidi: isolate;
}
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.wrap { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 var(--gutter); }
.narrow { max-width: 820px; }

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

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px; padding: 0 22px;
  border-radius: 3px; border: 1px solid transparent;
  font-family: var(--f-ui); font-weight: 700; font-size: 16px;
  text-decoration: none; white-space: nowrap;
  transition: background-color 150ms var(--ease), transform 150ms var(--ease);
}
.btn:active { transform: scale(0.98); }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-ghost { color: #fff; border-color: rgba(255,255,255,0.45); }
.btn-ghost:hover { background: rgba(255,255,255,0.08); }
.btn-secondary { background: var(--paper); color: var(--ink); border-color: var(--line-strong); }
.btn-secondary:hover { background: var(--ground); }

/* Top bar */
.top { background: var(--paper); border-bottom: 1px solid var(--line-strong); }
.top-row { display: flex; align-items: center; gap: 16px; min-height: 64px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.mark { width: 36px; height: 36px; flex: none; }
.brand-name { font-family: var(--f-ui); font-weight: 700; font-size: 24px; line-height: 1; }
.nav { display: none; gap: 28px; margin-inline-start: 24px; }
.nav a, .signin { font-family: var(--f-ui); font-weight: 600; font-size: 15px; color: var(--ink-muted); text-decoration: none; }
.nav a:hover { color: var(--ink); }
.signin { margin-inline-start: auto; color: var(--accent); padding: 10px 0; }
.signin:hover { color: var(--accent-hover); text-decoration: underline; }

/* Hero */
.hero { background: var(--forest); color: #fff; padding: 40px 0 48px; }
.hero-grid { display: grid; gap: 40px; }
.hero h1 { font-size: 32px; line-height: 1.3; }
.lead { margin-top: 18px; color: #d9e7e1; font-size: 17px; max-width: 54ch; }
.cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.cta .btn { flex: 1 1 auto; }
.hero-note { margin-top: 14px; font-size: 14px; color: var(--forest-muted); }

/* The app window: a home screen with today's numbers and stock alerts */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.kicker { display: block; font-size: 15px; font-weight: 600; color: var(--forest-muted); margin-bottom: 10px; line-height: 1.6; }
.app {
  margin: 0; background: var(--paper); color: var(--ink); border-radius: 10px; overflow: hidden;
  box-shadow: 0 30px 60px -28px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(255, 255, 255, 0.08);
  font-size: 13px; min-width: 0;
}
.app-bar { display: flex; align-items: center; gap: 12px; padding: 9px 12px; background: var(--sunken); border-bottom: 1px solid var(--line); }
.dots { display: flex; gap: 5px; direction: ltr; }
.dots i { width: 9px; height: 9px; border-radius: 50%; background: var(--line-strong); }
.app-url { flex: 1; text-align: center; font-family: var(--f-num); font-size: 12px; color: var(--ink-faint); direction: ltr; background: var(--paper); border: 1px solid var(--line); border-radius: 6px; padding: 2px 8px; }
.app-body { display: grid; grid-template-columns: 1fr; }
.app-side { display: none; }
.app-main { padding: 14px; display: grid; gap: 12px; min-width: 0; }
.app-head { display: flex; justify-content: space-between; align-items: center; }
.app-head b { font-family: var(--f-ui); font-size: 16px; }
.chip { font-family: var(--f-ui); font-weight: 600; font-size: 11px; color: var(--accent); background: var(--accent-soft); border-radius: 999px; padding: 2px 10px; }
.kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.kpis div { border: 1px solid var(--line); border-radius: 8px; padding: 8px 9px; display: grid; gap: 2px; min-width: 0; }
.kpis small { font-family: var(--f-ui); font-weight: 600; font-size: 11px; color: var(--ink-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpis strong { font-size: 19px; font-weight: 700; line-height: 1.3; }
.kpis em { font-style: normal; font-size: 10.5px; color: var(--ink-faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpis em.up { color: var(--accent); }
.panel { border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.panel-head { display: flex; justify-content: space-between; align-items: center; padding: 8px 10px; background: var(--sunken); border-bottom: 1px solid var(--line); }
.panel-head b { font-family: var(--f-ui); font-size: 13px; }
.panel-head .num { font-size: 11px; background: var(--amber); color: #fff; border-radius: 999px; padding: 0 7px; }
.alerts { list-style: none; margin: 0; padding: 0; }
.alerts li { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.alerts li:last-child { border-bottom: 0; }
.alerts li > span { min-width: 0; font-weight: 700; font-size: 13px; }
.alerts small { display: block; font-weight: 400; font-size: 11.5px; color: var(--ink-faint); margin-top: 1px; }
.pill { flex: none; font-style: normal; font-family: var(--f-ui); font-weight: 700; font-size: 11px; border-radius: 999px; padding: 2px 9px; background: var(--ground); color: var(--ink-muted); }
.pill.amber { background: #fdf3e2; color: var(--warn); }
.pill.red { background: #fdecec; color: #b42318; }
.pill.green { background: var(--accent-soft); color: var(--accent); }

/* Totals rule, used by the plan statements */
.total { border-top: 1px solid var(--rule); border-bottom: 3px double var(--rule); margin-top: 6px; padding-top: 6px !important; padding-bottom: 6px !important; }
.total dt { color: var(--ink) !important; font-weight: 700 !important; }
.total dd { font-weight: 700; }

/* Sections */
.section { padding: 56px 0; }
.section-ground { background: var(--ground); }
.section-head { margin-bottom: 28px; max-width: 62ch; }
.section-head h2 { font-size: 26px; padding-bottom: 10px; border-bottom: 1px solid var(--line-strong); }
.section-head p { margin-top: 12px; color: var(--ink-muted); }

/* Features ledger */
.ledger { margin: 0; border-top: 1px solid var(--rule); }
.ledger .row { display: grid; gap: 6px; padding: 18px 0; border-bottom: 1px solid var(--line); }
.ledger h3 { font-size: 18px; }
.ledger p { margin: 0; color: var(--ink-muted); max-width: 72ch; }

/* Segments */
.segments { list-style: none; margin: 0; padding: 0; display: grid; gap: 24px; }
.segments li { border-top: 2px solid var(--accent); padding-top: 12px; }
.segments h3 { font-size: 18px; }
.segments p { margin-top: 6px; color: var(--ink-muted); font-size: 15px; }

/* Plans */
.plans { display: grid; gap: 20px; }
.plan { border: 1px solid var(--line-strong); border-radius: 4px; padding: 20px 18px; background: var(--paper); display: flex; flex-direction: column; }
.plan-mid { border-color: var(--accent); box-shadow: inset 0 3px 0 var(--accent); }
.plan h3 { font-size: 22px; }
.fit { color: var(--ink-muted); font-size: 15px; margin-top: 2px; }
.plan dl { margin: 16px 0 0; border-top: 1px solid var(--line-strong); }
.plan dl div { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.plan dt { color: var(--ink-muted); font-family: var(--f-ui); font-weight: 600; font-size: 14px; }
.plan dd { margin: 0; text-align: left; font-size: 15px; }
.plan dd .num { font-weight: 600; }
.plan dl .total { border-bottom: 3px double var(--rule); margin-top: 0; }
.plan .total dt { font-size: 16px; }
.plan .total dd { font-family: var(--f-ui); font-size: 15px; }
.plan .total dd .num { font-size: 30px; font-weight: 700; margin-inline-end: 4px; }
.plan-trial { margin-top: 14px; font-family: var(--f-ui); font-weight: 600; font-size: 14px; color: var(--accent); }
.plans-note { margin-top: 20px; color: var(--ink-muted); font-size: 15px; max-width: 72ch; }

.sub-head { font-size: 18px; margin-top: 40px; margin-bottom: 12px; }
.addons { width: 100%; border-collapse: collapse; font-size: 15px; }
.addons th {
  font-family: var(--f-ui); font-weight: 600; font-size: 13px; color: var(--ink-muted); text-align: start;
  background: var(--sunken); padding: 8px 8px; border-top: 1px solid var(--line-strong); border-bottom: 1px solid var(--line-strong);
}
.addons td { padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.addons td:nth-child(2) { white-space: nowrap; }
.addons td:nth-child(3) { color: var(--ink-muted); }

/* Steps */
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 24px; counter-reset: step; }
.steps li { counter-increment: step; display: grid; grid-template-columns: 40px 1fr; column-gap: 14px; }
.steps li::before {
  content: counter(step); grid-row: span 2;
  font-family: var(--f-num); font-weight: 600; font-size: 22px; color: var(--accent);
  border-top: 2px solid var(--accent); padding-top: 6px; text-align: center; height: max-content;
}
.steps h3 { font-size: 18px; padding-top: 6px; }
.steps p { color: var(--ink-muted); font-size: 15px; margin-top: 4px; }
.contact { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }
.contact .btn { flex: 1 1 auto; }

/* FAQ */
.faq { border-top: 1px solid var(--rule); }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary {
  cursor: pointer; list-style: none; padding: 16px 0; min-height: 44px;
  font-family: var(--f-ui); font-weight: 700; font-size: 17px;
  display: flex; justify-content: space-between; gap: 16px; align-items: center;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-family: var(--f-num); font-weight: 500; font-size: 22px; color: var(--accent); flex: none; }
.faq details[open] summary::after { content: "−"; }
.faq details p { padding: 0 0 18px; color: var(--ink-muted); max-width: 68ch; }

/* Footer */
.foot { background: var(--forest); color: #fff; padding: 32px 0; }
.foot-row { display: grid; gap: 20px; }
.foot-brand { display: flex; flex-direction: column; gap: 6px; }
.foot-tag { color: var(--forest-muted); font-size: 14px; }
.foot-links { display: flex; flex-wrap: wrap; gap: 8px 24px; }
.foot-links a { color: #fff; font-family: var(--f-ui); font-weight: 600; text-decoration: none; padding: 8px 0; }
.foot-links a:hover { text-decoration: underline; }
.foot-domain { color: var(--forest-muted); font-family: var(--f-num); font-size: 14px; direction: ltr; text-align: right; }

/* Tablet and up */
@media (min-width: 720px) {
  :root { --gutter: 24px; }
  .segments { grid-template-columns: 1fr 1fr; column-gap: 32px; }
  .steps { grid-template-columns: 1fr 1fr; column-gap: 32px; }
  .cta .btn, .contact .btn { flex: 0 0 auto; }
  .foot-row { grid-template-columns: 1fr auto auto; align-items: center; gap: 32px; }
}

/* Desktop */
@media (min-width: 1024px) {
  :root { --gutter: 32px; }
  .nav { display: flex; }
  .hero { padding: 72px 0 80px; }
  .hero-grid { grid-template-columns: 1.05fr 1fr; align-items: center; gap: 64px; }
  .hero h1 { font-size: 46px; line-height: 1.25; }
  .lead { font-size: 18px; }
  .app-body { grid-template-columns: 132px 1fr; }
  .app-side { display: flex; flex-direction: column; gap: 2px; background: var(--forest); padding: 12px 8px; }
  .app-side .mark { width: 30px; height: 30px; margin: 0 6px 10px; }
  .app-side span { font-family: var(--f-ui); font-weight: 600; font-size: 12px; color: var(--forest-muted); padding: 6px 8px; border-radius: 6px; }
  .app-side span.on { background: var(--forest-2); color: #fff; }
  .app-main { padding: 16px; }
  .kicker { font-size: 17px; }
  .section { padding: 88px 0; }
  .section-head h2 { font-size: 32px; }
  .ledger .row { grid-template-columns: 240px 1fr; gap: 40px; padding: 22px 0; }
  .segments { grid-template-columns: repeat(4, 1fr); }
  .steps { grid-template-columns: repeat(4, 1fr); }
  .steps li { grid-template-columns: 1fr; }
  .steps li::before { grid-row: auto; text-align: start; width: 40px; margin-bottom: 4px; }
  .plans { grid-template-columns: repeat(3, 1fr); gap: 24px; align-items: start; }
  .addons { max-width: 760px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn { transition: background-color 120ms linear; }
  .btn:active { transform: none; }
}
