@font-face {
  font-family: "Source Sans 3";
  src: url("../fonts/source-sans-3.woff2") format("woff2");
  font-weight: 200 900;
  font-display: swap;
}

@font-face {
  font-family: "Caveat";
  src: url("../fonts/caveat.woff2") format("woff2");
  font-weight: 400 700;
  font-display: swap;
}

:root {
  --font-sans: "Source Sans 3", system-ui, sans-serif;
  --header-height: 72px;
  --bg: #f5f7f7;
  --surface: #ffffff;
  --ink: #182629;
  --muted: #526369;
  --accent: #006b70;
  --accent-hover: #00565b;
  --on-accent: #ffffff;
  --border: #72858a;
  --divider: #d8e1e2;
  --focus: #006b70;
  --error: #b42318;
  --cyan: #087f8c;
  --pencil-cyan: #2dd2e4;
  --pencil-magenta: #e144bc;
  --pencil-yellow: #f2c230;
  /* Sketch surfaces: decorative only, never text colours. */
  --sketch-face: rgb(255 255 255 / 95%);
  --sketch-line: rgb(24 38 41 / 72%);
  --paper-opacity: 0.4;
  --pencil-line-img: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 400 8' preserveAspectRatio='none'%3E%3Cg fill='none' stroke='%23526369' stroke-linecap='round'%3E%3Cpath d='M1 4.5 Q100 2 200 4 T399 3.5' stroke-width='1.3' stroke-opacity='.6'/%3E%3Cpath d='M3 6 Q120 4 240 5.5 T396 5' stroke-width='.6' stroke-opacity='.35'/%3E%3C/g%3E%3C/svg%3E");
  --scribble-cyan: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 60 10'%3E%3Cg fill='none' stroke='%232dd2e4' stroke-linecap='round'%3E%3Cpath d='M2 6 Q15 2 30 5 T58 4' stroke-width='3' stroke-opacity='.8'/%3E%3Cpath d='M6 8 Q22 5 38 7 T56 6' stroke-width='1.2'/%3E%3C/g%3E%3C/svg%3E");
  --scribble-magenta: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 60 10'%3E%3Cg fill='none' stroke='%23e144bc' stroke-linecap='round'%3E%3Cpath d='M2 5 Q18 2 32 5 T58 5' stroke-width='3' stroke-opacity='.75'/%3E%3Cpath d='M5 8 Q20 6 36 7 T55 7' stroke-width='1.2'/%3E%3C/g%3E%3C/svg%3E");
  --scribble-yellow: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 60 10'%3E%3Cg fill='none' stroke='%23f2c230' stroke-linecap='round'%3E%3Cpath d='M2 6 Q16 3 30 6 T58 4' stroke-width='3.4' stroke-opacity='.9'/%3E%3Cpath d='M6 8 Q24 5 40 7 T56 6' stroke-width='1.2'/%3E%3C/g%3E%3C/svg%3E");
  color-scheme: light;
}

