@font-face {
  font-family: "Space Grotesk";
  src: url("/fonts/space-grotesk.woff") format("woff");
  font-weight: 300 700;
  font-style: normal;
  font-display: swap;
}

/* flude.io brand: ink, signal orange, slate, paper */
:root {
  --bg: #f6f7f9;
  --card: #ffffff;
  --ink: #12141a;
  --muted: #555b66;
  --slate: #6b7280;
  --line: #e1e4ea;
  --signal: #ff5a1f;
  --accent: #c2410c;
  --accent-ink: #ffffff;
  --btn: #ff5a1f;
  --btn-ink: #12141a;
  --measure: 44rem;
  --wide: 66rem;
  --display: "Space Grotesk", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #12141a;
    --card: #1a1d24;
    --ink: #f2f3f5;
    --muted: #a3a9b4;
    --slate: #a3a9b4;
    --line: #2b2f38;
    --accent: #ff7a45;
    --accent-ink: #12141a;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 1.0625rem/1.65 var(--sans);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
main { flex: 1; padding-block: 3rem 4rem; }
.wrap { width: 100%; max-width: var(--wide); margin-inline: auto; padding-inline: 1.25rem; }

a { color: var(--accent); text-underline-offset: 0.18em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--signal); outline-offset: 3px; border-radius: 2px; }

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

/* header */
.site-header { border-bottom: 1px solid var(--line); }
.bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.5rem 2rem; padding-block: 1rem; }
.brand { display: inline-flex; align-items: center; gap: 0.6rem; font: 700 1.6rem/1 var(--display); color: var(--ink); text-decoration: none; letter-spacing: -0.045em; }
.brand svg { flex: none; width: 2.25rem; height: 2.25rem; }
.brand .mk-bg { fill: var(--ink); }
.brand .mk-fg { fill: var(--bg); }
.brand .mk-sl { stroke: var(--bg); stroke-width: 4.5; }
.brand .mk-dot, .brand .dot { fill: var(--signal); color: var(--signal); }
.brand .io { font-weight: 400; color: var(--slate); }
nav { display: flex; flex-wrap: wrap; gap: 0.25rem 1.5rem; }
nav a { font-family: var(--display); font-weight: 500; color: var(--muted); text-decoration: none; padding-block: 0.25rem; border-bottom: 2px solid transparent; font-size: 0.97rem; }
nav a:hover, nav a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--signal); }

/* footer */
.site-footer { border-top: 1px solid var(--line); color: var(--muted); font-size: 0.92rem; }
.foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.5rem 1.5rem; padding-block: 1.5rem; }
.site-footer a { color: var(--muted); }

/* type */
h1, h2, h3 { font-family: var(--display); font-weight: 700; line-height: 1.12; letter-spacing: -0.03em; margin: 0; }
h1 { font-size: clamp(2.1rem, 5vw, 3.1rem); }
h2 { font-size: clamp(1.5rem, 3vw, 1.85rem); }
h3 { font-size: 1.25rem; }

/* prose pages */
.prose { max-width: var(--measure); }
.prose h1 { margin-bottom: 1.5rem; }
.prose h2 { margin: 2.75rem 0 1rem; }
.prose h3 { margin: 2rem 0 0.6rem; }
.prose p, .prose ul, .prose ol, .prose blockquote { margin: 0 0 1.15rem; }
.prose ul, .prose ol { padding-left: 1.25rem; }
.prose li { margin-bottom: 0.55rem; }
.prose li::marker { color: var(--signal); }
.prose blockquote { border-left: 3px solid var(--signal); padding: 0.2rem 0 0.2rem 1.1rem; color: var(--muted); }
.prose code { background: var(--card); border: 1px solid var(--line); border-radius: 4px; padding: 0.1em 0.35em; font-size: 0.92em; }
.crumb { margin: 0 0 1.25rem; font-size: 0.95rem; }
.meta { color: var(--muted); margin: -0.75rem 0 2rem !important; font-size: 0.95rem; }
.cta { margin-top: 2.5rem !important; }

/* buttons */
.btn {
  display: inline-block; background: var(--btn); color: var(--btn-ink);
  padding: 0.7rem 1.3rem; border-radius: 8px; font: 600 1rem/1.4 var(--display); text-decoration: none;
  border: 2px solid var(--btn); cursor: pointer; transition: background-color 0.15s, color 0.15s, border-color 0.15s;
}
.btn:hover { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--ink); }
.btn.ghost:hover { background: var(--ink); color: var(--bg); }

