/* =========================================================
   THOMPSON TECHNOLOGIES: DESIGN SYSTEM (v5)
   Look:    dark mode grays and blacks, purple outlines and
            background glow, gold accents
   Spacing: 8-point scale only
   Radius:  one value for every component (--radius)
   Fonts:   Space Grotesk (headings), Inter (body), JetBrains Mono (labels)
   ========================================================= */

:root {
  /* Neutrals */
  --bg:          #0A0A0C;
  --bg-alt:      #0F0F12;
  --surface:     #141417;
  --surface-2:   #1C1C21;
  --surface-3:   #24242A;
  --line:        #26262C;                    /* neutral dividers */
  --text:        #EDEDF0;
  --text-muted:  #A3A3AD;
  --text-faint:  #6E6E78;

  /* Purple: outlines and glow only */
  --border:       rgba(139, 101, 222, 0.28);
  --border-hover: rgba(160, 124, 240, 0.55);
  --purple-glow:  0 0 48px -12px rgba(124, 77, 214, 0.35);

  /* Gold: accents */
  --gold:        #C9A24F;
  --gold-hover:  #DBB866;
  --gold-deep:   #957224;
  --gold-light:  #E9CD88;
  --gold-soft:   rgba(201, 162, 79, 0.10);
  --gold-line:   rgba(201, 162, 79, 0.40);
  --gold-grad:   linear-gradient(135deg, var(--gold-light) 0%, var(--gold) 50%, var(--gold-deep) 100%);
  --on-gold:     #17120A;

  --avoid:       #D9827A;
  --avoid-soft:  rgba(217, 130, 122, 0.12);
  --ok:          #74CF9C;
  --wait:        #A99AF2;

  /* Spacing (8-point) */
  --s-1: 8px;   --s-2: 16px;  --s-3: 24px;  --s-4: 32px;
  --s-5: 40px;  --s-6: 48px;  --s-8: 64px;  --s-10: 80px; --s-12: 96px; --s-16: 128px;

  /* Type */
  --fs-xs:  0.8125rem;
  --fs-sm:  0.9375rem;
  --fs-md:  1.0625rem;
  --fs-lg:  1.25rem;
  --fs-xl:  2.25rem;
  --fs-2xl: 3.75rem;

  --mono: "JetBrains Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;
  --radius: 8px;
  --shadow: 0 16px 40px rgba(0, 0, 0, 0.5);
  --ease:   cubic-bezier(0.2, 0.7, 0.2, 1);
  --dur:    200ms;
  --container: 1200px;
  --header-h: 72px;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: var(--header-h); }
img, svg, canvas { display: block; max-width: 100%; }
ul, ol { list-style: none; }
button, input, textarea, select, output { font: inherit; color: inherit; }

body {
  background:
    radial-gradient(1000px 640px at 10% -8%, rgba(110, 64, 200, 0.16), transparent 60%),
    radial-gradient(900px 700px at 100% 40%, rgba(110, 64, 200, 0.08), transparent 60%),
    var(--bg);
  background-attachment: fixed;
  color: var(--text);
  font-family: "Inter", system-ui, sans-serif;
  font-size: var(--fs-md);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Type ---------- */
h1, h2, h3, h4 { font-family: "Space Grotesk", "Inter", system-ui, sans-serif; font-weight: 600; letter-spacing: -0.025em; color: var(--text); }
h1 { font-size: var(--fs-2xl); line-height: 1.05; }
h2 { font-size: var(--fs-xl); line-height: 1.15; }
h3 { font-size: var(--fs-lg); line-height: 1.3; font-weight: 500; }
p { color: var(--text-muted); }
a { color: var(--gold); text-decoration: none; }

.gold-text { color: var(--gold); }

.eyebrow {
  display: inline-flex; align-items: center; gap: var(--s-1);
  font-size: var(--fs-xs); font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--gold); margin-bottom: var(--s-2);
}
.eyebrow::before { content: ""; width: 24px; height: 1px; background: var(--gold); }
.lead { font-size: var(--fs-lg); line-height: 1.6; }

:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; border-radius: var(--radius); }
.skip-link { position: absolute; left: var(--s-2); top: -100px; background: var(--gold); color: var(--on-gold); padding: var(--s-1) var(--s-2); border-radius: var(--radius); z-index: 100; }
.skip-link:focus { top: var(--s-2); }

/* ---------- Layout ---------- */
.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 var(--s-3); }
.section { padding: var(--s-12) 0; position: relative; }
.section-alt { background: rgba(255, 255, 255, 0.015); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.section-head { max-width: 720px; margin-bottom: var(--s-6); }
.section-head h2 + p { margin-top: var(--s-2); }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-8); align-items: center; }
.split > div > h2 { margin-bottom: var(--s-2); }
.grid { display: grid; gap: var(--s-3); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s-1);
  min-height: 48px; padding: 0 var(--s-3); border-radius: var(--radius); border: 1px solid transparent;
  font-size: var(--fs-sm); font-weight: 600; line-height: 1.2; cursor: pointer;
  transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease), color var(--dur) var(--ease), box-shadow var(--dur) var(--ease), filter var(--dur) var(--ease);
}
.btn-primary { background: var(--gold-grad); color: var(--on-gold); box-shadow: 0 8px 24px -10px rgba(201, 162, 79, 0.6); }
.btn-primary:hover { filter: brightness(1.06); box-shadow: 0 12px 32px -10px rgba(201, 162, 79, 0.8); }
.btn-secondary { background: transparent; color: var(--text); border-color: var(--border-hover); }
.btn-secondary:hover { border-color: var(--gold); color: var(--gold); }
.btn-sm { min-height: 40px; padding: 0 var(--s-2); }
.btn-block { width: 100%; }
.text-link { display: inline-flex; align-items: center; gap: var(--s-1); font-size: var(--fs-sm); font-weight: 600; color: var(--gold); }
.text-link::after { content: "\2192"; transition: transform var(--dur) var(--ease); }
.text-link:hover::after { transform: translateX(4px); }
.link-btn { background: none; border: none; cursor: pointer; font-size: var(--fs-xs); font-weight: 600; color: var(--gold); padding: var(--s-1); border-radius: var(--radius); }
.link-btn:hover { text-decoration: underline; }

