/* Design tokens. Dark engineering editorial, set 22 September 2026.
   Every colour on the site resolves through this block. */
:root {
  --bg: #0A0C12;
  --surface: #10131B;
  --surface-2: #161A25;
  --panel: #0C0E15;

  --accent: #818CF8;
  --accent-strong: #A5B0FF;
  --accent-ring: #A5B0FF;
  --accent-ink: #0A0C12;
  --accent-wash: rgba(129, 140, 248, 0.14);
  --accent-a08: rgba(129, 140, 248, 0.08);
  --accent-a16: rgba(129, 140, 248, 0.16);
  --accent-a28: rgba(129, 140, 248, 0.30);
  --accent-a65: rgba(129, 140, 248, 0.65);

  --ink: #E9ECF5;
  --ink-deep: #F4F6FB;
  --ink-soft: #C3CAD9;
  --ink-muted: #9AA3B8;
  --ink-subtle: #8791A6;

  --surface-sunken: #10131B;
  --border: rgba(163, 175, 204, 0.16);
  --border-soft: rgba(163, 175, 204, 0.12);
  --border-softer: rgba(163, 175, 204, 0.10);
  --shadow-soft: rgba(0, 0, 0, 0.5);

  --ok: #4ADE80;
  --bad: #F87171;
  --flame: #FB923C;

  --font-display: "Space Grotesk", Inter, system-ui, sans-serif;
  --font-body: Inter, system-ui, -apple-system, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --act-0: rgba(163, 175, 204, 0.10);
  --act-1: rgba(129, 140, 248, 0.28);
  --act-2: rgba(129, 140, 248, 0.50);
  --act-3: rgba(129, 140, 248, 0.75);
  --act-4: #A5B0FF;

  --field: #0C0E15;
  --panel-2: #161A25;
  --panel-ink: #E9ECF5;
  --panel-ink-muted: #9AA3B8;

  --radius-card: 16px;
  --radius-pill: 999px;
}

:root {
  color-scheme: dark;
  font-family: var(--font-body);
  background:
    radial-gradient(ellipse 55% 38% at 18% 0%, rgba(99, 102, 241, 0.14), transparent),
    radial-gradient(ellipse 45% 32% at 92% 12%, rgba(139, 92, 246, 0.08), transparent),
    var(--bg);
  color: var(--ink);
  font-size: 16px;
}

h1, h2, h3, .site-wordmark {
  font-family: var(--font-display);
  letter-spacing: -0.02em;
}

* {
  box-sizing: border-box;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  border: 0;
  white-space: nowrap;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  line-height: 1.75;
  background: transparent;
}

img,
svg {
  max-width: 100%;
}

a {
  color: var(--accent);
  transition: color 180ms ease;
}

a:hover {
  color: var(--accent-strong);
}

button,
input,
textarea {
  font: inherit;
}

.container {
  width: min(1180px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 3rem 0;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(10, 12, 18, 0.78);
  border-bottom: 1px solid rgba(255,255,255,0.06);
  color: white;
  backdrop-filter: blur(14px);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.25rem;
  padding: 1rem 0;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.25rem;
  margin: 0 auto;
}

.site-nav a {
  color: rgba(255,255,255,0.8);
  border-radius: 999px;
  padding: 0.45rem 0.75rem;
  text-decoration: none;
  font-weight: 500;
  line-height: 1.2;
  transition: background 180ms ease, color 180ms ease;
}

.site-nav a:hover {
  background: rgba(255,255,255,0.1);
  color: #fff;
}

.site-nav a:focus-visible,
.nav-toggle:focus-visible + .nav-toggle-label {
  outline: 3px solid var(--accent-ring);
  outline-offset: 3px;
}

.nav-toggle {
  display: none;
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.nav-toggle-label {
  display: none;
}

.hero {
  margin-top: 2rem;
  padding: 2.5rem 0;
}

.hero .eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.24em;
  font-size: 0.8rem;
  color: var(--ink-muted);
  margin-bottom: 1rem;
}

.hero h1 {
  margin: 0;
  font-size: clamp(3rem, 4vw, 4.5rem);
  line-height: 0.95;
}

.accent {
  color: var(--accent);
}

.intro {
  max-width: 680px;
  margin: 1.2rem 0 1.8rem;
  color: var(--ink-muted);
  font-size: 1.05rem;
}

.hero-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3.2rem;
  padding: 0 1.6rem;
  border: 1px solid var(--accent-a28);
  border-radius: 0.85rem;
  box-shadow: 0 10px 24px var(--accent-a16);
  text-decoration: none;
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 700;
  letter-spacing: 0.02em;
  transition: transform 180ms ease, background 180ms ease;
}

.button:hover {
  transform: translateY(-1px);
  background: var(--accent-strong);
  /* held against the generic a:hover, which ties on specificity and
     would otherwise recolour the label (and any icon drawn in
     currentColor) to the link accent */
  color: var(--accent-ink);
}

.button-secondary {
  background: var(--surface-sunken);
  color: var(--ink-deep);
  border: 1px solid var(--border);
}

.button-secondary:hover {
  background: var(--accent-wash);
  color: var(--ink-deep);
}

.skills-grid div,
.contact-form {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: 1.1rem;
  box-shadow: 0 22px 55px rgba(0,0,0,0.35);
}

.section {
  margin-top: 2.5rem;
}

.section h2 {
  margin-bottom: 1.25rem;
  font-size: clamp(2.1rem, 2.5vw, 2.6rem);
  letter-spacing: -0.03em;
}

.card-grid,
.skills-grid,
.contact-grid {
  display: grid;
  gap: 1.5rem;
}

@media (max-width: 1144px) {
  .card-grid {
    grid-auto-columns: calc((100% - 3rem) / 3);
    overflow-x: scroll;
    padding-bottom: 1.25rem;
    scrollbar-color: var(--accent-a65) transparent;
    scrollbar-gutter: stable;
  }

  .card-grid::-webkit-scrollbar {
    height: 0.85rem;
  }

  .card-grid::-webkit-scrollbar-thumb {
    background: var(--accent-a65);
  }
}

.section-intro {
  max-width: 640px;
  margin: 0.25rem 0 0;
  color: var(--ink-muted);
}

.featured-blog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.75rem;
  margin-top: 6rem;
}

.featured-blog-header h2,
.featured-blog-header .section-intro {
  margin: 0;
}

.featured-blog-header .section-intro {
  text-align: right;
}

.featured-blog-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(280px, 0.75fr);
  gap: 1.5rem;
  align-items: stretch;
}

.featured-blog-stage {
  min-height: 22rem;
}

.featured-post {
  display: none;
  min-height: 100%;
  padding: 1.75rem;
  border: 1px solid var(--border-soft);
  border-radius: 1.1rem;
  background: var(--surface);
  box-shadow: 0 22px 55px rgba(0,0,0,0.35);
  color: var(--ink-muted);
  text-decoration: none;
}

.featured-post.is-active {
  display: grid;
  align-content: start;
  gap: 0.85rem;
}

.featured-post-link {
  display: grid;
  gap: 0.85rem;
  color: inherit;
  text-decoration: none;
}

.featured-post h3 {
  margin: 0;
  color: var(--ink);
  font-size: clamp(1.65rem, 3vw, 2.4rem);
  line-height: 1.08;
}

.featured-post p {
  margin: 0;
  color: var(--ink-muted);
}

.featured-post-excerpt {
  display: -webkit-box;
  overflow: hidden;
  color: var(--ink-muted);
  line-height: 1.55;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.featured-post-excerpt p {
  display: inline;
}

.featured-post-excerpt strong {
  color: var(--ink);
  font-weight: 800;
}

.featured-post .post-meta {
  margin: 0;
  color: var(--ink-subtle);
}

.featured-post:hover h3,
.featured-post-link:focus-visible h3 {
  color: var(--accent);
}

.featured-post-link:focus-visible {
  outline: 3px solid var(--accent-ring);
  outline-offset: 4px;
}

.featured-playlist {
  display: grid;
  gap: 0.75rem;
}

.featured-playlist button {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.85rem;
  align-items: center;
  width: 100%;
  padding: 0.95rem;
  border: 1px solid var(--border-softer);
  border-radius: 1rem;
  background: var(--surface);
  color: var(--ink-soft);
  cursor: pointer;
  text-align: left;
  transition: border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

.featured-playlist button:hover,
.featured-playlist button:focus-visible,
.featured-playlist button.is-active {
  border-color: var(--accent-a28);
  box-shadow: 0 14px 32px rgba(0,0,0,0.4);
  transform: translateY(-1px);
}

.featured-playlist button:focus-visible {
  outline: 3px solid var(--accent-ring);
  outline-offset: 3px;
}

.featured-playlist button.is-active {
  background: var(--accent-a16);
}

.featured-playlist-date {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 3.4rem;
  height: 2.25rem;
  padding: 0 0.55rem;
  border-radius: 0.75rem;
  background: var(--accent-a16);
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 800;
}

.featured-playlist button > span:last-child {
  display: grid;
  gap: 0.1rem;
  min-width: 0;
}

.featured-playlist strong {
  color: var(--ink);
  line-height: 1.25;
}

.featured-playlist button > span:last-child span {
  color: var(--ink-subtle);
  font-size: 0.9rem;
}

.featured-blog-see-all {
  display: flex;
  width: fit-content;
  margin: 1.25rem auto 0;
  padding: 0.75rem 1.25rem;
  /* border: 1px solid var(--border); */
  border-radius: 999px;
  /* background: var(--surface-sunken); */
  color: var(--ink-deep);
  font-weight: 700;
  text-decoration: none;
  transition: transform 180ms ease, background 180ms ease;
}

.featured-blog-see-all:hover,
.featured-blog-see-all:focus-visible {
  /* background: var(--accent-wash);
  color: #1b253c; */
  transform: translateY(-1px);
}

.featured-blog-see-all:focus-visible {
  outline: 3px solid var(--accent-ring);
  outline-offset: 3px;
}

.contact-copy p {
  color: var(--ink-muted);
}

.icon {
  width: 50%;
  display: block;
  margin-left: auto; 
  margin-right: auto; 
}

.cropped-icon {
  width: 70%;
  height: 50%;
  object-fit: cover; /* Crops the image to fill the box */
  object-position: center; /* Centers the crop (default) */
  display: block;
  margin-left: auto; 
  margin-right: auto; 
}

.post-meta {
  color: var(--ink-subtle);
  font-size: 0.95rem;
  margin-top: 20px;
}

.skills-grid {
  --skill-row-height: 10.75rem;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  grid-auto-rows: var(--skill-row-height);
  max-height: calc((var(--skill-row-height) * 2) + 1.5rem);
  overflow: hidden;
  position: relative;
  transition: max-height 260ms ease;
}

.skills-grid div {
  display: flex;
  min-height: var(--skill-row-height);
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.25rem 1rem 0.75rem;
}

.skills-grid .icon,
.skills-grid .cropped-icon {
  width: 4.5rem;
  height: 4.5rem;
  object-fit: contain;
}

/* Brand marks drawn in solid black (and aws's near-black letters)
   disappear on the dark ground. Dark mode, the attribute-less default,
   swaps in the white variants that sit next to the originals in
   assets/svg; light mode keeps the black ones. */
:root:not([data-theme="light"]) .skills-grid img[src="/assets/svg/apple.svg"] { content: url("/assets/svg/apple-white.svg"); }
:root:not([data-theme="light"]) .skills-grid img[src="/assets/svg/dotnet.svg"] { content: url("/assets/svg/dotnet-white.svg"); }
:root:not([data-theme="light"]) .skills-grid img[src="/assets/svg/mssql.svg"] { content: url("/assets/svg/mssql-white.svg"); }
:root:not([data-theme="light"]) .skills-grid img[src="/assets/svg/mysql.svg"] { content: url("/assets/svg/mysql-white.svg"); }
:root:not([data-theme="light"]) .skills-grid img[src="/assets/svg/react-native.svg"] { content: url("/assets/svg/react-native-white.svg"); }
:root:not([data-theme="light"]) .skills-grid img[src="/assets/svg/aws.svg"] { content: url("/assets/svg/aws-white.svg"); }
:root:not([data-theme="light"]) .skills-grid img[src="/assets/svg/rust.svg"] { content: url("/assets/svg/rust-white.svg"); }

.skills-grid::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 3rem;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(10,12,18,0), var(--bg));
  transition: opacity 180ms ease;
}

