/* =============================================================
   MarTech & Gen-AI Stack Audit — engine stylesheet
   One typeface (Inter). Warm paper. Single accent.
   No left-border accent boxes. Tints carry hierarchy instead.
   ============================================================= */

:root {
  --bg:        #f5f3ee;
  --bg-2:      #ebe8df;
  --paper:    #fbfaf6;
  --ink:       #141312;
  --ink-2:     #2c2a26;
  --muted:     #76736b;
  --muted-2:   #a09c92;
  --rule:      #e2dfd5;
  --rule-soft: #ecead0e0;

  /* one accent, used sparingly */
  --accent:    #1f3a8a;

  /* semantic verdict tints */
  --ok:        #2d6a4f;
  --ok-soft:   #e6eee5;
  --warn:      #8a4a1f;
  --warn-soft: #f1e4d2;
  --danger:    #8b2a1f;
  --danger-soft: #efd9d3;

  --font: 'Inter', ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  --max: 980px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-feature-settings: "ss01", "cv11";
}

a {
  color: inherit;
  text-decoration: underline;
  text-decoration-color: var(--rule);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}
a:hover { text-decoration-color: var(--ink); }

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 28px; }

.eyebrow {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--muted);
  margin: 0 0 14px;
}

.muted { color: var(--muted); }
.lbl {
  display: block;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--muted);
  margin-bottom: 10px;
}

/* ----- top header ---------------------------------------------- */
.top {
  border-bottom: 1px solid var(--rule);
  background: var(--bg);
  position: sticky; top: 0; z-index: 5;
  backdrop-filter: blur(8px);
  background-color: rgba(245, 243, 238, 0.92);
}
.top .wrap {
  display: flex; align-items: center; justify-content: space-between;
  gap: 24px;
  padding-top: 16px; padding-bottom: 16px;
}
.brand {
  display: flex; align-items: center; gap: 12px;
  font-weight: 600; letter-spacing: -0.005em;
}
.brand-mark {
  width: 18px; height: 18px;
  background: var(--ink);
  border-radius: 2px;
  position: relative;
}
.brand-mark::after {
  content: "";
  position: absolute; left: 4px; bottom: 4px;
  width: 6px; height: 6px;
  background: var(--bg);
}
.brand-name { font-size: 15px; }
.top-right { display: flex; align-items: center; gap: 24px; }
.top-right .by { font-size: 13px; color: var(--muted); }
.top nav {
  display: flex; gap: 22px;
  font-size: 13px;
}
.top nav a {
  color: var(--muted);
  text-decoration: none;
}
.top nav a:hover { color: var(--ink); }

/* ----- hero ---------------------------------------------------- */
.hero {
  padding-top: 84px;
  padding-bottom: 56px;
  border-bottom: 1px solid var(--rule);
}
.hero .thesis {
  margin: 0 0 24px;
  font-size: clamp(34px, 5.4vw, 56px);
  line-height: 1.05;
  letter-spacing: -0.028em;
  font-weight: 600;
  max-width: 14ch;
  text-wrap: balance;
}
.hero .thesis-2 {
  color: var(--muted);
  font-weight: 500;
}
.hero .lede {
  margin: 0;
  font-size: 17px;
  line-height: 1.55;
  color: var(--ink-2);
  max-width: 60ch;
  text-wrap: pretty;
}

/* ----- demo --------------------------------------------------- */
.demo { padding-top: 56px; padding-bottom: 56px; }
.demo-head { display: flex; align-items: baseline; gap: 18px; flex-wrap: wrap; margin-bottom: 22px; }
.demo-head h2 {
  margin: 0;
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.015em;
}
.demo-head p { margin: 0; font-size: 14px; }

.tabs {
  display: inline-flex;
  padding: 4px;
  background: var(--bg-2);
  border-radius: 8px;
  margin-bottom: 16px;
  gap: 2px;
}
.tab {
  appearance: none;
  border: none;
  background: transparent;
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  padding: 8px 14px;
  border-radius: 6px;
  cursor: pointer;
  letter-spacing: -0.005em;
  transition: background 0.15s, color 0.15s;
}
.tab:hover { color: var(--ink); }
.tab.active {
  background: var(--paper);
  color: var(--ink);
  box-shadow: 0 1px 2px rgba(0,0,0,0.04), 0 0 0 1px var(--rule);
}

.intake-card {
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 8px;
  padding: 20px 22px 18px;
  margin-bottom: 36px;
}
.intake-card textarea {
  width: 100%;
  border: 1px solid var(--rule);
  border-radius: 6px;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 13.5px;
  line-height: 1.6;
  padding: 14px 16px;
  min-height: 220px;
  resize: vertical;
  outline: none;
  transition: border-color 0.12s, background 0.12s;
}
.intake-card textarea:focus {
  border-color: var(--ink);
  background: #fff;
}

