/* ==========================================
   Nabajit Borah — field notes
   serif voice: Fraunces (display) + Newsreader (body)
   mono voice:  IBM Plex Mono (labels, dates, data)
   light: warm paper, ink, deep-water teal, vermilion
   dark:  abyss, bone, bioluminescent cyan
   ========================================== */

/* Tokens */
:root {
  --paper: #f7f3ec;
  --paper-header: rgba(247, 243, 236, 0.82);
  --ink: #15120e;
  --ink-soft: #575145;
  --line: #c4bba9;
  --accent: #0f5868;
  --accent-ink: #0a4552;
  --seal: #9a2f22;
  --surface: rgba(31, 27, 22, 0.04);

  /* Protein chain colors (secondary structure), read by protein.js */
  --ss-helix: #b13a2c;
  --ss-strand: #16687a;
  --ss-loop: #9f968a;
  --ss-backbone: rgba(110, 103, 89, 0.32);

  --code-bg: rgba(31, 27, 22, 0.04);
  --code-comment: #9f968a;
  --code-keyword: #b13a2c;
  --code-string: #4f7a3a;
  --code-number: #9a6a1e;
  --code-func: #0e4e5c;

  --font-display: 'Fraunces', Georgia, serif;
  --font-body: 'Newsreader', Georgia, serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, Menlo, monospace;

  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --max-width: 880px;
  --radius: 6px;
}

:root[data-theme="dark"] {
  --paper: #0a0f16;
  --paper-header: rgba(10, 15, 22, 0.8);
  --ink: #e8e3d8;
  --ink-soft: #8b94a3;
  --line: #232c38;
  --accent: #5fd4e0;
  --accent-ink: #8ce4ed;
  --seal: #e05a48;
  --surface: rgba(232, 227, 216, 0.05);

  --ss-helix: #e05a48;
  --ss-strand: #5fd4e0;
  --ss-loop: #6b7688;
  --ss-backbone: rgba(139, 148, 163, 0.3);

  --code-bg: rgba(232, 227, 216, 0.04);
  --code-comment: #6b7688;
  --code-keyword: #e5795f;
  --code-string: #a9cc86;
  --code-number: #d8ad63;
  --code-func: #8ce4ed;
}

/* Reset & base */
*, *::before, *::after {
  box-sizing: border-box;
}

/* Every themed surface eases on the same clock, so light/dark flips as one piece. */
*, *::before, *::after {
  transition-property: background-color, border-color, color, fill, stroke;
  transition-duration: 0.45s;
  transition-timing-function: ease;
}

html {
  scroll-behavior: smooth;
  color-scheme: light;
  background: var(--paper);
}

:root[data-theme="dark"] {
  color-scheme: dark;
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1.1rem;
  font-weight: 400;
  line-height: 1.65;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
}

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

/* Paper grain */
.grain {
  position: fixed;
  inset: 0;
  z-index: 50;
  pointer-events: none;
  opacity: 0.3;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.10'/%3E%3C/svg%3E");
}

:root[data-theme="dark"] .grain {
  mix-blend-mode: screen;
  opacity: 0.18;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-variation-settings: 'opsz' 60;
  font-weight: 480;
  color: var(--ink);
  letter-spacing: -0.01em;
  line-height: 1.2;
  margin: 1.75em 0 0.5em;
}

h1 { font-size: 2.6rem; font-variation-settings: 'opsz' 144; }
h2 { font-size: 1.9rem; }
h3 { font-size: 1.3rem; font-variation-settings: 'opsz' 40; font-weight: 500; }
h4 { font-size: 1.05rem; }

p {
  margin: 0 0 1em;
}

/* Links carry no rule: colour (teal -> vermilion on hover) is the affordance. */
a {
  color: var(--accent-ink);
  text-decoration: none;
  transition: color 0.25s ease;
}

a:hover {
  color: var(--seal);
}

strong {
  font-weight: 560;
}

