/* Public pages: group landing, brand enquiry forms, confirmation and privacy pages.
   Direction: a professional firm's front desk. Warm paper neutrals, ink text, each brand colour
   used only for its primary action and selections. Signature: the hairline route with dot ends. */

@font-face { font-family: "Instrument Sans"; src: url("/static/fonts/instrument-sans.woff2") format("woff2"); font-weight: 400 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Newsreader"; src: url("/static/fonts/newsreader.woff2") format("woff2"); font-weight: 200 800; font-style: normal; font-display: swap; }
@font-face { font-family: "IBM Plex Mono"; src: url("/static/fonts/ibm-plex-mono-400.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "IBM Plex Mono"; src: url("/static/fonts/ibm-plex-mono-500.woff2") format("woff2"); font-weight: 500; font-style: normal; font-display: swap; }

:root {
  color-scheme: light;
  /* Warm paper ramp */
  --page: #f7f4ee;
  --card: #fdfbf7;
  --raised: #efe9df;
  --text: #1f1b16;
  --text-2: #5e554a;
  --muted: #776e62;
  --hairline: rgba(31, 27, 22, .09);
  --control: #958b7e;            /* input and choice borders, 3:1 on the card */
  --positive: #16794a;
  --negative: #c0362c;
  --negative-soft: #fbefec;
  --shadow: 0 1px 2px rgba(31, 27, 22, .05);
  /* Brand accent: overridden per brand; the group page uses ink */
  --accent: #1f1b16;
  --on-accent: #fdfbf7;
  --accent-tint: rgba(31, 27, 22, .05);

  --sans: "Instrument Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --serif: "Newsreader", Georgia, "Times New Roman", serif;
  --mono: "IBM Plex Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}
.brand-kcs { --accent: #1f4e79; --on-accent: #ffffff; --accent-tint: rgba(31, 78, 121, .07); }
.brand-kcpee { --accent: #6b2c5a; --on-accent: #ffffff; --accent-tint: rgba(107, 44, 90, .07); }
.brand-startlex { --accent: #1d5c4a; --on-accent: #ffffff; --accent-tint: rgba(29, 92, 74, .07); }

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --page: #161513;
    --card: #1c1a18;
    --raised: #262421;
    --text: #efe9de;
    --text-2: #aaa398;
    --muted: #8f897f;
    --hairline: rgba(239, 233, 222, .08);
    --control: #6f685e;
    --positive: #4cc38a;
    --negative: #e5675f;
    --negative-soft: #2c1a17;
    --shadow: none;
    --accent: #efe9de;
    --on-accent: #161513;
    --accent-tint: rgba(239, 233, 222, .06);
  }
  .brand-kcs { --accent: #8fb8e0; --on-accent: #12110f; --accent-tint: rgba(143, 184, 224, .1); }
  .brand-kcpee { --accent: #d9a6cb; --on-accent: #12110f; --accent-tint: rgba(217, 166, 203, .1); }
  .brand-startlex { --accent: #86c9b0; --on-accent: #12110f; --accent-tint: rgba(134, 201, 176, .1); }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 24px; }
body { margin: 0; background: var(--page); color: var(--text); font: 400 16px/1.5 var(--sans); -webkit-font-smoothing: antialiased; }
body.embed { background: transparent; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { font-weight: 500; line-height: 1.2; }
a { color: inherit; text-underline-offset: 3px; text-decoration-thickness: 1px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.icon { flex: none; }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.meta { font-size: 13px; color: var(--muted); }
[hidden] { display: none !important; }

.skip-link { position: absolute; left: -9999px; top: 12px; z-index: 10; background: var(--card); color: var(--text); padding: 8px 12px; border-radius: 8px; border: 1px solid var(--hairline); }
.skip-link:focus { left: 12px; }

/* ---------- chrome ---------- */
.shell { min-height: 100vh; display: flex; flex-direction: column; }
.site-header { width: 100%; max-width: 1200px; margin: 0 auto; padding: 24px 32px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.wordmark { font-size: 18px; font-weight: 600; letter-spacing: 0; text-decoration: none; }
.brandline { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand-name { font-size: 16px; font-weight: 500; line-height: 1.25; }
.monogram {
  width: 32px; height: 32px; border-radius: 8px; flex: none; display: grid; place-items: center;
  background: var(--accent); color: var(--on-accent); font-size: 12px; font-weight: 600; letter-spacing: .02em;
}
.monogram-sm { width: 24px; height: 24px; border-radius: 6px; font-size: 10px; }
.header-link { font-size: 14px; color: var(--text-2); text-decoration: none; padding: 8px 12px; border-radius: 8px; transition: color 150ms var(--ease), background-color 150ms var(--ease); }
.header-link:hover { color: var(--text); background: var(--raised); }
.site-footer { margin-top: auto; width: 100%; max-width: 1200px; margin-inline: auto; padding: 32px; display: flex; gap: 24px; color: var(--muted); font-size: 13px; border-top: 1px solid var(--hairline); }
.site-footer a { color: var(--text-2); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 12px 20px; border-radius: 8px; border: 1px solid transparent;
  font: 500 15px/1.2 var(--sans); text-decoration: none; cursor: pointer;
  transition: background-color 150ms var(--ease), border-color 150ms var(--ease), color 150ms var(--ease), transform 120ms var(--ease);
}
.btn:active { transform: scale(.98); }
.btn-primary { background: var(--accent); color: var(--on-accent); }
.btn-primary:hover { background: color-mix(in srgb, var(--accent) 88%, var(--text)); }
.btn-secondary { background: var(--card); color: var(--text); border-color: var(--hairline); box-shadow: var(--shadow); }
.btn-secondary:hover { background: var(--raised); }

/* ---------- the route (signature) ---------- */
.route { list-style: none; margin: 0; padding: 0; display: grid; gap: 20px; position: relative; }
.route li { position: relative; display: grid; grid-template-columns: 12px minmax(0, 1fr); gap: 16px; align-content: start; }
.route li:not(:last-child)::before {
  content: ""; position: absolute; left: 5px; top: 16px; bottom: -20px; width: 1px; background: var(--control); opacity: .6;
}
.route-dot { flex: none; width: 12px; height: 12px; border-radius: 50%; border: 1px solid var(--control); background: var(--page); margin-top: 4px; position: relative; z-index: 1; }
.route-dot.is-end { background: var(--accent); border-color: var(--accent); }
.route-title { font-size: 15px; font-weight: 500; }
.route-text { font-size: 14px; color: var(--text-2); margin-top: 4px; }

/* ---------- home ---------- */
.home { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 32px; display: grid; gap: 96px; }
.hero {
  display: grid; grid-template-columns: minmax(0, 6fr) minmax(0, 5fr); gap: 64px; align-items: center;
  min-height: min(640px, calc(100vh - 200px)); padding: 32px 0 0;
}
.hero-copy { display: grid; gap: 24px; animation: rise 400ms var(--ease) both; }
.hero h1 { font-family: var(--serif); font-weight: 400; font-size: clamp(40px, 5.4vw, 64px); line-height: 1.05; letter-spacing: -.02em; max-width: 12em; }
.lead { font-size: 18px; line-height: 1.6; color: var(--text-2); max-width: 36rem; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; padding-top: 8px; }

/* docket illustration (the moment on the main page) */
.docket { margin: 0; display: grid; gap: 0; animation: rise 400ms var(--ease) 60ms both; }
.docket-paper {
  background: var(--card); border: 1px solid var(--hairline); border-radius: 16px; padding: 24px;
  box-shadow: 0 1px 2px rgba(31, 27, 22, .05), 0 12px 32px rgba(31, 27, 22, .07);
}
.docket-head { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; color: var(--muted); padding-bottom: 16px; border-bottom: 1px dashed var(--control); }
.docket-fields { margin: 0; padding-top: 16px; display: grid; gap: 12px; }
.docket-fields div { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 12px; }
.docket-fields dt { font-size: 13px; color: var(--muted); padding-top: 2px; }
.docket-fields dd { margin: 0; font-size: 15px; }
.docket-targets { list-style: none; margin: 0; padding: 24px 0 0 20px; display: grid; gap: 12px; position: relative; }
.docket-targets::before { content: ""; position: absolute; left: 25px; top: 0; bottom: 26px; width: 1px; background: var(--control); opacity: .6; }
.docket-target { display: flex; align-items: center; gap: 12px; font-size: 14px; color: var(--muted); position: relative; }
.docket-target .route-dot { margin-top: 0; }
.docket-target .monogram { opacity: .45; }
.docket-target.is-hit { color: var(--text); font-weight: 500; }
.docket-target.is-hit .monogram { opacity: 1; }
.docket-target-name { min-width: 0; }
.docket-tag { margin-left: auto; font-family: var(--mono); font-size: 12px; color: var(--text-2); white-space: nowrap; }
.dark-only { display: none; }

/* practices */
.practices { display: grid; gap: 24px; scroll-margin-top: 24px; }
.practices h2, .how h2 { font-family: var(--serif); font-weight: 400; font-size: 32px; letter-spacing: -.01em; }
.practice-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--hairline); }
.practice { border-bottom: 1px solid var(--hairline); }
.practice-link {
  display: grid; grid-template-columns: 32px minmax(0, 1fr) minmax(0, 260px) auto; gap: 20px; align-items: center;
  padding: 24px 12px; margin: 0 -12px; text-decoration: none; border-radius: 12px;
  transition: background-color 150ms var(--ease);
}
.practice-link:hover { background: var(--accent-tint); }
.practice-main { display: grid; gap: 4px; }
.practice-name { font-size: 18px; font-weight: 500; }
.practice-desc { font-size: 15px; color: var(--text-2); }
.practice-focus { font-size: 14px; color: var(--muted); }
.practice-go { display: inline-flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 500; color: var(--accent); white-space: nowrap; }
.unsure { font-size: 15px; color: var(--text-2); max-width: 44rem; }
.unsure strong { color: var(--text); font-weight: 500; }

.how { display: grid; gap: 24px; padding-bottom: 32px; }
.route-row { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 32px; }
.route-row li { grid-template-columns: minmax(0, 1fr); gap: 12px; }
.route-row li:not(:last-child)::before { left: 16px; right: -28px; top: 9px; bottom: auto; width: auto; height: 1px; }
.route-row .route-dot { margin-top: 4px; }

/* ---------- form layout ---------- */
.layout {
  width: 100%; max-width: 1200px; margin: 0 auto; padding: 8px 32px 64px;
  display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 64px; align-items: start;
}
.layout-single { grid-template-columns: minmax(0, 640px); justify-content: center; padding-top: 32px; }
.layout-embed { grid-template-columns: minmax(0, 1fr); max-width: 720px; padding: 0; }
.intro-panel { position: sticky; top: 32px; display: grid; gap: 24px; padding-top: 16px; }
.intro-focus { font-size: 14px; color: var(--muted); }
.intro-lead { font-family: var(--serif); font-size: 28px; line-height: 1.25; margin-top: -16px; }
.intro-note { font-size: 14px; color: var(--text-2); padding-top: 24px; border-top: 1px solid var(--hairline); }
.panel-title { font-size: 15px; font-weight: 500; }
.privacy-note, .notice { display: flex; gap: 8px; align-items: flex-start; font-size: 14px; color: var(--text-2); }
.privacy-note .icon, .notice .icon { color: var(--muted); margin-top: 2px; }
.notice a { color: var(--text); }

.card { background: var(--card); border: 1px solid var(--hairline); border-radius: 16px; box-shadow: var(--shadow); padding: 32px; }
.form-card { padding: 0; overflow: clip; }
.form-head { padding: 32px 32px 8px; display: grid; gap: 8px; }
.form-head h1 { font-family: var(--serif); font-weight: 400; font-size: 36px; line-height: 1.15; letter-spacing: -.01em; }
.intro { color: var(--text-2); font-size: 15px; }

.group { padding: 24px 32px 8px; display: grid; gap: 24px; }
.group + .group { border-top: 1px solid var(--hairline); margin-top: 16px; padding-top: 32px; }
.group-title { font-size: 15px; font-weight: 500; color: var(--text-2); }

.field { margin: 0; padding: 0; border: 0; min-width: 0; display: grid; gap: 8px; }
.field > label, .field > legend { display: flex; align-items: baseline; gap: 12px; font-size: 15px; font-weight: 500; padding: 0; line-height: 1.4; }
.field > legend { float: left; width: 100%; margin-bottom: 4px; }
.field > legend + * { clear: both; }
.num { font-family: var(--mono); font-size: 13px; font-weight: 400; color: var(--muted); width: 12px; flex: none; text-align: right; }
.label-text { min-width: 0; }
.req { color: var(--negative); margin-left: 2px; }
.opt { margin-left: auto; font-size: 13px; font-weight: 400; color: var(--muted); white-space: nowrap; }

input[type="text"], input[type="tel"], input[type="email"], textarea {
  width: 100%; font: 400 16px/1.4 var(--sans); color: var(--text); background: var(--card);
  border: 1px solid var(--control); border-radius: 8px; padding: 12px 16px; min-height: 48px;
  transition: border-color 150ms var(--ease), box-shadow 150ms var(--ease);
}
textarea { resize: vertical; min-height: 112px; line-height: 1.5; }
input::placeholder, textarea::placeholder { color: var(--muted); }
input:hover, textarea:hover { border-color: var(--text-2); }
input:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-tint), 0 0 0 1px var(--accent); }
[aria-invalid="true"] { border-color: var(--negative) !important; }

.hint { color: var(--muted); font-size: 13px; line-height: 1.5; }
.hint-row { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; }
.counter { font-family: var(--mono); font-size: 12px; color: var(--muted); white-space: nowrap; }
.counter.near { color: var(--negative); }
.preselect-note { color: var(--text-2); background: var(--raised); border-radius: 8px; padding: 8px 12px; }
.error { color: var(--negative); font-size: 14px; }
.error:empty { display: none; }

/* answer choices */
.choices { display: grid; gap: 8px; }
.choice {
  position: relative; display: flex; align-items: center; gap: 12px; cursor: pointer;
  border: 1px solid var(--control); border-radius: 8px; padding: 12px 16px; min-height: 48px; background: var(--card);
  transition: border-color 150ms var(--ease), background-color 150ms var(--ease);
}
.choice:hover { background: var(--raised); }
.choice input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.choice-dot { width: 16px; height: 16px; border-radius: 50%; border: 1px solid var(--control); flex: none; display: grid; place-items: center; background: var(--card); }
.choice-dot::after { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); transform: scale(0); transition: transform 150ms var(--ease); }
.choice-label { font-size: 15px; line-height: 1.4; }
.choice:has(input:checked) { border-color: var(--accent); background: var(--accent-tint); box-shadow: inset 0 0 0 1px var(--accent); }
.choice:has(input:checked) .choice-dot { border-color: var(--accent); }
.choice:has(input:checked) .choice-dot::after { transform: scale(1); }
.choice:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.field[data-invalid] .choice { border-color: var(--negative); }
.choices-compact { grid-template-columns: repeat(2, minmax(0, 1fr)); }

/* consent */
.group.consent-group { border-top: 1px solid var(--hairline); margin-top: 16px; padding-top: 24px; padding-bottom: 8px; gap: 16px; }
.checkbox { position: relative; display: flex; gap: 12px; align-items: flex-start; cursor: pointer; padding: 12px 16px; border: 1px solid var(--hairline); border-radius: 8px; background: var(--page); transition: background-color 150ms var(--ease), border-color 150ms var(--ease); }
.checkbox:hover { background: var(--raised); }
.checkbox input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.checkbox .box { width: 20px; height: 20px; border-radius: 4px; border: 1px solid var(--control); flex: none; display: grid; place-items: center; color: transparent; margin-top: 2px; background: var(--card); }
.checkbox-text { font-size: 15px; display: grid; gap: 4px; }
.checkbox-sub { font-size: 13px; color: var(--muted); }
.checkbox:has(input:checked) { border-color: var(--accent); background: var(--accent-tint); }
.checkbox:has(input:checked) .box { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.checkbox:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }

/* submit bar */
.submit-row {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  padding: 20px 32px 24px; margin-top: 16px; border-top: 1px solid var(--hairline); background: var(--page);
}
.progress { display: grid; gap: 8px; min-width: 160px; flex: 1; max-width: 280px; }
.progress-track { height: 4px; background: var(--raised); border-radius: 4px; overflow: hidden; }
.progress-bar { display: block; height: 100%; width: 100%; background: var(--text-2); border-radius: 4px; transform: scaleX(0); transform-origin: left; transition: transform 300ms var(--ease); }
.progress-text { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.progress.complete .progress-bar { background: var(--positive); }
.progress.complete .progress-text { color: var(--positive); }
.btn-submit { min-width: 200px; }
.spinner { display: none; width: 16px; height: 16px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin 700ms linear infinite; }
.btn-submit.is-loading .spinner { display: inline-block; }
.btn-submit:disabled { opacity: .7; cursor: progress; }

/* messages */
.error-summary { margin: 16px 32px 0; border: 1px solid var(--negative); border-radius: 8px; background: var(--negative-soft); padding: 16px 20px; display: grid; gap: 8px; }
.card > .error-summary { margin: 0 0 24px; }
.error-summary h1, .error-summary h2 { font-size: 16px; font-weight: 500; color: var(--negative); }
.error-summary ul { margin: 0; padding-left: 20px; display: grid; gap: 4px; }
.error-summary a { color: var(--negative); font-size: 15px; }
.error-summary:focus { outline: 2px solid var(--negative); outline-offset: 2px; }
.alert { margin: 16px 32px 0; border: 1px solid var(--negative); color: var(--negative); background: var(--negative-soft); border-radius: 8px; padding: 12px 16px; font-size: 15px; }

/* confirmation */
.thanks { display: grid; justify-items: start; gap: 16px; padding: 40px 32px; }
.thanks:focus { outline: none; }
.thanks h1 { font-family: var(--serif); font-weight: 400; font-size: 40px; line-height: 1.1; }
.thanks-text { color: var(--text-2); max-width: 32rem; font-size: 16px; }
.slip { width: 100%; max-width: 32rem; margin: 8px 0; padding: 16px 20px; border: 1px dashed var(--control); border-radius: 12px; display: grid; gap: 12px; background: var(--page); }
.reference { font-size: 14px; color: var(--muted); }
.reference strong { font-family: var(--mono); font-weight: 500; font-size: 16px; color: var(--text); letter-spacing: .04em; margin-left: 4px; }
.slip-route { display: flex; align-items: center; gap: 0; font-size: 14px; color: var(--text-2); }
.slip-route .route-dot { margin-top: 0; }
.slip-line { width: 40px; height: 1px; background: var(--control); flex: none; }
.slip-to { margin-left: 12px; }

/* privacy */
.prose { display: grid; gap: 16px; }
.prose h1 { font-family: var(--serif); font-weight: 400; font-size: 36px; line-height: 1.15; }
.prose ul { margin: 0; padding-left: 20px; display: grid; gap: 8px; color: var(--text-2); }
.callout { background: var(--raised); border-radius: 8px; padding: 12px 16px; }

/* Honeypot: hidden from people and assistive tech, visible to naive bots */
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

@keyframes rise { from { opacity: 0; transform: translateY(8px); } }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- responsive ---------- */
@media (max-width: 960px) {
  .hero { grid-template-columns: minmax(0, 1fr); min-height: 0; gap: 48px; padding-top: 16px; }
  .home { gap: 64px; }
  .layout { grid-template-columns: minmax(0, 1fr); gap: 40px; }
  .intro-panel { position: static; order: 2; padding-top: 0; }
  .practice-link { grid-template-columns: 32px minmax(0, 1fr) auto; }
  .practice-focus { display: none; }
  .route-row { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .route-row li { grid-template-columns: 12px minmax(0, 1fr); gap: 16px; }
  .route-row li:not(:last-child)::before { left: 5px; right: auto; top: 16px; bottom: -20px; width: 1px; height: auto; }
}
@media (max-width: 600px) {
  .site-header { padding: 16px; }
  .brand-name { font-size: 15px; }
  .home { padding: 0 16px; }
  .hero h1 { font-size: 40px; }
  .lead { font-size: 16px; }
  .actions .btn { flex: 1 1 100%; }
  .docket-paper { padding: 20px; }
  .docket-fields div { grid-template-columns: 88px minmax(0, 1fr); }
  .docket-fields div:last-child { display: none; }
  .practice-link { gap: 16px; padding: 20px 8px; margin: 0 -8px; }
  .practice-go { font-size: 0; gap: 0; }
  .layout { padding: 0 16px 48px; }
  .layout-embed { padding: 0; }
  .site-footer { padding: 24px 16px; }
  .card { padding: 24px 20px; }
  .form-card { padding: 0; }
  .form-head { padding: 24px 20px 4px; }
  .form-head h1 { font-size: 32px; }
  .group { padding: 20px 20px 4px; }
  .error-summary, .alert { margin: 16px 20px 0; }
  .choices-compact { grid-template-columns: minmax(0, 1fr); }
  .intro-lead { font-size: 24px; }
  /* Keep the submit button reachable on phones */
  .submit-row { position: sticky; bottom: 0; z-index: 2; padding: 12px 20px calc(12px + env(safe-area-inset-bottom)); }
  .progress { min-width: 0; max-width: none; flex-basis: 100%; }
  .btn-submit { width: 100%; }
  .thanks { padding: 32px 20px; }
  .thanks h1 { font-size: 36px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
@media (forced-colors: active) {
  .choice:has(input:checked), .checkbox:has(input:checked) { outline: 2px solid CanvasText; }
  .choice-dot::after, .route-dot.is-end { background: CanvasText; }
}