.intake-actions {
  display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
  margin-top: 14px;
}
.btn {
  appearance: none;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: var(--bg);
  font: inherit;
  font-weight: 600;
  font-size: 13.5px;
  letter-spacing: -0.005em;
  padding: 10px 22px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, transform 0.05s;
}
.btn:hover:not(:disabled) { background: var(--ink-2); }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: 0.5; cursor: wait; }
.status {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
  flex: 1;
  min-width: 240px;
}

/* ----- result region ----------------------------------------- */
.result-region {
  display: grid;
  gap: 28px;
}
.result-pane { display: none; }
.result-pane.active { display: grid; gap: 28px; }

.client-summary {
  font-size: 17px;
  line-height: 1.5;
  color: var(--ink-2);
  font-style: italic;
  margin: 0;
  max-width: 60ch;
}

/* Sample-run banner — sits above the callout on pre-baked results.
   Disappears automatically when a live /audit response replaces the pane. */
.sample-banner {
  background: rgba(241, 228, 210, 0.5);
  border: 1px solid rgba(138, 74, 31, 0.18);
  border-radius: 6px;
  padding: 11px 16px;
  display: flex;
  align-items: baseline;
  gap: 14px;
  flex-wrap: wrap;
}
.sample-banner .sb-eyebrow {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--warn);
  flex: 0 0 auto;
  white-space: nowrap;
}
.sample-banner .sb-body {
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
  color: var(--ink-2);
  flex: 1;
  min-width: 240px;
}
.sample-banner .sb-body strong { font-weight: 600; }

/* Override / clean callout — tinted block, no left border */
.callout {
  border-radius: 8px;
  padding: 20px 22px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 22px;
  align-items: end;
}
.callout.warn  { background: var(--warn-soft); }
.callout.clean { background: var(--ok-soft); }
.callout .c-eyebrow {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  margin: 0 0 8px;
}
.callout.warn  .c-eyebrow { color: var(--warn); }
.callout.clean .c-eyebrow { color: var(--ok); }
.callout .c-body {
  margin: 0;
  font-size: 19px;
  font-weight: 500;
  line-height: 1.4;
  letter-spacing: -0.012em;
  max-width: 56ch;
  text-wrap: pretty;
}
.callout strong { font-weight: 700; }
.callout .c-meta {
  display: grid;
  grid-auto-flow: column;
  gap: 28px;
  align-items: end;
}
.callout .c-meta div { text-align: left; }
.callout .c-meta .lbl-2 {
  display: block;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--muted);
  font-weight: 600;
  margin-bottom: 4px;
}
.callout.warn .c-meta .lbl-2 { color: rgba(138, 74, 31, 0.7); }
.callout.clean .c-meta .lbl-2 { color: rgba(45, 106, 79, 0.7); }
.callout .c-meta .val {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.015em;
  font-variant-numeric: tabular-nums;
}

/* section sub-titles inside result */
.section-title {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--muted);
  margin: 8px 0 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--rule);
}

/* findings table */
.table-wrap { overflow-x: auto; }
table.findings {
  width: 100%; min-width: 660px;
  border-collapse: collapse;
  font-size: 13.5px;
}
table.findings thead th {
  text-align: left;
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  padding: 0 14px 10px 0;
  border-bottom: 1px solid var(--ink);
}
table.findings tbody td {
  padding: 14px 14px 14px 0;
  vertical-align: top;
  border-bottom: 1px dashed var(--rule);
  line-height: 1.5;
}
table.findings tbody tr:last-child td { border-bottom: 1px solid var(--rule); }
table.findings tbody tr.overridden td { background: rgba(241, 228, 210, 0.55); }
table.findings tbody tr.overridden td:first-child { border-radius: 4px 0 0 4px; }
table.findings tbody tr.overridden td:last-child { border-radius: 0 4px 4px 0; }
table.findings td.num {
  font-size: 11.5px;
  color: var(--muted);
  font-weight: 600;
  width: 36px;
  font-variant-numeric: tabular-nums;
  padding-left: 14px;
}
.f-type { font-size: 13px; color: var(--ink-2); white-space: nowrap; }
.type-label { display: block; font-weight: 500; }
.type-layer {
  display: block;
  margin-top: 3px;
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.02em;
}
.f-title { display: block; font-weight: 600; }
.f-detail { display: block; color: var(--muted); font-size: 13px; margin-top: 4px; }
.f-deps {
  display: inline-block;
  margin-top: 8px;
  font-size: 11px;
  color: var(--warn);
  background: var(--warn-soft);
  padding: 2px 8px;
  border-radius: 999px;
}
.cell-tight { white-space: nowrap; }

