/*
  Dark, clean, research-reviewer-friendly theme.
  Edit colors in :root only.
*/

:root {
  --bg: #0b1220;
  --surface: #0f1c33;
  --surface2: #121a2b;
  --text: #e6edf7;
  --muted: #b6c2d6;
  --accent: #22d3ee;
  --gold: #fbbf24;
  --gold-rgb: 251, 191, 36;
  --border: #24324e;
  --shadow: rgba(0, 0, 0, 0.35);

  --radius: 14px;
  --radius-sm: 10px;
  --container: 980px;

  --space-1: 0.5rem;
  --space-2: 0.75rem;
  --space-3: 1rem;
  --space-4: 1.5rem;
  --space-5: 2rem;
  --space-6: 3rem;

  color-scheme: dark;
}

* { box-sizing: border-box; }

html, body {
  height: 100%;
}

html {
  background: var(--bg);
}

body {
  margin: 0;
  background: transparent;
  color: var(--text);
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  line-height: 1.55;
  position: relative;
  z-index: 0;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: radial-gradient(1200px 800px at 20% 10%, rgba(34, 211, 238, 0.10), transparent 55%),
              radial-gradient(900px 700px at 80% 20%, rgba(96, 165, 250, 0.10), transparent 50%),
              var(--bg);
}

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

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

a:hover {
  text-decoration-thickness: 2px;
}

/* Accessibility */
.skip-link {
  position: absolute;
  left: 0;
  top: 0;
  transform: translateY(-130%);
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 0.75rem 1rem;
  border-radius: 0 0 var(--radius-sm) 0;
  z-index: 9999;
}

.skip-link:focus {
  transform: translateY(0);
  outline: 3px solid rgba(34, 211, 238, 0.45);
  outline-offset: 2px;
}

:focus-visible {
  outline: 3px solid rgba(34, 211, 238, 0.55);
  outline-offset: 2px;
  border-radius: 8px;
}

.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(11, 18, 32, 0.82);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-3) 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  color: var(--text);
  font-weight: 800;
  letter-spacing: 0.2px;
}

.brand-mark {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(34, 211, 238, 0.25), rgba(96, 165, 250, 0.25));
  border: 1px solid rgba(34, 211, 238, 0.25);
  box-shadow: 0 10px 30px var(--shadow);
}

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

.nav a {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.5rem 0.7rem;
  border-radius: 10px;
  color: var(--muted);
  text-decoration: none;
  border: 1px solid transparent;
}

.nav a:hover {
  color: var(--text);
  border-color: rgba(34, 211, 238, 0.25);
  background: rgba(34, 211, 238, 0.06);
}

.nav a[aria-current="page"] {
  color: var(--text);
  border-color: rgba(34, 211, 238, 0.35);
  background: rgba(34, 211, 238, 0.10);
}

.nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: rgba(34, 211, 238, 0.06);
  border: 1px solid rgba(34, 211, 238, 0.22);
  color: var(--text);
}

.nav-toggle-lines {
  width: 18px;
  height: 12px;
  position: relative;
}

.nav-toggle-lines span {
  position: absolute;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  opacity: 0.85;
}

.nav-toggle-lines span:nth-child(1) { top: 0; }
.nav-toggle-lines span:nth-child(2) { top: 5px; }
.nav-toggle-lines span:nth-child(3) { top: 10px; }

main {
  padding: var(--space-6) 0;
}

.hero {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: var(--space-5);
  align-items: start;
}

.hero-card {
  background: rgba(15, 28, 51, 0.72);
  border: 1px solid var(--border);
  box-shadow: 0 18px 60px var(--shadow);
  border-radius: var(--radius);
  overflow: hidden;
}

.hero-banner {
  border-bottom: 1px solid var(--border);
}

.hero-body {
  padding: var(--space-5);
}

.h1 {
  font-size: clamp(2rem, 4vw, 2.6rem);
  line-height: 1.15;
  margin: 0 0 var(--space-2) 0;
}

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

.quick-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.65rem 0.95rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(18, 26, 43, 0.75);
  color: var(--text);
  text-decoration: none;
  font-weight: 650;
  cursor: pointer;
}

.btn:hover {
  border-color: rgba(34, 211, 238, 0.35);
  background: rgba(34, 211, 238, 0.06);
}

.btn.primary {
  border-color: rgba(34, 211, 238, 0.35);
  background: linear-gradient(135deg, rgba(34, 211, 238, 0.12), rgba(96, 165, 250, 0.10));
}

.btn.ghost {
  background: transparent;
}

.btn.small {
  padding: 0.5rem 0.75rem;
  border-radius: 10px;
  font-weight: 600;
}

.btn.demo-btn {
  background: rgba(var(--gold-rgb), 0.10);
  border-color: rgba(var(--gold-rgb), 0.60);
  color: var(--text);
}

.btn.demo-btn:hover {
  background: rgba(var(--gold-rgb), 0.16);
  border-color: rgba(var(--gold-rgb), 0.75);
}

.section {
  margin-top: var(--space-6);
}

.section h2 {
  margin: 0 0 var(--space-3) 0;
  font-size: 1.35rem;
}

.card h2 {
  margin: 0 0 var(--space-3) 0;
  font-size: 1.35rem;
}

.section p {
  margin: 0 0 var(--space-3) 0;
  color: var(--muted);
}

.card {
  background: rgba(15, 28, 51, 0.55);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 14px 40px var(--shadow);
  padding: var(--space-4);
}

