:root {
  color-scheme: light;

  --font-sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-display: var(--font-sans);
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;

  --bg: #ffffff;
  --surface: #ffffff;
  --ink: #000000;
  --muted: #1f2937;

  --accent: #a3ff12;
  --accent-strong: #7bdb00;
  --accent-2: #00d5ff;

  --border: #000000;
  --subtle: #f5f5f5;
  --subtle-2: #f0f0f0;

  --shadow: 8px 8px 0 var(--border);
  --shadow-sm: 4px 4px 0 var(--border);

  --radius: 0px;
  --radius-sm: 0px;
  --content-max: 980px;
  --content-narrow: 920px;

  --banner-h: 48px;
  --banner-gap: 18px;

  /* Back-compat variables used by some pages */
  --card: var(--surface);
  --card-solid: var(--surface);
  --nav-bg: var(--surface);
  --chip-bg: var(--surface);
  --ring: rgba(0, 0, 0, 0.35);
}

* {
  box-sizing: border-box;
}

body {
  font-family: var(--font-sans);
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

h1,
h2,
h3 {
  font-family: var(--font-display);
}

h3 {
  letter-spacing: -0.015em;
}

a {
  color: var(--ink);
  text-decoration-thickness: 3px;
  text-underline-offset: 3px;
}

a:hover {
  background: var(--accent);
}

.skip-link {
  position: absolute;
  top: 10px;
  left: 10px;
  padding: 10px 14px;
  border-radius: 0;
  background: var(--card-solid);
  border: 3px solid var(--border);
  box-shadow: var(--shadow);
  color: var(--ink);
  text-decoration: none;
  transform: translateY(-140%);
  transition: transform 0.18s ease;
  z-index: 5;
}

.skip-link:focus {
  transform: translateY(0);
  outline: none;
}

.skip-link:focus-visible {
  box-shadow: 0 0 0 4px var(--ring), var(--shadow);
}

.ambient-bg {
  display: none;
}

header {
  position: relative;
  z-index: 1;
  padding: calc(var(--banner-h) + var(--banner-gap)) 20px 18px;
  text-align: center;
  width: min(100%, var(--content-max));
  max-width: var(--content-max);
  margin: 0 auto;
  background: var(--surface);
  border-bottom: 3px solid var(--border);
  border-left: 3px solid var(--border);
  border-right: 3px solid var(--border);
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow: hidden;
}

header::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: var(--banner-h);
  background: var(--accent);
  border-bottom: 3px solid var(--border);
  z-index: 0;
}

header > * {
  position: relative;
  z-index: 1;
  width: min(100%, var(--content-max));
  margin-left: 0;
  margin-right: 0;
}

header h1 {
  font-size: clamp(2.6rem, 4vw, 4.2rem);
  margin: 6px 0 0;
  letter-spacing: -0.03em;
  font-weight: 950;
  text-transform: uppercase;
  line-height: 1.05;
}

header p {
  margin: 10px 0 0;
  font-size: 1rem;
  color: var(--muted);
  font-weight: 750;
}

nav {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  padding: 12px 20px;
  background: var(--nav-bg);
  border-bottom: 3px solid var(--border);
  border-left: 3px solid var(--border);
  border-right: 3px solid var(--border);
  overflow-x: auto;
  width: min(100%, var(--content-max));
  margin: 0 auto;
}

nav a {
  color: var(--ink);
  text-decoration: none;
  padding: 10px 12px;
  border-radius: 0;
  font-weight: 950;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  background: var(--surface);
  border: 2px solid var(--border);
  box-shadow: var(--shadow-sm);
  transition: transform 0.08s ease;
}

nav a:hover,
nav a.active {
  color: var(--ink);
  background: var(--accent);
}

nav a:active {
  transform: translate(2px, 2px);
  box-shadow: 2px 2px 0 var(--border);
}

section,
.card {
  position: relative;
  z-index: 1;
  max-width: var(--content-max);
  margin: 28px auto;
  padding: clamp(18px, 3vw, 32px);
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 3px solid var(--border);
}

section h2,
.card h2 {
  font-size: 1.1rem;
  margin: 0 0 12px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  font-weight: 950;
}

section ul {
  padding-left: 1.15em;
}

section li {
  margin: 0.35em 0;
}

.hero-section .about-container {
  align-items: center;
}

