/* Keel Stone Systems — site styles
   Tokens: vellum ground, navy ink, teal for links, amber reserved for the keystone. */

:root {
  --vellum: #edf0ec;
  --paper: #f8f9f6;
  --ink: #13283a;
  --ink-2: #3d5163;
  --ink-3: #66788a;
  --rule: #c7cec9;
  --teal: #1f5f5b;
  --teal-dark: #164744;
  --amber: #d99a1e;
  --amber-soft: #f3dfb2;

  --display: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --body: "Source Serif 4", Georgia, "Times New Roman", serif;

  /* Modular scale, ratio 1.25 from 18px body */
  --s-1: 0.889rem;
  --s0: 1.125rem;
  --s1: 1.406rem;
  --s2: 1.758rem;
  --s3: 2.197rem;
  --s4: 2.747rem;
  --s5: clamp(2.4rem, 5.2vw, 3.9rem);

  --gutter: clamp(1rem, 4vw, 3rem);
  --max: 76rem;
  --measure: 36em;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--vellum);
  color: var(--ink);
  font-family: var(--body);
  font-size: var(--s0);
  line-height: 1.6;
  font-optical-sizing: auto;
}

img, svg { max-width: 100%; display: block; }

a { color: var(--teal); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { color: var(--teal-dark); text-decoration-thickness: 2px; }

:focus-visible {
  outline: 3px solid var(--amber);
  outline-offset: 3px;
  border-radius: 2px;
}

.skip {
  position: absolute; left: -999px; top: 0;
  background: var(--ink); color: var(--paper); padding: 0.6rem 1rem; z-index: 10;
}
.skip:focus { left: 1rem; top: 1rem; }

.wrap {
  width: 100%;
  max-width: var(--max);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* ---------- Headings ---------- */

h1, h2, h3 {
  font-family: var(--display);
  font-stretch: 112%;
  color: var(--ink);
  line-height: 1.12;
  margin: 0 0 0.6em;
  letter-spacing: -0.01em;
}
h1 { font-size: var(--s5); font-weight: 700; font-stretch: 118%; letter-spacing: -0.02em; }
h2 { font-size: var(--s3); font-weight: 650; }
h3 { font-size: var(--s1); font-weight: 600; font-stretch: 105%; }

p { margin: 0 0 1em; max-width: var(--measure); }

.lede { font-size: var(--s1); line-height: 1.5; color: var(--ink-2); max-width: 32em; }

/* ---------- Header ---------- */

.site-header {
  border-bottom: 1px solid var(--rule);
  background: var(--vellum);
}
.site-header .wrap {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; min-height: 4.5rem; flex-wrap: wrap;
}

.brand {
  display: flex; align-items: center; gap: 0.65rem;
  color: var(--ink); text-decoration: none;
  font-family: var(--display); font-stretch: 120%; font-weight: 700;
  font-size: 1.05rem; letter-spacing: 0.01em;
}
.brand:hover { color: var(--ink); }
.brand svg { width: 28px; height: 28px; }

.nav ul { list-style: none; display: flex; gap: clamp(0.9rem, 2.5vw, 2rem); margin: 0; padding: 0; flex-wrap: wrap; }
.nav a {
  font-family: var(--display); font-size: 0.95rem; font-weight: 500;
  color: var(--ink-2); text-decoration: none; padding: 0.3rem 0;
  border-bottom: 2px solid transparent;
}
.nav a:hover { color: var(--ink); border-bottom-color: var(--rule); }
.nav a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--amber); }

/* ---------- Buttons ---------- */

.actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 2rem; }

.btn {
  display: inline-block;
  font-family: var(--display); font-weight: 600; font-size: 1rem; font-stretch: 105%;
  padding: 0.85rem 1.4rem;
  text-decoration: none;
  border: 2px solid var(--ink);
  border-radius: 0;
  cursor: pointer;
}
.btn-primary { background: var(--ink); color: var(--paper); }
.btn-primary:hover { background: var(--teal-dark); border-color: var(--teal-dark); color: var(--paper); }
.btn-plain { background: transparent; color: var(--ink); }
.btn-plain:hover { background: var(--paper); color: var(--ink); }

/* ---------- Hero ---------- */

