/* Iron Office Tools, shared stylesheet.
   Tokens copied from sources/business/design-system/tokens/ on 3 Sep 2026.
   Screen family: black page, one accent, hairlines, mono stamps. */

@import url('https://fonts.googleapis.com/css2?family=Anton&family=Inter:wght@400;500;600;700;800&display=swap');

:root {
  --io-blue: #0000c5;
  --io-blue-bright: #4361ff;
  --io-crimson: #d6303f;
  --io-black: #000;
  --io-white: #fff;
  --io-grey-100: #cfcfcf;
  --io-grey-200: #a8a8a8;
  --io-grey-300: #9a9a9a;   /* was #8a8a8a, +contrast 7 Sep 2026 */
  --io-grey-400: #7c7c7c;   /* was #6a6a6a */
  --io-grey-500: #6a6a6a;   /* was #5a5a5a */
  --io-grey-600: #565656;   /* was #4a4a4a */
  --io-surface-0: #0c0c0c;
  --io-surface-1: #111;
  --io-surface-2: #141414;
  --io-surface-4: #1c1c1c;
  --io-surface-6: #262626;
  --io-line: rgba(255,255,255,.10);
  --io-line-strong: rgba(255,255,255,.13);
  --io-line-soft: rgba(255,255,255,.07);
  --io-line-hover: rgba(255,255,255,.28);
  --io-surface-hover: #1a1a1a;
  --io-focus-ring: #4361ff;
  --io-blue-tint: rgba(0,0,197,.14);
  --io-track: rgba(255,255,255,.09);
  --io-ink: #fff;                 /* text on the page ground and on surfaces */
  --io-scrim: rgba(0,0,0,.6);     /* overlay behind a modal */
  --io-ghost: rgba(255,255,255,.05);

  /* The four pillars, exactly as the client check-in dashboards draw them. */
  --pillar-training: #4361ff;
  --pillar-nutrition: #e0500a;
  --pillar-steps: #19d44b;
  --pillar-sleep: #7b2ff5;
  --block-work: #4a4a4a;
  --block-life: #e7e5df;    /* the Life block; darker in the light theme so it stands off the ground */

  --font-display: 'Anton', 'Arial Narrow', Arial, sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, Arial, sans-serif;
  --font-mono: ui-monospace, Menlo, 'SF Mono', Consolas, monospace;

  --radius-control: 6px;
  --radius-card: 8px;
  --control-h: 32px;
  --control-h-lg: 40px;
  color-scheme: dark;
}

/* Light theme, 7 Sep 2026 (Matt's feedback: the dark contrast is too much for some people). The one
   accent, the pillars and every block colour stay as they are; only the ground, surfaces, greys and
   hairlines flip. Chosen with the nav switch, remembered in localStorage under io-theme; dark is the
   default and the design system's home. Greys carry a hint of the blue so they read as chosen. */