.hero-content {
  display: grid;
  gap: 12px;
}

.hero-content h2 {
  margin: 0;
}

.lead {
  margin: 0;
  color: var(--muted);
  font-size: 1.05rem;
}

.hero-ctas {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 8px;
}

.section-intro {
  margin: 0 0 16px;
  color: var(--muted);
}

.highlights-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 12px;
}

.highlight-card {
  display: grid;
  gap: 4px;
  padding: 14px;
  text-decoration: none;
  border: 2px solid var(--border);
  box-shadow: var(--shadow-sm);
  background: var(--surface);
  transition: transform 0.08s ease;
}

.highlight-card:hover {
  transform: translate(2px, 2px);
  box-shadow: 2px 2px 0 var(--border);
}

.highlight-value {
  font-size: 1.9rem;
  font-weight: 950;
  line-height: 1;
}

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

.featured-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}

.featured-column {
  border: 2px solid var(--border);
  box-shadow: var(--shadow-sm);
  padding: 16px;
  display: grid;
  gap: 12px;
}

.featured-column h3 {
  margin: 0;
}

.featured-list {
  margin: 0;
  padding-left: 1.1em;
  display: grid;
  gap: 10px;
}

.featured-list li {
  margin: 0;
}

.featured-column .btn {
  justify-self: start;
}

.pub-list {
  list-style: none;
  padding: 0;
  margin: 16px 0 0;
  display: grid;
  gap: 14px;
}

.pub-item {
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  border: 2px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.pub-title {
  color: var(--ink);
  font-weight: 650;
}

.pub-item a {
  font-weight: 650;
}

.pub-snippet {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.98rem;
  line-height: 1.55;
}

.pub-snippet:empty {
  display: none;
}

.profile-links {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 16px;
  width: fit-content;
}

.profile-links a {
  width: 38px;
  height: 38px;
  border-radius: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--chip-bg);
  color: var(--ink);
  box-shadow: var(--shadow-sm);
  border: 2px solid var(--border);
  transition: transform 0.08s ease;
}

.profile-links a:hover {
  transform: translate(2px, 2px);
  box-shadow: 2px 2px 0 var(--border);
}

.profile-links svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.about-container {
  display: grid;
  grid-template-columns: 170px 1fr;
  gap: 26px;
  align-items: start;
}

.profile-image {
  width: 170px;
  height: 170px;
  border-radius: 0;
  object-fit: cover;
  border: 3px solid var(--border);
  box-shadow: var(--shadow);
  margin: 0;
}

.three-column-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 8px 18px;
  list-style: none;
  padding: 0;
  margin: 0;
}

.three-column-list li {
  padding: 8px 10px;
  background: var(--surface);
  border-radius: 0;
  color: var(--ink);
  font-weight: 900;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  text-align: center;
  border: 2px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.book-list {
  list-style: none;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px;
}

.book-list li {
  text-align: left;
  background: var(--surface);
  border-radius: var(--radius-sm);
  padding: 12px;
  border: 2px solid var(--border);
  box-shadow: var(--shadow-sm);
  transition: transform 0.08s ease;
}

.book-list li:hover {
  transform: translate(2px, 2px);
  box-shadow: 2px 2px 0 var(--border);
}

.book-list img {
  width: 100%;
  height: auto;
  border-radius: 0;
  border: 2px solid var(--border);
}

.book-list a {
  text-decoration: none;
  color: var(--ink);
  font-weight: 600;
  display: grid;
  gap: 10px;
}

.book-list a:hover span {
  color: var(--ink);
}

.post-preview {
  background: var(--surface);
  padding: 18px;
  border-radius: var(--radius-sm);
  border: 2px solid var(--border);
  box-shadow: var(--shadow-sm);
  display: grid;
  gap: 8px;
}

.post-preview h3 {
  margin: 0;
  font-size: 1.4rem;
}

.post-preview h3 a {
  color: var(--ink);
  text-decoration: none;
}

.post-preview h3 a:hover {
  color: var(--ink);
}

.post-meta {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--muted);
  font-weight: 800;
}

.post-preview .btn {
  justify-self: start;
}

.post-frontmatter {
  margin: 10px 0 16px;
}

.post-title {
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 3vw, 3rem);
  margin: 0;
  letter-spacing: -0.03em;
  text-transform: uppercase;
  font-weight: 950;
}