.hero { padding-block: clamp(3rem, 7vw, 6rem) clamp(3rem, 6vw, 5rem); }
.hero .wrap {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
  gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
}
.hero h1 { max-width: 15em; font-size: clamp(2.1rem, 3.9vw, 3.2rem); }

.hero-figure { margin: 0; }
.bus { width: 100%; height: auto; overflow: visible; }
.bus .wire { stroke: var(--ink); stroke-width: 3; }
.bus .stubs line { stroke: var(--ink); stroke-width: 2; }
.bus .wire-label { font-family: var(--display); font-size: 13px; fill: var(--ink-3); }
.bus .term { fill: var(--amber); stroke: var(--ink); stroke-width: 2; }
.bus .node rect { fill: var(--paper); stroke: var(--ink); stroke-width: 2; }
.bus .node-key rect { fill: var(--amber-soft); }
.bus .node text { font-family: var(--display); font-size: 17px; font-weight: 650; fill: var(--ink); }
.bus .node .sub { font-family: var(--body); font-size: 13.5px; font-weight: 400; font-style: italic; fill: var(--ink-2); }
.bus .frame { fill: var(--amber); stroke: var(--ink); stroke-width: 1.5; opacity: 0; }

/* The one orchestrated moment: the bus draws in, nodes connect, one frame crosses it. */
@media (prefers-reduced-motion: no-preference) {
  .bus .wire { stroke-dasharray: 560; stroke-dashoffset: 560; animation: draw 1s ease-out 0.2s forwards; }
  .bus .node, .bus .stubs, .bus .term, .bus .wire-label { opacity: 0; animation: appear 0.5s ease-out 1s forwards; }
  .bus .frame { animation: travel 1.8s cubic-bezier(.45,0,.55,1) 1.6s forwards; }
}
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes appear { to { opacity: 1; } }
@keyframes travel {
  0% { opacity: 0; transform: translateX(0); }
  10% { opacity: 1; }
  85% { opacity: 1; }
  100% { opacity: 0; transform: translateX(520px); }
}

/* ---------- Sections ---------- */

.section { padding-block: clamp(3rem, 7vw, 5.5rem); border-top: 1px solid var(--rule); }
.section-paper { background: var(--paper); }

.split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
  gap: clamp(1.5rem, 5vw, 4rem);
}
.split > header p { color: var(--ink-2); }

/* Audiences: a definition list, not a card grid */
.audiences { margin: 0; display: grid; gap: 0; }
.audiences > div {
  display: grid; grid-template-columns: minmax(0, 15rem) minmax(0, 1fr);
  gap: 1.5rem; padding-block: 1.4rem; border-bottom: 1px solid var(--rule);
}
.audiences > div:first-child { padding-top: 0; }
.audiences dt { font-family: var(--display); font-weight: 600; font-size: var(--s0); line-height: 1.35; }
.audiences dd { margin: 0; color: var(--ink-2); }

/* Standards row */
.standards { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 1.5rem; border-top: 2px solid var(--ink); }
.standards li { padding: 1.1rem 1.2rem 1.1rem 0; border-bottom: 1px solid var(--rule); }
.standards strong { display: block; font-family: var(--display); font-stretch: 110%; font-size: var(--s0); }
.standards span { color: var(--ink-3); font-size: var(--s-1); }

/* Steps — a genuine sequence, so numbered */
.steps { list-style: none; counter-reset: step; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; }
.steps li { counter-increment: step; padding: 0 1.5rem 0 0; position: relative; }
.steps li::before {
  content: counter(step);
  display: block; font-family: var(--display); font-weight: 700; font-stretch: 125%;
  font-size: var(--s3); color: var(--teal); line-height: 1; margin-bottom: 0.9rem;
  padding-bottom: 0.9rem; border-bottom: 2px solid var(--ink);
}
.steps li:last-child::before { color: var(--amber); }
.steps h3 { font-size: var(--s0); }
.steps p { color: var(--ink-2); font-size: var(--s-1); line-height: 1.55; }

/* Founder note */
.note { display: grid; grid-template-columns: 6px minmax(0, 1fr); gap: 1.5rem; }
.note::before { content: ""; background: var(--amber); }
.note blockquote { margin: 0; font-size: var(--s1); line-height: 1.5; max-width: 30em; }
.note cite { display: block; margin-top: 1rem; font-style: normal; font-family: var(--display); font-size: var(--s-1); color: var(--ink-3); }

