/* ==========================================================================
   Foundation Builder — Empact workspace design system

   Palette and type are Empact's own, lifted from the `client` skin in the deck
   they already show their clients (deliverables/_sent/2026-08-13). Keeping them
   identical is the point: this is their product, under their brand.

     teal    #17726D   primary / links / active state
     crimson #BE3151   accent, used sparingly
     Sora    the deck's typeface throughout

   Empact's brand. Built with Agentic Users; see the footer, not the chrome.
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Sora:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  --accent:      #17726D;
  --accent-700:  #115853;
  --accent-050:  #E7F0EF;
  --accent-tint: rgba(23,114,109,.09);
  --accent-line: rgba(23,114,109,.28);

  --crimson:     #BE3151;
  --crimson-050: #FBECEF;

  --bg:      #F4F1EC;
  --stage:   #FFFFFF;
  --soft:    #FAF8F4;
  --ink:     #2F363C;
  --muted:   #4E5862;
  --faint:   #8D949C;
  --line:    #E4DFD7;
  --line-soft: #EFEBE4;

  --good:      #157F5B;
  --good-050:  #E6F4EF;
  --warn:      #B4741A;
  --warn-050:  #FBF1E2;
  --bad:       #B3261E;
  --bad-050:   #FBEAE9;

  --font: 'Sora', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --r-sm: 6px;
  --r:    10px;
  --r-lg: 16px;
  --pill: 50px;
  --shadow-sm: 0 1px 2px rgba(47,54,60,.04), 0 1px 3px rgba(47,54,60,.05);
  --shadow:    0 2px 4px rgba(47,54,60,.03), 0 10px 30px -14px rgba(47,54,60,.18);
  --shadow-lg: 0 30px 70px -30px rgba(23,114,109,.30);
  --nav-h: 64px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
[x-cloak] { display: none !important; }
html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4 { font-weight: 500; letter-spacing: -.02em; line-height: 1.2; }
h1 { font-size: 44px; font-weight: 300; }
h1 strong { font-weight: 600; }
h2 { font-size: 24px; font-weight: 500; }
h3 { font-size: 16px; font-weight: 600; letter-spacing: -.01em; }
h4 { font-size: 12.5px; font-weight: 600; }

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-700); }
code, pre, .mono { font-family: var(--mono); font-size: 12px; }

.eyebrow { font-size: 10.5px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--faint); }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.row  { display: flex; align-items: center; gap: 10px; }
.col  { display: flex; flex-direction: column; }
.wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.right { margin-left: auto; }
.center { text-align: center; }
.lede { font-size: 17px; line-height: 1.65; color: var(--muted); font-weight: 300; }

/* -------------------------------------------------------------------- chrome */
.topbar {
  height: var(--nav-h); display: flex; align-items: center; gap: 18px;
  padding: 0 28px; background: var(--stage); border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 40;
}
.brand { display: flex; align-items: center; gap: 11px; color: var(--ink); }
.brand img { height: 26px; width: auto; display: block; }
.brand .divider { width: 1px; height: 20px; background: var(--line); }
.brand .title { font-size: 14px; font-weight: 500; letter-spacing: -.01em; }
.nav { display: flex; gap: 4px; margin-left: 10px; }
.nav a {
  font-size: 13px; color: var(--muted); padding: 7px 13px; border-radius: var(--pill);
  transition: background .16s ease, color .16s ease;
}
.nav a:hover { background: var(--accent-tint); color: var(--accent-700); }
.nav a.on { background: var(--accent); color: #fff; }

.page { max-width: 1080px; margin: 0 auto; padding: 40px 28px 80px; }
.page--narrow { max-width: 760px; }

/* ------------------------------------------------------------------- buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--font); font-size: 11.5px; font-weight: 600;
  letter-spacing: .09em; text-transform: uppercase;
  padding: 11px 24px; border-radius: var(--pill);
  border: 1px solid var(--line); background: var(--stage); color: var(--accent);
  cursor: pointer; white-space: nowrap;
  transition: background .16s ease, color .16s ease, border-color .16s ease, transform .12s ease;
}
.btn:hover { border-color: var(--accent); color: var(--accent-700); }
.btn:active { transform: translateY(1px); }
.btn--primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn--primary:hover { background: var(--accent-700); border-color: var(--accent-700); color: #fff; }
.btn--lg { padding: 14px 32px; font-size: 12px; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }

/* --------------------------------------------------------------------- cards */
.card {
  background: var(--stage); border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: 26px; box-shadow: var(--shadow-sm);
}
.card + .card { margin-top: 22px; }
.card__head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 20px; }
/* A card that ends in a disclosure summary closed up against its own edge. */
details.disclose:last-child { padding-bottom: 4px; }