html[data-theme="dark"] {
  --bg: #10191c;
  --surface: #18262a;
  --ink: #eef5f5;
  --muted: #adc0c5;
  --accent: #75d9d1;
  --accent-hover: #9be8e2;
  --on-accent: #102326;
  --border: #68858d;
  --divider: #34474d;
  --focus: #75d9d1;
  --error: #ffb4a9;
  --cyan: #73cedc;
  --sketch-face: var(--surface);
  --sketch-line: rgb(238 245 245 / 55%);
  --paper-opacity: 0.05;
  --pencil-line-img: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 400 8' preserveAspectRatio='none'%3E%3Cg fill='none' stroke='%23adc0c5' stroke-linecap='round'%3E%3Cpath d='M1 4.5 Q100 2 200 4 T399 3.5' stroke-width='1.3' stroke-opacity='.5'/%3E%3Cpath d='M3 6 Q120 4 240 5.5 T396 5' stroke-width='.6' stroke-opacity='.3'/%3E%3C/g%3E%3C/svg%3E");
  color-scheme: dark;
}

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

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  font: 1rem/1.5 var(--font-sans);
  color: var(--ink);
  background: var(--bg);
  overflow-wrap: anywhere;
}
/* Brand paper grain; purely decorative and behind all content. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: url("../images/brand/paper.webp") 0 0 / 600px repeat;
  opacity: var(--paper-opacity);
}
html[data-theme="dark"] body::before {
  filter: invert(1);
}
.svg-defs {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

img {
  max-width: 100%;
  height: auto;
}
svg {
  max-width: 100%;
}
p {
  margin: 0 0 16px;
  max-width: 65ch;
}
ul,
ol {
  padding-left: 24px;
}
a {
  color: var(--accent);
  text-underline-offset: 4px;
}
a:hover {
  color: var(--accent-hover);
}
button,
input,
textarea {
  font: inherit;
}
button,
summary {
  cursor: pointer;
}
button:disabled {
  cursor: not-allowed;
  color: var(--muted);
  background: var(--surface);
}

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

[id],
a,
button,
input,
textarea,
summary {
  scroll-margin-top: calc(var(--header-offset, var(--header-height)) + 16px);
  scroll-margin-bottom: 16px;
}

h1,
h2,
h3,
h4 {
  margin: 0 0 16px;
  font-weight: 650;
  letter-spacing: -0.025em;
  text-wrap: pretty;
}
h1 {
  font-size: clamp(2.375rem, 5.3vw, 4.75rem);
  line-height: 1.04;
  font-weight: 750;
  letter-spacing: -0.035em;
}
h2 {
  font-size: clamp(1.875rem, 3.2vw, 2.75rem);
  line-height: 1.15;
  max-width: 30ch;
  font-weight: 700;
  letter-spacing: -0.03em;
}
h3 {
  font-size: clamp(1.375rem, 2.2vw, 1.625rem);
  line-height: 1.2;
}
h4 {
  font-size: 1.125rem;
  line-height: 1.3;
  letter-spacing: 0;
}

.wrap {
  width: min(100% - 32px, 1200px);
  margin-inline: auto;
  min-width: 0;
}
.wrap :where(div, article, li, figure) {
  min-width: 0;
}

.skip {
  position: fixed;
  left: 16px;
  top: 8px;
  z-index: 100;
  padding: 12px 16px;
  background: var(--surface);
  transform: translateY(-180%);
}
.skip:focus {
  transform: none;
}

.site-header {
  position: relative;
  top: 0;
  z-index: 40;
  background: color-mix(in srgb, var(--bg) 84%, transparent);
  -webkit-backdrop-filter: saturate(1.2) blur(10px);
  backdrop-filter: saturate(1.2) blur(10px);
  border-bottom: 1px solid var(--divider);
}
.has-measured-header .site-header {
  position: sticky;
}
.header-inner {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: var(--header-height);
}
.wordmark {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  flex: none;
}
.wordmark img {
  display: block;
  width: 132px;
}
.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.nav {
  font-size: 1rem;
  line-height: 1.25;
}
.nav a {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 8px;
  color: var(--ink);
}
.desktop-nav {
  display: none;
}
.mobile-menu > summary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 64px;
  min-height: 44px;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 1rem;
  line-height: 1.25;
}
.mobile-menu > summary::after {
  content: "+";
}
.mobile-menu[open] > summary::after {
  content: "−";
}
.mobile-menu > summary::-webkit-details-marker {
  display: none;
}
.mobile-menu .nav {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  padding: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  max-height: calc(100dvh - var(--header-offset, var(--header-height)) - 16px);
  overflow-y: auto;
  box-shadow: 0 4px 16px rgb(0 0 0 / 6%);
}
.mobile-menu .nav a {
  padding: 12px;
}
.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 44px;
  height: 44px;
  padding: 8px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
}
.theme-toggle[aria-pressed="true"] {
  color: var(--accent);
  border-color: var(--accent);
}
.theme-toggle:hover,
summary:hover {
  color: var(--accent-hover);
}
.subpage-header {
  flex-wrap: wrap;
  padding-block: 8px;
}
.back-nav {
  margin-left: auto;
}
.back-nav a {
  font-size: 0.9375rem;
}

.kicker,
.label {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 0.875rem;
  font-weight: 650;
  line-height: 1.4;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.kicker {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
}
.kicker-num {
  position: relative;
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 2.2em;
  height: 2em;
  color: var(--ink);
  font: 600 1.5rem/1 "Caveat", var(--font-sans);
  letter-spacing: 0;
}
.pencil-circle {
  position: absolute;
  inset: -3px -5px;
  width: calc(100% + 10px);
  height: calc(100% + 6px);
  max-width: none;
  color: var(--pencil-magenta);
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  pointer-events: none;
  filter: url(#pencil-grain);
}
.pencil-circle path {
  vector-effect: non-scaling-stroke;
}
.pencil-circled {
  position: relative;
  display: inline-block;
  padding-inline: 0.15em;
  white-space: nowrap;
}
.pencil-circled .pencil-circle {
  inset: -0.2em -0.35em;
  width: calc(100% + 0.7em);
  height: calc(100% + 0.4em);
  color: var(--pencil-cyan);
}
.intro,
.lede {
  max-width: 65ch;
}
.intro {
  margin-bottom: 32px;
}
.muted,
.caption,
.role {
  color: var(--muted);
}
.caption {
  font-size: 0.875rem;
}

.hero {
  display: grid;
  gap: 32px;
  padding-block: 24px 48px;
}
.hero h1 > span {
  display: block;
}
.pencil-word {
  position: relative;
  display: inline-block;
  white-space: nowrap;
  padding-bottom: 28px;
}
.pencil-stroke,
.pencil-rule,
.process-trail {
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  pointer-events: none;
}
:is(.pencil-stroke, .pencil-rule, .process-trail) path {
  vector-effect: non-scaling-stroke;
}
.pencil-stroke {
  position: absolute;
  left: -3px;
  bottom: 8px;
  width: calc(100% + 6px);
  max-width: none;
  height: 14px;
  color: var(--pencil-cyan);
  filter: url(#pencil-grain);
}
.pencil-stroke path:nth-child(n + 3) {
  stroke: var(--pencil-magenta);
}
.pencil-rule {
  width: 100%;
  height: 18px;
  color: var(--muted);
}
.hero .lede {
  margin-bottom: 0;
}
.cta-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-block: 24px 16px;
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 20px;
  min-height: 48px;
  min-width: 44px;
  background: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 4px;
  color: var(--on-accent);
  font-size: 1rem;
  font-weight: 600;
  text-align: center;
  text-decoration: none;
}
.btn:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  color: var(--on-accent);
}
.btn:active {
  box-shadow: inset 0 0 0 2px var(--on-accent);
}
.btn-ghost {
  background: transparent;
  border-color: var(--border);
  color: var(--ink);
}
.btn-ghost:hover {
  background: var(--surface);
  border-color: var(--accent);
  color: var(--accent);
}
.hero-note {
  color: var(--muted);
  font-size: 0.875rem;
  margin: 0;
}
.pencil-note {
  display: block;
  margin-top: 8px;
  max-width: 32ch;
  font: 500 28px/1.15 "Caveat", var(--font-sans);
  color: var(--ink);
}
.portrait-board {
  width: min(100%, 360px);
  justify-self: center;
}
.portrait-board figure {
  margin: 0;
}
.portrait-frame {
  position: relative;
  width: fit-content;
  max-width: 100%;
}
.portrait-board img {
  position: relative;
  display: block;
  width: 200px;
  aspect-ratio: 1;
  object-fit: contain;
  border-radius: 8px;
}
.portrait-board .portrait-color {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  pointer-events: none;
}
@media (hover: hover) and (pointer: fine) {
  .portrait-frame.has-hover-image:hover .portrait-base {
    opacity: 0;
  }
  .portrait-frame.has-hover-image:hover .portrait-color {
    opacity: 1;
  }
}
@media (prefers-reduced-motion: no-preference) {
  .portrait-frame img {
    transition: opacity 220ms ease;
  }
}
.portrait-board figcaption {
  margin-top: 12px;
  font-size: 0.875rem;
  color: var(--muted);
}
.portrait-board figcaption strong {
  display: block;
  color: var(--ink);
  font-weight: 600;
}
.technical-diagram {
  margin-top: 24px;
}

.diagram-labels {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  list-style: none;
  padding: 0;
  margin: 8px 0 0;
  font-size: 0.875rem;
  color: var(--muted);
}

.proof {
  padding-block: 24px 32px;
}
.proof h2 {
  max-width: none;
  font-size: 1.125rem;
  line-height: 1.4;
  letter-spacing: 0;
  margin: 0 0 4px;
}
.proof p {
  margin: 0;
  font-size: 0.875rem;
  color: var(--muted);
}
.logo-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px 24px;
  list-style: none;
  padding: 0;
  margin: 24px 0 0;
}
.logo-strip li {
  flex: 0 1 112px;
}
.logo-strip img {
  display: block;
  width: 112px;
  height: 32px;
  object-fit: contain;
  filter: grayscale(1);
}
html[data-theme="dark"] .logo-strip img {
  filter: grayscale(1) brightness(0) invert(1);
}
.logo-strip li {
  border-radius: 4px;
}
@media (hover: hover) {
  .logo-strip li:hover img {
    filter: none;
  }
  html[data-theme="dark"] .logo-strip li:hover {
    background: #f5f7f7;
  }
  html[data-theme="dark"] .logo-strip li:hover img {
    filter: none;
  }
}
@media (hover: none) {
  .logo-strip img,
  html[data-theme="dark"] .logo-strip img {
    filter: none;
  }
  html[data-theme="dark"] .logo-strip li {
    background: #f5f7f7;
  }
}
@media (prefers-reduced-motion: no-preference) {
  .logo-strip img {
    transition: filter 200ms ease;
  }
  .logo-strip li {
    transition: background-color 200ms ease;
  }
}

.chapter {
  padding-block: 48px;
}
.service-grid,
.example-grid,
.quality-grid,
.about-grid,
.contact-grid,
.skill-grid {
  display: grid;
  gap: 24px;
}
.service-card {
  display: flex;
  flex-direction: column;
  padding: 20px;
}
.service-card > p:not(.label),
.practice-example > p:not(.label) {
  color: var(--muted);
}
.service-card ul {
  margin: 8px 0 24px;
  padding-left: 20px;
}
.service-card li {
  padding-left: 4px;
  margin-bottom: 8px;
}
.service-card li::marker {
  color: var(--accent);
}
.service-result {
  margin-top: auto;
  background: var(--pencil-line-img) 0 0 / 100% 8px no-repeat;
  padding-top: 20px;
}
.service-result h4 {
  font-size: 0.875rem;
  color: var(--muted);
  margin-bottom: 8px;
}
.text-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding-block: 8px;
  font-weight: 600;
}
.text-link span {
  flex: none;
}
.service-card .text-link {
  align-self: flex-start;
}
.service-card .service-link-label {
  position: relative;
  flex: 0 1 auto;
}
.practice-example {
  padding: 24px 24px 12px;
}
.practice-example .example-goal {
  color: var(--ink);
  font-weight: 600;
  font-size: 1rem;
}
.project-list {
  margin-top: 48px;
}
.project-evidence {
  display: grid;
  gap: 16px;
  padding-block: 28px 24px;
  background: var(--pencil-line-img) 0 0 / 100% 8px no-repeat;
}
.project-evidence h4 {
  margin-bottom: 8px;
}
.project-evidence p:last-child {
  margin-bottom: 0;
}
.project-role {
  margin-bottom: 4px;
}
.funded-project {
  display: grid;
  gap: 24px;
  margin-top: 40px;
  padding: 24px;
  --sketch-color: var(--muted);
}
.funding-note {
  font-size: 0.875rem;
  color: var(--muted);
  margin-bottom: 0;
}
.efre-inline {
  display: block;
  align-self: center;
  width: 100%;
  max-width: 555px;
  height: auto;
  padding: 12px;
  background: #fff;
}

.process-track {
  position: relative;
  margin: 32px 0;
}
.process-steps {
  display: grid;
  gap: 24px;
  list-style: none;
  padding: 0 0 0 24px;
  margin: 0;
}
.process-trail {
  position: absolute;
  top: 0;
  left: 0;
  color: var(--muted);
}
.trail-vertical {
  width: 16px;
  height: 100%;
}
.trail-horizontal {
  display: none;
}
.trail-progress {
  stroke: var(--pencil-cyan);
}
.trail-fine {
  stroke: var(--pencil-magenta);
}
.step-number {
  display: inline-block;
  color: var(--accent);
  font: 600 2.5rem/1 "Caveat", var(--font-sans);
  padding: 0 4px 10px 0;
  margin-bottom: 8px;
  background: var(--scribble-cyan) 0 100% / 56px 10px no-repeat;
}
.process-steps li:nth-child(3n + 2) .step-number {
  background-image: var(--scribble-magenta);
}
.process-steps li:nth-child(3n + 3) .step-number {
  background-image: var(--scribble-yellow);
}
.process-steps h3 {
  margin-bottom: 12px;
}
.process-steps p {
  color: var(--muted);
}
.process-steps .step-output {
  font-size: 1rem;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 0;
}
.quality-block {
  padding: 28px 24px;
}
.quality-block > h3 {
  max-width: 40ch;
  margin-bottom: 24px;
}
.quality-grid p {
  color: var(--muted);
  margin: 0;
}
.quality-grid h4 {
  margin-bottom: 8px;
}
.about-grid {
  margin-top: 32px;
  align-items: start;
}
.personal-heading {
  padding: 24px;
}
.personal-heading h3 {
  max-width: 20ch;
}
.personal-heading p {
  margin-bottom: 8px;
}

.team-details {
  padding-block: 4px;
  background:
    var(--pencil-line-img) 0 0 / 100% 8px no-repeat,
    var(--pencil-line-img) 0 100% / 100% 8px no-repeat;
}
.team-details > summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 24px;
  min-height: 48px;
  padding: 16px 8px;
  font-weight: 600;
  color: var(--accent);
  list-style: none;
}
.team-details > summary::-webkit-details-marker {
  display: none;
}
.team-summary-label::after {
  content: " +";
}
.team-details[open] .team-summary-label::after {
  content: " −";
}
.avatar-stack {
  display: flex;
  padding-left: 12px;
}
.avatar-stack img {
  width: 44px;
  height: 44px;
  margin-left: -12px;
  object-fit: contain;
  background: #fff;
  border: 2px solid var(--bg);
  border-radius: 12px;
  box-shadow: 0 0 0 1px var(--divider);
  transform: rotate(-5deg);
}
.avatar-stack img:nth-child(even) {
  transform: rotate(4deg) translateY(2px);
}
.team-details > p {
  margin: 16px 8px 24px;
}
.team-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 24px;
  padding-block: 0 24px;
  align-items: start;
}
.agent-profile summary {
  position: relative;
  padding: 16px;
  list-style: none;
}
.agent-profile summary::-webkit-details-marker {
  display: none;
}
.agent-profile summary::after {
  content: "+";
  position: absolute;
  right: 16px;
  top: 16px;
  font-size: 1.25rem;
  color: var(--accent);
}
.agent-profile[open] summary::after {
  content: "−";
}
.agent-profile img {
  display: block;
  width: 80px;
  height: 80px;
  object-fit: contain;
  background: #fff;
  border-radius: 4px;
  margin-bottom: 12px;
}
.agent-name {
  display: block;
  font-size: 1.375rem;
  font-weight: 650;
}
.role {
  display: block;
  font-size: 0.875rem;
  margin-block: 4px;
}
.badge {
  display: block;
  color: var(--accent);
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.04em;
}
.agent-description {
  padding: 0 16px 16px;
  font-size: 1rem;
}
.agent-description p {
  margin: 0;
}

.contact-details {
  align-self: start;
  padding: 24px;
}
.contact-company {
  font-size: 1.375rem;
  font-weight: 650;
}
.contact-details a,
.legal a,
.facts-bar a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}
.contact-form {
  display: grid;
  gap: 16px;
}
.form-field {
  display: grid;
  gap: 8px;
}
.contact-form label {
  font-size: 1rem;
  font-weight: 600;
}
.contact-form input,
.contact-form textarea {
  width: 100%;
  min-width: 0;
  min-height: 48px;
  padding: 12px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
}
.contact-form textarea {
  resize: vertical;
  min-height: 144px;
}
.contact-form :is(input, textarea)::placeholder {
  color: var(--muted);
  opacity: 1;
}
.contact-form [aria-invalid="true"] {
  border-color: var(--error);
}
.contact-form .btn {
  justify-self: start;
}
.field-error {
  color: var(--error);
  font-size: 0.875rem;
  margin: 0;
}
.form-hint,
.form-status {
  color: var(--muted);
  font-size: 0.875rem;
  margin: 0;
}
.form-status:empty {
  display: none;
}

.site-footer {
  padding-block: 28px 24px;
  background: var(--pencil-line-img) 0 0 / 100% 8px no-repeat;
  color: var(--muted);
  font-size: 0.875rem;
}
.footer-inner > div {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 24px;
  width: 100%;
}
.site-footer p {
  margin: 0;
}
.site-footer nav {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
}
.site-footer nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}
.payment-line {
  display: flex;
  align-items: center;
  gap: 8px;
}
.btc-badge {
  flex: none;
}

/* ---------------------------------------------------------------
   Sketchbook layer: pencil outlines, dividers and doodles.
   All pseudo-elements and SVGs are decorative (aria-hidden) and
   sit behind content; text colours and contrast stay untouched.
   --------------------------------------------------------------- */
