/* =========================================================================
   Charudatta Korde — portfolio design system
   Material-inspired, dark/light themes, minimal JavaScript, accessible.
   ========================================================================= */

/* -------------------------------------------------------------------------
   Design tokens
   ------------------------------------------------------------------------- */
:root {
  --font-sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas,
    monospace;

  --radius: 18px;
  --radius-sm: 12px;
  --radius-xs: 8px;
  --max-width: 1120px;
  --header-h: 64px;

  /* light theme (default) */
  --bg: #f5f6fb;
  --bg-glow-1: rgba(79, 70, 229, 0.09);
  --bg-glow-2: rgba(8, 145, 178, 0.08);
  --surface: #ffffff;
  --surface-2: #f8f9fe;
  --surface-3: #f0f2fa;
  --border: rgba(15, 23, 42, 0.09);
  --border-strong: rgba(15, 23, 42, 0.16);
  --text-1: #0f172a;
  --text-2: #46546a;
  --text-3: #6b7890;
  --primary: #4f46e5;
  --primary-strong: #4338ca;
  --primary-soft: #eef0ff;
  --primary-contrast: #ffffff;
  --secondary: #0e7490;
  --secondary-soft: #ecfeff;
  --good: #047857;
  --good-soft: #ecfdf5;
  --warn: #b45309;
  --warn-soft: #fffbeb;
  --shadow-1: 0 1px 2px rgba(15, 23, 42, 0.05),
    0 1px 3px rgba(15, 23, 42, 0.06);
  --shadow-2: 0 2px 4px rgba(15, 23, 42, 0.05),
    0 8px 24px rgba(15, 23, 42, 0.08);
  --shadow-3: 0 4px 8px rgba(15, 23, 42, 0.06),
    0 16px 40px rgba(15, 23, 42, 0.12);
  --ring: 0 0 0 3px rgba(79, 70, 229, 0.25);
  --tile: 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
  --tile-fast: 0.25s ease;
  --grid-lines: linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  --grid-size: 44px;

  color-scheme: light;
}

body {
  background-image:
    radial-gradient(
      1.5px 1.5px at 25% 30%,
      var(--border-strong),
      transparent 100%
    );
  background-repeat: no-repeat;
}

