/* soren.work — Ghost theme 2.1
   Layout: a portfolio home (hero, case studies, projects, writing, experience)
   and an editorial post page, inspired by the structure of portfolio themes like Digital.
   Look: the Soren Hamby design system (Eclipse 2.0) — 1px ink hairlines, square by default,
   one loud accent (chartreuse, always a fill with on-accent text), Lexend for reading,
   Atkinson Hyperlegible Mono for controls. Targets WCAG 2.2 AA in both themes. */

:root {
  --surface: #dddddd;
  --ink: #1c1c1c;
  --black: #1a1a1a;
  --text-body: #2d2d2d;
  --text-muted: #5a5a5a;
  --raised: #e9e9e9;
  --surface-hover: #f7f7f7;
  --cobalt: hsl(213.4 100% 39%);
  --chartreuse: #b6d200;
  --accent-hover: #dce59a;
  --on-accent: #1c1c1c;
  --danger: #c40003;
  --rule: #8a8a8a;

  --sans-default: "Lexend", system-ui, sans-serif;
  --sans: var(--gh-font-body, var(--sans-default));
  --display: var(--gh-font-heading, var(--sans));
  --mono: "Atkinson Hyperlegible Mono", ui-monospace, monospace;

  --space-1: 0.5rem; --space-2: 1rem; --space-3: 1.5rem; --space-4: 2rem;
  --space-5: 3rem; --space-6: 4rem; --space-7: 5rem;
  --gutter: max(20px, 5vw);
  --reading: 50rem;
  --wide: 65rem;
  --page: 87.5rem;
  --hairline: 1px solid var(--ink);
  --radius-lg: 1rem;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --surface: #161616; --ink: #e6e6e6; --black: #f2f2f2; --text-body: #d4d4d4; --text-muted: #a3a3a3;
    --raised: #222222; --surface-hover: #404040; --cobalt: #6ea8ff; --accent-hover: #e0ff3d; --danger: #ff6b6e; --rule: #5c5c5c;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --surface: #161616; --ink: #e6e6e6; --black: #f2f2f2; --text-body: #d4d4d4; --text-muted: #a3a3a3;
  --raised: #222222; --surface-hover: #404040; --cobalt: #6ea8ff; --accent-hover: #e0ff3d; --danger: #ff6b6e; --rule: #5c5c5c;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: var(--space-3); }
body {
  margin: 0; background: var(--surface); color: var(--text-body);
  font-family: var(--sans); font-size: 1.125rem; font-weight: 300; line-height: 1.8;
  transition: background-color 200ms, color 200ms;
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }

img { max-width: 100%; height: auto; display: block; }
a { color: var(--cobalt); text-decoration: underline; text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
main:focus { outline: none; }
h1, h2, h3, h4, h5, h6 { font-family: var(--display); color: var(--ink); }
strong, b { font-weight: 600; }
.muted { color: var(--text-muted); }
.measure { width: 100%; max-width: calc(var(--reading) + var(--space-4)); margin: 0 auto; padding: 0 var(--space-2); }
.label { margin: 0; font-size: 18px; font-weight: 600; letter-spacing: 1px; line-height: 1.4; color: var(--text-muted); }

.skip-link {
  position: absolute; left: -9999px; top: 12px; z-index: 10;
  padding: 12px 16px; background: var(--ink); color: var(--surface);
  font-family: var(--mono); font-size: 13px; letter-spacing: 1px;
}
.skip-link:focus { left: 16px; }

/* Controls */
.button, .theme-toggle {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 var(--space-2);
  border: var(--hairline); border-radius: 0; background: var(--surface); color: var(--ink);
  font-family: var(--mono); font-size: 13px; line-height: 1.1; letter-spacing: 1px;
  text-decoration: none; cursor: pointer;
}
.button:hover, .theme-toggle:hover { background: var(--surface-hover); }
.button--accent { background: var(--chartreuse); color: var(--on-accent); border-color: var(--on-accent); }
.button--accent:hover { background: var(--accent-hover); }
.theme-toggle { min-height: 44px; }
.tag {
  display: inline-block; align-self: flex-start; padding: 6px 10px;
  border: var(--hairline); font-family: var(--mono); font-size: 13px; line-height: 1.1;
  letter-spacing: 1px; color: var(--ink); text-decoration: none;
}
a.tag--link:hover { background: var(--surface-hover); }
.nav-link { font-family: var(--mono); font-size: 16px; font-weight: 300; letter-spacing: 1px; color: var(--ink); text-underline-offset: 5px; }

/* Header: one rule under it, plain nav, current page shown with a heavier underline */
.site-header__inner {
  margin: 0 var(--gutter); min-height: 88px; border-bottom: var(--hairline);
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px var(--space-4);
}
.site-title { display: inline-flex; align-items: center; min-height: 44px; font-family: var(--display); font-size: 22px; font-weight: 400; color: var(--ink); text-decoration: none; }
.site-header__nav { display: flex; align-items: center; flex-wrap: wrap; gap: 12px 40px; }
.nav { margin: 0; padding: 0; list-style: none; }
.site-header .nav { display: flex; flex-wrap: wrap; column-gap: var(--space-4); }
.site-header .nav a {
  display: inline-flex; align-items: center; min-height: 44px;
  font-family: var(--mono); font-size: 15px; font-weight: 300; letter-spacing: 1px; color: var(--ink); text-underline-offset: 6px;
}
.site-header .nav a[aria-current="page"] { font-weight: 400; text-decoration-thickness: 2px; }
.theme-toggle { background: transparent; }

main { display: block; }

/* Sections: a rule above each heading, generous space between, no boxes */
.home { padding: 0 var(--gutter); }
.section { padding: 0 0 7.5rem; }
.listing .section, .read-next { padding-left: var(--gutter); padding-right: var(--gutter); }
.section__head {
  display: flex; align-items: baseline; justify-content: space-between; gap: var(--space-2);
  padding-top: var(--space-3); border-top: var(--hairline); margin-bottom: 2.5rem;
}
.section__head h2 { margin: 0; font-size: clamp(2rem, 3.2vw, 2.5rem); line-height: 1.1; font-weight: 400; }
.grid { display: grid; gap: 2.5rem; }
.grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: var(--space-5); row-gap: 4.5rem; }
.grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

/* Hero: photo and headline side by side */
.hero { padding: 6rem 0 7.5rem; display: grid; grid-template-columns: 25rem minmax(0, 1fr); gap: var(--space-7); align-items: center; }
.hero:not(:has(.hero__photo)) { grid-template-columns: minmax(0, 1fr); }
.hero__photo { position: relative; width: 25rem; aspect-ratio: 1; }
.hero__disc { position: absolute; left: 8%; top: 8%; width: 92%; height: 92%; border-radius: 50%; background: var(--chartreuse); }
.hero__img { position: absolute; left: 0; top: 0; width: 92%; height: 92%; border-radius: 50%; object-fit: cover; border: var(--hairline); background: var(--raised); }
.hero__text { display: flex; flex-direction: column; align-items: flex-start; gap: 1.75rem; }
.hero h1 { margin: 0; font-size: clamp(2.75rem, 6vw, 5rem); line-height: 1.05; font-weight: 400; color: var(--black); }
.hero__bio { margin: 0; max-width: 37.5rem; font-size: 1.3125rem; line-height: 1.6; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 12px; }

/* Controls */
.button--ink { background: var(--on-accent); color: #e9e9e9; border-color: var(--on-accent); }
.button--ink:hover { background: #3a3a3a; }

/* Newsletter sign-up */
.subscribe { width: 100%; max-width: 35rem; margin-top: 12px; padding-top: 1.75rem; border-top: 1px solid var(--rule); display: flex; flex-direction: column; gap: var(--space-2); }
.subscribe__intro { display: flex; flex-direction: column; gap: 4px; }
.subscribe__title { margin: 0; font-size: 1.25rem; line-height: 1.3; font-weight: 500; color: var(--ink); }
.subscribe__desc { margin: 0; font-size: 1rem; line-height: 1.6; color: var(--text-muted); }
.subscribe__field { display: flex; flex-direction: column; gap: 6px; }
.subscribe__label { font-family: var(--mono); font-size: 13px; letter-spacing: 1px; color: var(--ink); }
.subscribe__row { display: flex; align-items: stretch; }
.subscribe__input {
  flex-grow: 1; min-width: 0; min-height: 52px; padding: 0 var(--space-2);
  border: var(--hairline); border-right: 0; border-radius: 0; background: var(--raised); color: var(--ink);
  font: inherit; font-size: 1.0625rem; font-weight: 300;
}
.subscribe__input:focus-visible { outline-offset: -4px; }
.subscribe__button {
  display: inline-flex; align-items: center; gap: 10px; min-height: 52px; padding: 0 22px;
  border: var(--hairline); border-radius: 0; background: var(--ink); color: var(--surface);
  font-family: var(--mono); font-size: 13px; letter-spacing: 1px; cursor: pointer;
}
.subscribe__button:hover { background: var(--text-body); }
.subscribe__status { margin: 0; min-height: 1.6em; font-size: 0.9375rem; color: var(--text-body); }
.subscribe.error .subscribe__status { color: var(--danger); }

/* Cards: no boxes. A rounded image, then text. One link per card (the title); the card is clickable through it. */
.case-card, .post-card { position: relative; display: flex; flex-direction: column; gap: 1.25rem; }
.post-card { gap: var(--space-2); }
.case-card__img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: var(--radius-lg); }
.post-card__img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; border-radius: var(--radius-lg); }
.case-card__title { margin: -4px 0 0; font-size: 1.75rem; line-height: 1.25; font-weight: 500; }
.post-card__title { margin: -4px 0 0; font-size: 1.375rem; line-height: 1.35; font-weight: 500; }
.case-card__link, .post-card__link { color: var(--ink); text-underline-offset: 5px; text-decoration-thickness: 1px; }
.case-card:hover .case-card__link, .post-card:hover .post-card__link { text-decoration-thickness: 2px; }
.case-card__link::after, .post-card__link::after { content: ""; position: absolute; inset: 0; }
.case-card:focus-within, .post-card:focus-within { outline: 2px solid var(--ink); outline-offset: 8px; border-radius: 4px; }
.case-card a:focus-visible, .post-card a:focus-visible { outline: none; }
.case-card__excerpt, .post-card__excerpt { margin: 0; line-height: 1.7; }
.post-card__meta { margin: 0; font-family: var(--mono); font-size: 13px; letter-spacing: 1px; color: var(--text-muted); }

/* Projects: one featured chartreuse card beside a list */
.projects { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-5); align-items: start; }
.project-feature { min-height: 22.5rem; padding: var(--space-5); background: var(--chartreuse); color: var(--on-accent); display: flex; flex-direction: column; gap: var(--space-2); }
.project-feature__label { font-family: var(--mono); font-size: 13px; letter-spacing: 1px; }
.project-feature h3 { margin: auto 0 0; font-size: clamp(2rem, 3.6vw, 3rem); line-height: 1.1; font-weight: 400; color: var(--on-accent); }
.project-feature h3 a { color: var(--on-accent); text-underline-offset: 6px; }
.project-feature p { margin: 0; font-size: 1.1875rem; line-height: 1.6; }
.project-list { margin: 0; padding: 0; list-style: none; }
.project-list li { padding: var(--space-3) 0; display: flex; flex-direction: column; gap: 6px; }
.project-list li + li { border-top: 1px solid var(--rule); }
.project-list h3 { margin: 0; font-size: 1.5rem; line-height: 1.3; font-weight: 500; }
.project-list h3 a { color: var(--ink); text-underline-offset: 5px; }
.project-list p { margin: 0; font-size: 1.0625rem; line-height: 1.7; }

