/* tōtara software — website draft (2026-11-17).
   The "rail" look from the architecture practice toolkit, re-coloured in tōtara greens:
   a left rail holds section numbers and labels, text runs in the main column, wide
   components use the full measure. A solid title block with an accent rule beneath.
   Ruled (booktabs) tables. Marks, not pills. No rounded corners, no tinted boxes,
   no tracked capitals. */

/* ---------- Fonts (self-hosted, SIL OFL 1.1: see fonts/*-OFL.txt) ---------- */
@font-face { font-family: 'Inter'; font-weight: 400; font-display: swap; src: url('fonts/inter-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-weight: 500; font-display: swap; src: url('fonts/inter-latin-500-normal.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-weight: 600; font-display: swap; src: url('fonts/inter-latin-600-normal.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-weight: 700; font-display: swap; src: url('fonts/inter-latin-700-normal.woff2') format('woff2'); }
@font-face { font-family: 'Source Serif 4'; font-weight: 400; font-display: swap; src: url('fonts/source-serif-4-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'Source Serif 4'; font-weight: 400; font-style: italic; font-display: swap; src: url('fonts/source-serif-4-latin-400-italic.woff2') format('woff2'); }
@font-face { font-family: 'Source Serif 4'; font-weight: 600; font-display: swap; src: url('fonts/source-serif-4-latin-600-normal.woff2') format('woff2'); }

/* ---------- Tokens ---------- */
:root {
  color-scheme: light;
  --ink: #0f4425;          /* title block, headings: forest green */
  --ink-2: #2c4a37;        /* secondary text */
  --text: #15251b;
  --muted: #5d6e62;
  --paper: #ffffff;
  --accent: #189612;       /* tōtara green: rules and marks */
  --accent-deep: #0f6e0c;  /* links on paper */
  --leaf: #9ed69a;         /* rail labels on ink */
  --rule: #cdd8cf;         /* hairlines on paper */
  --rule-ink: #0f4425;     /* heavy rules */

  --font-sans: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-serif: 'Source Serif 4', Georgia, 'Times New Roman', serif;

  --page: 1200px;
  --rail: 196px;
  --gap: 36px;
  --measure: 680px;
  --side: 40px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; }
body {
  margin: 0; background: var(--paper); color: var(--text);
  font-family: var(--font-sans); font-size: 17px; line-height: 1.6;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
img { display: block; max-width: 100%; height: auto; }
a { color: var(--accent-deep); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--accent); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
p { margin: 0 0 1em; }
strong { font-weight: 600; color: var(--ink); }

.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 12px; z-index: 10; background: var(--paper); padding: 8px 12px; }

.wrap { max-width: var(--page); margin: 0 auto; padding: 0 var(--side); }

/* ---------- Top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 5; background: var(--paper);
  border-bottom: 1px solid var(--rule);
}
.topbar .wrap { display: flex; align-items: center; justify-content: space-between; height: 72px; }
.topbar .brand img { height: 44px; width: auto; }
.nav { display: flex; gap: 28px; font-size: 15px; font-weight: 500; }
.nav a { color: var(--ink); text-decoration: none; padding: 6px 0; border-bottom: 2px solid transparent; }
.nav a:hover { border-bottom-color: var(--accent); color: var(--ink); }
.menu { display: none; }

/* ---------- Title block ---------- */
.title-block { background: var(--ink); color: #fff; border-bottom: 10px solid var(--accent); }
.title-block .wrap {
  display: grid; grid-template-columns: var(--rail) 1fr; column-gap: var(--gap);
  padding-top: 88px; padding-bottom: 72px;
}
.rail-label {
  font-size: 13px; font-weight: 700; line-height: 1.35; color: var(--leaf);
  padding-top: 14px;
}
.rail-label span { display: block; font-weight: 500; color: rgba(255,255,255,.62); }
.title-block h1 {
  font-family: var(--font-serif); font-weight: 600; font-size: clamp(40px, 5.4vw, 68px);
  line-height: 1.03; letter-spacing: -.01em; margin: 0 0 28px; max-width: 15ch;
}
.title-block .lede {
  font-family: var(--font-serif); font-size: 21px; line-height: 1.45;
  color: rgba(255,255,255,.86); max-width: 40ch; margin: 0 0 36px;
}
.title-block .lede + .lede { margin-top: -20px; }
.actions { display: flex; flex-wrap: wrap; gap: 14px 28px; align-items: center; }
.actions.spaced { margin-top: 28px; }
.btn {
  display: inline-block; background: var(--accent); color: #fff; text-decoration: none;
  font-weight: 600; font-size: 16px; padding: 14px 22px; border: 0; border-radius: 0;
}
.btn:hover { background: #127c0e; color: #fff; }
.title-block .link { color: #fff; font-weight: 600; text-decoration-color: var(--leaf); }
.title-block .link:hover { color: var(--leaf); }

/* ---------- Sections on the rail ---------- */
.sec .wrap { display: grid; grid-template-columns: var(--rail) 1fr; column-gap: var(--gap); }
.sec { padding: 72px 0 24px; }
.sec-head {
  grid-column: 1 / -1; display: grid; grid-template-columns: var(--rail) 1fr; column-gap: var(--gap);
  border-top: 1px solid var(--rule-ink); padding-top: 16px; margin-bottom: 28px;
}
.secnum {
  font-family: var(--font-serif); font-size: 44px; line-height: 1; font-weight: 400; color: var(--accent);
}
.secnum small {
  display: block; margin-top: 10px; font-family: var(--font-sans); font-size: 13px; font-weight: 700;
  color: var(--ink-2); line-height: 1.35;
}
.sec h2 {
  font-family: var(--font-serif); font-weight: 600; font-size: clamp(30px, 3.4vw, 42px);
  line-height: 1.1; color: var(--ink); margin: 0; max-width: 22ch;
}
.main { grid-column: 2; max-width: var(--measure); }
.wide { grid-column: 2; }
.full { grid-column: 1 / -1; }
.lead { font-family: var(--font-serif); font-size: 21px; line-height: 1.5; color: var(--ink-2); }
h3 { font-family: var(--font-serif); font-weight: 600; font-size: 23px; line-height: 1.25; color: var(--ink); margin: 0 0 10px; }
h4 { font-size: 16px; font-weight: 700; color: var(--ink); margin: 0 0 6px; }

/* A label that hangs in the rail, beside a paragraph in the main column. */
.railnote { grid-column: 1 / -1; display: grid; grid-template-columns: var(--rail) 1fr; column-gap: var(--gap); margin: 8px 0 28px; }
.railnote > .label { font-size: 13px; font-weight: 700; color: var(--accent-deep); padding-top: 3px; }
.railnote > p { max-width: var(--measure); margin: 0; font-family: var(--font-serif); font-size: 19px; color: var(--ink); }
.railnote > ol { grid-column: 2; }

/* ---------- Booktabs tables ---------- */
table.ruled { width: 100%; border-collapse: collapse; font-size: 16px; margin: 4px 0 32px; }
table.ruled thead th {
  text-align: left; font-weight: 600; color: var(--ink); font-size: 14px;
  border-top: 2.5px solid var(--rule-ink); border-bottom: 1px solid var(--rule-ink); padding: 10px 14px 10px 0;
}
table.ruled td { border-bottom: 1px solid var(--rule); padding: 16px 18px 16px 0; vertical-align: top; }
table.ruled tbody tr:last-child td { border-bottom: 2.5px solid var(--rule-ink); }
table.ruled td:first-child { width: 30%; }
table.ruled td .name { font-family: var(--font-serif); font-weight: 600; font-size: 20px; color: var(--ink); line-height: 1.25; }
table.ruled td .sub { display: block; color: var(--muted); font-size: 14px; margin-top: 4px; }
table.ruled.compact td:first-child { width: 34%; }

table.ruled.types { font-size: 15px; }
table.ruled.types td:first-child { width: 22%; }
table.ruled.types td:last-child { width: 12%; color: var(--ink-2); font-size: 14px; }
table.ruled.types td .sub { font-size: 13px; }

/* "From most controlled to most autonomous", above the five types. */
.scale {
  display: flex; justify-content: space-between; font-size: 13px; font-weight: 700; color: var(--ink-2);
  margin: 0 0 10px; padding-bottom: 8px; position: relative;
  background: linear-gradient(var(--accent), var(--accent)) left bottom / calc(100% - 10px) 2px no-repeat;
}
.scale::after {
  content: ""; position: absolute; right: 0; bottom: -4px;
  border-left: 10px solid var(--accent); border-top: 5px solid transparent; border-bottom: 5px solid transparent;
}

/* Harvey balls: the share of the ball filled is the level. */
.harvey {
  display: inline-block; width: 14px; height: 14px; border-radius: 50%; margin-right: 8px; vertical-align: -2px;
  border: 1.5px solid var(--accent); --f: 0%;
  background: conic-gradient(var(--accent) 0 var(--f), transparent var(--f) 100%);
}
.harvey.q1 { --f: 25%; } .harvey.q2 { --f: 50%; } .harvey.q3 { --f: 75%; } .harvey.q4 { --f: 100%; }

ol.questions { margin: 0; padding-left: 22px; max-width: var(--measure); font-size: 16px; }
ol.questions li { margin: 0 0 10px; padding-left: 4px; }
ol.questions li::marker { font-family: var(--font-serif); font-weight: 600; color: var(--accent-deep); }
.small { font-size: 14px; color: var(--muted); }

/* Term boxes: the one tinted component, on purpose (as in the rail theme). */
.terms { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin: 4px 0 24px; }
.term { background: #eef6ec; padding: 20px 22px 8px; border-top: 3px solid var(--accent); }
.term.warn { background: #fbf4e4; border-top-color: #b7791f; }
.term-label { font-size: 12px; font-weight: 700; color: var(--accent-deep); margin-bottom: 4px; }
.term.warn .term-label { color: #8a5a12; }
.term h4 { font-family: var(--font-serif); font-size: 22px; font-weight: 600; margin: 0 0 10px; }
.term p { font-size: 15px; line-height: 1.55; }

/* ---------- Marks (not pills) ---------- */
.mark { display: inline-block; width: 12px; height: 12px; margin-right: 10px; vertical-align: -1px; border: 2px solid var(--accent); }
.mark.full { background: var(--accent); }
.mark.half { background: linear-gradient(90deg, var(--accent) 50%, transparent 50%); }
.mark.empty { background: transparent; }
.mark.dash { border-style: dashed; }

/* ---------- Two and three across, divided by hairlines ---------- */
.cols { display: grid; gap: 0; border-top: 2.5px solid var(--rule-ink); border-bottom: 1px solid var(--rule); margin: 4px 0 36px; }
.cols.two { grid-template-columns: 1fr 1fr; }
.cols.three { grid-template-columns: repeat(3, 1fr); }
.cols > div { padding: 22px 26px 18px 0; }
.cols > div + div { border-left: 1px solid var(--rule); padding-left: 26px; }
.cols .n { font-family: var(--font-serif); font-size: 15px; color: var(--accent-deep); font-weight: 600; margin-bottom: 8px; }
.cols ul { margin: 10px 0 0; padding-left: 18px; }
.cols li { margin: 4px 0; }
li::marker { color: var(--accent); }

/* ---------- Product schematic ---------- */
.schematic { margin: 8px 0 36px; border-top: 2.5px solid var(--rule-ink); border-bottom: 1px solid var(--rule); padding: 20px 0 8px; }
.schematic figcaption { font-size: 14px; color: var(--muted); margin-top: 10px; }

/* Built in HTML so it reflows on a phone. */
.flow { display: grid; grid-template-columns: 1fr 44px 1.3fr 44px 1fr; align-items: center; }
.flow-label { font-size: 13px; font-weight: 700; color: var(--ink-2); margin-bottom: 8px; }
.flow-box { border: 1px solid var(--ink); padding: 11px 14px; font-size: 15px; line-height: 1.3; margin-bottom: 10px; }
.flow-box:last-child { margin-bottom: 0; }
.flow-arrow { height: 1.5px; background: var(--ink); margin: 0 8px 0 4px; position: relative; }
.flow-arrow::after {
  content: ""; position: absolute; right: -2px; top: -5px;
  border-left: 9px solid var(--ink); border-top: 5.5px solid transparent; border-bottom: 5.5px solid transparent;
}
.flow-account { border: 1px dashed var(--ink); padding: 12px 14px 14px; }
.flow-app { background: var(--ink); color: #fff; padding: 18px 20px 0; border-bottom: 8px solid var(--accent); }
.flow-app-name { font-family: var(--font-serif); font-size: 24px; font-weight: 600; line-height: 1.2; }
.flow-app-kind { color: var(--leaf); font-size: 13px; font-weight: 600; margin: 2px 0 12px; }
.flow-app ul { list-style: none; padding: 0; margin: 0; font-size: 15px; color: rgba(255,255,255,.9); }
.flow-app li { padding: 7px 0; border-top: 1px solid rgba(255,255,255,.2); }
.flow-app-foot { font-size: 13px; font-weight: 600; color: var(--leaf); padding: 9px 0 12px; border-top: 1px solid rgba(255,255,255,.2); }

/* ---------- People ---------- */
.people { display: grid; grid-template-columns: 1fr 1fr; gap: 0; border-top: 2.5px solid var(--rule-ink); }
.person { display: grid; grid-template-columns: 132px 1fr; gap: 22px; padding: 26px 26px 26px 0; border-bottom: 1px solid var(--rule); }
.person + .person { border-left: 1px solid var(--rule); padding-left: 26px; }
.person img { width: 132px; height: 132px; object-fit: cover; filter: saturate(.85); }
.person h3 { margin-bottom: 2px; }
.person .role { font-size: 14px; font-weight: 600; color: var(--accent-deep); margin-bottom: 10px; }
.person p { font-size: 16px; }

/* ---------- Contact ---------- */
.contact { display: grid; grid-template-columns: 1.4fr 1fr; gap: 40px; align-items: start; }
.contact dl { margin: 0; display: grid; grid-template-columns: 110px 1fr; row-gap: 12px; font-size: 16px; }
.contact dt { font-weight: 700; color: var(--ink); }
.contact dd { margin: 0; }

/* ---------- Footer ---------- */
.footer { background: var(--ink); color: rgba(255,255,255,.72); margin-top: 88px; border-top: 10px solid var(--accent); }
.footer .wrap { display: grid; grid-template-columns: var(--rail) 1fr auto; column-gap: var(--gap); align-items: end; padding-top: 48px; padding-bottom: 44px; font-size: 14px; }
.footer img { height: 58px; width: auto; }
.footer a { color: #fff; }
.footer p { margin: 0; }

/* People stack one per row until there's room for two. */
@media (max-width: 1140px) {
  .terms { grid-template-columns: 1fr 1fr; }
  .people { grid-template-columns: 1fr; }
  .person + .person { border-left: 0; padding-left: 0; }
}

/* ---------- Narrow screens: the rail folds above the text ---------- */
@media (max-width: 880px) {
  :root { --side: 16px; }
  .nav { display: none; }
  .menu { display: block; position: relative; }
  .menu summary { list-style: none; cursor: pointer; font-weight: 600; color: var(--ink); padding: 8px 12px; border: 1px solid var(--ink); }
  .menu summary::-webkit-details-marker { display: none; }
  .menu nav { position: absolute; right: 0; top: 46px; background: var(--paper); border: 1px solid var(--ink); display: grid; min-width: 220px; }
  .menu nav a { padding: 12px 16px; color: var(--ink); text-decoration: none; border-bottom: 1px solid var(--rule); }
  .topbar .wrap { height: 64px; }
  .topbar .brand img { height: 36px; }

  .title-block .wrap, .sec .wrap, .sec-head, .railnote, .footer .wrap { grid-template-columns: 1fr; }
  .title-block .wrap { padding-top: 48px; padding-bottom: 44px; }
  .rail-label { padding: 0 0 16px; }
  .title-block .lede { font-size: 19px; }
  .sec { padding-top: 48px; }
  .sec-head { row-gap: 12px; }
  .secnum { font-size: 34px; display: flex; align-items: baseline; gap: 12px; }
  .secnum small { margin: 0; }
  .main, .wide, .full { grid-column: 1; }
  .railnote > .label { padding-bottom: 6px; }
  .cols.two, .cols.three, .people, .contact { grid-template-columns: 1fr; }
  .cols > div + div, .person + .person { border-left: 0; padding-left: 0; border-top: 1px solid var(--rule); }
  .person { grid-template-columns: 96px 1fr; gap: 16px; padding-right: 0; }
  .person img { width: 96px; height: 96px; }
  table.ruled, table.ruled tbody, table.ruled tr, table.ruled td { display: block; width: 100% !important; }
  table.ruled thead { display: none; }
  table.ruled { border-top: 2.5px solid var(--rule-ink); }
  table.ruled td { border-bottom: 0; padding: 0 0 6px; }
  table.ruled td:first-child { padding-top: 16px; }
  table.ruled tr { border-bottom: 1px solid var(--rule); padding-bottom: 12px; }
  table.ruled tbody tr:last-child { border-bottom: 2.5px solid var(--rule-ink); }
  table.ruled tbody tr:last-child td { border-bottom: 0; }
  .footer .wrap { row-gap: 18px; }
  .flow { grid-template-columns: 1fr; }
  .terms { grid-template-columns: 1fr; }
  table.ruled.types td:nth-child(2)::before { content: "What it is"; }
  table.ruled.types td:nth-child(3)::before { content: "What runs in production"; }
  table.ruled.types td:nth-child(4)::before { content: "Controls"; }
  table.ruled.types td:nth-child(5)::before { content: "Risk"; }
  table.ruled.types td:not(:first-child)::before { display: block; font-size: 12px; font-weight: 700; color: var(--accent-deep); margin-top: 4px; }
  ol.questions { padding-left: 20px; }
  table.ruled.types td:last-child { white-space: normal; }
  .flow-arrow { width: 1.5px; height: 30px; margin: 10px auto; }
  .flow-arrow::after { right: auto; left: -5px; top: auto; bottom: -2px; border-left: 5.5px solid transparent; border-right: 5.5px solid transparent; border-top: 9px solid var(--ink); border-bottom: 0; }
}