/* Clickable project tiles (projects index) */
.project-tile {
  display: block;
  color: inherit;
  text-decoration: none;
  transition: transform 140ms ease, border-color 140ms ease, background 140ms ease;
}

.project-title-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
  margin: 0 0 0.4rem 0;
}

.project-title-row h3 {
  margin: 0;
}

.demo-indicator {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.24rem 0.6rem;
  border-radius: 999px;
  border: 1px solid rgba(var(--gold-rgb), 0.55);
  background: rgba(var(--gold-rgb), 0.12);
  color: var(--text);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  cursor: default;
  user-select: none;
}

.project-tile:hover {
  transform: translateY(-2px);
  border-color: rgba(34, 211, 238, 0.30);
  background: rgba(34, 211, 238, 0.05);
}

.project-tile:active {
  transform: translateY(0);
}

/* Project page title row (title + actions) */
.title-row {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.title-row .h1 {
  margin: 0;
  margin-right: 0.25rem;
}

.icon-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(18, 26, 43, 0.75);
  color: var(--text);
  text-decoration: none;
}

.icon-link:hover {
  border-color: rgba(34, 211, 238, 0.35);
  background: rgba(34, 211, 238, 0.06);
}

.icon {
  width: 20px;
  height: 20px;
  fill: currentColor;
  opacity: 0.92;
}

.card.compact {
  padding: var(--space-3);
}

.card h3 {
  margin: 0 0 0.4rem 0;
  font-size: 1.1rem;
}

.meta {
  color: var(--muted);
  font-size: 0.95rem;
}

.bullet-list {
  margin: 0;
  padding-left: 1.15rem;
  list-style-position: outside;
}

.bullet-list li {
  margin: 0.25rem 0;
}

.card .bullet-list {
  margin: 0.35rem 0 0.65rem 0;
}

.grid {
  display: grid;
  gap: var(--space-4);
}

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

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.65rem;
}

.tag {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.55rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(18, 26, 43, 0.65);
  color: var(--muted);
  font-size: 0.85rem;
}

.tag.accent {
  border-color: rgba(34, 211, 238, 0.35);
  color: var(--text);
}

.kv {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.55rem;
  margin: 0;
}

.kv dt {
  font-weight: 700;
  color: var(--text);
}

.kv dd {
  margin: 0;
  color: var(--muted);
}

.form-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}

.input {
  width: 100%;
  max-width: 420px;
  padding: 0.65rem 0.85rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(18, 26, 43, 0.75);
  color: var(--text);
}

.input::placeholder {
  color: rgba(182, 194, 214, 0.72);
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.filter-btn {
  appearance: none;
  border: 1px solid var(--border);
  background: rgba(18, 26, 43, 0.65);
  color: var(--muted);
  padding: 0.45rem 0.75rem;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 650;
}

.filter-btn[aria-pressed="true"] {
  color: var(--text);
  border-color: rgba(34, 211, 238, 0.35);
  background: rgba(34, 211, 238, 0.10);
}

.media {
  display: grid;
  grid-template-columns: 132px 1fr;
  gap: var(--space-4);
  align-items: start;
}

.headshot-frame {
  width: 132px;
  height: 132px;
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid rgba(34, 211, 238, 0.30);
  background: rgba(15, 28, 51, 0.45);
  box-shadow: 0 14px 40px var(--shadow);
}

.headshot-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.split {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: var(--space-5);
  align-items: start;
}

.sidebar {
  position: sticky;
  top: 88px;
}

.figure {
  margin: 0;
}

.figure img {
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: rgba(18, 26, 43, 0.35);
}

.figure figcaption {
  margin-top: 0.5rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.notice {
  border: 1px dashed rgba(34, 211, 238, 0.35);
  background: rgba(34, 211, 238, 0.08);
  border-radius: var(--radius);
  padding: var(--space-4);
  color: var(--muted);
}

.demo-root {
  min-height: 420px;
  border-radius: var(--radius);
  border: 1px dashed rgba(182, 194, 214, 0.45);
  background: rgba(18, 26, 43, 0.35);
}

.site-footer {
  border-top: 1px solid var(--border);
  padding: var(--space-5) 0;
  background: rgba(11, 18, 32, 0.60);
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.footer-links a {
  color: var(--muted);
  text-decoration: none;
}

.footer-links a:hover {
  color: var(--text);
  text-decoration: underline;
}

.small {
  color: var(--muted);
  font-size: 0.9rem;
}

.code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, Liberation Mono, monospace;
  background: rgba(18, 26, 43, 0.75);
  border: 1px solid var(--border);
  padding: 0.15rem 0.35rem;
  border-radius: 8px;
}

.toast {
  position: fixed;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(15, 28, 51, 0.92);
  border: 1px solid rgba(34, 211, 238, 0.25);
  box-shadow: 0 18px 60px var(--shadow);
  padding: 0.65rem 0.9rem;
  border-radius: 999px;
  color: var(--text);
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease, transform 180ms ease;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(-4px);
}

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

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

  .sidebar {
    position: static;
  }
}

@media (max-width: 760px) {
  .container {
    padding: 0 var(--space-3);
  }

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

  .nav {
    display: none;
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    padding-top: var(--space-2);
  }

  .site-header.nav-open .nav {
    display: flex;
  }

  .nav a {
    justify-content: space-between;
    padding: 0.75rem 0.8rem;
  }

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

  .media {
    grid-template-columns: 110px 1fr;
  }

  .headshot-frame {
    width: 110px;
    height: 110px;
  }
}

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