:root {
  --bg: #eef2f5;
  --card: #f7f9fb;
  --surface: #dbe4ec;
  --text: #13202c;
  --muted: #44586b;
  --border: rgba(19, 32, 44, 0.14);
  --border-strong: rgba(19, 32, 44, 0.34);
  --accent: #c2561d;
  --accent-2: #2f5f86;
  --accent-soft: rgba(194, 86, 29, 0.11);
  --blue-soft: rgba(47, 95, 134, 0.10);
  --placeholder: #d3dde6;
  --dot: rgba(19, 32, 44, 0.28);
  --shadow: rgba(19, 32, 44, 0.16);
  --gt-hover-text: #13202c;
  --code-bg: #13202c;
  --code-text: #e6edf3;

  --serif: "Faustina", Georgia, serif;
  --sans: "Google Sans", system-ui, -apple-system, sans-serif;

  --width: 1180px;
  --radius: 14px;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background-color: var(--bg);
  background-image: radial-gradient(var(--dot) 1.1px, transparent 1.1px);
  background-size: 22px 22px;
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
}

h1,
h2,
h3 {
  font-family: var(--serif);
  font-weight: 700;
  line-height: 1.2;
  margin: 0;
}

svg {
  width: 1em;
  height: 1em;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

svg.icon-fill {
  fill: currentColor;
  stroke: none;
}

/* ── Top bar ─────────────────────────────────── */
.topbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  max-width: var(--width);
  margin: 0 auto;
  padding: 1.25rem 1.5rem 0;
}

.topbar-nav {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  font-size: 0.9rem;
}

.topbar-nav a {
  color: var(--muted);
  text-decoration: none;
  transition: color 0.15s;
}

.topbar-nav a:hover {
  color: var(--text);
}

/* ── Layout ──────────────────────────────────── */
.page {
  max-width: var(--width);
  margin: 0 auto;
  padding: 2.5rem 1.5rem 0;
}

.page > section + section {
  margin-top: 4rem;
}

.page > section {
  scroll-margin-top: 1.5rem;
}

.section-head {
  margin-bottom: 1.5rem;
}

.section-head h2 {
  font-size: 1.75rem;
}

.section-head p {
  margin: 0.35rem 0 0;
  color: var(--muted);
}

.section-head a,
.intro p a {
  color: var(--accent);
  text-decoration: none;
}

.section-head a:hover {
  text-decoration: underline;
}

.section-label {
  font-family: var(--sans);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 1rem;
}

/* ── Intro ───────────────────────────────────── */
.intro .hello {
  margin: 0;
  font-size: 1.1rem;
}

.wave {
  display: inline-block;
  transform-origin: 70% 70%;
  animation: wave 1.8s ease-in-out 0.5s 1;
}

.intro .hello:hover .wave {
  animation: wave 1.8s ease-in-out infinite;
}

@keyframes wave {
  0%, 60%, 100% { transform: rotate(0deg); }
  10%, 30% { transform: rotate(14deg); }
  20% { transform: rotate(-8deg); }
  40% { transform: rotate(-4deg); }
  50% { transform: rotate(10deg); }
}

.intro h1 {
  font-size: clamp(3rem, 9vw, 5.25rem);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.015em;
  opacity: 0.8;
  margin: 0.1em 0 1.1rem;
}

.intro p {
  margin: 0 0 1rem;
  color: var(--muted);
  font-size: 1.05rem;
  max-width: 62ch;
}

/* Georgia Tech Buzz Gold */
.intro p a.gt {
  color: #eaaa00;
  font-weight: 600;
  text-decoration: none;
  padding: 0 0.1em;
}

.intro p a.gt:hover {
  color: var(--gt-hover-text);
  background: #eaaa00;
}

.socials {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--card);
  font-size: 0.85rem;
  font-weight: 500;
  text-decoration: none;
  transition: border-color 0.15s, background-color 0.15s;
}

.pill:hover {
  border-color: var(--border-strong);
  background: var(--surface);
}

.pill-icon {
  padding: 0.45rem;
  font-size: 0.95rem;
}

.pill-accent {
  border-color: transparent;
  background: var(--accent-soft);
  color: var(--accent);
}

.pill-accent:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

/* ── Now ─────────────────────────────────────── */
.now-head {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  margin-bottom: 0.45rem;
}

.now-date {
  margin-left: auto;
  font-size: 0.8rem;
  color: var(--muted);
}

.now p {
  margin: 0;
  color: var(--muted);
  font-size: 1.02rem;
  line-height: 1.65;
}

.live-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--muted);
  flex-shrink: 0;
}

/* ── Experience ──────────────────────────────── */
.logos {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
}

.logo {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 3rem;
  padding: 0 1.1rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--card);
  text-decoration: none;
  transition: border-color 0.15s, transform 0.2s ease;
}

.logo:hover {
  border-color: var(--border-strong);
  transform: translateY(-2px);
}

.logo img {
  height: 1.6rem;
  width: auto;
  filter: grayscale(1);
  opacity: 0.8;
  transition: filter 0.2s, opacity 0.2s;
}

.logo:hover img {
  filter: none;
  opacity: 1;
}

.logo-text {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--muted);
}

/* ── Projects ────────────────────────────────── */
.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.25rem;
}

.card {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--card);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.card:hover {
  transform: translateY(-3px) scale(1.01);
  border-color: var(--border-strong);
  box-shadow: 0 12px 30px -12px var(--shadow);
}

.card-img {
  display: block;
  width: 100%;
  height: 190px;
  object-fit: cover;
  border-bottom: 1px solid var(--border);
}

.card-img.is-diagram {
  object-fit: contain;
  background: var(--card);
}

.card-img.is-empty {
  background: var(--placeholder);
}

.card-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  padding: 1.15rem 1.35rem 1.35rem;
}

.card h3 {
  font-size: 1.2rem;
  margin-bottom: 0.4rem;
}

.card p {
  flex: 1;
  margin: 0 0 1rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.card p:has(+ .stats) {
  flex: none;
}

.stats {
  flex: 1;
  margin: 0 0 1.1rem;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--border);
}

.stats li {
  padding: 0.4rem 0;
  border-bottom: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.45;
}

.stats b {
  color: var(--text);
  font-weight: 600;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.65rem;
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0;
  border-radius: 0;
  font-size: 0.78rem;
  font-weight: 500;
  line-height: 1.6;
  color: var(--muted);
}

.tag + .tag::before {
  content: "·";
  margin-right: 0.35rem;
  color: var(--muted);
}

.tag .live-dot {
  width: 6px;
  height: 6px;
}


.tag-blue,
.tag-green,
.tag-violet,
.tag-amber,
.tag-rose,
.tag-slate {
  background: transparent;
  color: var(--muted);
}

.links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: auto;
}

.link {
  padding: 0.2rem 0.8rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--card);
  font-size: 0.8rem;
  font-weight: 500;
  line-height: 1.8;
  text-decoration: none;
  transition: border-color 0.15s, background-color 0.15s;
}

.link:hover {
  border-color: var(--border-strong);
}

.link-primary {
  border-color: transparent;
  background: var(--text);
  color: var(--bg);
}

.link-primary:hover {
  border-color: transparent;
  background: var(--accent);
  color: var(--card);
}

