/* ============================================================
   DESIGN TOKENS — light mode defaults
   ============================================================ */
:root {
  --bg:           #FAFAF8;
  --surface:      #F0EFE9;
  --surface-2:    #E5E4DE;
  --text:         #1A1A1A;
  --text-muted:   #6B6B6B;
  --accent:       #2563EB;
  --accent-hover: #1D4ED8;
  --accent-2:     #C2570A;
  --border:       #DDDDD8;
  --border-2:     #C8C7C1;
  --code-bg:      #F0EFE9;
  --shadow:       0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.06);
  --shadow-md:    0 4px 6px rgba(0,0,0,0.07), 0 2px 4px rgba(0,0,0,0.06);

  --font-mono:    'JetBrains Mono', 'Fira Code', 'Cascadia Code', monospace;
  --font-sans:    'IBM Plex Sans', system-ui, -apple-system, sans-serif;
  --font-serif:   'Lora', 'Georgia', serif;

  --radius:       4px;
  --max-w:        860px;
  --nav-h:        56px;
}

/* Dark mode */
html.dark {
  --bg:           #0F1117;
  --surface:      #1A1D26;
  --surface-2:    #252836;
  --text:         #E8E8E3;
  --text-muted:   #8A8A85;
  --accent:       #4F8EF7;
  --accent-hover: #6BA3F9;
  --accent-2:     #E07030;
  --border:       #2D3142;
  --border-2:     #3D4259;
  --code-bg:      #1A1D26;
  --shadow:       0 1px 3px rgba(0,0,0,0.3);
  --shadow-md:    0 4px 6px rgba(0,0,0,0.4);
}

/* ============================================================
   RESET & BASE
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  transition: background 0.2s, color 0.2s;
  padding-top: var(--nav-h);
}

img, video { max-width: 100%; display: block; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); text-decoration: underline; }

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-mono);
  line-height: 1.3;
  color: var(--text);
  font-weight: 600;
}

code, kbd, samp, pre {
  font-family: var(--font-mono);
  font-size: 0.875em;
}

pre {
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  overflow-x: auto;
}

code:not(pre code) {
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 0.1em 0.35em;
}

blockquote {
  border-left: 3px solid var(--accent);
  padding-left: 1rem;
  color: var(--text-muted);
  font-style: italic;
  margin: 1.5rem 0;
}

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

/* ============================================================
   LAYOUT
   ============================================================ */
.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 1.5rem;
}

.page-body {
  padding: 3rem 0 5rem;
}

/* ============================================================
   NAVIGATION
   ============================================================ */
.site-nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-h);
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  z-index: 100;
  transition: background 0.2s, border-color 0.2s;
}

.site-nav .container {
  height: 100%;
  display: flex;
  align-items: center;
  gap: 0;
}

.nav-logo {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
}
.nav-logo:hover { color: var(--accent); text-decoration: none; }
.nav-logo .prompt { color: var(--accent); }

.nav-links {
  display: flex;
  align-items: center;
  gap: 0;
  list-style: none;
  margin-left: auto;
}

.nav-links a {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-muted);
  text-decoration: none;
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius);
  transition: color 0.15s, background 0.15s;
}
.nav-links a:hover,
.nav-links a.active {
  color: var(--accent);
  background: var(--surface);
  text-decoration: none;
}

.nav-theme-toggle {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-muted);
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.3rem 0.6rem;
  cursor: pointer;
  margin-left: 0.75rem;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
  white-space: nowrap;
  flex-shrink: 0;
}
.nav-theme-toggle:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--surface);
}

/* Mobile nav toggle */
.nav-hamburger {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.4rem;
  margin-left: auto;
  color: var(--text);
}

/* ============================================================
   SECTION HEADINGS
   ============================================================ */
.section-heading {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: lowercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 2rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.section-heading::before { content: '//'; color: var(--accent); }
.section-heading::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
  margin-left: 0.5rem;
}

.page-title {
  font-family: var(--font-mono);
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}
.page-subtitle {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 3rem;
}

/* ============================================================
   TAG PILLS
   ============================================================ */
.tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: 2px;
  padding: 0.1em 0.45em;
  text-decoration: none;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
  white-space: nowrap;
}
.tag:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--surface);
  text-decoration: none;
}
.tag.active {
  color: var(--bg);
  background: var(--accent);
  border-color: var(--accent);
}

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

/* ============================================================
   PUBLICATION CARDS
   ============================================================ */
.pub-grid {
  display: grid;
  gap: 1.5rem;
  margin-bottom: 3rem;
}