/* Work experience: logo on the left, role and years on the right (the snippet is in the README) */
.experience > *:first-child { margin-top: 0; }
.xp { margin: 0; padding: 0 !important; list-style: none; }
.xp > li { margin: 0 !important; display: grid; grid-template-columns: 12.5rem minmax(0, 1fr); gap: var(--space-4); padding: var(--space-4) 0; align-items: start; }
.xp > li + li { border-top: 1px solid var(--rule); }
.xp__logo { display: block; width: auto; max-width: 10rem; height: auto; max-height: 3rem; object-fit: contain; object-position: left center; }
.xp h3 { margin: 0 !important; font-size: 1.5rem !important; line-height: 1.3; font-weight: 500; }
.xp__org { margin: 4px 0 0 !important; font-size: 1.125rem; font-weight: 400; color: var(--text-muted); }
.xp__years { font-family: var(--mono); font-size: 13px; letter-spacing: 1px; }
.xp__desc { margin: 10px 0 0 !important; line-height: 1.7; }
/* Logos are supplied in black; flip them for the dark theme. */
:root[data-theme="dark"] .xp__logo { filter: invert(1); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .xp__logo { filter: invert(1); } }

/* Contact: a full-width chartreuse band. Text on it is always the dark on-accent colour. */
.contact {
  margin: 0 calc(var(--gutter) * -1); padding: 6rem var(--gutter);
  background: var(--chartreuse); color: var(--on-accent);
  display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: var(--space-5); align-items: end;
}
.contact h2 { margin: 0; font-size: clamp(2.5rem, 5.5vw, 4.5rem); line-height: 1.05; font-weight: 400; color: var(--on-accent); }
.contact__body { display: flex; flex-direction: column; gap: 1.25rem; align-items: flex-start; }
.contact p { margin: 0; font-size: 1.25rem; line-height: 1.6; }
.contact a:not(.button) { color: var(--on-accent); font-weight: 400; text-underline-offset: 4px; }
.contact :focus-visible { outline-color: var(--on-accent); }