.skills-toggle {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.skills-toggle:checked + .skills-grid {
  max-height: 120rem;
}

.skills-toggle:checked + .skills-grid::after {
  opacity: 0;
}

.skills-toggle-control {
  display: flex;
  width: fit-content;
  align-items: center;
  justify-content: center;
  min-height: 2.9rem;
  margin: 1.25rem auto 0;
  padding: 0 1.3rem;
  border-radius: 999px;
  /* background: var(--accent);
  color: var(--accent-ink); */
  background: var(--surface-sunken);
  color: var(--ink-deep);
  border: 1px solid var(--border);
  cursor: pointer;
  font-weight: 700;
  text-align: center;
  transition: transform 180ms ease, background 180ms ease;
}

.skills-toggle-control:hover {
  transform: translateY(-1px);
  background: var(--accent-wash);
}

.skills-toggle:focus-visible ~ .skills-toggle-control {
  outline: 3px solid var(--accent-ring);
  outline-offset: 3px;
}

.skills-toggle-less {
  display: none;
}

.skills-toggle:checked ~ .skills-toggle-control .skills-toggle-more {
  display: none;
}

.skills-toggle:checked ~ .skills-toggle-control .skills-toggle-less {
  display: inline;
}

.skill-header {
  margin: 0.85rem 0 0;
  text-align: center;
  font-weight: bold;
  line-height: 1.25;
}

.contact-section {
  padding: 2rem 0 1rem;
}

.contact-grid {
  grid-template-columns: minmax(280px, 1fr) minmax(340px, 1fr);
  align-items: start;
}

.contact-copy {
  display: grid;
  /* gap: 0.8rem; */
}

.contact-links-layout {
  display: grid;
  grid-template-columns: minmax(170px, 0.85fr) minmax(0, 1.15fr);
  align-items: center;
  gap: 1.25rem;
  margin-top: 1.2rem;
}

.contact-timezone {
  display: grid;
  align-content: center;
}

.contact-timezone h3 {
  margin: 0;
  line-height: 1.2;
}

.contact-details {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.85rem;
}

.contact-time {
  display: grid;
  justify-items: start;
  gap: 0.25rem;
  padding: 1.15rem 0 1rem;
  color: var(--ink);
  text-align: left;
}

.contact-details li {
  margin: 0;
  color: var(--ink-soft);
}

.contact-details a {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.85rem;
  align-items: center;
  padding: 0.85rem;
  border: 1px solid var(--border-softer);
  border-radius: 1rem;
  background: var(--surface);
  color: var(--ink-soft);
  text-decoration: none;
  transition: border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

.contact-details a:hover,
.contact-details a:focus-visible {
  border-color: var(--accent-a28);
  color: var(--accent-strong);
  box-shadow: 0 14px 32px rgba(0,0,0,0.4);
  transform: translateY(-1px);
}

.contact-details a:focus-visible {
  outline: 3px solid var(--accent-ring);
  outline-offset: 3px;
}

.contact-details svg {
  width: 2.2rem;
  height: 2.2rem;
  padding: 0.48rem;
  border-radius: 0.8rem;
  background: var(--accent-a16);
  color: var(--accent);
  fill: currentColor;
}

.contact-details span {
  display: grid;
  min-width: 0;
  line-height: 1.35;
}

.contact-details li strong {
  color: var(--ink);
}

.lockscreen-clock {
  display: inline-flex;
  align-items: baseline;
  color: var(--ink);
  gap: 0.2rem;
  font-size: clamp(3.6rem, 11vw, 3.2rem);
  font-weight: 800;
  letter-spacing: 0;
  line-height: 0.9;
  font-variant-numeric: tabular-nums;
}

.clock-period {
  color: var(--accent);
  font-size: 0.8em;
  font-weight: 200;
}

.contact-time > span {
  color: var(--ink-muted);
  font-size: 0.98rem;
  font-weight: 700;
}

.contact-form {
  padding: 1.8rem;
  display: grid;
  gap: 1rem;
}

.contact-form label {
  display: grid;
  gap: 0.75rem;
  font-weight: 600;
  color: var(--ink);
}

.contact-form input,
.contact-form textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 1rem;
  background: var(--surface-sunken);
  color: var(--ink);
  padding: 0.95rem 1rem;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

.contact-form input:focus,
.contact-form textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-a16);
}

.contact-form textarea {
  min-height: 180px;
  resize: vertical;
}

.form-honey {
  display: none;
}

.form-status {
  min-height: 1.5rem;
  margin: 0;
  color: var(--ok);
  font-weight: 700;
}

.form-status.is-error {
  color: var(--bad);
}

.form-note {
  margin: 0;
  color: var(--ink-subtle);
  font-size: 0.95rem;
}

.site-footer {
  text-align: center;
  padding: 2rem 0 1rem;
  color: var(--ink-subtle);
}

.blog-section,
.post-page {
  max-width: 880px;
  margin-right: auto;
  margin-left: auto;
  margin-top: 1rem;
}

.blog-heading {
  margin-bottom: 1.75rem;
}

.blog-heading .eyebrow {
  margin: 1rem 0 0.85rem;
  color: var(--ink-muted);
  font-size: 0.8rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.blog-heading h1,
.post-header h1 {
  margin: 0;
  color: var(--ink);
  font-size: clamp(2.5rem, 4vw, 4.2rem);
  line-height: 0.98;
}

.blog-intro,
.post-excerpt {
  max-width: 680px;
  margin: 1rem 0 0;
  color: var(--ink-muted);
  font-size: 1.05rem;
}

.post-excerpt {
  font-weight: 700;
}

.post-header .post-meta {
  margin: 0;
  color: var(--ink-subtle);
}

.post-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  list-style: none;
  padding: 0;
  margin: 0.1rem 0 0;
}

.post-tags li {
  padding: 0.2rem 0.65rem;
  border: 1px solid var(--accent-a16);
  border-radius: 999px;
  background: var(--accent-a08);
  color: var(--accent-strong);
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1.4;
}

.post-tags .tag-release {
  border-color: rgba(74,222,128,0.25);
  background: rgba(74,222,128,0.10);
  color: var(--ok);
}

.post-read-link:hover {
  color: var(--accent);
}

.social-feed {
  display: grid;
  gap: 1.25rem;
  margin-top: 2.25rem;
}

.feed-post {
  display: grid;
  gap: 1rem;
  padding: 1.25rem 0;
  border-top: 1px solid var(--border-soft);
}

.feed-post:last-child {
  border-bottom: 1px solid var(--border-soft);
}

.feed-post-titlebar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 1rem;
  align-items: start;
}

.feed-post-titlebar h2 {
  margin: 0;
  font-size: clamp(1.35rem, 2.35vw, 2rem);
  line-height: 1.12;
}

.feed-post-titlebar h2 a {
  color: var(--ink);
  text-decoration: none;
}

.feed-post-titlebar h2 a:hover,
.feed-post-titlebar h2 a:focus-visible {
  color: var(--accent);
}

.feed-post-titlebar .post-tags {
  justify-content: flex-end;
}

.feed-post-titlebar .post-tags li {
  padding: 0.14rem 0.55rem;
  font-size: 0.74rem;
}

.feed-post-meta-stack {
  display: grid;
  justify-items: end;
  gap: 0.45rem;
  text-align: right;
}

.feed-post-header {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 1rem;
  align-items: start;
}

.feed-avatar {
  display: block;
  width: clamp(3rem, 5.5vw, 3.75rem);
  height: clamp(3rem, 5.5vw, 3.75rem);
  border: 2px solid var(--accent);
  border-radius: 50%;
  box-shadow: 0 0 0 3px var(--accent-a16);
  object-fit: cover;
}

.feed-post-header-content {
  display: grid;
  gap: 0.25rem;
  min-width: 0;
}

.feed-post-titlebar > div:first-child {
  display: grid;
  gap: 0.2rem;
  min-width: 0;
}

.feed-author {
  margin: 0;
  color: var(--ink-subtle);
  font-weight: 500;
  line-height: 1.25;
}

.feed-post .post-meta {
  margin: 0;
  color: var(--ink-subtle);
  font-size: 0.9rem;
  line-height: 1.35;
}

.feed-post-body {
  display: grid;
  gap: 0.75rem;
}

.feed-post-body:has(> .feed-post-media) {
  grid-template-areas:
    "content"
    "actions"
    "media";
}

.feed-post-body:has(> .feed-post-media) > .feed-post-content {
  grid-area: content;
}

.feed-post-body:has(> .feed-post-media) > .feed-post-actions {
  grid-area: actions;
}

.feed-post-body:has(> .feed-post-media) > .feed-post-media {
  grid-area: media;
}

.feed-post-content {
  position: relative;
  max-height: 18rem;
  overflow: hidden;
  color: var(--ink-soft);
}

.feed-post:not(.is-expanded) .feed-post-content:not(.has-no-overflow) {
  -webkit-mask-image: linear-gradient(180deg, #000 calc(100% - 4rem), transparent);
  mask-image: linear-gradient(180deg, #000 calc(100% - 4rem), transparent);
}

.feed-post.is-expanded .feed-post-content {
  max-height: none;
  overflow: visible;
  -webkit-mask-image: none;
  mask-image: none;
}

.feed-post:not(.is-expanded) .feed-post-inline-media {
  display: none;
}

.feed-post.is-expanded .feed-post-media {
  display: none;
}

.feed-post-content h2,
.feed-post-content h3 {
  color: var(--ink);
  line-height: 1.25;
}

.feed-post-content h2 {
  margin-top: 1.4rem;
  font-size: 1.45rem;
}

.feed-post-content p,
.feed-post-content li {
  color: var(--ink-muted);
}

.feed-post-content a {
  font-weight: 700;
}

.feed-post-content ul,
.feed-post-content ol {
  padding-left: 1.4rem;
}

.feed-post-content blockquote {
  margin: 1.5rem 0;
  padding: 0.2rem 0 0.2rem 1rem;
  border-left: 4px solid var(--accent-ring);
  color: var(--ink-muted);
}

.feed-post-content :not(pre) > code {
  padding: 0.16rem 0.36rem;
  border: 1px solid var(--accent-a16);
  border-radius: 0.35rem;
  background: var(--accent-a08);
  color: var(--accent);
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 0.92em;
}

.feed-post-content pre,
.feed-post-content .highlight {
  margin: 0.9rem 0;
  border: 1px solid var(--accent-a28);
  border-radius: 0.75rem;
  background: var(--accent-a16);
  box-shadow: none;
  overflow: auto;
}

.feed-post-content pre {
  padding: 0.55rem 0.75rem;
}

.feed-post-content .highlight pre {
  margin: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.feed-post-content pre code,
.feed-post-content .highlight code {
  color: var(--accent-strong);
  background: transparent;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 0.86rem;
  line-height: 1.35;
  white-space: pre;
}

.feed-post-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.feed-post-actions .post-read-link {
  margin-top: 0;
}

.feed-post-media {
  margin: 0;
}

.feed-post-single-media {
  overflow: hidden;
  border: 1px solid var(--border-softer);
  border-radius: 1rem;
  background: var(--panel);
  box-shadow: 0 18px 48px var(--shadow-soft);
}

.feed-post-single-media img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  background: var(--border);
}

.feed-post-single-media figcaption {
  margin: 0;
  padding: 0.6rem 0.85rem;
  background: var(--panel);
  color: var(--panel-ink-muted);
  font-size: 0.92rem;
  line-height: 1.5;
}

.show-more-button {
  width: fit-content;
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--accent);
  cursor: pointer;
  font-weight: 800;
}

.show-more-button:hover,
.show-more-button:focus-visible {
  color: var(--accent-strong);
}

.show-more-button:focus-visible {
  outline: 3px solid var(--accent-ring);
  outline-offset: 3px;
}

.feed-comments {
  margin-top: 0;
  padding-top: 0.65rem;
}

.post-engagement {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
}

.like-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  min-height: 2.45rem;
  min-width: 4.2rem;
  padding: 0 0.95rem;
  border: 1px solid var(--accent-a16);
  border-radius: 0.75rem;
  background: var(--accent-a08);
  color: var(--accent-strong);
  cursor: pointer;
  font-weight: 800;
  line-height: 1;
  transition: transform 180ms ease, background 180ms ease, border-color 180ms ease, color 180ms ease;
}