html[data-theme="dark"] {
  --bg: #0a0f1d;
  --bg-glow-1: rgba(129, 140, 248, 0.12);
  --bg-glow-2: rgba(34, 211, 238, 0.1);
  --surface: #111827;
  --surface-2: #162032;
  --surface-3: #1c2840;
  --border: rgba(148, 163, 184, 0.14);
  --border-strong: rgba(148, 163, 184, 0.28);
  --text-1: #e7ebf4;
  --text-2: #b6bfd0;
  --text-3: #8b95aa;
  --primary: #8b93ff;
  --primary-strong: #a8afff;
  --primary-soft: rgba(129, 140, 248, 0.14);
  --primary-contrast: #0a0f1d;
  --secondary: #38d2ee;
  --secondary-soft: rgba(34, 211, 238, 0.12);
  --good: #34d399;
  --good-soft: rgba(52, 211, 153, 0.14);
  --warn: #fbbf24;
  --warn-soft: rgba(251, 191, 36, 0.14);
  --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.35), 0 1px 3px rgba(0, 0, 0, 0.4);
  --shadow-2: 0 2px 4px rgba(0, 0, 0, 0.35), 0 10px 28px rgba(0, 0, 0, 0.45);
  --shadow-3: 0 4px 10px rgba(0, 0, 0, 0.4), 0 20px 48px rgba(0, 0, 0, 0.55);
  --ring: 0 0 0 3px rgba(139, 147, 255, 0.35);
  --grid-lines: linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  --grid-size: 44px;
  color-scheme: dark;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 24px);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.65;
  color: var(--text-1);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background-color 0.35s ease, color 0.35s ease;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(42rem 30rem at 12% -6%, var(--bg-glow-1), transparent 60%),
    radial-gradient(36rem 26rem at 92% 12%, var(--bg-glow-2), transparent 55%);
  pointer-events: none;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image: var(--grid-lines);
  background-size: var(--grid-size) var(--grid-size);
  -webkit-mask-image: radial-gradient(60rem 40rem at 70% 0%, #000 0%, transparent 70%);
  mask-image: radial-gradient(60rem 40rem at 70% 0%, #000 0%, transparent 70%);
  pointer-events: none;
  opacity: 0.5;
}

img,
svg,
video {
  max-width: 100%;
  height: auto;
  display: block;
}

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

a:hover {
  text-decoration: underline;
}

h1,
h2,
h3,
h4 {
  line-height: 1.18;
  letter-spacing: -0.02em;
  margin: 0 0 0.5em;
  font-weight: 650;
}

p {
  margin: 0 0 1em;
  color: var(--text-2);
}

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

::selection {
  background: var(--primary-soft);
  color: var(--primary-strong);
}

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

main {
  padding-bottom: 40px;
}

section {
  scroll-margin-top: calc(var(--header-h) + 16px);
}

/* -------------------------------------------------------------------------
   Top bar / navigation
   ------------------------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 60;
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 0 22px;
  background: color-mix(in srgb, var(--bg) 72%, transparent);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 1px solid var(--border);
}

.logo {
  font-size: 1.02rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-1);
  display: inline-flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
  text-decoration: none;
}

.logo:hover {
  text-decoration: none;
}

.logo-mark {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 800;
  box-shadow: var(--shadow-1);
}

.nav {
  display: flex;
  align-items: center;
  gap: 4px;
}

.menu {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 2px;
  margin: 0;
  padding: 0;
}

.menu a,
.dropbtn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: 10px;
  font-size: 0.9rem;
  font-weight: 550;
  color: var(--text-2);
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  text-decoration: none;
  transition: background-color var(--tile-fast), color var(--tile-fast);
}

.menu a:hover,
.dropbtn:hover,
.menu a[aria-current="page"] {
  color: var(--text-1);
  background: var(--surface-2);
  text-decoration: none;
}

.menu li {
  position: relative;
}

.dropdown-content {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  min-width: 208px;
  padding: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow-3);
  list-style: none;
  margin: 0;
  z-index: 70;
}

.dropdown-content li {
  margin: 0;
}

.dropdown-content a {
  display: flex;
  width: 100%;
  padding: 9px 12px;
  font-weight: 500;
  font-size: 0.88rem;
  border-radius: 9px;
  color: var(--text-2);
}

.dropdown-content a:hover {
  background: var(--surface-2);
  color: var(--text-1);
}

.dropdown:hover .dropdown-content,
.dropdown:focus-within .dropdown-content,
.dropdown.open .dropdown-content {
  display: block;
}

.dropbtn .caret {
  transition: transform var(--tile-fast);
}

.dropdown:hover .caret,
.dropdown.open .caret {
  transform: rotate(180deg);
}

.header-tools {
  display: flex;
  align-items: center;
  gap: 10px;
}

.icon-btn {
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 11px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-2);
  cursor: pointer;
  font-size: 1rem;
  transition: color var(--tile-fast), border-color var(--tile-fast),
    transform var(--tile-fast);
}

.icon-btn:hover {
  color: var(--primary);
  border-color: var(--border-strong);
  transform: translateY(-1px);
}

.menu-toggle {
  display: none;
}

/* Search box (Pagefind) */
.search-box {
  position: relative;
  width: clamp(180px, 20vw, 260px);
}

.search-box .pagefind-ui__drawer {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: min(460px, 92vw);
  max-height: 60vh;
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow-3);
  z-index: 80;
  padding: 10px;
}

.pagefind-ui__search-input,
.pagefind-ui__search-input:focus {
  background: var(--surface-2);
  border-color: var(--border);
  color: var(--text-1);
  border-radius: 11px;
}

