/* ===========================================================
   Expert System — Design System v2 (Corporate / Consulting)
   Light, structured, authoritative. Refs: McKinsey, BCG, Bain,
   Deloitte, Palantir-light, Stripe docs. Deep navy + clean blue.
   =========================================================== */

:root {
  --canvas: #FBFCFD;
  --surface: #FFFFFF;
  --surface-2: #F3F5F8;
  --hairline: #E3E8EF;
  --hairline-soft: #EDF0F4;

  --text: #0E1E30;          /* deep navy ink */
  --ink: #0A2540;
  --muted: #56616F;
  --faint: #8A95A3;

  --accent: #15498C;        /* corporate blue */
  --accent-2: #2F6FD0;      /* link / hover */
  --accent-soft: #EAF1FB;
  --navy: #0A2540;          /* dark bands / footer */

  --success: #1F9D6B;
  --warn: #C77D11;
  --caution: #B4690E;
  --danger: #C2412D;

  --radius: 12px;
  --radius-sm: 9px;
  --radius-lg: 18px;
  --shadow: 0 1px 2px rgba(16,30,48,.04), 0 4px 16px rgba(16,30,48,.06);
  --shadow-lg: 0 10px 36px rgba(16,30,48,.12);

  --font-ui: "Inter", system-ui, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --font-display: "Source Serif 4", "PT Serif", Georgia, serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;

  --maxw: 1180px;
}