.post-date {
  margin-top: 8px;
  font-size: 0.9rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.post-cover {
  display: block;
  width: 100%;
  border-radius: var(--radius-sm);
  margin: 16px 0 18px;
  border: 2px solid var(--border);
  box-shadow: var(--shadow);
}

/* Intentionally no inline image injection for posts; only cover images are shown. */

blockquote {
  margin: 18px 0;
  padding: 16px 18px;
  border: 3px solid var(--border);
  background: var(--subtle);
  border-radius: 0;
  color: var(--ink);
  box-shadow: var(--shadow-sm);
}

pre,
code {
  font-family: var(--font-mono);
}

pre {
  margin: 16px 0;
  padding: 14px 16px;
  background: var(--subtle-2);
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: auto;
  box-shadow: var(--shadow-sm);
}

code {
  background: var(--subtle-2);
  border: 2px solid var(--border);
  padding: 0.14em 0.36em;
  border-radius: 0;
  font-size: 0.95em;
}

pre code {
  background: transparent;
  border: none;
  padding: 0;
}

.tweets-section iframe {
  border: none;
  width: 100%;
  height: 600px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 0;
  font-weight: 950;
  text-decoration: none;
  background: var(--accent);
  color: var(--ink);
  border: 3px solid var(--border);
  box-shadow: 5px 5px 0 var(--border);
  text-transform: uppercase;
  letter-spacing: 0.02em;
  transition: transform 0.08s ease;
}

.btn:hover {
  transform: translate(2px, 2px);
  box-shadow: 3px 3px 0 var(--border);
}

.btn-outline {
  background: var(--surface);
  color: var(--ink);
  border: 3px solid var(--border);
  box-shadow: 5px 5px 0 var(--border);
}

.btn-outline:hover {
  background: var(--surface);
  transform: translate(2px, 2px);
  box-shadow: 3px 3px 0 var(--border);
}

.btn-compact {
  padding: 8px 14px;
  font-size: 0.95rem;
}

.subscribe-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  padding: 10px 16px;
  background: var(--accent);
  color: var(--ink);
  border-radius: 0;
  font-weight: 950;
  text-decoration: none;
  border: 3px solid var(--border);
  box-shadow: 5px 5px 0 var(--border);
  text-transform: uppercase;
  letter-spacing: 0.02em;
  transition: transform 0.08s ease;
}

.subscribe-btn:hover {
  transform: translate(2px, 2px);
  box-shadow: 3px 3px 0 var(--border);
}

footer {
  position: relative;
  z-index: 1;
  text-align: left;
  padding: 16px 20px 20px;
  color: var(--muted);
  max-width: var(--content-max);
  margin: 28px auto 0;
  border-top: 3px solid var(--border);
}

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

footer a:hover {
  background: var(--accent);
}

*:focus-visible {
  outline: 3px solid transparent;
  box-shadow: 0 0 0 4px var(--ring);
}

.suggested-citation {
  margin-top: 26px;
  padding: 18px;
  border: 3px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.suggested-citation h3 {
  margin: 18px 0 10px;
  font-family: var(--font-display);
  font-size: 1.2rem;
  letter-spacing: -0.01em;
}

.suggested-citation h3:first-child {
  margin-top: 0;
}

.citation-variant {
  margin-bottom: 14px;
}

.citation-label {
  font-size: 0.85rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 6px;
}

.citation-body {
  padding: 12px 14px;
  border-radius: 0;
  background: var(--surface);
  border: 2px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.citation-body div + div {
  margin-top: 6px;
}

.citation-body a {
  word-break: break-word;
}

.citation-bibtex {
  margin: 10px 0 0;
  padding: 14px;
  border-radius: 14px;
  background: var(--chip-bg);
  border: 1px solid var(--border);
  overflow-x: auto;
}

.citation-bibtex code {
  font-family: var(--font-mono);
  font-size: 0.92rem;
  white-space: pre;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

@media (max-width: 720px) {
  header {
    padding: calc(var(--banner-h) + 16px) 20px 16px;
  }

  .hero-ctas {
    flex-direction: column;
    align-items: flex-start;
  }

  .about-container {
    grid-template-columns: 1fr;
  }

  .profile-image {
    display: block;
    width: 160px;
    height: 160px;
    margin: 0 auto 10px;
  }

  .citation-body {
    padding: 10px 12px;
  }
}
