@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Sans:wght@400;500;600;700&family=IBM+Plex+Mono:wght@400;500;600&display=swap');

/* ---------------------------------------------------------------------------
   Layout: a left rail of interface labels against one reading column, the way a
   protocol stack lists its interfaces beside the path they carry. Shares its
   token set with /blog so the two halves read as one site.

   Three layers: primitive ramp -> semantic role -> component.
   --------------------------------------------------------------------------- */

:root {
  /* LAYER 1 — primitives (never used directly) */
  --slate-50:  #FAFAF9;  --slate-100: #EDECE9;  --slate-200: #E2E1DE;
  --slate-400: #85837E;  --slate-500: #62676E;  --slate-700: #3C4046;
  --slate-900: #16181C;  --white: #FFFFFF;
  --indigo-600: #8A5A1E; --indigo-800: #6B4415; --indigo-300: #E0A96D;
  --night-900: #0F1113;  --night-800: #15181B;  --night-700: #1D2023;
  --night-600: #272A2E;

  /* LAYER 2 — semantic */
  --surface:      var(--slate-50);
  --surface-2:    var(--white);
  --surface-sunk: var(--slate-100);
  --text:         var(--slate-900);
  --text-muted:   var(--slate-700);
  --text-faint:   var(--slate-500);
  --border:       var(--slate-200);
  --border-soft:  var(--slate-100);
  --accent:       var(--indigo-600);
  --accent-hover: var(--indigo-800);

  /* domain accents, shared with the blog's category system */
  --c-infra:#2E5C8A; --c-devops:#1F6F63; --c-monitoring:#8A6414;
  --c-telecom:#5B4A8F; --c-containers:#4A5A6B; --c-security:#8A3A3A;

  --font-read: 'IBM Plex Sans', Georgia, serif;
  --font-ui:   'IBM Plex Sans', system-ui, -apple-system, sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, Menlo, monospace;

  --rail: 232px;
  --measure: 64ch;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --surface: var(--night-900); --surface-2: var(--night-800);
    --surface-sunk: var(--night-700);
    --text: #E9E7E4; --text-muted: #B6B3AE; --text-faint: #85837E;
    --border: var(--night-600); --border-soft: var(--night-700);
    --accent: var(--indigo-300); --accent-hover: #EFC18C;
    --c-infra:#7FA8D8; --c-devops:#5FB8A8; --c-monitoring:#D4A542;
    --c-telecom:#A290D8; --c-containers:#90A2B5; --c-security:#D88A8A;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --surface: var(--night-900); --surface-2: var(--night-800);
  --surface-sunk: var(--night-700);
  --text: #E9E7E4; --text-muted: #B6B3AE; --text-faint: #85837E;
  --border: var(--night-600); --border-soft: var(--night-700);
  --accent: var(--indigo-300); --accent-hover: #EFC18C;
  --c-infra:#7FA8D8; --c-devops:#5FB8A8; --c-monitoring:#D4A542;
  --c-telecom:#A290D8; --c-containers:#90A2B5; --c-security:#D88A8A;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

body {
  margin: 0;
  background: var(--surface);
  color: var(--text-muted);
  font-family: var(--font-read);
  font-size: 1.0625rem;
  line-height: 1.65;
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
}
img, svg { max-width: 100%; }
a { color: var(--accent); text-underline-offset: 2px; text-decoration-thickness: 1px; }
a:hover { color: var(--accent-hover); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }

/* ------------------------------------------------------------- rail ------- */

#sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--rail);
  padding: 2.75rem 1.5rem;
  border-right: 1px solid var(--border);
  background: var(--surface);
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
  z-index: 10;
}
#sidebar .inner { display: flex; flex-direction: column; gap: 1.5rem; }
#sidebar nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.15rem; }
#sidebar nav a {
  display: flex;
  align-items: center;
  min-height: 44px;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-faint);
  text-decoration: none;
  padding: 0 0.6rem;
  border-left: 2px solid transparent;
}
#sidebar nav a:hover { color: var(--text); background: var(--surface-sunk); }
#sidebar nav a.active { color: var(--text); border-left-color: var(--accent); }


/* the logo is dark artwork on transparent; invert it so it survives dark mode */
#sidebar img { max-width: 160px; height: auto; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) #sidebar img { filter: invert(1) hue-rotate(180deg) brightness(1.15); }
}
:root[data-theme="dark"] #sidebar img { filter: invert(1) hue-rotate(180deg) brightness(1.15); }

#wrapper { margin-left: var(--rail); padding-inline: clamp(24px, 5vw, 72px); }

