/* ============================================================
   rodrigosf.com — design system
   Dark-first, terminal-inspired, developer-tooling aesthetic.
   ============================================================ */

:root {
  /* type */
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  /* dark theme (default) */
  --bg: #0a0e16;
  --bg-raised: #101624;
  --bg-inset: #0d1220;
  --border: #1e2637;
  --border-strong: #2c3650;
  --text: #e8ecf4;
  --text-muted: #98a2b8;
  --text-faint: #6b7690;
  --accent: #54d148;          /* anaconda green — primary */
  --accent-dim: rgba(84, 209, 72, 0.13);
  --violet: #b39dfb;          /* keywords */
  --amber: #f2c464;           /* strings / highlights */
  --rose: #f28fad;
  --terminal-green: #7ee787;
  --shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
  --dot-grid: rgba(152, 162, 184, 0.09);
}

[data-theme="light"] {
  --bg: #f7f8fa;
  --bg-raised: #ffffff;
  --bg-inset: #eef1f6;
  --border: #e0e5ed;
  --border-strong: #c9d1de;
  --text: #182033;
  --text-muted: #505b72;
  --text-faint: #7a849b;
  --accent: #2e7d1f;
  --accent-dim: rgba(67, 176, 42, 0.10);
  --violet: #6841d8;
  --amber: #96610a;
  --rose: #c4386b;
  --terminal-green: #1a7f37;
  --shadow: 0 10px 32px rgba(24, 32, 51, 0.10);
  --dot-grid: rgba(24, 32, 51, 0.07);
}

/* ---------- reset & base ---------- */

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

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

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

img { max-width: 100%; }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}

::selection { background: var(--accent); color: var(--bg); }

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--accent);
  color: var(--bg);
  padding: 0.6rem 1rem;
  font-family: var(--font-mono);
  z-index: 100;
}
.skip-link:focus { left: 0.5rem; top: 0.5rem; }

.container {
  max-width: 62rem;
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* ---------- nav ---------- */

.site-nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.site-nav .container {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  min-height: 3.6rem;
  flex-wrap: wrap;
  padding-top: 0.4rem;
  padding-bottom: 0.4rem;
}

.brand {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text);
  white-space: nowrap;
}
.brand:hover { text-decoration: none; }
.brand .prompt-sign { color: var(--accent); }
.brand .cursor {
  display: inline-block;
  width: 0.55em;
  height: 1.1em;
  margin-left: 2px;
  background: var(--accent);
  vertical-align: text-bottom;
  animation: blink 1.2s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

.nav-links {
  display: flex;
  gap: 0.35rem;
  margin-left: auto;
  align-items: center;
  flex-wrap: wrap;
}

.nav-links a {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text-muted);
  padding: 0.35rem 0.65rem;
  border-radius: 6px;
  border: 1px solid transparent;
}
.nav-links a::before { content: "./"; color: var(--text-faint); }
.nav-links a:hover {
  color: var(--text);
  background: var(--bg-raised);
  border-color: var(--border);
  text-decoration: none;
}
.nav-links a[aria-current="page"] {
  color: var(--accent);
  background: var(--accent-dim);
  border-color: transparent;
}
.nav-links a[aria-current="page"]::before { color: var(--accent); }

.theme-toggle {
  background: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  padding: 0.35rem 0.6rem;
  cursor: pointer;
  line-height: 1.4;
}
.theme-toggle:hover { color: var(--text); border-color: var(--border-strong); }

/* ---------- sections & headings ---------- */

main { display: block; }

.section { padding: 3.5rem 0 1rem; }

.kicker {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--accent);
  letter-spacing: 0.04em;
  display: block;
  margin-bottom: 0.4rem;
}
.kicker::before { content: "// "; color: var(--text-faint); }

h1, h2, h3 { line-height: 1.25; margin: 0 0 0.75rem; }

h1 {
  font-size: clamp(2.2rem, 5.5vw, 3.3rem);
  letter-spacing: -0.02em;
  font-weight: 800;
}

