:root {
  color-scheme: light;
  /* content */
  --ink: #2c352c;
  --muted: #4e594d;
  --pale: #dce4d7;
  --paper: #f6f6ee;
  --sage-dark: #485b49;
  --line: #becbbb;
  --surface: #ffffff;
  --on-accent: #ffffff;
  --button-hover: #374838;
  --disabled-bg: #dce3d6;
  --portrait-bg: #dbe2d4;
  --chip-hover: #cfdccb;
  --chip-hover-line: #839583;
  --qty-disabled-bg: #e4e9e0;
  --qty-disabled-ink: #788375;
  --input-line: #768475;
  --focus: #4d654f;
  --em-soft: #596c58;
  --backdrop: #2c352c91;
  --shadow: #2c352c38;
  /* action bands: banner and footer */
  --night: #2c352c;
  --on-night: #f6f6ee;
  --on-night-muted: #dbe4d8;
  --night-accent: #c0d0bb;
  --code-bg: #232e26;
  /* identity layers: berry marks edge cases and attention, mono marks "system" text */
  --berry: #8c2d3b;
  --berry-soft: #f1dfe1;
  --tongue: #3f67a6;
  --font-display: "Newsreader", "Iowan Old Style", Georgia, serif;
  --font-body: "Hanken Grotesk", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  background: var(--paper);
  color: var(--ink);
  font: 100%/1.55 var(--font-body);
}
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --ink: #e7ece4;
    --muted: #a9b4a8;
    --pale: #1d2820;
    --paper: #141a16;
    --sage-dark: #9cc0a3;
    --line: #34403a;
    --surface: #1b231d;
    --on-accent: #10160f;
    --button-hover: #b4d2ba;
    --disabled-bg: #26302a;
    --portrait-bg: #1d2820;
    --chip-hover: #26352b;
    --chip-hover-line: #5c7462;
    --qty-disabled-bg: #222b25;
    --qty-disabled-ink: #7d897f;
    --input-line: #5c6a5f;
    --focus: #9cc0a3;
    --em-soft: #9cc0a3;
    --backdrop: #000000a6;
    --shadow: #00000066;
    --night: #0c100d;
    --on-night: #e7ece4;
    --on-night-muted: #a9b4a8;
    --night-accent: #9cc0a3;
    --code-bg: #0c100d;
    --berry: #e58a96;
    --berry-soft: #3a2227;
    --tongue: #8db0e8;
  }
}
* { box-sizing: border-box; }
body { margin: 0; }
.skip-link {
  position: absolute;
  z-index: 1;
  inset: .5rem auto auto .5rem;
  padding: .5rem .75rem;
  background: var(--paper);
  transform: translateY(calc(-100% - 1rem));
}
.skip-link:focus { transform: none; }
[hidden] { display: none !important; }
.wrap { width: min(71rem, calc(100% - 3rem)); margin-inline: auto; }
a { color: inherit; text-underline-offset: .22em; }
button, input, textarea { font: inherit; }
button, .button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 4px; }
h1, h2, h3, p { margin: 0; }
h1, h2 { font-family: var(--font-display); font-weight: 600; letter-spacing: -.025em; line-height: 1.02; text-wrap: balance; }
h2 { font-size: clamp(2.1rem, 5vw, 3.7rem); }
.site-top { border-bottom: 1px solid var(--line); }
.top-row, .footer-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 4.6rem; }
.top-row nav, footer nav { display: flex; flex-wrap: wrap; gap: 1.25rem; font-weight: 650; }
.top-row > nav { margin-inline-start: auto; margin-inline-end: .55rem; }
.top-row nav a { text-decoration: none; }
.top-row nav a:hover, .top-row nav a[aria-current="page"] { text-decoration: underline; }
#portfolio-menu-toggle { width: 44px; padding: 0; display: grid; place-items: center; }
.portfolio-menu-icon { width: 18px; height: 12px; border-block: 2px solid currentColor; display: grid; align-items: center; }
.portfolio-menu-icon::before { content: ''; border-top: 2px solid currentColor; }
#portfolio-menu {
  inset: 0 0 0 auto;
  margin: 0;
  width: min(22rem, calc(100% - 3rem));
  height: 100dvh;
  max-height: none;
  border: 0;
  border-inline-start: 1px solid var(--line);
  border-radius: 0;
}
@media (prefers-reduced-motion: no-preference) {
  #portfolio-menu[open] { animation: portfolio-menu-enter .2s ease-out; }
  @keyframes portfolio-menu-enter { from { transform: translateX(100%); } }
}
#portfolio-menu nav { flex-direction: column; gap: .25rem; }
#portfolio-menu nav a { display: flex; align-items: center; min-height: 44px; }
@media (width < 770px) {
  .top-row { gap: .65rem; }
  .top-row > .cart-trigger { margin-inline-start: auto; }
  .top-row > nav { order: 1; width: 100%; margin: 0; }
  .top-row:has(> nav) { flex-wrap: wrap; }
}
.wordmark { font: 700 2rem/1 var(--font-display); text-decoration: none; letter-spacing: -.05em; }
.wordmark span { color: var(--sage-dark); }
.cart-trigger, .outline, .filters button {
  background: transparent; border: 1px solid var(--line); color: var(--ink); min-height: 44px;
  border-radius: .6rem; padding: .55rem .85rem; font-weight: 650;
}
.cart-trigger { display: flex; align-items: center; gap: .6rem; }
.cart-trigger span { background: var(--pale); color: var(--sage-dark); border-radius: 50%; min-width: 1.55rem; text-align: center; }
.hero { display: grid; grid-template-columns: 1.12fr .88fr; align-items: center; gap: 2rem; padding-block: clamp(3rem, 8vw, 7rem); }
.eyebrow { color: var(--sage-dark); font-weight: 750; margin-bottom: 1rem; }
.hero h1 { font-size: clamp(3.4rem, 8vw, 6rem); }
.page-title { font-size: clamp(2.65rem, 6vw, 4.65rem); }
h1 em { color: var(--sage-dark); font-weight: 500; }
.intro { font-size: 1.15rem; max-width: 48ch; margin-block: 1.3rem .8rem; color: var(--muted); }

