/* HighLevelSolutions.org — shared styles
   Palette: charcoal ink + warm cream paper + muted gold accent
   Type: Instrument Serif (display) + Inter (body) — editorial, senior, calm */

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

/* Visually hidden but available to assistive tech (form labels, etc.) */
.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0);
  white-space: nowrap; border: 0;
}
/* Skip-to-content link: hidden until keyboard-focused */
.sr-only-focusable {
  position: absolute; left: -9999px; top: auto;
  width: 1px; height: 1px; overflow: hidden;
}
.sr-only-focusable:focus {
  position: fixed; left: 12px; top: 12px;
  width: auto; height: auto; padding: 10px 14px;
  background: #363636; color: #f6f6f6;
  z-index: 9999; border-radius: 6px;
  font: 500 14px "Inter", system-ui, sans-serif;
}

:root {
  /* Brand palette — charcoal #363636, blue #16598f, paper #f6f6f6 */
  --ink: #363636;
  --ink-2: #2a2a2a;
  --ink-3: #555555;
  --muted: #777777;
  --muted-2: #9a9a9a;
  --rule: #d9d9d9;
  --rule-soft: #e8e8e8;
  --paper: #f6f6f6;
  --paper-2: #ececec;
  --paper-3: #e0e0e0;
  --card: #ffffff;
  --gold: #16598f;
  --gold-2: #114a78;
  --gold-soft: #5a91bd;
  --warn: #c0432a;

  /* Type */
  --serif: "Instrument Serif", "Iowan Old Style", "Hoefler Text", Georgia, serif;
  --sans: "Inter", ui-sans-serif, system-ui, -apple-system, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --measure: 64ch;
  --container: 1200px;
  --container-wide: 1320px;
  --container-narrow: 880px;
}

* { box-sizing: border-box; }

/* Responsiveness safety nets */
img, video, iframe { max-width: 100%; height: auto; }
html, body { overflow-x: clip; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body {
  background:
    radial-gradient(1200px 800px at 80% -200px, rgba(22, 89, 143, 0.06), transparent 60%),
    radial-gradient(900px 600px at -10% 30%, rgba(26, 26, 26, 0.025), transparent 60%),
    var(--paper);
  min-height: 100vh;
}

/* ── Type ───────────────────────────────────────────────── */
.serif { font-family: var(--serif); font-weight: 400; letter-spacing: -0.01em; }
.mono  { font-family: var(--mono); font-feature-settings: "tnum"; }

h1, h2, h3, h4 {
  font-family: var(--serif);
  font-weight: 400;
  margin: 0;
  letter-spacing: -0.015em;
  color: var(--ink);
}
h1 { font-size: clamp(40px, 5.5vw, 76px); line-height: 1.02; letter-spacing: -0.025em; }
h2 { font-size: clamp(30px, 3.6vw, 48px); line-height: 1.08; letter-spacing: -0.018em; }
h3 { font-size: clamp(20px, 1.8vw, 26px); line-height: 1.2; }
h4 { font-size: 17px; font-family: var(--sans); font-weight: 600; letter-spacing: -0.005em; }

p { margin: 0; }
a { color: inherit; text-decoration: none; }

.eyebrow {
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}
.eyebrow .dot {
  display: inline-block;
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--gold);
  margin-right: 10px;
  vertical-align: middle;
}

.lede {
  font-size: 19px;
  line-height: 1.55;
  color: var(--ink-3);
  max-width: 60ch;
}

.fine {
  font-size: 12.5px;
  color: var(--muted);
  letter-spacing: 0.005em;
}

/* ── Layout ─────────────────────────────────────────────── */
.container { max-width: var(--container); margin: 0 auto; padding: 0 32px; }
.container.wide { max-width: var(--container-wide); }
.container.narrow { max-width: var(--container-narrow); }
@media (max-width: 720px) { .container { padding: 0 20px; } }

.section { padding: 96px 0; }
.section-sm { padding: 64px 0; }
.section-lg { padding: 128px 0; }