.like-button:hover,
.like-button:focus-visible,
.like-button.is-liked {
  border-color: var(--accent-a28);
  background: var(--accent-wash);
  color: var(--accent-strong);
  transform: translateY(-1px);
}

.like-button:focus-visible {
  outline: 3px solid var(--accent-ring);
  outline-offset: 3px;
}

.like-button:disabled {
  cursor: default;
  opacity: 0.85;
  transform: none;
}

.like-button svg {
  width: 1.15rem;
  height: 1.15rem;
  fill: currentColor;
}

.like-button-icon {
  width: auto;
  min-width: 4.25rem;
  height: 3.2rem;
  min-height: 3.2rem;
  padding: 0 0.85rem;
}

.post-read-link,
.post-back-link,
.post-home-link {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  width: fit-content;
  margin-top: 0.45rem;
  color: var(--accent);
  font-weight: 700;
  text-decoration: none;
}

.post-nav-links {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin: 0 0 1.25rem;
}

.post-back-link,
.post-home-link {
  margin: 0;
}

.post-back-link::before {
  content: "←";
}

.post-home-link::after {
  content: "→";
}

.post-home-link-back::before {
  content: "←";
}

.post-home-link-back::after {
  content: none;
}

.post-read-link::after {
  content: "→";
}

.post-page {
  display: grid;
  gap: 1.5rem;
  min-width: 0;
}

.post-header,
.post-content {
  background: transparent;
  min-width: 0;
}

.post-header {
  padding: 0 0 0.5rem;
}

.post-content {
  padding: 0;
  color: var(--ink-soft);
}

.post-content h2,
.post-content h3 {
  color: var(--ink);
  line-height: 1.25;
}

.post-content h2 {
  margin-top: 2rem;
  font-size: 1.65rem;
}

.post-content p,
.post-content li {
  color: var(--ink-muted);
}

.post-content a {
  font-weight: 700;
}

.post-content ul,
.post-content ol {
  padding-left: 1.4rem;
}

.post-content blockquote {
  margin: 1.5rem 0;
  padding: 0.2rem 0 0.2rem 1rem;
  border-left: 4px solid var(--accent-ring);
  color: var(--ink-muted);
}

.post-comments {
  margin-top: 1rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border-soft);
}

.post-comments.feed-comments {
  margin-top: 0.25rem;
  padding-top: 0.75rem;
  border-top: 0;
}

.post-comments h2 {
  margin: 0 0 1rem;
  color: var(--ink);
  font-size: 1.65rem;
}

.comment-prompt {
  margin: 1.25rem 0 1rem;
  color: var(--ink-muted);
  font-weight: 700;
}

.comment-draft-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 0.75rem;
  padding-top: 1rem;
}

.comment-draft-form.has-like-button {
  grid-template-columns: auto minmax(0, 1fr) auto;
}

.comment-draft-form textarea,
.comment-modal input {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 0.85rem;
  background: var(--field);
  color: var(--ink);
  transition: border-color 180ms ease, box-shadow 180ms ease;
}

.comment-draft-form textarea {
  min-height: 3.2rem;
  max-height: 13rem;
  padding: 0.72rem 1rem;
  overflow: hidden;
  resize: none;
  line-height: 1.55;
}

.comment-send-button {
  flex: none;
  width: 3.2rem;
  min-width: 3.2rem;
  height: 3.2rem;
  min-height: 3.2rem;
  padding: 0;
}

.comment-send-button svg {
  width: 1.25rem;
  height: 1.25rem;
  fill: currentColor;
}

.comment-send-button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
  transform: none;
}

.comment-draft-form textarea:focus,
.comment-modal input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-a16);
  outline: none;
}

.comment-status {
  min-height: 1.5rem;
  margin: 0.9rem 0 0;
  color: var(--ok);
  font-weight: 700;
}

.comment-status.is-error {
  color: var(--bad);
}

.comment-list {
  display: grid;
  gap: 1rem;
  margin-top: 0;
}

.comment-empty {
  margin: 0;
  color: var(--ink-subtle);
}

.comment-item {
  display: grid;
  gap: 0.4rem;
  padding: 1rem 0;
  border-top: 1px solid var(--border-soft);
}

.feed-comments .comment-item {
  border-top: 0;
  padding: 0.35rem 0 0.45rem;
}

.feed-comments .comment-list:has(.comment-item) {
  gap: 0.35rem;
}

.feed-comments .comment-list:has(.comment-item) + .comment-prompt {
  margin-top: 0.35rem;
  margin-bottom: 0.65rem;
}

.comment-meta {
  margin: 0;
  color: var(--ink-subtle);
  font-size: 0.9rem;
  font-weight: 700;
}

.comment-body {
  margin: 0;
  color: var(--ink-soft);
  white-space: pre-wrap;
}

.comment-replies {
  display: grid;
  gap: 0.75rem;
  margin-top: 0.4rem;
  padding-left: 1rem;
  border-left: 3px solid var(--accent-a16);
}

.comment-modal[hidden] {
  display: none;
}

.comment-modal {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 1rem;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(6px);
}

.comment-modal-open {
  overflow: hidden;
}

.comment-modal-panel {
  width: min(100%, 430px);
  padding: 1.5rem;
  border: 1px solid var(--border-soft);
  border-radius: 1rem;
  background: var(--surface);
  box-shadow: 0 28px 70px rgba(0,0,0,0.6);
}

.comment-modal-panel h3 {
  margin: 0;
  color: var(--ink);
  font-size: 1.45rem;
  line-height: 1.2;
}

.comment-modal-panel p {
  margin: 0.45rem 0 1rem;
  color: var(--ink-muted);
}

.comment-modal-panel form {
  display: grid;
  gap: 0.9rem;
}

.comment-modal label {
  display: grid;
  gap: 0.35rem;
  color: var(--ink);
  font-weight: 800;
}

.comment-modal label span {
  color: var(--ink-subtle);
  font-size: 0.85rem;
  font-weight: 700;
}

.comment-modal input {
  min-height: 3rem;
  padding: 0 0.9rem;
}

.comment-modal-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.75rem;
  margin-top: 0.25rem;
}

.post-content :not(pre) > code {
  padding: 0.16rem 0.36rem;
  border: 1px solid var(--accent-a16);
  border-radius: 0.35rem;
  background: var(--accent-a08);
  color: var(--accent);
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 0.92em;
}

.post-content pre,
.post-content .highlight {
  margin: 1rem 0;
  border: 1px solid var(--accent-a28);
  border-radius: 0.8rem;
  background: var(--accent-a16);
  box-shadow: none;
  overflow: auto;
}

.post-content .highlight pre {
  margin: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.post-content pre {
  padding: 0.58rem 0.8rem;
}

.post-content pre code,
.post-content .highlight code {
  color: var(--accent-strong);
  background: transparent;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 0.86rem;
  line-height: 1.35;
  white-space: pre;
}

.post-content .language-bash,
.post-content .language-sh,
.post-content .language-shell,
.post-content .language-console,
.post-content .language-terminal,
.post-content .highlight.language-bash,
.post-content .highlight.language-sh,
.post-content .highlight.language-shell,
.post-content .highlight.language-console,
.post-content .highlight.language-terminal {
  position: relative;
  padding-top: 1.8rem;
}

.post-content .language-bash::before,
.post-content .language-sh::before,
.post-content .language-shell::before,
.post-content .language-console::before,
.post-content .language-terminal::before,
.post-content .highlight.language-bash::before,
.post-content .highlight.language-sh::before,
.post-content .highlight.language-shell::before,
.post-content .highlight.language-console::before,
.post-content .highlight.language-terminal::before {
  content: "Terminal";
  position: absolute;
  top: 0.55rem;
  left: 0.9rem;
  color: #bfdbfe;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.post-content .highlight .k,
.post-content .highlight .kd,
.post-content .highlight .kn {
  color: #bfdbfe;
}

.post-content .highlight .s,
.post-content .highlight .s1,
.post-content .highlight .s2 {
  color: #dbeafe;
}

.post-content .highlight .c,
.post-content .highlight .c1 {
  color: #9fb6dd;
}

.post-slider {
  margin: 1rem 0 0.35rem;
}

.post-slider-viewport {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--border-softer);
  border-radius: 1rem;
  background: var(--panel);
  box-shadow: 0 18px 48px var(--shadow-soft);
  touch-action: pan-y;
  user-select: none;
}

.post-slider-viewport.is-dragging {
  cursor: grabbing;
}

.post-slider-media {
  position: relative;
  overflow: hidden;
}

.post-slider-media::before,
.post-slider-media::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  z-index: 1;
  width: 11%;
  pointer-events: none;
  opacity: 0;
  transition: opacity 180ms ease;
}

.post-slider-media::before {
  left: 0;
  background: linear-gradient(90deg, rgba(15,23,42,0.48), rgba(15,23,42,0));
}

.post-slider-media::after {
  right: 0;
  background: linear-gradient(270deg, rgba(15,23,42,0.48), rgba(15,23,42,0));
}

.post-slider-viewport:hover .post-slider-media::before,
.post-slider-viewport:hover .post-slider-media::after {
  opacity: 1;
}

.post-slider-track {
  display: grid;
}

.post-slider-slide {
  grid-area: 1 / 1;
}

.post-slider-slide[hidden] {
  display: none;
}

.post-slider img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  background: var(--border);
}

.post-slider figcaption {
  margin: 0;
  padding: 0.6rem 0.85rem;
  background: var(--panel);
  color: var(--panel-ink-muted);
  font-size: 0.92rem;
  line-height: 1.5;
}

.post-slider-control {
  position: absolute;
  top: 50%;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 4rem;
  height: 100%;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #fff;
  line-height: 1;
  transform: translateY(-50%);
  cursor: pointer;
  opacity: 0.86;
  transition: opacity 180ms ease;
}

