/* =====================================================
   Brand Scans — design system
   Marketing: dark "observatory" theme, Fraunces + Archivo
   App: warm paper light theme with dark sidebar
   ===================================================== */

:root {
  /* brand */
  --ink: #0b1020;
  --ink-2: #131a2e;
  --ink-3: #1c2440;
  --amber: #f5b83d;
  --amber-deep: #b7791f;
  --cyan: #62d9d0;
  --cream: #ece9df;
  --cream-dim: #a8aebc;

  /* app light theme */
  --paper: #f4f3ee;
  --surface: #fcfcfb;
  --line: #e3e1d8;
  --line-soft: #edece5;
  --text: #14181d;
  --text-2: #52514e;
  --text-3: #898781;
  --blue: #1c5cab;
  --blue-deep: #12365c;

  /* dataviz (validated palette) */
  --s1: #2a78d6; --s2: #008300; --s3: #e87ba4; --s4: #eda100;
  --s5: #1baf7a; --s6: #eb6834; --s7: #4a3aa7; --s8: #e34948;
  --seq-250:#86b6ef; --seq-400:#3987e5; --seq-550:#1c5cab; --seq-700:#0d366b;
  --good: #0ca30c; --warning: #fab219; --serious: #ec835a; --critical: #d03b3b;
  --good-text: #006300;
  --grid-hair: #e1e0d9;

  --radius: 10px;
  --font-display: "Fraunces", Georgia, serif;
  --font-body: "Archivo", system-ui, sans-serif;
  --font-mono: "Spline Sans Mono", ui-monospace, monospace;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.55;
  color: var(--text);
  background: var(--paper);
}
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
h1,h2,h3,h4 { font-family: var(--font-display); font-weight: 600; line-height: 1.15; margin: 0 0 .5em; }
img { max-width: 100%; }
::selection { background: var(--amber); color: var(--ink); }

/* =====================================================
   MARKETING
   ===================================================== */
.mkt {
  background: var(--ink);
  color: var(--cream);
  min-height: 100vh;
}
.mkt a { color: var(--cyan); }
.mkt-wrap { max-width: 1120px; margin: 0 auto; padding: 0 24px; }

.mkt-nav {
  display: flex; align-items: center; gap: 28px;
  padding: 22px 0;
  position: relative; z-index: 5;
}
.mkt-logo {
  font-family: var(--font-display); font-size: 24px; font-weight: 700;
  color: var(--cream) !important; text-decoration: none !important;
  letter-spacing: -0.02em;
}
.mkt-logo .dot { color: var(--amber); }
.mkt-nav-links { display: flex; gap: 22px; margin-left: auto; align-items: center; flex-wrap: wrap; }
.mkt-nav-links a { color: var(--cream-dim); font-size: 14px; }
.mkt-nav-links a:hover { color: var(--cream); text-decoration: none; }