/* Listing pages */
.page-head { padding: var(--space-7) var(--gutter) var(--space-5); display: flex; flex-direction: column; gap: var(--space-2); }
.page-head h1 { margin: 0; font-size: clamp(2.5rem, 5vw, 4rem); line-height: 1.2; font-weight: 400; color: var(--black); }
.author-head { align-items: flex-start; }
.listing__grid { padding: 0 var(--gutter); }
.listing > p { margin: 0; padding: 0 var(--gutter); }
.pagination { display: flex; justify-content: space-between; gap: var(--space-2); margin: var(--space-4) var(--gutter) 0; font-family: var(--mono); font-size: 13px; letter-spacing: 1px; }

/* Post header: byline, tag, title, standfirst, share */
.post-head { padding-top: var(--space-6); margin-bottom: var(--space-5); display: flex; flex-direction: column; gap: var(--space-3); }
.byline { margin: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; font-family: var(--mono); font-size: 13px; letter-spacing: 1px; color: var(--text-muted); }
.byline__avatar { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; border: var(--hairline); }
.byline__name { color: var(--ink); }
.post-head h1 { margin: 0; font-size: clamp(2.5rem, 5vw, 4rem); line-height: 1.1; font-weight: 400; color: var(--black); }
.standfirst { margin: 0; font-size: 1.375rem; line-height: 1.6; color: var(--text-muted); }