.spinner { display: none; width: 16px; height: 16px; border: 2px solid rgba(23, 18, 10, 0.3); border-top-color: var(--on-gold); border-radius: 50%; animation: spin 700ms linear infinite; }
.btn.is-loading { pointer-events: none; opacity: 0.85; }
.btn.is-loading .spinner { display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Header ---------- */
.site-header { position: sticky; top: 0; z-index: 50; height: var(--header-h); background: rgba(10, 10, 12, 0.82); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border-bottom: 1px solid var(--line); }
.header-inner { height: 100%; display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); }
.brand { display: flex; align-items: center; gap: var(--s-2); }
.brand-mark { width: 44px; height: 44px; flex: none; }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-name { font-family: "Space Grotesk", "Inter", sans-serif; letter-spacing: -0.01em; font-size: var(--fs-lg); font-weight: 600; color: var(--text); }
.brand-sub { font-size: 0.6875rem; font-weight: 600; letter-spacing: 0.32em; text-transform: uppercase; color: var(--gold); }

.site-nav { display: flex; align-items: center; gap: var(--s-3); }
.nav-link {
  position: relative; display: inline-flex; align-items: center; gap: 6px; background: none; border: none; cursor: pointer;
  color: var(--text-muted); font-size: var(--fs-sm); font-weight: 500; padding: var(--s-1) 0; transition: color var(--dur) var(--ease);
}
.nav-link:hover, .nav-link[aria-expanded="true"], .nav-link[aria-current="page"] { color: var(--text); }
.nav-link .caret { width: 10px; height: 10px; fill: none; stroke: currentColor; stroke-width: 2; transition: transform var(--dur) var(--ease); }
.nav-link[aria-expanded="true"] .caret { transform: rotate(180deg); }

.dropdown { position: relative; }
.dropdown-menu {
  position: absolute; top: calc(100% + 12px); left: 50%; transform: translateX(-50%); min-width: 280px;
  display: grid; gap: 4px; padding: var(--s-1); background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow), var(--purple-glow);
}
.dropdown-menu[hidden] { display: none; }
.dropdown-menu a { display: grid; gap: 2px; padding: var(--s-1) var(--s-2); border-radius: var(--radius); color: var(--text); font-size: var(--fs-sm); font-weight: 500; }
.dropdown-menu a:hover { background: var(--surface-2); }
.dropdown-menu a span { font-size: var(--fs-xs); color: var(--text-faint); font-weight: 400; }
.dropdown-menu .soon { color: var(--text-muted); }

.nav-toggle { display: none; width: 40px; height: 40px; background: none; border: 1px solid var(--border); border-radius: var(--radius); cursor: pointer; flex-direction: column; align-items: center; justify-content: center; gap: 6px; }
.nav-toggle span { width: 16px; height: 2px; background: var(--text); transition: transform var(--dur) var(--ease); }
.nav-toggle[aria-expanded="true"] span:first-child { transform: translateY(4px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:last-child { transform: translateY(-4px) rotate(-45deg); }

/* ---------- Panels, tabs, badges ---------- */
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow), var(--purple-glow); overflow: hidden; }
.panel-bar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: var(--s-1); min-height: 56px; padding: var(--s-1) var(--s-2); border-bottom: 1px solid var(--line); }
.panel-title { font-size: var(--fs-sm); font-weight: 600; color: var(--text); }
.panel-meta { font-size: var(--fs-xs); color: var(--text-faint); }
.panel-foot { padding: var(--s-2); border-top: 1px solid var(--line); }
.tabs { display: flex; gap: 4px; padding: 4px; background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius); }
.tab { background: none; border: none; cursor: pointer; padding: var(--s-1) var(--s-2); border-radius: var(--radius); font-size: var(--fs-xs); font-weight: 600; color: var(--text-muted); transition: background var(--dur) var(--ease), color var(--dur) var(--ease); }
.tab:hover { color: var(--text); }
.tab.is-active { background: var(--surface-3); color: var(--gold); }
.badge { display: inline-flex; align-items: center; font-size: var(--fs-xs); font-weight: 600; padding: 4px var(--s-1); border-radius: var(--radius); color: var(--gold); border: 1px solid var(--gold-line); white-space: nowrap; }
.badge-muted { color: var(--text-muted); border-color: var(--line); }

/* ---------- Hero ---------- */
.hero { padding: var(--s-8) 0 var(--s-6); text-align: center; }
.hero-copy { max-width: 1000px; margin: 0 auto; }
.hero-copy .eyebrow::after { content: ""; width: 24px; height: 1px; background: var(--gold); }
.hero h1 { margin-bottom: var(--s-3); }
.hero .lead { max-width: 600px; margin: 0 auto var(--s-5); }
.hero-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--s-2); }

/* Tree: what you have branches into one tailored system, which branches into results.
   Full-bleed: it stretches across the whole screen, not just the content column. */