.rule { height: 1px; background: var(--rule); border: 0; }
.rule-thick { height: 2px; background: var(--ink); border: 0; }

/* ── Nav ────────────────────────────────────────────────── */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in oklab, var(--paper) 88%, transparent);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 1px solid var(--rule);
}
.nav-inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 68px;
}
.nav-logo {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--serif);
  font-size: 20px;
  letter-spacing: -0.02em;
}
.nav-logo .mark {
  width: 26px; height: 26px;
  border: 1.5px solid var(--ink);
  border-radius: 50%;
  display: grid; place-items: center;
  font-family: var(--sans); font-size: 11px; font-weight: 600;
  letter-spacing: 0;
}
.nav-logo .mark::after {
  content: "";
  width: 10px; height: 10px;
  background: var(--gold);
  border-radius: 50%;
}
.nav-links {
  display: flex; gap: 24px; align-items: center;
  font-size: 13.5px;
  color: var(--ink-3);
}
@media (max-width: 1100px) {
  .nav-links { gap: 18px; font-size: 13px; }
}
@media (max-width: 980px) {
  .nav-links a:nth-child(n+5) { display: none; }
}
.nav-links a {
  position: relative;
  padding: 6px 0;
  transition: color 0.15s;
}
.nav-links a:hover { color: var(--ink); }
.nav-links a.active { color: var(--ink); }
.nav-links a.active::after {
  content: "";
  position: absolute; left: 0; right: 0; bottom: 0;
  height: 1px; background: var(--gold);
}
@media (max-width: 820px) {
  .nav-links { display: none; }
}

/* ── Buttons ────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 13px 22px;
  border-radius: 999px;
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: -0.005em;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.12s ease, background 0.15s, color 0.15s, border-color 0.15s;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}
.btn-primary:hover { background: #000; }
.btn-primary .arrow { transition: transform 0.2s; }
.btn-primary:hover .arrow { transform: translateX(3px); }
.btn-ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--ink-2);
}
.btn-ghost:hover { background: var(--ink); color: var(--paper); }
.btn-text {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 14px; font-weight: 500;
  color: var(--ink);
  border-bottom: 1px solid var(--ink);
  padding-bottom: 2px;
  transition: gap 0.2s, color 0.15s;
}
.btn-text:hover { gap: 12px; }
.btn-gold {
  background: var(--gold);
  color: #ffffff;
  border-color: var(--gold);
}
.btn-gold:hover { background: var(--gold-2); }

/* ── Cards & containers ─────────────────────────────────── */
.card {
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: 12px;
  padding: 28px;
}
.card-flat {
  background: transparent;
  border-top: 1px solid var(--ink);
  padding: 28px 0;
}

/* ── Footer ─────────────────────────────────────────────── */
.footer {
  background: var(--ink);
  color: var(--paper);
  padding: 80px 0 32px;
  margin-top: 0;
}
.footer .container { color: var(--paper); }
.footer h4 { color: var(--paper); font-family: var(--sans); font-size: 12px; text-transform: uppercase; letter-spacing: 0.12em; color: var(--muted-2); font-weight: 500; }
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 48px;
  align-items: start;
}
@media (max-width: 820px) {
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 36px; }
}
.footer ul { list-style: none; padding: 0; margin: 14px 0 0; display: flex; flex-direction: column; gap: 10px; }
.footer ul a { color: rgba(246, 246, 246, 0.78); font-size: 14px; transition: color 0.15s; }
.footer ul a:hover { color: var(--paper); }
.footer .lockup { display: none; }
.footer-bottom {
  margin-top: 64px;
  padding-top: 24px;
  border-top: 1px solid rgba(246, 246, 246, 0.12);
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 16px;
  font-size: 12.5px; color: rgba(246, 246, 246, 0.55);
}

/* ── Newsletter signup success state ───────────────────────
   Replaces the form after a successful webhook POST. Uses the
   View Transitions API for the swap, SVG stroke-dashoffset for
   the checkmark draw-in, and Web Animations for the spark burst. */