.btn {
  display: inline-block; padding: 11px 22px; border-radius: 8px;
  font-family: var(--font-body); font-weight: 600; font-size: 14.5px;
  border: 1px solid transparent; cursor: pointer; text-decoration: none !important;
  transition: transform .12s ease, box-shadow .12s ease, background .12s;
}
.btn-amber { background: var(--amber); color: var(--ink) !important; }
.btn-amber:hover { transform: translateY(-1px); box-shadow: 0 6px 24px rgba(245,184,61,.35); }
.btn-ghost { border-color: #39445e; color: var(--cream) !important; background: transparent; }
.btn-ghost:hover { border-color: var(--cream-dim); }
.btn-blue { background: var(--blue); color: #fff !important; }
.btn-blue:hover { background: var(--blue-deep); }
.btn-line { border: 1px solid var(--line); color: var(--text) !important; background: var(--surface); }
.btn-line:hover { border-color: var(--text-3); }
.btn-sm { padding: 6px 13px; font-size: 13px; border-radius: 7px; }
.btn-danger { background: #fff; border: 1px solid var(--critical); color: var(--critical) !important; }

/* hero */
.hero { position: relative; padding: 84px 0 90px; overflow: hidden; }
.hero-scan {
  position: absolute; inset: -40% -20% auto auto; width: 900px; height: 900px;
  border-radius: 50%;
  background:
    radial-gradient(circle at center, transparent 38%, rgba(98,217,208,.05) 40%, transparent 42%),
    radial-gradient(circle at center, transparent 58%, rgba(98,217,208,.05) 60%, transparent 62%),
    radial-gradient(circle at center, transparent 78%, rgba(98,217,208,.06) 80%, transparent 82%),
    conic-gradient(from 0deg, rgba(245,184,61,.16), transparent 18%);
  animation: sweep 14s linear infinite;
  pointer-events: none;
}
@keyframes sweep { to { transform: rotate(360deg); } }
.hero h1 {
  font-size: clamp(40px, 6vw, 68px);
  max-width: 13em; letter-spacing: -0.015em;
  margin-bottom: 22px;
}
.hero h1 em { font-style: italic; color: var(--amber); }
.hero .lede { font-size: 19px; color: var(--cream-dim); max-width: 36em; margin-bottom: 34px; }
.hero-ctas { display: flex; gap: 14px; flex-wrap: wrap; }
.hero-note { margin-top: 14px; font-size: 13px; color: #6d7688; }

.kicker {
  font-family: var(--font-mono); font-size: 12px; letter-spacing: .18em;
  text-transform: uppercase; color: var(--cyan); margin-bottom: 18px; display:block;
}

.mkt-section { padding: 72px 0; border-top: 1px solid #1d2640; position: relative; }
.mkt-section h2 { font-size: clamp(28px, 3.6vw, 40px); max-width: 18em; }
.mkt-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 18px; margin-top: 38px; }
.mkt-card {
  background: linear-gradient(180deg, var(--ink-2), var(--ink));
  border: 1px solid #232d4a; border-radius: 14px; padding: 26px 24px;
}
.mkt-card h3 { font-size: 19px; color: var(--cream); }
.mkt-card p { color: var(--cream-dim); font-size: 14.5px; margin: 0; }
.mkt-card .n {
  font-family: var(--font-mono); color: var(--amber); font-size: 13px;
  display:block; margin-bottom: 12px;
}

/* pricing */
.tiers { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 18px; margin-top: 40px; align-items: stretch; }
.tier {
  border: 1px solid #232d4a; border-radius: 16px; padding: 28px 24px;
  background: var(--ink-2); display: flex; flex-direction: column;
}
.tier.hot { border-color: var(--amber); box-shadow: 0 0 0 1px var(--amber), 0 18px 50px rgba(245,184,61,.12); }
.tier .tag { font-family: var(--font-mono); font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--amber); }
.tier h3 { font-size: 21px; margin: 8px 0 4px; }
.tier .price { font-family: var(--font-display); font-size: 40px; font-weight: 700; margin: 10px 0 2px; }
.tier .price small { font-size: 14px; font-family: var(--font-body); color: var(--cream-dim); font-weight: 400; }
.tier ul { list-style: none; padding: 0; margin: 18px 0 26px; color: var(--cream-dim); font-size: 14px; flex: 1; }
.tier ul li { padding: 5px 0 5px 22px; position: relative; }
.tier ul li::before { content: "→"; position: absolute; left: 0; color: var(--cyan); }

.mkt-footer { border-top: 1px solid #1d2640; padding: 44px 0 60px; color: #6d7688; font-size: 13.5px; }
.mkt-footer a { color: var(--cream-dim); margin-right: 18px; }

/* faq */
.faq-item { border-top: 1px solid #232d4a; padding: 22px 0; }
.faq-item h3 { font-size: 18px; color: var(--cream); margin-bottom: 8px; }
.faq-item p { color: var(--cream-dim); margin: 0; max-width: 52em; }

/* auth cards on marketing bg */
.auth-card {
  max-width: 480px; margin: 60px auto; background: var(--surface); color: var(--text);
  border-radius: 16px; padding: 36px; box-shadow: 0 30px 80px rgba(0,0,0,.45);
}
.auth-card h1 { font-size: 26px; }
.auth-card a { color: var(--blue); }

/* =====================================================
   FORMS (shared)
   ===================================================== */
label { display: block; font-size: 13px; font-weight: 600; color: var(--text-2); margin: 14px 0 5px; }
input[type=text], input[type=email], input[type=password], input[type=number],
input[type=date], input[type=url], select, textarea {
  width: 100%; padding: 9px 12px; border: 1px solid var(--line); border-radius: 8px;
  font: inherit; font-size: 14px; background: #fff; color: var(--text);
}
input:focus, select:focus, textarea:focus { outline: 2px solid rgba(28,92,171,.35); border-color: var(--blue); }
textarea { min-height: 90px; resize: vertical; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.checkline { display: flex; gap: 9px; align-items: flex-start; font-size: 13.5px; color: var(--text-2); margin: 14px 0; }
.checkline input { margin-top: 3px; }
.errors { background: #fdf0f0; border: 1px solid #f0c4c4; color: #8f2222; border-radius: 8px; padding: 10px 14px; margin-bottom: 14px; font-size: 14px; }
.errors ul { margin: 0; padding-left: 18px; }

.flash { padding: 11px 16px; border-radius: 8px; margin-bottom: 18px; font-size: 14px; border: 1px solid; }
.flash-success { background: #eef8ee; border-color: #bfe3bf; color: var(--good-text); }
.flash-warn { background: #fdf6e7; border-color: #ecd9a8; color: #7a5200; }
.flash-info { background: #eef3fb; border-color: #c4d6ef; color: var(--blue-deep); word-break: break-all; }

/* =====================================================
   APP SHELL
   ===================================================== */
.shell { display: flex; min-height: 100vh; }
.sidebar {
  width: 232px; flex-shrink: 0; background: var(--ink); color: var(--cream-dim);
  display: flex; flex-direction: column; padding: 20px 0;
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.sidebar .mkt-logo { font-size: 20px; padding: 0 22px 16px; display: block; }

/* section accent colors */
.side-sec { --sec: var(--amber); --sec-soft: rgba(245,184,61,.10); }
.sec-overview  { --sec: #f5b83d; --sec-soft: rgba(245,184,61,.10); }
.sec-assess    { --sec: #62d9d0; --sec-soft: rgba(98,217,208,.10); }
.sec-act       { --sec: #f0997b; --sec-soft: rgba(240,153,123,.10); }
.sec-workspace { --sec: #afa9ec; --sec-soft: rgba(175,169,236,.10); }
.sec-platform  { --sec: #f09595; --sec-soft: rgba(240,149,149,.10); }

.side-group {
  display: flex; align-items: center; gap: 9px;
  font-family: var(--font-body); font-size: 15px; font-weight: 700;
  letter-spacing: .06em; text-transform: uppercase; color: #ffffff;
  padding: 18px 22px 7px;
}
.side-group::before {
  content: ""; width: 9px; height: 9px; border-radius: 3px; flex-shrink: 0;
  background: var(--sec);
}
.sidebar nav a {
  display: block; padding: 8px 22px 8px 40px; color: var(--cream-dim); font-size: 14px;
  border-left: 3px solid transparent;
}
.sidebar nav a:hover { color: #fff; text-decoration: none; background: rgba(255,255,255,.04); }
.sidebar nav a.active { color: #fff; border-left-color: var(--sec); background: var(--sec-soft); }
.side-foot { margin-top: auto; padding: 16px 22px; font-size: 12.5px; color: #566078; border-top: 1px solid #1d2640; }
.side-foot a { color: var(--cream-dim); }

.main { flex: 1; min-width: 0; padding: 28px 34px 60px; }
.topbar { display: flex; align-items: center; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.topbar h1 { font-size: 26px; margin: 0; }
.topbar .spacer { flex: 1; }
.topbar .ws-name { font-size: 13px; color: var(--text-3); }
.plan-chip {
  font-family: var(--font-mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase;
  background: var(--ink); color: var(--amber); border-radius: 999px; padding: 4px 12px;
}

/* cards + tables */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px; margin-bottom: 20px; }
.card h2 { font-size: 17px; margin-bottom: 14px; }
.card h2 .sub { font-family: var(--font-body); font-weight: 400; font-size: 13px; color: var(--text-3); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: start; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
@media (max-width: 980px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } .form-row { grid-template-columns: 1fr; } }

table.data { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.data th {
  text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .07em;
  color: var(--text-3); font-weight: 600; padding: 8px 10px; border-bottom: 1px solid var(--line);
}
table.data td { padding: 9px 10px; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
table.data tr:hover td { background: #faf9f4; }
.table-scroll { overflow-x: auto; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }

/* badges */
.badge { display: inline-block; font-size: 11.5px; font-weight: 700; padding: 2px 9px; border-radius: 999px; border: 1px solid; white-space: nowrap; }
.badge-crit { color: #fff; background: var(--critical); border-color: var(--critical); }
.badge-high { color: #7c3a00; background: #fdeee4; border-color: #f3c8a8; }
.badge-med  { color: var(--blue-deep); background: #eaf1fa; border-color: #c8daf0; }
.badge-low  { color: var(--text-2); background: #f1f0ea; border-color: var(--line); }
.badge-status { color: var(--text-2); background: #f1f0ea; border-color: var(--line); font-weight: 600; }
.badge-status[data-s=completed], .badge-status[data-s=active], .badge-status[data-s=approved],
.badge-status[data-s=match], .badge-status[data-s=accepted], .badge-status[data-s=connected] { color: var(--good-text); background: #eef8ee; border-color: #bfe3bf; }
.badge-status[data-s=running], .badge-status[data-s=in_progress], .badge-status[data-s=queued] { color: var(--blue-deep); background: #eaf1fa; border-color: #c8daf0; }
.badge-status[data-s=failed], .badge-status[data-s=error], .badge-status[data-s=mismatch], .badge-status[data-s=missing] { color: #8f2222; background: #fdf0f0; border-color: #f0c4c4; }

/* stat tiles */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; margin-bottom: 20px; }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 15px 17px; }
.tile .t-label { font-size: 12px; color: var(--text-3); font-weight: 600; }
.tile .t-value { font-size: 30px; font-weight: 600; font-family: var(--font-body); letter-spacing: -.01em; margin-top: 2px; }
.tile .t-note { font-size: 12px; color: var(--text-3); }
.tile .delta-up { color: var(--good-text); font-size: 13px; font-weight: 700; }
.tile .delta-down { color: var(--critical); font-size: 13px; font-weight: 700; }

/* score ring (hero number) */
.score-hero { display: flex; gap: 26px; align-items: center; }
.ring { width: 128px; height: 128px; border-radius: 50%; display: grid; place-items: center; flex-shrink: 0; }
.ring .inner {
  width: 100px; height: 100px; border-radius: 50%; background: var(--surface);
  display: grid; place-items: center; font-size: 32px; font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.ring .inner small { font-size: 11px; color: var(--text-3); display: block; text-align: center; font-weight: 600; }

/* horizontal bars (single-hue + categorical) */
.bar-row { display: grid; grid-template-columns: 170px 1fr 52px; gap: 12px; align-items: center; margin: 7px 0; font-size: 13px; }
.bar-row .bar-label { color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-track { background: var(--line-soft); border-radius: 4px; height: 14px; position: relative; }
.bar-fill { position: absolute; inset: 0 auto 0 0; border-radius: 4px; min-width: 2px; background: var(--seq-450, #2a78d6); }
.bar-val { text-align: right; font-variant-numeric: tabular-nums; color: var(--text-2); font-weight: 600; }
.bar-row.you .bar-label { font-weight: 700; }

/* trend sparkline */
.spark { width: 100%; height: 74px; }
.spark polyline { fill: none; stroke: var(--s1); stroke-width: 2; }
.spark circle { fill: var(--s1); }

/* usage meters */
.meter { margin: 9px 0; font-size: 13px; }
.meter .m-head { display: flex; justify-content: space-between; color: var(--text-2); margin-bottom: 3px; }
.meter .m-track { height: 8px; background: var(--line-soft); border-radius: 4px; }
.meter .m-fill { height: 100%; border-radius: 4px; background: var(--seq-550); }
.meter .m-fill.hot { background: var(--serious); }
.meter .m-fill.full { background: var(--critical); }

/* progress screens */
.progress-big { height: 18px; background: var(--line-soft); border-radius: 9px; overflow: hidden; margin: 14px 0; }
.progress-big .p-fill { height: 100%; background: linear-gradient(90deg, var(--seq-400), var(--seq-550)); border-radius: 9px; transition: width .6s ease; }

/* AI response text */
.response-box {
  background: #fbfaf6; border: 1px solid var(--line); border-radius: 8px; padding: 16px 18px;
  font-size: 14px; white-space: pre-wrap; font-family: var(--font-body); max-height: 480px; overflow-y: auto;
}
.snippet { background: #fbf6e9; border-left: 3px solid var(--amber); padding: 8px 12px; font-size: 13px; margin: 6px 0; border-radius: 0 6px 6px 0; }

/* guided journey */
.phase-track { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 4px 0 20px; }
.phase-seg { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 14px; color: var(--text-3); }
.phase-seg .phase-dot {
  width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center;
  font-size: 13px; background: var(--line-soft); color: var(--text-3); border: 1px solid var(--line);
}
.phase-seg.current { color: var(--blue-deep); }
.phase-seg.current .phase-dot { background: var(--blue); color: #fff; border-color: var(--blue); }
.phase-seg.done { color: var(--good-text); }
.phase-seg.done .phase-dot { background: #eef8ee; color: var(--good-text); border-color: #bfe3bf; }
.phase-link { flex: 0 0 34px; height: 2px; background: var(--line); border-radius: 1px; }

.hero-next { display: flex; gap: 20px; align-items: center; border-left: 4px solid var(--blue); border-radius: 0 var(--radius) var(--radius) 0; }
.hero-next.done-hero { border-left-color: var(--good); }
.hero-next .hero-num {
  width: 54px; height: 54px; border-radius: 50%; flex-shrink: 0; display: grid; place-items: center;
  background: var(--ink); color: var(--amber); font-size: 22px; font-weight: 700; font-family: var(--font-display);
}
.hero-next.done-hero .hero-num { background: var(--good); color: #fff; }

.jstep { display: flex; gap: 10px; padding: 10px 8px; border-radius: 8px; margin: 2px -8px; }
.jstep.is-current { background: #eaf1fa; outline: 1px solid #c8daf0; }
.jstep .jdot {
  width: 24px; height: 24px; border-radius: 50%; flex-shrink: 0; display: grid; place-items: center;
  font-size: 12px; font-weight: 700; background: var(--line-soft); color: var(--text-3); border: 1px solid var(--line);
}
.jstep.is-done .jdot { background: #eef8ee; color: var(--good-text); border-color: #bfe3bf; }
.jstep.is-current .jdot { background: var(--blue); color: #fff; border-color: var(--blue); }
.jstep .jtitle { font-weight: 700; font-size: 14px; }
.jstep.is-done .jtitle { color: var(--text-2); }
.jstep.is-done .mini { color: var(--text-3); }

.phase-mini { display: inline-flex; gap: 4px; align-items: center; text-decoration: none !important; flex-wrap: wrap; }
.phase-mini .pm-seg {
  font-size: 11.5px; font-weight: 700; padding: 3px 10px; border-radius: 999px;
  background: var(--line-soft); color: var(--text-3); border: 1px solid var(--line);
}
.phase-mini .pm-seg.current { background: var(--blue); color: #fff; border-color: var(--blue); }
.phase-mini .pm-seg.done { background: #eef8ee; color: var(--good-text); border-color: #bfe3bf; }
.phase-mini:hover .pm-seg { border-color: var(--text-3); }

/* response comparison */
.cmp-line { font-size: 13.5px; margin: 5px 0; padding: 6px 10px; border-radius: 6px; }
.cmp-same { background: #eef8ee; color: var(--good-text); }
.cmp-diff { background: #fdf3e4; color: #7a4a00; }
.cmp-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }

/* misc */
.empty { text-align: center; color: var(--text-3); padding: 46px 20px; }
.empty h3 { color: var(--text-2); font-size: 18px; }
.pill-nav { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.pill-nav a { font-size: 13px; padding: 5px 13px; border-radius: 999px; border: 1px solid var(--line); color: var(--text-2); background: var(--surface); }
.pill-nav a.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.pill-nav a:hover { text-decoration: none; border-color: var(--text-3); }
.mini { font-size: 12.5px; color: var(--text-3); }
.mono { font-family: var(--font-mono); font-size: 12.5px; }
hr.soft { border: 0; border-top: 1px solid var(--line-soft); margin: 16px 0; }
.actions-inline { display: inline-flex; gap: 6px; }
.right { text-align: right; }

/* shared web report */
.webreport { max-width: 880px; margin: 0 auto; padding: 40px 24px 80px; background: var(--paper); }
.webreport-head { border-bottom: 3px solid var(--ink); padding-bottom: 20px; margin-bottom: 30px; }

/* responsive shell */
@media (max-width: 860px) {
  .shell { flex-direction: column; }
  .sidebar { width: 100%; height: auto; position: static; flex-direction: row; flex-wrap: wrap; align-items: center; padding: 10px 8px; }
  .sidebar nav { display: flex; flex-wrap: wrap; }
  .sidebar nav a { padding: 7px 12px; border-left: 0; border-radius: 6px; }
  .side-group, .side-foot { display: none; }
  .main { padding: 20px 16px 60px; }
  .bar-row { grid-template-columns: 110px 1fr 46px; }
}
@media print {
  .sidebar, .topbar .btn, .pill-nav { display: none !important; }
  body { background: #fff; }
}