.pub-card {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 1.25rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.pub-card--no-media {
  grid-template-columns: 1fr;
}
.pub-card:hover {
  border-color: var(--border-2);
  box-shadow: var(--shadow-md);
}

.pub-card-media {
  position: relative;
  width: 180px;
  height: 110px;
  border-radius: 3px;
  overflow: hidden;
  background: var(--surface-2);
  flex-shrink: 0;
}
.pub-card-media img,
.pub-card-media video {
  width: 100%; height: 100%;
  object-fit: cover;
  position: absolute;
  top: 0; left: 0;
}
.pub-card-media video { opacity: 0; transition: opacity 0.25s; }
.pub-card:hover .pub-card-media video { opacity: 1; }

.pub-card-body { min-width: 0; }

.pub-title {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.4;
  margin-bottom: 0.3rem;
  color: var(--text);
}

.pub-authors {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
}
.pub-authors .me { font-weight: 600; color: var(--text); }

.pub-venue {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 2px;
  padding: 0.05em 0.45em;
  display: inline-block;
  margin-bottom: 0.5rem;
}

.pub-awards { margin-bottom: 0.5rem; }

.award-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--accent-2);
  border: 1px solid var(--accent-2);
  border-radius: 2px;
  padding: 0.1em 0.4em;
}

.pub-links { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.75rem; }
.pub-link {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--accent);
  border: 1px solid var(--border);
  border-radius: 2px;
  padding: 0.2em 0.55em;
  text-decoration: none;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.pub-link:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  text-decoration: none;
}

/* Full publication list */
.pub-list { display: flex; flex-direction: column; gap: 0; }

.pub-list-item {
  border-bottom: 1px solid var(--border);
}
.pub-list-item:last-child { border-bottom: none; }

/* summary row */
.pub-list-item > summary {
  display: grid;
  grid-template-columns: 48px 1fr auto;
  gap: 1rem;
  padding: 0.85rem 0.25rem;
  cursor: pointer;
  list-style: none;
  align-items: start;
  transition: background 0.1s;
  border-radius: var(--radius);
}
.pub-list-item > summary::-webkit-details-marker { display: none; }
.pub-list-item > summary:hover { background: var(--surface); }

.pub-list-year {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 600;
  padding-top: 0.2rem;
  white-space: nowrap;
}

.pub-list-summary { min-width: 0; }

.pub-list-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.2rem;
  line-height: 1.4;
}

.pub-list-meta {
  font-size: 0.78rem;
  color: var(--text-muted);
  display: flex;
  flex-wrap: wrap;
  gap: 0 0.4rem;
  align-items: center;
}
.pub-list-meta .venue {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 2px;
  padding: 0.05em 0.45em;
  white-space: nowrap;
}
.pub-list-award {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--accent-2);
  border: 1px solid var(--accent-2);
  border-radius: 2px;
  padding: 0.05em 0.45em;
  white-space: nowrap;
}
.pub-list-demo-badge {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 2px;
  padding: 0.05em 0.4em;
  white-space: nowrap;
}

.pub-list-chevron {
  font-family: var(--font-mono);
  font-size: 1rem;
  color: var(--text-muted);
  transition: transform 0.2s;
  padding-top: 0.1rem;
  user-select: none;
}
.pub-list-item[open] > summary .pub-list-chevron {
  transform: rotate(90deg);
}

/* expanded body */
.pub-list-body {
  padding: 0 0.25rem 1rem calc(48px + 1rem);
}
.pub-list-authors {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
  line-height: 1.5;
}
.pub-list-authors .me { font-weight: 600; color: var(--text); }
.pub-list-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.65;
  margin-bottom: 0.75rem;
  font-style: italic;
  border-left: 2px solid var(--border);
  padding-left: 0.75rem;
}

/* ============================================================
   BLOG
   ============================================================ */
.blog-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 2.5rem;
}

.blog-feed { display: flex; flex-direction: column; gap: 0; }

.blog-item {
  display: grid;
  grid-template-columns: 100px 1fr;
  gap: 1.5rem;
  padding: 1.25rem 0;
  border-bottom: 1px solid var(--border);
}
.blog-item:last-child { border-bottom: none; }

.blog-date {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
  padding-top: 0.2rem;
  line-height: 1.3;
}

.blog-item-title {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
  display: block;
  margin-bottom: 0.3rem;
  line-height: 1.4;
}
.blog-item-title:hover { color: var(--accent); text-decoration: none; }

.blog-item-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

/* ============================================================
   BACKLOG CARDS
   ============================================================ */
.backlog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
}