em {
  font-style: italic;
}

hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 2.5rem 0;
}

code {
  font-family: var(--font-mono);
  font-size: 0.82em;
  background: var(--surface);
  border: 1px solid var(--line);
  padding: 0.05em 0.35em;
  border-radius: 4px;
}

/* Layout */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

header {
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 24px;
  min-height: 60px;
  background: var(--paper-header);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}

.site-title {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--ink);
  white-space: nowrap;
}

.site-title:hover {
  color: var(--ink);
}

.cursor-blink {
  color: var(--seal);
  animation: blink 1.2s steps(2) infinite;
}

@keyframes blink {
  50% { opacity: 0; }
}

nav {
  order: 2;
  margin-left: auto;
}

.header-actions {
  order: 3;
  display: flex;
  gap: 0.25rem;
}

nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 22px;
}

nav a {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  color: var(--ink-soft);
}

nav a::before {
  content: '/';
  color: var(--line);
  margin-right: 5px;
}

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

nav a.active {
  color: var(--seal);
}

nav a.active::before {
  color: var(--seal);
}

.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: none;
  background: none;
  color: var(--ink-soft);
  cursor: pointer;
  transition: color 0.45s ease, transform 0.4s var(--ease-out);
}

.icon-button svg {
  width: 18px;
  height: 18px;
  display: block;
}

.theme-toggle:hover {
  color: var(--accent-ink);
  transform: rotate(18deg);
}

.icon-button:focus-visible,
a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.theme-icon-dark { display: none !important; }
:root[data-theme="dark"] .theme-icon-light { display: none !important; }
:root[data-theme="dark"] .theme-icon-dark { display: block !important; }

.nav-toggle {
  display: none;
}

.nav-toggle-bar,
.nav-toggle-bar::before,
.nav-toggle-bar::after {
  display: block;
  width: 16px;
  height: 1.5px;
  border-radius: 2px;
  background: currentColor;
  position: relative;
  transition: transform 0.2s ease, background-color 0.2s ease;
}

.nav-toggle-bar::before,
.nav-toggle-bar::after {
  content: "";
  position: absolute;
  left: 0;
}

.nav-toggle-bar::before { top: -5px; }
.nav-toggle-bar::after { top: 5px; }

.nav-open .nav-toggle-bar { background: transparent; }
.nav-open .nav-toggle-bar::before { transform: translateY(5px) rotate(45deg); }
.nav-open .nav-toggle-bar::after { transform: translateY(-5px) rotate(-45deg); }

/* Main */
main {
  position: relative;
  z-index: 10;
  padding: 3rem 0 4rem;
  min-height: calc(100vh - 140px);
}

/* Numbered section heads: "01  About  ————" */
.page {
  counter-reset: sec;
}

.page > h2 {
  display: flex;
  align-items: baseline;
  gap: 16px;
  margin: 90px 0 40px;
  counter-increment: sec;
}

.page > h2::before {
  content: counter(sec, decimal-leading-zero);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 400;
  letter-spacing: 0.04em;
  color: var(--seal);
}

.page > h2::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

.page > h2:first-child {
  margin-top: 1rem;
}

.page > h1 {
  margin-top: 0.5rem;
}

/* Protein chain canvas */
#protein-canvas {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  transition: opacity 0.8s var(--ease-out);
}

#protein-canvas {
  opacity: 0;
}

#protein-canvas.is-ready {
  opacity: 1;
  transition: opacity 1.6s var(--ease-out);
}

#protein-canvas[data-sparse].is-ready,
#protein-canvas.is-ready.is-dim {
  opacity: 0.35;
}

/* Hero */
.profile-section {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 56px;
  align-items: end;
  padding: 8vh 0 10vh;
}

.profile-info {
  min-width: 0;
}

.profile-name {
  font-family: var(--font-display);
  font-variation-settings: 'opsz' 144, 'WONK' 1;
  font-weight: 460;
  font-size: clamp(3rem, 9vw, 5.6rem);
  line-height: 1.02;
  letter-spacing: -0.015em;
  margin: 0 0 32px;
}