/* --------------------------------------------------------------------- forms */
/* `.field`, not `label.field`: a radio group is a <div> with the same job, and
   it was getting no bottom margin at all — the submit row sat on top of it. */
.field { display: block; margin-bottom: 22px; }
.field:last-child { margin-bottom: 0; }
/* The row of actions that ends a form. */
.form-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 16px; margin-top: 4px; }
.form-actions + .faint { margin-top: 14px; }
label.field > span {
  display: block; font-size: 12.5px; font-weight: 500; margin-bottom: 7px; color: var(--ink);
}
label.field > small { display: block; color: var(--faint); font-size: 12px; margin-top: 6px; font-weight: 300; }
input[type=text], input[type=email], input[type=password], select, textarea {
  width: 100%; font-family: var(--font); font-size: 14px; color: var(--ink);
  background: var(--soft); border: 1px solid var(--line); border-radius: var(--r);
  padding: 11px 14px; transition: border-color .16s ease, background .16s ease;
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--accent); background: var(--stage);
  box-shadow: 0 0 0 3px var(--accent-tint);
}
textarea { min-height: 120px; resize: vertical; line-height: 1.6; }

.choice { display: grid; gap: 10px; }
.choice label {
  display: flex; gap: 12px; align-items: flex-start; cursor: pointer;
  border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px;
  background: var(--soft); transition: border-color .16s ease, background .16s ease;
}
.choice label:hover { border-color: var(--accent-line); background: var(--stage); }
.choice input { margin-top: 3px; accent-color: var(--accent); }
.choice strong { display: block; font-size: 13.5px; font-weight: 600; }
.choice small { color: var(--muted); font-size: 12.5px; font-weight: 300; }

.err {
  background: var(--bad-050); border: 1px solid rgba(179,38,30,.22); color: var(--bad);
  border-radius: var(--r); padding: 14px 16px; font-size: 13px; line-height: 1.5;
  margin-bottom: 20px;
}
.card__head + .err { margin-top: 2px; }

/* --------------------------------------------------------------------- pills */
.pill {
  display: inline-flex; align-items: center; gap: 6px; font-size: 10.5px; font-weight: 600;
  letter-spacing: .07em; text-transform: uppercase; padding: 4px 11px; border-radius: var(--pill);
  background: var(--soft); color: var(--muted); border: 1px solid var(--line);
}
.pill--ready    { background: var(--accent-050); color: var(--accent-700); border-color: var(--accent-line); }
.pill--degraded { background: var(--warn-050); color: var(--warn); border-color: rgba(180,116,26,.24); }
.pill--blocked  { background: var(--soft); color: var(--faint); }
.pill--done     { background: var(--good-050); color: var(--good); border-color: rgba(21,127,91,.22); }
.pill--locked   { background: var(--crimson-050); color: var(--crimson); border-color: rgba(190,49,81,.2); }
.pill--superseded { background: var(--soft); color: var(--faint); text-decoration: line-through; }

/* ------------------------------------------------------------------ landing */
.hero { padding: 76px 0 52px; }
.hero h1 { max-width: 15ch; margin-bottom: 20px; }
.hero .lede { max-width: 54ch; }
.hero__accent { color: var(--accent); }

.tree {
  font-family: var(--mono); font-size: 12.5px; line-height: 2;
  background: var(--soft); border: 1px solid var(--line); border-radius: var(--r);
  padding: 18px 20px; color: var(--muted);
}
.tree b { color: var(--ink); font-weight: 500; }
.tree .miss { color: var(--faint); }

.steps { counter-reset: s; display: grid; gap: 18px; }
.steps li { list-style: none; display: flex; gap: 14px; align-items: flex-start; }
.steps li::before {
  counter-increment: s; content: counter(s);
  flex: 0 0 26px; height: 26px; border-radius: 50%;
  background: var(--accent-050); color: var(--accent-700);
  font-size: 12px; font-weight: 600; display: grid; place-items: center; margin-top: 1px;
}

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 820px) { .grid-2 { grid-template-columns: 1fr; } .hero h1 { font-size: 34px; } }

