/* Palette: Sanzo Wada, A Dictionary of Color Combinations, no. 211
   Deep Indigo #051230 · Apricot Orange #f68c50 · Olive Yellow #a6a159 */

:root {
  --indigo: #051230;
  --apricot: #f68c50;
  --olive: #a6a159;

  --bg: #fbf8f3;
  --surface: #f2ece2;
  --border: #e0d7c8;
  --text: #051230;
  --muted: #4a5470;
  --accent: #9a4413;
  --accent-2: #5c5a1f;
  --link: #9a4413;
  color-scheme: light;
}

/* Dark: follows the system setting unless the visitor picked light with the toggle */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #051230;
    --surface: #0b1c44;
    --border: #1d3061;
    --text: #eef0f5;
    --muted: #a9b2c8;
    --accent: #f68c50;
    --accent-2: #c9c47a;
    --link: #f68c50;
    color-scheme: dark;
  }
}

/* Dark: picked with the toggle */
:root[data-theme="dark"] {
  --bg: #051230;
  --surface: #0b1c44;
  --border: #1d3061;
  --text: #eef0f5;
  --muted: #a9b2c8;
  --accent: #f68c50;
  --accent-2: #c9c47a;
  --link: #f68c50;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 17px/1.65 "Segoe UI", -apple-system, BlinkMacSystemFont, Helvetica, Arial, sans-serif;
}
a { color: var(--link); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
img { max-width: 100%; height: auto; }
figure.diagram { margin: 20px 0 24px; }
figure.diagram img { display: block; width: 100%; }
code { font: 0.9em ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; background: var(--surface); padding: 1px 5px; border-radius: 4px; }
pre { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 14px 16px; overflow-x: auto; }
pre code { background: none; padding: 0; }

.wrap { max-width: 860px; margin: 0 auto; padding: 0 16px; }

/* Site header */
.site-header { background: var(--indigo); color: #eef0f5; }
.site-header .wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 20px; padding-top: 14px; padding-bottom: 14px; }
.brand { color: #eef0f5; text-decoration: none; font-weight: 700; display: flex; align-items: center; gap: 10px; margin-right: auto; }
.brand svg { flex: none; }
.nav { display: flex; flex-wrap: wrap; gap: 4px 16px; list-style: none; margin: 0; padding: 0; font-size: 15px; }
.nav a { color: #a9b2c8; text-decoration: none; white-space: nowrap; }
@media (max-width: 600px) {
  .site-header nav { width: 100%; order: 2; }
  .theme-toggle { order: 1; }
  .nav { gap: 4px 14px; font-size: 14px; }
}
.nav a:hover, .nav a[aria-current="page"] { color: var(--apricot); }
.theme-toggle { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; padding: 0; border-radius: 8px; border: 1px solid #2a3c6e; background: transparent; color: #a9b2c8; cursor: pointer; }
.theme-toggle:hover { color: var(--apricot); border-color: var(--apricot); }
.theme-toggle svg { width: 18px; height: 18px; }
.theme-toggle .icon-sun { display: none; }
.is-dark .theme-toggle .icon-sun { display: block; }
.is-dark .theme-toggle .icon-moon { display: none; }

/* Hero (home and page headers share the indigo band) */
.hero { background: var(--indigo); color: #eef0f5; padding: 48px 0 52px; }
.hero.small { padding: 28px 0 36px; }
.bar { width: 64px; height: 6px; border-radius: 3px; background: var(--apricot); box-shadow: 22px 0 0 -0px var(--olive); margin-bottom: 22px; }
.hero h1 { font-size: clamp(2rem, 6vw, 3.25rem); line-height: 1.1; margin: 0 0 12px; letter-spacing: -0.01em; }
.hero.small h1 { font-size: clamp(1.75rem, 5vw, 2.5rem); }
.hero .lede { font-size: clamp(1.05rem, 2.6vw, 1.35rem); color: #a9b2c8; margin: 0 0 8px; max-width: 46em; }
.hero .meta { color: #a9b2c8; margin: 0 0 24px; }
.hero .meta:last-child { margin-bottom: 0; }

.links { display: flex; flex-wrap: wrap; gap: 10px; padding: 0; margin: 0; list-style: none; }
.btn { display: inline-block; padding: 8px 14px; border-radius: 8px; border: 1px solid #2a3c6e; color: #eef0f5; text-decoration: none; font-size: 15px; background: transparent; }
.btn:hover { border-color: var(--apricot); }
.btn.primary { background: var(--apricot); border-color: var(--apricot); color: var(--indigo); font-weight: 600; }

/* Content */
main section { padding: 36px 0 4px; }
main > .wrap > :first-child { margin-top: 36px; }
h2 { font-size: 1.5rem; margin: 0 0 14px; letter-spacing: -0.01em; }
h3 { font-size: 1.15rem; margin: 0 0 6px; }
.prose h2 { margin-top: 36px; }
.prose h3 { margin-top: 24px; }
ul, ol { padding-left: 22px; }
li { margin-bottom: 6px; }
.muted { color: var(--muted); }
.eyebrow { font-size: 13px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--apricot); margin: 0 0 8px; font-weight: 600; }

.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 20px; margin-bottom: 16px; }
.grid .card { margin-bottom: 0; }
.card h3 a { color: var(--text); text-decoration: none; }
.card h3 a:hover { color: var(--accent); }
.card p { margin: 6px 0; }
.card h3, .card h3:first-child { margin-top: 0; }
.stack { color: var(--accent-2); font-size: 15px; }
.tag { display: inline-block; font-size: 13px; padding: 1px 8px; border-radius: 999px; border: 1px solid var(--border); color: var(--muted); }
.more { font-weight: 600; text-decoration: none; }
.more::after { content: " \2192"; }

table { width: 100%; border-collapse: collapse; margin: 12px 0 20px; font-size: 15px; display: block; overflow-x: auto; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--border); vertical-align: top; }
th { color: var(--muted); font-weight: 600; }

.callout { border-left: 4px solid var(--apricot); background: var(--surface); padding: 14px 18px; border-radius: 0 10px 10px 0; margin: 20px 0; }
.callout p { margin: 4px 0; }

dl.faq dt { font-weight: 600; margin-top: 18px; }
dl.faq dd { margin: 4px 0 0; }

.site-footer { border-top: 1px solid var(--border); margin-top: 48px; padding: 24px 0 40px; color: var(--muted); font-size: 15px; }
.site-footer .links a { color: var(--muted); }

/* Resume */
.resume h2 { font-size: 1.2rem; border-bottom: 2px solid var(--apricot); padding-bottom: 4px; margin-top: 28px; }
.resume .job { margin-bottom: 14px; }
.resume .job p { margin: 2px 0; }

@media print {
  .site-header, .site-footer, .no-print { display: none !important; }
  .hero { background: none; color: #000; padding: 0 0 8px; }
  .hero .lede, .hero .meta { color: #333; }
  .bar { display: none; }
  body { font-size: 11pt; line-height: 1.45; background: #fff; color: #000; }
  a { color: #000; text-decoration: none; }
  .wrap { max-width: none; padding: 0; }
  main section { padding-top: 10px; }
  .resume h2 { border-color: #c96a32; }
  .card { border: none; padding: 0; background: none; }
  body { font-size: 10pt; line-height: 1.4; }
  .hero h1, .hero.small h1 { font-size: 22pt; margin-bottom: 4px; }
  .hero .lede { font-size: 12pt; margin-bottom: 2px; }
  .hero .meta { font-size: 9.5pt; margin: 0; }
  main section { padding: 0; }
  .resume h2 { font-size: 12pt; margin: 14px 0 6px; padding-bottom: 2px; }
  .resume h3 { font-size: 10.5pt; margin: 0; }
  .resume .job { margin-bottom: 8px; break-inside: avoid; }
  .resume ul { margin: 4px 0; }
  .resume li { margin-bottom: 1px; }
  .resume p { margin: 2px 0; }
}

/* Fraunces (SIL Open Font License 1.1), self-hosted Latin subset; one variable file covers weights 500 to 700 */
@font-face {
  font-family: "Fraunces";
  font-style: normal;
  font-weight: 500 700;
  font-display: swap;
  src: url("/assets/fonts/fraunces-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ===== Woven Code theme layer (loads after the base rules above) ===== */
/* "Woven Code" theme.
   Warm cream and oatmeal, indigo, rust, olive. Patterns are accents, drawn in CSS and SVG. */


:root {
  --serif: "Fraunces", Georgia, "Times New Roman", serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --rust: #a2441b;
  --maroon: #7a2332;

  --bg: #f4ecdc;
  --surface: #ede2cc;
  --border: #d3c2a0;
  --stitch: #b9a47c;
  --muted: #4d5472;
  --accent: #a2441b;
  --accent-2: #5a5920;
  --link: #a2441b;
  --grain: 0.06;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #050e26;
    --surface: #0a1a42;
    --border: #1d3061;
    --stitch: #34498a;
    --muted: #a9b2c8;
    --accent: #f68c50;
    --accent-2: #c9c47a;
    --link: #f68c50;
    --grain: 0.09;
  }
}
:root[data-theme="dark"] {
  --bg: #050e26;
  --surface: #0a1a42;
  --border: #1d3061;
  --stitch: #34498a;
  --muted: #a9b2c8;
  --accent: #f68c50;
  --accent-2: #c9c47a;
  --link: #f68c50;
  --grain: 0.09;
}

/* Grain: faint noise over everything, never catches clicks */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 100;
  pointer-events: none;
  opacity: var(--grain);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 .9 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* Type: serif headings, mono labels, sans body */
h1, h2, h3, .brand span { font-family: var(--serif); font-weight: 700; }
h2 { font-size: 1.75rem; }
.hero h1 { font-weight: 700; letter-spacing: -0.02em; }
.nav, .stack, .eyebrow, .tag, .meta, .muted, .btn { font-family: var(--mono); }
.nav { font-size: 13.5px; letter-spacing: 0.02em; }
.stack { font-size: 13px; }
.card .muted { font-size: 13px; }
.btn { font-size: 14px; }
.btn.primary { font-weight: 700; }

/* Hero: indigo field of dots, a few glow like nodes in a network */
.hero {
  position: relative;
  background-color: var(--indigo);
  background-image:
    radial-gradient(circle at center, rgba(246, 140, 80, 0.95) 0 2.5px, rgba(246, 140, 80, 0.18) 3px 7px, transparent 8px),
    radial-gradient(circle at center, rgba(246, 140, 80, 0.8) 0 2px, rgba(246, 140, 80, 0.14) 2.5px 6px, transparent 7px),
    radial-gradient(circle at center, rgba(238, 240, 245, 0.28) 0 1.6px, transparent 2.2px);
  background-size: 198px 198px, 242px 242px, 22px 22px;
  background-position: 66px 44px, 150px 120px, 0 0;
}
/* keep the text area calm: fade the pattern out behind the headline block */
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, var(--indigo) 0%, rgba(5, 18, 48, 0.88) 38%, rgba(5, 18, 48, 0) 78%);
  pointer-events: none;
}
.hero > .wrap { position: relative; }
.hero.small::before { background: linear-gradient(90deg, var(--indigo) 0%, rgba(5, 18, 48, 0.92) 50%, rgba(5, 18, 48, 0.2) 100%); }

/* Hero network: nodes joined by stitched thread */
.hero-net { position: absolute; top: 0; right: 0; height: 100%; width: min(58%, 720px); pointer-events: none; }
.hero-net .thread { fill: none; stroke: #f68c50; stroke-width: 1.6; stroke-dasharray: 7 6; stroke-linecap: round; opacity: 0.7; }
.hero-net .halo { fill: #f68c50; opacity: 0.16; }
.hero-net .node { fill: #f68c50; }
.hero-net .node.olive { fill: #c9c47a; }
.hero-net .halo.olive { fill: #c9c47a; }
.hero-net .ring { fill: none; stroke: #eef0f5; stroke-width: 1.4; opacity: 0.55; }
@media (max-width: 760px) { .hero-net { opacity: 0.16; width: 100%; } }

/* Section dividers: a two-row punch-card strip, drawn as a mask so it follows the theme colour */
:root {
  --punch: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='14'%3E%3Cg fill='black'%3E%3Crect x='0' y='2' width='8' height='4'/%3E%3Crect x='12' y='2' width='4' height='4'/%3E%3Crect x='22' y='2' width='14' height='4'/%3E%3Crect x='42' y='2' width='4' height='4'/%3E%3Crect x='56' y='2' width='8' height='4'/%3E%3Crect x='70' y='2' width='4' height='4'/%3E%3Crect x='82' y='2' width='16' height='4'/%3E%3Crect x='106' y='2' width='4' height='4'/%3E%3Crect x='4' y='9' width='4' height='3'/%3E%3Crect x='16' y='9' width='12' height='3'/%3E%3Crect x='34' y='9' width='4' height='3'/%3E%3Crect x='46' y='9' width='8' height='3'/%3E%3Crect x='60' y='9' width='4' height='3'/%3E%3Crect x='72' y='9' width='12' height='3'/%3E%3Crect x='92' y='9' width='4' height='3'/%3E%3Crect x='102' y='9' width='10' height='3'/%3E%3C/g%3E%3C/svg%3E");
}
main section + section::before,
.divider {
  content: "";
  display: block;
  height: 14px;
  margin-bottom: 28px;
  background: var(--accent);
  opacity: 0.8;
  -webkit-mask: var(--punch) repeat-x left center;
          mask: var(--punch) repeat-x left center;
}
main section + section { padding-top: 14px; }

/* Cards: a dashed inner line, like hand stitching */
.card {
  position: relative;
  border-radius: 10px;
  padding: 22px;
}
.card::after {
  content: "";
  position: absolute;
  inset: 6px;
  border: 1.5px dashed var(--stitch);
  border-radius: 6px;
  pointer-events: none;
  opacity: 0.8;
}
.card > * { position: relative; }

/* Project swatches: a small pattern generated from the project name */
.swatch { display: block; width: 44px; height: 44px; margin-bottom: 12px; border-radius: 6px; }
.swatch svg { display: block; width: 100%; height: 100%; border-radius: 6px; }

.callout { border-left-color: var(--rust); }

/* Footer: a narrow patchwork band above the usual links */
.site-footer {
  position: relative;
  border-top: none;
  padding-top: 34px;
  margin-top: 56px;
}
.site-footer::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 12px;
  background:
    repeating-linear-gradient(90deg,
      #051230 0 24px, #a2441b 24px 36px, #5a5920 36px 60px, #f4ecdc 60px 66px,
      #7a2332 66px 90px, #f68c50 90px 96px, #051230 96px 120px, #5a5920 120px 132px,
      #a2441b 132px 156px, #f4ecdc 156px 162px);
  border-top: 1px dashed rgba(255, 255, 255, 0.35);
  border-bottom: 1px dashed rgba(255, 255, 255, 0.35);
}

@media (max-width: 600px) {
  .hero::before { background: rgba(5, 18, 48, 0.72); }
  h2 { font-size: 1.5rem; }
}
@media print {
  body::before, .site-footer::before, .card::after { display: none; }
  /* plain, ink-friendly page: no dark hero, no pattern strips */
  .hero, .hero.small { background: none !important; border: 0; }
  .hero::before, .hero::after, .hero-net { display: none !important; }
  .hero h1, .hero .lede, .hero .meta { color: #000; }
  main section + section::before, .divider { display: none; }
  main section + section { padding-top: 0; }
  h2 { break-after: avoid; }
}

/* Dark mode: hero and page share an indigo, so mark the hero edge with a thread line */
.hero { border-bottom: 1px solid var(--border); }
.hero::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 6px;
  border-bottom: 1.5px dashed rgba(246, 140, 80, 0.45);
  pointer-events: none;
}
@media print { .hero::after { display: none; } }

/* Hero tagline: the one human line above the keywords */
.hero .tagline { font-family: var(--serif); font-weight: 500; font-size: clamp(1.15rem, 3vw, 1.5rem); color: var(--apricot); margin: 0 0 10px; }

/* Two-up grid for the four services: 2 x 2 on desktop, one column on phones */
.grid.two { grid-template-columns: repeat(2, 1fr); }
.grid.two .card { display: flex; flex-direction: column; }
.grid.two .card > p:last-child { margin-top: auto; }

/* Clickable cards: the title link stretches over the whole card; other links stay clickable on top */
.card-link > * { position: static; }
.card-link h3 a::before { content: ""; position: absolute; inset: 0; border-radius: inherit; z-index: 0; }
.card-link p a { position: relative; z-index: 1; }
.card-link { transition: border-color 0.15s ease; }
.card-link:hover { border-color: var(--accent); }
.card-link:hover h3 a { color: var(--accent); }
.card-link:has(h3 a:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.card-link h3 a:focus-visible { outline: none; }
.card-cta { color: var(--link); }
@media (prefers-reduced-motion: reduce) { .card-link { transition: none; } }
@media (max-width: 640px) { .grid.two { grid-template-columns: 1fr; } }

/* Hero role line: the job title recruiters scan for */
.hero .role { font-family: var(--mono); font-weight: 700; font-size: clamp(0.95rem, 2.4vw, 1.1rem); letter-spacing: 0.02em; color: #eef0f5; margin: 0 0 10px; }

/* At a glance: quick facts for recruiters */
.glance { padding-top: 32px; }
.glance h2 { font-size: 1.25rem; margin-bottom: 10px; }
.glance dl { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 10px 24px; margin: 0; padding: 16px 20px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; }
.glance dl div { min-width: 0; }
.glance dt { font-family: var(--mono); font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }
.glance dd { margin: 2px 0 0; }
@media print {
  /* the printed resume already opens with a summary, so the box would only repeat it */
  .glance { display: none; }
}

/* Phone menu: keep all six links on one line (the mono font is wide) */
@media (max-width: 600px) {
  .nav { flex-wrap: nowrap; gap: 0 11px; font-size: 12.5px; letter-spacing: 0; }
}
@media (max-width: 360px) {
  .site-header nav { overflow-x: auto; }
}

/* Keep hero text readable: fade the network graphic where it runs under the text */
@media (min-width: 761px) {
  .hero-net {
    -webkit-mask-image: linear-gradient(90deg, transparent 0 28%, #000 58%);
    mask-image: linear-gradient(90deg, transparent 0 28%, #000 58%);
  }
}

/* Service cards: headline, short intro, tools line, one proof sentence, then the link */
.service-card { display: flex; flex-direction: column; }
.service-card .card-headline { font-family: var(--serif); font-weight: 500; font-size: 1.1rem; line-height: 1.35; color: var(--accent); margin-top: 2px; }
.service-card .tools-label { font-weight: 700; }
.service-card .card-proof { font-size: 15px; color: var(--muted); }
.service-card .card-cta { margin-top: auto; padding-top: 6px; }