/* --------------------------------------------------------- sections ------- */

section.wrapper { padding-block: 4.5rem; border-bottom: 1px solid var(--border-soft); }
section.wrapper > .inner { max-width: 940px; }
section.wrapper.fullscreen { padding-top: 5.5rem; }

h2 {
  margin: 0 0 1rem;
  font-family: var(--font-read);
  font-size: clamp(1.55rem, 3.4vw, 2.05rem);
  font-weight: 600;
  line-height: 1.18;
  letter-spacing: -0.02em;
  color: var(--text);
  text-wrap: balance;
}
h3 {
  margin: 0 0 0.4rem;
  font-family: var(--font-ui);
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.005em;
  color: var(--text);
}
p { margin: 0 0 1.1rem; max-width: var(--measure); }

/* hero */
#intro h1, #intro h2 {
  font-size: clamp(2.1rem, 6vw, 3.4rem);
  font-weight: 600;
  line-height: 1.08;
  letter-spacing: -0.03em;
  margin-bottom: 1.25rem;
}
#intro > .inner > p:first-of-type {
  font-size: 1.1875rem;
  line-height: 1.55;
  color: var(--text);
  max-width: 58ch;
}
#intro .eyebrow {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: 1rem;
}

/* the signalling path under the hero — the one piece of real ornament */
@media (prefers-reduced-motion: no-preference) {
  @keyframes travel {
    0%   { transform: translateX(0);     opacity: 0; }
    6%   { opacity: 1; }
    94%  { opacity: 1; }
    100% { transform: translateX(412px); opacity: 0; }
  }
}

/* buttons */
ul.actions { list-style: none; margin: 1.6rem 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.6rem; }
ul.actions a, .button {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 1.1rem;
  font-family: var(--font-ui);
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid var(--border);
  border-radius: 3px;
  color: var(--text);
  background: var(--surface-2);
}
ul.actions a:hover, .button:hover { border-color: var(--text-faint); color: var(--text); }
ul.actions li:first-child a, .button.primary {
  background: var(--accent); border-color: var(--accent); color: var(--surface-2);
}
ul.actions li:first-child a:hover, .button.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }

/* spotlights — stacked prose blocks, not cards */
.spotlights > .content,
section.wrapper .content {
  padding-block: 1.9rem;
  border-top: 1px solid var(--border-soft);
}
.spotlights > .content:first-child { border-top: 0; }
section.wrapper .content ul:not(.actions):not(.icons):not(.contact) {
  margin: 0 0 1rem; padding-left: 1.15rem; max-width: var(--measure);
}
section.wrapper .content li { margin-bottom: 0.3rem; }
section.wrapper .content li::marker { color: var(--text-faint); }

/* capability grid */
.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1px;
  margin-top: 2rem;
  background: var(--border-soft);
  border: 1px solid var(--border-soft);
}
.features > section, .features > div {
  background: var(--surface);
  padding: 1.5rem 1.4rem;
  min-width: 0;
}
.features h3 { margin-bottom: 0.3rem; }
.features p { font-size: 0.9375rem; color: var(--text-faint); margin: 0; max-width: none; }
.features .glyph { display: block; margin-bottom: 0.9rem; color: var(--accent); }
.features .glyph svg { width: 26px; height: 26px; stroke: currentColor; fill: none;
  stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.features > :nth-child(1) .glyph { color: var(--c-containers); }
.features > :nth-child(2) .glyph { color: var(--c-monitoring); }
.features > :nth-child(3) .glyph { color: var(--c-telecom); }
.features > :nth-child(4) .glyph { color: var(--c-devops); }
.features > :nth-child(5) .glyph { color: var(--c-security); }
.features > :nth-child(6) .glyph { color: var(--c-infra); }

/* form — label above the field, 44px controls, per the UX thresholds */
.split { display: grid; grid-template-columns: minmax(0,1.3fr) minmax(0,1fr); gap: 2.5rem 3rem; margin-top: 1.75rem; }
.fields { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 1rem; }
.field { display: flex; flex-direction: column; gap: 0.35rem; min-width: 0; }
.field:not(.half) { grid-column: 1 / -1; }
.field label {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-faint);
}
.field input[type="text"],
.field input[type="email"],
.field textarea {
  width: 100%;
  min-height: 44px;
  padding: 0.55rem 0.7rem;
  font-family: var(--font-ui);
  font-size: 0.9375rem;
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 3px;
}
.field textarea { min-height: 120px; resize: vertical; line-height: 1.5; }
.field input:focus, .field textarea:focus { border-color: var(--accent); outline-offset: 1px; }
button.button { font-family: var(--font-ui); cursor: pointer; }