h2 { font-size: 1.65rem; letter-spacing: -0.01em; font-weight: 750; }
h3 { font-size: 1.15rem; font-weight: 650; }

.lede { font-size: 1.15rem; color: var(--text-muted); max-width: 46rem; }

.year-heading {
  font-family: var(--font-mono);
  font-size: 1.05rem;
  color: var(--text);
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.5rem;
  margin: 2.75rem 0 1.25rem;
}
.year-heading::before { content: "## "; color: var(--violet); }

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

.hero { padding: 4rem 0 2rem; position: relative; overflow: hidden; }
.hero::before {
  content: "";
  position: absolute;
  top: -20%; right: -10%;
  width: 55%; height: 90%;
  background: radial-gradient(ellipse at center, var(--accent-dim), transparent 65%);
  pointer-events: none;
}
.hero > .container { position: relative; }

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

.hero-grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 2.5rem;
  align-items: center;
}
@media (max-width: 820px) {
  .hero h1 { color: var(--accent); }

.hero-grid { grid-template-columns: 1fr; }
}

.hero .tagline {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: var(--text-muted);
  margin: 0 0 1.5rem;
}
.hero .tagline strong { color: var(--amber); font-weight: 500; }

.terminal {
  background: var(--bg-inset);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: var(--shadow);
  overflow: hidden;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  line-height: 1.7;
}

.terminal-bar {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.6rem 0.9rem;
  background: var(--bg-raised);
  border-bottom: 1px solid var(--border);
}
.terminal-bar .dot { width: 11px; height: 11px; border-radius: 50%; }
.dot-r { background: #ff5f57; } .dot-y { background: #febc2e; } .dot-g { background: #28c840; }
.terminal-bar .term-title {
  margin-left: auto; margin-right: auto;
  color: var(--text-faint);
  font-size: 0.75rem;
}

.terminal-body { padding: 1rem 1.1rem 1.2rem; margin: 0; overflow-x: auto; }
@media (max-width: 480px) { .terminal { font-size: 0.75rem; } }
.terminal-body .prompt { color: var(--accent); user-select: none; }
.terminal-body .cmd { color: var(--text); font-weight: 600; }
.terminal-body .out { color: var(--text-muted); }
.terminal-body .str { color: var(--terminal-green); }
.terminal-body .flag { color: var(--violet); }
.terminal-body .cursor {
  display: inline-block;
  width: 0.6em; height: 1.15em;
  background: var(--accent);
  vertical-align: text-bottom;
  animation: blink 1.2s steps(1) infinite;
}

/* ---------- buttons / social links ---------- */

.link-row { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-top: 1.5rem; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text);
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.5rem 0.9rem;
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.btn:hover {
  text-decoration: none;
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-1px);
}
.btn svg { width: 16px; height: 16px; fill: currentColor; flex: none; }
.btn-primary { background: var(--accent-dim); border-color: var(--accent); color: var(--accent); }

/* ---------- stats strip ---------- */

.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-raised);
  overflow: hidden;
  margin: 2.5rem 0 0;
}
@media (max-width: 680px) { .stats { grid-template-columns: repeat(2, 1fr); } }

.stat {
  padding: 1.1rem 1.25rem;
  border-right: 1px solid var(--border);
  transition: background 0.15s ease;
}
.stat:hover { background: var(--accent-dim); }
.stat:last-child { border-right: none; }
@media (max-width: 680px) {
  .stat:nth-child(2n) { border-right: none; }
  .stat:nth-child(-n+2) { border-bottom: 1px solid var(--border); }
}

