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

:root {
  --bg: #fafaf8;
  --text: #1f2328;
  --muted: #59626d;
  --card: #ffffff;
  --border: #e3e3df;
  --link: #5b3fb0;
  --accent: #6f42c1;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111315;
    --text: #e6e6e6;
    --muted: #a3aab3;
    --card: #1a1d20;
    --border: #2c3035;
    --link: #b49cff;
    --accent: #9f7aea;
  }
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Navigation */
.site-nav {
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 50;
  background: var(--bg);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  -webkit-backdrop-filter: saturate(1.4) blur(10px); backdrop-filter: saturate(1.4) blur(10px);
}
.site-nav .inner {
  max-width: max(880px, 85vw);
  margin: 0 auto;
  padding: 1rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.site-nav .brand, .site-nav ul a { white-space: nowrap; }
.site-nav .brand {
  font-weight: 700;
  color: var(--text);
}
.site-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 1.5rem;
}
.site-nav ul a { color: var(--muted); }
.site-nav ul a:hover,
.site-nav ul a[aria-current="page"] { color: var(--text); text-decoration: none; }

/* Main content */
main {
  flex: 1;
  width: 100%;
  max-width: max(880px, 85vw);
  margin: 0 auto;
  padding: 3.5rem 1.5rem;
}

.intro { max-width: 600px; margin-bottom: 3rem; }
.avatar {
  width: 160px;
  height: 160px;
  border-radius: 50%;
  display: block;
  margin: 0 0 1.5rem;
  box-shadow: 0 4px 16px rgba(0,0,0,.12);
}
h1 { font-size: 2.25rem; line-height: 1.2; margin: 0 0 1rem; font-weight: 700; }
p { font-size: 1.125rem; margin: 0 0 1rem; color: var(--muted); }

/* Boxes */
.boxes {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.25rem;
}
.box {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem;
}
.box h2 {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  margin: 0 0 1rem;
}
.box ul { list-style: none; margin: 0; padding: 0; }
.box li { padding: 0.35rem 0; }
.box li + li { border-top: 1px solid var(--border); }
.box .plain { color: var(--text); }
.box p { font-size: 1rem; margin: 0 0 1rem; }

/* Coming soon pages */
.coming-soon { text-align: center; padding-top: 5rem; }
.coming-soon p { font-size: 1.25rem; }

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  text-align: center;
  padding: 1.5rem;
  font-size: 0.875rem;
  color: var(--muted);
}

@media (max-width: 480px) {
  .site-nav .inner { padding: 0.9rem 1.25rem; }
  .site-nav ul { gap: 1rem; font-size: 0.95rem; }
  main { padding: 2.5rem 1.25rem; }
}