/* ── Writing ─────────────────────────────────── */
.posts {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--border);
}

.posts li {
  border-bottom: 1px solid var(--border);
}

.post {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 1.1rem 0.25rem;
  text-decoration: none;
  transition: padding-left 0.2s ease;
}

.post:hover {
  padding-left: 0.6rem;
}

.post h3 {
  font-size: 1.15rem;
  transition: color 0.15s;
}

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

.post p {
  margin: 0.2rem 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.post time {
  flex-shrink: 0;
  color: var(--muted);
  font-size: 0.85rem;
  font-variant-numeric: tabular-nums;
}

/* ── Footer ──────────────────────────────────── */
.footer {
  max-width: var(--width);
  margin: 5rem auto 0;
  padding: 2rem 1.5rem 3rem;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.9rem;
}

.footer p {
  margin: 0;
}

.footer a {
  color: var(--accent);
  text-decoration: none;
}

.footer a:hover {
  text-decoration: underline;
}

.footer-small {
  margin-top: 0.35rem !important;
  font-size: 0.8rem;
}

.card-title {
  text-decoration: none;
  transition: color 0.15s;
}

.card-title:hover {
  color: var(--accent);
}

/* ── Project write-up pages ──────────────────── */
.back-link {
  display: inline-block;
  margin-bottom: 1.75rem;
  color: var(--muted);
  font-size: 0.9rem;
  text-decoration: none;
  transition: color 0.15s;
}

.back-link:hover {
  color: var(--text);
}

.article-header h1 {
  font-size: clamp(2.25rem, 6vw, 3.25rem);
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -0.01em;
  margin: 0.35rem 0 1rem;
}

.lede {
  margin: 0 0 2rem;
  color: var(--muted);
  font-size: 1.15rem;
  line-height: 1.6;
}

.article section {
  margin-top: 2.75rem;
}

.article h2 {
  font-size: 1.5rem;
  margin-bottom: 0.75rem;
}

.article h3 {
  font-size: 1.2rem;
  margin: 1.75rem 0 0.75rem;
}

.article section > p,
.article section > ul {
  color: var(--muted);
  font-size: 1.02rem;
  line-height: 1.75;
}

.article section > p {
  margin: 0 0 1rem;
}

.article section > ul {
  margin: 0 0 1rem;
  padding-left: 1.2rem;
}

.article section > ul li + li {
  margin-top: 0.35rem;
}

.figure {
  margin: 1.5rem 0;
}

.media {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--placeholder);
}

.media.is-diagram {
  object-fit: contain;
  background: var(--card);
}

.media.is-clear {
  border: none;
  background: transparent;
  object-fit: contain;
}

.media.is-empty {
  background: var(--placeholder);
}

.figure figcaption {
  margin-top: 0.5rem;
  color: var(--muted);
  font-size: 0.85rem;
  text-align: center;
}

.figure-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin: 1.5rem 0;
}

.figure-row .figure {
  margin: 0;
}

.figure-row .media {
  aspect-ratio: 4 / 3;
}

.article .results {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem;
  margin-top: 2rem;
}

.article .results.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.result {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--card);
}

.result-value {
  font-family: var(--serif);
  font-size: 1.6rem;
  font-weight: 800;
  line-height: 1.1;
  color: var(--text);
}

.result-label {
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.4;
}

.skills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.skills li {
  padding: 0.3rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--card);
  color: var(--text);
  font-size: 0.85rem;
  font-weight: 500;
}

.spec-table {
  width: 100%;
  margin: 1.25rem 0;
  border-collapse: collapse;
  font-size: 0.92rem;
}

.spec-table th,
.spec-table td {
  padding: 0.55rem 0.75rem;
  border-bottom: 1px solid var(--border);
  text-align: left;
}

.spec-table tr:first-child th,
.spec-table tr:first-child td {
  border-top: 1px solid var(--border);
}

.spec-table th {
  width: 7rem;
  color: var(--muted);
  font-weight: 600;
}

.spec-table td {
  color: var(--text);
}

.table-scroll {
  overflow-x: auto;
}

.calc-table th,
.calc-table thead th {
  width: auto;
  color: var(--muted);
  font-weight: 600;
}

.next-project {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin-top: 3.5rem;
  padding: 1.25rem 1.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
}