.stat .num {
  font-family: var(--font-mono);
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--accent);
  display: block;
  line-height: 1.2;
}
.stat .label {
  font-size: 0.82rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

/* ---------- cards ---------- */

.card {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.35rem 1.5rem;
  margin-bottom: 1rem;
  transition: border-color 0.15s ease;
  position: relative;
}
.card:hover { border-color: var(--border-strong); }
.card::before {
  content: "";
  position: absolute;
  left: -1px; top: 14px; bottom: 14px;
  width: 3px;
  border-radius: 3px;
  background: var(--accent);
  opacity: 0;
  transition: opacity 0.15s ease;
}
.card:hover::before { opacity: 1; }

.card h3 { margin-bottom: 0.35rem; }
.card h3 a { color: var(--text); }
.card h3 a:hover { color: var(--accent); }
.card p { margin: 0.4rem 0 0.75rem; color: var(--text-muted); font-size: 0.97rem; }

.card-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
@media (max-width: 760px) { .card-grid { grid-template-columns: 1fr; } }
.card-grid .card { margin-bottom: 0; }

.card-featured { border-color: color-mix(in srgb, var(--accent) 40%, var(--border)); }
.card-featured::before { opacity: 1; }

/* ---------- chips / tags ---------- */

.chips { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.6rem; }

.chip {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-muted);
  background: var(--bg-inset);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.12rem 0.6rem;
  white-space: nowrap;
}

.badge {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 600;
  border-radius: 5px;
  padding: 0.14rem 0.5rem;
  vertical-align: middle;
  white-space: nowrap;
}
.badge-upcoming { color: var(--amber); background: color-mix(in srgb, var(--amber) 12%, transparent); border: 1px solid color-mix(in srgb, var(--amber) 35%, transparent); }
.badge-role { color: var(--violet); background: color-mix(in srgb, var(--violet) 12%, transparent); border: 1px solid color-mix(in srgb, var(--violet) 35%, transparent); }
.badge-muted { color: var(--text-muted); background: var(--bg-inset); border: 1px solid var(--border-strong); }
.badge-cite { color: var(--accent); background: var(--accent-dim); border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent); }

/* ---------- talks ---------- */

.talk {
  display: grid;
  grid-template-columns: 7.5rem 1fr;
  gap: 1.25rem;
  padding: 1.1rem 0.75rem;
  margin: 0 -0.75rem;
  border-bottom: 1px solid var(--border);
  border-radius: 8px;
  transition: background 0.15s ease;
}
.talk:hover { background: var(--bg-raised); }
@media (max-width: 600px) { .talk { grid-template-columns: 1fr; gap: 0.25rem; } }
.talk:last-child { border-bottom: none; }

.talk-when {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--text-faint);
  padding-top: 0.2rem;
}

.talk-title { font-weight: 650; font-size: 1.02rem; margin: 0; }
.talk-meta {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--text-muted);
  margin: 0.3rem 0 0;
}
.talk-meta .venue { color: var(--amber); }

.video-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  background: var(--bg-inset);
  box-shadow: var(--shadow);
}
.video-frame iframe {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  border: 0;
}

/* ---------- publications ---------- */

.pub {
  display: grid;
  grid-template-columns: 2.6rem 1fr;
  gap: 0.9rem;
  padding: 1.2rem 0.75rem;
  margin: 0 -0.75rem;
  border-bottom: 1px solid var(--border);
  border-radius: 8px;
  transition: background 0.15s ease;
}
.pub:hover { background: var(--bg-raised); }
.pub:last-child { border-bottom: none; }

.pub-index {
  font-family: var(--font-mono);
  color: var(--text-faint);
  font-size: 0.9rem;
  padding-top: 0.15rem;
}

.pub h3 { font-size: 1.05rem; margin-bottom: 0.3rem; }
.pub h3 a { color: var(--text); }
.pub h3 a:hover { color: var(--accent); }

.pub .authors { font-size: 0.9rem; color: var(--text-muted); margin: 0 0 0.25rem; }
.pub .authors .me { color: var(--text); font-weight: 650; }
.pub .venue-line {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--text-muted);
  margin: 0 0 0.5rem;
}
.pub .venue-line .venue { color: var(--amber); font-style: normal; }
.pub .pub-links { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }
.pub .pub-links a {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 0.1rem 0.55rem;
  color: var(--text-muted);
}
.pub .pub-links a:hover { color: var(--accent); border-color: var(--accent); text-decoration: none; }