@property --signup-pulse {
  syntax: '<length>';
  inherits: false;
  initial-value: 0px;
}

.signup-success {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 14px;
  min-height: 44px;
}
.signup-card .signup-success { margin-top: 14px; }

.signup-check-wrap {
  position: relative;
  width: 44px; height: 44px;
  flex: 0 0 44px;
  display: grid; place-items: center;
}

.signup-check {
  width: 44px; height: 44px;
  overflow: visible;
  filter: drop-shadow(0 1px 14px rgba(22, 89, 143, 0.35));
}
.signup-check .ring {
  stroke: var(--gold);
  stroke-dasharray: 176;        /* 2π·28 ≈ 175.93 */
  stroke-dashoffset: 176;
  transform-origin: center;
  transform: rotate(-90deg);
  animation: signup-ring-draw 620ms cubic-bezier(.22, .61, .36, 1) 60ms forwards;
}
.signup-check .check {
  stroke: var(--gold);
  stroke-dasharray: 50;
  stroke-dashoffset: 50;
  animation: signup-check-draw 360ms cubic-bezier(.65, 0, .25, 1) 540ms forwards;
}

@keyframes signup-ring-draw { to { stroke-dashoffset: 0; } }
@keyframes signup-check-draw { to { stroke-dashoffset: 0; } }

/* Halo pulse using @property so it animates the box-shadow distance smoothly */
.signup-check-wrap::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  pointer-events: none;
  box-shadow: 0 0 0 var(--signup-pulse) rgba(22, 89, 143, 0.18);
  --signup-pulse: 0px;
  animation: signup-halo 900ms cubic-bezier(.22, .61, .36, 1) 540ms forwards;
}
@keyframes signup-halo {
  0%   { --signup-pulse: 0px;  opacity: 1; }
  100% { --signup-pulse: 22px; opacity: 0; }
}

/* Spark particles spawned by JS */
.sparks {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.spark {
  position: absolute;
  top: 50%; left: 50%;
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--gold);
  opacity: 0;
  transform: translate(-50%, -50%) scale(0);
  will-change: transform, opacity;
}
.spark:nth-child(odd) { background: var(--gold-soft); width: 4px; height: 4px; }
.spark:nth-child(3n)  { background: var(--ink-3); width: 3px; height: 3px; }

.signup-success-text {
  display: flex; flex-direction: column; gap: 2px;
  opacity: 0; transform: translateY(6px);
  animation: signup-text-in 460ms cubic-bezier(.22, .61, .36, 1) 720ms forwards;
}
.signup-success-text strong {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 19px;
  line-height: 1.1;
  color: var(--ink);
  letter-spacing: -0.01em;
}
.signup-success-text span {
  font-size: 13px;
  color: var(--muted);
}
@keyframes signup-text-in { to { opacity: 1; transform: translateY(0); } }

/* Adapt to dark contexts (footer is on var(--ink) background) */
.footer .signup-success-text strong { color: var(--paper); }
.footer .signup-success-text span   { color: rgba(246, 246, 246, 0.62); }
.footer .signup-check { filter: drop-shadow(0 1px 14px rgba(90, 145, 189, 0.45)); }
.footer .signup-check .ring,
.footer .signup-check .check { stroke: var(--gold-soft); }
.footer .spark { background: var(--gold-soft); }
.footer .signup-check-wrap::after { box-shadow: 0 0 0 var(--signup-pulse) rgba(90, 145, 189, 0.22); }

/* View Transitions: scope the cross-fade to the swapped element only */
::view-transition-old(*),
::view-transition-new(*) {
  animation-duration: 380ms;
  animation-timing-function: cubic-bezier(.22, .61, .36, 1);
}