.flow {
  position: relative; width: 100vw; margin: var(--s-6) 0 0 calc(50% - 50vw);
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: var(--s-8);
  padding: var(--s-3) clamp(16px, 4vw, 72px);
}
.flow::before { /* faint purple light behind the trunk, no box */
  content: ""; position: absolute; left: 50%; top: 50%; width: min(1100px, 90vw); height: 420px; transform: translate(-50%, -50%);
  background: radial-gradient(closest-side, rgba(124, 77, 214, 0.16), transparent); pointer-events: none;
}
.flow-canvas { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 1; }
.flow-col { position: relative; z-index: 2; display: grid; gap: var(--s-4); }
@media (min-width: 1280px) { .flow-col { gap: var(--s-5); } }
.flow-inputs { justify-items: start; }
.flow-outputs { justify-items: end; }
/* stagger the leaves so they hang like a tree, not a list */
.flow-inputs .node:nth-of-type(1)  { margin-left: 9%; }
.flow-inputs .node:nth-of-type(3)  { margin-left: 14%; }
.flow-inputs .node:nth-of-type(4)  { margin-left: 4%; }
.flow-outputs .node:nth-of-type(1) { margin-right: 5%; }
.flow-outputs .node:nth-of-type(2) { margin-right: 13%; }
.flow-outputs .node:nth-of-type(4) { margin-right: 9%; }
.flow-label { font-size: 0.6875rem; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--text-faint); transition: opacity 500ms var(--ease); }
.flow-outputs .flow-label { text-align: right; }

.node { display: inline-flex; align-items: center; transition: opacity 500ms var(--ease), transform 500ms var(--ease); }
.flow-outputs .node { flex-direction: row-reverse; }
.leaf-body {
  display: inline-flex; align-items: center; gap: 10px; white-space: nowrap;
  padding: 12px 20px; font-size: var(--fs-sm); font-weight: 500; color: var(--text-muted);
  background: rgba(20, 20, 23, 0.88); border: 1px solid var(--gold-line);
  border-radius: 26px 4px 26px 4px;   /* leaf: two rounded corners, two pointed */
  transition: color 400ms var(--ease), border-color 400ms var(--ease), box-shadow 400ms var(--ease);
}
.flow-outputs .leaf-body { border-radius: 4px 26px 4px 26px; color: var(--text); }
.leaf-body svg { width: 18px; height: 18px; flex: none; fill: none; stroke: var(--gold); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.stem { width: 16px; height: 1px; flex: none; background: var(--gold-line); }
.node.is-lit .leaf-body { color: var(--text); border-color: var(--gold); box-shadow: 0 0 24px -4px rgba(201, 162, 79, 0.5); }

.hub {
  position: relative; width: 184px; height: 184px; border-radius: 50%;
  display: grid; place-items: center;
  background: radial-gradient(circle at 50% 38%, #202026, var(--bg) 72%);
  border: 1px solid var(--gold-line);
  box-shadow: 0 0 0 10px rgba(201, 162, 79, 0.04), 0 0 80px -8px rgba(201, 162, 79, 0.3);
  transition: opacity 600ms var(--ease), transform 600ms var(--ease);
}
.hub svg { width: 112px; height: 112px; }
.hub-label {
  position: absolute; top: calc(100% + 16px); left: 50%; transform: translateX(-50%); white-space: nowrap;
  font-family: var(--mono); font-size: var(--fs-xs); font-weight: 600; color: var(--gold);
}
.flow.is-grown .hub { animation: hub-breathe 4s var(--ease) infinite; }
@keyframes hub-breathe {
  0%, 100% { box-shadow: 0 0 0 10px rgba(201, 162, 79, 0.04), 0 0 80px -8px rgba(201, 162, 79, 0.25); }
  50%      { box-shadow: 0 0 0 16px rgba(201, 162, 79, 0.07), 0 0 100px -4px rgba(201, 162, 79, 0.45); }
}
/* growth states, set by script */
.flow.is-seed .hub { opacity: 0; transform: scale(0.6); }
.flow.is-seed .node, .flow.is-seed .flow-label { opacity: 0; transform: scale(0.9); }
.node.is-born, .flow-label.is-born { opacity: 1 !important; transform: none !important; }

/* ---------- Mission ---------- */
.mission { padding: var(--s-8) 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.mission-grid { display: grid; grid-template-columns: 200px 1fr; gap: var(--s-4); align-items: baseline; }
.mission-grid .eyebrow { margin-bottom: 0; }
.mission-text { font-family: "Space Grotesk", "Inter", sans-serif; font-weight: 500; letter-spacing: -0.02em; font-size: 1.75rem; line-height: 1.35; color: var(--text); max-width: 860px; }
.mission-text em { color: var(--gold); }

/* ---------- Cards ---------- */
.card {
  position: relative; display: flex; flex-direction: column; gap: var(--s-1);
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: var(--s-4);
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.card:hover { border-color: var(--border-hover); box-shadow: var(--purple-glow); }
.card p { font-size: var(--fs-sm); }
.card .text-link { margin-top: auto; padding-top: var(--s-2); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s-2); }
a.card { color: inherit; }
a.card:hover { transform: translateY(-2px); }
.icon-box { width: 48px; height: 48px; display: grid; place-items: center; margin-bottom: var(--s-2); border-radius: var(--radius); background: var(--surface-2); border: 1px solid var(--line); color: var(--gold); }
.icon-box svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.good-for { font-size: var(--fs-xs) !important; color: var(--text-faint) !important; }

/* ---------- Points (short feature row) ---------- */
.points { display: grid; gap: var(--s-3); }
.points li { padding-left: var(--s-3); border-left: 1px solid var(--gold-line); }
.points h3 { font-size: var(--fs-md); font-family: "Inter", system-ui, sans-serif; font-weight: 600; letter-spacing: 0; margin-bottom: 4px; }
.points p { font-size: var(--fs-sm); }

/* Callout strip */
.callout {
  display: grid; grid-template-columns: 1fr auto; gap: var(--s-3); align-items: center; margin-top: var(--s-4);
  padding: var(--s-3) var(--s-4); border: 1px solid var(--gold-line); border-radius: var(--radius); background: var(--gold-soft);
}
.callout h3 { font-size: var(--fs-lg); margin-bottom: 4px; }
.callout p { font-size: var(--fs-sm); }

/* ---------- Applications ---------- */
.app-feature { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-6); align-items: center; padding: var(--s-5); margin-bottom: var(--s-3); }
.app-feature h3 { font-size: 2rem; font-weight: 600; margin: var(--s-2) 0 var(--s-1); }
.app-feature .btn { margin-top: var(--s-3); }
.mini-sched { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s-1); }
.mini-shift { background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius); padding: var(--s-1); display: grid; gap: 6px; }
.mini-shift b { font-size: var(--fs-xs); font-weight: 600; color: var(--text); }
.mini-shift span { font-size: var(--fs-xs); background: var(--surface-2); border-radius: 6px; padding: 4px var(--s-1); color: var(--text-muted); }
.mini-shift span.m { color: var(--gold); }