.sketch {
  --sketch-color: var(--pencil-cyan);
  --sketch-dx: 7px;
  --sketch-dy: 7px;
  position: relative;
  isolation: isolate;
}
.sketch-cyan { --sketch-color: var(--pencil-cyan); }
.sketch-magenta { --sketch-color: var(--pencil-magenta); }
.sketch-yellow { --sketch-color: var(--pencil-yellow); }
.sketch-graphite { --sketch-color: var(--muted); }
.team-grid > .sketch:nth-child(3n + 1) { --sketch-color: var(--pencil-cyan); }
.team-grid > .sketch:nth-child(3n + 2) { --sketch-color: var(--pencil-magenta); }
.team-grid > .sketch:nth-child(3n + 3) { --sketch-color: var(--pencil-yellow); }
.sketch::before,
.sketch::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: 7px 5px 8px 4px / 5px 8px 4px 7px;
  pointer-events: none;
}
/* Offset coloured outline, like the shifted strokes in the wordmark. */
.sketch::before {
  border: 2px solid var(--sketch-color);
  opacity: 0.9;
  transform: translate(var(--sketch-dx), var(--sketch-dy));
  filter: url(#pencil-grain);
}
/* Paper face with a slightly wobbly graphite contour. */
.sketch::after {
  background: var(--sketch-face);
  border: 1.5px solid var(--sketch-line);
  filter: url(#pencil-rough);
}

.doodle {
  display: block;
  width: 48px;
  height: 48px;
  margin-bottom: 16px;
  overflow: visible;
  fill: none;
  stroke: var(--ink);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: url(#pencil-grain);
}
.doodle .d-ghost {
  stroke-width: 1;
  opacity: 0.4;
}
.doodle .d-thick {
  stroke-width: 3.5;
}
.doodle .d-accent {
  stroke: var(--sketch-color, var(--pencil-magenta));
  stroke-width: 2.75;
}
.doodle .d-thin {
  stroke-width: 1.4;
}
.doodle .d-alt {
  stroke: var(--pencil-cyan);
}
.doodle-check {
  width: 30px;
  height: 30px;
  margin-bottom: 10px;
}
.doodle-check .d-accent {
  stroke: var(--pencil-magenta);
  stroke-width: 3;
}
.quality-grid > div:nth-child(2) .doodle-check .d-accent {
  stroke: var(--pencil-cyan);
}
.quality-grid > div:nth-child(3) .doodle-check .d-accent {
  stroke: var(--accent);
}

.pencil-divider {
  position: relative;
  height: 24px;
  color: var(--muted);
}
.pd-cyan { --pd-c1: var(--pencil-cyan); --pd-c2: var(--pencil-magenta); }
.pd-yellow { --pd-c1: var(--pencil-yellow); --pd-c2: var(--pencil-cyan); }
.pd-magenta { --pd-c1: var(--pencil-magenta); --pd-c2: var(--pencil-yellow); }
.pd-line {
  display: block;
  width: 100%;
  height: 24px;
  overflow: visible;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  pointer-events: none;
  filter: url(#pencil-grain);
}
.pd-line path {
  vector-effect: non-scaling-stroke;
}
.pd-line .pd-c1 {
  stroke: var(--pd-c1);
}
.pd-line .pd-c2 {
  stroke: var(--pd-c2);
}
.pd-spark {
  position: absolute;
  top: -8px;
  width: 18px;
  height: 18px;
  fill: var(--pd-c2);
  pointer-events: none;
}
.pd-left .pd-spark { left: calc(36% + 2px); }
.pd-center .pd-spark { left: calc(68% + 2px); }
.pd-right .pd-spark { right: -6px; }

.spark {
  position: absolute;
  pointer-events: none;
  fill: currentColor;
  filter: url(#pencil-grain);
}
.spark-cyan {
  top: -10px;
  right: -12px;
  width: 28px;
  height: 28px;
  color: var(--pencil-cyan);
}
.spark-yellow {
  top: 30px;
  right: -26px;
  width: 14px;
  height: 14px;
  color: var(--pencil-yellow);
}
.spark-magenta {
  bottom: 22%;
  left: -16px;
  width: 18px;
  height: 18px;
  color: var(--pencil-magenta);
}
.note-arrow {
  display: inline-block;
  width: 46px;
  height: 34px;
  margin-left: 6px;
  vertical-align: 4px;
  overflow: visible;
  fill: none;
  stroke: var(--accent);
  stroke-linecap: round;
  stroke-linejoin: round;
  transform: scaleX(-1);
}

/* Existing CV renderer shares the refreshed editorial layout. */
.legal {
  max-width: 65ch;
  padding-block: 48px;
}
.legal h2 {
  margin-top: 32px;
}
.legal p {
  color: var(--muted);
}
.cv-head {
  padding-block: 48px 24px;
}
.cv-head h1 {
  font-size: clamp(2.375rem, 4.5vw, 4rem);
}
.cv-head-grid {
  display: grid;
  gap: 24px;
}
.cv-photo {
  width: 160px;
  height: 160px;
  object-fit: cover;
  border-radius: 8px;
}
.status {
  padding-block: 16px;
}
.chapter-label {
  font-size: 0.875rem;
  color: var(--muted);
  margin-bottom: 12px;
}
.facts-bar {
  display: grid;
  gap: 16px 24px;
  border-block: 1px solid var(--divider);
  padding-block: 24px;
  color: var(--muted);
  font-size: 1rem;
}
.comp-list,
.cert-list,
.edu-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.comp-list li,
.cert-list li,
.edu-list li {
  padding-block: 16px;
  border-bottom: 1px solid var(--divider);
}
.station {
  display: grid;
  gap: 8px 24px;
  padding-block: 24px;
  border-top: 1px solid var(--divider);
}
.station-company {
  font-size: 1.375rem;
  font-weight: 600;
  margin: 0;
}
.station-period {
  font-size: 0.875rem;
  color: var(--muted);
  margin: 0;
}
.station-meta {
  grid-column: 1 / -1;
}
.station-highlight {
  font-weight: 650;
}
.inline-tags {
  font-size: 0.875rem;
  color: var(--muted);
}
.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.tag-list li {
  max-width: 100%;
  border-bottom: 1px solid var(--divider);
  color: var(--muted);
  font-size: 1rem;
}
#cv-root > p:last-child {
  margin-block: 24px 48px;
}

@media (min-width: 480px) {
  .cta-row {
    flex-direction: row;
    flex-wrap: wrap;
  }
  .team-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 768px) {
  body {
    font-size: 1.125rem;
    line-height: 1.55;
  }
  .wrap {
    width: min(100% - 48px, 1200px);
  }
  .chapter {
    padding-block: 64px;
  }
  .hero {
    padding-block: 48px 64px;
  }
  .service-grid,
  .example-grid,
  .skill-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .service-card {
    padding: 24px;
  }
  .project-evidence,
  .about-grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.7fr);
    gap: 32px;
  }
  .facts-bar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .cv-head-grid,
  .station {
    grid-template-columns: minmax(0, 1fr) auto;
  }
  .station-period {
    text-align: right;
  }
  .portrait-board img {
    width: 280px;
  }
}

@media (min-width: 1024px) {
  :root {
    --header-height: 88px;
  }
  .wrap {
    width: min(100% - 80px, 1200px);
  }
  .wordmark img {
    width: 180px;
  }
  .desktop-nav {
    display: flex;
    gap: 8px;
    margin-left: auto;
  }
  .mobile-menu {
    display: none;
  }
  .chapter {
    padding-block: 80px;
  }
  .hero {
    grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
    align-items: center;
    gap: 48px;
    padding-block: 64px;
  }
  .portrait-board {
    justify-self: end;
  }
  .portrait-board img {
    width: 360px;
  }
  .proof {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.5fr);
    gap: 32px;
    align-items: center;
  }
  .logo-strip {
    justify-content: space-between;
    gap: 16px;
    margin: 0;
  }
  .logo-strip li {
    flex: 1 1 70px;
  }
  .logo-strip img {
    width: 100%;
  }
  .process-steps {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    padding: 42px 0 0;
  }
  .trail-horizontal {
    display: block;
    width: 100%;
    height: 18px;
  }
  .trail-vertical {
    display: none;
  }
  .quality-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .team-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
  .contact-grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr);
    gap: 48px;
  }
  .funded-project {
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
    align-items: center;
  }
  .facts-bar {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .site-footer nav {
    margin-left: auto;
  }
}