@media (prefers-reduced-motion: reduce) {
  .signup-check .ring,
  .signup-check .check,
  .signup-check-wrap::after,
  .signup-success-text { animation: none; }
  .signup-check .ring,
  .signup-check .check { stroke-dashoffset: 0; }
  .signup-success-text { opacity: 1; transform: none; }
}
.footer-bottom .indep { color: rgba(246, 246, 246, 0.5); }
.footer .signup {
  display: flex; gap: 0;
  border: 1px solid rgba(246, 246, 246, 0.2);
  border-radius: 999px;
  padding: 4px;
  margin-top: 14px;
  max-width: 320px;
}
.footer .signup input {
  flex: 1;
  background: transparent;
  border: 0;
  color: var(--paper);
  font: inherit;
  font-size: 13.5px;
  padding: 8px 14px;
  outline: none;
}
.footer .signup input::placeholder { color: rgba(246, 246, 246, 0.45); }
.footer .signup button {
  background: var(--paper);
  color: var(--ink);
  border: 0;
  border-radius: 999px;
  padding: 8px 16px;
  font: inherit; font-size: 13px; font-weight: 500;
  cursor: pointer;
}

/* ── Common building blocks ─────────────────────────────── */
.section-title {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 32px; margin-bottom: 48px; flex-wrap: wrap;
}
.section-title .right { color: var(--muted); font-size: 13px; }

.kicker {
  font-family: var(--serif);
  font-style: italic;
  color: var(--gold-2);
  font-size: 1.1em;
}

.tag {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px;
  border: 1px solid var(--rule);
  background: var(--card);
  border-radius: 999px;
  font-size: 11.5px;
  letter-spacing: 0.04em;
  color: var(--ink-3);
  text-transform: uppercase;
  font-weight: 500;
}
.tag.gold { border-color: var(--gold-soft); color: var(--gold-2); background: rgba(22, 89, 143, 0.08); }

/* ── Operational proof — abstracted UI mockups ──────────── */
.proof-frame {
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: 14px;
  padding: 0;
  overflow: hidden;
  box-shadow: 0 1px 0 rgba(255,255,255,0.6) inset, 0 30px 60px -30px rgba(26,26,26,0.18);
}
.proof-frame .pf-bar {
  display: flex; align-items: center; gap: 8px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--rule);
  background: linear-gradient(180deg, rgba(22, 89, 143,0.04), transparent);
}
.proof-frame .pf-bar .dots { display: flex; gap: 6px; }
.proof-frame .pf-bar .dots span { width: 9px; height: 9px; border-radius: 50%; background: var(--rule); }
.proof-frame .pf-bar .pf-title {
  font-size: 12px; color: var(--muted); margin-left: auto;
  font-family: var(--mono);
  letter-spacing: -0.01em;
}

/* Slack-ish thread (abstracted) */
.thread {
  padding: 20px 22px 24px;
  font-size: 14px;
  display: flex; flex-direction: column; gap: 14px;
}
.thread .msg { display: grid; grid-template-columns: 32px 1fr; gap: 12px; align-items: start; }
.thread .av {
  width: 32px; height: 32px; border-radius: 6px;
  background: var(--paper-3);
  display: grid; place-items: center;
  font-size: 11px; font-weight: 600; color: var(--ink-2);
  letter-spacing: 0.02em;
}
.thread .av.gold { background: var(--gold); color: #ffffff; }
.thread .av.ink { background: var(--ink); color: var(--paper); }
.thread .name {
  font-weight: 600; font-size: 13.5px; color: var(--ink);
}
.thread .time { font-size: 11.5px; color: var(--muted); margin-left: 6px; font-weight: 400; }
.thread .body { color: var(--ink-2); margin-top: 2px; line-height: 1.5; }
.thread .body code {
  background: var(--paper-2);
  padding: 1px 6px;
  border-radius: 4px;
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--gold-2);
}
.thread .reaction {
  display: inline-flex; align-items: center; gap: 4px;
  margin-top: 6px; padding: 2px 8px;
  border: 1px solid var(--rule); border-radius: 999px;
  font-size: 11.5px; color: var(--muted);
  background: var(--paper);
}