/* ---------- Chat ---------- */
.chat-log { height: 320px; overflow-y: auto; padding: var(--s-2); display: flex; flex-direction: column; gap: var(--s-2); scroll-behavior: smooth; }
.msg { max-width: 88%; padding: var(--s-1) var(--s-2); border-radius: var(--radius); font-size: var(--fs-sm); line-height: 1.5; animation: rise 320ms var(--ease) both; }
.msg-user { align-self: flex-end; background: var(--gold-soft); border: 1px solid var(--gold-line); color: var(--text); }
.msg-bot { align-self: flex-start; background: var(--surface-2); color: var(--text); }
.msg-src { display: flex; align-items: center; gap: var(--s-1); margin-top: var(--s-1); font-size: var(--fs-xs); color: var(--text-faint); }
.msg-src svg { width: 14px; height: 14px; flex: none; fill: none; stroke: var(--gold); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.msg-src.is-handoff { color: var(--gold-light); }
.typing { display: inline-flex; gap: 4px; padding: 4px 0; }
.typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--text-muted); animation: typing 1s ease-in-out infinite; }
.typing i:nth-child(2) { animation-delay: 150ms; }
.typing i:nth-child(3) { animation-delay: 300ms; }
@keyframes typing { 0%, 60%, 100% { opacity: 0.25; transform: none; } 30% { opacity: 1; transform: translateY(-3px); } }
@keyframes rise { from { opacity: 0; transform: translateY(4px); } }
.chat-suggest { padding: var(--s-2); border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: var(--s-1); }
.suggest { background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius); min-height: 40px; padding: var(--s-1) var(--s-2); font-size: var(--fs-xs); font-weight: 500; color: var(--text); cursor: pointer; text-align: left; transition: border-color var(--dur) var(--ease), opacity var(--dur) var(--ease); }
.suggest:hover:not(:disabled) { border-color: var(--gold); }
.suggest:disabled { opacity: 0.35; cursor: default; }

/* ---------- Steps (compact) ---------- */
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--s-3); margin-top: var(--s-6); }
.step { padding-top: var(--s-2); border-top: 1px solid var(--line); }
.step-num { display: block; font-family: var(--mono); font-size: var(--fs-sm); color: var(--gold); margin-bottom: 4px; }
.step h3 { font-size: var(--fs-md); margin-bottom: 4px; }
.step p { font-size: var(--fs-sm); }

/* ---------- Contact form ---------- */
.contact-grid { display: grid; grid-template-columns: 1fr 1.1fr; gap: var(--s-8); align-items: start; }
.contact-grid h2 { margin-bottom: var(--s-2); }
.form { display: grid; gap: var(--s-3); padding: var(--s-4); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-2); }
.field { display: grid; gap: var(--s-1); }
.field label { font-size: var(--fs-sm); font-weight: 500; color: var(--text); }
.field input, .field textarea, .field select {
  width: 100%; background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius);
  padding: var(--s-1) var(--s-2); min-height: 48px; transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.field select { appearance: none; -webkit-appearance: none; cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, var(--gold) 50%), linear-gradient(135deg, var(--gold) 50%, transparent 50%);
  background-position: calc(100% - 20px) 50%, calc(100% - 14px) 50%; background-size: 6px 6px; background-repeat: no-repeat; padding-right: var(--s-5); }
.field select option { background: var(--surface); color: var(--text); }
.field textarea { resize: vertical; padding-top: var(--s-2); }
.field input::placeholder, .field textarea::placeholder { color: var(--text-faint); }
.field input:hover, .field textarea:hover, .field select:hover { border-color: var(--border-hover); }
.field input:focus, .field textarea:focus, .field select:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 4px var(--gold-soft); }
[aria-invalid="true"] { border-color: var(--avoid) !important; }
.segmented { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius); }
.segmented label { display: block; cursor: pointer; }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented span { display: flex; align-items: center; justify-content: center; min-height: 40px; border-radius: var(--radius); font-size: var(--fs-sm); font-weight: 600; color: var(--text-muted); transition: background var(--dur) var(--ease), color var(--dur) var(--ease); }
.segmented input:checked + span { background: var(--surface-3); color: var(--gold); }
.segmented input:focus-visible + span { outline: 2px solid var(--gold); outline-offset: 2px; }
.form-status { font-size: var(--fs-sm); min-height: 1.6em; }
.form-status.is-error { color: var(--avoid); }
.form-status.is-success { color: var(--ok); }