.share { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; font-family: var(--mono); font-size: 13px; letter-spacing: 1px; }
.share__label { color: var(--text-muted); }
.share__list { margin: 0; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: 8px; }
.share__list a, .share__copy-btn {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 12px;
  border: var(--hairline); background: var(--surface); color: var(--ink);
  font: inherit; text-decoration: none; cursor: pointer;
}
.share__list a:hover, .share__copy-btn:hover { background: var(--surface-hover); }
.share__copy { display: flex; align-items: center; gap: 8px; }
.share__copy[hidden] { display: none; }
.share__copy-status { color: var(--text-muted); }

.post-hero { max-width: calc(var(--wide) + var(--space-4)); margin: 0 auto var(--space-5); padding: 0 var(--space-2); }
.post-hero img { width: 100%; border-radius: var(--radius-lg); }
.post-hero figcaption { max-width: var(--reading); margin: 12px auto 0; font-size: 16px; line-height: 1.6; color: var(--text-muted); }

/* Post footer */
.post-foot { margin-top: var(--space-6); display: flex; flex-direction: column; gap: var(--space-4); }
.post-tags { margin: 0; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: 8px; }
.author-box { display: flex; gap: var(--space-3); align-items: flex-start; padding: var(--space-4); border: var(--hairline); background: var(--raised); }
.author-box__avatar { width: 72px; height: 72px; border-radius: 50%; object-fit: cover; border: var(--hairline); flex-shrink: 0; }
.author-box__name { margin: 0; font-size: 1.25rem; font-weight: 500; color: var(--ink); }
.author-box__bio { margin: 6px 0 0; line-height: 1.7; }
.prev-next { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border-top: var(--hairline); border-bottom: var(--hairline); }
.prev-next a { padding: var(--space-3) 0; display: flex; flex-direction: column; gap: 6px; color: var(--ink); text-decoration: none; }
.prev-next__prev { padding-right: var(--space-3) !important; border-right: var(--hairline); }
.prev-next__next { grid-column: 2; text-align: right; align-items: flex-end; padding-left: var(--space-3) !important; }
.prev-next__label { font-family: var(--mono); font-size: 13px; letter-spacing: 1px; color: var(--text-muted); }
.prev-next__title { font-size: 1.25rem; font-weight: 400; text-decoration: underline; text-underline-offset: 5px; }
.prev-next a:hover .prev-next__title { text-decoration-thickness: 2px; }
.comments { margin-top: var(--space-5); }
.read-next { margin-top: var(--space-7); }

/* Content: reading measure, with wide and full cards breaking out */
.gh-content { display: flex; flex-direction: column; align-items: center; padding: 0 var(--space-2); font-size: 1.25rem; line-height: 1.6; }
.gh-content > * { width: 100%; max-width: var(--reading); margin-top: 0; margin-bottom: 1.1em; }
.gh-content > .kg-width-wide { max-width: var(--wide); }
.gh-content > .kg-width-full { max-width: none; width: calc(100% + var(--space-4)); margin-left: calc(var(--space-2) * -1); margin-right: calc(var(--space-2) * -1); }
.gh-content > .kg-width-full img { border-radius: 0; }
.gh-content h2 { margin-top: 2.4em; margin-bottom: 0.6em; font-size: 3rem; line-height: 1.1; font-weight: 400; }
.gh-content h3 { margin-top: 1.8em; margin-bottom: 0.5em; font-size: 2rem; line-height: 1.2; font-weight: 500; }
.gh-content h4 { margin-top: 1.6em; margin-bottom: 0.4em; font-size: 1.5rem; line-height: 1.4; font-weight: 600; }

/* Case studies: H2 = small section label; the H3 after it = the headline */
.is-case-study > h2 { margin-top: var(--space-7); margin-bottom: var(--space-2); font-family: var(--sans); font-size: 18px; font-weight: 600; letter-spacing: 1px; line-height: 1.4; color: var(--text-muted); }
.is-case-study > h2 + h3 { margin-top: 0; margin-bottom: var(--space-3); font-size: clamp(1.75rem, 3vw, 2rem); }