/* Invoice (abstracted) */
.invoice { padding: 24px 26px; font-size: 13.5px; }
.invoice .inv-head {
  display: flex; justify-content: space-between; align-items: baseline;
  border-bottom: 1px solid var(--ink);
  padding-bottom: 14px; margin-bottom: 14px;
}
.invoice .inv-head .label { font-family: var(--sans); font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); margin-bottom: 4px; }
.invoice .inv-head .val { font-family: var(--serif); font-size: 22px; }
.invoice table { width: 100%; border-collapse: collapse; }
.invoice th {
  text-align: left; font-size: 10.5px; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--muted); font-weight: 500;
  padding: 8px 0; border-bottom: 1px solid var(--rule);
}
.invoice th.r, .invoice td.r { text-align: right; }
.invoice td {
  padding: 10px 0;
  border-bottom: 1px dashed var(--rule);
  vertical-align: top;
  font-size: 13px;
}
.invoice td.desc { color: var(--ink-2); }
.invoice td .meta { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; }
.invoice td.hrs { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.invoice .total {
  display: flex; justify-content: space-between;
  margin-top: 16px; padding-top: 14px;
  border-top: 2px solid var(--ink);
  font-family: var(--serif);
  font-size: 22px;
}

/* Tracker (abstracted kanban) */
.tracker { padding: 18px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
@media (max-width: 720px) {
  .tracker { grid-template-columns: 1fr; gap: 16px; }
}
.tracker .col { display: flex; flex-direction: column; gap: 8px; }
.tracker .col-h {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 10.5px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--muted); padding: 4px 4px 8px;
  border-bottom: 1px solid var(--rule);
}
.tracker .col-h .count {
  background: var(--paper-2); color: var(--ink-3);
  padding: 1px 6px; border-radius: 999px;
  font-size: 10px;
}
.tracker .ticket {
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 12.5px;
  color: var(--ink-2);
  line-height: 1.35;
}
.tracker .ticket .id { font-family: var(--mono); font-size: 10.5px; color: var(--muted); display: block; margin-bottom: 3px; letter-spacing: 0.04em; }
.tracker .ticket.gold { border-left: 3px solid var(--gold); }
.tracker .ticket.ink { border-left: 3px solid var(--ink); }

/* SOW snippet */
.sow { padding: 24px 26px; font-size: 13px; line-height: 1.6; color: var(--ink-2); }
.sow h5 { font-family: var(--serif); font-size: 18px; font-weight: 400; margin: 0 0 6px; color: var(--ink); }
.sow .sow-meta { display: flex; gap: 24px; font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); margin-bottom: 18px; padding-bottom: 14px; border-bottom: 1px solid var(--rule); }
.sow .wbs { display: flex; flex-direction: column; gap: 10px; }
.sow .wbs-row { display: grid; grid-template-columns: 24px 1fr 60px; gap: 10px; align-items: baseline; }
.sow .wbs-row .num { font-family: var(--mono); color: var(--muted); font-size: 11px; }
.sow .wbs-row .hrs { font-family: var(--mono); color: var(--ink); text-align: right; font-size: 12px; }
.sow .sow-foot { display: flex; justify-content: space-between; margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--ink); }
.sow .redact { background: var(--ink); color: var(--ink); border-radius: 2px; padding: 0 4px; user-select: none; }

/* ── Utility ───────────────────────────────────────────── */
.muted { color: var(--muted); }
.ink-3 { color: var(--ink-3); }
.flex { display: flex; }
.between { justify-content: space-between; }
.center { align-items: center; }
.gap-sm { gap: 12px; }
.gap-md { gap: 24px; }
.gap-lg { gap: 48px; }
.text-center { text-align: center; }
.mt-sm { margin-top: 12px; } .mt-md { margin-top: 24px; } .mt-lg { margin-top: 48px; }
.mb-sm { margin-bottom: 12px; } .mb-md { margin-bottom: 24px; } .mb-lg { margin-bottom: 48px; }