.button {
  display: inline-flex; justify-content: center; align-items: center; min-height: 44px;
  padding: .62rem .95rem; border: 1px solid transparent; border-radius: .6rem;
  background: var(--sage-dark); color: var(--on-accent); text-decoration: none; font-weight: 700;
}
.button:hover { background: var(--button-hover); }
.button:disabled, .button[aria-disabled=true] { cursor: default; background: var(--disabled-bg); color: var(--muted); }
.hero-portrait {
  margin: 0; position: relative; aspect-ratio: 1.06;
  overflow: hidden; background: var(--portrait-bg); border-radius: 1.5rem;
}
.hero-portrait img { width: 100%; height: 100%; display: block; object-fit: cover; object-position: center 33%; }
.shelf { background: var(--pale); padding-block: clamp(2.5rem, 6vw, 5rem); }
.section-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: end; gap: 1.25rem; margin-bottom: 1.5rem; }
.section-head p { margin-top: .6rem; color: var(--muted); }
.role-presets {
  margin-bottom: 1.65rem; padding: clamp(1rem, 3vw, 1.5rem);
  display: grid; justify-items: start; gap: .85rem;
  border: 1px solid var(--line); border-radius: .9rem; background: var(--paper);
}
.role-presets h2 { font-size: clamp(1.55rem, 3.5vw, 2.35rem); }
.role-presets p { color: var(--muted); margin-top: .35rem; }
#presets-status:empty { display: none; }
.preset-options, .preset-skills { display: flex; flex-wrap: wrap; gap: .45rem; }
.preset-options button[aria-pressed=true] { border-color: var(--sage-dark); background: var(--pale); }
.preset-preview { width: 100%; border-top: 1px solid var(--line); padding-top: .85rem; }
.preset-preview h4 { margin: .9rem 0 .35rem; }
.preset-skills { padding: 0; list-style: none; margin: 0 0 .9rem; }
.preset-skills li { padding: .2rem .55rem; border-radius: 999px; background: var(--pale); font-size: .875rem; }
.shelf-controls { margin-bottom: 1rem; display: grid; gap: .75rem; }
.skill-search { display: grid; gap: .3rem; max-width: 24rem; font-weight: 650; }
#skill-count { color: var(--muted); }
.filters { display: flex; flex-wrap: wrap; gap: .4rem; }
.filters button[aria-pressed=true] { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.cards { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 1rem; }
.card { min-width: 0; display: flex; flex-direction: column; align-items: start; gap: .7rem; padding: 1.25rem; background: var(--paper); border: 1px solid var(--line); border-radius: .9rem; }
.card .category {
  align-self: end; display: inline-grid; place-items: center; min-height: 24px; max-width: 100%;
  padding: .1rem .4rem; border-radius: 999px;
  border: 1px solid var(--line); background: var(--pale); color: var(--sage-dark);
  font-size: .75rem; line-height: 1.2; font-weight: 700; text-align: center;
}
.card:target { border-color: var(--sage-dark); box-shadow: 0 0 0 2px var(--sage-dark); }
.card, .work-project { scroll-margin-block-start: 1rem; }
.card .category:hover { background: var(--chip-hover); border-color: var(--chip-hover-line); }
.card h3, .work h3 { font-size: 1.24rem; line-height: 1.25; }
.card p, .work p { color: var(--muted); }
.card .button { margin-top: auto; }
.card .is-shortlisted { background: var(--chip-hover); color: var(--sage-dark); }
.work { padding-block: clamp(2.5rem, 6vw, 5rem); }
.work-accordion { margin-top: 1.75rem; border-top: 1px solid var(--line); }
.work-project { border-bottom: 1px solid var(--line); }
.work-project summary {
  position: relative; list-style: none; cursor: pointer; padding: 1.1rem 3.75rem 1.1rem .85rem;
  display: flex; flex-wrap: wrap; align-items: baseline; gap: .35rem 1.25rem;
}
.work-project summary::-webkit-details-marker { display: none; }
.work-project summary:hover, .work-project[open] summary { background: var(--pale); }
.work-project summary::after {
  content: ""; position: absolute; right: .85rem; top: 50%; transform: translateY(-50%);
  width: 2rem; height: 2rem; border: 1px solid var(--line); border-radius: 50%;
  background: linear-gradient(var(--sage-dark), var(--sage-dark)) center / .75rem 2px no-repeat,
    linear-gradient(var(--sage-dark), var(--sage-dark)) center / 2px .75rem no-repeat, var(--paper);
}
.work-project[open] summary::after { background-size: .75rem 2px, 0 0; }
.project-context { color: var(--muted); }
.project-detail { max-width: 75ch; padding: 1.15rem .85rem 1.45rem; }
.project-detail p + p { margin-top: .75rem; }
.project-detail > a { display: inline-block; margin-top: .9rem; color: var(--sage-dark); font-weight: 700; }
.project-skills { display: flex; flex-wrap: wrap; gap: .45rem; margin-bottom: .9rem; }
.project-skills a {
  display: inline-flex; align-items: center; min-height: 26px; padding: .15rem .55rem;
  border: 1px solid var(--line); border-radius: 999px; background: var(--pale);
  color: var(--sage-dark); font-size: .8rem; font-weight: 700; text-decoration: none;
}
.project-skills a:hover { text-decoration: underline; }
.home-about {
  display: grid; grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr);
  align-items: start; gap: 1.25rem 2rem; border-top: 1px solid var(--line);
  padding-block: clamp(2rem, 5vw, 4rem);
}
.home-about h2 { font-size: clamp(2.1rem, 4.3vw, 3.3rem); }
.home-about h2 em { color: var(--em-soft); font-weight: 400; }
.about-copy { max-width: 64ch; color: var(--muted); }
.intro p + p, .about-copy p + p { margin-top: .7rem; }
.shortlist-banner {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 1.2rem 2rem;
  background: var(--night); color: var(--on-night); border-radius: 1rem;
  padding: clamp(1.25rem, 4vw, 2.5rem); margin-bottom: clamp(2rem, 5vw, 4rem);
}
.shortlist-banner p { max-width: 55ch; margin-top: .65rem; }
.shortlist-banner .button { background: var(--night-accent); color: var(--night); }
.shortlist-banner .button:hover { background: var(--on-night); }
.shortlist-banner a:focus-visible { outline-color: var(--night-accent); }
.home-featured .section-head p { max-width: 69ch; }
.home-featured { background: var(--pale); padding-block: clamp(2.5rem, 6vw, 4rem); }
.featured-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.featured-card {
  display: flex; flex-direction: column; gap: .55rem; padding: 1.25rem;
  border: 1px solid var(--line); background: var(--paper); border-radius: .9rem;
}
.featured-type { color: var(--muted); font-size: .875rem; font-weight: 700; }
.featured-card h3 { font-size: 1.3rem; }
.featured-card a, .text-link { color: var(--sage-dark); font-weight: 700; }
.featured-card a { align-self: start; margin-top: auto; padding-top: .5rem; }
.case-list { display: grid; gap: 1rem; margin-top: 2rem; }
.case-list article { padding: clamp(1.25rem, 4vw, 2rem); }
.case-list h2 { font-size: clamp(2rem, 5vw, 3rem); }
.case-list article > p { max-width: 72ch; }
.case-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem 1.25rem; margin-top: .5rem; }
.case-actions .button { color: var(--on-accent); }
.case-resource { margin-top: .5rem; border-top: 1px solid var(--line); padding-top: .7rem; }
.case-resource summary { cursor: pointer; font-weight: 650; }
.case-resource p { margin-top: .45rem; max-width: 72ch; }
.experience { display: grid; grid-template-columns: minmax(0, 1fr) 2fr; gap: 1rem 2rem; margin-top: 1.5rem; background: var(--pale); padding: 1.25rem; border-radius: .9rem; }
.experience-date, .work-profile { font-weight: 650; }
.work .work-profile { margin-top: 1.75rem; }
.experience-date { margin-top: .5rem; }
footer { background: var(--night); color: var(--on-night); }
.footer-row { padding-block: 1.5rem; flex-wrap: wrap; }
footer p { margin-top: .35rem; }
footer .copyright { color: var(--on-night-muted); font-size: .875rem; }