.gh-content ul, .gh-content ol { padding-left: 1.3em; }
.gh-content li + li { margin-top: 0.4em; }
.gh-content hr { border: 0; border-top: var(--hairline); margin: 2.4em auto; }
.gh-content blockquote:not(.kg-blockquote-alt) { margin-left: 0; margin-right: 0; padding: var(--space-5); border: var(--hairline); background: var(--raised); font-size: 2rem; line-height: 1.35; font-weight: 400; color: var(--ink); }
.gh-content .kg-blockquote-alt { font-size: 2rem; line-height: 1.35; font-weight: 400; text-align: center; color: var(--ink); padding: 0 var(--space-3); }
.gh-content code { font-family: var(--mono); font-size: 0.85em; background: var(--raised); padding: 0.1em 0.3em; }
.gh-content pre { font-family: var(--mono); font-size: 15px; line-height: 1.55; background: var(--raised); border: var(--hairline); padding: var(--space-3); overflow-x: auto; }
.gh-content pre code { background: none; padding: 0; }
.gh-content figure { margin-left: 0; margin-right: 0; }
.gh-content .kg-card { margin-top: 1.6em; margin-bottom: 1.6em; }
.gh-content .kg-image { border-radius: var(--radius-lg); margin: 0 auto; }
.gh-content .kg-width-full .kg-image { border-radius: 0; }
.gh-content figcaption { max-width: var(--reading); margin: 12px auto 0; font-size: 16px; line-height: 1.6; color: var(--text-muted); text-align: left; }
.gh-content .kg-gallery-image img { border-radius: var(--radius-lg); }
.gh-content .kg-button-card a.kg-btn { border-radius: 0; border: var(--hairline); font-family: var(--mono); font-size: 13px; letter-spacing: 1px; }
.gh-content .kg-callout-card { border-radius: 0; border: var(--hairline); }
.gh-content table { width: 100%; border-collapse: collapse; font-size: 17px; line-height: 1.5; display: block; overflow-x: auto; border: var(--hairline); }
.gh-content caption { caption-side: top; text-align: left; padding-bottom: 12px; font-size: 16px; color: var(--text-muted); }
.gh-content th { text-align: left; vertical-align: bottom; padding: 14px 16px; border: var(--hairline); background: var(--raised); font-size: 15px; font-weight: 700; letter-spacing: 1px; color: var(--ink); }
.gh-content td { vertical-align: top; padding: 14px 16px; border: var(--hairline); }

/* Case study snippets: details, key numbers, summary, figure descriptions */
.gh-content > .cs-meta, .gh-content > .cs-stats { max-width: var(--wide); }
.cs-meta { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-top: var(--hairline); border-left: var(--hairline); line-height: 1.4; }
.cs-meta > div { padding: var(--space-3); border-right: var(--hairline); border-bottom: var(--hairline); }
.cs-meta dt { font-size: 15px; font-weight: 700; letter-spacing: 1px; color: var(--text-muted); }
.cs-meta dd { margin: 8px 0 0; font-size: 18px; color: var(--ink); }
.cs-stats { list-style: none; padding: 0 !important; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-top: var(--hairline); border-left: var(--hairline); margin-top: var(--space-3) !important; }
.cs-stats li { margin: 0 !important; padding: var(--space-4); border-right: var(--hairline); border-bottom: var(--hairline); display: flex; flex-direction: column; gap: 10px; }
.cs-stats strong { font-family: var(--display); font-size: 4rem; line-height: 1; font-weight: 400; color: var(--black); }
.cs-stats span { font-size: 18px; line-height: 1.5; color: var(--text-muted); }
.cs-tldr { padding: var(--space-5); border: 1px solid var(--on-accent); background: var(--chartreuse); color: var(--on-accent); }
.cs-tldr .label { color: var(--on-accent); }
.cs-tldr p:not(.label) { margin: var(--space-2) 0 0; font-size: 1.625rem; line-height: 1.5; }
.gh-content details:not(.deep) { font-size: 16px; line-height: 1.6; border-top: var(--hairline); padding-top: 12px; }
.gh-content details:not(.deep) > summary { font-family: var(--mono); font-size: 13px; letter-spacing: 1px; color: var(--cobalt); text-decoration: underline; cursor: pointer; min-height: 32px; }
.gh-content details:not(.deep) p { margin: 12px 0 0; }

/* "Go deeper" panels */
.gh-content details.deep, .gh-content .kg-toggle-card { border: var(--hairline); border-radius: 0; background: var(--surface); padding: 0; font-size: 1.125rem; line-height: 1.7; }
.gh-content details.deep > summary { list-style: none; display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 0 20px; font-family: var(--mono); font-size: 13px; letter-spacing: 1px; color: var(--ink); cursor: pointer; }
.gh-content details.deep > summary::-webkit-details-marker { display: none; }
.gh-content details.deep > summary::before { content: ""; flex-shrink: 0; width: 8px; height: 8px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(-45deg); margin-right: 4px; }
.gh-content details.deep[open] > summary::before { transform: rotate(45deg); }
.gh-content details.deep > summary:hover { background: var(--raised); }
.gh-content details.deep[open] > summary { border-bottom: var(--hairline); }
.gh-content details.deep > summary .deep__meta { margin-left: auto; color: var(--text-muted); }
.gh-content details.deep > .deep__body { padding: var(--space-3); }
.gh-content details.deep > .deep__body > * { margin: 0 0 1em; }
.gh-content details.deep > .deep__body > *:last-child { margin-bottom: 0; }
.gh-content .kg-toggle-card .kg-toggle-heading { padding: 16px 20px; }
.gh-content .kg-toggle-card h4.kg-toggle-heading-text { margin: 0; font-family: var(--mono); font-size: 13px; font-weight: 400; letter-spacing: 1px; color: var(--ink); }
.gh-content .kg-toggle-card .kg-toggle-content { padding: 0 20px 20px; }