.next-project span {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.next-project a {
  font-family: var(--serif);
  font-size: 1.2rem;
  font-weight: 700;
  text-decoration: none;
  transition: color 0.15s;
}

.next-project a:hover {
  color: var(--accent);
}

/* ── Small screens ───────────────────────────── */
@media (max-width: 640px) {
  .grid {
    grid-template-columns: 1fr;
  }

  .post {
    flex-direction: column;
    gap: 0.25rem;
  }

  .post time {
    order: -1;
    font-size: 0.8rem;
  }

  .article .results {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .article .results.three {
    grid-template-columns: 1fr;
  }

  .figure-row {
    grid-template-columns: 1fr;
  }
}

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

/* ── Build-log write-up ──────────────────────── */
.figure figcaption {
  font-style: italic;
}

.media.is-light {
  padding: clamp(0.85rem, 3vw, 1.6rem);
  background: var(--card);
  object-fit: contain;
}

.media.is-natural {
  aspect-ratio: auto;
  height: auto;
}

.media.is-hero {
  aspect-ratio: 3 / 2;
}

.figure-row.square .media {
  aspect-ratio: 1 / 1;
}

.figure-row.wide .media {
  aspect-ratio: 2.2 / 1;
  padding: 0.75rem;
}

.media.is-contain {
  object-fit: contain;
}

.media.is-frame {
  aspect-ratio: 1024 / 734;
  object-fit: contain;
  height: auto;
}

video.media {
  aspect-ratio: 4 / 3;
  object-fit: contain;
  background: var(--code-bg);
  height: auto;
}

.gallery {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem;
  margin: -0.5rem 0 1.5rem;
}

.gallery .figure {
  margin: 0;
}

.gallery .media {
  aspect-ratio: 1 / 1;
}

.lights .gallery {
  margin: 0;
}

.lights .figure figcaption {
  margin-top: 0.45rem;
  font-style: normal;
  font-size: 0.82rem;
  text-align: left;
}

.lights-views {
  margin: 0 0 1.25rem;
}

.lights-views .media {
  aspect-ratio: 3 / 4;
  object-fit: contain;
  background: var(--card);
}

.downloads {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0 0 2rem;
}

.figure-row.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.figure-row.three .media {
  aspect-ratio: 4 / 3;
}

.figure-row.three.lights-views .media {
  aspect-ratio: 3 / 4;
}

.phases {
  margin: 0;
  padding: 0;
  list-style: none;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  overflow: hidden;
}

.phases li {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  padding: 0.7rem 1rem;
  color: var(--muted);
  font-size: 0.95rem;
}

.phases li + li {
  border-top: 1px solid var(--border);
}

.phases li b {
  color: var(--text);
  font-weight: 600;
}

.phases li.done {
  color: var(--text);
}

.phase-check {
  flex: none;
  position: relative;
  top: 0.15em;
  width: 1rem;
  height: 1rem;
  border: 1.5px solid var(--border-strong);
  border-radius: 4px;
}

.phases li.done .phase-check {
  border-color: var(--text);
  background: transparent;
}

.phases li.done .phase-check::after {
  content: "";
  position: absolute;
  left: 4px;
  top: 0px;
  width: 4px;
  height: 8px;
  border: solid var(--text);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.phase-when {
  margin-left: auto;
  padding-left: 0.75rem;
  color: var(--muted);
  font-size: 0.8rem;
  white-space: nowrap;
}

.log-intro {
  margin: 0 0 0.5rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.log-entry {
  position: relative;
  margin-top: 2.25rem;
  padding: 0 0 0.5rem 1.5rem;
  border-left: 2px solid var(--border);
}

.log-entry::before {
  content: "";
  position: absolute;
  left: -7px;
  top: 0.35rem;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--bg);
}

.log-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
  color: var(--muted);
  font-size: 0.82rem;
}

.log-day {
  color: var(--text);
  font-weight: 700;
  letter-spacing: 0.02em;
}

.phase-tag {
  padding: 0;
  border-radius: 0;
  background: transparent;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 500;
}

.log-entry h3 {
  margin: 0.4rem 0 0.9rem;
  font-family: var(--serif);
  font-size: 1.45rem;
  font-weight: 700;
  line-height: 1.2;
}

.log-entry h4 {
  margin: 2rem 0 0.6rem;
  font-size: 1.05rem;
  color: var(--text);
}

.log-entry > p,
.log-entry > ul,
.log-entry > ol,
.faq p {
  color: var(--muted);
  font-size: 1.02rem;
  line-height: 1.75;
}

.log-entry > p {
  margin: 0 0 1rem;
}

.log-entry > ul,
.log-entry > ol {
  margin: 0 0 1rem;
  padding-left: 1.2rem;
}

.log-entry li + li {
  margin-top: 0.4rem;
}

.log-entry b,
.article section > ul b {
  color: var(--text);
}

.table-wrap {
  margin: 1.25rem 0;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--card);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.data-table th,
.data-table td {
  padding: 0.6rem 0.85rem;
  text-align: left;
  vertical-align: top;
}

.data-table th {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--border);
}

.data-table td {
  color: var(--text);
}

.data-table tbody tr + tr td {
  border-top: 1px solid var(--border);
}

.data-table tr.highlight td {
  background: var(--accent-soft);
}

.callout {
  margin: 1.25rem 0;
  padding: 0.9rem 1.1rem;
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  background: var(--surface);
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.65;
}

.callout-label {
  display: block;
  margin-bottom: 0.2rem;
  color: var(--text);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.faq details {
  border-bottom: 1px solid var(--border);
}

.faq details:first-of-type {
  border-top: 1px solid var(--border);
}

.faq summary {
  padding: 0.85rem 0;
  color: var(--text);
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}

.faq summary::-webkit-details-marker {
  display: none;
}

.faq summary::before {
  content: "+";
  display: inline-block;
  width: 1.25rem;
  color: var(--accent);
  transition: transform 0.2s;
}

.faq details[open] summary::before {
  transform: rotate(45deg);
}

.faq details p {
  margin: 0 0 1rem 1.25rem;
}

.tune {
  margin: 0.25rem 0 1.5rem;
  border-top: 1px solid var(--border);
}

.tune details {
  border-bottom: 1px solid var(--border);
}

.tune summary {
  position: relative;
  padding: 0.85rem 0 0.85rem 1.35rem;
  color: var(--text);
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}

.tune summary::-webkit-details-marker {
  display: none;
}

.tune summary::before {
  content: "+";
  position: absolute;
  left: 0;
  top: 0.8rem;
  color: var(--accent);
  font-weight: 500;
  transition: transform 0.2s;
}

.tune details[open] summary::before {
  transform: rotate(45deg);
}

.tune summary .hint {
  display: block;
  margin-top: 0.2rem;
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.75rem;
  font-weight: 400;
  line-height: 1.45;
}

.tune details[open] summary .hint {
  display: none;
}

.tune pre {
  margin: 0 0 0.85rem;
  padding: 0.95rem 1.05rem;
  overflow-x: auto;
  border-radius: 10px;
  background: var(--code-bg);
  color: var(--code-text);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.82rem;
  line-height: 1.65;
}

.tune pre code {
  display: block;
  color: inherit;
  font-family: inherit;
  white-space: pre;
}

.tune p {
  margin: 0 0 1rem;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.65;
}

.build-log {
  margin-top: 1.25rem;
}

.log-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.log-bar h2 {
  margin: 0;
}

.log-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-left: auto;
}

.log-actions .pill {
  cursor: pointer;
  font-family: inherit;
  color: inherit;
}

.log-card {
  margin: 0 0 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
}

.log-card summary {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 1.05rem 1.15rem;
  cursor: pointer;
  list-style: none;
}

.log-card summary::-webkit-details-marker {
  display: none;
}

.log-card-copy {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  flex: 1;
  min-width: 0;
}

.log-card-title {
  font-family: var(--serif);
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.25;
}

.log-card-date {
  color: var(--muted);
  font-size: 0.82rem;
}

.log-star {
  flex: none;
  width: 0.95rem;
  height: 0.95rem;
  margin-top: 0.22rem;
  background: var(--accent);
  clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
}

.log-star.is-empty {
  visibility: hidden;
}

.log-chevron {
  flex: none;
  width: 0;
  height: 0;
  margin-top: 0.48rem;
  border: 4px solid transparent;
  border-left-color: var(--muted);
}

.log-card[open] .log-chevron {
  margin-top: 0.55rem;
  border-left-color: transparent;
  border-top-color: var(--muted);
}

.log-card:not([open]) > *:not(summary) {
  display: none !important;
}

.log-card-body {
  padding: 0 1.15rem 1.25rem;
}

.log-card-body > p {
  margin: 0 0 1rem;
  color: var(--muted);
  font-size: 1.02rem;
  line-height: 1.75;
}

@media (max-width: 640px) {
  .gallery {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .figure-row.three {
    grid-template-columns: 1fr;
  }

  .log-entry {
    padding-left: 1.1rem;
  }

  .phase-when {
    display: none;
  }
}

/* ── Design calculations ─────────────────────── */
.log-card-body h4 {
  margin: 1.75rem 0 0.4rem;
  font-family: var(--serif);
  font-size: 1.1rem;
}

.log-card-body .calc-table {
  margin: 0.5rem 0 1rem;
}

.log-card-body .calc-table td:last-child {
  font-variant-numeric: tabular-nums;
}

.log-card-body .mass-table td:first-child {
  width: 60%;
}

.log-card-body small {
  color: var(--muted);
  font-size: 0.82rem;
}

.module-diagram {
  margin: 1.25rem 0;
  padding: 0.75rem 0.5rem 0.25rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
}

.module-diagram svg {
  width: 100%;
  height: auto;
  fill: none;
  stroke: none;
}

.module-diagram .d-title {
  fill: var(--text);
  font: 700 15px var(--sans);
}

.module-diagram .d-sub,
.module-diagram .d-label {
  fill: var(--muted);
  font: 400 12px var(--sans);
}

.module-diagram .d-ring {
  fill: var(--accent-2);
}

.module-diagram .d-ringtext {
  fill: #fff;
  font: 600 11px var(--sans);
}

.module-diagram .d-pinion {
  fill: var(--surface);
  stroke: var(--accent-2);
  stroke-width: 2;
}

.module-diagram .d-axle {
  stroke: var(--muted);
  stroke-width: 4;
}

.module-diagram .d-axlegear {
  fill: var(--accent-soft);
  stroke: var(--accent);
  stroke-width: 2.5;
}

.module-diagram .d-wheel {
  fill: var(--text);
}

.module-diagram .d-arrow {
  stroke: var(--accent);
  stroke-width: 2.5;
  stroke-linecap: round;
}

.module-diagram .d-head {
  fill: var(--accent);
  stroke: none;
}

.diagram-pair {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.5rem;
}

.module-diagram svg {
  min-width: 0;
}

.log-card-body,
.log-card-body > * {
  min-width: 0;
}

@media (max-width: 640px) {
  .diagram-pair {
    grid-template-columns: 1fr;
  }

  .log-card-body .spec-table {
    display: block;
    overflow-x: auto;
  }

  .log-card-body {
    overflow-wrap: break-word;
  }
}

.log-card-body .decision-table td {
  vertical-align: top;
  line-height: 1.6;
}

.log-card-body .decision-table td:first-child {
  width: 34%;
  color: var(--text);
}

.log-card-body .decision-table td:first-child b {
  font-weight: 700;
}

.log-card-body > ul {
  margin: 0 0 1rem;
  padding-left: 1.2rem;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.7;
}

.log-card-body > ul li + li {
  margin-top: 0.5rem;
}

.log-card-body > ul b {
  color: var(--text);
}

.log-card-body pre.formula {
  margin: 0 0 1.25rem;
  padding: 0.95rem 1.05rem;
  overflow-x: auto;
  border-radius: 10px;
  background: var(--code-bg);
  color: var(--code-text);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.82rem;
  line-height: 1.65;
}

.log-card-body pre.formula code {
  display: block;
  color: inherit;
  font-family: inherit;
  white-space: pre;
}

/* ── Featured projects, status light, lights grid ── */
.status-live {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  align-self: flex-start;
  margin-bottom: 0.75rem;
  padding: 0.25rem 0.75rem 0.25rem 0.6rem;
  border: 1px solid rgba(34, 160, 84, 0.35);
  border-radius: 999px;
  background: rgba(34, 160, 84, 0.1);
  color: #17703c;
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1.5;
}

.tags .status-live,
.article-header .tags .status-live {
  margin-bottom: 0;
}

.tag + .status-live::before,
.status-live + .tag::before {
  content: none;
}

.live-light {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22a054;
  box-shadow: 0 0 0 0 rgba(34, 160, 84, 0.6);
  animation: live-pulse 2s ease-out infinite;
}

@keyframes live-pulse {
  0% { box-shadow: 0 0 0 0 rgba(34, 160, 84, 0.55); }
  70% { box-shadow: 0 0 0 7px rgba(34, 160, 84, 0); }
  100% { box-shadow: 0 0 0 0 rgba(34, 160, 84, 0); }
}

.grid {
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

.card-feature {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
}

.card-feature:hover {
  transform: translateY(-3px);
}

.card-feature .card-img {
  height: 100%;
  min-height: 380px;
  border-bottom: none;
  border-right: 1px solid var(--border);
}

.card-feature .card-img.is-diagram {
  padding: 1rem;
  background: var(--blue-soft);
}

.card-feature .card-body {
  padding: 1.75rem 2rem;
}

.card-feature h3 {
  font-size: 1.75rem;
  margin-bottom: 0.6rem;
}

.card-feature p {
  flex: none;
  font-size: 1rem;
  line-height: 1.7;
}

.card-feature .tags {
  margin-bottom: 1rem;
}

.card-secondary {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
}

.card-secondary .card-img {
  min-height: 300px;
}

.card-secondary h3 {
  font-size: 1.45rem;
}

.card-secondary p {
  font-size: 0.95rem;
}

.log-list {
  margin: 0 0 1.25rem;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--border);
}

.log-list li {
  border-bottom: 1px solid var(--border);
}

.log-list a {
  display: flex;
  gap: 1rem;
  padding: 0.5rem 0;
  font-size: 0.9rem;
  text-decoration: none;
  transition: color 0.15s;
}

.log-list a:hover {
  color: var(--accent);
}

.log-list span {
  flex: none;
  width: 4.2rem;
  color: var(--muted);
}

.card-feature .links {
  margin-top: auto;
}

.lights-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
}

.lights-grid .figure {
  margin: 0;
}

.lights-grid .media {
  aspect-ratio: 3 / 4;
  object-fit: cover;
}

.lights-grid .media.is-light {
  object-fit: contain;
}

.lights-grid .figure figcaption {
  margin-top: 0.45rem;
  font-style: normal;
  font-size: 0.82rem;
  text-align: left;
}

.downloads-card {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 1.25rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  aspect-ratio: 3 / 4;
}

.downloads-card h3 {
  font-size: 1.1rem;
  margin-bottom: 0.4rem;
}

.downloads-card p {
  margin: 0 0 1rem;
  color: var(--muted);
  font-size: 0.88rem;
}

.downloads-card .downloads {
  margin: 0;
  flex-direction: column;
  align-items: flex-start;
}

@media (max-width: 900px) {
  .lights-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .card-feature,
  .card-secondary {
    grid-template-columns: 1fr;
  }

  .card-feature .card-img,
  .card-secondary .card-img {
    min-height: 0;
    height: 240px;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }

  .card-feature .card-body {
    padding: 1.25rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .live-light {
    animation: none !important;
  }
}

/* ══ Home page layout, modelled on a single-column editorial grid ══
   Everything is scoped to body.home so the project sub-pages are untouched. */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.home .page,
.home .footer {
  max-width: none;
  margin-left: 0;
  margin-right: 0;
  padding-left: max(5vw, calc(50% - 480px));
  padding-right: max(5vw, calc(50% - 480px));
}

.home .page {
  padding-top: 5vmin;
}

.home .page > section + section {
  margin-top: 2rem;
}

/* Hero */
.home .intro .hello {
  margin: 0;
}

.home .intro h1 {
  font-size: 16vw;
  line-height: 1em;
  margin: 0.15em 0 1.5vmin;
}

@media (min-width: 640px) {
  .home .intro h1 {
    font-size: 10vmin;
  }
}

.home .socials {
  margin: 0 0 0.75rem;
  gap: 0.5rem;
}

.home .intro p {
  max-width: none;
  margin: 0 0 0.75rem;
}

/* "What I'm doing now" runs on from the intro */
.home .now {
  margin-top: 1.25rem;
}

.home .now-head {
  gap: 0.75rem;
  margin-bottom: 0.15rem;
}

.home .now .section-label {
  margin: 0;
}

.home .now-date {
  margin-left: 0;
}

.home .now p {
  max-width: none;
  font-size: 1.05rem;
}

/* Project grid: one column, 2rem gaps */
.home .projects {
  margin-top: 1.5rem;
}

.home .grid {
  grid-template-columns: 1fr;
  gap: 2rem;
}

.home .card {
  border-radius: 14px;
}

.home .card-feature,
.home .card-feature.card-reverse {
  display: grid;
  max-height: none;
}

.home .card-feature {
  grid-template-columns: 52% minmax(0, 1fr);
}

.home .card-feature.card-reverse {
  grid-template-columns: minmax(0, 1fr) 52%;
}

.home .card-feature .card-img {
  grid-column: 1;
  grid-row: 1;
  width: 100%;
  height: 100%;
  min-height: 0;
  max-height: none;
  padding: 1rem;
  object-fit: contain;
  border-bottom: none;
  border-right: 1px solid var(--border);
  background: var(--surface);
}

.home .card-feature.card-reverse .card-img {
  grid-column: 2;
  border-right: none;
  border-left: 1px solid var(--border);
}

.home .card-feature .card-body {
  grid-row: 1;
  grid-column: 2;
  justify-content: flex-start;
  padding: 1.5em;
}

.home .card-feature.card-reverse .card-body {
  grid-column: 1;
}

.home .card-feature h3 {
  font-size: 1.4rem;
  margin-bottom: 0.4em;
}

.home .card-feature p {
  flex: none;
  margin: 0 0 1em;
  font-size: 0.88rem;
  line-height: 1.65;
}

/* Badges as small pills above the title */
.home .tags {
  gap: 0.4em;
  margin-bottom: 0.5em;
}

.home .tag {
  padding: 0.2em 0.65em;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  font-size: 0.72rem;
  line-height: 1.8;
}

.home .tag + .tag::before {
  content: none;
}

.home .tags .status-live {
  margin: 0;
  padding: 0.2em 0.65em;
  font-size: 0.72rem;
  line-height: 1.8;
}

.home .card-feature p + .tags {
  margin: 0 0 0.5em;
}

/* Dated log rows */
.home .log-list {
  margin: 0.6em 0 0.9em;
}

.home .log-list a {
  gap: 0.85em;
  padding: 0.28em 0;
  font-size: 0.78rem;
  line-height: 1.4;
}

.home .log-list span {
  width: 3.6em;
  font-size: 0.72rem;
}

.home .log-list li {
  border-bottom: 1px solid var(--border);
}

.home .stats {
  flex: none;
  margin: 0 0 1em;
}

.home .card-feature .links {
  margin-top: auto;
}

/* Light building: same column, same card styling */
.home .lights .section-head {
  margin-bottom: 1.25rem;
}

.home .lights-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 2rem;
}

.home .lights-grid .figure,
.home .downloads-card {
  display: flex;
  flex-direction: column;
  margin: 0;
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  background: var(--card);
}

.home .lights-grid .media {
  aspect-ratio: 4 / 5;
  border: none;
  border-radius: 0;
  border-bottom: 1px solid var(--border);
}

.home .lights-grid .figure figcaption {
  margin: 0;
  padding: 0.7em 1em 0.8em;
}

.home .downloads-card {
  aspect-ratio: auto;
  justify-content: flex-start;
  padding: 1.25em 1.25em 1.4em;
}

.home .downloads-card .downloads {
  gap: 0.5em;
}

/* Footer: divider, then a short centred line */
.home .footer {
  margin-top: 2em;
  padding-top: 0;
  padding-bottom: 6vh;
  border-top: none;
  text-align: center;
}

.home .footer::before {
  content: "";
  display: block;
  margin: 2em 0 1.5em;
  border-top: 1px solid var(--border);
}

/* Narrower screens */
@media (max-width: 900px) {
  .home .lights-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.25rem;
  }
}