/* ---------- Footer ---------- */
.site-footer { padding: var(--s-4) 0; border-top: 1px solid var(--line); }
.footer-inner { display: flex; align-items: center; justify-content: space-between; gap: var(--s-2); flex-wrap: wrap; }
.footer-inner p { font-size: var(--fs-sm); }
.footer-nav { display: flex; gap: var(--s-3); flex-wrap: wrap; }
.footer-nav a { color: var(--text-muted); font-size: var(--fs-sm); }
.footer-nav a:hover { color: var(--gold); }

/* =========================================================
   APPLICATION PAGES
   ========================================================= */
.page-hero { padding: var(--s-10) 0 var(--s-6); }
.crumbs { display: flex; gap: var(--s-1); font-size: var(--fs-xs); color: var(--text-faint); margin-bottom: var(--s-3); }
.crumbs a { color: var(--text-muted); }
.crumbs a:hover { color: var(--gold); }
.page-hero .title-row { display: flex; align-items: center; gap: var(--s-2); flex-wrap: wrap; margin-bottom: var(--s-2); }
.page-hero p.lead { max-width: 680px; }
.note {
  display: flex; gap: var(--s-2); align-items: flex-start; margin-bottom: var(--s-3);
  padding: var(--s-2) var(--s-3); border: 1px solid var(--border); border-left: 2px solid var(--gold);
  border-radius: var(--radius); background: var(--surface); font-size: var(--fs-sm); color: var(--text-muted);
}
.note strong { color: var(--text); font-weight: 600; }
.cta-band { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); flex-wrap: wrap; padding: var(--s-4); }
.cta-band h2 { font-size: 1.75rem; }

/* ---------- Scheduler demo ---------- */
.stab[hidden] { display: none; }
.sched-layout { display: grid; grid-template-columns: 280px 1fr; }
.priorities { display: grid; gap: var(--s-3); align-content: start; padding: var(--s-3); border-right: 1px solid var(--line); }
.mini-title { font-size: var(--fs-xs); font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--text-faint); }
.weight { display: grid; gap: 4px; }
.weight-head { display: flex; justify-content: space-between; font-size: var(--fs-sm); font-weight: 500; color: var(--text); }
.weight-head output { color: var(--gold); font-weight: 600; font-variant-numeric: tabular-nums; }
.weight-hint { font-size: var(--fs-xs); color: var(--text-faint); }
input[type="range"] { -webkit-appearance: none; appearance: none; width: 100%; height: 24px; background: transparent; cursor: pointer; }
input[type="range"]::-webkit-slider-runnable-track { height: 4px; border-radius: var(--radius); background: linear-gradient(90deg, var(--gold) var(--fill, 50%), var(--surface-3) var(--fill, 50%)); }
input[type="range"]::-moz-range-track { height: 4px; border-radius: var(--radius); background: var(--surface-3); }
input[type="range"]::-moz-range-progress { height: 4px; border-radius: var(--radius); background: var(--gold); }
input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 16px; height: 16px; margin-top: -6px; border-radius: 50%; background: var(--gold-light); border: 2px solid var(--bg); box-shadow: 0 0 0 1px var(--gold); }
input[type="range"]::-moz-range-thumb { width: 14px; height: 14px; border-radius: 50%; background: var(--gold-light); border: 2px solid var(--bg); box-shadow: 0 0 0 1px var(--gold); }

.sched-main { padding: var(--s-3); }
.sched-hint { font-size: var(--fs-xs); color: var(--text-faint); margin-bottom: var(--s-2); }
.sched-error { margin-bottom: var(--s-2); padding: var(--s-1) var(--s-2); border: 1px solid var(--avoid); border-radius: var(--radius); background: var(--avoid-soft); color: var(--avoid); font-size: var(--fs-sm); }
.schedule { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s-1); transition: opacity var(--dur) var(--ease); }
.schedule.is-stale { opacity: 0.4; }
.shift { position: relative; overflow: hidden; background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius); padding: var(--s-1); display: grid; gap: var(--s-1); align-content: start; }
.shift.needs-mgr { border-color: var(--gold-line); }
.shift-head { display: flex; justify-content: space-between; align-items: center; gap: var(--s-1); min-height: 28px; }
.shift-name { font-size: var(--fs-xs); font-weight: 600; color: var(--text); }
.mgr-toggle {
  display: inline-flex; align-items: center; gap: 6px; min-height: 28px; padding: 0 var(--s-1);
  background: none; border: 1px solid var(--line); border-radius: var(--radius); cursor: pointer;
  font-size: 0.6875rem; font-weight: 600; letter-spacing: 0.04em; color: var(--text-faint);
  transition: border-color var(--dur) var(--ease), color var(--dur) var(--ease), background var(--dur) var(--ease);
}
.mgr-toggle::before { content: ""; width: 8px; height: 8px; border-radius: 50%; border: 1px solid currentColor; }
.mgr-toggle:hover { color: var(--text); border-color: var(--border-hover); }
.mgr-toggle[aria-pressed="true"] { color: var(--gold); border-color: var(--gold-line); background: var(--gold-soft); }
.mgr-toggle[aria-pressed="true"]::before { background: var(--gold); border-color: var(--gold); }