/* Table of contents, built from H2s by site.js */
.toc { display: flex; gap: 12px var(--space-4); align-items: baseline; padding: 20px 0; border-top: var(--hairline); border-bottom: var(--hairline); margin-top: var(--space-5) !important; }
.toc h2 { flex-shrink: 0; margin: 0 !important; font-family: var(--sans); font-size: 15px !important; font-weight: 700; letter-spacing: 1px; color: var(--ink) !important; }
.toc ol { margin: 0; padding: 0 !important; list-style: none; display: flex; flex-wrap: wrap; column-gap: var(--space-3); row-gap: 4px; }
.toc li { margin: 0 !important; }
.toc a { display: inline-flex; min-height: 32px; align-items: center; font-family: var(--mono); font-size: 15px; font-weight: 300; letter-spacing: 1px; color: var(--ink); text-underline-offset: 5px; }

/* Footnotes */
.footnote-ref { position: relative; font-family: var(--mono); font-size: 13px; line-height: 0; }
.footnote-ref a { padding: 2px 3px; }
.fn-tip { position: absolute; left: -12px; bottom: calc(100% + 14px); z-index: 5; width: min(320px, 80vw); padding: var(--space-2); border: var(--hairline); background: var(--raised); color: var(--ink); font-family: var(--sans); font-size: 16px; line-height: 1.6; font-weight: 300; text-align: left; }
.fn-tip[hidden] { display: none; }
.footnotes { font-size: 16px; line-height: 1.6; border-top: var(--hairline); padding-top: var(--space-4); margin-top: var(--space-6) !important; }
.footnotes::before { content: "Notes"; display: block; margin-bottom: 14px; font-size: 18px; font-weight: 600; letter-spacing: 1px; color: var(--text-muted); }
.footnotes hr { display: none; }
.footnote-backref { font-family: var(--mono); font-size: 13px; }

/* Footer: three columns, one light rule above the copyright line */
.site-footer { margin-top: var(--space-7); padding: 3.5rem var(--gutter) 2.5rem; border-top: 1px solid var(--rule); font-family: var(--mono); font-size: 13px; letter-spacing: 1px; }
.home-template .site-footer { margin-top: 0; border-top: 0; }
.site-footer__top { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr); gap: var(--space-4); }
.site-footer__about { display: flex; flex-direction: column; gap: 10px; }
.site-footer__about .site-title { min-height: 0; }
.site-footer__about p { margin: 0; max-width: 38ch; font-family: var(--sans); font-size: 16px; letter-spacing: 0; line-height: 1.6; color: var(--text-body); }
.site-footer .nav, .social { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 4px; }
.site-footer .nav a, .social a { display: inline-flex; align-items: center; min-height: 32px; color: var(--ink); text-underline-offset: 4px; }
.site-footer__bottom { margin-top: var(--space-5); padding-top: 1.25rem; border-top: 1px solid var(--rule); display: flex; justify-content: space-between; align-items: center; gap: var(--space-2); }
.site-footer__bottom p { margin: 0; color: var(--text-muted); }
.back-to-top { color: var(--ink); text-underline-offset: 4px; }