@media (max-width: 760px) {
  .home .card-feature,
  .home .card-feature.card-reverse {
    grid-template-columns: 1fr;
  }

  .home .card-feature .card-img,
  .home .card-feature.card-reverse .card-img {
    grid-column: 1;
    grid-row: 1;
    height: 240px;
    border: none;
    border-bottom: 1px solid var(--border);
  }

  .home .card-feature .card-body,
  .home .card-feature.card-reverse .card-body {
    grid-column: 1;
    grid-row: 2;
  }
}

/* ══ Project build-log page (scoped to body.project-log) ══ */
.project-log .page {
  max-width: 1020px;
  padding: 1.5vmin clamp(1rem, 3vw, 2rem) 0;
}

.project-log .back-link {
  margin-bottom: 1.25rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text);
}

.project-log .article-header h1 {
  font-size: clamp(1.9rem, 4.5vw, 3rem);
  line-height: 1.05;
  margin: 0.2rem 0 1.25rem;
}

.project-log .article-header .tags {
  gap: 0.4em;
}

.hero-grid {
  display: grid;
  gap: 1.5em;
  align-items: stretch;
}

@media (min-width: 640px) {
  .hero-grid {
    grid-template-columns: 58% minmax(0, 1fr);
  }
}

.viewer-col {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.viewer {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1 1 auto;
  min-height: 300px;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  overflow: hidden;
}

.viewer img {
  display: block;
  max-width: 100%;
  max-height: 420px;
  object-fit: contain;
}

.filmstrip {
  display: flex;
  gap: 0.5em;
  margin-top: 0.6em;
  overflow-x: auto;
}

.filmstrip-thumb {
  position: relative;
  flex: 0 0 auto;
  width: 5.2em;
  height: 3.8em;
  padding: 0;
  border: 2px solid transparent;
  border-radius: 8px;
  overflow: hidden;
  background: var(--surface);
  opacity: 0.75;
  cursor: pointer;
  transition: border-color 0.15s, opacity 0.15s;
}

.filmstrip-thumb:hover {
  opacity: 1;
}

.filmstrip-thumb.active {
  border-color: var(--accent-2);
  opacity: 1;
}

.filmstrip-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.thumb-label {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 0.1em 0.3em;
  background: rgba(19, 32, 44, 0.65);
  color: #fff;
  font-size: 0.6rem;
  font-weight: 600;
  line-height: 1.5;
  text-align: center;
}

.info-col {
  display: flex;
  flex-direction: column;
  padding: 0.25em 0;
  min-width: 0;
}

.hero-lede {
  margin: 0 0 1rem;
  color: var(--text);
  font-size: 1.02rem;
  line-height: 1.65;
}

.hero-where {
  margin: 0 0 1.5rem;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.6;
}

.hero-where b {
  color: var(--text);
}

.section-marker,
.project-log .build-log h2.section-marker,
.project-log .why h2.section-marker {
  margin: 0 0 0.75rem;
  color: var(--muted);
  font-family: var(--sans);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.phases-list {
  flex: 1;
  margin: 0;
  padding: 0;
  list-style: none;
}

.phase {
  display: flex;
  gap: 0.75em;
  align-items: baseline;
  padding: 0.6em 0;
  border-bottom: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.5;
}

.phase-status {
  flex-shrink: 0;
  width: 1.1em;
  color: var(--border-strong);
  font-size: 0.85rem;
  text-align: center;
}

.phase.done .phase-status {
  color: #22a054;
}

.phase.active .phase-status {
  color: var(--accent);
}

.phase-text {
  color: var(--text);
}

.phase-text a {
  text-decoration: none;
}

.phase-label {
  margin-right: 0.3em;
  color: var(--text);
  font-family: var(--serif);
  font-weight: 700;
}

.project-log .why {
  margin-top: 2rem;
}

.project-log .why p {
  margin: 0;
  max-width: 62ch;
}

.drone-rule {
  margin: 2rem 0 1.5rem;
  border: none;
  border-top: 1px solid var(--border-strong);
}

.project-log .build-log {
  margin-top: 0;
}

.project-log .log-bar {
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.project-log .log-bar h2 {
  margin: 0;
}

.project-log .log-actions {
  gap: 0.75rem;
  align-items: baseline;
}

.project-log .log-actions .pill[data-log="oldest"] {
  padding: 0;
  border: none;
  background: none;
  font-size: 0.82rem;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.project-log .log-actions .pill[data-log="oldest"]::after {
  content: " ↓";
}

.project-log .log-actions .pill[data-log="collapse"] {
  padding: 0.1rem 0.6rem;
  font-size: 0.82rem;
}

.project-log .log-card {
  border-radius: 10px;
  margin-bottom: 1rem;
}

.project-log .log-card-title {
  font-size: 1.02rem;
}

.project-log .log-card-body {
  margin: 0 1.15rem;
  padding: 0.9rem 0 1.25rem;
  border-top: 1px solid var(--border);
}

.project-log .log-card-body > p {
  color: var(--text);
}

.project-log .log-card-body b {
  color: var(--text);
}

.project-log .log-card-body > ul {
  color: var(--text);
}

/* Figures: image with a caption strip, in a bordered frame */
.project-log .log-card-body .figure {
  margin: 1.25rem 0;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  background: var(--card);
}

.project-log .log-card-body .figure .media {
  border: none;
  border-radius: 0;
}

.project-log .log-card-body .figure figcaption {
  margin: 0;
  padding: 0.55em 0.9em;
  border-top: 1px solid var(--border);
  background: var(--surface);
  font-size: 0.82rem;
  font-style: normal;
}

.project-log .figure-row {
  gap: 1rem;
}

.project-log .figure-row .figure {
  margin: 0;
}

@media (max-width: 640px) {
  .project-log .log-actions {
    margin-left: 0;
  }
}

.viewer-caption {
  margin: 0.6rem 0 0;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.5;
}

.project-log .stat-list .phase {
  padding: 0.5em 0;
}

.project-log .next-marker {
  margin-top: 1.25rem;
}

.project-log .why .skills {
  margin-top: 0.25rem;
}

.project-log .why .skills {
  padding-left: 0;
}

/* Placeholder project card */
.home .card-img.is-empty {
  background:
    repeating-linear-gradient(45deg, rgba(19, 32, 44, 0.04) 0 10px, transparent 10px 20px),
    var(--surface);
}

.link.is-static {
  border-color: transparent;
  background: var(--muted);
  color: var(--bg);
  cursor: default;
}

.link.is-static:hover {
  border-color: transparent;
}

.home .card-placeholder .card-img {
  min-height: 220px;
}

.home .card-placeholder:hover {
  transform: none;
}

/* "Awaiting" sign next to the Ongoing light */
.status-wait {
  display: inline-flex;
  align-items: center;
  padding: 0.2em 0.65em;
  border: 1px solid rgba(194, 86, 29, 0.4);
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1.8;
}

.article section > ul.skills li + li {
  margin-top: 0;
}

/* ══════════════════════════════════════════════════════════
   Blog layout (index + posts), modelled on a simple blog:
   small header, a label column beside content, list of posts
   with thumbnails, and narrow single-column posts.
   ══════════════════════════════════════════════════════════ */
.site-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  max-width: 1080px;
  margin: 0 auto;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
}

.brand {
  font-family: var(--serif);
  font-size: 1.35rem;
  font-weight: 800;
  text-decoration: none;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.5rem;
  font-size: 0.92rem;
}

.site-nav a {
  color: var(--muted);
  text-decoration: none;
  transition: color 0.15s;
}

.site-nav a:hover {
  color: var(--text);
}

.site-foot {
  max-width: 1080px;
  margin: 4rem auto 0;
  padding: 1.75rem 1.5rem 3rem;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.92rem;
}

.site-foot p {
  margin: 0;
}

.site-foot a {
  color: var(--accent);
  text-decoration: none;
}

.foot-small {
  margin-top: 0.35rem !important;
  font-size: 0.8rem;
}

/* Index */
.blog-main {
  max-width: 1080px;
  margin: 0 auto;
  padding: 2.25rem 1.5rem 0;
}

.blog-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 3fr);
  gap: 2rem;
  padding-bottom: 2.5rem;
}

.blog-row + .blog-row {
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}

.blog-label {
  margin: 0;
  font-size: 1.4rem;
}

.blog-row.lights {
  margin-top: 0;
}

.blog .intro h1 {
  font-size: clamp(2.5rem, 6vw, 3.75rem);
  line-height: 1.05;
  margin: 0.1em 0 0.8rem;
}

.blog .intro .hello {
  margin: 0;
}

.blog .socials {
  margin: 0 0 1rem;
}

.blog .intro p {
  max-width: 62ch;
}

.blog .now-line {
  margin-top: 1rem;
  font-size: 0.95rem;
}

.blog .now-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin-right: 0.4rem;
  color: var(--text);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.now-date {
  color: var(--muted);
  font-size: 0.8rem;
  white-space: nowrap;
}

.post-list {
  min-width: 0;
}

.post-card {
  display: grid;
  grid-template-columns: minmax(0, 190px) minmax(0, 1fr);
  gap: 1.5rem;
  align-items: center;
  padding: 0.25rem 0;
  color: inherit;
  text-decoration: none;
}

.post-card img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: contain;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
}