dialog { position: fixed; width: min(37rem, calc(100% - 2rem)); max-height: calc(100dvh - 2rem); overflow: auto; color: var(--ink); background: var(--paper); border: 1px solid var(--line); border-radius: 1rem; padding: clamp(1.1rem, 5vw, 2rem); }
dialog::backdrop { background: var(--backdrop); }
html:has(dialog[open]) { overflow: hidden; }
dialog h2 { padding-inline-end: 2.6rem; margin-bottom: 1rem; font-size: clamp(2rem,5vw,3rem); }
.close-form { position: absolute; top: .75rem; right: .75rem; }
.close-form button { width: 44px; height: 44px; border: 0; border-radius: 50%; background: var(--pale); font-size: 1.5rem; color: var(--ink); }
#cart-items { list-style: none; padding: 0; }
#cart-items li { border-bottom: 1px solid var(--line); padding-block: .65rem; }
.cart-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .55rem; }
.cart-row > span { flex: 1 1 10rem; font-weight: 650; }
.cart-row-actions, .quantity-control { display: flex; align-items: center; gap: .35rem; }
.cart-row-actions { flex-wrap: wrap; }
.quantity-control button { min-height: 44px; min-width: 44px; padding: .15rem; }
.quantity-control button[aria-disabled=true] {
  background: var(--qty-disabled-bg);
  border-color: transparent;
  color: var(--qty-disabled-ink);
  cursor: not-allowed;
}
.quantity-control span { min-width: 1.1rem; text-align: center; font-variant-numeric: tabular-nums; }
#checkout-selection summary { cursor: pointer; font-weight: 650; }
#checkout-summary { margin-block: .4rem; padding-inline-start: 1.25rem; }
.shortlist-toast {
  position: fixed; inset: auto 1rem max(1rem, env(safe-area-inset-bottom)) auto; margin: 0;
  width: max-content; max-width: min(24rem, calc(100% - 2rem)); pointer-events: none;
  padding: .8rem 1rem; border: 1px solid var(--line); border-radius: .65rem;
  color: var(--paper); background: var(--ink); box-shadow: 0 .3rem 1.2rem var(--shadow);
  font-size: .9rem; font-weight: 650;
}
#toast-context { margin-top: .35rem; color: var(--paper); opacity: .8; font-weight: 400; }
#quantity-note p + p { margin-top: .25rem; }
#cart-view .dialog-actions { margin-top: .75rem; }
.order-summary { background: var(--pale); border-radius: .65rem; padding: 1rem; }
.order-summary dl { margin: .65rem 0; }
.order-summary dl div { display: grid; grid-template-columns: 1fr auto; gap: .75rem; padding: .35rem 0; }
.order-summary dd { margin: 0; text-align: end; }
.order-summary dl .order-reptile { row-gap: .25rem; }
.order-summary .reptile-note { grid-column: 1 / -1; text-align: start; }
.order-summary .order-total { border-top: 1px solid var(--line); font-weight: 750; padding-top: .55rem; }
.order-summary p + p, #inquiry-confirmation p { margin-top: .55rem; }
#contact-form { display: grid; gap: .7rem; margin-top: 1rem; }
#contact-form label { display: grid; gap: .2rem; font-weight: 650; }
input, textarea { width: 100%; min-height: 44px; border: 1px solid var(--input-line); border-radius: .4rem; background: var(--surface); color: var(--ink); padding: .5rem .65rem; font-weight: 400; }
textarea { resize: vertical; }
.dialog-actions { display: flex; flex-wrap: wrap; gap: .6rem; }
.hint { color: var(--muted); font-size: .92rem; }
#contact-status:not(:empty), #draft { margin-top: 1rem; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
@media (max-width: 54rem) { .cards { grid-template-columns: repeat(2, minmax(0,1fr)); } }
@media (max-width: 38rem) {
  .wrap { width: calc(100% - 2rem); }
  .hero, .cards, .featured-grid, .home-about { grid-template-columns: 1fr; }
  .hero-portrait { aspect-ratio: 1.2; }
  .hero-portrait img { object-position: center 26%; }
  .experience { grid-template-columns: 1fr; gap: .55rem; }
}