/* -------------------------------------------------------------------------
   Buttons & chips
   ------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.9rem;
  font-family: inherit;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform var(--tile-fast), box-shadow var(--tile-fast),
    background-color var(--tile-fast), border-color var(--tile-fast);
  text-decoration: none;
  white-space: nowrap;
}

.btn:hover {
  text-decoration: none;
  transform: translateY(-2px);
}

.btn:active {
  transform: translateY(0);
}

.btn-primary {
  background: var(--primary);
  color: var(--primary-contrast);
  box-shadow: 0 6px 18px rgba(79, 70, 229, 0.3);
}

.btn-primary:hover {
  box-shadow: 0 10px 26px rgba(79, 70, 229, 0.4);
}

.btn-ghost {
  background: var(--surface);
  color: var(--text-1);
  border-color: var(--border);
  box-shadow: var(--shadow-1);
}

.btn-ghost:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-2);
}

.btn-sm {
  padding: 7px 14px;
  font-size: 0.82rem;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 550;
  color: var(--text-2);
  background: var(--surface-2);
  border: 1px solid var(--border);
  white-space: nowrap;
}

.chip-primary {
  color: var(--primary-strong);
  background: var(--primary-soft);
  border-color: transparent;
}

.chip-good {
  color: var(--good);
  background: var(--good-soft);
  border-color: transparent;
}

.chip-mono {
  font-family: var(--font-mono);
  font-size: 0.72rem;
}

/* -------------------------------------------------------------------------
   Sections
   ------------------------------------------------------------------------- */
.section {
  padding: 88px 0 24px;
}

.section-head {
  max-width: 760px;
  margin-bottom: 40px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--primary);
  font-weight: 600;
  margin-bottom: 14px;
}

.eyebrow::before {
  content: "";
  width: 26px;
  height: 2px;
  border-radius: 2px;
  background: var(--primary);
}

.section-title {
  font-size: clamp(1.6rem, 3.4vw, 2.1rem);
  margin-bottom: 12px;
}

.section-sub {
  color: var(--text-2);
  font-size: 1.02rem;
}

/* -------------------------------------------------------------------------
   Hero
   ------------------------------------------------------------------------- */
.hero {
  position: relative;
  min-height: calc(100svh - var(--header-h));
  display: flex;
  align-items: center;
  padding: 72px 0 48px;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
}

.hero-bg svg {
  filter: blur(6px) saturate(0.9);
  opacity: 0.65;
}

.hero-inner {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 48px;
  align-items: center;
  width: 100%;
}

.hero-name {
  font-size: clamp(2.6rem, 6.4vw, 4.3rem);
  letter-spacing: -0.04em;
  line-height: 1.04;
  margin-bottom: 18px;
}

.hero-name .accent {
  background: linear-gradient(120deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-roles {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 22px;
}

.hero-tagline {
  font-size: clamp(1.02rem, 1.6vw, 1.15rem);
  color: var(--text-2);
  max-width: 560px;
  margin-bottom: 28px;
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 26px;
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.hero-figure {
  border-radius: 24px;
  padding: 20px;
  background: color-mix(in srgb, var(--surface) 82%, transparent);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-3);
}

/* -------------------------------------------------------------------------
   Cards & grids
   ------------------------------------------------------------------------- */
.grid {
  display: grid;
  gap: 22px;
}

.grid-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.grid-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-1);
  transition: transform var(--tile), box-shadow var(--tile),
    border-color var(--tile);
}

.card-hover:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-2);
  border-color: var(--border-strong);
}

.card-pad {
  padding: 26px;
}

.card-title {
  font-size: 1.08rem;
  margin-bottom: 8px;
}

.card-body {
  color: var(--text-2);
  font-size: 0.94rem;
  margin-bottom: 16px;
}

.card-footer {
  margin-top: auto;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* Research area cards */
.research-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.research-art {
  background: linear-gradient(
    160deg,
    color-mix(in srgb, var(--primary-soft) 70%, var(--surface)),
    var(--surface)
  );
  border-bottom: 1px solid var(--border);
  padding: 12px 12px 0;
}

.research-card .card-pad {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.research-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0 16px;
}

.research-links {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: auto;
}

.research-links a {
  font-size: 0.88rem;
  font-weight: 600;
}

/* Project cards */
.project-card {
  display: flex;
  flex-direction: column;
}

.project-icon {
  width: 46px;
  height: 46px;
  border-radius: 13px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--primary-soft);
  color: var(--primary);
  margin-bottom: 16px;
}

.project-status {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-3);
}

.project-actions a {
  font-size: 0.86rem;
  font-weight: 600;
}

/* Publication rows */
.pub-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 14px;
}