/* ---------- experience timeline ---------- */

.timeline { position: relative; padding-left: 1.6rem; margin-top: 1.5rem; }
.timeline::before {
  content: "";
  position: absolute;
  left: 0.35rem; top: 6px; bottom: 6px;
  width: 2px;
  background: var(--border);
}

.tl-item { position: relative; padding-bottom: 2rem; }
.tl-item:last-child { padding-bottom: 0.5rem; }
.tl-item::before {
  content: "";
  position: absolute;
  left: -1.6rem; top: 7px;
  width: 11px; height: 11px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--accent);
  transform: translateX(0.05rem);
}

.tl-when {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-faint);
  display: block;
  margin-bottom: 0.15rem;
}
.tl-item h3 { margin-bottom: 0.1rem; }
.tl-org {
  font-family: var(--font-mono);
  font-size: 0.88rem;
  color: var(--accent);
  margin: 0 0 0.4rem;
}
.tl-item p { color: var(--text-muted); font-size: 0.95rem; margin: 0.3rem 0; max-width: 44rem; }
.tl-item ul { color: var(--text-muted); font-size: 0.95rem; margin: 0.4rem 0 0; padding-left: 1.2rem; max-width: 44rem; }
.tl-item li { margin-bottom: 0.25rem; }

/* ---------- prose / misc ---------- */

.prose { max-width: 46rem; color: var(--text-muted); }
.prose strong { color: var(--text); }
.prose a { text-decoration: underline; text-underline-offset: 3px; text-decoration-color: color-mix(in srgb, var(--accent) 45%, transparent); }

.callout {
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  background: var(--bg-raised);
  border-radius: 8px;
  padding: 0.9rem 1.2rem;
  font-size: 0.95rem;
  color: var(--text-muted);
  margin: 1.5rem 0;
  max-width: 46rem;
}

.inline-code {
  font-family: var(--font-mono);
  font-size: 0.85em;
  background: var(--bg-inset);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 0.08em 0.4em;
  color: var(--amber);
}

/* ---------- gallery ---------- */

.gallery-controls {
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
  margin: -2.6rem 0 0.9rem;
}
.g-btn {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 1rem;
  padding: 0.3rem 0.8rem;
  cursor: pointer;
}
.g-btn:hover { color: var(--accent); border-color: var(--accent); }

.gallery-strip {
  display: flex;
  gap: 2.25rem;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding-bottom: 0.75rem;
  scrollbar-width: none;
  cursor: grab;
}
.gallery-strip::-webkit-scrollbar { display: none; }
.gallery-strip.dragging {
  scroll-snap-type: none;
  cursor: grabbing;
  user-select: none;
  scroll-behavior: auto;
}

.event { margin: 0; flex: 0 0 auto; scroll-snap-align: start; max-width: none; }
.event-photos { display: flex; gap: 0.6rem; }
.photo-btn {
  display: block;
  padding: 0;
  border: none;
  background: none;
  border-radius: 10px;
  scroll-snap-align: start;
  cursor: zoom-in;
  flex: none;
}
.event-photos img {
  display: block;
  height: 380px;
  width: auto;
  border-radius: 10px;
  border: 1px solid var(--border);
  transition: border-color 0.2s ease;
  -webkit-user-drag: none;
  pointer-events: none;
}
.photo-btn:hover img, .photo-btn:focus-visible img { border-color: var(--accent); }
@media (max-width: 600px) { .event-photos img { height: 280px; } }

.event figcaption {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-faint);
  padding: 0.45rem 0.2rem 0;
}