.post-slider-control:hover,
.post-slider-control:focus-visible {
  opacity: 1;
}

.post-slider-control:focus-visible {
  outline: 3px solid var(--accent-ring);
  outline-offset: -5px;
}

.post-slider-control span {
  display: block;
  width: 0.75rem;
  height: 0.75rem;
  border-top: 0.24rem solid currentColor;
  border-right: 0.24rem solid currentColor;
  font-size: 0;
  line-height: 0;
}

.post-slider-prev span {
  transform: rotate(-135deg);
}

.post-slider-next span {
  transform: rotate(45deg);
}

.post-slider-prev {
  left: 0;
}

.post-slider-next {
  right: 0;
}

.post-slider-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-top: 0.45rem;
}

.post-slider-dots {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.post-slider-dot {
  width: 0.75rem;
  height: 0.75rem;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: #cbd5e1;
  cursor: pointer;
}

.post-slider-dot.is-active {
  background: var(--accent);
}

.post-slider-dot:focus-visible {
  outline: 3px solid var(--accent-ring);
  outline-offset: 3px;
}

.post-slider-status {
  margin: 0;
  color: var(--accent);
  font-size: 0.9rem;
  font-weight: 700;
}

.post-content .post-slider-status,
.feed-post-content .post-slider-status {
  color: var(--accent);
}

@media (min-width: 1100px) {
  .blog-container {
    width: min(1580px, calc(100% - clamp(3rem, 8vw, 8rem)));
  }

  .blog-section {
    max-width: none;
  }

  .blog-section .feed-post-body:has(.feed-post-media) {
    --feed-media-gap: clamp(2rem, 4vw, 4rem);
    --feed-media-width: min(880px, max(360px, calc((100% - var(--feed-media-gap)) * 0.42)));
    grid-template-columns: minmax(0, 0.58fr) minmax(360px, 0.42fr);
    grid-template-areas:
      "content media"
      "actions actions";
    column-gap: var(--feed-media-gap);
    row-gap: 0.75rem;
    align-items: start;
  }

  .blog-section .feed-post-body:has(.feed-post-media) .feed-post-content {
    grid-area: content;
  }

  .blog-section .feed-post-body:has(.feed-post-media) .feed-post-actions {
    grid-area: actions;
  }

  .blog-section .feed-post-media,
  .blog-section .feed-post-content .post-slider {
    width: min(100%, 880px);
    max-width: 880px;
    margin-right: auto;
    margin-left: auto;
  }

  .blog-section .feed-post-body > .feed-post-media {
    grid-area: media;
    width: 100%;
  }

  .blog-section .feed-post.is-expanded .feed-post-body > .feed-post-media {
    display: block;
  }

  .blog-section .feed-post.is-expanded .feed-post-content .feed-post-inline-media {
    display: none;
  }

  .blog-section .feed-post.is-expanded .feed-post-body:has(> .feed-post-media) {
    display: block;
  }

  .blog-section .feed-post.is-expanded .feed-post-body > .feed-post-media {
    float: right;
    width: var(--feed-media-width);
    margin: 0 0 1rem var(--feed-media-gap);
  }

  .blog-section .feed-post.is-expanded .feed-post-actions {
    clear: both;
    padding-top: 0.25rem;
  }

  .blog-section .feed-post-media.post-slider {
    margin-top: 0;
    margin-bottom: 0.35rem;
  }
}

@media (max-width: 960px) {
  .hero,
  .contact-grid {
    grid-template-columns: 1fr;
  }

  .contact-links-layout {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .container:not(.site-header .container) {
    padding: 2rem 0;
  }

  .featured-blog-layout {
    grid-template-columns: 1fr;
  }

  .featured-blog-stage {
    min-height: auto;
  }

  .hero-gravatar-banner,
  .hero-gravatar-card {
    display: none;
  }

  .hero-gravatar-compact {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 1rem;
    align-items: center;
    max-width: 36rem;
    min-height: 6.25rem;
    margin-bottom: 1.4rem;
    padding: 1rem;
    overflow: hidden;
    border-radius: 1.1rem;
    background: linear-gradient(138deg, var(--surface-2) 0%, var(--accent-a28) 100%);
    color: white;
    text-decoration: none;
    box-shadow: 0 18px 45px var(--shadow-soft);
  }

  .hero-gravatar-compact:hover,
  .hero-gravatar-compact:focus-visible {
    color: white;
  }

  .hero-gravatar-compact:focus-visible {
    outline: 3px solid var(--accent-ring);
    outline-offset: 4px;
  }

  .hero-gravatar-compact img {
    width: 4.25rem;
    height: 4.25rem;
    border: 2px solid rgba(255,255,255,0.86);
    border-radius: 50%;
  }

  .hero-gravatar-compact span {
    display: grid;
    min-width: 0;
    line-height: 1.35;
  }

  .hero-gravatar-compact strong {
    color: white;
    font-size: 1.1rem;
  }

  .hero-gravatar-compact span span {
    color: rgba(255,255,255,0.82);
  }
}

@media (max-width: 720px) {
  .header-inner {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem 0;
  }

  .nav-toggle {
    display: block;
  }

  .nav-toggle-label {
    display: inline-flex;
    grid-column: 2;
    justify-self: end;
    width: 2.75rem;
    height: 2.75rem;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.32rem;
    border: 1px solid rgba(255,255,255,0.18);
    border-radius: 0.8rem;
    background: rgba(255,255,255,0.08);
    cursor: pointer;
  }

  .nav-toggle-label span {
    width: 1.15rem;
    height: 2px;
    border-radius: 999px;
    background: white;
    transition: transform 180ms ease, opacity 180ms ease;
  }

  .site-nav {
    grid-column: 1 / -1;
    display: grid;
    align-content: start;
    justify-content: stretch;
    justify-items: stretch;
    gap: 0.35rem;
    width: 100%;
    max-height: 0;
    margin-left: 0;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transition: max-height 220ms ease, opacity 180ms ease, padding-top 180ms ease, visibility 0s 220ms;
  }

  .site-nav a {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 3rem;
    padding: 0.8rem 1rem;
    border-radius: 0.85rem;
    color: rgba(255,255,255,0.88);
    font-size: 1.02rem;
    text-align: center;
  }

  .skills-grid {
    --skill-row-height: 3.9rem;
    grid-template-columns: 1fr;
    grid-auto-rows: var(--skill-row-height);
    gap: 0.65rem;
    max-height: calc((var(--skill-row-height) * 2) + 0.65rem);
  }

  .skills-grid div {
    min-height: var(--skill-row-height);
    flex-direction: row;
    justify-content: flex-start;
    gap: 0.85rem;
    padding: 0.65rem 0.9rem;
    border-radius: 0.85rem;
  }

  .skills-grid .icon,
  .skills-grid .cropped-icon {
    flex: 0 0 2.2rem;
    width: 2.2rem;
    height: 2.2rem;
    margin: 0;
  }

  .skill-header {
    margin: 0;
    text-align: left;
    font-size: 1rem;
  }

  .nav-toggle:checked ~ .nav-toggle-label span:nth-child(1) {
    transform: translateY(0.44rem) rotate(45deg);
  }

  .nav-toggle:checked ~ .nav-toggle-label span:nth-child(2) {
    opacity: 0;
  }

  .nav-toggle:checked ~ .nav-toggle-label span:nth-child(3) {
    transform: translateY(-0.44rem) rotate(-45deg);
  }

  .nav-toggle:checked ~ .site-nav {
    max-height: 20rem;
    padding: 0.85rem 0 0.25rem;
    border-top: 1px solid rgba(255,255,255,0.12);
    opacity: 1;
    visibility: visible;
    transition-delay: 0s;
  }

  .hero {
    padding: 2rem;
  }

  .post-header,
  .post-content {
    padding: 0;
  }

  .feed-post-titlebar {
    grid-template-columns: 1fr;
    gap: 0.65rem;
  }

  .feed-post-titlebar .post-tags {
    justify-content: flex-start;
    margin-top: 0;
  }

  .feed-post-meta-stack {
    justify-items: start;
    text-align: left;
  }

  .post-nav-links {
    flex-wrap: wrap;
  }

  .post-content pre,
  .post-content .highlight {
    margin-right: -0.25rem;
    margin-left: -0.25rem;
    border-radius: 0.85rem;
  }

  .card-grid {
    grid-auto-columns: calc((100% - 1.5rem) / 2);
  }

  .contact-form {
    padding: 1.4rem;
  }
}

@media (max-width: 584px) {
  .card-grid {
    grid-auto-columns: 100%;
  }

  .post-page {
    max-width: 100%;
    overflow-x: hidden;
  }

  .post-header h1 {
    font-size: clamp(2rem, 12vw, 2.8rem);
    overflow-wrap: anywhere;
  }

  .post-content {
    overflow-wrap: break-word;
  }

  .post-content pre,
  .post-content .highlight {
    width: 100%;
    max-width: 100%;
    margin-right: 0;
    margin-left: 0;
    min-width: 0;
  }

  .post-content pre {
    padding: 0.52rem 0.65rem;
  }

  .post-content pre code,
  .post-content .highlight code {
    font-size: 0.78rem;
    line-height: 1.35;
  }
}

@media (max-width: 555px) {
  .post-content pre,
  .post-content .highlight {
    max-width: calc(100vw - 2rem);
    border-radius: 0.7rem;
  }

  .post-content pre {
    padding: 0.48rem 0.6rem;
  }

  .post-content pre code,
  .post-content .highlight code {
    font-size: 0.72rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ==========================================================================
   Project pages. Added 22 September 2026. Tokens only, no literals.
   ========================================================================== */

.project-page { padding-bottom: 2rem; }

.project-crumb {
  display: flex; gap: 0.5rem; align-items: center;
  font-size: 0.9rem; color: var(--ink-subtle); margin-bottom: 2rem;
}
.project-crumb a { text-decoration: none; }
.project-crumb a:hover { text-decoration: underline; }

.project-hero { display: grid; gap: 1.25rem; margin-bottom: 2.5rem; }
.project-hero h1 { font-size: clamp(2.2rem, 5vw, 3.2rem); margin: 0 0 0.25rem; line-height: 1.1; }
.project-tagline { font-size: 1.25rem; color: var(--ink-muted); margin: 0 0 1rem; }
.project-summary { font-size: 1.05rem; max-width: 62ch; margin: 0 0 1.5rem; }

.project-chips { display: flex; flex-wrap: wrap; gap: 0.4rem; list-style: none; padding: 0; margin: 0 0 1rem; }
.project-chips li {
  font-size: 0.8rem; font-weight: 600; letter-spacing: 0.02em;
  padding: 0.25rem 0.7rem; border-radius: var(--radius-pill);
  background: var(--accent-a08); color: var(--accent-strong);
  border: 1px solid var(--accent-a16);
}

.project-cta { display: flex; flex-wrap: wrap; gap: 0.6rem; }

.project-hero-media { margin: 0 0 2.5rem; }
.project-hero-media img {
  width: 100%; border-radius: var(--radius-card);
  border: 1px solid var(--border); box-shadow: 0 10px 30px var(--shadow-soft);
}

.project-terminal {
  border-radius: var(--radius-card); overflow: hidden;
  background: var(--panel); border: 1px solid var(--border);
  box-shadow: 0 10px 30px var(--shadow-soft); margin-bottom: 2.5rem;
}
.project-terminal-bar { display: flex; gap: 0.4rem; padding: 0.7rem 0.9rem; background: var(--panel-2); }
.project-terminal-bar span { width: 11px; height: 11px; border-radius: var(--radius-pill); background: var(--panel-ink-muted); opacity: 0.55; }
.project-terminal pre {
  margin: 0; padding: 1.25rem; overflow-x: auto;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.86rem; line-height: 1.6;
}
.project-terminal-cmd { display: block; color: var(--panel-ink); font-weight: 600; }
.project-terminal-cwd { display: block; color: var(--panel-ink-muted); font-weight: 400; font-size: 0.92em; }
.project-terminal-prompt { color: var(--accent-ring); margin-right: 0.5rem; }
.project-terminal-out { display: block; color: var(--panel-ink-muted); white-space: pre-wrap; margin-bottom: 1.25rem; }

.project-metrics {
  border-top: 1px solid var(--border); border-bottom: 1px solid var(--border);
  padding: 1.5rem 0; margin-bottom: 2.5rem;
}
.project-metrics dl {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 1.25rem; margin: 0;
}
.project-metrics dt { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-subtle); }
.project-metrics dd { margin: 0.3rem 0 0; font-size: 1.05rem; font-weight: 600; color: var(--ink); }
.project-metrics-date { font-size: 0.78rem; color: var(--ink-subtle); margin: 1.25rem 0 0; }

.project-problem { margin-bottom: 2.5rem; }
.project-problem p { font-size: 1.2rem; line-height: 1.7; color: var(--ink-soft); }

.project-capabilities { margin-bottom: 2.5rem; }
.project-capability-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1rem; }
.project-capability {
  padding: 1.25rem; border-radius: var(--radius-card);
  border: 1px solid var(--border-soft); background: var(--surface-sunken);
}
.project-capability h3 { margin: 0 0 0.5rem; font-size: 1.05rem; }
.project-capability p { margin: 0; color: var(--ink-muted); font-size: 0.95rem; }

.project-showcase { margin-bottom: 2.5rem; }
.project-shot { margin: 0 0 1.5rem; }
.project-shot img { width: 100%; border-radius: var(--radius-card); border: 1px solid var(--border); }
.project-shot figcaption { font-size: 0.88rem; color: var(--ink-subtle); margin-top: 0.6rem; }

.project-writeup { margin-bottom: 2.5rem; }
.project-writeup h2 { margin-top: 2.5rem; }
.project-writeup pre {
  background: var(--panel); color: var(--panel-ink);
  padding: 1rem; border-radius: 12px; overflow-x: auto;
}
.project-writeup :not(pre) > code {
  background: var(--accent-a08); color: var(--accent-strong);
  padding: 0.1rem 0.35rem; border-radius: 6px; font-size: 0.9em;
}

.project-quickstart { margin-bottom: 2.5rem; }
.project-install {
  background: var(--panel); color: var(--panel-ink);
  padding: 1rem 1.25rem; border-radius: 12px; overflow-x: auto;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}
.project-install-note { font-size: 0.88rem; color: var(--ink-subtle); max-width: 60ch; }

.project-rail {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem; padding-top: 2rem; border-top: 1px solid var(--border);
}
.project-rail-block h2 { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-subtle); margin: 0 0 0.75rem; }
.project-rail .project-chips li { margin: 0; }
.project-related { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.5rem; }
.project-related span { color: var(--ink-subtle); font-size: 0.85rem; }

@media (min-width: 900px) {
  /* the icon takes the space beside the copy */
  .project-hero { grid-template-columns: minmax(0, 1fr) auto; align-items: center; column-gap: 3rem; }
  .project-metrics dl { gap: 2rem; }
}

/* --- Project tiles and earlier work -------------------------------------- */

.project-tiles {
  display: grid;
  grid-auto-flow: column;
  /* one card per view, the next peeking */
  grid-auto-columns: calc(100% - 2.5rem);
  gap: 1rem;
  margin-bottom: 2.5rem;
  overflow-x: auto;
  padding: 0.25rem 0.25rem 1rem;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: 0.25rem;
  scrollbar-width: thin;
  scrollbar-color: var(--accent-a65) transparent;
}

@media (min-width: 640px) {
  /* two per view: width = (100% - 1 gap) / 2 */
  .project-tiles { grid-auto-columns: calc((100% - 1rem) / 2); }
}

@media (min-width: 1000px) {
  /* exactly three per view: width = (100% - 2 gaps) / 3, so a rest
     position always shows three whole cards */
  .project-tiles { grid-auto-columns: calc((100% - 2rem) / 3); }
}
.project-tiles::-webkit-scrollbar { height: 8px; }
.project-tiles::-webkit-scrollbar-track { background: var(--border-softer); border-radius: var(--radius-pill); }
.project-tiles::-webkit-scrollbar-thumb { background: var(--accent-a65); border-radius: var(--radius-pill); }
.project-tile { scroll-snap-align: start; }
.project-tile {
  display: flex; flex-direction: column; gap: 0.7rem; text-decoration: none; color: inherit;
  padding: 1.25rem;
  border: 1px solid var(--border-soft); border-radius: var(--radius-card);
  overflow: hidden; background: var(--surface-sunken);
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}
.project-tile:hover {
  transform: translateY(-3px);
  border-color: var(--accent-a28);
  box-shadow: 0 12px 28px var(--shadow-soft);
}
.project-tile:focus-visible { outline: 3px solid var(--accent-ring); outline-offset: 3px; }

/* App-style head: the logo sits beside the name and tagline. */
.project-tile-head { display: flex; align-items: center; gap: 0.9rem; }
.project-tile-icon { width: 56px; height: 56px; object-fit: contain; flex: none; }
.project-tile-icon.is-rounded { border-radius: 22%; }
.project-tile-title { display: flex; flex-direction: column; gap: 0.15rem; min-width: 0; }
.project-tile-monogram {
  display: flex; align-items: center; justify-content: center;
  width: 56px; height: 56px; flex: none;
  font-size: 2rem; font-weight: 700; color: var(--accent-strong); line-height: 1;
}

.project-tile-name { font-size: 1.15rem; }
.project-tile-tagline { color: var(--ink-muted); font-size: 0.95rem; }
.project-tile .project-chips { display: flex; flex-wrap: wrap; gap: 0.35rem; margin: 0; }
.project-tile .project-chips span {
  font-size: 0.74rem; font-weight: 600; padding: 0.15rem 0.55rem;
  border-radius: var(--radius-pill); background: var(--accent-a08);
  color: var(--accent-strong); border: 1px solid var(--accent-a16);
}
.project-tile-cta { margin-top: auto; padding-top: 0.35rem; font-weight: 600; color: var(--accent); font-size: 0.92rem; }
.project-tile:hover .project-tile-cta { color: var(--accent-strong); }

.earlier-work { border-top: 1px solid var(--border); padding-top: 1.75rem; }
.earlier-work h3 {
  font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--ink-subtle); margin: 0 0 1rem;
}
.earlier-work ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.75rem; }
.earlier-work li { display: grid; grid-template-columns: minmax(0, 12rem) 6rem 1fr; gap: 0.75rem; align-items: baseline; }
.earlier-work-year { color: var(--ink-subtle); font-size: 0.85rem; }
.earlier-work-note { color: var(--ink-muted); font-size: 0.9rem; }