.chip {
  display: flex; align-items: center; gap: var(--s-1); width: 100%; min-height: 36px;
  background: var(--surface-2); border: 1px solid transparent; border-radius: var(--radius);
  padding: 4px var(--s-1); font-size: var(--fs-xs); font-weight: 500; color: var(--text); text-align: left;
  animation: rise 320ms var(--ease) both;
}
button.chip { cursor: pointer; transition: border-color var(--dur) var(--ease); }
button.chip:hover { border-color: var(--avoid); }
.chip-open { border: 1px dashed var(--line); background: transparent; color: var(--text-faint); }
button.chip-open { color: var(--gold); border-color: var(--gold-line); }
button.chip-open:hover { border-color: var(--gold); }
.tag-mgr { margin-left: auto; font-size: 0.625rem; font-weight: 700; letter-spacing: 0.08em; color: var(--gold); border: 1px solid var(--gold-line); border-radius: 4px; padding: 1px 4px; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; flex: none; }
.dot-pref { background: var(--gold); }
.dot-neutral { background: var(--text-faint); }
.dot-avoid { background: var(--avoid); }
.schedule.is-loading .chip { opacity: 0.25; }
.schedule.is-loading .shift::after { content: ""; position: absolute; inset: 0; background: linear-gradient(100deg, transparent 30%, rgba(201, 162, 79, 0.08) 50%, transparent 70%); animation: shimmer 600ms linear infinite; }
@keyframes shimmer { from { transform: translateX(-100%); } to { transform: translateX(100%); } }
.schedule-summary { margin-top: var(--s-2); font-size: var(--fs-xs); color: var(--text-muted); }
.schedule-summary strong { color: var(--gold); font-weight: 600; }

.rescue { margin-top: var(--s-2); border: 1px solid var(--gold-line); border-radius: var(--radius); background: var(--bg); }
.rescue[hidden] { display: none; }
.rescue-head { display: flex; justify-content: space-between; align-items: flex-start; gap: var(--s-2); padding: var(--s-2); border-bottom: 1px solid var(--line); }
.rescue-head h4 { font-size: var(--fs-md); }
.rescue-head p { font-size: var(--fs-xs); margin-top: 4px; }
.rescue-btns { display: flex; gap: var(--s-1); flex-wrap: wrap; }
.rescue-item { display: flex; align-items: center; justify-content: space-between; gap: var(--s-2); padding: var(--s-1) var(--s-2); border-bottom: 1px solid var(--line); }
.rescue-item:last-child { border-bottom: none; }
.rescue-name { font-size: var(--fs-sm); font-weight: 600; color: var(--text); }
.rescue-best { margin-left: var(--s-1); font-size: 0.6875rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--gold); }
.reasons { display: flex; flex-wrap: wrap; gap: 4px var(--s-2); margin-top: 4px; }
.reason { font-size: var(--fs-xs); color: var(--text-muted); }
.reason::before { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%; margin-right: 6px; background: var(--text-faint); vertical-align: 1px; }
.reason.good::before { background: var(--gold); }
.reason.warn::before { background: var(--avoid); }
.rescue-blocked { padding: var(--s-1) var(--s-2); border-top: 1px solid var(--line); font-size: var(--fs-xs); color: var(--text-faint); }
.mini-btn { min-height: 32px; padding: 0 var(--s-2); background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius); font-size: var(--fs-xs); font-weight: 600; color: var(--text); cursor: pointer; transition: border-color var(--dur) var(--ease), color var(--dur) var(--ease); white-space: nowrap; }
.mini-btn:hover { border-color: var(--gold); color: var(--gold); }
.mini-btn-gold { background: var(--gold-grad); color: var(--on-gold); border-color: transparent; }
.mini-btn-gold:hover { color: var(--on-gold); filter: brightness(1.06); }

/* People grid */
.people-wrap { padding: var(--s-3); }
.people-help { font-size: var(--fs-sm); margin-bottom: var(--s-2); }
.people-scroll { overflow-x: auto; }
.people { display: grid; grid-template-columns: 140px repeat(6, minmax(52px, 1fr)); gap: 4px; min-width: 520px; }
.people-colhead { text-align: center; font-size: var(--fs-xs); line-height: 1.3; color: var(--text-muted); padding-bottom: 4px; }
.people-colhead b { display: block; color: var(--text); font-weight: 600; }
.people-name { display: flex; align-items: center; justify-content: space-between; gap: var(--s-1); font-size: var(--fs-sm); font-weight: 500; color: var(--text); padding-right: var(--s-1); }
.mgr-tag-btn { font-size: 0.625rem; font-weight: 700; letter-spacing: 0.08em; padding: 4px 6px; border-radius: 4px; border: 1px dashed var(--line); background: none; color: var(--text-faint); cursor: pointer; }
.mgr-tag-btn:hover { color: var(--text); border-color: var(--border-hover); }
.mgr-tag-btn[aria-pressed="true"] { border-style: solid; border-color: var(--gold-line); color: var(--gold); background: var(--gold-soft); }
.cell { height: 40px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--bg); font-size: var(--fs-sm); font-weight: 700; cursor: pointer; color: var(--text-faint); transition: border-color var(--dur) var(--ease), background var(--dur) var(--ease); }
.cell:hover { border-color: var(--border-hover); }
.cell-pp { background: rgba(201, 162, 79, 0.20); border-color: var(--gold); color: var(--gold-light); }
.cell-p  { background: var(--gold-soft); border-color: var(--gold-line); color: var(--gold); }
.cell-a  { background: var(--avoid-soft); border-color: rgba(217, 130, 122, 0.35); color: var(--avoid); }
.cell-aa { background: rgba(217, 130, 122, 0.22); border-color: var(--avoid); color: var(--avoid); }
.cell-x  { background: repeating-linear-gradient(135deg, var(--surface-2) 0 4px, var(--bg) 4px 8px); color: var(--text-muted); }
.key { display: flex; flex-wrap: wrap; gap: var(--s-1) var(--s-3); margin-top: var(--s-2); font-size: var(--fs-xs); color: var(--text-muted); }
.key b { color: var(--text); margin-right: 4px; }