/* Small screens */
@media (max-width: 960px) {
  .hero { grid-template-columns: 1fr; gap: var(--space-4); padding: var(--space-5) 0 var(--space-6); }
  .hero__photo { width: 12.25rem; }
  .grid--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .projects { grid-template-columns: 1fr; gap: var(--space-2); }
  .contact { grid-template-columns: 1fr; gap: var(--space-3); }
  .site-footer__top { grid-template-columns: 1fr 1fr; }
  .site-footer__about { grid-column: 1 / -1; }
}
@media (max-width: 700px) {
  body { font-size: 1.0625rem; }
  .site-header__inner { min-height: 72px; padding-bottom: 8px; }
  .site-header .nav { column-gap: 20px; }
  .section { padding-bottom: 4.5rem; }
  .section__head { padding-top: 20px; margin-bottom: 1.75rem; }
  .section__head h2 { font-size: 2rem; }
  .grid--2, .grid--3 { grid-template-columns: 1fr; row-gap: var(--space-5); }
  .case-card__title { font-size: 1.375rem; }
  .project-feature { min-height: 0; padding: 1.75rem 1.5rem; }
  .project-feature h3 { margin-top: 0; }
  .xp > li { grid-template-columns: 1fr; gap: 14px; padding: var(--space-3) 0; }
  .xp__logo { max-height: 2.25rem; }
  .xp h3 { font-size: 1.25rem !important; }
  .subscribe__row { flex-direction: column; gap: 8px; }
  .subscribe__input { border-right: var(--hairline); }
  .contact { padding: 3.5rem var(--gutter); }
  .page-head { padding: var(--space-5) var(--gutter) var(--space-4); }
  .cs-meta { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cs-stats { grid-template-columns: 1fr; }
  .cs-stats strong { font-size: 3rem; }
  .cs-tldr { padding: var(--space-3); }
  .toc { flex-direction: column; gap: 8px; }
  .is-case-study > h2 { margin-top: var(--space-6); }
  .author-box { flex-direction: column; padding: var(--space-3); }
  .prev-next { grid-template-columns: 1fr; }
  .prev-next__prev { border-right: 0; border-bottom: var(--hairline); padding-right: 0 !important; }
  .prev-next__next { grid-column: auto; text-align: left; align-items: flex-start; padding-left: 0 !important; }
  .site-footer { padding: var(--space-4) var(--gutter) var(--space-4); }
  .site-footer__top { grid-template-columns: 1fr 1fr; }
  .site-footer__bottom { flex-direction: column; align-items: flex-start; }
}

/* Accessibility audit fixes (2.1.2) */
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.gh-content iframe, .gh-content video, .gh-content embed { display: block; max-width: 100%; }
.gh-content iframe[src*="youtube"], .gh-content iframe[src*="vimeo"] { width: 100%; height: auto; aspect-ratio: 16 / 9; }
.gh-content a, .cs-meta dd { overflow-wrap: anywhere; }

/* Ghost comments (2.1.3): the comments iframe's document is always color-scheme "normal".
   When the page is dark, the browser paints an opaque white backdrop behind a frame whose
   scheme doesn't match, which put Ghost's white "dark mode" text on white. Match the frame. */
.comments iframe { color-scheme: normal; }

/* a11y-webring.club member links (2.1.4) */
.a11y-webring-club { margin-top: var(--space-5); padding-top: 1.25rem; border-top: 1px solid var(--rule); display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px var(--space-3); }
.a11y-webring-club h2 { margin: 0; font-family: var(--mono); font-size: 13px; font-weight: 400; letter-spacing: 1px; color: var(--ink); }
.a11y-webring-club p { margin: 0; color: var(--text-muted); }
.a11y-webring-club p a { color: var(--ink); }
.a11y-webring-club ul { margin: 0 0 0 auto; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: 4px var(--space-3); }
.a11y-webring-club ul a { display: inline-flex; align-items: center; min-height: 32px; color: var(--ink); text-underline-offset: 4px; }
.a11y-webring-club + .site-footer__bottom { margin-top: var(--space-3); }
@media (max-width: 700px) { .a11y-webring-club { flex-direction: column; align-items: flex-start; } .a11y-webring-club ul { margin-left: 0; } }

/* Contact form (2.2.0) — paste snippets/contact-form.html into an HTML card */
.gh-content .contact-form { display: flex; flex-direction: column; gap: var(--space-3); margin-top: var(--space-4); padding-top: var(--space-4); border-top: 1px solid var(--rule); }
.contact-form__title { margin: 0 !important; }
.contact-form__note { margin: 0 !important; color: var(--text-muted); }
.contact-form__field { display: flex; flex-direction: column; gap: 6px; }
.contact-form label { font-family: var(--mono); font-size: 13px; letter-spacing: 1px; color: var(--ink); }
.contact-form input, .contact-form select, .contact-form textarea {
  width: 100%; min-height: 52px; padding: 12px var(--space-2); border: var(--hairline); border-radius: 0;
  background: var(--raised); color: var(--ink); font: inherit; font-size: 1.0625rem; font-weight: 300;
}
.contact-form textarea { min-height: 10rem; resize: vertical; line-height: 1.6; }
.contact-form select { appearance: none; padding-right: 44px; background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%); background-position: calc(100% - 22px) 50%, calc(100% - 16px) 50%; background-size: 6px 6px; background-repeat: no-repeat; }
.contact-form input:focus-visible, .contact-form select:focus-visible, .contact-form textarea:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.contact-form [aria-invalid="true"] { border-color: var(--danger); border-width: 2px; }
.contact-form__hint { margin: 0 !important; font-size: 0.9375rem; color: var(--text-muted); }
.contact-form__error { margin: 0 !important; font-size: 0.9375rem; font-weight: 500; color: var(--danger); }
.contact-form__error::before { content: "Error: "; font-weight: 700; }
.contact-form__summary { padding: var(--space-2) var(--space-3); border: 2px solid var(--danger); }
.contact-form__summary:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.contact-form__summary-title { margin: 0 0 8px !important; font-size: 1.125rem !important; }
.contact-form__summary ul { margin: 0 !important; padding-left: 1.25rem; }
.contact-form__summary a { color: var(--danger); }
.contact-form__trap { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.contact-form__submit {
  align-self: flex-start; display: inline-flex; align-items: center; min-height: 52px; padding: 0 22px;
  border: var(--hairline); border-radius: 0; background: var(--ink); color: var(--surface);
  font-family: var(--mono); font-size: 13px; letter-spacing: 1px; cursor: pointer;
}
.contact-form__submit:hover { background: var(--text-body); }
.contact-form__submit[aria-disabled="true"] { opacity: 0.7; cursor: progress; }
.contact-form__status { margin: 0 !important; min-height: 1.6em; color: var(--text-body); }
.contact-form__status:focus-visible { outline: 2px solid var(--ink); outline-offset: 4px; }
.contact-form.is-sent .contact-form__status { font-size: 1.125rem; color: var(--ink); }
.contact-form.is-failed .contact-form__status { color: var(--danger); }

/* 2.4.0 About page: skill groups (hairline grid) and compact skill lists */
.gh-content > .skill-grid, .gh-content > .skill-lists { max-width: var(--wide); }
.skill-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-top: var(--hairline); border-left: var(--hairline); }
.skill-grid > div { padding: var(--space-3); border-right: var(--hairline); border-bottom: var(--hairline); }
.skill-grid h3, .skill-lists h3 { margin: 0 0 14px !important; font-family: var(--mono); font-size: 14px !important; font-weight: 700; letter-spacing: 1px; line-height: 1.4; text-transform: uppercase; color: var(--text-muted); }
.skill-grid ul, .skill-lists ul { list-style: none; margin: 0; padding: 0 !important; font-size: 17px; line-height: 1.45; color: var(--ink); }
.skill-grid li + li { margin-top: 10px; }
.skill-lists { display: grid; gap: var(--space-5); }
.skill-lists > div { border-top: var(--hairline); padding-top: var(--space-2); }
.skill-lists ul { columns: 3 13rem; column-gap: var(--space-4); }
.skill-lists li { margin: 0 !important; padding: 7px 0; break-inside: avoid; border-bottom: 1px solid var(--rule); }
@media (max-width: 1000px) { .skill-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .skill-grid { grid-template-columns: 1fr; } }