@keyframes line-draw {
  from {
    stroke-dashoffset: 1;
  }
  to {
    stroke-dashoffset: 0;
  }
}

@media (prefers-reduced-motion: no-preference) {
  a:hover,
  a:focus-visible,
  button:hover,
  button:focus-visible,
  summary:hover,
  summary:focus-visible {
    transition:
      color 120ms,
      background-color 120ms,
      border-color 120ms;
  }
  .has-brand-motion .pencil-stroke path {
    stroke-dasharray: 1;
  }
  .has-brand-motion .hero-draw-pending .pencil-stroke path {
    stroke-dashoffset: 1;
  }
  .has-brand-motion .hero-drawn .pencil-stroke path {
    animation: line-draw 800ms linear both;
  }
  .has-brand-motion .hero-drawn path:nth-child(2) {
    animation-delay: 60ms;
  }
  .has-brand-motion .hero-drawn path:nth-child(3) {
    animation-delay: 120ms;
  }
  .has-brand-motion .hero-drawn path:nth-child(4) {
    animation-delay: 180ms;
  }
  .has-brand-motion .trail-progress {
    stroke-dasharray: 1;
    stroke-dashoffset: var(--trail-offset, 0);
  }
  /* Hero doodles appear once, after the underline has been drawn. */
  .has-brand-motion .note-arrow path {
    stroke-dasharray: 1;
    animation: line-draw 650ms ease-out 1000ms backwards;
  }
  .has-brand-motion .spark {
    animation: spark-pop 650ms cubic-bezier(0.3, 1.5, 0.5, 1) 900ms backwards;
  }
  .has-brand-motion .spark-yellow {
    animation-delay: 1050ms;
  }
  .has-brand-motion .spark-magenta {
    animation-delay: 1200ms;
  }
  .spark,
  .sketch::before,
  .avatar-stack img,
  .agent-profile summary img,
  .btn,
  .btn:hover {
    transition:
      transform 220ms cubic-bezier(0.2, 0.8, 0.25, 1),
      box-shadow 220ms cubic-bezier(0.2, 0.8, 0.25, 1),
      color 120ms,
      background-color 120ms,
      border-color 120ms;
  }
}