/* Pairings */
.pairs-layout { display: grid; grid-template-columns: 1.2fr 1fr; gap: var(--s-4); padding: var(--s-3); }
.rules-list { display: grid; gap: var(--s-1); margin-top: var(--s-2); }
.rules-list li { display: flex; align-items: center; justify-content: space-between; gap: var(--s-2); padding: var(--s-1) var(--s-2); background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius); font-size: var(--fs-sm); color: var(--text); }
.rule-who { font-weight: 600; }
.rule-end { display: flex; align-items: center; gap: var(--s-1); }
.rule-tag { font-size: var(--fs-xs); font-weight: 600; padding: 4px var(--s-1); border-radius: var(--radius); white-space: nowrap; }
.rule-like  { color: var(--gold); background: var(--gold-soft); }
.rule-avoid { color: var(--avoid); background: var(--avoid-soft); }
.rule-never { color: var(--text); background: var(--surface-3); }
.rule-x { width: 32px; height: 32px; background: none; border: none; border-radius: var(--radius); font-size: var(--fs-lg); line-height: 1; color: var(--text-faint); cursor: pointer; }
.rule-x:hover { color: var(--avoid); }
.rules-empty { font-size: var(--fs-sm); color: var(--text-faint) !important; }
.pair-form { display: grid; gap: var(--s-2); align-content: start; }
.pair-form .mini-title { margin-bottom: 0; }

.legend { display: flex; flex-wrap: wrap; gap: var(--s-2); font-size: var(--fs-xs); color: var(--text-muted); }
.legend span { display: inline-flex; align-items: center; gap: var(--s-1); }

/* ---------- Before / after showcase ---------- */
.showcase-body { position: relative; height: 304px; }
.view { position: absolute; inset: 0; padding: var(--s-2); opacity: 0; transform: translateY(8px); transition: opacity 400ms var(--ease), transform 400ms var(--ease); pointer-events: none; }
.view.is-visible { opacity: 1; transform: none; pointer-events: auto; }
.sheet { width: 100%; border-collapse: collapse; font-family: ui-monospace, Consolas, monospace; font-size: var(--fs-xs); color: var(--text-muted); }
.sheet th, .sheet td { border: 1px solid var(--line); padding: var(--s-1); text-align: left; white-space: nowrap; }
.sheet th, .sheet td:first-child { background: var(--bg); color: var(--text-faint); font-weight: 500; text-align: center; }
.sheet tbody tr:first-child td:not(:first-child) { color: var(--text); font-weight: 600; }
.app-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s-1); margin-bottom: var(--s-2); }
.stat { background: var(--surface-2); border-radius: var(--radius); padding: var(--s-1) var(--s-2); }
.stat-num { display: block; font-family: var(--mono); font-size: var(--fs-lg); color: var(--gold-light); }
.stat-label { font-size: var(--fs-xs); color: var(--text-muted); }
.records { display: grid; gap: var(--s-1); }
.record { display: flex; align-items: center; justify-content: space-between; gap: var(--s-2); background: var(--surface-2); border-radius: var(--radius); padding: var(--s-1) var(--s-2); }
.record-title { color: var(--text); font-size: var(--fs-sm); font-weight: 600; }
.record-sub { font-size: var(--fs-xs); }
.pill { font-size: var(--fs-xs); font-weight: 600; padding: 4px var(--s-1); border-radius: var(--radius); white-space: nowrap; }
.pill-open { color: var(--gold); background: var(--gold-soft); }
.pill-wait { color: var(--wait); background: rgba(169, 154, 242, 0.12); }
.pill-done { color: var(--ok); background: rgba(116, 207, 156, 0.12); }
.caption { font-size: var(--fs-xs); }

/* ---------- Reveal ---------- */
.reveal { opacity: 0; transform: translateY(16px); transition: opacity 600ms var(--ease), transform 600ms var(--ease); }
.reveal.is-in { opacity: 1; transform: none; }

/* =========================================================
   RESPONSIVE
   ========================================================= */
@media (max-width: 1080px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .flow { gap: var(--s-4); }
  .hub { width: 144px; height: 144px; }
  .hub svg { width: 88px; height: 88px; }
  .flow-col .node { margin-left: 0 !important; margin-right: 0 !important; }
  .flow-inputs .node:nth-of-type(odd), .flow-outputs .node:nth-of-type(even) { margin-left: 0; }
  .sched-layout { grid-template-columns: 1fr; }
  .priorities { grid-template-columns: repeat(2, 1fr); border-right: none; border-bottom: 1px solid var(--line); }
  .priorities .mini-title { grid-column: 1 / -1; }
}