/* External links: open in a new tab and show an "external" icon */
a[target="_blank"]::after {
  content: "";
  display: inline-block;
  width: 0.85em;
  height: 0.85em;
  margin-left: 0.3em;
  vertical-align: -0.05em;
  background-color: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M14 4h6v6'/%3E%3Cpath d='M20 4 10 14'/%3E%3Cpath d='M18 14v5a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1V7a1 1 0 0 1 1-1h5'/%3E%3C/svg%3E") no-repeat center / contain;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M14 4h6v6'/%3E%3Cpath d='M20 4 10 14'/%3E%3Cpath d='M18 14v5a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1V7a1 1 0 0 1 1-1h5'/%3E%3C/svg%3E") no-repeat center / contain;
}
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* Dragons page */
.dragons-intro {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 2.5rem;
  align-items: start;
  margin-top: 1.5rem;
}
.dragon-button {
  --btn: #6f42c1;                /* same purple in light and dark mode, so the white label stays readable */
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #fff;              /* matches the animation's white background */
  border: 2px solid var(--btn);
  border-radius: 14px;
  color: #fff;
  font-weight: 600;
  text-align: center;
  box-shadow: 0 2px 8px rgba(0,0,0,.06);
  transition: transform .15s ease, box-shadow .15s ease;
}
.dragon-button img {
  display: block;
  width: 100%;
  height: auto;
  padding: 0.75rem 0.75rem 0.25rem;
}
.dragon-button span {
  display: block;
  background: var(--btn);
  padding: 0.7rem 1rem;
  font-size: 1.0625rem;
  transition: background-color .15s ease;
}
.dragon-button:hover { text-decoration: none; transform: translateY(-3px); box-shadow: 0 10px 28px rgba(0,0,0,.16); }
.dragon-button:hover span { background: #5a32a3; }
.dragon-button:focus-visible { outline: 3px solid var(--btn); outline-offset: 3px; }
.dragons-story p { font-size: 1.0625rem; }
.dragons-story .dragons-quote { font-size: 1.5rem; font-weight: 700; line-height: 1.3; color: var(--text); margin-bottom: 1.25rem; }
.dragons-photo { margin: 2rem 0 0; }
.dragons-photo img { display: block; width: 100%; height: auto; border-radius: 12px; box-shadow: 0 4px 16px rgba(0,0,0,.12); }
.dragons-photo figcaption { margin-top: 0.6rem; font-size: 0.95rem; color: var(--muted); font-style: italic; }
.dragons-photo figcaption a { font-style: normal; font-weight: 600; }

@media (max-width: 640px) {
  .dragons-intro { grid-template-columns: 1fr; gap: 1.75rem; }
  .dragon-button { max-width: 260px; margin: 0 auto; }
}

/* Research page */
.research-intro { max-width: 680px; }
.pub-controls { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: center; margin: 2rem 0 1rem; }
.pub-search {
  flex: 1 1 280px;
  display: flex; align-items: center; gap: 0.5rem;
  background: var(--card); border: 1px solid var(--border); border-radius: 10px;
  padding: 0 0.85rem;
}
.pub-search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 20%, transparent); }
.pub-search svg { width: 18px; height: 18px; flex: none; fill: none; stroke: var(--muted); stroke-width: 2; stroke-linecap: round; }
.pub-search input { flex: 1; border: 0; outline: 0; background: transparent; color: var(--text); font: inherit; font-size: 1rem; padding: 0.7rem 0; min-width: 0; }
.pub-view { display: inline-flex; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; background: var(--card); }
.pub-view button { border: 0; background: transparent; color: var(--muted); font: inherit; font-size: 0.95rem; padding: 0.65rem 1rem; cursor: pointer; }
.pub-view button + button { border-left: 1px solid var(--border); }
.pub-view button[aria-pressed="true"] { background: #6f42c1; color: #fff; }
.pub-chips { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 0.75rem; }
.pub-chips button {
  border: 1px solid var(--border); background: var(--card); color: var(--text);
  border-radius: 999px; padding: 0.35rem 0.8rem; font: inherit; font-size: 0.875rem; cursor: pointer;
}
.pub-chips button span { color: var(--muted); font-size: 0.8em; margin-left: 0.15rem; }
.pub-chips button:hover { border-color: var(--accent); }
.pub-chips button[aria-pressed="true"] { background: #6f42c1; border-color: #6f42c1; color: #fff; }
.pub-chips button[aria-pressed="true"] span { color: rgba(255,255,255,.8); }
.pub-count { font-size: 0.9rem; margin-bottom: 1.5rem; }

.pub-group { margin-bottom: 2.25rem; }
.pub-group h2 {
  font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--accent);
  margin: 0 0 0.5rem; padding-bottom: 0.5rem; border-bottom: 1px solid var(--border);
}
.pub-group h2 span { color: var(--muted); font-weight: 400; margin-left: 0.25rem; }
.pub-group ul { list-style: none; margin: 0; padding: 0; }
.pub { display: flex; gap: 1rem; align-items: flex-start; padding: 0.9rem 0; border-bottom: 1px solid var(--border); }
.pub-main { flex: 1; min-width: 0; }
.pub-title {
  display: block; text-align: left; border: 0; background: none; padding: 0; margin: 0 0 0.25rem;
  font: inherit; font-size: 1.05rem; font-weight: 600; line-height: 1.4; color: var(--text); cursor: pointer;
}
.pub-title:hover { color: var(--link); text-decoration: underline; }
.pub-title:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 3px; }
.pub-authors, .pub-source { font-size: 0.9rem; margin: 0; line-height: 1.5; }
.pub-authors strong { color: var(--text); }
.pub-pdf {
  flex: none; width: 42px; height: 48px; display: flex; align-items: center; justify-content: center;
  border-radius: 8px; color: #c62828; transition: background-color .15s ease;
}
.pub-pdf svg { width: 34px; height: 34px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linejoin: round; }
.pub-pdf svg text { fill: currentColor; stroke: none; font: 700 5.6px -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; }
.pub-pdf:hover { background: color-mix(in srgb, #c62828 10%, transparent); text-decoration: none; }
@media (prefers-color-scheme: dark) { .pub-pdf { color: #ff6b6b; } }
.pub-empty { padding: 2rem 0; text-align: center; }

/* Paper details box */
.pub-modal {
  width: min(720px, calc(100% - 2rem)); max-height: calc(100vh - 3rem);
  border: 0; border-radius: 16px; padding: 2rem 2rem 1.75rem;
  background: var(--card); color: var(--text);
  box-shadow: 0 24px 80px rgba(0,0,0,.35);
}
.pub-modal::backdrop { background: rgba(10,10,14,.55); -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px); }
.pm-close {
  position: absolute; top: 0.9rem; right: 0.9rem; width: 38px; height: 38px; border-radius: 50%;
  border: 0; background: transparent; color: var(--muted); cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.pm-close:hover { background: var(--bg); color: var(--text); }
.pm-close svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; }
.pm-cat { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--accent); font-weight: 600; margin: 0 2.5rem 0.5rem 0; }
.pub-modal h2 { font-size: 1.35rem; line-height: 1.35; margin: 0 2rem 0.75rem 0; }
.pm-authors, .pm-source { font-size: 0.95rem; margin: 0 0 0.4rem; }
.pm-authors strong { color: var(--text); }
.pm-doi-text { font-size: 0.85rem; }
.pub-modal h3 { font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.08em; margin: 1.5rem 0 0.5rem; color: var(--muted); }
.pm-abstract { font-size: 1rem; line-height: 1.65; color: var(--text); margin: 0; }
.pm-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1.75rem; }
.pm-btn {
  display: inline-flex; align-items: center; gap: 0.5rem;
  background: #6f42c1; color: #fff; border: 1px solid #6f42c1; border-radius: 10px;
  padding: 0.65rem 1.1rem; font-weight: 600;
}
.pm-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.pm-btn span { font-weight: 400; opacity: .85; }
.pm-btn:hover { background: #5a32a3; text-decoration: none; }
.pm-btn-ghost { background: transparent; color: var(--link); border-color: var(--border); }
.pm-btn-ghost:hover { background: var(--bg); }
.pm-btn-ghost::after { margin-left: 0.1em; }

@media (max-width: 640px) {
  .pub-modal { padding: 1.5rem 1.25rem 1.25rem; }
  .pub-view { width: 100%; }
  .pub-view button { flex: 1; }
}

/* Citation metrics (OpenAlex) */
.metrics {
  display: grid; grid-template-columns: auto 1fr; gap: 1.25rem 2rem; align-items: end;
  margin: 2rem 0 0.5rem; padding: 1.5rem; background: var(--card); border: 1px solid var(--border); border-radius: 14px;
}
.metric-tiles { display: flex; gap: 1.75rem; }
.metric { display: flex; flex-direction: column; }
.metric-num { font-size: 2rem; font-weight: 700; line-height: 1.1; color: var(--text); font-variant-numeric: tabular-nums; }
.metric-label { font-size: 0.8rem; letter-spacing: 0.04em; color: var(--muted); margin-top: 0.25rem; }
.metric-chart-title { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); margin: 0 0 0.5rem; }
.bars { display: flex; align-items: flex-end; gap: 4px; height: 90px; margin-bottom: 1.2rem; }
.bar { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; position: relative; }
.bar-fill { width: 100%; background: #6f42c1; border-radius: 3px 3px 0 0; min-height: 2px; }
.bar-partial .bar-fill { background: repeating-linear-gradient(135deg, #6f42c1 0 3px, #a98ae0 3px 6px); }
.bar:hover .bar-fill { background: #5a32a3; }
.bar-year { position: absolute; bottom: -1.3rem; font-size: 0.7rem; color: var(--muted); }
.metrics-note { grid-column: 1 / -1; font-size: 0.85rem; margin: 0; }
.pub-cited { display: inline-block; margin-left: 0.4rem; padding: 0 0.45rem; border-radius: 999px; font-size: 0.78rem; font-style: normal;
  background: color-mix(in srgb, #6f42c1 12%, transparent); color: var(--link); white-space: nowrap; }
.pub-view button { white-space: nowrap; }
@media (max-width: 640px) {
  .metrics { grid-template-columns: 1fr; padding: 1.25rem; }
  .metric-tiles { justify-content: space-between; }
  .pub-view button { padding: 0.65rem 0.5rem; font-size: 0.9rem; }
}

.pub-type { display: inline-block; margin-right: 0.4rem; padding: 0 0.45rem; border-radius: 4px; font-size: 0.72rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.04em; border: 1px solid var(--border); color: var(--muted); vertical-align: 1px; }

/* Chat with Greg Fridman (/chat/) */
.chat-banner { position: relative; display: block; margin-bottom: 2rem; border-radius: 14px; overflow: hidden; box-shadow: 0 6px 24px rgba(0,0,0,.18); }
.chat-banner img { display: block; width: 100%; height: auto; }
.chat-banner:hover { text-decoration: none; }
.chat-banner::after { display: none !important; }   /* no external-link icon on the banner */
.vid-group { margin-bottom: 2rem; }
.vid-group h2 {
  font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--accent);
  margin: 0 0 1rem; padding-bottom: 0.5rem; border-bottom: 1px solid var(--border);
}
.vid-group h2 span { color: var(--muted); font-weight: 400; margin-left: 0.25rem; }
.vid-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 1.5rem 1.25rem; }
.vid { display: flex; flex-direction: column; gap: 0.45rem; width: 100%; padding: 0; border: 0; background: none; text-align: left; font: inherit; color: var(--text); cursor: pointer; }
.vid-thumb { position: relative; display: block; aspect-ratio: 16 / 9; border-radius: 10px; overflow: hidden; background: var(--border); }
.vid-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .25s ease; }
.vid-dur { position: absolute; right: 6px; bottom: 6px; background: rgba(0,0,0,.8); color: #fff; font-size: 0.75rem; font-weight: 600; padding: 1px 5px; border-radius: 4px; }
.vid-play { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; opacity: 0; transition: opacity .2s ease; background: rgba(0,0,0,.25); }
.vid-play svg { width: 54px; height: 54px; fill: #fff; filter: drop-shadow(0 2px 6px rgba(0,0,0,.5)); }
.vid:hover .vid-thumb img { transform: scale(1.04); }
.vid:hover .vid-play, .vid:focus-visible .vid-play { opacity: 1; }
.vid:focus-visible { outline: 3px solid var(--accent); outline-offset: 4px; border-radius: 10px; }
.vid-title { font-weight: 600; line-height: 1.35; font-size: 0.98rem; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.vid:hover .vid-title { color: var(--link); }
.vid-meta { font-size: 0.82rem; color: var(--muted); }
.vid-modal { width: min(880px, calc(100% - 2rem)); }
.vm-player { aspect-ratio: 16 / 9; margin: 1.75rem 0 1rem; border-radius: 10px; overflow: hidden; background: #000; }
.vm-player iframe { width: 100%; height: 100%; border: 0; display: block; }
@media (max-width: 640px) {
  .vid-grid { grid-template-columns: 1fr; }
  .chat-banner { margin-left: -0.5rem; margin-right: -0.5rem; border-radius: 10px; }
}

/* Contact links (nav + footer) */
.site-nav ul { align-items: center; }
.nav-contact { display: flex; gap: 0.25rem; margin-left: 0.25rem; padding-left: 1rem; border-left: 1px solid var(--border); }
.nav-icon { display: flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 8px; color: var(--muted); }
.nav-icon:hover { color: var(--text); background: color-mix(in srgb, var(--muted) 12%, transparent); text-decoration: none; }
.nav-icon svg, .footer-link svg { width: 18px; height: 18px; fill: currentColor; }
.nav-icon svg.stroke, .footer-link svg.stroke, .chat-btn svg.stroke { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.nav-icon .contact-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }
.site-nav .nav-icon::after, .footer-link::after { display: none !important; }   /* no external-link arrow on icons */
.site-footer { display: flex; flex-direction: column; align-items: center; gap: 0.5rem; }
.footer-contact { display: flex; gap: 1.25rem; }
.footer-link { display: inline-flex; align-items: center; gap: 0.4rem; color: var(--muted); }
.footer-link:hover { color: var(--text); text-decoration: none; }
@media (max-width: 480px) {
  .site-nav .inner { gap: 0.5rem; }
  .site-nav .brand { font-size: 0.95rem; }
  .site-nav ul { gap: 0.7rem; font-size: 0.9rem; }
  .nav-contact { padding-left: 0.5rem; margin-left: 0; gap: 0; }
  .nav-icon { width: 26px; height: 28px; }
}
@media (max-width: 400px) { .site-nav .brand { display: none; } .site-nav .inner { justify-content: center; } }

/* Chat page: teaching note and channel buttons */
.chat-teach {
  max-width: 680px; font-size: 1.15rem; line-height: 1.55; color: var(--text); font-weight: 500;
  border-left: 3px solid #6f42c1; padding-left: 1rem; margin: 1.25rem 0 1.5rem;
}
.chat-links { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-bottom: 0.5rem; }
.chat-btn { display: inline-flex; align-items: center; gap: 0.55rem; padding: 0.65rem 1.1rem; border-radius: 10px; font-weight: 600; color: #fff; }
.chat-btn svg { width: 20px; height: 20px; fill: currentColor; }
.chat-btn::after { display: none !important; }
.chat-btn:hover { text-decoration: none; filter: brightness(1.08); }
.chat-btn-yt { background: #e00; }
.chat-btn-pod { background: #6f42c1; }

.chat-btn-coffee { background: #ffdd00; color: #1f1f1f; }
.chat-btn-coffee svg.stroke { stroke-width: 2; }

.nav-coffee { color: #1f1f1f; background: #ffdd00; }
.nav-coffee:hover { color: #1f1f1f; background: #ffe633; }
.nav-contact .nav-coffee { margin-right: 0.25rem; }

/* Research page: coffee call-out */
.research-coffee {
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem 1.25rem; max-width: 760px;
  margin: 0 0 1.75rem; padding: 0.9rem 1.1rem; border-radius: 12px;
  background: rgba(255, 221, 0, 0.12); border: 1px solid rgba(255, 200, 0, 0.45);
}
.research-coffee p { flex: 1 1 280px; margin: 0; }
.research-coffee .chat-btn { padding: 0.55rem 1rem; white-space: nowrap; }

/* Clickable hotspot over the Subscribe button painted into the chat banner */
.chat-banner-sub {
  position: absolute; left: 67.5%; top: 38.6%; width: 19.1%; height: 21.6%;
  border-radius: 1.1vw; transition: box-shadow .15s, background-color .15s, transform .15s;
}
.chat-banner-sub::after { display: none !important; }
.chat-banner-sub:hover, .chat-banner-sub:focus-visible {
  background: rgba(255,255,255,.12); box-shadow: 0 0 0 3px rgba(255,255,255,.85), 0 0 24px rgba(255,40,40,.75);
  transform: scale(1.03); outline: none;
}
.chat-banner-sub:active { transform: scale(0.98); }

/* keep in-page jump targets clear of the sticky navigation bar */
html { scroll-padding-top: 4.5rem; }

/* keep the dragons story readable on very wide screens */
.dragons-story { max-width: 820px; }

/* Box around the current page in the navigation bar */
.site-nav ul { gap: 0.6rem; }
.site-nav ul > li > a:not(.nav-icon) { display: inline-block; padding: 0.3rem 0.65rem; border: 1px solid transparent; border-radius: 8px; }
.site-nav ul > li > a[aria-current="page"]:not(.nav-icon) { border-color: color-mix(in srgb, var(--muted) 40%, transparent); background: var(--card); box-shadow: 0 1px 3px rgba(0,0,0,.06); }
@media (max-width: 480px) {
  .site-nav ul { gap: 0.1rem; }
  .site-nav ul > li > a:not(.nav-icon) { padding: 0.25rem 0.4rem; }
}
@media (max-width: 370px) {
  .site-nav ul > li > a:not(.nav-icon) { padding: 0.25rem 0.3rem; }
}

/* Footer: icons and copyright on one line */
.footer-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 0.5rem 1rem; }
.footer-icons { display: inline-flex; align-items: center; gap: 0.25rem; }
.site-footer .nav-icon::after { display: none !important; }
.site-footer .nav-coffee { margin-right: 0.25rem; }

/* Home intro: photo with the text beside it, centered as a block */
.intro { display: flex; align-items: center; gap: 2rem; max-width: 720px; margin: 0 auto 3rem; }
.intro .avatar { flex: 0 0 auto; margin: 0; }
.intro-text p { margin-bottom: 0; }
@media (max-width: 560px) {
  .intro { flex-direction: column; text-align: center; gap: 1.25rem; }
}

/* Research: intro and coffee box side by side on wide screens */
@media (min-width: 900px) {
  .research-top { display: flex; align-items: flex-start; gap: 2.5rem; margin-bottom: 1.75rem; }
  .research-top .research-intro { flex: 1 1 0; max-width: none; margin: 0; }
  .research-top .research-coffee { flex: 0 1 380px; margin: 0; flex-direction: column; align-items: flex-start; }
  .research-top .research-coffee p { flex: none; }
}

/* Chat: intro and teaching note side by side on wide screens */
@media (min-width: 900px) {
  .chat-top { display: flex; align-items: flex-start; gap: 3rem; margin-bottom: 1.5rem; }
  .chat-top .research-intro { flex: 1 1 0; max-width: none; margin: 0; }
  .chat-top .chat-teach { flex: 1 1 0; max-width: none; margin: 0; }
}