.gallery-dots {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  margin-top: 1rem;
}
.g-dot {
  width: 9px; height: 9px;
  border-radius: 50%;
  border: 1px solid var(--border-strong);
  background: transparent;
  padding: 0;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.g-dot:hover { border-color: var(--accent); }
.g-dot.is-active { background: var(--accent); border-color: var(--accent); }

/* ---------- lightbox ---------- */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.25rem;
  background: rgba(4, 6, 12, 0.92);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  padding: 1rem;
}
.lightbox[hidden] { display: none; }
.lightbox figure { margin: 0; text-align: center; max-width: min(1100px, 86vw); }
.lightbox img {
  max-width: 100%;
  max-height: 82vh;
  border-radius: 12px;
  border: 1px solid rgba(152, 162, 184, 0.35);
}
.lightbox figcaption {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: #c6cede;
  padding-top: 0.6rem;
}
.lightbox .lb-prev, .lightbox .lb-next, .lightbox .lb-close {
  background: rgba(16, 22, 36, 0.85);
  border: 1px solid rgba(152, 162, 184, 0.35);
  border-radius: 10px;
  color: #e8ecf4;
  font-family: var(--font-mono);
  font-size: 1.15rem;
  padding: 0.55rem 0.95rem;
  cursor: pointer;
  flex: none;
}
.lightbox .lb-prev:hover, .lightbox .lb-next:hover, .lightbox .lb-close:hover { border-color: #54d148; color: #54d148; }
.lightbox .lb-close { position: fixed; top: 1rem; right: 1rem; }
@media (max-width: 700px) {
  .lightbox { gap: 0.5rem; }
  .lightbox .lb-prev, .lightbox .lb-next { position: fixed; bottom: 1rem; }
  .lightbox .lb-prev { left: 25%; }
  .lightbox .lb-next { right: 25%; }
  .lightbox img { max-height: 72vh; }
}

/* ---------- terminal input & chat ---------- */

.visually-hidden {
  position: absolute; width: 1px; height: 1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}

.term-input {
  background: transparent;
  border: none;
  outline: none;
  color: var(--text);
  font: inherit;
  caret-color: var(--accent);
  width: 16ch;
  padding: 0;
}
.term-input::placeholder { color: var(--text-faint); }
.terminal-body .echo-line { display: block; }
.terminal-body .echo-err { color: var(--rose); }

.chat { border-top: 1px solid var(--border); }

.chat-log {
  max-height: 340px;
  overflow-y: auto;
  padding: 0.9rem 1.1rem 0.4rem;
  font-family: var(--font-mono);
  font-size: 0.84rem;
  line-height: 1.65;
}
.chat-msg { margin: 0 0 0.85rem; }
.chat-msg .who { color: var(--accent); user-select: none; }
.chat-msg.user .who { color: var(--violet); }
.chat-msg .msg-text { color: var(--text); white-space: pre-wrap; word-break: break-word; }
.chat-msg.assistant .msg-text { color: var(--text-muted); }
.chat-msg .msg-text strong { color: var(--text); }
.chat-msg .stream-cursor {
  display: inline-block; width: 0.55em; height: 1.05em;
  background: var(--accent); vertical-align: text-bottom;
  animation: blink 1.1s steps(1) infinite;
}

.chat-welcome { color: var(--text-muted); }
.chat-suggest { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0.6rem 0 0.9rem; }
.chat-suggest button {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  padding: 0.25rem 0.7rem;
  cursor: pointer;
  text-align: left;
}
.chat-suggest button:hover { color: var(--accent); border-color: var(--accent); }

.msg-footer {
  margin-top: 0.5rem;
  font-size: 0.74rem;
  color: var(--text-faint);
}
.msg-footer .conf { font-weight: 600; }
.msg-footer .conf-High { color: var(--terminal-green); }
.msg-footer .conf-Medium { color: var(--amber); }
.msg-footer .conf-Low { color: var(--rose); }
.msg-footer .foot-row { margin-top: 0.25rem; }
.msg-footer a { color: var(--text-muted); text-decoration: underline; text-underline-offset: 2px; }
.msg-footer a:hover { color: var(--accent); }

.chat-handoff {
  border: 1px dashed var(--border-strong);
  border-radius: 8px;
  padding: 0.7rem 0.9rem;
  margin-top: 0.6rem;
  color: var(--text-muted);
  font-size: 0.78rem;
}
.chat-handoff a {
  display: inline-block;
  margin-top: 0.4rem;
  border: 1px solid var(--accent);
  border-radius: 6px;
  color: var(--accent);
  padding: 0.25rem 0.7rem;
  text-decoration: none;
}
.chat-handoff a:hover { background: var(--accent-dim); }

.chat-form {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 1.1rem;
  border-top: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 0.84rem;
}
.chat-form .prompt { color: var(--accent); }
.chat-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text);
  font: inherit;
  caret-color: var(--accent);
  min-width: 0;
}
.chat-input::placeholder { color: var(--text-faint); }
.chat-send {
  background: var(--accent-dim);
  border: 1px solid var(--accent);
  border-radius: 6px;
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 0.74rem;
  padding: 0.25rem 0.7rem;
  cursor: pointer;
}
.chat-send[disabled] { opacity: 0.45; cursor: wait; }