/* contact */
ul.icons a.icon-link { font-family: var(--font-ui); font-weight: 500; }
ul.contact, ul.icons { list-style: none; margin: 1.2rem 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.5rem 1.6rem; }
ul.contact { flex-direction: column; gap: 0.9rem; }
ul.contact li, ul.icons li { font-family: var(--font-ui); font-size: 0.9375rem; }
ul.icons { gap: 0.5rem 1.4rem; }
ul.contact a, ul.icons a { text-decoration: none; }
ul.contact a:hover, ul.icons a:hover { text-decoration: underline; }
.contact-key {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: 0.15rem;
}

/* footer */
#footer {
  margin-left: var(--rail);
  padding: 2.5rem clamp(24px, 5vw, 72px) 4rem;
  border-top: 1px solid var(--border-soft);
}
#footer .inner { max-width: 940px; }
#footer ul.menu { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.4rem 1.2rem;
  font-family: var(--font-mono); font-size: 0.72rem; color: var(--text-faint); }

/* ------------------------------------------------------------ phone ------- */

@media (max-width: 860px) {
  .split { grid-template-columns: minmax(0,1fr); gap: 2rem; }
  .fields { grid-template-columns: minmax(0,1fr); }
  .field.half { grid-column: 1 / -1; }
  #sidebar {
    position: static; width: auto; inset: auto;
    border-right: 0; border-bottom: 1px solid var(--border);
    padding: 1.5rem clamp(16px, 5vw, 24px);
    gap: 1rem;
  }
  #sidebar nav ul { flex-direction: row; flex-wrap: wrap; gap: 0.3rem; }
  #sidebar nav a { border-left: 0; border-bottom: 2px solid transparent; padding: 0 0.5rem; }
  #sidebar nav a.active { border-left-color: transparent; border-bottom-color: var(--accent); }
  #wrapper { margin-left: 0; padding-inline: clamp(16px, 5vw, 24px); }
  #footer { margin-left: 0; padding-inline: clamp(16px, 5vw, 24px); }
  section.wrapper { padding-block: 3rem; }
  section.wrapper.fullscreen { padding-top: 3rem; }
}

/* ----------------------------------------------------------- theme toggle -- */
.theme-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; flex: 0 0 auto;
  background: transparent; border: 1px solid var(--border);
  border-radius: 3px; color: var(--text-faint); cursor: pointer; padding: 0;
}
.theme-toggle:hover { color: var(--text); border-color: var(--text-faint); }
.theme-toggle svg { width: 17px; height: 17px; stroke: currentColor; fill: none;
  stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.theme-toggle .i-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .i-sun { display: block; }
:root[data-theme="dark"] .theme-toggle .i-moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .i-sun { display: block; }
  :root:not([data-theme="light"]) .theme-toggle .i-moon { display: none; }
  :root[data-theme="light"] .theme-toggle .i-sun { display: none; }
  :root[data-theme="light"] .theme-toggle .i-moon { display: block; }
}


/* ---- identity: mono-led headings -------------------------------------------
   The personal site and the consultancy site were sharing one type system and
   one accent, so they read as the same brand. This site now leads with the
   mono face and an amber accent; the consultancy keeps the editorial serif and
   the indigo. Figures are tabular so commit counts line up in a column. */
h1, h2, h3, h4,
.eyebrow, .t-name, .work-role, .work-metric, .theme-toggle {
  font-family: 'IBM Plex Mono', ui-monospace, 'SF Mono', Menlo, monospace;
  letter-spacing: -0.015em;
}
.eyebrow, .work-role { letter-spacing: 0.08em; text-transform: uppercase; }
.work-metric, .stat, table td, table th { font-variant-numeric: tabular-nums; }

/* ---- selected work ---------------------------------------------------------
   A record, not a card grid: each entry is a rule-separated row so nine of them
   read as one list rather than nine competing objects. The role badge is the
   point of the section - authored / contributed / operated - so it is the only
   coloured thing in the row. */
.work { display: flex; flex-direction: column; gap: 0; }