@media (max-width: 680px) {
  .earlier-work li { grid-template-columns: 1fr; gap: 0.2rem; }
}

/* ==========================================================================
   Editorial layer. Dark engineering redesign, 22 September 2026.
   Overrides the base rules above; tokens only.
   ========================================================================== */

html { scroll-padding-top: 5.5rem; }

::selection { background: var(--accent-a28); color: var(--ink-deep); }

body { line-height: 1.7; }

/* --- header --------------------------------------------------------------- */

.site-header {
  background: rgba(10, 12, 18, 0.72);
  border-bottom: 1px solid var(--border-soft);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.header-inner { justify-content: space-between; padding: 0.85rem 0; }

.site-wordmark {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--ink);
  text-decoration: none;
}
.site-wordmark span { color: var(--accent); }
.site-wordmark:hover { color: var(--ink-deep); }
.site-wordmark:focus-visible { outline: 3px solid var(--accent-ring); outline-offset: 3px; border-radius: 4px; }

.site-nav { margin: 0; }
/* The nav speaks the same mono as the wordmark beside it and the rest of
   the site chrome (eyebrow, chips, activity log), lowercase like both. */
.site-nav a {
  color: var(--ink-muted);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  letter-spacing: 0.02em;
  text-transform: lowercase;
}
.site-nav a:hover { background: var(--accent-a08); color: var(--ink-deep); }

/* --- hero ------------------------------------------------------------------ */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(340px, 0.85fr);
  gap: 3.5rem;
  align-items: center;
  margin-top: 2rem;
  padding: 4.5rem 0 3.5rem;
}
.hero-copy { max-width: 640px; }

@media (max-width: 1000px) {
  .hero { grid-template-columns: 1fr; gap: 2.5rem; }
  .hero-activity { max-width: 560px; }
}

.hero-head {
  display: flex;
  align-items: center;
  gap: 1.75rem;
}

.hero-avatar {
  flex-shrink: 0;
  width: 96px;
  height: 96px;
  border-radius: 50%;
  border: 2px solid var(--border);
  box-shadow: 0 0 0 5px var(--accent-a08), 0 12px 30px var(--shadow-soft);
}

.hero-title .eyebrow { margin-top: 0; }

@media (max-width: 600px) {
  .hero-head { gap: 1.1rem; }
  .hero-avatar { width: 64px; height: 64px; }
}

/* Icon buttons on the cta row, flowing left beside the buttons. */
.hero-social {
  display: inline-flex;
  gap: 0.5rem;
}
.hero-social a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3.2rem;
  min-height: 3.2rem;
  border: none;
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--ink-muted);
  text-decoration: none;
  transition: color 180ms ease, background 180ms ease;
}
.hero-social a:hover {
  color: var(--accent-strong);
  background: var(--accent-a08);
}
.hero-social svg {
  width: 1.35rem;
  height: 1.35rem;
}

.hero .eyebrow {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1.25rem;
}

.hero h1 {
  font-size: clamp(3.2rem, 7.5vw, 5.6rem);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 0.98;
  /* The gradient is clipped to the text and paints only inside the box;
     at this line-height the g's descender hangs below it, so the box is
     extended under it and pulled back so layout does not move. */
  padding-bottom: 0.15em;
  margin-bottom: -0.15em;
  background: linear-gradient(135deg, var(--ink-deep) 55%, var(--accent-strong));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero .intro { font-size: 1.08rem; max-width: 56ch; }

@media (max-width: 900px) {
  .hero { padding-top: 2.5rem; }
}

/* --- buttons --------------------------------------------------------------- */

.button {
  min-height: 2.9rem;
  padding: 0 1.4rem;
  border-radius: 10px;
  border: 1px solid transparent;
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 600;
  font-size: 0.95rem;
  box-shadow: 0 0 0 1px var(--accent-a28), 0 8px 30px var(--accent-a16);
}
.button:hover { background: var(--accent-strong); transform: translateY(-1px); }

.button-secondary {
  background: transparent;
  color: var(--ink-soft);
  border: 1px solid var(--border);
  box-shadow: none;
}
.button-secondary:hover { background: var(--accent-a08); border-color: var(--accent-a28); color: var(--ink-deep); }

/* --- sections -------------------------------------------------------------- */

.section { margin-top: 4.5rem; }
/* No rule above the heading: it drew only as wide as the heading's own
   column, and it landed on every nested h2 as well, including blog post
   titles. The section's top margin carries the separation instead. */
.section h2 {
  font-size: clamp(1.9rem, 2.4vw, 2.4rem);
  letter-spacing: -0.03em;
}
.section-intro { color: var(--ink-muted); }

/* --- homepage tiles --------------------------------------------------------- */


.project-tile {
  background:
    radial-gradient(ellipse 130% 100% at 0% 0%, var(--p-wash, var(--accent-a08)), transparent 55%),
    var(--surface);
  border-color: var(--border-soft);
}
.project-tile:hover {
  border-color: color-mix(in srgb, var(--p, var(--accent)) 45%, transparent);
  box-shadow: 0 18px 50px rgba(0,0,0,0.5), 0 0 40px -18px var(--p, var(--accent));
}

.project-tile-icon { filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.35)); }
.project-tile:hover .project-tile-icon { filter: drop-shadow(0 8px 20px var(--p-wash, var(--accent-a16))); }
.project-tile-monogram { color: var(--p, var(--accent)); font-family: var(--font-display); }