/* verdict pills */
.v {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: -0.005em;
  padding: 3px 9px;
  border-radius: 999px;
  white-space: nowrap;
}
.v::before {
  content: "";
  width: 6px; height: 6px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.65;
}
.v-ship_now             { background: var(--ok-soft);     color: var(--ok); }
.v-fix_foundation_first { background: var(--warn-soft);   color: var(--warn); }
.v-re_scope             { background: var(--bg-2);        color: var(--muted); }
.v-dont_pursue          { background: var(--danger-soft); color: var(--danger); }
.v-na { font-size: 11.5px; color: var(--muted-2); }
.v.sm { font-size: 10.5px; padding: 2px 8px; }

.override-flag {
  display: inline-block;
  margin-left: 8px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--warn);
}

/* override cards */
.override-card {
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 8px;
  padding: 16px 20px;
  display: grid;
  gap: 8px;
  margin-bottom: 10px;
}
.oc-head {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.008em;
}
.oc-id {
  display: inline-block;
  margin-right: 10px;
  font-size: 11px;
  color: var(--muted);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.oc-flow {
  display: flex; align-items: center; gap: 10px;
  margin: 0; flex-wrap: wrap;
}
.oc-flow .arrow { color: var(--muted); font-size: 14px; }
.oc-reason {
  margin: 0;
  font-size: 13.5px;
  color: var(--ink-2);
  line-height: 1.55;
  max-width: 70ch;
}

/* roadmap */
.roadmap-note {
  font-size: 13px;
  color: var(--muted);
  margin: 0 0 18px;
  max-width: 60ch;
}
.phase {
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 8px;
  padding: 18px 22px 20px;
  margin-bottom: 12px;
}
.phase.phase-1 { background: linear-gradient(180deg, rgba(241,228,210,0.55), rgba(241,228,210,0.18)); }
.phase.phase-2 { background: linear-gradient(180deg, rgba(230,238,229,0.55), rgba(230,238,229,0.18)); }
.phase.phase-3 { background: var(--paper); }
.phase.phase-parked { background: transparent; border-style: dashed; }
.phase-head {
  display: flex; align-items: baseline; gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}
.phase-n {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.phase.phase-1 .phase-n { color: var(--warn); }
.phase.phase-2 .phase-n { color: var(--ok); }
.phase.phase-3 .phase-n { color: var(--ink); }
.phase-name {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.012em;
}
.phase-count {
  margin-left: auto;
  font-size: 11.5px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  background: rgba(255,255,255,0.6);
  padding: 2px 10px;
  border-radius: 999px;
  border: 1px solid var(--rule);
}
.phase-why {
  font-size: 13px;
  color: var(--muted);
  margin: 0 0 10px;
  max-width: 60ch;
}
.phase-list {
  list-style: none;
  padding: 0;
  margin: 6px 0 0;
  border-top: 1px solid var(--rule);
}
.phase-list li {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 10px 0;
  border-bottom: 1px dashed var(--rule);
  font-size: 14px;
}
.phase-list li:last-child { border-bottom: none; }
.pl-id {
  font-size: 11px;
  color: var(--muted);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
  width: 32px;
}
.pl-title { font-weight: 500; flex: 1; min-width: 0; }
.phase-empty {
  font-size: 13px;
  color: var(--muted-2);
  margin: 8px 0 0;
  font-style: italic;
}

/* ----- method strip ------------------------------------------ */
.method { padding-top: 70px; padding-bottom: 70px; border-top: 1px solid var(--rule); }
.section-head { margin-bottom: 28px; }
.section-head h2 {
  margin: 0;
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.022em;
  max-width: 22ch;
}
.split {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 10px;
  overflow: hidden;
}
.split-col {
  padding: 22px 22px 24px;
  border-right: 1px solid var(--rule);
}
.split-col:last-child { border-right: none; }
.col-tag {
  display: inline-block;
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  padding: 3px 9px;
  border-radius: 999px;
  margin: 0 0 14px;
}
.tag-llm   { background: #ece4f6; color: #5b3dba; }
.tag-rules { background: #e1ebff; color: var(--accent); }
.tag-out   { background: var(--ink); color: var(--bg); }
.col-body {
  margin: 0;
  font-size: 14.5px;
  line-height: 1.55;
  color: var(--ink-2);
  max-width: 36ch;
}
.micro-note {
  margin: 18px 0 0;
  font-size: 13px;
  color: var(--muted);
  max-width: 70ch;
}

@media (max-width: 760px) {
  .split { grid-template-columns: 1fr; }
  .split-col { border-right: none; border-bottom: 1px solid var(--rule); }
  .split-col:last-child { border-bottom: none; }
}

/* ----- framework block --------------------------------------- */
.framework { padding-top: 70px; padding-bottom: 90px; border-top: 1px solid var(--rule); }
.fw-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 40px;
}
@media (max-width: 820px) {
  .fw-grid { grid-template-columns: 1fr; gap: 28px; }
}
.fw-stack { display: grid; gap: 6px; }
.layer {
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 8px;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 18px;
}
.layer-n {
  flex: 0 0 32px;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
}
.layer-body { flex: 1; min-width: 0; display: grid; gap: 2px; }
.layer-name {
  font-weight: 600;
  letter-spacing: -0.008em;
  font-size: 15px;
  color: var(--ink);
}
.layer-desc {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.45;
}
.layer-tag {
  flex: 0 0 auto;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--warn);
}
.layer.layer-4 {
  background: linear-gradient(180deg, rgba(31, 58, 138, 0.06), rgba(31, 58, 138, 0.02));
  border-color: rgba(31, 58, 138, 0.18);
}
.layer.layer-4 .layer-name { color: var(--accent); }
.layer.foundation { background: var(--bg-2); }

.fw-side { padding-top: 4px; }
.side-title {
  margin: 0 0 14px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--muted);
}
.verdicts {
  list-style: none;
  padding: 0; margin: 0 0 18px;
  display: grid;
  gap: 14px;
}
.verdicts li {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink-2);
}
.verdicts .vtxt { flex: 1; min-width: 0; }
.verdicts li b { font-weight: 600; color: var(--ink); }
.vdot {
  flex: 0 0 10px;
  width: 10px; height: 10px;
  border-radius: 50%;
  margin-top: 7px;
}
.vdot-ok     { background: var(--ok); }
.vdot-warn   { background: var(--warn); }
.vdot-muted  { background: var(--muted); }
.vdot-danger { background: var(--danger); }
.side-foot {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
  font-style: italic;
}