/* Closing call to action */
.closing { background: var(--ink); color: var(--paper); padding-block: clamp(3rem, 7vw, 5rem); }
.closing h2 { color: var(--paper); max-width: 18em; }
.closing p { color: #c9d4dc; }
.closing .btn-primary { background: var(--amber); border-color: var(--amber); color: var(--ink); }
.closing .btn-primary:hover { background: var(--amber-soft); border-color: var(--amber-soft); color: var(--ink); }

/* ---------- Inner pages ---------- */

.page-head { padding-block: clamp(3rem, 6vw, 5rem) clamp(2rem, 4vw, 3rem); }
.page-head h1 { font-size: var(--s4); max-width: 16em; }

.practice { padding-block: clamp(2.5rem, 6vw, 4.5rem); border-top: 1px solid var(--rule); }
.practice .split > header h2 { font-size: var(--s2); }

.offer { list-style: none; padding: 0; margin: 0; }
.offer li { padding-block: 1.1rem; border-bottom: 1px solid var(--rule); display: grid; grid-template-columns: minmax(0, 14rem) minmax(0, 1fr); gap: 1.5rem; }
.offer li:first-child { padding-top: 0; }
.offer h3 { font-size: var(--s0); margin: 0; line-height: 1.4; }
.offer p { margin: 0; color: var(--ink-2); }

.formats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(1rem, 3vw, 2rem); }
.formats > div { border-top: 2px solid var(--ink); padding-top: 1rem; }
.formats h3 { font-size: var(--s0); }
.formats p { color: var(--ink-2); font-size: var(--s-1); }

.prose { max-width: var(--measure); }
.prose h2 { font-size: var(--s2); margin-top: 2.2rem; }
.prose ul { padding-left: 1.2rem; }
.prose li { margin-bottom: 0.5rem; }

.facts { margin: 0; border-top: 2px solid var(--ink); }
.facts > div { padding-block: 0.9rem; border-bottom: 1px solid var(--rule); }
.facts dt { font-family: var(--display); font-size: var(--s-1); color: var(--ink-3); }
.facts dd { margin: 0.2rem 0 0; }

/* ---------- Contact form ---------- */

.form { display: grid; gap: 1.25rem; max-width: 34rem; }
.field { display: grid; gap: 0.4rem; }
.field label { font-family: var(--display); font-weight: 600; font-size: 0.95rem; }
.field .hint { font-size: var(--s-1); color: var(--ink-3); margin: 0; }
.field input, .field select, .field textarea {
  font: inherit; font-size: 1rem; color: var(--ink);
  background: var(--paper); border: 1.5px solid var(--ink-3); border-radius: 0;
  padding: 0.7rem 0.8rem; width: 100%;
}
.field textarea { min-height: 9rem; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { outline: 3px solid var(--amber); outline-offset: 0; border-color: var(--ink); }
.field [aria-invalid="true"] { border-color: #a5322a; }
.error { color: #a5322a; font-size: var(--s-1); margin: 0; }
.form-status { font-family: var(--display); font-size: 0.95rem; color: var(--teal-dark); min-height: 1.5em; }

/* ---------- Footer ---------- */

.site-footer { padding-block: 2.5rem; font-size: var(--s-1); color: var(--ink-3); }
.site-footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem; }
.site-footer p { margin: 0; }
.site-footer a { color: var(--ink-2); }

/* ---------- Responsive ---------- */

@media (max-width: 900px) {
  .hero .wrap, .split { grid-template-columns: minmax(0, 1fr); }
  .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 2.5rem; }
  .formats { grid-template-columns: minmax(0, 1fr); }
  .standards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
  .audiences > div, .offer li { grid-template-columns: minmax(0, 1fr); gap: 0.4rem; }
  .steps { grid-template-columns: minmax(0, 1fr); }
  .standards { grid-template-columns: minmax(0, 1fr); }
  .site-header .wrap { padding-block: 0.8rem; }
  .bus .node text { font-size: 19px; }
  .bus .node .sub { font-size: 15px; }
}