@keyframes spark-pop {
  from {
    opacity: 0;
    transform: scale(0) rotate(-60deg);
  }
  70% {
    opacity: 1;
    transform: scale(1.2) rotate(10deg);
  }
  to {
    transform: none;
  }
}

@keyframes read-progress {
  to {
    transform: scaleX(1);
  }
}

/* Reading progress as a cyan crayon line under the header (no JS). */
@supports (animation-timeline: scroll()) {
  @media (prefers-reduced-motion: no-preference) {
    .site-header::after {
      content: "";
      position: absolute;
      left: 0;
      bottom: -2px;
      width: 100%;
      height: 3px;
      background: var(--pencil-cyan);
      border-radius: 2px;
      transform: scaleX(0);
      transform-origin: 0 50%;
      pointer-events: none;
      animation: read-progress linear both;
      animation-timeline: scroll(root);
    }
  }
}

@media (prefers-reduced-motion: no-preference) and (hover: hover) and (pointer: fine) {
  .has-brand-motion .service-card,
  .has-brand-motion .service-link-arrow {
    transition: transform 160ms ease-out;
  }
  .has-brand-motion .service-card:has(.text-link:is(:hover, :focus-visible)) {
    transform: translateY(-3px);
    --sketch-dx: 10px;
    --sketch-dy: 10px;
    transition-duration: 180ms;
  }
  .has-brand-motion .text-link:is(:hover, :focus-visible) .service-link-arrow {
    transform: translate(3px, -3px);
    transition-duration: 180ms;
  }
  .has-brand-motion .service-card:has(.text-link:active) {
    transform: none;
  }
  /* Crayon offset shadow on buttons; buttons themselves never tilt. */
  .btn:hover {
    transform: translate(-2px, -2px);
    box-shadow: 4px 4px 0 var(--pencil-cyan);
  }
  .btn-ghost:hover {
    box-shadow: 4px 4px 0 var(--pencil-magenta);
  }
  .btn:active {
    transform: none;
    box-shadow: inset 0 0 0 2px var(--on-accent);
  }
  .portrait-frame:hover .spark {
    transform: rotate(35deg) scale(1.15);
  }
  .team-details > summary:hover .avatar-stack img {
    transform: translateY(-5px) rotate(0);
  }
  .team-details > summary:hover .avatar-stack img:nth-child(2) { transition-delay: 30ms; }
  .team-details > summary:hover .avatar-stack img:nth-child(3) { transition-delay: 60ms; }
  .team-details > summary:hover .avatar-stack img:nth-child(4) { transition-delay: 90ms; }
  .team-details > summary:hover .avatar-stack img:nth-child(5) { transition-delay: 120ms; }
  .team-details > summary:hover .avatar-stack img:nth-child(6) { transition-delay: 150ms; }
  .team-details > summary:hover .avatar-stack img:nth-child(7) { transition-delay: 180ms; }
  .team-details > summary:hover .avatar-stack img:nth-child(8) { transition-delay: 210ms; }
  .agent-profile:has(> summary:hover) {
    --sketch-dx: 10px;
    --sketch-dy: 10px;
  }
  .agent-profile > summary:hover img {
    transform: rotate(-4deg) scale(1.06);
  }
}

