/* ------------------------------------------------------------------
   Sujit Noronha — hand-written minimalist theme
   White. Serif display (Newsreader), sans body (Inter), mono details.
   One flourish: the short black rule under section headings.
   ------------------------------------------------------------------ */

:root {
  --ink: #1a1a1a;
  --muted: #6b7280;
  --hairline: #e8e8e4;
  --underline: #c9c9c2;
  --bg: #ffffff;
  --c-data1: #2a78d6;   /* series 1 / positive pole */
  --c-data1-deep: #1c5cab;
  --c-data2: #eb6834;   /* series 2 */
  --c-neg: #d03b3b;     /* negative pole / critical */
  --c-good: #0ca30c;    /* status good */
  --c-amber: #eda100;   /* small warm details */
  --serif: "Newsreader", Georgia, serif;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", "SF Mono", Menlo, monospace;
}

* {
  box-sizing: border-box;
}

html {
  font-size: 17px;
}

body {
  margin: 0 auto;
  max-width: 44rem;
  padding: 0 1.4rem 3rem;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

::selection {
  background: #d7e5f8;
}

/* ---------- Header ---------- */
.site-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.4rem 1rem;
  padding: 1.6rem 0 1.1rem;
  border-bottom: 1px solid var(--hairline);
  margin-bottom: 2.4rem;
}

.site-name {
  font-family: var(--serif);
  font-size: 1.25rem;
  font-weight: 600;
  text-decoration: none;
  color: var(--ink);
  letter-spacing: -0.01em;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.2rem 1.1rem;
  font-size: 0.82rem;
}

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

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

.site-nav a[aria-current="page"] {
  color: var(--c-data1-deep);
  font-weight: 500;
}

/* ---------- Typography ---------- */
h1, h2, h3, h4 {
  font-family: var(--serif);
  font-weight: 500;
  letter-spacing: -0.01em;
  line-height: 1.2;
  margin: 2.2rem 0 0.8rem;
}

h1 {
  font-size: 2.1rem;
  margin-top: 0.5rem;
}

h2 {
  font-size: 1.45rem;
  padding-bottom: 0.4rem;
  position: relative;
  margin-top: 2.6rem;
}

/* The one flourish: a short rule under section headings */
h2::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 2.4rem;
  height: 2.5px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--c-data1), #7c5cd6);
}

.grad {
  background: linear-gradient(100deg, var(--c-data1), #7c5cd6 60%, var(--c-data2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

h3 {
  font-size: 1.15rem;
}

p, ul, ol {
  margin: 0 0 1.1rem;
  font-size: 0.92rem;
}

ul, ol {
  padding-left: 1.3rem;
}

li {
  margin-bottom: 0.45rem;
}

li::marker {
  color: var(--muted);
}

strong {
  font-weight: 600;
}

hr {
  border: none;
  border-top: 1px solid var(--hairline);
  margin: 2.4rem 0;
}

em {
  font-family: var(--serif);
  font-size: 1.04em;
}

/* ---------- Links ---------- */
a {
  color: var(--c-data1-deep);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-decoration-color: color-mix(in srgb, var(--c-data1) 45%, transparent);
  text-underline-offset: 3px;
  transition: text-decoration-color 0.18s ease, color 0.18s ease;
}

a:hover {
  color: var(--c-data1);
  text-decoration-color: var(--c-data1);
}

h1 a, h2 a, h3 a {
  text-decoration: none;
}

/* ---------- Homepage hero ---------- */
.hero {
  padding-bottom: 0.4rem;
}

.hero .avatar {
  width: 92px;
  height: 92px;
  border-radius: 50%;
  display: block;
  margin-bottom: 1.3rem;
  border: 1px solid var(--hairline);
}

.hero h1 {
  font-size: clamp(2rem, 5vw, 2.6rem);
  margin-bottom: 1rem;
}

.hero p {
  font-size: 0.95rem;
  color: #2d2d2d;
  max-width: 40rem;
}

/* ---------- Blog list ---------- */
.post-list {
  list-style: none;
  padding: 0;
  margin: 1.6rem 0;
}

.post-list li {
  display: flex;
  align-items: baseline;
  gap: 1.1rem;
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--hairline);
  margin: 0;
}

.post-list time {
  font-family: var(--mono);
  font-size: 0.68rem;
  color: var(--muted);
  white-space: nowrap;
  min-width: 7.2rem;
}

.post-list a {
  font-family: var(--serif);
  font-size: 1.02rem;
  color: var(--ink);
  text-decoration: none;
}

.post-list a:hover {
  color: var(--c-data1-deep);
}

.post-list a:hover {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-decoration-color: var(--ink);
  text-underline-offset: 3px;
}

/* ---------- Posts ---------- */
.post-header {
  margin-bottom: 1.8rem;
}

.post-header h1 {
  margin-bottom: 0.4rem;
}

.post-meta {
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--c-data2);
  letter-spacing: 0.04em;
}