/* persona accents (corporate, deep) */
[data-persona="mp"]       { --accent: #1B4F8A; --accent-2: #2F6FD0; --accent-soft: #E9F0FA; }
[data-persona="minister"] { --accent: #1E6B4F; --accent-2: #2E8C68; --accent-soft: #E8F4EE; }
[data-persona="company"]  { --accent: #93611F; --accent-2: #B07C2E; --accent-soft: #F6EFE2; }

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-ui);
  background: var(--canvas);
  color: var(--text);
  line-height: 1.6;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* subtle structured backdrop */
body::before {
  content: "";
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    linear-gradient(180deg, #FFFFFF 0%, var(--canvas) 38%),
    radial-gradient(1000px 480px at 88% -8%, var(--accent-soft), transparent 60%);
}
body::after {
  content: "";
  position: fixed; inset: 0; z-index: -1; opacity: .5; pointer-events: none;
  background-image: linear-gradient(var(--hairline-soft) 1px, transparent 1px), linear-gradient(90deg, var(--hairline-soft) 1px, transparent 1px);
  background-size: 64px 64px;
  -webkit-mask-image: radial-gradient(ellipse at 50% -10%, #000 0%, transparent 60%);
          mask-image: radial-gradient(ellipse at 50% -10%, #000 0%, transparent 60%);
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
h1,h2,h3,h4 { margin: 0 0 .4em; font-weight: 600; letter-spacing: -.01em; color: var(--text); }
p { margin: 0 0 1em; color: var(--muted); }

.container { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
.section { padding: 84px 0; }
.section.alt { background: var(--surface-2); border-top: 1px solid var(--hairline); border-bottom: 1px solid var(--hairline); }
.eyebrow { font-size: 12px; letter-spacing: .16em; text-transform: uppercase; color: var(--accent); font-weight: 700; }
.serif { font-family: var(--font-display); }
.mono { font-family: var(--font-mono); }
.muted { color: var(--muted); }
.center { text-align: center; }

/* ---------- top nav ---------- */
.nav { position: sticky; top: 0; z-index: 50; backdrop-filter: blur(12px); background: rgba(255,255,255,.86); border-bottom: 1px solid var(--hairline); }
.nav-inner { display: flex; align-items: center; justify-content: space-between; height: 66px; }
.brand { display: flex; align-items: center; gap: 11px; font-weight: 700; font-size: 16px; letter-spacing: -.01em; color: var(--ink); }
.brand .logo { width: 30px; height: 30px; border-radius: 7px; display: grid; place-items: center; background: var(--navy); color: #fff; font-weight: 700; font-family: var(--font-display); font-size: 17px; }
.nav-links { display: flex; align-items: center; gap: 28px; }
.nav-links a { color: var(--muted); font-size: 14.5px; font-weight: 500; transition: color .15s; }
.nav-links a:hover { color: var(--ink); }
.nav-actions { display: flex; align-items: center; gap: 12px; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font: inherit; font-size: 14.5px; font-weight: 600; padding: 11px 18px; border-radius: 9px; border: 1px solid transparent; transition: transform .12s ease, background .15s, border-color .15s, box-shadow .15s; white-space: nowrap; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); color: #fff; box-shadow: 0 2px 8px rgba(21,73,140,.22); }
.btn-primary:hover { background: var(--accent-2); box-shadow: 0 6px 18px rgba(21,73,140,.28); }
.btn-ghost { background: var(--surface); border-color: var(--hairline); color: var(--ink); }
.btn-ghost:hover { border-color: var(--accent); background: var(--accent-soft); }
.btn-lg { padding: 14px 24px; font-size: 15.5px; border-radius: 11px; }
.btn-sm { padding: 8px 14px; font-size: 13px; }

/* ---------- chips / tags / badges ---------- */
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; font-size: 12.5px; background: var(--surface); border: 1px solid var(--hairline); color: var(--muted); }
.chip.active, .chip:hover { color: var(--ink); border-color: var(--accent); cursor: pointer; }
.tag { font-size: 11px; color: var(--faint); letter-spacing: .06em; text-transform: uppercase; font-weight: 600; }

.badge { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; padding: 4px 10px; border-radius: 999px; }
.badge .dot { width: 8px; height: 8px; border-radius: 50%; }
.badge.high    { color: var(--success); background: rgba(31,157,107,.10); } .badge.high .dot{background:var(--success);}
.badge.medium  { color: var(--warn);    background: rgba(199,125,17,.10); } .badge.medium .dot{background:var(--warn);}
.badge.caution { color: var(--caution); background: rgba(180,105,14,.10); } .badge.caution .dot{background:var(--caution);}
.badge.verify  { color: var(--danger);  background: rgba(194,65,45,.10);  } .badge.verify .dot{background:var(--danger);}

/* citation chip */
.cite { display: inline-flex; align-items: center; gap: 7px; font-family: var(--font-mono); font-size: 12.5px; padding: 6px 11px; border-radius: 8px; background: var(--surface); border: 1px solid var(--hairline); color: var(--ink); transition: border-color .15s, background .15s; }
.cite:hover { border-color: var(--accent); background: var(--accent-soft); }
.cite .ok { color: var(--success); } .cite .pending { color: var(--warn); }

/* ---------- cards ---------- */
.card { background: var(--surface); border: 1px solid var(--hairline); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px; transition: border-color .18s, transform .18s, box-shadow .18s; }
.card:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.card .emoji { font-size: 24px; line-height: 1; }
.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-auto { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }

/* persona card */
.persona-card { position: relative; overflow: hidden; cursor: pointer; padding-top: 26px; }
.persona-card::before { content:""; position:absolute; inset:0 0 auto 0; height:4px; background: var(--pa, var(--accent)); }
.persona-card .pemoji { font-size: 28px; }
.persona-card h3 { font-size: 19px; margin-top: 12px; color: var(--ink); }
.persona-card .focus { list-style: none; padding: 0; margin: 12px 0 0; }
.persona-card .focus li { font-size: 13.5px; color: var(--muted); padding: 5px 0 5px 18px; position: relative; }
.persona-card .focus li::before { content:"›"; position:absolute; left:2px; color: var(--pa, var(--accent)); font-weight: 700; }

/* agent card */
.agent-card { display: flex; flex-direction: column; gap: 8px; cursor: pointer; }
.agent-card .row { display: flex; align-items: center; gap: 12px; }
.agent-card h4 { font-size: 15.5px; margin: 0; color: var(--ink); }
.agent-card .tagline { font-size: 13px; color: var(--muted); margin: 0; }
.agent-card .cat { margin-top: auto; }

/* ---------- hero ---------- */
.hero { padding: 86px 0 60px; position: relative; }
.hero h1 { font-family: var(--font-display); font-size: clamp(38px, 5.6vw, 62px); line-height: 1.07; letter-spacing: -.02em; font-weight: 600; color: var(--ink); }
.hero h1 .grad { color: var(--accent); }
.hero .lede { font-size: clamp(16px, 2vw, 19px); color: var(--muted); max-width: 660px; margin-top: 18px; }
.hero-cta { display: flex; gap: 14px; margin-top: 32px; flex-wrap: wrap; }

/* instant cabinet hero box */
.instant-box { margin-top: 38px; max-width: 640px; background: var(--surface); border: 1px solid var(--hairline); border-radius: var(--radius-lg); padding: 22px; box-shadow: var(--shadow-lg); }
.instant-box .label { font-size: 12.5px; color: var(--muted); margin-bottom: 12px; font-weight: 500; }
.instant-row { display: flex; gap: 10px; flex-wrap: wrap; }
.input { flex: 1; min-width: 160px; font: inherit; font-size: 15px; color: var(--ink); background: var(--surface); border: 1px solid var(--hairline); border-radius: 9px; padding: 12px 14px; outline: none; transition: border-color .15s, box-shadow .15s; }
.input::placeholder { color: var(--faint); }
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
textarea.input { width: 100%; resize: vertical; min-height: 96px; line-height: 1.55; }

/* stats strip */
.stats { display: flex; gap: 52px; flex-wrap: wrap; margin-top: 48px; padding-top: 30px; border-top: 1px solid var(--hairline); }
.stat .num { font-family: var(--font-display); font-size: 34px; font-weight: 600; color: var(--ink); }
.stat .lbl { font-size: 13px; color: var(--faint); }

/* section heads */
.shead { max-width: 680px; margin-bottom: 38px; }
.shead h2 { font-size: clamp(26px, 3.2vw, 36px); font-family: var(--font-display); letter-spacing: -.015em; color: var(--ink); }
.shead p { font-size: 16px; }

/* feature (WOW) card */
.feature { display: flex; flex-direction: column; gap: 10px; }
.feature .fnum { font-family: var(--font-mono); font-size: 12px; color: var(--accent); font-weight: 500; }
.feature h3 { font-size: 18px; color: var(--ink); }
.feature p { font-size: 14px; margin: 0; }

/* answer / output panel */
.answer { background: var(--surface); border: 1px solid var(--hairline); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); }
.answer-md { line-height: 1.7; font-size: 15px; color: var(--text); }
.answer-md h1,.answer-md h2,.answer-md h3 { font-family: var(--font-ui); color: var(--ink); }
.answer-md code { font-family: var(--font-mono); font-size: .9em; background: var(--surface-2); padding: 1px 6px; border-radius: 6px; }
.answer-md pre { background: var(--surface-2); border:1px solid var(--hairline); border-radius: 10px; padding: 14px; overflow:auto; }
.answer-md table { border-collapse: collapse; width: 100%; margin: 12px 0; font-size: 14px; }
.answer-md th,.answer-md td { border: 1px solid var(--hairline); padding: 8px 10px; text-align: left; }
.answer-md th { background: var(--surface-2); }

/* thinking shimmer */
.thinking { display:inline-flex; align-items:center; gap:10px; color: var(--muted); font-size:14px; }
.shimmer { height: 12px; border-radius: 6px; background: linear-gradient(90deg, var(--surface-2) 25%, #E7ECF2 37%, var(--surface-2) 63%); background-size: 400% 100%; }
@media (prefers-reduced-motion: no-preference) {
  .shimmer { animation: sh 1.4s ease infinite; }
  @keyframes sh { 0%{background-position:100% 0} 100%{background-position:0 0} }
  .fade-up { opacity: 0; transform: translateY(10px); animation: fu .5s ease forwards; }
  @keyframes fu { to { opacity: 1; transform: none; } }
  .pulse { animation: pulse 1.6s ease-in-out infinite; }
  @keyframes pulse { 0%,100%{ box-shadow: 0 0 0 0 rgba(21,73,140,0);} 50%{ box-shadow: 0 0 0 6px rgba(21,73,140,.12);} }
}

/* footer — dark corporate band */
.footer { background: var(--navy); color: #AEBBCB; padding: 44px 0; font-size: 13.5px; }
.footer .brand { color: #fff; }
.footer .brand .logo { background: #fff; color: var(--navy); }
.footer a { color: #C9D3DE; }
.footer a:hover { color: #fff; }

/* utilities */
.flex { display:flex; } .between { justify-content: space-between; } .items-center { align-items:center; }
.gap-8{gap:8px}.gap-12{gap:12px}.gap-16{gap:16px}
.mt-8{margin-top:8px}.mt-16{margin-top:16px}.mt-24{margin-top:24px}.mt-32{margin-top:32px}
.hide { display:none !important; }

/* responsive */
@media (max-width: 900px) { .grid-3,.grid-4 { grid-template-columns: repeat(2, 1fr); } .nav-links { display: none; } .section { padding: 58px 0; } .stats { gap: 30px; } }
@media (max-width: 560px) { .grid-2,.grid-3,.grid-4 { grid-template-columns: 1fr; } }