/* home */
.hero { max-width: 52rem; padding-block: 1.5rem 3.5rem; }
.eyebrow { font-family: var(--display); color: var(--accent); font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; font-size: 0.85rem; margin: 0 0 1rem; }
.hero h1 { margin-bottom: 1.5rem; }
.lede { font-size: 1.25rem; color: var(--muted); max-width: 40rem; }
.lede p { margin: 0 0 1.75rem; }
.hero-split { max-width: none; display: grid; grid-template-columns: minmax(0, 1fr) 17rem; gap: 2.5rem 3.5rem; align-items: center; }
.hero-text { max-width: 40rem; }
.headshot { display: block; width: 100%; height: auto; aspect-ratio: 4 / 5; object-fit: cover; border-radius: 12px; border: 1px solid var(--line); }
.actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin: 0; }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr)); gap: 1.25rem; margin-bottom: 4rem; }
.card { display: block; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 1.6rem; color: var(--ink); text-decoration: none; transition: border-color 0.15s, transform 0.15s; }
.card:hover { border-color: var(--signal); transform: translateY(-2px); }
.card h2 { font-size: 1.4rem; margin-bottom: 0.6rem; }
.card p { color: var(--muted); margin: 0 0 1rem; }
.card .more { font-family: var(--display); color: var(--accent); font-weight: 600; }
.latest h2 { margin-bottom: 1rem; }

/* post lists */
.post-list { list-style: none; padding: 0 !important; margin: 0; }
.post-list li { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.25rem 1.5rem; padding: 0.9rem 0; border-top: 1px solid var(--line); margin: 0; }
.post-list li:last-child { border-bottom: 1px solid var(--line); }
.post-list a { font-family: var(--display); font-weight: 600; letter-spacing: -0.01em; }
.post-list time { color: var(--muted); font-size: 0.93rem; }
.post-list.big li { display: block; padding: 1.4rem 0; }
.post-list.big a { font: 700 1.35rem/1.25 var(--display); }
.post-list.big time { display: block; margin: 0.25rem 0 0.4rem; }
.post-list.big p { margin: 0; color: var(--muted); }
.tag { font: 600 0.7rem/1 var(--display); text-transform: uppercase; letter-spacing: 0.06em; background: var(--line); color: var(--muted); padding: 0.25rem 0.5rem; border-radius: 4px; vertical-align: middle; }

/* form */
.form { max-width: 34rem; margin-top: 2rem; }
.form p { margin: 0 0 1.1rem; }
.form label { display: block; font-weight: 600; margin-bottom: 0.35rem; }
.form .opt { font-weight: 400; color: var(--muted); }
.form input, .form textarea { width: 100%; padding: 0.7rem 0.8rem; font: inherit; color: var(--ink); background: var(--card); border: 1px solid var(--line); border-radius: 6px; }
.form input:focus, .form textarea:focus { border-color: var(--signal); }
.hp { position: absolute; left: -9999px; }

.sub { margin: -2.5rem 0 3.5rem; color: var(--muted); }
.testimonial { margin: 2.75rem 0 0; padding: 0; }
.testimonial blockquote, .prose .testimonial blockquote { margin: 0; border-left: 3px solid var(--signal); padding: 0.2rem 0 0.2rem 1.25rem; color: var(--ink); font: 400 1.2rem/1.55 var(--display); letter-spacing: -0.01em; }
.testimonial blockquote p, .prose .testimonial blockquote p { margin: 0; }
.testimonial figcaption { margin: 0.9rem 0 0 1.5rem; color: var(--muted); font-size: 0.95rem; }
.home-quote { max-width: var(--measure); margin-top: 0; }
.bio { display: flex; gap: 1.5rem; align-items: center; margin: 0 0 1.15rem; }
.bio img { flex: none; width: 7.5rem; height: auto; aspect-ratio: 4 / 5; object-fit: cover; border-radius: 10px; border: 1px solid var(--line); }
.bio p { margin: 0 !important; }