.post-card .post-title {
  margin: 0 0 0.2rem;
  font-size: 1.45rem;
  line-height: 1.2;
  transition: color 0.15s;
}

.post-card:hover .post-title {
  color: var(--accent);
}

.post-snippet {
  margin: 0 0 0.3rem;
  color: var(--muted);
  font-family: var(--sans);
  font-size: 1rem;
  font-weight: 400;
}

.post-date,
.post-by {
  margin: 0 0 0.25rem;
  color: var(--muted);
  font-family: var(--sans);
  font-size: 0.85rem;
  font-weight: 400;
  line-height: 1.4;
}

.post-badges {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.5rem;
}

.post-badges .status-live,
.post-badges .status-wait {
  margin: 0;
  font-size: 0.72rem;
}

.post-badges .tag {
  padding: 0.15em 0.6em;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  font-size: 0.72rem;
  line-height: 1.7;
}

.post-badges .tag + .tag::before {
  content: none;
}

.post-divider {
  height: 0;
  margin: 1.25rem 0;
  border-top: 1px solid var(--border);
}

.blog .lights-intro {
  margin: 0 0 1.25rem;
  color: var(--muted);
  max-width: 62ch;
}

.blog .lights-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.25rem;
}

.blog .lights-grid .figure,
.blog .downloads-card {
  display: flex;
  flex-direction: column;
  margin: 0;
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  background: var(--card);
}