body { min-height: 100vh; display: flex; flex-direction: column; }
main { flex: 1; }
dialog h2:focus:not(:focus-visible) { outline: none; }
.work-profile h2 { font-size: clamp(1.7rem, 3vw, 2.4rem); margin-bottom: .65rem; }
.speedrun-gallery { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 20rem), 1fr)); gap: .75rem; }
.speedrun-gallery img { width: 100%; height: auto; display: block; border-radius: .6rem; border: 1px solid var(--line); }
.test-showcase-title { margin-block: 1.2rem 1.5rem; }
.spec-group { margin-top: 1.5rem; }
.spec-group h2 { font-size: 1.65rem; margin-bottom: .6rem; }
.spec-group details { border: 1px solid var(--line); border-radius: .6rem; margin-bottom: .5rem; overflow: clip; }
.spec-group summary { background: var(--pale); padding: .8rem 1rem; font-weight: 700; cursor: pointer; }
.spec-group summary:focus-visible { outline-offset: -4px; }
.spec-content { padding: .85rem 1rem; }
.spec-toolbar { display: flex; align-items: center; justify-content: space-between; gap: .8rem; }
.spec-content pre { background: var(--code-bg); color: #f6f6ee; padding: 1rem; border-radius: .45rem; overflow: auto; max-height: 34rem; font-size: .9rem; }
.code-keyword { color: #f0c4e7; }
.code-string { color: #d3eaa9; }
.code-comment { color: #b7c8b9; }
.code-number { color: #ffd2ac; }
@media (width < 770px) {
  .preset-options { flex-wrap: nowrap; overflow-x: auto; max-width: 100%; padding: 4px 4px 8px; }
  .preset-options button { flex: none; }
  .role-presets { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- Identity layers ---------- */

/* Mono "system" text: labels, counts, statuses */
.eyebrow, .featured-type, #skill-count, .project-context, .experience-date, .card .category, .skill-id {
  font-family: var(--font-mono);
  letter-spacing: .01em;
}
.eyebrow { font-size: .85rem; font-weight: 600; }
.featured-type { font-size: .8rem; font-weight: 600; }
#skill-count, .project-context, .experience-date { font-size: .875rem; }
.card .category { font-size: .7rem; font-weight: 600; }
h2 em { color: var(--sage-dark); font-weight: 500; }
.shortlist-banner h2 em { color: var(--night-accent); }

/* Logo: the full stop is a status dot that turns into a check */
.wordmark { display: inline-flex; align-items: baseline; }
.logo-dot {
  position: relative; display: inline-block; width: .3em; height: .3em; margin-inline-start: .06em;
  border-radius: 50%; background: var(--sage-dark); transition: background-color .2s;
}
.logo-dot svg { position: absolute; inset: -.13em; width: .56em; height: .56em; opacity: 0; transition: opacity .2s; }
.logo-dot circle { fill: var(--sage-dark); }
.logo-dot path { fill: none; stroke: var(--paper); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.wordmark:hover .logo-dot, .wordmark.is-flashing .logo-dot { background: transparent; }
.wordmark:hover .logo-dot svg, .wordmark.is-flashing .logo-dot svg { opacity: 1; }
footer .logo-dot, footer .logo-dot circle { background: var(--night-accent); fill: var(--night-accent); }
footer .logo-dot path { stroke: var(--night); }
footer .wordmark:hover .logo-dot { background: transparent; }

/* Shortlist badge in berry, with a bump when something is added */
.cart-trigger span {
  display: inline-grid; place-items: center; min-width: 1.6rem; height: 1.6rem; padding-inline: .3rem;
  border-radius: 999px; background: var(--berry); color: var(--paper);
  font-family: var(--font-mono); font-size: .8rem; font-weight: 600;
}
.cart-trigger span.is-bumping { animation: count-bump .35s ease; }
@keyframes count-bump { 40% { transform: scale(1.3); } }

/* Skill cards: test-case IDs and an animated check on add */
.card-meta { align-self: stretch; display: flex; justify-content: space-between; align-items: center; gap: .5rem; }
.card-meta .category { align-self: auto; }
.skill-id { color: var(--sage-dark); font-size: .8rem; font-weight: 600; }
.card .button { gap: .45rem; }
.card .button .tick { width: 1rem; height: 1rem; display: none; flex: none; }
.card .button .tick path {
  fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round;
}
.card .button.is-shortlisted .tick { display: inline-block; }
.card .button.just-added .tick path { stroke-dasharray: 24; stroke-dashoffset: 24; animation: tick-draw .35s ease-out forwards; }
@keyframes tick-draw { to { stroke-dashoffset: 0; } }

.card .card-foot { margin-top: auto; align-self: stretch; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem .75rem; }
.card .card-foot .button { margin-top: 0; }
.card-status { font-family: var(--font-mono); font-size: .75rem; color: var(--muted); }
.card-status.is-in { color: var(--sage-dark); font-weight: 600; }

/* Order-receipt preview in the dark "Configure your QA." band */
.banner-receipt {
  margin: 1.1rem 0 0; padding-top: .8rem; max-width: 22rem; display: grid; gap: .25rem;
  border-top: 1px dashed color-mix(in srgb, var(--on-night) 35%, transparent);
  font-family: var(--font-mono); font-size: .8rem; color: var(--on-night-muted);
}
.banner-receipt div { display: flex; justify-content: space-between; gap: 1rem; }
.banner-receipt dd { margin: 0; font-variant-numeric: tabular-nums; }

/* About: pull quote and a "how I work" list written like test results */
.about-method {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 2rem clamp(2rem, 5vw, 4rem); align-items: start;
  border-top: 1px solid var(--line); padding-block: clamp(2.5rem, 6vw, 4.5rem);
}
.pull-quote { margin: 0; padding-inline-start: 1.25rem; border-inline-start: 3px solid var(--sage-dark); }
.pull-quote p { font: italic 500 clamp(1.7rem, 3.6vw, 2.6rem)/1.15 var(--font-display); color: var(--sage-dark); letter-spacing: -.015em; }
.about-method h2 { font-size: clamp(1.9rem, 4vw, 2.8rem); }
.method-list { list-style: none; padding: 0; margin: 1.25rem 0 0; display: grid; gap: .65rem; }
.method-list li { display: grid; grid-template-columns: 1.5rem minmax(0, 1fr); gap: .4rem; color: var(--muted); }
.method-list .mark { font-family: var(--font-mono); font-weight: 600; color: var(--sage-dark); }
.method-list .is-edge, .method-list .is-edge .mark { color: var(--berry); }
@media (max-width: 38rem) { .about-method { grid-template-columns: 1fr; } }

/* The path motif: happy path in green, edge cases as dotted berry branches */
.trail { padding-block: .5rem clamp(1.5rem, 4vw, 2.5rem); }
.trail-scroll { overflow-x: auto; }
.trail svg { display: block; width: 100%; min-width: 40rem; height: auto; overflow: visible; }
.trail-main { fill: none; stroke: var(--sage-dark); stroke-width: 2.5; stroke-linecap: round; }
.trail-branch { fill: none; stroke: var(--berry); stroke-width: 2; stroke-dasharray: 1 7; stroke-linecap: round; }
.trail-stop { fill: var(--paper); stroke: var(--sage-dark); stroke-width: 2.5; }
.trail-edge { fill: var(--berry); }
.trail text { font-family: var(--font-mono); font-size: 12px; fill: var(--muted); }
.trail .trail-pass { fill: var(--sage-dark); font-weight: 600; }
.trail .trail-fail { fill: var(--berry); }
.trail + .home-about { border-top: 0; }
@media (prefers-reduced-motion: no-preference) {
  /* The script arms the path (hidden) and reveals it once it scrolls into view.
     Without the script the path simply shows complete. */
  .trail.is-armed .trail-main { stroke-dasharray: 1400; stroke-dashoffset: 1400; }
  .trail.is-armed .trail-branch, .trail.is-armed .trail-edge, .trail.is-armed .trail-fail { opacity: 0; }
  .trail.is-visible .trail-main { animation: trail-draw 2.2s .15s ease-out forwards; }
  .trail.is-visible .trail-branch, .trail.is-visible .trail-edge, .trail.is-visible .trail-fail { animation: trail-fade .6s ease-out forwards; }
  .trail.is-visible .d1 { animation-delay: 1.05s; }
  .trail.is-visible .d2 { animation-delay: 1.45s; }
  .trail.is-visible .d3 { animation-delay: 1.85s; }
}
@keyframes trail-draw { to { stroke-dashoffset: 0; } }
@keyframes trail-fade { to { opacity: 1; } }

/* Experience as a trail: a vertical path with a stop per project */
.work-accordion.timeline { position: relative; padding-inline-start: 2.5rem; border-top: 0; }
.work-accordion.timeline::before {
  content: ""; position: absolute; inset-inline-start: .75rem; top: 1.75rem; bottom: 1.75rem;
  width: 2.5px; border-radius: 2px; background: var(--sage-dark);
}
.timeline .work-project { position: relative; }
.timeline .work-project::before {
  content: ""; position: absolute; inset-inline-start: calc(-2.5rem + .75rem + 1.25px - .45rem); top: 1.35rem;
  width: .9rem; height: .9rem; border-radius: 50%; background: var(--paper); border: 2.5px solid var(--sage-dark);
  box-sizing: border-box;
}
.timeline .work-project[open]::before { background: var(--sage-dark); }
.edge-chips { display: flex; flex-wrap: wrap; gap: .45rem; margin-block: -.35rem .9rem; }
.edge-chip [aria-hidden="true"] { margin-inline-end: .4em; }
.edge-chip {
  display: inline-flex; align-items: center; min-height: 26px; padding: .15rem .6rem; border-radius: 999px;
  background: var(--berry-soft); color: var(--berry); font-family: var(--font-mono); font-size: .78rem; font-weight: 600;
}

/* Geralt: empty and error states only */
.geralt { display: block; width: 100%; max-width: 13.5rem; height: auto; }
.geralt .g-body { fill: var(--paper); stroke: var(--sage-dark); stroke-width: 2.2; stroke-linejoin: round; }
.geralt .g-band { fill: none; stroke: var(--sage-dark); stroke-width: 1.6; opacity: .55; }
.geralt .g-leg { fill: none; stroke: var(--sage-dark); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.geralt .g-eye { fill: var(--sage-dark); }
.geralt .g-tongue { fill: none; stroke: var(--tongue); stroke-width: 2.2; stroke-linecap: round; }
.geralt .g-ground { fill: none; stroke: var(--muted); stroke-width: 1.5; stroke-dasharray: 1 6; stroke-linecap: round; }
.geralt .g-cliff { fill: none; stroke: var(--sage-dark); stroke-width: 2.5; stroke-linecap: round; }
.geralt .g-label { font-family: var(--font-mono); fill: var(--berry); }
.geralt .g-zzz { font-family: var(--font-mono); fill: var(--muted); }
.geralt-panel { display: grid; place-items: center; padding: 1.25rem; border-radius: .9rem; background: var(--pale); }
.empty-state {
  display: grid; grid-template-columns: minmax(0, 15rem) minmax(0, 1fr); align-items: center; gap: 1.25rem 2rem;
  padding: clamp(1rem, 3vw, 1.5rem); border: 1px solid var(--line); border-radius: .9rem; background: var(--paper);
}
.empty-state .geralt-panel { background: var(--pale); }
.empty-state h2 { font-size: clamp(1.7rem, 3.5vw, 2.4rem); }
.empty-state p { color: var(--muted); margin-block: .5rem 1rem; max-width: 46ch; }
.not-found { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 22rem); align-items: center; gap: 2rem; }
.not-found .eyebrow { color: var(--berry); }
.not-found .geralt { max-width: 18rem; }
.empty-cart { display: grid; justify-items: start; gap: .75rem; }
.empty-cart .geralt-panel { width: 100%; }
@media (max-width: 38rem) {
  .empty-state, .not-found { grid-template-columns: 1fr; }
  .work-accordion.timeline { padding-inline-start: 2rem; }
  .work-accordion.timeline::before { inset-inline-start: .5rem; }
  .timeline .work-project::before { inset-inline-start: calc(-2rem + .5rem + 1.25px - .45rem); }
}
@media (prefers-reduced-motion: reduce) {
  .card .button.just-added .tick path { animation: none; stroke-dashoffset: 0; }
  .cart-trigger span.is-bumping { animation: none; }
}

/* More Geralt: About, Case studies, and peeking over the footer on Home */
.geralt .g-ridge { fill: none; stroke: var(--line); stroke-width: 2; stroke-linejoin: round; }
.geralt .g-pole { fill: none; stroke: var(--sage-dark); stroke-width: 2; stroke-linecap: round; }
.geralt .g-flag { fill: var(--berry); }
.geralt-figure { margin: 0; display: grid; justify-items: start; gap: .4rem; }
.geralt-figure figcaption { font-family: var(--font-mono); font-size: .78rem; color: var(--muted); max-width: 34ch; }
.pull-quote-column { display: grid; gap: 2rem; align-content: start; }
.pull-quote-column .geralt { max-width: 11rem; }
.geralt-hike { margin-top: 2rem; justify-items: end; text-align: end; }
.geralt-hike .geralt { max-width: 17rem; }
.home-talk { position: relative; }
.geralt-peek {
  position: absolute; right: clamp(1rem, 9vw, 7rem); bottom: 0; width: 6.5rem; max-width: none;
  pointer-events: none;
}

/* About: CV downloads */
.cv-download { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem .75rem; margin-top: 1.4rem; }
.cv-download .eyebrow { margin: 0; margin-inline-end: .25rem; }
.cv-link {
  display: inline-flex; align-items: center; gap: .55rem; min-height: 44px; padding: .45rem .85rem;
  border: 1px solid var(--line); border-radius: .6rem; background: var(--surface);
  color: var(--ink); font-weight: 650; text-decoration: none;
}
.cv-link:hover { border-color: var(--sage-dark); }
.cv-type { font: 600 .72rem var(--font-mono); color: var(--sage-dark); background: var(--pale); border-radius: 999px; padding: .1rem .45rem; }

/* Home: section labels, offer chips, case studies and "Let's talk" */
.home-about .eyebrow, .section-head .eyebrow { margin-bottom: .55rem; }
.shortlist-banner .eyebrow { color: var(--night-accent); margin-bottom: .55rem; }
.offer-list { list-style: none; padding: 0; margin: 1rem 0 0; display: flex; flex-wrap: wrap; gap: .45rem; }
.offer-list li {
  display: inline-flex; align-items: center; gap: .45rem; padding: .3rem .7rem; border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--on-night) 22%, transparent); font-size: .88rem; color: var(--on-night);
}
.offer-list li::before { content: "✓"; font: 600 .78rem var(--font-mono); color: var(--night-accent); }
.home-featured .geralt-peek { display: none; }
.home-cases { padding-block: clamp(2.5rem, 6vw, 4rem); }
.card-links { margin-top: auto; padding-top: .5rem; display: flex; flex-wrap: wrap; gap: .4rem 1.1rem; }
.featured-card .card-links a { margin-top: 0; padding-top: 0; }
.home-talk { position: relative; padding-block: clamp(1rem, 3vw, 2rem) clamp(4.5rem, 9vw, 6rem); }
.talk-card {
  display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: 1.5rem 2.5rem; align-items: center;
  background: var(--night); color: var(--on-night); border-radius: 1rem; padding: clamp(1.25rem, 4vw, 2.5rem);
}
.talk-card .eyebrow { color: var(--night-accent); margin-bottom: .55rem; }
.talk-card h2 em { color: var(--night-accent); }
.talk-card p { max-width: 50ch; margin-top: .65rem; color: var(--on-night-muted); }

/* Home refinements: rhythm, full-width offer band, bottom buttons, Let's talk */
.trail { padding-block: clamp(1.5rem, 4vw, 3rem) clamp(2.5rem, 6vw, 4.5rem); }
.home-about { padding-block: clamp(3rem, 7vw, 5.5rem); }
.home-about + .shortlist-banner { margin-top: clamp(.5rem, 2vw, 1.5rem); }

.shortlist-banner { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1.5rem; }
.banner-copy p { max-width: 62ch; }
.shortlist-banner .offer-list { margin: 0; }
.banner-foot {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem 2rem;
  padding-top: 1.1rem; border-top: 1px dashed color-mix(in srgb, var(--on-night) 30%, transparent);
}
.banner-foot .banner-receipt { margin: 0; padding: 0; border: 0; max-width: none; display: flex; flex-wrap: wrap; gap: .4rem 2.25rem; }
.banner-foot .banner-receipt div { gap: .7rem; }
.banner-foot .banner-receipt dd { color: var(--on-night); }

.section-foot { display: flex; justify-content: center; margin-top: clamp(1.5rem, 4vw, 2.25rem); }

.talk-card { grid-template-columns: minmax(0, 1fr); gap: 1.4rem; }
.talk-card p { max-width: 62ch; }
.talk-address { font-family: var(--font-mono); font-size: .92em; color: var(--on-night); }
.talk-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; }
.talk-actions .button { background: var(--night-accent); color: var(--night); }
.talk-actions .button:hover { background: var(--on-night); }
.talk-button {
  display: inline-flex; align-items: center; justify-content: center; gap: .45rem; min-height: 44px; padding: .62rem .95rem;
  border: 1px solid color-mix(in srgb, var(--on-night) 30%, transparent); border-radius: .6rem;
  color: var(--on-night); font-weight: 700; text-decoration: none;
}
.talk-button:hover { border-color: var(--night-accent); }
.talk-actions a:focus-visible { outline-color: var(--night-accent); }

/* The path has a compact version for phones instead of a sideways-scrolling strip */
.trail .trail-mobile { display: none; width: 100%; min-width: 0; height: auto; overflow: visible; }
@media (max-width: 40rem) {
  .trail .trail-desktop { display: none; }
  .trail .trail-mobile { display: block; }
}

/* ---------- Motion ----------
   Everything below runs only for visitors who haven't asked for reduced motion.
   Features without browser support (e.g. animated <details>) simply open instantly. */
@media (prefers-reduced-motion: no-preference) {
  :root { interpolate-size: allow-keywords; }


  /* Accordions slide open and closed */
  details::details-content {
    block-size: 0; overflow: clip;
    transition: block-size .32s ease, content-visibility .32s allow-discrete;
  }
  details[open]::details-content { block-size: auto; }
  .work-project summary, .spec-group summary { transition: background-color .2s ease; }
  /* rotate inside the same transform as the centring, so the icon turns in place */
  .work-project summary::after { transition: background-size .25s ease, transform .25s ease; }
  .work-project[open] summary::after { transform: translateY(-50%) rotate(180deg); }
  .timeline .work-project::before { transition: background-color .25s ease; }

  /* Toast fades and slides in and out */
  .shortlist-toast {
    opacity: 0; translate: 0 .5rem;
    transition: opacity .22s ease, translate .22s ease, overlay .22s allow-discrete, display .22s allow-discrete;
  }
  .shortlist-toast:popover-open { opacity: 1; translate: 0 0; }
  @starting-style { .shortlist-toast:popover-open { opacity: 0; translate: 0 .5rem; } }

  /* Shortlist dialog slides and scales in, backdrop fades (no opacity fade, so contrast is never reduced) */
  #shortlist {
    translate: 0 .75rem; scale: .97;
    transition: translate .25s ease, scale .25s ease, overlay .25s allow-discrete, display .25s allow-discrete;
  }
  #shortlist[open] { translate: 0 0; scale: 1; }
  @starting-style { #shortlist[open] { translate: 0 .75rem; scale: .97; } }
  dialog::backdrop { transition: background-color .25s ease, overlay .25s allow-discrete, display .25s allow-discrete; }
  dialog:not([open])::backdrop { background-color: transparent; }
  @starting-style { dialog[open]::backdrop { background-color: transparent; } }

  /* Cards and the empty state fade in when they appear (filtering, search) */
  .card, .empty-state { transition: opacity .25s ease, translate .25s ease, box-shadow .2s ease, border-color .2s ease, display .25s allow-discrete; }
  @starting-style { .card, .empty-state { opacity: 0; translate: 0 .4rem; } }

  /* Gentle lift on hover */
  .featured-card { transition: translate .2s ease, box-shadow .2s ease; }
  .featured-card:hover { translate: 0 -3px; box-shadow: 0 .6rem 1.6rem var(--shadow); }
  .card:hover { box-shadow: 0 .4rem 1.2rem var(--shadow); }
  .button, .outline, .filters button, .cart-trigger, .project-skills a, .card .category {
    transition: background-color .18s ease, color .18s ease, border-color .18s ease, translate .12s ease;
  }
  .button:active, .outline:active, .filters button:active { translate: 0 1px; }

  /* Hero rises in on load */
  .hero > * { animation: rise-in .6s ease-out both; }
  .hero > :nth-child(2) { animation-delay: .12s; }
  @keyframes rise-in { from { opacity: 0; translate: 0 .75rem; } }

  /* Geralt: an occasional tongue flick, and his z z float while he sleeps */
  .geralt .g-tongue { transform-box: fill-box; transform-origin: right center; animation: tongue-flick 4.5s ease-in-out infinite; }
  @keyframes tongue-flick { 0%, 86%, 100% { scale: 1 1; } 90% { scale: 1.7 1; } 94% { scale: .4 1; } }
  .geralt .g-zzz { animation: snooze 3.2s ease-in-out infinite; }
  .geralt-peek .g-eye { transform-box: fill-box; transform-origin: center; animation: blink 5s ease-in-out infinite; }
  @keyframes blink { 0%, 92%, 100% { scale: 1 1; } 95% { scale: 1 .1; } }
  .geralt-hike g { animation: trudge 2.4s ease-in-out infinite; }
  @keyframes trudge { 50% { translate: 0 -1.5px; } }
  @keyframes snooze { 50% { translate: 3px -5px; opacity: .45; } }
}