/* 2.6.0 Logo: inline SVG drawn in currentColor, so it follows light and dark mode */
.site-title--logo { min-height: 44px; color: var(--ink); }
.site-logo { display: block; width: auto; height: 40px; }
.site-footer__about .site-logo { height: 36px; }

/* 2.7.0 Dropdown navigation (disclosure pattern) */
.site-header .nav-item { position: relative; display: flex; align-items: center; }
.nav-toggle { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0; border: 0; background: none; cursor: pointer;
  font-family: var(--mono); font-size: 15px; font-weight: 300; letter-spacing: 1px; color: var(--ink); }
.nav-toggle--icon { min-width: 28px; justify-content: center; margin-left: 2px; }
.nav-toggle svg { transition: transform .15s ease; }
.nav-toggle[aria-expanded="true"] svg { transform: rotate(180deg); }
.nav-toggle:not(.nav-toggle--icon):hover > span, .is-current-parent > .nav-toggle > span { text-decoration: underline; text-underline-offset: 6px; }
.is-current-parent > .nav-toggle > span { text-decoration-thickness: 2px; }
.nav-sub { position: absolute; top: 100%; left: -16px; z-index: 30; min-width: 15rem; max-width: calc(100vw - 2 * var(--gutter));
  margin: 0; padding: 8px 0; list-style: none; background: var(--surface); border: var(--hairline); }
.nav-sub[hidden] { display: none; }
.nav-sub--right { left: auto; right: 0; }
.site-header .nav-sub a { display: flex; width: 100%; padding: 0 16px; text-decoration: none; }
.site-header .nav-sub a:hover, .site-header .nav-sub a[aria-current="page"] { text-decoration: underline; }
.site-header .nav-sub a:hover { background: var(--surface-hover); }
@media (prefers-reduced-motion: reduce) { .nav-toggle svg { transition: none; } }

/* 2.8.0 Theme switch: "Dark mode" label + on/off switch. State shows by thumb position and icon, not color alone. */
.theme-toggle { gap: 12px; padding: 0 4px; border: 0; background: transparent; font-size: 14px; }
.theme-toggle:hover { background: transparent; }
.theme-toggle:hover .theme-toggle__label { text-decoration: underline; text-underline-offset: 5px; }
.theme-toggle__track { position: relative; flex: none; width: 46px; height: 26px; border: 1.5px solid var(--ink); border-radius: 999px; }
.theme-toggle__thumb { position: absolute; top: 2px; left: 2px; display: grid; place-items: center; width: 19px; height: 19px; border-radius: 50%;
  background: var(--ink); color: var(--surface); transition: transform .18s ease; }
.theme-toggle__thumb svg { display: block; }
.theme-toggle .icon-moon, .theme-toggle[aria-checked="true"] .icon-sun { display: none; }
.theme-toggle[aria-checked="true"] .icon-moon { display: block; }
.theme-toggle[aria-checked="true"] .theme-toggle__thumb { transform: translateX(20px); }
@media (prefers-reduced-motion: reduce) { .theme-toggle__thumb { transition: none; } }
@media (forced-colors: active) { .theme-toggle__thumb { background: ButtonText; color: ButtonFace; } .theme-toggle__track { border-color: ButtonText; } }