.blog .lights-grid .media {
  aspect-ratio: 4 / 5;
  border: none;
  border-radius: 0;
  border-bottom: 1px solid var(--border);
  object-fit: cover;
}

.blog .lights-grid .media.is-light {
  object-fit: contain;
}

.blog .lights-grid .figure figcaption {
  margin: 0;
  padding: 0.7em 1em 0.8em;
  font-style: normal;
  font-size: 0.82rem;
  text-align: left;
}

.blog .downloads-card {
  justify-content: flex-start;
  padding: 1.25em 1.25em 1.4em;
  aspect-ratio: auto;
}

.blog .downloads-card .downloads {
  gap: 0.5em;
  flex-direction: column;
  align-items: flex-start;
  margin: 0;
}

/* Posts */
.post-main {
  max-width: 760px;
  margin: 0 auto;
  padding: 2.25rem 1.5rem 0;
}

.post-main h1.post-title {
  margin: 0 0 0.4rem;
  font-size: clamp(2rem, 5vw, 2.9rem);
  line-height: 1.1;
}

.post-subtitle {
  margin: 0 0 0.9rem;
  color: var(--muted);
  font-family: var(--sans);
  font-size: 1.2rem;
  font-weight: 400;
  line-height: 1.4;
}

.post-main .post-badges {
  margin: 0.5rem 0 1.5rem;
}