@media (max-width: 760px) {
  .hero-split { grid-template-columns: 1fr; }
  .headshot { order: -1; max-width: 12rem; }
}
@media (max-width: 480px) {
  .bio { flex-direction: column; align-items: flex-start; }
}
@media (max-width: 560px) {
  body { font-size: 1rem; }
  main { padding-block: 2rem 3rem; }
}

/* service picker: cutout portrait with per-service backdrop (CSS only) */
:root {
  --svc-a: #ff5a1f; --on-a: #12141a; --txt-a: #c2410c;
  --svc-f: #12141a; --on-f: #ffffff; --txt-f: #12141a;
  --svc-v: #6b7280; --on-v: #ffffff; --txt-v: #4b5262;
}
@media (prefers-color-scheme: dark) {
  :root {
    --svc-f: #f2f3f5; --on-f: #12141a; --txt-f: #f2f3f5;
    --svc-v: #a3a9b4; --on-v: #12141a; --txt-v: #c3c8d1;
    --txt-a: #ff7a45;
  }
}
.picker { display: grid; grid-template-columns: minmax(0, 15rem) 1fr; gap: 1.5rem 2.25rem; align-items: center; margin: 2.25rem 0; padding: 1.5rem; background: var(--card); border: 1px solid var(--line); border-radius: 14px; --tint: var(--svc-a); --tint-txt: var(--txt-a); }
.picker:has(input[id=p-a]:checked) { --tint: var(--svc-a); --tint-txt: var(--txt-a); }
.picker:has(input[id=p-f]:checked) { --tint: var(--svc-f); --tint-txt: var(--txt-f); }
.picker:has(input[id=p-v]:checked) { --tint: var(--svc-v); --tint-txt: var(--txt-v); }
.picker.picker:has(label[for=p-a]:hover) { --tint: var(--svc-a); --tint-txt: var(--txt-a); }
.picker.picker:has(label[for=p-f]:hover) { --tint: var(--svc-f); --tint-txt: var(--txt-f); }
.picker.picker:has(label[for=p-v]:hover) { --tint: var(--svc-v); --tint-txt: var(--txt-v); }
.picker .stage { position: relative; aspect-ratio: 4 / 5; border-radius: 999px 999px 14px 14px; overflow: hidden; background: var(--tint); transition: background-color 0.35s ease; }
.picker .stage::before { content: ""; position: absolute; left: -25%; right: -25%; bottom: -35%; height: 75%; border-radius: 50%; background: rgba(255, 255, 255, 0.16); }
.picker .stage img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 100%; }
.picker fieldset { border: 0; margin: 0 0 1rem; padding: 0; min-width: 0; }
.picker legend { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.picker input[type=radio] { position: absolute; width: 1px; height: 1px; opacity: 0; }
.picker .opts { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.picker label { font-family: var(--display); cursor: pointer; padding: 0.45rem 0.95rem; border: 1px solid var(--line); border-radius: 999px; font-weight: 600; font-size: 0.95rem; background: var(--bg); color: var(--ink); transition: background-color 0.2s, color 0.2s, border-color 0.2s; }
.picker label[for=p-a]:hover { border-color: var(--svc-a); }
.picker label[for=p-f]:hover { border-color: var(--svc-f); }
.picker label[for=p-v]:hover { border-color: var(--svc-v); }
.picker:has(input[id=p-a]:checked) label[for=p-a] { background: var(--svc-a); border-color: var(--svc-a); color: var(--on-a); }
.picker:has(input[id=p-f]:checked) label[for=p-f] { background: var(--svc-f); border-color: var(--svc-f); color: var(--on-f); }
.picker:has(input[id=p-v]:checked) label[for=p-v] { background: var(--svc-v); border-color: var(--svc-v); color: var(--on-v); }
.picker:has(input:focus-visible) label[for] { outline-offset: 2px; }
.picker:has(input[id=p-a]:focus-visible) label[for=p-a],
.picker:has(input[id=p-f]:focus-visible) label[for=p-f],
.picker:has(input[id=p-v]:focus-visible) label[for=p-v] { outline: 3px solid var(--tint); }
.picker .caps { display: grid; }
.picker .cap { grid-area: 1 / 1; opacity: 0; visibility: hidden; transition: opacity 0.25s ease; }
.picker .cap p { margin: 0 0 0.75rem; }
.picker .cap a { font-weight: 700; color: var(--tint-txt); }
.picker:has(input[id=p-a]:checked) .cap-a,
.picker:has(input[id=p-f]:checked) .cap-f,
.picker:has(input[id=p-v]:checked) .cap-v { opacity: 1; visibility: visible; }
.picker.picker.picker:has(label:hover) .cap { opacity: 0; visibility: hidden; }
.picker.picker.picker:has(label[for=p-a]:hover) .cap-a,
.picker.picker.picker:has(label[for=p-f]:hover) .cap-f,
.picker.picker.picker:has(label[for=p-v]:hover) .cap-v { opacity: 1; visibility: visible; }
@media (max-width: 40rem) {
  .picker { grid-template-columns: 1fr; justify-items: center; }
  .picker .stage { width: 100%; max-width: 14rem; }
  .picker .controls { width: 100%; }
}
@keyframes picker-pulse {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--tint) 38%, transparent); }
  70%, 100% { box-shadow: 0 0 0 16px color-mix(in srgb, var(--tint) 0%, transparent); }
}
.picker .stage { animation: picker-pulse 4.5s ease-out infinite; }
@media (prefers-reduced-motion: reduce) {
  .picker .stage, .picker label, .picker .cap { transition: none; animation: none; }
}