.chat-disclaimer {
  margin: 0;
  padding: 0.55rem 1.1rem 0.8rem;
  font-family: var(--font-mono);
  font-size: 0.66rem;
  line-height: 1.5;
  color: var(--text-faint);
}
.chat-disclaimer a { color: var(--text-muted); }

@media (prefers-reduced-motion: reduce) {
  .chat-msg .stream-cursor { animation: none; }
}

/* ---------- blog ---------- */

.post h1 { max-width: 46rem; }
.post-meta {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--text-faint);
  margin: 0 0 1.75rem;
}
.epigraph {
  border-left: 3px solid var(--accent);
  background: var(--bg-raised);
  border-radius: 0 8px 8px 0;
  margin: 0 0 2.25rem;
  padding: 1rem 1.4rem;
  font-size: 1.08rem;
  font-style: italic;
  color: var(--text-muted);
  max-width: 44rem;
}
.post-body { max-width: 44rem; }
.post-body p { color: var(--text-muted); margin: 0 0 1.1rem; }
.post-body strong { color: var(--text); }
.post-body h2 {
  font-size: 1.35rem;
  margin: 2.5rem 0 0.9rem;
}
.post-body h2::before { content: "## "; color: var(--violet); font-family: var(--font-mono); font-size: 1rem; }
.post-body blockquote {
  border-left: 3px solid var(--border-strong);
  margin: 1.25rem 0;
  padding: 0.25rem 1.2rem;
  color: var(--text-muted);
  font-style: italic;
}
.post-body figure { margin: 1.75rem 0; }
.post-body figure img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: var(--shadow);
}
.post-body figure.portrait { max-width: 26rem; }
.post-body figcaption {
  margin-top: 0.55rem;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-muted);
}
.post-excerpt { color: var(--text-muted); font-size: 0.95rem; margin: 0.4rem 0 0; max-width: 42rem; }
.post-listing .talk-title a { color: var(--text); }
.post-listing .talk-title a:hover { color: var(--accent); }
.post-back { margin-top: 2.5rem; font-family: var(--font-mono); font-size: 0.9rem; }

.notebook-embed { margin-top: 3rem; }
.notebook-embed h2 { font-size: 1.35rem; }
.nb-frame {
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: var(--shadow);
  background: var(--bg-inset);
}
.nb-frame iframe {
  display: block;
  width: 100%;
  height: 78vh;
  min-height: 540px;
  border: 0;
}

/* ---------- footer ---------- */

.site-footer {
  margin-top: 4.5rem;
  border-top: 1px solid var(--border);
  padding: 2rem 0 2.5rem;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--text-faint);
}
.site-footer .echo { color: var(--text-muted); margin-bottom: 0.75rem; }
.site-footer .echo .prompt-sign { color: var(--accent); }
.site-footer .echo .str { color: var(--terminal-green); }
.site-footer a { color: var(--text-muted); }
.site-footer a:hover { color: var(--accent); }
.site-footer .foot-links { display: flex; flex-wrap: wrap; gap: 1rem; margin-top: 0.5rem; }