.profile-name .line {
  display: block;
}

.profile-name em {
  font-family: var(--font-body);
  font-style: italic;
  font-weight: 300;
  font-size: 0.42em;
  letter-spacing: 0;
  color: var(--ink-soft);
  vertical-align: 0.3em;
}

.profile-title {
  max-width: 34em;
  font-size: 1.22rem;
  margin: 0 0 40px;
}

.contact-links {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 22px;
  padding: 0;
  margin: 0;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.04em;
}

.contact-links a,
.contact-links .copy-email {
  display: block;
  color: var(--ink);
  transition: color 0.25s ease, transform 0.35s var(--ease-out);
}

.contact-links a:hover,
.contact-links .copy-email:hover {
  color: var(--seal);
  transform: translateY(-3px);
}

/* Email: a button that copies the address; the tooltip shows it on hover/focus. */
.contact-links .copy-email {
  position: relative;
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  cursor: pointer;
}

.copy-tip {
  position: absolute;
  bottom: calc(100% + 10px);
  left: 0;
  padding: 4px 8px;
  white-space: nowrap;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.02em;
  color: var(--ink-soft);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 4px;
  opacity: 0;
  transform: translateY(4px);
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.copy-email:hover .copy-tip,
.copy-email:focus-visible .copy-tip,
.copy-email.copied .copy-tip {
  opacity: 1;
  transform: none;
}

.copy-email.copied .copy-tip {
  color: var(--accent);
}

/* Icon files are used as masks, so they take the current text colour. */
.contact-links .ico {
  display: block;
  width: 20px;
  height: 20px;
  background: currentColor;
  -webkit-mask: var(--i) center / contain no-repeat;
  mask: var(--i) center / contain no-repeat;
}

.contact-links .cv-pill {
  border-bottom: 1px solid var(--seal);
}

.profile-photo {
  margin: 0;
  transform: rotate(1.2deg);
}

.profile-photo img {
  width: 100%;
  height: auto;
  aspect-ratio: 1;
  object-fit: cover;
  display: block;
  border-radius: 4px;
  filter: saturate(0.92) contrast(1.02);
  box-shadow: 0 18px 40px -18px rgba(0, 0, 0, 0.35);
}

.profile-photo figcaption {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 18px;
  margin-top: 12px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  color: var(--ink-soft);
}

.profile-photo .loc {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.profile-photo .pin {
  width: 12px;
  height: 12px;
  flex: none;
}


.email-highlight {
  font-family: var(--font-mono);
  font-size: 0.85em;
  color: var(--seal);
}

.lede,
.intro {
  font-size: 1.3rem;
  line-height: 1.5;
  max-width: 34em;
}

/* Sections */
.section {
  margin-bottom: 1rem;
  counter-reset: item;
}

/* List rows: publications, writing, talks */
.pub-item {
  position: relative;
  counter-increment: item;
  padding: 26px 14px 26px 54px;
  margin: 0 -14px;
  border-bottom: 1px solid var(--line);
  border-radius: var(--radius);
  transition: background-color 0.3s ease;
}

.pub-item::before {
  content: counter(item, lower-greek);
  position: absolute;
  left: 14px;
  top: 28px;
  font-family: var(--font-mono);
  font-size: 1.05rem;
  color: var(--seal);
  transition: transform 0.3s var(--ease-out), color 0.45s ease;
}

.pub-item:hover {
  background: var(--surface);
}

.pub-item:hover::before {
  transform: translateX(4px);
}

.pub-title {
  font-family: var(--font-display);
  font-variation-settings: 'opsz' 40;
  font-weight: 500;
  font-size: 1.25rem;
  line-height: 1.35;
  letter-spacing: -0.01em;
  margin-bottom: 6px;
}

.pub-title a {
  color: var(--ink);
}

.pub-item:hover .pub-title a {
  color: var(--accent-ink);
}

.pub-authors {
  font-size: 1rem;
  color: var(--ink-soft);
}

.pub-journal {
  font-style: italic;
  font-size: 1rem;
  color: var(--ink-soft);
}

.pub-award {
  margin-top: 2px;
  font-size: 1rem;
  color: var(--seal);
}

.pub-links {
  margin-top: 8px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.04em;
}

.pub-links a::before { content: '['; color: var(--line); }
.pub-links a::after { content: ']'; color: var(--line); }

.more-link {
  margin-top: 24px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.04em;
}

/* Lists */
.page ul {
  padding-left: 1.25rem;
}

.page li {
  margin-bottom: 0.3rem;
}

.page li::marker {
  color: var(--seal);
}

.page ul.contact-links {
  padding: 0;
}

.research-list {
  list-style: none;
  padding: 0 !important;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.research-list li {
  margin: 0;
  padding: 4px 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

/* Timeline */
.timeline-item {
  position: relative;
  margin: 0 0 1.75rem;
  padding-left: 1.5rem;
  border-left: 1px solid var(--line);
}

.timeline-item::before {
  content: "";
  position: absolute;
  left: -4px;
  top: 0.6rem;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--seal);
}

.timeline-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.25rem 1rem;
}

.timeline-title {
  font-family: var(--font-display);
  font-variation-settings: 'opsz' 40;
  font-weight: 500;
  font-size: 1.2rem;
}

.timeline-date {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  color: var(--accent-ink);
}

.timeline-place {
  color: var(--ink-soft);
  font-size: 1rem;
  margin-bottom: 0.4rem;
}

.timeline-desc {
  margin-top: 0.4rem;
  font-size: 1rem;
}

/* Log (news) */
.news-item {
  display: flex;
  align-items: baseline;
  gap: 14px;
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
  font-size: 1.02rem;
}

.news-item:last-child {
  border-bottom: 0;
}

/* Log lines are links, but read as text until hovered. */
.news-item a {
  color: var(--ink);
  text-decoration: none;
  transition: color 0.2s ease;
}

.news-item a:hover,
.news-item a:focus-visible {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.news-date {
  display: flex;
  align-items: baseline;
  gap: 14px;
  flex: 0 0 120px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  color: var(--accent-ink);
  white-space: nowrap;
}

.news-date::after {
  content: "";
  flex: 1;
  border-bottom: 1px dotted var(--line);
}

/* Awards */
.award-item {
  margin-bottom: 0.75rem;
}

.award-title {
  font-weight: 560;
}

.award-details {
  color: var(--ink-soft);
  font-size: 1rem;
}

/* Big call-to-action link (404, etc.) */
.cv-button {
  display: inline-flex;
  align-items: baseline;
  gap: 14px;
  font-family: var(--font-display);
  font-variation-settings: 'opsz' 60;
  font-style: italic;
  font-weight: 480;
  font-size: 1.8rem;
  color: var(--ink);
  border-bottom: 2px solid var(--seal);
  padding-bottom: 4px;
}

.cv-button:hover {
  color: var(--seal);
}

/* Footer */
footer {
  position: relative;
  z-index: 10;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  color: var(--ink-soft);
}

footer .container {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  padding-top: 26px;
  padding-bottom: 34px;
  border-top: 1px solid var(--line);
}

footer p {
  margin: 0;
}

/* Skip link */
.skip-link {
  position: absolute;
  left: 1rem;
  top: -3rem;
  z-index: 200;
  padding: 0.5rem 0.9rem;
  border-radius: 4px;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--font-mono);
  font-size: 0.8rem;
}

.skip-link:focus {
  top: 0.75rem;
}

/* Currently */
.currently {
  display: flex;
  gap: 1rem;
  align-items: baseline;
  padding: 14px 0;
  margin-bottom: 2rem;
  border-top: 1px dashed var(--line);
  border-bottom: 1px dashed var(--line);
  font-size: 1.02rem;
}

.currently-label {
  flex-shrink: 0;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--seal);
}

/* Projects & tags */
.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr));
  gap: 1rem;
}