.project-tile-name { font-family: var(--font-display); color: var(--ink-deep); }
.project-tile-tagline { font-size: 0.92rem; }
.project-tile .project-chips span {
  background: var(--p-wash, var(--accent-a08));
  color: var(--p, var(--accent));
  border-color: transparent;
}
.project-tile-stats {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  color: var(--ink-subtle);
  margin-top: 0.2rem;
}
.project-tile-cta { color: var(--p, var(--accent)); }
.project-tile:hover .project-tile-cta { color: var(--ink-deep); }

.earlier-work h3, .project-rail-block h2, .project-metrics dt {
  font-family: var(--font-mono);
  font-weight: 500;
}

/* --- project pages ---------------------------------------------------------- */

.project-crumb { font-family: var(--font-mono); font-size: 0.8rem; }
.project-crumb a { color: var(--ink-subtle); }
.project-crumb a:hover { color: var(--p, var(--accent)); }
.project-crumb span:last-child { color: var(--p, var(--accent)); }

.project-hero { padding-top: 1rem; }
.project-hero h1 {
  font-size: clamp(2.8rem, 6vw, 4.4rem);
  letter-spacing: -0.04em;
  color: var(--ink-deep);
  text-shadow: 0 0 60px var(--p-wash, transparent);
}
.project-tagline { font-size: 1.3rem; color: var(--ink-soft); }
.project-summary { color: var(--ink-muted); }

/* The project's own mark, sitting in the hero's second column on
   desktop and leading the page on narrow screens. Decorative: the h1
   beside it already names the project. */
.project-hero-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  order: -1;
}
.project-hero-icon img {
  width: 88px;
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 14px 34px rgba(0, 0, 0, 0.5));
}
.project-hero-icon img.is-rounded { border-radius: 22%; }

@media (min-width: 900px) {
  .project-hero-icon {
    order: 0;
    padding: 1.5rem;
    border-radius: 50%;
    background: radial-gradient(circle at 50% 50%, var(--p-wash, var(--accent-a16)), transparent 70%);
  }
  .project-hero-icon img { width: clamp(150px, 16vw, 210px); }
}

.project-page .project-chips li {
  background: var(--p-wash, var(--accent-a08));
  color: var(--p, var(--accent));
  border-color: transparent;
  font-family: var(--font-mono);
  font-weight: 500;
}

.project-page .button { background: var(--p, var(--accent)); box-shadow: 0 0 0 1px color-mix(in srgb, var(--p, var(--accent)) 35%, transparent), 0 8px 30px var(--p-wash, var(--accent-a16)); }
.project-page .button:hover { filter: brightness(1.15); background: var(--p, var(--accent)); }
.project-page .button-secondary { background: transparent; }
.project-page .button-secondary:hover { background: var(--accent-a08); }

/* --- icon actions ---------------------------------------------------------- */
/* The hero actions carry a mark instead of a label. The name lives in
   aria-label for assistive tech and in data-label for the tooltip below,
   which is drawn here rather than left to the browser's title attribute:
   the native one waits about a second, too slow when the icon is the
   only thing naming the link. */
.project-cta { gap: 0.75rem; }
.project-cta .button {
  position: relative;
  width: 3.2rem;
  padding: 0;
}
.project-cta .button svg {
  width: 1.35rem;
  height: 1.35rem;
  display: block;
}
.project-cta .button::after,
.pd-controls button[data-label]::after {
  content: attr(data-label);
  position: absolute;
  top: calc(100% + 0.5rem);
  /* anchored to the button's left edge, not centred on it: the first
     button sits on the page gutter and a centred label would hang off it */
  left: 0;
  z-index: 3;
  padding: 0.3rem 0.6rem;
  border-radius: 0.5rem;
  background: var(--panel-2);
  color: var(--panel-ink);
  border: 1px solid var(--border-soft);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  line-height: 1.4;
  white-space: nowrap;
  opacity: 0;
  transform: translateY(-0.25rem);
  pointer-events: none;
  transition: opacity 110ms ease, transform 110ms ease;
}
.project-cta .button:hover::after,
.project-cta .button:focus-visible::after,
.pd-controls button[data-label]:hover::after,
.pd-controls button[data-label]:focus-visible::after {
  opacity: 1;
  transform: translateY(0);
  transition-delay: 40ms;
}
@media (prefers-reduced-motion: reduce) {
  .project-cta .button::after,
  .pd-controls button[data-label]::after { transition: opacity 110ms ease; transform: translateY(0); }
}

.project-terminal {
  border-color: var(--border);
  border-top: 2px solid color-mix(in srgb, var(--p, var(--accent)) 55%, transparent);
  box-shadow: 0 24px 70px rgba(0,0,0,0.55), 0 0 80px -40px var(--p, var(--accent));
}
.project-terminal-prompt { color: var(--p, var(--accent)); }
.project-terminal pre { font-size: 0.84rem; }
.project-terminal-cwd { color: var(--panel-ink-muted); }

.project-metrics { border-color: var(--border-soft); }
.project-metrics dl > div { display: flex; flex-direction: column-reverse; }
.project-metrics dd {
  font-family: var(--font-mono);
  font-size: 1.35rem;
  font-weight: 600;
  color: var(--ink-deep);
  line-height: 1.35;
}
.project-metrics dt {
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  color: var(--p, var(--accent));
  margin-top: 0.35rem;
}
.project-metrics-date { font-family: var(--font-mono); font-size: 0.72rem; }

.project-problem h2, .project-capabilities h2, .project-showcase h2,
.project-quickstart h2, .project-writeup h2 { letter-spacing: -0.03em; }
.project-problem p { color: var(--ink-soft); font-size: 1.25rem; }

.project-capability {
  background: var(--surface);
  border: 1px solid var(--border-softer);
  position: relative;
  overflow: hidden;
}
.project-capability::before {
  content: "";
  position: absolute; top: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, var(--p, var(--accent)), transparent 60%);
  opacity: 0.6;
}
.project-capability h3 { font-size: 1rem; color: var(--ink-deep); }

.project-shot img { border-color: var(--border-soft); box-shadow: 0 24px 70px rgba(0,0,0,0.45); }
.project-shot figcaption { font-family: var(--font-mono); font-size: 0.78rem; }

/* --- showcase slider ------------------------------------------------------- */
/* Reuses the blog slider. Two departures: the shots run from 1.46 to 1.75
   wide, so they are fitted whole into the frame rather than cropped to
   16/9, and the controls take the project's hue. */
.project-showcase .post-slider img {
  aspect-ratio: 16 / 10;
  object-fit: contain;
  background: var(--panel);
  border: 0;
  border-radius: 0;
  box-shadow: none;
}
.project-showcase .post-slider figcaption {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  margin-top: 0;
}
.project-showcase .post-slider-dot.is-active { background: var(--p, var(--accent)); }
.project-showcase .post-slider-status { color: var(--p, var(--accent)); }
.project-showcase .post-slider-control:focus-visible,
.project-showcase .post-slider-dot:focus-visible { outline-color: var(--p, var(--accent-ring)); }

.project-writeup { font-size: 1.02rem; }
.project-writeup strong { color: var(--ink-deep); }
.project-writeup :not(pre) > code { background: var(--p-wash, var(--accent-a08)); color: var(--p, var(--accent-strong)); }

.project-install {
  border: 1px solid var(--border);
  border-left: 3px solid var(--p, var(--accent));
}
.project-install-note { font-size: 0.9rem; }

.project-rail-block h2 { color: var(--ink-subtle); }
.project-related a { color: var(--ink-soft); text-decoration: none; }
.project-related a:hover { color: var(--p, var(--accent)); }
.project-related span { font-family: var(--font-mono); font-size: 0.76rem; }

/* --- skills ----------------------------------------------------------------- */

.skills-grid div { border-radius: 12px; padding-block: 0.5rem; }
.skills-grid .icon, .skills-grid .cropped-icon { transform: scale(0.72); }
.skill-header { font-size: 0.85rem; font-family: var(--font-mono); font-weight: 500; color: var(--ink-muted); }
.skills-toggle-control { color: var(--ink-muted); }

/* --- feed ------------------------------------------------------------------- */

.featured-post h3 { color: var(--ink-deep); }
.featured-playlist strong { color: var(--ink-soft); }
.featured-blog-see-all { color: var(--ink-muted); }
.featured-blog-see-all:hover { color: var(--accent-strong); }
.post-meta, .featured-playlist-date { font-family: var(--font-mono); }
.post-tags li { font-family: var(--font-mono); font-size: 0.72rem; }

/* --- contact + footer -------------------------------------------------------- */

.contact-form input, .contact-form textarea { background: var(--field); color: var(--ink); }
.contact-details a { color: var(--ink-soft); }
.contact-details li strong { color: var(--ink-deep); }
.lockscreen-clock { font-family: var(--font-mono); }

.site-footer {
  border-top: 1px solid var(--border-soft);
  color: var(--ink-subtle);
  font-size: 0.85rem;
}
.footer-mono { font-family: var(--font-mono); font-size: 0.78rem; color: var(--ink-subtle); }

/* --- motion ------------------------------------------------------------------ */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}

.project-metrics dd { display: flex; flex-direction: column; }
.project-metric-value { font-size: 2rem; font-weight: 600; line-height: 1.1; letter-spacing: -0.02em; }
.project-metric-detail { font-family: var(--font-mono); font-size: 0.76rem; font-weight: 400; color: var(--ink-subtle); margin-top: 0.3rem; }
.project-tile-stats { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

@media (max-width: 720px) {
  .header-inner { grid-template-columns: 1fr auto auto; }
  .site-wordmark { grid-row: 1; grid-column: 1; }
  .theme-toggle { grid-row: 1; grid-column: 2; }
  .nav-toggle-label { grid-row: 1; grid-column: 3; }
  .site-nav { grid-row: 2; grid-column: 1 / -1; }
}

/* ==========================================================================
   Theme toggle, and the light theme: the site's original white and blue,
   restored 22 September 2026 as a switchable mode. Dark stays the default.
   ========================================================================== */

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 8px;
  border: none;
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--ink-muted);
  cursor: pointer;
  transition: color 180ms ease, background 180ms ease;
}
.theme-toggle:hover { color: var(--ink-deep); background: var(--accent-a08); }
.theme-toggle:focus-visible { outline: none; box-shadow: 0 0 0 2px var(--accent-ring); }
.theme-toggle .theme-icon { display: none; width: 20px; height: 20px; }
:root:not([data-theme="light"]) .theme-toggle .theme-icon-sun { display: block; }
:root[data-theme="light"] .theme-toggle .theme-icon-moon { display: block; }