/* Only successful observer deliveries opt individual items into hiding.
   JS removes the reveal classes after the entrance, so hover states and
   the final layout never depend on the reveal rules. */
@media screen and (prefers-reduced-motion: no-preference) {
  [data-reveal]:not([data-reveal="draw"]).reveal-ready {
    --reveal-tilt: -0.8deg;
    opacity: 0;
    transform: translateY(36px) rotate(var(--reveal-tilt)) scale(0.98);
    transition:
      opacity 500ms ease var(--reveal-delay, 0ms),
      transform 900ms cubic-bezier(0.2, 0.85, 0.25, 1) var(--reveal-delay, 0ms);
  }
  [data-reveal]:not([data-reveal="draw"]):nth-child(even).reveal-ready {
    --reveal-tilt: 0.8deg;
  }
  [data-reveal].reveal-ready.is-revealed {
    opacity: 1;
    transform: none;
  }
  /* The coloured offset outline slides out after the card has landed. */
  .sketch.reveal-ready::before {
    transition:
      transform 650ms cubic-bezier(0.2, 0.85, 0.25, 1) calc(var(--reveal-delay, 0ms) + 380ms),
      opacity 300ms ease calc(var(--reveal-delay, 0ms) + 380ms);
  }
  .sketch.reveal-ready:not(.is-revealed)::before {
    opacity: 0;
    transform: none;
  }
  .reveal-ready .doodle path {
    stroke-dasharray: 1;
    stroke-dashoffset: 1;
    transition: stroke-dashoffset 700ms ease-out calc(var(--reveal-delay, 0ms) + 420ms);
  }
  .reveal-ready .doodle .d-accent {
    transition-delay: calc(var(--reveal-delay, 0ms) + 750ms);
  }
  .reveal-ready.is-revealed .doodle path {
    stroke-dashoffset: 0;
  }
  /* Pencil dividers draw themselves: graphite first, then colour. */
  [data-reveal="draw"].reveal-ready .pd-line path {
    stroke-dasharray: 1;
    stroke-dashoffset: 1;
    transition: stroke-dashoffset 1100ms cubic-bezier(0.45, 0, 0.2, 1);
  }
  [data-reveal="draw"].reveal-ready .pd-line path:nth-child(2) {
    transition-delay: 120ms;
  }
  [data-reveal="draw"].reveal-ready .pd-line .pd-c1 {
    transition-duration: 700ms;
    transition-delay: 450ms;
  }
  [data-reveal="draw"].reveal-ready .pd-line .pd-c2 {
    transition-duration: 700ms;
    transition-delay: 600ms;
  }
  [data-reveal="draw"].reveal-ready .pd-spark {
    opacity: 0;
    transform: scale(0) rotate(-60deg);
    transition:
      transform 500ms cubic-bezier(0.3, 1.5, 0.5, 1) 1100ms,
      opacity 200ms ease 1100ms;
  }
  [data-reveal="draw"].reveal-ready.is-revealed .pd-line path {
    stroke-dashoffset: 0;
  }
  [data-reveal="draw"].reveal-ready.is-revealed .pd-spark {
    opacity: 1;
    transform: none;
  }
  [data-reveal].reveal-ready:is(:focus-within, .reveal-immediate) {
    opacity: 1;
    transform: none;
    transition: none !important;
  }
  [data-reveal].reveal-ready:is(:focus-within, .reveal-immediate)::before {
    opacity: 0.9;
    transform: translate(var(--sketch-dx), var(--sketch-dy));
    transition: none !important;
  }
  [data-reveal].reveal-ready:is(:focus-within, .reveal-immediate) :is(path, .pd-spark) {
    stroke-dashoffset: 0;
    transition: none !important;
  }
  [data-reveal].reveal-ready:is(:focus-within, .reveal-immediate) .pd-spark {
    opacity: 1;
    transform: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}