.project-card {
  display: flex;
  flex-direction: column;
  padding: 1.25rem 1.35rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition: background-color 0.3s ease, border-color 0.3s ease;
}

.project-card:hover {
  background: var(--surface);
  border-color: color-mix(in srgb, var(--accent) 45%, var(--line));
}

.project-meta {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ink-soft);
  margin: 0 0 0.5rem;
}

.project-title {
  font-size: 1.3rem;
  margin: 0 0 0.5rem;
}

.project-title a {
  color: var(--ink);
}

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

.project-problem {
  color: var(--ink-soft);
  font-size: 1rem;
}

.project-outcome {
  font-size: 1rem;
  margin: auto 0 0;
  padding-top: 0.75rem;
  border-top: 1px dashed var(--line);
}

.page ul.tag-list {
  list-style: none;
  padding: 0;
  margin: 0.4rem 0 0.75rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.9rem;
}

.page .tag-list li {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  color: var(--ink-soft);
}

.page .tag-list li::before {
  content: '·';
  color: var(--seal);
  margin-right: 0.4em;
}

.skill-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr));
  gap: 1.5rem;
}

.skill-grid h3 {
  font-size: 1.1rem;
  margin: 0 0 0.35rem;
}

/* Blog posts */
.back-link {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  color: var(--ink-soft);
}