:root[data-theme="light"] {
  color-scheme: light;
  /* The page colour is an image layer rather than the background colour, so
     the default layout's script can colour the gap a bounce opens above the
     header without repainting the page. It repeats across but not down:
     Firefox skips the background colour, and a bounce shows white, when the
     bottom layer is opaque and repeats both ways. */
  background:
    radial-gradient(circle at top left, rgba(37, 99, 235, 0.18), transparent 22%),
    radial-gradient(circle at bottom right, rgba(59, 130, 246, 0.16), transparent 18%),
    linear-gradient(var(--bg), var(--bg)) repeat-x;
  background-color: var(--bg);

  --bg: #f7f7fb;
  --surface: #ffffff;
  --surface-2: #f1f5f9;

  --accent: #2563eb;
  --accent-strong: #1d4ed8;
  --accent-ring: #93c5fd;
  --accent-ink: #ffffff;
  --accent-wash: #eef2ff;
  --accent-a08: rgba(37, 99, 235, 0.08);
  --accent-a16: rgba(37, 99, 235, 0.16);
  --accent-a28: rgba(37, 99, 235, 0.28);
  --accent-a65: rgba(37, 99, 235, 0.65);

  --ink: #0f172a;
  --ink-deep: #111827;
  --ink-soft: #334155;
  --ink-muted: #475569;
  --ink-subtle: #64748b;

  --surface-sunken: #f8fafc;
  --border: #e2e8f0;
  --border-soft: rgba(148, 163, 184, 0.24);
  --border-softer: rgba(148, 163, 184, 0.22);
  --shadow-soft: rgba(15, 23, 42, 0.12);

  --ok: #15803d;
  --bad: #b91c1c;
  --flame: #ea580c;

  --field: #ffffff;

  --act-0: rgba(148, 163, 184, 0.20);
  --act-1: rgba(37, 99, 235, 0.22);
  --act-2: rgba(37, 99, 235, 0.45);
  --act-3: rgba(37, 99, 235, 0.68);
  --act-4: #2563eb;
}

/* The header keeps the original dark blue in light mode, so the controls on
   it stay light regardless of theme. */
:root[data-theme="light"] .site-header {
  background: rgba(30, 59, 122, 0.94);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  /* The same colour as it looks over the page, made solid, for the gap a
     bounce opens above the header. */
  --header-solid: color-mix(in srgb, rgb(30, 59, 122) 94%, var(--bg));
}
:root[data-theme="light"] .site-wordmark { color: #ffffff; }
/* On a project page the light header takes that project's hue instead of
   the site blue. It is darkened toward a neutral near-black rather than
   the slate the rest of the palette uses, which turns amber olive. The
   nav text is brighter here than on the blue header: at the usual 80%
   white, Brewery's amber measured 4.25:1, under AA; at 92% the lowest of
   the five is above 4.5. Dark mode keeps its own header. */
:root[data-theme="light"] .site-header[data-project-hue] {
  background: color-mix(in srgb, color-mix(in srgb, var(--p, var(--accent)) 40%, #16181d) 94%, transparent);
  --header-solid: color-mix(in srgb, color-mix(in srgb, var(--p, var(--accent)) 40%, #16181d) 94%, var(--bg));
}
:root[data-theme="light"] .site-header[data-project-hue] .site-nav a { color: rgba(255, 255, 255, 0.92); }
:root[data-theme="light"] .site-header[data-project-hue] .site-nav a:hover { color: #ffffff; }
:root[data-theme="light"] .site-header[data-project-hue] .site-wordmark span {
  color: color-mix(in srgb, var(--p, var(--accent)) 35%, #ffffff);
}
:root[data-theme="light"] .site-wordmark span { color: #93c5fd; }
:root[data-theme="light"] .site-nav a { color: rgba(255, 255, 255, 0.8); }
:root[data-theme="light"] .site-nav a:hover { background: rgba(255, 255, 255, 0.1); color: #ffffff; }
:root[data-theme="light"] .theme-toggle { color: rgba(255, 255, 255, 0.85); }
:root[data-theme="light"] .theme-toggle:hover { color: #ffffff; background: rgba(255, 255, 255, 0.1); }


/* Project hues were tuned for a dark ground; on white, small hue-coloured
   text darkens toward slate so it keeps contrast without losing identity. */
:root[data-theme="light"] .project-page .project-chips li,
:root[data-theme="light"] .project-tile .project-chips span,
:root[data-theme="light"] .project-metrics dt,
:root[data-theme="light"] .project-crumb span:last-child,
:root[data-theme="light"] .project-tile-cta,
:root[data-theme="light"] .project-tab.is-active,
:root[data-theme="light"] .project-note-evidence,
:root[data-theme="light"] .project-diagram-title,
:root[data-theme="light"] .pd-detail-title,
:root[data-theme="light"] .pd-play,
:root[data-theme="light"] .pd-step:hover,
:root[data-theme="light"] .project-terminal-prompt,
:root[data-theme="light"] .project-writeup :not(pre) > code,
:root[data-theme="light"] .pd-facts li {
  color: color-mix(in srgb, var(--p, var(--accent)) 55%, #1e2a44);
}
/* On white the tile logo casts slate, not black, and the hover keeps
   the project hue. */
:root[data-theme="light"] .project-tile-icon {
  filter: drop-shadow(0 5px 12px rgba(15, 23, 42, 0.16));
}
:root[data-theme="light"] .project-tile:hover .project-tile-icon {
  filter: drop-shadow(0 8px 20px var(--p-wash, var(--accent-a16)));
}
:root[data-theme="light"] .project-hero-icon img {
  filter: drop-shadow(0 10px 26px rgba(15, 23, 42, 0.18));
}
/* The hover lift too: half-black under a card reads as a hole on white,
   so it becomes a light slate lift with the hue bloom washed down. */
:root[data-theme="light"] .project-tile:hover {
  box-shadow: 0 14px 34px rgba(15, 23, 42, 0.12), 0 0 40px -18px var(--p-wash, var(--accent-a16));
}

/* Darkened hue for the filled button only: without the :not, this beat
   .project-page .button-secondary on specificity and painted the ghost
   buttons like primaries. */
:root[data-theme="light"] .project-page .button:not(.button-secondary) {
  background: color-mix(in srgb, var(--p, var(--accent)) 65%, #1f2937);
}
:root[data-theme="light"] .project-page .button:not(.button-secondary):hover {
  filter: none;
  background: color-mix(in srgb, var(--p, var(--accent)) 78%, #1f2937);
}

/* --- hero activity panel: public GitHub data baked in at build time ------ */

.hero-activity {
  padding: 1.5rem;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-card);
  background: var(--surface);
  box-shadow: 0 24px 60px var(--shadow-soft);
}

.hero-activity-head {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: baseline;
  column-gap: 0.75rem;
  margin-bottom: 1.1rem;
}
.hero-activity-total {
  font-family: var(--font-mono);
  font-size: 1.7rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--ink-deep);
  line-height: 1.1;
}
.hero-activity-streak {
  grid-column: 2;
  grid-row: 1 / 3;
  align-self: center;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-family: var(--font-mono);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--ink-deep);
  white-space: nowrap;
}
.hero-activity-streak svg {
  width: 1.05em;
  height: 1.05em;
  color: var(--flame);
}
.hero-activity-label {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--ink-subtle);
  margin-top: 0.3rem;
}

.activity-graph {
  display: grid;
  grid-auto-flow: column;
  grid-template-rows: repeat(7, 1fr);
  grid-auto-columns: 1fr;
  gap: 3px;
}
.activity-graph span {
  aspect-ratio: 1;
  border-radius: 2.5px;
  background: var(--act-0);
}
.activity-graph .act-1 { background: var(--act-1); }
.activity-graph .act-2 { background: var(--act-2); }
.activity-graph .act-3 { background: var(--act-3); }
.activity-graph .act-4 { background: var(--act-4); }

.activity-log {
  list-style: none;
  margin: 1.1rem 0 0;
  padding: 1rem 0 0;
  border-top: 1px solid var(--border-softer);
  display: grid;
  gap: 0.45rem;
}
.activity-log li {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  min-width: 0;
}
.activity-log-verb { color: var(--accent); flex-shrink: 0; }
.activity-log-detail {
  color: var(--ink-soft);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.activity-log time {
  margin-left: auto;
  flex-shrink: 0;
  color: var(--ink-subtle);
}

.hero-activity-note {
  margin: 1rem 0 0;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--ink-subtle);
}

:root[data-theme="light"] .hero-activity,
:root[data-theme="light"] .skills-grid div,
:root[data-theme="light"] .contact-form,
:root[data-theme="light"] .featured-post {
  box-shadow: 0 22px 55px rgba(15, 23, 42, 0.08);
}

/* ==========================================================================
   Project page sections and schematics
   ========================================================================== */

/* The site header's height, which the tab bar sticks beneath. These are the
   fallbacks for when JavaScript is off; project-tabs.js measures the header
   and keeps this exact as the breakpoint, the fonts or an open menu change it. */
:root { --header-h: 69px; }
@media (max-width: 720px) { :root { --header-h: 85px; } }

/* --- section tabs ---------------------------------------------------------- */

.project-tabs {
  position: sticky;
  top: var(--header-h);
  z-index: 10;
  margin: 0 0 2rem;
  padding: 0.75rem 0 0.5rem;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-soft);
}
.project-tabs-scroll {
  display: flex;
  gap: 0.25rem;
  overflow-x: auto;
  scrollbar-width: none;
}
.project-tabs-scroll::-webkit-scrollbar { display: none; }
.project-tab {
  flex: none;
  padding: 0.5rem 0.9rem;
  border-radius: var(--radius-pill);
  font-family: var(--font-mono);
  font-size: 0.82rem;
  letter-spacing: 0.01em;
  color: var(--ink-muted);
  text-decoration: none;
  white-space: nowrap;
  transition: color 160ms ease, background 160ms ease;
}
.project-tab:hover { color: var(--ink-deep); background: var(--p-wash, var(--accent-a08)); }
.project-tab.is-active {
  color: var(--p, var(--accent));
  background: var(--p-wash, var(--accent-a16));
  font-weight: 600;
}
.project-tab:focus-visible { outline: 2px solid var(--p, var(--accent-ring)); outline-offset: 2px; }

.project-panel { margin-bottom: 2.5rem; }
.project-panel[hidden] { display: none; }
.project-panel-heading {
  font-size: clamp(1.7rem, 2.2vw, 2.1rem);
  letter-spacing: -0.03em;
  margin: 0 0 0.75rem;
}
.project-panel-lede {
  font-size: 1.15rem;
  line-height: 1.7;
  color: var(--ink-soft);
  margin: 0 0 2rem;
}
.project-panel-closing {
  margin: 2rem 0 0;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border-softer);
  color: var(--ink-muted);
  font-size: 0.98rem;
}

/* Notes: the per-project points that a generic template would lose. */
.project-notes {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.25rem;
  margin-top: 2rem;
}
.project-note {
  padding: 1.25rem;
  border: 1px solid var(--border-soft);
  border-left: 2px solid var(--p, var(--accent));
  border-radius: 0 var(--radius-card) var(--radius-card) 0;
  background: var(--surface);
}
.project-note h3 {
  margin: 0 0 0.6rem;
  font-size: 1rem;
  color: var(--ink-deep);
}
.project-note p { margin: 0; color: var(--ink-muted); font-size: 0.95rem; line-height: 1.65; }
.project-note-evidence {
  margin-top: 0.7rem !important;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: var(--p, var(--accent));
}

/* --- schematics ------------------------------------------------------------ */

.project-diagram {
  margin: 0 0 2.5rem;
  padding: 1.5rem;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-card);
  background:
    radial-gradient(ellipse 80% 60% at 50% 0%, var(--p-wash, var(--accent-a08)), transparent 70%),
    var(--panel);
}
.project-diagram-title {
  margin: 0 0 1.25rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--p, var(--accent));
}
.project-diagram-ascii {
  margin: 0;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  line-height: 1.45;
  color: var(--panel-ink-muted);
}

/* Chart on the left, the selected stage's description on the right. The
   description sticks under the header and tab bar so it stays beside a
   tall chart while the reader scrolls it. */
.pd {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
  gap: 2rem;
  align-items: start;
}
.pd-chart { min-width: 0; }
.pd-aside {
  position: sticky;
  top: calc(var(--header-h) + 4.75rem);
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
@media (max-width: 960px) {
  .pd { grid-template-columns: minmax(0, 1fr); }
  .pd-aside { position: static; }
}

.pd:focus-visible { outline: 2px solid var(--p, var(--accent-ring)); outline-offset: 6px; border-radius: 0.75rem; }

.pd-query {
  margin: 0 0 1.5rem;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.6rem;
}
.pd-query-label {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--panel-ink-muted);
}
.pd-query code {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--panel-ink);
  background: var(--panel-2);
  border: 1px solid var(--border-softer);
  border-radius: 0.5rem;
  padding: 0.3rem 0.6rem;
}

.pd-stage { position: relative; display: flex; flex-direction: column; gap: 1.6rem; }
.pd-edges {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  color: var(--p, var(--accent));
  overflow: visible;
}
.pd-edge {
  fill: none;
  stroke: var(--border);
  stroke-width: 1.5;
  transition: stroke 260ms ease, opacity 260ms ease;
  opacity: 0.55;
}
.pd-edge.is-lit { stroke: var(--p, var(--accent)); opacity: 0.85; }
.pd-edge.is-active { stroke: var(--p, var(--accent)); opacity: 1; stroke-width: 2.25; }

.pd-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem;
  position: relative;
  z-index: 1;
}
.pd-node {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 8rem;
  max-width: 15rem;
  padding: 0.55rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: 0.7rem;
  background: var(--panel-2);
  color: var(--panel-ink-muted);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color 200ms ease, color 200ms ease, box-shadow 200ms ease, transform 200ms ease;
}
.pd-node-label { font-family: var(--font-mono); font-size: 0.82rem; font-weight: 600; }
.pd-node-meta { font-family: var(--font-mono); font-size: 0.66rem; opacity: 0.7; }
.pd-node:hover { border-color: var(--p, var(--accent)); color: var(--panel-ink); }
.pd-node.is-done { color: var(--panel-ink); border-color: color-mix(in srgb, var(--p, var(--accent)) 40%, transparent); }
.pd-node.is-active {
  color: var(--panel-ink);
  border-color: var(--p, var(--accent));
  box-shadow: 0 0 0 1px var(--p, var(--accent)), 0 10px 30px var(--p-wash, var(--accent-a16));
  transform: translateY(-1px);
}
.pd-node-refusal { border-style: dashed; }
.pd-node-refusal.is-active { border-style: solid; }
.pd-node:focus-visible { outline: 2px solid var(--p, var(--accent-ring)); outline-offset: 3px; }

.pd-detail {
  position: relative;
  overflow: hidden;
  border-radius: 0.8rem;
  background: var(--panel-2);
  border: 1px solid var(--border-softer);
}
/* One fixed height for every stage, so the controls below never move and
   Next stays under the pointer. 38rem fits 30 of the 41 descriptions whole
   at desktop width; the rest scroll inside it. On a short screen it gives
   way to what is left under the header, tab bar and controls. Scroll
   chaining is left on: once the text is at its end the wheel moves the
   page, rather than the box swallowing it. */
.pd { --pd-detail-h: min(38rem, calc(100vh - var(--header-h) - 13.75rem)); }
.pd-detail-inner {
  height: var(--pd-detail-h);
  overflow-y: auto;
  scrollbar-width: thin;
  padding: 1.35rem 1.35rem 1.25rem;
}
/* A fade on the bottom edge while more text sits below it, since overlay
   scrollbars stay hidden until someone scrolls. */
.pd-detail::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 3rem;
  border-radius: 0 0 0.8rem 0.8rem;
  background: linear-gradient(to bottom, transparent, var(--panel-2));
  opacity: 0;
  pointer-events: none;
  transition: opacity 160ms ease;
}
.pd-detail.has-more::after { opacity: 1; }
@media (max-width: 960px) {
  .pd { --pd-detail-h: min(36rem, 68vh); }
}
/* Time left on this stage while the tour runs. */
.pd-progress {
  position: absolute;
  inset: 0 0 auto 0;
  height: 2px;
  background: var(--border-softer);
}
.pd-progress-bar {
  display: block;
  height: 100%;
  background: var(--p, var(--accent));
  transform: scaleX(0);
  transform-origin: left center;
}
.pd:not(.is-auto) .pd-progress-bar { opacity: 0; }
@keyframes pd-fill { from { transform: scaleX(0); } to { transform: scaleX(1); } }

.pd-detail-eyebrow {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 0.6rem;
  margin: 0 0 0.35rem;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--panel-ink-muted);
}
/* Only the step count is set as a label: the meta is file and constant
   names, which upper case would misspell. */
.pd-eyebrow-step { letter-spacing: 0.08em; text-transform: uppercase; }
.pd-eyebrow-meta::before { content: "·"; margin-right: 0.6rem; }
.pd-detail-title {
  margin: 0 0 0.85rem;
  font-family: var(--font-mono);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--p, var(--accent));
}
.pd-detail-body p {
  margin: 0 0 0.8rem;
  color: var(--panel-ink-muted);
  font-size: 0.9rem;
  line-height: 1.64;
}
.pd-detail-body p:last-child { margin-bottom: 0; }
.pd-detail-body code {
  font-family: var(--font-mono);
  font-size: 0.82em;
  padding: 0.05em 0.35em;
  border-radius: 0.3rem;
  background: var(--panel);
  border: 1px solid var(--border-softer);
  color: var(--panel-ink);
  overflow-wrap: anywhere;
}
.pd-facts {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 1rem 0 0;
  padding: 0;
}
.pd-facts li {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  line-height: 1.4;
  padding: 0.25rem 0.55rem;
  border-radius: 0.4rem;
  background: var(--p-wash, var(--accent-a08));
  color: var(--p, var(--accent));
}