.backlog-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.backlog-card:hover {
  border-color: var(--border-2);
  box-shadow: var(--shadow);
}

.backlog-status {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}
.backlog-status.idea    { color: var(--accent); }
.backlog-status.exploring { color: var(--accent-2); }
.backlog-status.paused  { color: var(--text-muted); }

.backlog-title {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.5rem;
  line-height: 1.4;
}

.backlog-desc {
  font-size: 0.83rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
  line-height: 1.6;
}

/* ============================================================
   HOME PAGE
   ============================================================ */
.hero {
  padding: 3.5rem 0 3rem;
  position: relative;
}

/* subtle dot-grid background */
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(var(--border) 1px, transparent 1px);
  background-size: 24px 24px;
  opacity: 0.6;
  pointer-events: none;
}

.hero-inner { position: relative; }

.hero-name {
  font-family: var(--font-mono);
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 0.25rem;
  line-height: 1.2;
}
.hero-name .prompt { color: var(--accent); }

.hero-role {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

.hero-bio {
  max-width: 600px;
  font-size: 0.95rem;
  line-height: 1.75;
  margin-bottom: 1.5rem;
  color: var(--text);
}

.hero-links { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 1rem; }
.hero-link {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.3rem 0.75rem;
  text-decoration: none;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}
.hero-link:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--surface);
  text-decoration: none;
}
.hero-link.primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.hero-link.primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  color: #fff;
}

/* News */
.news-list { display: flex; flex-direction: column; gap: 0; }
.news-item {
  display: grid;
  grid-template-columns: 90px 1fr;
  gap: 1rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.875rem;
}
.news-item:last-child { border-bottom: none; }
.news-date {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-muted);
  padding-top: 0.15rem;
  white-space: nowrap;
}
.news-text { color: var(--text); line-height: 1.6; }
.news-text a { color: var(--accent); }

/* Awards */
details.awards-details {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
details.awards-details summary {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  padding: 0.75rem 1rem;
  cursor: pointer;
  user-select: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  list-style: none;
  background: var(--surface);
  transition: background 0.15s;
}
details.awards-details summary:hover { background: var(--surface-2); }
details.awards-details summary::before { content: '//'; color: var(--accent); }
details.awards-details summary::-webkit-details-marker { display: none; }

.awards-list {
  padding: 0.5rem 1rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0;
}
.award-item {
  display: grid;
  grid-template-columns: 70px 1fr;
  gap: 1rem;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.85rem;
}
.award-item:last-child { border-bottom: none; }
.award-date {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-muted);
  padding-top: 0.1rem;
}
.award-name { font-weight: 600; margin-bottom: 0.1rem; }
.award-venue { font-size: 0.8rem; color: var(--text-muted); }

/* ============================================================
   DEMO EMBEDS
   ============================================================ */
.demo-container {
  margin: 2rem 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: #000;
}
.demo-canvas { width: 100%; display: block; }
.demo-caption {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
  text-align: center;
  padding: 0.5rem;
  background: var(--surface);
  border-top: 1px solid var(--border);
}

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 1.5rem 0;
  margin-top: 4rem;
}
.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-muted);
  gap: 1rem;
  flex-wrap: wrap;
}

/* ============================================================
   UTILITIES
   ============================================================ */
.hidden { display: none !important; }
.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;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 700px) {
  .nav-links { display: none; }
  .nav-links.open { display: flex; flex-direction: column; position: absolute; top: var(--nav-h); left: 0; right: 0; background: var(--bg); border-bottom: 1px solid var(--border); padding: 0.75rem 1rem; gap: 0; }
  .nav-hamburger { display: block; }
  .nav-theme-toggle { margin-left: 0.5rem; }

  .pub-card {
    grid-template-columns: 1fr;
  }
  .pub-card-media {
    width: 100%;
    height: 160px;
  }
  .blog-item {
    grid-template-columns: 1fr;
    gap: 0.5rem;
  }
  .news-item {
    grid-template-columns: 1fr;
    gap: 0.25rem;
  }
  .award-item {
    grid-template-columns: 1fr;
    gap: 0.25rem;
  }
  .pub-list-item {
    grid-template-columns: 1fr;
    gap: 0.25rem;
  }
  .hero-name { font-size: 1.5rem; }
  .backlog-grid { grid-template-columns: 1fr; }
}

/* ============================================================
   PRINT
   ============================================================ */
@media print {
  .site-nav, .site-footer, .nav-theme-toggle { display: none; }
  body { padding-top: 0; color: #000; background: #fff; }
  a { color: #000; text-decoration: underline; }
}