.post-title {
  margin: 1rem 0 0.4rem;
  font-variation-settings: 'opsz' 144, 'WONK' 1;
  font-size: clamp(2.2rem, 6vw, 3.4rem);
  line-height: 1.05;
}

.post-meta {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  color: var(--ink-soft);
  margin-bottom: 2.5rem;
}

.toc {
  padding: 14px 0;
  margin-bottom: 2.5rem;
  border-top: 1px dashed var(--line);
  border-bottom: 1px dashed var(--line);
  font-size: 1rem;
}

.toc-title {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--seal);
  margin: 0 0 0.35rem;
}

.toc ol {
  margin: 0;
  padding-left: 1.2rem;
}

.toc ul {
  margin: 0.25rem 0 0;
  padding-left: 1.1rem;
  list-style-type: circle;
}

.toc li {
  margin-bottom: 0.15rem;
}

.post {
  max-width: 700px;
  margin: 0 auto;
}

.post-body {
  font-size: 1.2rem;
  line-height: 1.7;
}

.post-body p,
.post-body ul,
.post-body ol {
  margin: 0 0 1.4em;
}

.post-body li {
  margin-bottom: 0.4em;
}

.post-body h2 {
  margin: 2.2em 0 0.6em;
  font-size: 1.6rem;
  line-height: 1.25;
}

.post-body h3 {
  margin: 1.8em 0 0.5em;
  font-size: 1.3rem;
}

.post-body h2 strong,
.post-body h3 strong {
  font-weight: inherit;
}

.post-body img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 0 auto;
  border-radius: 4px;
}

.post-body figure {
  margin: 2.2rem 0;
}

.post-body figcaption {
  margin-top: 0.7rem;
  text-align: center;
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--ink-soft);
}

.post-body .embed {
  position: relative;
  aspect-ratio: 16 / 9;
  margin: 2.2rem 0;
}

.post-body .embed iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: 4px;
}

.post-body pre {
  margin: 0 0 1.4em;
  white-space: pre;
}

.post-footer {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px dashed var(--line);
}

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

.post-tags li {
  margin: 0;
  padding: 0.2rem 0.7rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink-soft);
}

.post-tags li::marker {
  content: none;
}

.post-origin {
  font-size: 1rem;
  color: var(--ink-soft);
}

/* Writing list */
.blog-excerpt {
  margin-top: 6px;
  font-size: 1rem;
  color: var(--ink-soft);
}