/* ----- footer ----------------------------------------------- */
.bottom {
  border-top: 1px solid var(--rule);
  padding: 28px 0 40px;
  font-size: 13px;
  color: var(--muted);
}
.bottom p { margin: 0 0 6px; }
.bottom a { color: var(--ink-2); }
.bottom code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  color: var(--ink-2);
}

/* ----- responsive ------------------------------------------- */
@media (max-width: 700px) {
  .top .wrap { flex-direction: column; align-items: flex-start; gap: 10px; padding-top: 14px; padding-bottom: 14px; }
  .top-right { gap: 14px; }
  .top nav { gap: 16px; }
  .hero { padding-top: 56px; padding-bottom: 40px; }
  .callout { grid-template-columns: 1fr; }
  .callout .c-meta { grid-auto-flow: column; justify-content: flex-start; gap: 22px; }
}

/* ----- result entrance --------------------------------------- */
.result-region .result-pane.active > * {
  opacity: 0;
  transform: translateY(6px);
  animation: rise 0.45s ease forwards;
}
.result-region .result-pane.active > *:nth-child(2) { animation-delay: 0.05s; }
.result-region .result-pane.active > *:nth-child(3) { animation-delay: 0.10s; }
.result-region .result-pane.active > *:nth-child(4) { animation-delay: 0.15s; }
.result-region .result-pane.active > *:nth-child(5) { animation-delay: 0.20s; }
.result-region .result-pane.active > *:nth-child(6) { animation-delay: 0.25s; }
.result-region .result-pane.active > *:nth-child(7) { animation-delay: 0.30s; }
.result-region .result-pane.active > *:nth-child(8) { animation-delay: 0.35s; }
.result-region .result-pane.active > *:nth-child(9) { animation-delay: 0.40s; }
@keyframes rise {
  to { opacity: 1; transform: none; }
}

/* skeleton during live extract */
.skeleton {
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 8px;
  padding: 28px;
  display: grid;
  gap: 14px;
  opacity: 1; transform: none;
  animation: none;
}
.skel-line {
  height: 12px;
  background: linear-gradient(90deg, var(--bg-2) 0%, var(--bg) 50%, var(--bg-2) 100%);
  background-size: 200% 100%;
  border-radius: 4px;
  animation: shimmer 1.2s linear infinite;
}
.skel-line.w-1 { width: 38%; }
.skel-line.w-2 { width: 82%; }
.skel-line.w-3 { width: 64%; }
.skel-line.w-4 { width: 92%; }
@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* error block returned by POST /audit */
.error {
  background: var(--danger-soft);
  color: var(--danger);
  border-radius: 8px;
  padding: 16px 20px;
  font-size: 14px;
  line-height: 1.5;
}