.pd-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
}
/* Round icon buttons, sized like the theme toggle. Play and pause is the
   primary control, so it carries the project hue; the steps stay quiet
   until hovered. */
.pd-play, .pd-step {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  background: transparent;
  color: var(--panel-ink);
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease, color 160ms ease;
}
.pd-play svg, .pd-step svg { display: block; width: 1rem; height: 1rem; }
.pd-play {
  border-color: var(--p, var(--accent));
  color: var(--p, var(--accent));
  background: var(--p-wash, var(--accent-a08));
}
.pd-step:hover { border-color: var(--p, var(--accent)); color: var(--p, var(--accent)); background: var(--p-wash, var(--accent-a08)); }
.pd-play:hover { background: color-mix(in srgb, var(--p, var(--accent)) 22%, transparent); }
.pd-play:focus-visible, .pd-step:focus-visible, .pd-dot:focus-visible {
  outline: 2px solid var(--p, var(--accent-ring)); outline-offset: 2px;
}
.pd-dots { display: flex; flex-wrap: wrap; gap: 0.3rem; margin-left: 0.25rem; }
.pd-dot {
  width: 0.5rem; height: 0.5rem; padding: 0;
  border: 0; border-radius: var(--radius-pill);
  background: var(--border);
  cursor: pointer;
  transition: background 160ms ease, transform 160ms ease;
}
.pd-dot.is-done { background: color-mix(in srgb, var(--p, var(--accent)) 45%, transparent); }
.pd-dot.is-active { background: var(--p, var(--accent)); transform: scale(1.35); }
.pd-status {
  flex-basis: 100%;
  margin: 0;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--panel-ink-muted);
}

@media (prefers-reduced-motion: reduce) {
  .pd-node, .pd-edge, .pd-dot { transition: none; }
}

@media (max-width: 700px) {
  .project-diagram { padding: 1rem; }
  .pd-node { min-width: 7rem; padding: 0.55rem 0.75rem; }
  .pd-stage { gap: 1.75rem; }
}

/* Project screenshots sit on a light frame in the light theme, so a
   light capture's transparent margin and window shadow land on white
   rather than on the dark panel. The slider's arrows turn dark and their
   hover scrims light, the dark treatment inverted. */
:root[data-theme="light"] .project-showcase {
  --panel: #ffffff;
  --panel-2: #f8fafc;
  --panel-ink: #0f172a;
  --panel-ink-muted: #475569;
  --border-softer: #e2e8f0;
}
:root[data-theme="light"] .project-showcase .post-slider-control { color: #0f172a; }
:root[data-theme="light"] .project-showcase .post-slider-media::before {
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.85), rgba(255, 255, 255, 0));
}
:root[data-theme="light"] .project-showcase .post-slider-media::after {
  background: linear-gradient(270deg, rgba(255, 255, 255, 0.85), rgba(255, 255, 255, 0));
}

/* The command-line surfaces (the terminal session, the quickstart
   command and any code block in a write-up) leave the fixed dark panel in
   light mode too. Their rules read the panel tokens, so re-pointing those
   inside each one turns it light without touching a component rule: a
   white window, a pale title bar, dark commands, slate output. */
:root[data-theme="light"] .project-terminal,
:root[data-theme="light"] .project-install,
:root[data-theme="light"] .project-writeup pre {
  --panel: #ffffff;
  --panel-2: #f1f5f9;
  --panel-ink: #0f172a;
  --panel-ink-muted: #475569;
  --border: #e2e8f0;
}
:root[data-theme="light"] .project-terminal {
  box-shadow: 0 22px 55px rgba(15, 23, 42, 0.08), 0 0 60px -36px var(--p, var(--accent));
}
:root[data-theme="light"] .project-install {
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
}

/* In light mode the schematic leaves the fixed dark panel the terminals
   use. Its rules all read the panel tokens, so re-pointing those inside
   .project-diagram turns the whole drawing light without touching a
   single component rule, and the terminals keep their dark panel. */
:root[data-theme="light"] .project-diagram {
  --panel: #ffffff;
  --panel-2: #f8fafc;
  --panel-ink: #0f172a;
  --panel-ink-muted: #475569;
  --border: #cbd5e1;
  --border-softer: #e2e8f0;
  border-color: var(--border-softer);
  box-shadow: 0 22px 55px rgba(15, 23, 42, 0.08);
}
/* Unlit edges were tuned to sit back on a dark ground; on white they
   need more weight to read as connections at all. */
:root[data-theme="light"] .pd-edge { stroke: #94a3b8; opacity: 0.8; }
:root[data-theme="light"] .pd-node.is-active {
  box-shadow: 0 0 0 1px var(--p, var(--accent)), 0 10px 26px rgba(15, 23, 42, 0.10);
}

/* Anchors land below the header and the tab bar, not under them. */
.project-panel, .project-quickstart, .project-diagram { scroll-margin-top: calc(var(--header-h) + 4.25rem); }