.work-row {
  padding-block: 1.6rem;
  border-top: 1px solid var(--border, #E2E1DE);
}
.work-row:last-child { border-bottom: 1px solid var(--border, #E2E1DE); }

.work-row > header {
  display: flex; align-items: baseline; gap: 0.75rem 1rem; flex-wrap: wrap;
  margin-bottom: 0.35rem;
}
.work-row h3 { margin: 0; font-size: 1.05rem; }

.work-role {
  font-size: 0.7rem; line-height: 1.6;
  padding: 0.1rem 0.5rem; border-radius: 2px;
  border: 1px solid currentColor; white-space: nowrap;
  color: var(--text-faint, #62676E);
}
/* only "authored" gets the accent; the other two must not look like a lesser
   version of it, because operating something is a different claim, not a weaker one */
.work-role--authored   { color: var(--accent, #8A5A1E); }
.work-role--contributed{ color: var(--text-muted, #3C4046); }
.work-role--operated   { color: var(--text-faint, #62676E); }

.work-metric {
  font-family: 'IBM Plex Mono', ui-monospace, Menlo, monospace;
  font-variant-numeric: tabular-nums;
  font-size: 0.82rem; color: var(--text-faint, #62676E);
  margin: 0 0 0.5rem;
}
.work-row > p:not(.work-metric) { margin: 0; max-width: 68ch; }

.work-links {
  list-style: none; margin: 0.7rem 0 0; padding: 0;
  display: flex; flex-wrap: wrap; gap: 0.3rem 1.1rem;
  font-size: 0.85rem;
}
.work-links li { margin: 0; }
.work-links li + li { position: relative; }
.work-links li + li::before {
  content: ''; position: absolute; left: -0.6rem; top: 0.45em;
  width: 1px; height: 0.9em; background: var(--border, #E2E1DE);
}

/* ---- contact --------------------------------------------------------------- */
.contact-list { list-style: none; margin: 1.2rem 0 0; padding: 0; }
.contact-list li {
  display: flex; align-items: baseline; gap: 0.8rem;
  padding-block: 0.45rem;
  border-top: 1px solid var(--border-soft, #EDECE9);
}
.contact-list li:first-child { border-top: 0; }
.contact-list .work-role { min-width: 5.5rem; text-align: center; }

/* ---- sidebar identity ------------------------------------------------------
   .t-name and .t-what are separate blocks, so the 0px gap between them that the
   first pass shipped had to be set explicitly rather than inherited. */
.t-name { display: block; font-weight: 600; letter-spacing: -0.02em; }
.t-what {
  display: block; margin-top: 0.3rem; margin-bottom: 1.25rem;
  font-size: 0.8rem; color: var(--text-faint, #62676E);
}

@media (max-width: 480px) {
  .work-row > header { gap: 0.3rem 0.75rem; }
  .contact-list li { flex-wrap: wrap; }
}

/* ---- earlier work ----------------------------------------------------------
   Visually distinct from .work-row on purpose. Those entries carry commit
   counts because the repositories exist; none of this does. So: no role badges,
   a date rail instead of a metric line, and bulleted items rather than a single
   claim. The reader should be able to see that these are two different kinds of
   evidence without being told. */
.eras { display: flex; flex-direction: column; gap: 2.2rem; margin-top: 2rem; }

.era { display: grid; grid-template-columns: 9rem 1fr; gap: 0 1.8rem; }
.era > header { display: contents; }

.era-when {
  grid-column: 1; grid-row: 1 / span 2;
  font-family: 'IBM Plex Mono', ui-monospace, Menlo, monospace;
  font-variant-numeric: tabular-nums;
  font-size: 0.78rem; letter-spacing: 0.02em;
  color: var(--text-faint, #62676E);
  padding-top: 0.3rem;
  border-right: 1px solid var(--border, #E2E1DE);
}
.era h3 { grid-column: 2; margin: 0 0 0.1rem; font-size: 1rem; }
.era-role {
  grid-column: 2; font-size: 0.8rem; color: var(--text-faint, #62676E);
  margin-bottom: 0.6rem;
}
.era ul {
  grid-column: 2; margin: 0; padding-left: 1.05rem;
  max-width: 68ch;
}
.era li { margin: 0 0 0.45rem; }

.era-creds {
  margin-top: 2.4rem; padding-top: 1.2rem;
  border-top: 1px solid var(--border-soft, #EDECE9);
  font-size: 0.86rem; color: var(--text-muted, #3C4046);
}

@media (max-width: 736px) {
  /* the date rail becomes a label above the entry rather than a squeezed column */
  .era { grid-template-columns: 1fr; gap: 0; }
  .era-when {
    grid-column: 1; grid-row: auto;
    border-right: 0; padding-top: 0; margin-bottom: 0.35rem;
  }
  .era h3, .era-role, .era ul { grid-column: 1; }
}