.post-body blockquote {
  margin: 1.5rem 0;
  padding: 0.25rem 1.25rem;
  border-left: 2px solid var(--seal);
  color: var(--ink-soft);
  font-style: italic;
}

.katex-display {
  overflow-x: auto;
  overflow-y: hidden;
  padding: 0.25rem 0;
}

/* Code blocks (Rouge) */
pre {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  line-height: 1.6;
  padding: 1rem 1.2rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--code-bg);
  overflow-x: auto;
}

pre code {
  background: none;
  border: 0;
  padding: 0;
  font-size: inherit;
}

.highlight .c, .highlight .c1, .highlight .cm, .highlight .cs, .highlight .cp { color: var(--code-comment); font-style: italic; }
.highlight .k, .highlight .kd, .highlight .kn, .highlight .kr, .highlight .kc, .highlight .ow { color: var(--code-keyword); }
.highlight .s, .highlight .s1, .highlight .s2, .highlight .sd, .highlight .sb, .highlight .si, .highlight .sx { color: var(--code-string); }
.highlight .m, .highlight .mi, .highlight .mf, .highlight .mh, .highlight .il { color: var(--code-number); }
.highlight .nf, .highlight .fm, .highlight .nc, .highlight .nb, .highlight .bp { color: var(--code-func); }
.highlight .o, .highlight .p { color: var(--ink-soft); }

/* 404 */
.not-found {
  padding: 10vh 0 2rem;
  max-width: 36rem;
}

.not-found .profile-kicker {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--ink-soft);
  margin: 0 0 28px;
}

/* Scroll reveal (classes added by default.html) */
.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.8s var(--ease-out), transform 0.8s var(--ease-out),
              background-color 0.3s ease, border-color 0.45s ease, color 0.45s ease;
  transition-delay: var(--d, 0s), var(--d, 0s), 0s, 0s, 0s;
}

.reveal.visible {
  opacity: 1;
  transform: none;
}

.profile-photo.reveal.visible {
  transform: rotate(1.2deg);
}

/* Page transitions (Chrome, Edge, Safari 18.2+; others just navigate) */
@view-transition {
  navigation: auto;
}

/* Responsive */
@media (max-width: 760px) {
  .container {
    padding: 0 16px;
  }

  .header-inner {
    flex-wrap: wrap;
    gap: 10px;
  }

  .header-actions {
    order: 2;
    margin-left: auto;
  }

  .nav-toggle {
    display: inline-flex;
  }

  nav {
    order: 3;
    flex-basis: 100%;
    margin: 0;
    display: none;
  }

  .nav-open nav {
    display: block;
  }

  nav ul {
    flex-direction: column;
    gap: 0;
    padding-bottom: 0.75rem;
  }

  nav a {
    display: block;
    padding: 0.55rem 0;
    font-size: 0.85rem;
  }

  .profile-section {
    grid-template-columns: 1fr;
    gap: 2.5rem;
    padding-top: 2rem;
  }

  .profile-photo {
    max-width: 220px;
  }

  .page > h2 {
    margin: 64px 0 28px;
    font-size: 1.6rem;
  }

  .news-item {
    flex-direction: column;
    gap: 0.15rem;
  }

  .news-date {
    flex-basis: auto;
  }

  .news-date::after {
    display: none;
  }

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

  .pub-item {
    padding-left: 44px;
  }
}

@media (prefers-reduced-motion: reduce) {
  @view-transition {
    navigation: none;
  }

  *, *::before, *::after {
    transition: none !important;
    scroll-behavior: auto !important;
  }

  .cursor-blink {
    animation: none;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }
}

/* Print */
@media print {
  header, footer, #protein-canvas, .grain, .skip-link, .toc {
    display: none;
  }

  body {
    font-size: 11pt;
    background: #fff;
    color: #000;
  }

  a {
    color: #000;
    text-decoration: underline;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }
}