.post-hero {
  margin: 1.5rem 0;
}

.post-note {
  margin: 0 0 1.25rem;
  padding: 0.85rem 1.1rem;
  border-left: 3px solid var(--accent-2);
  background: var(--blue-soft);
  border-radius: 0 10px 10px 0;
  color: var(--text);
  font-size: 1rem;
  line-height: 1.65;
}

.post-main article > p,
.post-body > p,
.post-body > ul {
  color: var(--text);
  font-size: 1.05rem;
  line-height: 1.75;
}

.post-main article > p {
  margin: 0 0 1.1rem;
}

.post-body > p {
  margin: 0 0 1.1rem;
}

.post-body > ul {
  margin: 0 0 1.1rem;
  padding-left: 1.3rem;
}

.post-body > ul li + li {
  margin-top: 0.4rem;
}

.post-body > ul.skills {
  padding-left: 0;
}

.post-body > ul.skills li + li {
  margin-top: 0;
}

.short-version {
  margin: 0 0 1.25rem;
  padding-left: 1.3rem;
  font-size: 1.05rem;
  line-height: 1.7;
}

.post-h {
  margin: 2.5rem 0 0.9rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  font-size: 1.6rem;
}

.post-body > .post-h:first-child {
  margin-top: 1.5rem;
}

.post-body h4 {
  margin: 1.75rem 0 0.4rem;
  font-family: var(--serif);
  font-size: 1.15rem;
}

.post-body .figure {
  margin: 1.5rem 0;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  background: var(--card);
}

.post-body .figure .media {
  border: none;
  border-radius: 0;
}

.post-body .figure figcaption {
  margin: 0;
  padding: 0.55em 0.9em;
  border-top: 1px solid var(--border);
  background: var(--surface);
  font-size: 0.85rem;
  font-style: normal;
  text-align: center;
}

.post-body .figure-row {
  gap: 1rem;
}

.post-body .figure-row .figure {
  margin: 0;
}

.post-hero .media.is-hero {
  aspect-ratio: 3 / 2;
}

.post-body .tune,
.post-body .table-scroll {
  margin-top: 0.5rem;
}

.post-body .spec-table {
  display: block;
  overflow-x: auto;
  font-size: 0.9rem;
}

.post-contact {
  margin: 3rem 0 0;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

.read-more {
  margin: 3rem 0 1.25rem;
  font-size: 1.35rem;
}

.post-main .post-list {
  padding-bottom: 1rem;
}

/* Rules carried over from the old collapsible-card write-ups */
.post-body > p {
  margin: 0 0 1rem;
  color: var(--muted);
  font-size: 1.02rem;
  line-height: 1.75;
}

.post-body h4 {
  margin: 1.75rem 0 0.4rem;
  font-family: var(--serif);
  font-size: 1.1rem;
}

.post-body .calc-table {
  margin: 0.5rem 0 1rem;
}

.post-body .calc-table td:last-child {
  font-variant-numeric: tabular-nums;
}

.post-body .mass-table td:first-child {
  width: 60%;
}

.post-body small {
  color: var(--muted);
  font-size: 0.82rem;
}

.post-body,
.post-body > * {
  min-width: 0;
}

.post-body .decision-table td {
  vertical-align: top;
  line-height: 1.6;
}

.post-body .decision-table td:first-child {
  width: 34%;
  color: var(--text);
}

.post-body .decision-table td:first-child b {
  font-weight: 700;
}

.post-body > ul {
  margin: 0 0 1rem;
  padding-left: 1.2rem;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.7;
}

.post-body > ul li + li {
  margin-top: 0.5rem;
}

.post-body > ul b {
  color: var(--text);
}

.post-body pre.formula {
  margin: 0 0 1.25rem;
  padding: 0.95rem 1.05rem;
  overflow-x: auto;
  border-radius: 10px;
  background: var(--code-bg);
  color: var(--code-text);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.82rem;
  line-height: 1.65;
}

.post-body pre.formula code {
  display: block;
  color: inherit;
  font-family: inherit;
  white-space: pre;
}

.blog .lights .section-head {
  margin-bottom: 1.25rem;
}

.blog .lights-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 2rem;
}

.blog .lights-grid .figure,
.blog .downloads-card {
  display: flex;
  flex-direction: column;
  margin: 0;
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  background: var(--card);
}

.blog .lights-grid .media {
  aspect-ratio: 4 / 5;
  border: none;
  border-radius: 0;
  border-bottom: 1px solid var(--border);
}

.blog .lights-grid .figure figcaption {
  margin: 0;
  padding: 0.7em 1em 0.8em;
}

.blog .downloads-card {
  aspect-ratio: auto;
  justify-content: flex-start;
  padding: 1.25em 1.25em 1.4em;
}

.blog .downloads-card .downloads {
  gap: 0.5em;
}

.post-body > p {
  color: var(--text);
}

.post-body b {
  color: var(--text);
}

.post-body > ul {
  color: var(--text);
}

.post-body .figure {
  margin: 1.25rem 0;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  background: var(--card);
}

.post-body .figure .media {
  border: none;
  border-radius: 0;
}

.post-body .figure figcaption {
  margin: 0;
  padding: 0.55em 0.9em;
  border-top: 1px solid var(--border);
  background: var(--surface);
  font-size: 0.82rem;
  font-style: normal;
}

.blog .lights-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: start;
  gap: 1.25rem;
}

.blog .downloads-card {
  aspect-ratio: auto;
}

@media (max-width: 760px) {
  .blog-row {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }

  .blog .lights-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .post-card {
    grid-template-columns: minmax(0, 120px) minmax(0, 1fr);
    gap: 1rem;
    align-items: start;
  }

  .post-card .post-title {
    font-size: 1.15rem;
  }

  .post-snippet {
    font-size: 0.92rem;
  }
}

@media (max-width: 420px) {
  .post-card {
    grid-template-columns: 1fr;
  }
}


/* Mini tables and galleries (narrative posts) */
.post-body .download-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0 0 1.25rem;
}

.post-body .mini-table {
  margin: 1.25rem 0 1.5rem;
  overflow-x: auto;
}