.pub-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 20px;
  align-items: start;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 22px 24px;
  box-shadow: var(--shadow-1);
  transition: transform var(--tile), box-shadow var(--tile),
    border-color var(--tile);
}

.pub-item:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-2);
  border-color: var(--border-strong);
}

.pub-year {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--primary);
  padding: 4px 10px;
  border-radius: 8px;
  background: var(--primary-soft);
  min-width: 52px;
  text-align: center;
}

.pub-title {
  font-size: 1.02rem;
  font-weight: 650;
  margin-bottom: 4px;
}

.pub-authors {
  font-size: 0.86rem;
  color: var(--text-3);
  margin-bottom: 8px;
}

.pub-meta {
  font-size: 0.86rem;
  color: var(--text-2);
  margin-bottom: 10px;
}

.pub-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 0.85rem;
}

.pub-badge {
  display: inline-flex;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 650;
}

.pub-badge-open {
  color: var(--good);
  background: var(--good-soft);
}

.pub-badge-conf {
  color: var(--secondary);
  background: var(--secondary-soft);
}

.pub-badge-j {
  color: var(--primary);
  background: var(--primary-soft);
}

/* Metric strip */
.metric-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 16px;
  margin: 28px 0;
}

.metric {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 18px 20px;
  box-shadow: var(--shadow-1);
}

.metric-value {
  font-family: var(--font-mono);
  font-size: 1.6rem;
  font-weight: 750;
  letter-spacing: -0.02em;
  color: var(--primary);
  line-height: 1.15;
  margin-bottom: 4px;
}

.metric-label {
  font-size: 0.82rem;
  color: var(--text-3);
}

/* Pipeline (research -> code) */
.pipeline {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  justify-content: center;
  gap: 8px;
  margin: 8px 0 8px;
}

.pipe-step {
  flex: 1 1 130px;
  min-width: 120px;
  text-align: center;
  padding: 14px 10px;
  border-radius: 13px;
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow-1);
}

.pipe-step .pipe-icon {
  font-size: 1.3rem;
  margin-bottom: 6px;
}

.pipe-step .pipe-label {
  font-size: 0.82rem;
  font-weight: 650;
}

.pipe-step .pipe-sub {
  font-size: 0.72rem;
  color: var(--text-3);
}

.pipe-arrow {
  align-self: center;
  color: var(--text-3);
  font-size: 1rem;
  padding: 0 2px;
}

/* Timeline */
.timeline {
  list-style: none;
  margin: 0;
  padding: 0;
  position: relative;
}

.timeline::before {
  content: "";
  position: absolute;
  left: 8px;
  top: 6px;
  bottom: 6px;
  width: 2px;
  background: var(--border-strong);
  border-radius: 2px;
}

.timeline li {
  position: relative;
  padding: 0 0 26px 34px;
}

.timeline li::before {
  content: "";
  position: absolute;
  left: 3px;
  top: 7px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 0 0 4px var(--primary-soft);
}

.timeline-period {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--primary);
  font-weight: 600;
}

.timeline-role {
  font-weight: 650;
  margin: 2px 0 4px;
}

/* Knowledge / writing list */
.link-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
}

.link-list a {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 13px 16px;
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  font-weight: 550;
  color: var(--text-1);
  transition: border-color var(--tile-fast), transform var(--tile-fast),
    box-shadow var(--tile-fast);
}

.link-list a:hover {
  text-decoration: none;
  border-color: var(--border-strong);
  box-shadow: var(--shadow-1);
  transform: translateX(3px);
}

.link-list a span:first-child {
  display: flex;
  align-items: center;
  gap: 10px;
}

.link-list a .chev {
  color: var(--text-3);
  font-size: 0.85rem;
}

/* Feature list (about) */
.feature-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 14px;
}

.feature-list li {
  padding: 18px 20px;
  border-radius: var(--radius-sm);
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-2);
  font-size: 0.95rem;
}

.content-block {
  color: var(--text-2);
}

/* Skill clusters */
.skill-group {
  margin-bottom: 8px;
}

.skill-group-title {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-3);
  margin: 20px 0 10px;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* Contact channels */
.channel-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}

.channel-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 20px;
}

.channel-card .channel-name {
  font-weight: 650;
  font-size: 0.98rem;
}