.post-back {
  margin-top: 2.6rem;
  font-size: 0.85rem;
}

.post-back a {
  text-decoration: none;
  color: var(--muted);
}

.post-back a:hover {
  color: var(--c-data1);
}

/* ---------- Code ---------- */
code {
  font-family: var(--mono);
  font-size: 0.8em;
  color: #184f95;
  background: color-mix(in srgb, var(--c-data1) 7%, #fff);
  padding: 0.12em 0.35em;
  border-radius: 4px;
}

pre {
  background: #f8f8f5;
  border: 1px solid var(--hairline);
  border-radius: 8px;
  padding: 0.95rem 1.1rem;
  overflow-x: auto;
  margin: 0 0 1.2rem;
  line-height: 1.55;
}

pre code {
  background: none;
  padding: 0;
  font-size: 0.74rem;
}

/* ---------- Tables ---------- */
table {
  border-collapse: collapse;
  width: 100%;
  margin: 0 0 1.3rem;
  font-size: 0.84rem;
  display: block;
  overflow-x: auto;
}

th {
  font-family: var(--sans);
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  text-align: left;
  padding: 0.5rem 0.9rem 0.5rem 0;
  border-bottom: 1px solid var(--hairline);
}

td {
  padding: 0.5rem 0.9rem 0.5rem 0;
  border-bottom: 1px solid var(--hairline);
  vertical-align: top;
}

/* ---------- Blockquote (used for project callouts) ---------- */
blockquote {
  margin: 0 0 1.2rem;
  padding: 0.2rem 0 0.2rem 1.1rem;
  border-left: 2px solid var(--c-data1);
  color: #2d2d2d;
}

blockquote p, blockquote ul {
  font-size: 0.88rem;
}

/* ---------- Project metadata lines ---------- */
.proj-meta {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--muted);
  line-height: 1.9;
  margin-bottom: 0.9rem;
}

/* ---------- Footer ---------- */
.site-footer {
  margin-top: 3.5rem;
  padding-top: 1.2rem;
  border-top: 1px solid var(--hairline);
  font-size: 0.78rem;
  color: var(--muted);
}

.site-footer a {
  color: var(--muted);
}

.site-footer a:hover {
  color: var(--c-data1);
}

/* ---------- Animations: quiet motion ---------- */
@media (prefers-reduced-motion: no-preference) {
  @keyframes fade-up {
    from { opacity: 0; transform: translateY(14px); }
    to   { opacity: 1; transform: translateY(0); }
  }

  /* Hero children stagger in on load — pure CSS */
  .hero > * {
    animation: fade-up 0.7s cubic-bezier(0.22, 1, 0.36, 1) both;
  }
  .hero > *:nth-child(1) { animation-delay: 0.05s; }
  .hero > *:nth-child(2) { animation-delay: 0.14s; }
  .hero > *:nth-child(3) { animation-delay: 0.23s; }
  .hero > *:nth-child(4) { animation-delay: 0.32s; }
  .hero > *:nth-child(5) { animation-delay: 0.41s; }

  /* Scroll reveal: .reveal is added by JS, so no-JS keeps all content visible */
  .reveal {
    opacity: 0;
    transform: translateY(14px);
    transition: opacity 0.6s cubic-bezier(0.22, 1, 0.36, 1),
                transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
  }

  .reveal.visible {
    opacity: 1;
    transform: translateY(0);
  }

  /* Heading rule draws in */
  h2::after {
    transform-origin: left center;
    transition: transform 0.55s cubic-bezier(0.22, 1, 0.36, 1) 0.1s;
  }

  h2.reveal:not(.visible)::after {
    transform: scaleX(0);
  }

  /* Blog rows nudge right on hover */
  .post-list li {
    transition: padding-left 0.2s ease;
  }

  .post-list li:hover {
    padding-left: 0.3rem;
  }
}