/* Easter egg: link to /1998/ hidden in the home page lede */
.egg { color: inherit; text-decoration: none; }
.egg:hover, .egg:focus-visible { text-decoration: underline dotted; text-underline-offset: 0.18em; }

/* About page: photo steps out of its frame on hover, tap or focus */
.pop { position: relative; flex: none; width: 7.5rem; aspect-ratio: 4 / 5; border-radius: 10px; cursor: default; }
.pop::before { content: ""; position: absolute; inset: 0; border-radius: 10px; border: 1px solid var(--line); background: var(--svc-a); }
.bio .pop img { position: absolute; inset: 0; width: 100%; height: 100%; aspect-ratio: auto; border: 0; border-radius: 0; object-fit: cover; }
.bio .pop .pop-photo { z-index: 1; border: 1px solid var(--line); border-radius: 10px; transition: opacity 0.3s ease; }
.pop-clip { position: absolute; inset: 0; z-index: 2; clip-path: inset(-60% 0 0 0 round 0 0 10px 10px); pointer-events: none; }
.bio .pop .pop-cut { object-position: 50% 100%; opacity: 0; transform-origin: 50% 100%; transition: transform 0.45s cubic-bezier(0.2, 0.9, 0.3, 1.25), opacity 0.25s ease; }
.pop:hover .pop-photo, .pop:focus .pop-photo { opacity: 0; }
.pop:hover .pop-cut, .pop:focus .pop-cut { opacity: 1; transform: scale(1.2); }
@media (prefers-reduced-motion: reduce) {
  .bio .pop .pop-photo, .bio .pop .pop-cut { transition: none; }
  .pop:hover .pop-cut, .pop:focus .pop-cut { transform: none; }
}