.post-body .mini-table table {
  width: auto;
  min-width: 60%;
  max-width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

.post-body .mini-table th,
.post-body .mini-table td {
  padding: 0.4rem 1.25rem 0.4rem 0;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}

.post-body .mini-table thead th {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.post-body .mini-table tbody tr:last-child td {
  border-bottom: 1px solid var(--border-strong);
}

.post-body .mini-table .table-caption {
  margin: 0.5rem 0 0;
  color: var(--muted);
  font-size: 0.82rem;
  font-style: italic;
}

.post-body .gallery-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 0.6rem;
  margin: 1.25rem 0;
}

.post-body .gallery-row .figure .media {
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.post-body .gallery-row .figure .media.is-clear,
.post-body .gallery-row .figure .media.is-light {
  object-fit: contain;
}

.post-body .gallery-row .figure figcaption {
  font-size: 0.78rem;
  padding: 0.45em 0.7em;
}

.post-body > ul b {
  color: var(--text);
}


/* ══ Post pages: plain white reading surface (no dot grid), card on a pale page ══ */
body.blog-post {
  background-color: #f6f8f9;
  background-image: none;
}

.blog-post .site-head {
  max-width: none;
  padding: 0.5rem clamp(1rem, 4vw, 2rem);
  border-bottom: none;
  background: #ffffff;
  box-shadow: 0 5px 10px rgba(0, 0, 0, 0.05), 0 3px 3px rgba(0, 0, 0, 0.01);
}

.blog-post .brand {
  font-size: 1.25rem;
  font-weight: 700;
}

.blog-post .post-main {
  max-width: 860px;
  margin: 2rem auto;
  padding: 2rem clamp(1.25rem, 5vw, 3rem) 2.25rem;
  border-radius: 5px;
  background: #ffffff;
  box-shadow: 0 5px 10px rgba(0, 0, 0, 0.05);
}

.blog-post .post-main h1.post-title {
  font-size: clamp(1.7rem, 4vw, 2.2rem);
  font-weight: 700;
}

.blog-post .post-subtitle {
  font-size: 1.15rem;
}

.blog-post article > p,
.blog-post .post-body > p,
.blog-post .post-body > ul {
  font-size: 1.1rem;
  line-height: 1.75;
}

.blog-post .post-note {
  border-left: 4px solid var(--accent-2);
  background: #f6f8f9;
  font-size: 1.05rem;
}

.blog-post .post-h {
  border-top: none;
  padding-top: 0;
  margin: 2.5rem 0 0.75rem;
  font-size: 1.55rem;
}

/* Figures: no frame, centred image, centred grey caption underneath */
.blog-post .post-body .figure,
.blog-post .post-hero {
  border: none;
  background: transparent;
  border-radius: 0;
  overflow: visible;
  box-shadow: none;
}

.blog-post .post-body .figure .media,
.blog-post .post-hero .media {
  border: none;
  background: transparent;
  border-radius: 4px;
}

.blog-post .post-body .figure figcaption,
.blog-post .post-hero figcaption {
  padding: 0.5rem 0 0;
  border-top: none;
  background: transparent;
  color: #5f6e78;
  font-size: 0.95rem;
  font-style: normal;
  text-align: center;
}

.blog-post .post-hero {
  margin: 1.5rem 0;
}

.blog-post .post-hero .media.is-hero {
  aspect-ratio: auto;
  max-height: 55vh;
  object-fit: contain;
}

.blog-post .post-body .gallery-row .figure .media {
  background: #f6f8f9;
}

/* Tables: full width, light grey header, thin grid lines */
.blog-post .post-body .mini-table table {
  width: 100%;
  min-width: 0;
  border-collapse: collapse;
}

.blog-post .post-body .mini-table th,
.blog-post .post-body .mini-table td {
  padding: 0.6rem 0.75rem;
  border: 1px solid #dde2e6;
}

.blog-post .post-body .mini-table thead th {
  background: #f2f4f5;
  color: var(--text);
  font-size: 0.85rem;
  letter-spacing: 0;
  text-transform: none;
}

.blog-post .post-body .mini-table tbody tr:last-child td {
  border-bottom: 1px solid #dde2e6;
}

.blog-post .post-body .tune pre {
  background: #14202b;
}

.blog-post .post-contact {
  margin-top: 2.5rem;
  border-top: 1px solid #e6eaed;
}

/* Read More sits in its own white card, like a suggestions panel */
.blog-post .read-more,
.blog-post .post-main .post-list {
  max-width: 860px;
}

.blog-post .site-foot {
  max-width: 860px;
  margin-top: 0;
  border-top: none;
}

@media (max-width: 760px) {
  .blog-post .post-main {
    margin: 0;
    border-radius: 0;
    box-shadow: none;
  }

  body.blog-post {
    background: #ffffff;
  }
}

/* ── Featured project (home) + post contents line, added Nov 2026 ── */
.feature {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: 1.75rem;
  align-items: stretch;
  padding: 1.25rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  color: inherit;
  text-decoration: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.feature:hover { border-color: var(--border-strong); box-shadow: 0 6px 24px var(--shadow); }
.feature:hover .post-title { color: var(--accent); }
.feature-media { display: grid; grid-template-columns: 1.15fr 1fr; gap: 0.6rem; min-width: 0; min-height: 340px; }
.feature-media img, .feature-media video {
  display: block; width: 100%; height: 100%; min-height: 0; object-fit: cover;
  border: 1px solid var(--border); border-radius: 10px; background: var(--surface);
}
.feature-media .stack { display: grid; grid-template-rows: 1fr 1fr; gap: 0.6rem; min-height: 0; }
.feature-media .stack img { object-fit: contain; background: var(--bg); }
.feature .post-title { margin: 0.35rem 0 0.4rem; font-size: clamp(1.5rem, 2.6vw, 2rem); line-height: 1.15; transition: color 0.15s; }
.feature-kicker { margin: 0; color: var(--accent); font-size: 0.75rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; }
.feature-text p { margin: 0 0 0.75rem; color: var(--muted); line-height: 1.6; }
.feature-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.5rem; margin: 0.9rem 0; padding: 0; list-style: none; }
.feature-stats li { padding: 0.55rem 0.65rem; border: 1px solid var(--border); border-radius: 10px; background: var(--bg); font-size: 0.78rem; line-height: 1.35; color: var(--muted); }
.feature-stats b { display: block; color: var(--text); font-family: var(--serif); font-size: 1.25rem; line-height: 1.1; }
.feature-cta { display: inline-flex; align-items: center; gap: 0.4rem; color: var(--accent); font-weight: 600; }
@media (max-width: 860px) {
  .feature { grid-template-columns: 1fr; padding: 1rem; }
  .feature-media { min-height: 0; aspect-ratio: 5 / 4; }
}
@media (max-width: 420px) {
  .feature-media { grid-template-columns: 1fr; aspect-ratio: 4 / 3; }
  .feature-media .stack { display: none; }
  .feature-stats { grid-template-columns: 1fr 1fr; }
}
.post-toc { margin: 0 0 1.5rem; color: var(--muted); font-size: 0.92rem; line-height: 1.9; }
.post-toc a { color: var(--accent-2); text-decoration: none; white-space: nowrap; }
.post-toc a:hover { text-decoration: underline; }