/* ---------- Small screens ---------- */
@media (max-width: 560px) {
  html { font-size: 16px; }

  .site-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .post-list li {
    flex-direction: column;
    gap: 0.05rem;
  }

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

/* ------------------------------------------------------------------
   Figures — monochrome charts, chat replays, flow diagrams
   ------------------------------------------------------------------ */
.fig {
  margin: 1.8rem 0 2rem;
  border: 1px solid var(--hairline);
  border-radius: 10px;
  padding: 1.2rem 1.3rem 1.3rem;
  background: #fcfcfa;
}

.fig figcaption {
  font-family: var(--mono);
  font-size: 0.68rem;
  color: var(--muted);
  line-height: 1.55;
  margin-bottom: 1rem;
}

/* ----- Bar charts ----- */
.barchart {
  display: grid;
  gap: 0.55rem;
}

.bar-row, .bar-pair {
  display: grid;
  grid-template-columns: 7.2rem 1fr 4.6rem;
  align-items: center;
  gap: 0.7rem;
}

.bar-label {
  font-family: var(--mono);
  font-size: 0.68rem;
  color: var(--ink);
  text-align: right;
  white-space: nowrap;
}

.bar-track {
  display: block;
  height: 12px;
  background: #efefeb;
  border-radius: 0 4px 4px 0;
  overflow: hidden;
}

.bar-fill {
  display: block;
  height: 100%;
  width: var(--w);
  background: var(--c-data1);
  border-radius: 0 4px 4px 0;
}

.bar-emph .bar-fill {
  background: var(--c-data1-deep);
}

.bar-fill-gray {
  background: var(--c-data2);
}

.bar-value {
  font-family: var(--mono);
  font-size: 0.68rem;
  color: var(--muted);
  white-space: nowrap;
}

.bar-emph .bar-label, .bar-emph .bar-value {
  font-weight: 600;
  color: var(--ink);
}

.bar-row:hover .bar-fill, .bar-pair:hover .bar-fill {
  opacity: 0.82;
}

/* Paired bars (two series per row) */
.bar-tracks {
  display: grid;
  gap: 2px;
}

.chart-legend {
  display: flex;
  gap: 1.2rem;
  margin-bottom: 0.8rem;
  font-family: var(--mono);
  font-size: 0.66rem;
  color: var(--muted);
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.legend-swatch {
  width: 14px;
  height: 9px;
  border-radius: 2px;
  display: inline-block;
}

.swatch-ink { background: var(--c-data1); }
.swatch-gray { background: var(--c-data2); }

/* ----- Diverging chart ----- */
.divchart {
  display: grid;
  gap: 0.55rem;
}

.div-row {
  display: grid;
  grid-template-columns: 8.4rem 1fr 3.2rem;
  align-items: center;
  gap: 0.7rem;
}

.div-label {
  font-family: var(--mono);
  font-size: 0.66rem;
  color: var(--ink);
  text-align: right;
  white-space: nowrap;
}

.div-track {
  display: grid;
  grid-template-columns: 2fr 5fr; /* scale: −2.5 .. +5 around the baseline */
  height: 12px;
}

.div-neg, .div-pos {
  position: relative;
  background: #efefeb;
}

.div-neg { border-radius: 4px 0 0 4px; }
.div-pos { border-radius: 0 4px 4px 0; border-left: 2px solid var(--ink); }

.div-pos .div-fill {
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: var(--w);
  background: var(--c-data1);
  border-radius: 0 4px 4px 0;
}

.div-neg .div-fill-neg {
  position: absolute;
  right: 0; top: 0; bottom: 0;
  width: var(--w);
  background: repeating-linear-gradient(135deg, var(--c-neg) 0 3px, #f3c4c4 3px 6px);
  border-radius: 4px 0 0 4px;
}

.div-value {
  font-family: var(--mono);
  font-size: 0.68rem;
  color: var(--muted);
}

.div-emph .div-label, .div-emph .div-value {
  font-weight: 600;
  color: var(--ink);
}

.div-emph .div-fill {
  background: var(--c-data1-deep);
}

/* ----- Chat replay ----- */
.chat {
  display: grid;
  gap: 0.7rem;
}

.chat-turn {
  max-width: 85%;
  border: 1px solid var(--hairline);
  border-radius: 10px;
  padding: 0.6rem 0.85rem;
  background: #fff;
}

.chat-turn p, .chat-outcome p {
  margin: 0;
  font-size: 0.8rem;
  line-height: 1.55;
}

.chat-user {
  justify-self: end;
  background: #f1f1ed;
  border-color: #e0e0da;
}

.chat-model { justify-self: start; }

.chat-kicker {
  display: block;
  font-family: var(--mono);
  font-size: 0.6rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.3rem;
}

.chat-outcomes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.7rem;
  margin-top: 0.3rem;
}

.chat-outcome {
  border: 1px solid var(--hairline);
  border-radius: 10px;
  padding: 0.6rem 0.85rem;
  background: #fff;
}

.chat-flip { border-style: dashed; border-color: #b9b9b2; }

.chat-verdict {
  display: inline-block;
  margin-top: 0.5rem;
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.05em;
  color: #006300;
  border: 1px solid var(--c-good);
  border-radius: 999px;
  padding: 0.1rem 0.55rem;
}

.chat-verdict-flip {
  background: var(--c-neg);
  border-color: var(--c-neg);
  color: #fff;
}

.chat-flip { border-color: #e7b1b1; }

/* ----- Flow diagrams ----- */
.flow {
  display: flex;
  align-items: stretch;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.flow-step {
  flex: 1 1 10rem;
  border: 1px solid var(--hairline);
  border-radius: 10px;
  background: #fff;
  padding: 0.65rem 0.85rem;
}

.flow-step p {
  margin: 0;
  font-size: 0.74rem;
  line-height: 1.5;
  color: #3a3a36;
}

.flow-kicker {
  display: block;
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--c-data1-deep);
  margin-bottom: 0.3rem;
}

.flow-arrow {
  align-self: center;
  font-family: var(--serif);
  font-size: 1.1rem;
  color: var(--muted);
}

.funnel {
  margin-top: 0.9rem;
  border-top: 1px solid var(--hairline);
  padding-top: 0.8rem;
  display: grid;
  gap: 0.35rem;
}

.funnel-row {
  display: flex;
  align-items: baseline;
  gap: 0.7rem;
}

.funnel-num {
  font-family: var(--serif);
  font-size: 1.05rem;
  font-weight: 600;
  min-width: 3.6rem;
  text-align: right;
}

.funnel-desc {
  font-size: 0.78rem;
  color: var(--muted);
}

/* ----- Figure animations ----- */
@media (prefers-reduced-motion: no-preference) {
  /* Bars grow when the figure is revealed (JS adds .reveal, then .visible) */
  .fig.reveal .bar-fill,
  .fig.reveal .div-fill,
  .fig.reveal .div-fill-neg {
    width: 0;
    transition: width 0.9s cubic-bezier(0.22, 1, 0.36, 1);
    transition-delay: calc(0.15s + var(--i, 0) * 90ms);
  }

  .fig.reveal.visible .bar-fill,
  .fig.reveal.visible .div-fill,
  .fig.reveal.visible .div-fill-neg {
    width: var(--w);
  }

  /* Chat turns and flow steps stagger in */
  .fig.reveal .chat-turn,
  .fig.reveal .chat-outcomes,
  .fig.reveal .flow-step,
  .fig.reveal .flow-arrow,
  .fig.reveal .funnel-row {
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.55s cubic-bezier(0.22, 1, 0.36, 1),
                transform 0.55s cubic-bezier(0.22, 1, 0.36, 1);
    transition-delay: calc(0.1s + var(--i, 0) * 180ms);
  }

  .fig.reveal.visible .chat-turn,
  .fig.reveal.visible .chat-outcomes,
  .fig.reveal.visible .flow-step,
  .fig.reveal.visible .flow-arrow,
  .fig.reveal.visible .funnel-row {
    opacity: 1;
    transform: translateY(0);
  }

  .bar-fill, .div-fill, .div-fill-neg {
    will-change: width;
  }
}

@media (max-width: 560px) {
  .bar-row, .bar-pair, .div-row {
    grid-template-columns: 5.4rem 1fr 3.4rem;
  }

  .bar-label, .div-label {
    font-size: 0.6rem;
    white-space: normal;
  }

  .chat-outcomes {
    grid-template-columns: 1fr;
  }

  .chat-turn { max-width: 100%; }
}

/* ------------------------------------------------------------------
   Two-column layout: identity sidebar left, content right
   ------------------------------------------------------------------ */
body {
  max-width: 64rem;
}

.layout {
  display: grid;
  grid-template-columns: 13.5rem minmax(0, 44rem);
  gap: 3rem;
  align-items: start;
}

.sidebar {
  position: sticky;
  top: 1.6rem;
  padding-top: 0.4rem;
}

.sidebar-avatar {
  width: 110px;
  height: 110px;
  border-radius: 50%;
  border: 1px solid var(--hairline);
  display: block;
  margin-bottom: 0.9rem;
}

.sidebar-name {
  font-family: var(--serif);
  font-size: 1.2rem;
  font-weight: 600;
  margin: 0 0 0.45rem;
}

.sidebar-bio {
  font-size: 0.78rem;
  line-height: 1.6;
  color: var(--muted);
  margin: 0 0 1rem;
}

.sidebar-bio a {
  color: var(--muted);
}

.sidebar-bio a:hover {
  color: var(--ink);
}

.sidebar-meta {
  list-style: none;
  padding: 0;
  margin: 0;
  border-top: 1px solid var(--hairline);
  padding-top: 0.9rem;
}

.sidebar-meta li {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 0.76rem;
  color: var(--muted);
  margin-bottom: 0.55rem;
}

.sidebar-meta svg {
  width: 14px;
  height: 14px;
  flex: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  color: var(--c-data1);
}

.sidebar-meta a {
  color: var(--muted);
  text-decoration: none;
}

.sidebar-meta a:hover {
  color: var(--c-data1);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

/* ---------- Post banners ---------- */
.post-banner, .banner-art {
  margin: 0 0 1.4rem;
}

.banner-art svg {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--hairline);
  border-radius: 10px;
  background: #fcfcfa;
  padding: 0.4rem 0;
}

/* ---------- Homepage blog teasers ---------- */
.teasers {
  display: grid;
  gap: 1.1rem;
  margin: 1.5rem 0;
}

.teaser {
  display: grid;
  grid-template-columns: 11rem 1fr;
  gap: 1.2rem;
  align-items: center;
  border: 1px solid var(--hairline);
  border-radius: 10px;
  padding: 1rem 1.15rem;
  text-decoration: none;
  transition: border-color 0.18s ease;
}

.teaser:hover {
  border-color: color-mix(in srgb, var(--c-data1) 45%, var(--hairline));
}

.teaser-banner {
  display: flex;
  align-items: center;
  height: 96px;
  background: #f6f6f3;
  border-radius: 8px;
  overflow: hidden;
}

.teaser-banner .banner-art {
  margin: 0;
  width: 100%;
}

.teaser-banner svg {
  display: block;
  width: 100%;
  height: auto;
  border: none;
  background: none;
  padding: 0;
  transform: scale(1.7);
  transform-origin: center;
}

.teaser-body {
  display: block;
  min-width: 0;
}

.teaser-date {
  display: block;
  font-family: var(--mono);
  font-size: 0.64rem;
  color: var(--c-data2);
  margin-bottom: 0.4rem;
}

.teaser-title {
  display: block;
  font-family: var(--serif);
  font-size: 1.05rem;
  font-weight: 500;
  line-height: 1.35;
  color: var(--ink);
  margin-bottom: 0.5rem;
}

.teaser-desc {
  display: block;
  font-size: 0.78rem;
  line-height: 1.6;
  color: var(--muted);
  margin-bottom: 0.65rem;
}

.teaser-more {
  display: block;
  font-family: var(--mono);
  font-size: 0.66rem;
  color: var(--c-data1-deep);
}

.teaser:hover .teaser-title {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

/* ---------- Banner + teaser animations ---------- */
@media (prefers-reduced-motion: no-preference) {
  @keyframes wv-grow {
    from { transform: scaleY(0.08); }
    to   { transform: scaleY(1); }
  }

  .banner-art .wv {
    transform-box: fill-box;
    transform-origin: center;
    animation: wv-grow 0.7s cubic-bezier(0.22, 1, 0.36, 1) both;
    animation-delay: var(--d, 0s);
  }

  @keyframes bn-in {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
  }

  .banner-art .bn {
    transform-box: fill-box;
    animation: bn-in 0.6s cubic-bezier(0.22, 1, 0.36, 1) both;
    animation-delay: var(--d, 0s);
  }

  .teaser {
    transition: border-color 0.18s ease, transform 0.2s ease;
  }

  .teaser:hover {
    transform: translateY(-2px);
  }
}

/* ---------- Responsive: collapse sidebar ---------- */
@media (max-width: 760px) {
  .layout {
    grid-template-columns: 1fr;
    gap: 1.6rem;
  }

  .sidebar {
    position: static;
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.2rem 1.1rem;
    border-bottom: 1px solid var(--hairline);
    padding-bottom: 1.2rem;
  }

  .sidebar-avatar {
    width: 72px;
    height: 72px;
    grid-row: 1 / 4;
    margin-bottom: 0;
  }

  .sidebar-bio { margin-bottom: 0.4rem; }

  .sidebar-meta {
    border-top: none;
    padding-top: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem 1rem;
  }

  .sidebar-meta li { margin-bottom: 0; }

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

/* ------------------------------------------------------------------
   Homepage showcase: project entries, badge buttons, skill pills
   ------------------------------------------------------------------ */
.proj {
  padding-bottom: 1.6rem;
  margin-bottom: 1.8rem;
  border-bottom: 1px solid var(--hairline);
}

.proj:last-of-type {
  border-bottom: none;
  margin-bottom: 0.4rem;
}

.proj h3 {
  margin-top: 0.4rem;
  margin-bottom: 0.5rem;
}

.proj p {
  font-size: 0.86rem;
}

.proj .banner-art {
  margin: 0.9rem 0 0;
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin: 0 0 0.75rem;
}

.btn {
  display: inline-block;
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.03em;
  color: var(--c-data1-deep);
  background: color-mix(in srgb, var(--c-data1) 7%, transparent);
  border: 1px solid color-mix(in srgb, var(--c-data1) 55%, transparent);
  border-radius: 6px;
  padding: 0.28rem 0.7rem;
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.btn:hover {
  background: var(--c-data1);
  border-color: var(--c-data1);
  color: #fff;
  text-decoration: none;
}

.pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.pills span {
  font-family: var(--mono);
  font-size: 0.64rem;
  border-radius: 999px;
  padding: 0.26rem 0.7rem;
  transition: transform 0.15s ease;
}

.pills span:nth-child(3n+1) {
  color: var(--c-data1-deep);
  border: 1px solid color-mix(in srgb, var(--c-data1) 45%, transparent);
  background: color-mix(in srgb, var(--c-data1) 8%, transparent);
}

.pills span:nth-child(3n+2) {
  color: #b44a1d;
  border: 1px solid color-mix(in srgb, var(--c-data2) 50%, transparent);
  background: color-mix(in srgb, var(--c-data2) 9%, transparent);
}

.pills span:nth-child(3n) {
  color: #0e7a56;
  border: 1px solid color-mix(in srgb, #1baf7a 50%, transparent);
  background: color-mix(in srgb, #1baf7a 9%, transparent);
}

.pills span:hover {
  transform: translateY(-1px);
}

/* ------------------------------------------------------------------
   Pixel avatar: explorer wandering Silicon Valley, chatting with LLMs
   ------------------------------------------------------------------ */
.px-avatar {
  overflow: hidden;
  background: #fcfcfa;
}

div.sidebar-avatar {
  width: 110px;
  height: 110px;
  border-radius: 50%;
  border: 1px solid var(--hairline);
  margin-bottom: 0.9rem;
}

.px-avatar svg {
  display: block;
  width: 100%;
  height: 100%;
  image-rendering: pixelated;
}

/* Static fallback: walk frame A shown, B hidden */
.px-legB { opacity: 0; }

@media (prefers-reduced-motion: no-preference) {
  @keyframes px-step {
    0%, 49.9% { opacity: 1; }
    50%, 100% { opacity: 0; }
  }

  .px-legA { animation: px-step 0.6s steps(1) infinite; }
  .px-legB { opacity: 1; animation: px-step 0.6s steps(1) infinite; animation-delay: -0.3s; }

  @keyframes px-bob {
    0%, 49.9% { transform: translateY(0); }
    50%, 100% { transform: translateY(-1.5px); }
  }

  .px-sprite { animation: px-bob 0.6s steps(1) infinite; }

  @keyframes px-scroll-city {
    from { transform: translateX(0); }
    to   { transform: translateX(-192px); }
  }

  .px-city { animation: px-scroll-city 16s linear infinite; }

  @keyframes px-scroll-ground {
    from { transform: translateX(0); }
    to   { transform: translateX(-48px); }
  }

  .px-ground { animation: px-scroll-ground 2.4s linear infinite; }

  @keyframes px-dot {
    0%, 15% { opacity: 0.15; }
    25%, 55% { opacity: 1; }
    65%, 100% { opacity: 0.15; }
  }

  .px-dot {
    animation: px-dot 1.4s infinite;
    animation-delay: calc(var(--i, 0) * 0.22s);
  }
}

@media (max-width: 760px) {
  div.sidebar-avatar {
    width: 72px;
    height: 72px;
    margin-bottom: 0;
  }
}