@media (max-width: 960px) {
  .nav-toggle { display: flex; }
  .site-nav {
    display: none; position: absolute; top: var(--header-h); left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0; padding: var(--s-2) var(--s-3) var(--s-3);
    background: var(--bg); border-bottom: 1px solid var(--line);
    max-height: calc(100vh - var(--header-h)); overflow-y: auto;
  }
  .site-nav.is-open { display: flex; }
  .nav-link { width: 100%; padding: var(--s-2) 0; border-bottom: 1px solid var(--line); justify-content: space-between; font-size: var(--fs-md); }
  .dropdown-menu { position: static; transform: none; min-width: 0; box-shadow: none; border: none; background: none; padding: 0 0 var(--s-1) var(--s-2); }
  .site-nav .btn { margin-top: var(--s-2); }
  .split, .app-feature, .contact-grid, .grid-3 { grid-template-columns: 1fr; }
  .split { gap: var(--s-5); }
  .app-feature { padding: var(--s-4); }
}

@media (max-width: 720px) {
  :root { --fs-2xl: 2.5rem; --fs-xl: 1.75rem; --fs-lg: 1.125rem; }
  .container { padding: 0 var(--s-2); }
  .section { padding: var(--s-8) 0; }
  .hero { padding: var(--s-8) 0 var(--s-6); }
  .hero-actions .btn { width: 100%; }
  .mission-grid { grid-template-columns: 1fr; gap: var(--s-1); }
  .mission-text { font-size: 1.375rem; }

  .flow { gap: var(--s-1); margin-top: var(--s-6); padding: var(--s-2) var(--s-1) var(--s-5); }
  .flow-col { gap: var(--s-2); }
  .flow-inputs { justify-items: end; }
  .flow-outputs { justify-items: start; }
  .flow-outputs .flow-label { text-align: left; }
  .flow-label { font-size: 0.625rem; letter-spacing: 0.06em; }
  .leaf-body { white-space: normal; font-size: 0.6875rem; line-height: 1.25; gap: 6px; padding: 6px 10px; max-width: 118px; border-radius: 14px 3px 14px 3px; }
  .flow-outputs .leaf-body { border-radius: 3px 14px 3px 14px; }
  .leaf-body svg { width: 13px; height: 13px; }
  .stem { width: 6px; }
  .hub { width: 72px; height: 72px; box-shadow: 0 0 0 4px rgba(201, 162, 79, 0.04), 0 0 40px -8px rgba(201, 162, 79, 0.3); }
  .hub svg { width: 46px; height: 46px; }
  .hub-label { font-size: 0.6875rem; }

  .grid-2, .grid-4, .steps, .field-row, .pairs-layout { grid-template-columns: 1fr; }
  .callout { grid-template-columns: 1fr; padding: var(--s-3); }
  .card, .form { padding: var(--s-3); }
  .priorities { grid-template-columns: 1fr; padding: var(--s-2); }
  .sched-main, .people-wrap, .pairs-layout { padding: var(--s-2); }
  .schedule { grid-template-columns: 1fr 1fr; }
  .rescue-head, .rescue-item { flex-direction: column; align-items: stretch; }
  .sheet th:nth-child(5), .sheet td:nth-child(5) { display: none; }
  .mini-sched { grid-template-columns: 1fr 1fr; }
  .mini-sched .mini-shift:nth-child(3) { display: none; }
  .page-hero { padding: var(--s-8) 0 var(--s-4); }
  .cta-band { padding: var(--s-3); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .reveal { opacity: 1; transform: none; }
}

/* growth: hub appears first */
.flow.is-seed.is-growing .hub { opacity: 1; transform: none; }

/* Code-style labels */
.eyebrow, .flow-label, .mini-title, .badge, .tag-mgr, .mgr-tag-btn, .mgr-toggle, .rescue-best, .crumbs, .step-num, .good-for, .panel-meta, .brand-sub, .weight-head output, .shift-name, .people-colhead, .sheet { font-family: var(--mono); }
.eyebrow { letter-spacing: 0.08em; }
.good-for::before { content: "// "; color: var(--gold); opacity: 0.7; }
.step-num::before { content: "["; } .step-num::after { content: "]"; }

/* Outreachdev wordmark */
.brand { gap: 12px; }
.brand-name { font-size: 1.3125rem; font-weight: 700; }
.brand-dev { color: var(--gold); }
.brand-sub { font-size: 0.625rem; letter-spacing: 0.08em; text-transform: none; color: var(--text-faint); font-weight: 500; }
.footer-by { color: var(--text-faint); }

/* Limited satisfaction policy */
.policy { display: grid; grid-template-columns: 280px 1fr; gap: var(--s-4); margin-top: var(--s-8); padding-top: var(--s-4); border-top: 1px solid var(--line); }
.policy h3 { font-size: var(--fs-lg); }
.policy-list { display: grid; gap: var(--s-1); }
.policy-list li { position: relative; padding-left: var(--s-3); font-size: var(--fs-sm); color: var(--text-muted); }
.policy-list li::before { content: ""; position: absolute; left: 4px; top: 0.6em; width: 6px; height: 6px; border-radius: 50%; background: var(--gold); }
.policy-note { margin-top: var(--s-2); font-size: var(--fs-xs); color: var(--text-faint); }
@media (max-width: 720px) { .policy { grid-template-columns: 1fr; gap: var(--s-2); margin-top: var(--s-6); } }

/* Contact extras */
.contact-direct { margin-top: var(--s-3); font-size: var(--fs-sm); }
.contact-direct a, .footer-email { color: var(--gold); word-break: break-all; }
.contact-direct a:hover, .footer-email:hover { text-decoration: underline; }
.form-status a { color: inherit; text-decoration: underline; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