.channel-card .channel-desc {
  font-size: 0.84rem;
  color: var(--text-3);
}

/* Gallery */
.gallery-img {
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-1);
  margin-bottom: 12px;
}

/* -------------------------------------------------------------------------
   Footer
   ------------------------------------------------------------------------- */
.site-footer {
  border-top: 1px solid var(--border);
  margin-top: 96px;
  padding: 40px 0 120px;
}

.site-footer .container {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  justify-content: space-between;
  align-items: flex-start;
  color: var(--text-3);
  font-size: 0.88rem;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
}

.footer-links a {
  color: var(--text-2);
  font-weight: 550;
  font-size: 0.86rem;
}

/* -------------------------------------------------------------------------
   Diagrams (inline SVG)
   ------------------------------------------------------------------------- */
.diagram {
  width: 100%;
  height: auto;
  display: block;
}

.diagram-node {
  fill: var(--surface);
  stroke: var(--border-strong);
  stroke-width: 1.5;
}

.diagram-node-hot {
  fill: var(--primary-soft);
  stroke: var(--primary);
  stroke-width: 1.5;
}

.diagram-node-cool {
  fill: var(--secondary-soft);
  stroke: var(--secondary);
  stroke-width: 1.5;
}

.diagram-line {
  stroke: var(--border-strong);
  fill: none;
  stroke-width: 1.5;
}

.diagram-flow {
  stroke: var(--primary);
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.diagram-flow-2 {
  stroke: var(--secondary);
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.diagram-dot {
  fill: var(--primary);
}

.diagram-dot-2 {
  fill: var(--secondary);
}

.diagram-text {
  fill: var(--text-2);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 550;
}

.diagram-title {
  fill: var(--text-1);
  font-family: var(--font-sans);
  font-weight: 650;
  font-size: 13px;
}

.diagram-sub {
  fill: var(--text-3);
  font-family: var(--font-mono);
  font-size: 9.5px;
}

/* -------------------------------------------------------------------------
   Floating CTA
   ------------------------------------------------------------------------- */
.floating-cta {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 50;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* -------------------------------------------------------------------------
   Scroll reveal (only when JS is active)
   ------------------------------------------------------------------------- */
html.js .reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.7s cubic-bezier(0.2, 0.8, 0.2, 1),
    transform 0.7s cubic-bezier(0.2, 0.8, 0.2, 1);
  will-change: opacity, transform;
}

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

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }

  html.js .reveal,
  html.js .reveal.visible {
    opacity: 1;
    transform: none;
  }

  .hero-bg {
    display: none;
  }
}

/* -------------------------------------------------------------------------
   Responsive
   ------------------------------------------------------------------------- */
@media (max-width: 980px) {
  .hero-inner {
    grid-template-columns: 1fr;
  }

  .hero-figure {
    max-width: 560px;
  }

  .grid-3,
  .grid-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .search-box {
    display: none;
  }
}

@media (max-width: 860px) {
  .nav {
    position: fixed;
    inset: var(--header-h) 0 auto 0;
    flex-direction: column;
    align-items: stretch;
    background: color-mix(in srgb, var(--bg) 94%, transparent);
    -webkit-backdrop-filter: blur(16px);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
    padding: 10px 18px 16px;
    display: none;
    max-height: calc(100vh - var(--header-h));
    overflow-y: auto;
    box-shadow: var(--shadow-3);
  }

  .nav.open {
    display: block;
  }

  .menu {
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
  }

  .menu a,
  .dropbtn {
    width: 100%;
    padding: 12px 14px;
  }

  .dropdown-content {
    position: static;
    box-shadow: none;
    border: none;
    background: transparent;
    padding: 0 0 0 14px;
    display: none;
  }

  .dropdown.open .dropdown-content {
    display: block;
  }

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

  .grid-2,
  .grid-3,
  .grid-4 {
    grid-template-columns: 1fr;
  }

  .pub-item {
    grid-template-columns: 1fr;
    gap: 10px;
  }
}

@media (max-width: 480px) {
  .site-header {
    padding: 0 14px;
  }

  .floating-cta {
    right: 16px;
    bottom: 16px;
  }

  .hero-name {
    font-size: clamp(2.2rem, 11vw, 2.9rem);
  }
}