/* --------------------------------------------------------------- mcp result */
.urlbox {
  display: flex; align-items: center; gap: 10px;
  background: var(--ink); border-radius: var(--r); padding: 14px 16px;
}
.urlbox code { color: #EFEDE8; font-size: 12.5px; word-break: break-all; flex: 1; }
.urlbox button {
  font-family: var(--font); font-size: 10.5px; font-weight: 600; letter-spacing: .08em;
  text-transform: uppercase; color: var(--ink); background: #EFEDE8; border: 0;
  border-radius: var(--pill); padding: 7px 14px; cursor: pointer;
}
.urlbox button:hover { background: #fff; }

/* -------------------------------------------------------------- module list */
.module {
  display: flex; align-items: center; gap: 14px; padding: 13px 2px;
  border-bottom: 1px solid var(--line-soft);
}
.module:last-child { border-bottom: 0; }
.module__id {
  flex: 0 0 34px; font-family: var(--mono); font-size: 11.5px; color: var(--faint);
}
.module__title { font-size: 13.5px; font-weight: 500; }
.module__path { font-family: var(--mono); font-size: 11.5px; color: var(--faint); }
.module__why { font-size: 12px; color: var(--muted); font-weight: 300; }
.module--next { background: var(--accent-050); border-radius: var(--r); padding-inline: 12px; }
.module__pills { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }

/* A decision the person made once, shown back to them. */
.fact { display: flex; align-items: flex-start; gap: 16px; padding: 14px 2px;
        border-bottom: 1px solid var(--line-soft); }
.fact:last-child { border-bottom: 0; padding-bottom: 0; }
.fact:first-of-type { padding-top: 0; }
.fact__label { flex: 0 0 150px; font-size: 12px; color: var(--faint); font-weight: 300;
               padding-top: 1px; }
.fact__value { font-size: 13.5px; font-weight: 500; }
@media (max-width: 720px) {
  .fact { flex-wrap: wrap; gap: 6px 12px; }
  .fact__label { flex-basis: 100%; }
}

/* ------------------------------------------------------------- long lists
   A list that grows with use (the audit log, the tool list, a document's
   text) must not decide how tall the page is. Each one scrolls inside a fixed
   frame, so the page keeps its shape at ten records and at ten thousand. */
.scroller {
  max-height: 420px; overflow-y: auto; overscroll-behavior: contain;
  margin: 0 -4px; padding: 0 4px;
  /* A cut-off list should look cut off: the fade is the only cue that there
     is more below until the scrollbar appears on hover. */
  mask-image: linear-gradient(to bottom, #000 calc(100% - 20px), transparent 100%);
}
.scroller--short { max-height: 300px; }
.scroller--tall  { max-height: 560px; }
.scroller::-webkit-scrollbar { width: 9px; }
.scroller::-webkit-scrollbar-thumb {
  background: var(--line); border-radius: var(--pill);
  border: 3px solid var(--stage); background-clip: padding-box;
}
.scroller::-webkit-scrollbar-thumb:hover { background: var(--accent-line); background-clip: padding-box; }
.scroller { scrollbar-width: thin; scrollbar-color: var(--line) transparent; }

/* A log line is scanned, not read: tighter than a content row, and the time
   and actor stay out of the way of what happened. */
.logrow { display: flex; align-items: baseline; gap: 12px; padding: 9px 2px;
          border-bottom: 1px solid var(--line-soft); }
.logrow:last-child { border-bottom: 0; }
.logrow__time { flex: 0 0 42px; font-family: var(--mono); font-size: 11px; color: var(--faint); }
.logrow__what { font-size: 13px; }
.logrow__who  { font-size: 11.5px; color: var(--faint); font-weight: 300; }
.logrow__detail { font-size: 11.5px; color: var(--muted); font-weight: 300; }

/* ------------------------------------------------------- disclosure blocks
   Reference material a person opens when they need it. Closed, it is one
   line; open, it is the whole list. */
details.disclose { border-top: 1px solid var(--line-soft); padding-top: 14px; margin-top: 18px; }
details.disclose > summary {
  cursor: pointer; list-style: none; display: flex; align-items: center; gap: 8px;
  font-size: 12.5px; font-weight: 500; color: var(--muted);
}
details.disclose > summary::-webkit-details-marker { display: none; }
details.disclose > summary::before {
  content: "›"; display: inline-block; font-size: 15px; line-height: 1; color: var(--faint);
  transition: transform .16s ease;
}
details.disclose[open] > summary::before { transform: rotate(90deg); }
details.disclose > summary:hover { color: var(--accent-700); }
.disclose__body { padding-top: 14px; }

/* The MCP tool list: two columns of name + one line, not eighteen rows. */
.toolgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 12px 24px; }
.toolgrid div { min-width: 0; }
.toolgrid b { display: block; font-family: var(--mono); font-size: 11.5px; font-weight: 500; color: var(--ink); }
.toolgrid span { font-size: 11.5px; color: var(--muted); font-weight: 300; }

/* ------------------------------------------------------------- doc editors */
.doc { border: 1px solid var(--line); border-radius: var(--r); margin-bottom: 10px; background: var(--stage); }
.doc > summary {
  cursor: pointer; list-style: none; display: flex; align-items: center; gap: 12px;
  padding: 14px 16px;
}
.doc > summary::-webkit-details-marker { display: none; }
.doc > summary::before {
  content: "›"; font-size: 15px; line-height: 1; color: var(--faint); transition: transform .16s ease;
}
.doc[open] > summary::before { transform: rotate(90deg); }
.doc[open] > summary { border-bottom: 1px solid var(--line-soft); }
.doc__path { font-family: var(--mono); font-size: 12.5px; font-weight: 500; }
.doc__meta { font-size: 11.5px; color: var(--faint); font-weight: 300; }
.doc__body { padding: 16px; }
.doc__note { font-size: 12px; color: var(--muted); font-weight: 300; margin-top: 10px; }

/* ------------------------------------------------------------- connect card */
.connect__hint { font-size: 12.5px; color: var(--muted); font-weight: 300; margin-top: 12px; max-width: 70ch; }
.connect__oauth {
  display: flex; align-items: flex-start; gap: 14px; margin-top: 18px;
  padding: 16px; background: var(--soft); border: 1px solid var(--line-soft); border-radius: var(--r);
}
.connect__oauth .pill { flex: 0 0 auto; }
.connect__oauth p { font-size: 13px; color: var(--muted); font-weight: 300; margin: 0; }

/* ------------------------------------------------------------------ phones
   The bar is the thing that breaks first: brand, nav and account controls do
   not fit on 375px in one row, and the page then scrolls sideways. It wraps
   instead, and the workspace name — which the heading repeats two lines
   later — steps out of the way. */
@media (max-width: 720px) {
  .topbar {
    height: auto; flex-wrap: wrap; gap: 8px 12px; padding: 10px 16px;
    position: static;
  }
  .topbar .right { margin-left: auto; }
  .topbar .right > .faint { display: none; }
  .nav { margin-left: 0; flex-wrap: wrap; gap: 2px; }
  .nav a { padding: 6px 11px; }
  .page { padding: 24px 16px 56px; }
  h1 { font-size: 30px; }
  h2 { font-size: 20px; }
  .lede { font-size: 15px; }
  .hero { padding: 40px 0 32px; }
  .card { padding: 20px 18px; border-radius: var(--r); }
  .connect__oauth { flex-direction: column; gap: 10px; }
  .logrow { flex-wrap: wrap; gap: 2px 10px; }
  .logrow__time { flex-basis: 100%; }
  .doc > summary { flex-wrap: wrap; gap: 8px; }
  /* A status pill and a step title fight for the same row on a phone, and the
     title loses — one word per line. The plan becomes two columns instead:
     number beside the step, status underneath it. */
  #plan .module { display: grid; grid-template-columns: 22px 1fr; gap: 6px 10px; align-items: start; }
  #plan .module .grow, #plan .module .module__pills { grid-column: 2; }
  #plan .module .module__id { flex: none; padding-top: 1px; }
  .module { flex-wrap: wrap; gap: 8px 12px; }
  .grid-2 { grid-template-columns: 1fr; }
  .scroller { max-height: 340px; }
}