:root[data-theme="light"] {
  --io-black: #f4f4f7;
  --io-white: #0a0a0c;
  --io-grey-100: #1f1f24;
  --io-grey-200: #3a3a41;
  --io-grey-300: #46464e;
  --io-grey-400: #5a5a63;
  --io-grey-500: #6e6e77;
  --io-grey-600: #85858e;
  --io-surface-0: #ffffff;
  --io-surface-1: #fbfbfc;
  --io-surface-2: #f1f1f4;
  --io-surface-4: #e8e8ec;
  --io-surface-6: #dadae0;
  --io-line: rgba(10,10,20,.16);
  --io-line-strong: rgba(10,10,20,.22);
  --io-line-soft: rgba(10,10,20,.10);
  --io-line-hover: rgba(10,10,20,.4);
  --block-life: #d6d3c8;
  --io-surface-hover: #ececf0;
  --io-blue-tint: rgba(0,0,197,.08);
  --io-track: rgba(10,10,20,.10);
  --io-ink: #0a0a0c;
  --io-scrim: rgba(20,20,30,.45);
  --io-ghost: rgba(10,10,20,.04);
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--io-black); }
body {
  color: var(--io-grey-100);
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.5;
  letter-spacing: -0.011em;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
a { color: var(--io-blue-bright); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
::selection { background: var(--io-blue); color: #fff; }

/* Nav bar: 56px, hairline bottom, mark and wordmark left, links right. */
.io-nav {
  position: sticky; top: 0; z-index: 40;
  height: 56px; background: var(--io-black);
  border-bottom: 1px solid var(--io-line);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 clamp(16px, 3vw, 40px);
}
.io-nav .brand { display: flex; align-items: center; gap: 10px; color: var(--io-ink); }
.io-nav .brand:hover { text-decoration: none; }
.io-nav .brand img { width: 22px; height: 22px; border-radius: 4px; display: block; }
.io-nav .brand span {
  font-family: var(--font-mono); font-size: 11px; letter-spacing: .2em;
  text-transform: uppercase; font-weight: 600; color: var(--io-ink);
}
.io-nav .brand small {
  font-family: var(--font-mono); font-size: 9px; letter-spacing: .16em;
  text-transform: uppercase; color: var(--io-grey-400); margin-left: 6px;
}
.io-nav .right { display: flex; align-items: center; gap: 18px; }
.io-nav .links { display: flex; gap: 22px; }
.io-nav .theme {
  height: 26px; padding: 0 10px; border-radius: 4px; border: 1px solid var(--io-line); background: var(--io-surface-1);
  color: var(--io-grey-300); cursor: pointer; font-family: var(--font-mono); font-size: 9px; letter-spacing: .16em; text-transform: uppercase;
}
.io-nav .theme:hover { color: var(--io-ink); border-color: var(--io-line-hover); }
.io-nav .links a { font-size: 14px; color: var(--io-grey-300); }
.io-nav .links a:hover { color: var(--io-ink); text-decoration: none; }
.io-nav .links a.on { color: var(--io-ink); }
/* The guide sits apart from the tools: a hairline divider, then an outlined pill (23 Sep 2026). */
.io-nav .links { align-items: center; }
.io-nav .links a.guide { margin-left: 4px; padding: 4px 12px; border: 1px solid var(--pillar-training); border-radius: 999px; color: var(--io-ink); position: relative; }
.io-nav .links a.guide::before { content: ''; position: absolute; left: -15px; top: 3px; bottom: 3px; width: 1px; background: var(--io-line-strong); }
.io-nav .links a.guide:hover, .io-nav .links a.guide.on { background: var(--pillar-training); color: #fff; }
@media (max-width: 640px) { .io-nav .links a.guide { padding: 3px 8px; white-space: nowrap; margin-left: 0; } .io-nav .links a.guide::before { left: -8px; } }
@media (max-width: 640px) {
  .io-nav .brand small { display: none; }
  .io-nav .brand span { display: none; }   /* four nav links need the room, 23 Sep 2026 */
  .io-nav .right { gap: 10px; }
  .io-nav .links { gap: 14px; }
  .io-nav .theme { padding: 0 7px; }
  .io-nav .links a { font-size: 12.5px; }
}
/* Phone nav, 3 Oct 2026: two rows so "What Can I Eat" stops wrapping to 3 lines; the mark and the Light/Dark button on top, the four links across the bottom, every tap 40px tall. Scrolls away rather than eating a tenth of the screen. */
@media (max-width: 640px) {
  .io-nav { position: static; height: auto; flex-wrap: wrap; padding-top: 6px; padding-bottom: 0; }
  .io-nav .right { display: contents; }
  .io-nav .theme { order: 2; height: 40px; padding: 0 14px; font-size: 11px; letter-spacing: .12em; }
  .io-nav .links { order: 3; flex: 0 0 100%; justify-content: space-between; gap: 6px; margin-top: 4px; border-top: 1px solid var(--io-line); }
  .io-nav .links a { padding: 11px 0; font-size: 12px; white-space: nowrap; }
  .io-nav .links a.guide { padding: 12px 10px; }
  .io-nav .links a.guide::before { display: none; }
}

/* Page frame */
.io-page { max-width: 1180px; margin: 0 auto; padding: 28px clamp(16px, 3vw, 40px) 80px; }
.io-page.wide { max-width: 1400px; }

.kicker {
  font-family: var(--font-mono); font-size: 10px; letter-spacing: .26em;
  text-transform: uppercase; color: var(--io-blue-bright); margin: 0 0 8px;
}
h1.display {
  font-family: var(--font-display); font-size: clamp(36px, 6vw, 60px);
  line-height: .95; color: var(--io-ink); margin: 0 0 12px; text-transform: uppercase;
  font-weight: 400; letter-spacing: 0;
}
h1.screen { font-size: 28px; font-weight: 600; letter-spacing: -0.022em; color: var(--io-ink); margin: 0 0 8px; line-height: 1.1; }
h2.screen { font-size: 20px; font-weight: 600; letter-spacing: -0.018em; color: var(--io-ink); margin: 0 0 8px; line-height: 1.15; }
.lead { font-size: 16px; color: var(--io-grey-200); max-width: 640px; margin: 0 0 24px; }
.muted { color: var(--io-grey-300); }
.hint { font-size: 12px; color: var(--io-grey-400); margin: 8px 0 0; }  /* one definition, moved here 5 Sep 2026 from week.html; whiteboard.html adjusts its margin */
.faint { color: var(--io-grey-500); }
p { margin: 0 0 12px; }

.section { margin-top: 34px; }
.section-head {
  font-family: var(--font-mono); font-size: 10px; letter-spacing: .22em;
  text-transform: uppercase; color: var(--io-blue-bright);
  padding-bottom: 8px; border-bottom: 1px solid var(--io-line); margin-bottom: 16px;
}
.section-head .n { color: var(--io-grey-500); margin-right: 8px; }

/* Depth is a value shift and a hairline border. No shadows on tiles, buttons or fields.
   .raised and .well are kept as names only, so pages that use them stay flat. */
.raised, .well { background: var(--io-surface-1); border: 1px solid var(--io-line-strong); border-radius: 12px; }
.raised > .card, .raised .card.flat, .well > .card { background: var(--io-surface-0); border-color: var(--io-line); }
.stamp-io { font-family: var(--font-mono); font-size: 9px; letter-spacing: .26em; text-transform: uppercase; color: var(--io-grey-500); margin: 0 0 10px; }
.stamp-io b { color: var(--io-blue-bright); font-weight: 600; }

/* Cards and panels */
.card {
  background: var(--io-surface-1); border: 1px solid var(--io-line);
  border-radius: var(--radius-card); padding: 16px;
}
.card.flat { background: var(--io-surface-0); }
.grid { display: grid; gap: 14px; }
.grid.c2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.c3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 860px) { .grid.c3 { grid-template-columns: 1fr; } .grid.c2 { grid-template-columns: 1fr; } }

/* Mono labels and stamps */
.label {
  font-family: var(--font-mono); font-size: 9px; letter-spacing: .16em;
  text-transform: uppercase; color: var(--io-grey-300);
}
.stamp {
  font-family: var(--font-mono); font-size: 10px; letter-spacing: .18em;
  text-transform: uppercase; color: var(--io-blue-bright);
}

/* Figures */
.figure { font-family: var(--font-display); font-size: 36px; line-height: 1; color: var(--io-ink); }
.figure .unit { font-size: 55%; color: var(--io-blue-bright); margin-left: 4px; }
.figure.sm { font-size: 24px; }

/* Controls: 32px, mono labels, hairline, blue focus */
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-family: var(--font-mono); font-size: 9px; letter-spacing: .16em; text-transform: uppercase; color: var(--io-grey-300); }
.input, .select {
  height: var(--control-h); background: var(--io-surface-0); border: 1px solid var(--io-line);
  border-radius: var(--radius-control); color: var(--io-ink); padding: 0 10px; outline: none;
  transition: border-color .12s, background .12s; width: 100%;
}
.input:hover, .select:hover { border-color: var(--io-line-hover); }
.input:focus, .select:focus { border-color: var(--io-focus-ring); }
.select { appearance: none; -webkit-appearance: none; background-image: none; padding-right: 26px; position: relative; }
.select-wrap { position: relative; }
.select-wrap::after { content: '\25BE'; position: absolute; right: 10px; top: 50%; transform: translateY(-50%); color: var(--io-grey-400); pointer-events: none; font-size: 12px; }
.input::placeholder { color: var(--io-grey-600); }
.input[type=number] { -moz-appearance: textfield; }
.input::-webkit-outer-spin-button, .input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

.btn {
  height: var(--control-h); padding: 0 14px; border-radius: var(--radius-control);
  border: 1px solid var(--io-line); background: var(--io-surface-1); color: var(--io-ink);
  cursor: pointer; font-size: 13px; font-weight: 500; display: inline-flex; align-items: center; gap: 8px;
  transition: border-color .12s, background .12s; white-space: nowrap;
}
.btn:hover { border-color: var(--io-line-hover); background: var(--io-surface-hover); }
.btn:focus-visible { outline: 1px solid var(--io-focus-ring); outline-offset: 1px; }
.btn.primary { background: var(--io-blue); border-color: var(--io-blue); color: #fff; }
.btn.primary:hover { background: #0000d8; }
.btn.ghost { background: transparent; }
.btn.danger:hover { border-color: var(--io-crimson); color: var(--io-crimson); }
.btn.lg { height: var(--control-h-lg); padding: 0 18px; font-size: 14px; }
.btn.sm { height: 26px; padding: 0 10px; font-size: 12px; }
.btn[disabled] { opacity: .45; cursor: default; }

/* Segmented tabs */
.seg { display: inline-flex; background: var(--io-surface-0); border: 1px solid var(--io-line); border-radius: var(--radius-control); padding: 2px; gap: 2px; }
.seg button {
  height: 26px; padding: 0 12px; border: none; background: transparent; border-radius: 4px;
  color: var(--io-grey-300); cursor: pointer; font-size: 12.5px; font-weight: 500;
}
.seg button:hover { color: var(--io-ink); }
.seg button.on { background: var(--io-surface-4); color: var(--io-ink); }

/* Chips */
.chip {
  display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px;
  border-radius: 4px; border: 1px solid var(--io-line); background: var(--io-surface-2);
  font-family: var(--font-mono); font-size: 10px; letter-spacing: .12em; text-transform: uppercase;
  color: var(--io-grey-300); cursor: pointer; transition: .12s;
}
.chip:hover { color: var(--io-ink); border-color: var(--io-line-hover); }
.chip.on { background: var(--io-surface-6); color: var(--io-ink); border-color: var(--io-line-hover); }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }

/* Tables */
.table { width: 100%; border-collapse: collapse; }
.table th {
  font-family: var(--font-mono); font-size: 9px; letter-spacing: .16em; text-transform: uppercase;
  color: var(--io-grey-400); text-align: left; padding: 0 10px 8px; border-bottom: 1px solid var(--io-line-strong); font-weight: 500;
}
.table td { padding: 11px 10px; border-bottom: 1px solid var(--io-line); font-size: 12.5px; color: var(--io-grey-200); }
.table td:first-child { color: var(--io-ink); font-weight: 600; }
.table td.num, .table th.num { text-align: right; font-variant-numeric: tabular-nums; }
.table tr:last-child td { border-bottom: none; }

/* Working panel (the maths, shown) */
.working {
  font-family: var(--font-mono); font-size: 11px; line-height: 1.7; color: var(--io-grey-200);
  background: var(--io-surface-0); border: 1px solid var(--io-line); border-radius: var(--radius-card);
  padding: 14px 16px; white-space: pre-wrap; overflow-x: auto;
}
.working b { color: var(--io-ink); font-weight: 600; }
.working .k { color: var(--io-blue-bright); }

/* Callout: 2px blue left bar */
.callout { border-left: 2px solid var(--io-blue); padding: 4px 0 4px 14px; color: var(--io-grey-100); margin: 16px 0; }
.callout .label { display: block; margin-bottom: 4px; }

/* Footer */
.io-foot {
  margin-top: 60px; padding-top: 16px; border-top: 1px solid var(--io-line);
  display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  font-family: var(--font-mono); font-size: 9px; letter-spacing: .16em; text-transform: uppercase; color: var(--io-grey-500);
}
.io-foot a { color: var(--io-grey-300); }
.io-foot .links { display: flex; gap: 14px; flex-wrap: wrap; }
.io-foot .links a:hover { color: var(--io-ink); }

/* Pillar swatches (the home page chips and tile strips). Text-colour helpers, the work and personal
   swatches, .panel, .visually-hidden and .figure.xl were unused on every page and went 5 Sep 2026. */
.bg-sleep { background: var(--pillar-sleep); }
.bg-steps { background: var(--pillar-steps); }
.bg-nutrition { background: var(--pillar-nutrition); }
.bg-training { background: var(--pillar-training); }

/* The path from a tool to coaching (28 Sep 2026, Brendan's go): one booking destination, the same form and
   label as the main site. A top-bar button on wide screens and a closing card inside each tool. */
.io-nav .book { height: 34px; }
@media (max-width: 860px) { .io-nav .book { display: none; } }
.book-card { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px 28px; margin-top: 28px; padding: 20px 22px; border: 1px solid var(--io-blue); background: var(--io-blue-tint); border-radius: var(--radius-card); }
.book-card .book-kicker { font-family: var(--font-mono); font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--io-grey-100); }
.book-card p { margin: 6px 0 0; font-size: 16px; line-height: 1.45; color: var(--io-ink); max-width: 36em; }
.book-card .btn { height: 44px; }

/* Expandables across the tools: a small thin blue chevron, the same as the main site's (Brendan, 28 Sep 2026).
   Points down when closed, up when open. */
details > summary.chev::after, details.fold > summary::after, details.more > summary::after { content: ""; flex: 0 0 auto; display: inline-block; width: 8px; height: 8px; margin-left: 12px; border-right: 2px solid #2b3ad4; border-bottom: 2px solid #2b3ad4; transform: translateY(-3px) rotate(45deg); transition: transform .3s; }
details[open] > summary.chev::after, details.fold[open] > summary::after, details.more[open] > summary::after { transform: translateY(2px) rotate(-135deg); }
@media (prefers-reduced-motion: reduce) { details > summary::after { transition: none; } }