/* Figures (inline SVG diagrams) */
.diagram { margin: 2rem 0; }
.diagram svg { display: block; width: 100%; max-width: 30rem; height: auto; margin-inline: auto; font-family: var(--display); }
.diagram figcaption { margin-top: 0.75rem; text-align: center; color: var(--muted); font-size: 0.95rem; }
.diagram .d-layer { fill: var(--card); stroke: var(--signal); stroke-width: 2; }
.diagram .d-top { fill: none; stroke: var(--muted); stroke-width: 2; stroke-dasharray: 6 5; }
.diagram .d-dot { fill: var(--signal); }
.diagram .d-num { fill: #12141a; font-size: 18px; font-weight: 700; text-anchor: middle; }
.diagram .d-title { fill: var(--ink); font-size: 19px; font-weight: 700; }
.diagram .d-sub { fill: var(--muted); font-size: 14px; }
.diagram .d-top-title { fill: var(--muted); font-size: 17px; font-weight: 700; text-anchor: middle; }
.diagram .d-top-sub { fill: var(--muted); font-size: 14px; text-anchor: middle; }
.diagram .d-arrow { fill: none; stroke: var(--signal); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* Thank-you page: the logo mark draws itself, then the message fades up */
.thanks-mark { display: block; width: 7rem; height: 7rem; margin: 0 0 1.5rem; }
.thanks-mark .tm-bg { fill: #12141a; stroke: var(--line); stroke-width: 1; }
.thanks-mark .tm-f { fill: #ffffff; opacity: 0; animation: tm-fade 0.4s ease 0.1s forwards; }
.thanks-mark .tm-sl { stroke: #ffffff; stroke-width: 4.5; fill: none; stroke-dasharray: 1; stroke-dashoffset: 1; animation: tm-draw 0.7s cubic-bezier(0.6, 0, 0.2, 1) 0.4s forwards; }
.thanks-mark .tm-dot { fill: #ff5a1f; transform-box: fill-box; transform-origin: 50% 100%; opacity: 0; animation: tm-drop 0.7s cubic-bezier(0.3, 1.4, 0.5, 1) 1s forwards; }
.thanks-msg { opacity: 0; animation: tm-fade 0.6s ease 1.5s forwards; }
@keyframes tm-fade { to { opacity: 1; } }
@keyframes tm-draw { to { stroke-dashoffset: 0; } }
@keyframes tm-drop { 0% { opacity: 0; transform: translateY(-2.5rem) scale(0.8, 1.2); } 55% { opacity: 1; transform: translateY(0) scale(1.35, 0.7); } 80% { transform: translateY(-0.4rem) scale(0.95, 1.05); } 100% { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  .thanks-mark .tm-f, .thanks-mark .tm-dot, .thanks-msg { animation: none; opacity: 1; }
  .thanks-mark .tm-sl { animation: none; stroke-dashoffset: 0; }
}

/* Thank-you page confetti layer (see /js/thanks.js) */
.confetti { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 20; display: none; }
.confetti.on { display: block; }

/* Photography page: 1988 self-portrait diptych; each photo fades to the other on hover, tap or focus */
.duo { margin: 2rem 0 2.5rem; }
.duo-grid { display: grid; grid-template-columns: 654fr 1503fr; gap: 0.75rem; align-items: start; }
.swap { position: relative; overflow: hidden; border: 1px solid var(--line); border-radius: 10px; background: var(--ink); cursor: default; }
.swap-bw { aspect-ratio: 1200 / 1836; }
.swap-colour { aspect-ratio: 1800 / 1198; }
.swap img { position: absolute; inset: 0; width: 100%; height: 100%; display: block; object-fit: cover; transition: opacity 0.4s ease; }
.swap .alt { opacity: 0; }
.swap-bw .alt { object-position: 14% 50%; }
.swap-colour .alt { object-position: 50% 12%; }
.swap:hover .main, .swap:focus .main { opacity: 0; }
.swap:hover .alt, .swap:focus .alt { opacity: 1; }
.swap:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.duo figcaption { margin-top: 0.75rem; color: var(--muted); font-size: 0.95rem; }
@media (prefers-reduced-motion: reduce) {
  .swap img { transition: none; }
}

.cred-badge { margin: 0 0 1.15rem; }
.cred-badge img { display: block; width: 7.5rem; height: auto; }

/* Salary spread chart (inline SVG, reuses .diagram) */
.diagram .r-axis { stroke: var(--slate); stroke-width: 1.5; }
.diagram .r-tick { stroke: var(--slate); stroke-width: 1.5; }
.diagram .r-tick-label { fill: var(--slate); font-size: 12px; text-anchor: middle; }
.diagram .r-range { fill: var(--signal); stroke: none; }
.diagram .r-mid { stroke: var(--ink); stroke-width: 4; stroke-linecap: round; }
.diagram .r-guide { stroke: var(--ink); stroke-width: 1.5; stroke-dasharray: 4 4; }
.diagram .r-dot { fill: var(--ink); stroke: var(--signal); stroke-width: 3; }
.diagram .r-label { fill: var(--ink); font-size: 13px; font-weight: 700; text-anchor: middle; }
.diagram .r-sub { fill: var(--slate); font-size: 12px; text-anchor: middle; }
.diagram .r-exp { fill: var(--ink); font-size: 13px; font-weight: 700; text-anchor: end; }
.diagram .r-title { fill: var(--slate); font-size: 12px; font-weight: 700; text-anchor: start; letter-spacing: 0.04em; text-transform: uppercase; }
.diagram .r-note { fill: var(--ink); font-size: 13px; font-weight: 700; text-anchor: start; }
