@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;700&display=swap');

*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* ===== Theme: Catppuccin Mocha (default) ===== */
[data-theme="catppuccin"] {
  --bg: #1e1e2e;
  --bg-terminal: #1e1e2e;
  --bg-titlebar: #181825;
  --border: #45475a;
  --text: #cdd6f4;
  --text-bright: #f5e0dc;
  --text-dim: #a6adc8;
  --prompt: #cba6f7;
  --command: #89b4fa;
  --accent: #a6e3a1;
  --link: #89dceb;
  --link-hover: #74c7ec;
  --tag-bg: #313244;
  --tag-border: #45475a;
  --venue: #fab387;
  --stars: #f9e2af;
}

/* ===== Theme: Gruvbox Dark ===== */
[data-theme="gruvbox"] {
  --bg: #282828;
  --bg-terminal: #282828;
  --bg-titlebar: #1d2021;
  --border: #504945;
  --text: #ebdbb2;
  --text-bright: #fbf1c7;
  --text-dim: #a89984;
  --prompt: #fe8019;
  --command: #83a598;
  --accent: #b8bb26;
  --link: #83a598;
  --link-hover: #8ec07c;
  --tag-bg: #3c3836;
  --tag-border: #504945;
  --venue: #fabd2f;
  --stars: #fabd2f;
}

/* ===== Theme: Dracula ===== */
[data-theme="dracula"] {
  --bg: #282a36;
  --bg-terminal: #282a36;
  --bg-titlebar: #21222c;
  --border: #44475a;
  --text: #f8f8f2;
  --text-bright: #f8f8f2;
  --text-dim: #6272a4;
  --prompt: #bd93f9;
  --command: #8be9fd;
  --accent: #50fa7b;
  --link: #8be9fd;
  --link-hover: #ff79c6;
  --tag-bg: #44475a;
  --tag-border: #6272a4;
  --venue: #ffb86c;
  --stars: #f1fa8c;
}

/* ===== Theme: Catppuccin Latte (light) ===== */
[data-theme="latte"] {
  --bg: #e6e9ef;
  --bg-terminal: #eff1f5;
  --bg-titlebar: #dce0e8;
  --border: #bcc0cc;
  --text: #4c4f69;
  --text-bright: #1e1e2e;
  --text-dim: #6c6f85;
  --prompt: #8839ef;
  --command: #1e66f5;
  --accent: #40a02b;
  --link: #04a5e5;
  --link-hover: #209fb5;
  --tag-bg: #dce0e8;
  --tag-border: #bcc0cc;
  --venue: #fe640b;
  --stars: #df8e1d;
}

html {
  font-size: 15px;
  scroll-behavior: smooth;
}

body {
  font-family: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', monospace;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  padding: 0;
  transition: background 0.3s, color 0.3s;
}

.terminal {
  max-width: 1080px;
  margin: 0 auto;
  padding: 20px;
}

/* ===== Title bar ===== */
.title-bar {
  display: flex;
  align-items: center;
  background: var(--bg-titlebar);
  border: 1px solid var(--border);
  border-bottom: none;
  border-radius: 8px 8px 0 0;
  padding: 10px 16px;
  gap: 8px;
  user-select: none;
  transition: background 0.3s, border-color 0.3s;
}

.title-bar .dots {
  display: flex;
  gap: 6px;
}

.title-bar .dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.title-bar .dot.red { background: #ff5f57; }
.title-bar .dot.yellow { background: #febc2e; }
.title-bar .dot.green { background: #28c840; }

.title-bar .title {
  flex: 1;
  text-align: center;
  color: var(--text-dim);
  font-size: 0.8rem;
}

/* Controls (theme + lang) */
.controls {
  display: flex;
  gap: 6px;
  align-items: center;
}

.controls button {
  background: var(--tag-bg);
  border: 1px solid var(--border);
  color: var(--text-dim);
  font-family: inherit;
  font-size: 0.7rem;
  padding: 2px 8px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s;
  line-height: 1.4;
}

.controls button:hover {
  color: var(--text);
  border-color: var(--prompt);
}

.controls button.active {
  color: var(--accent);
  border-color: var(--accent);
}

.controls .sep {
  color: var(--border);
  font-size: 0.7rem;
}

/* ===== Terminal body ===== */
.terminal-body {
  background: var(--bg-terminal);
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 8px 8px;
  padding: 28px 32px 36px;
  transition: background 0.3s, border-color 0.3s;
}

/* ===== Command blocks ===== */
.cmd-block {
  margin-bottom: 32px;
}

.cmd-block:last-child {
  margin-bottom: 0;
}

.prompt-line {
  display: flex;
  align-items: baseline;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.prompt {
  color: var(--prompt);
  margin-right: 8px;
  white-space: nowrap;
  font-weight: 700;
}

.command {
  color: var(--command);
  font-weight: 700;
}

.output {
  padding-left: 4px;
}

/* ===== whoami ===== */
.bio-name {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text-bright);
  margin-bottom: 6px;
}

.bio-detail {
  color: var(--text-dim);
  font-size: 0.9rem;
  line-height: 1.7;
}

.bio-detail a {
  color: var(--link);
  text-decoration: none;
}

.bio-detail a:hover {
  color: var(--link-hover);
  text-decoration: underline;
}

.interests {
  margin-top: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag {
  display: inline-block;
  background: var(--tag-bg);
  border: 1px solid var(--tag-border);
  border-radius: 4px;
  padding: 2px 10px;
  font-size: 0.75rem;
  color: var(--accent);
  transition: all 0.2s;
}

/* ===== Projects ===== */
.project-category {
  color: var(--text-dim);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-top: 18px;
  margin-bottom: 8px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--border);
}

.project-category:first-child {
  margin-top: 0;
}

.project-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2px;
}

.project-item {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 4px 0;
  font-size: 0.85rem;
}

.project-item a {
  color: var(--link);
  text-decoration: none;
  white-space: nowrap;
}

.project-item a:hover {
  color: var(--link-hover);
  text-decoration: underline;
}

.project-item .stars {
  color: var(--stars);
  font-size: 0.75rem;
  white-space: nowrap;
}

.project-item .desc {
  color: var(--text-dim);
  font-size: 0.8rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.project-item .sep {
  color: var(--border);
}

/* ===== Publications ===== */
.pub-list {
  list-style: none;
}

.pub-item {
  margin-bottom: 12px;
  font-size: 0.85rem;
  line-height: 1.5;
}

.pub-venue {
  color: var(--venue);
  font-weight: 700;
  font-size: 0.75rem;
  margin-right: 6px;
}

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

.pub-title a {
  color: var(--text);
  text-decoration: none;
}

.pub-title a:hover {
  color: var(--link-hover);
  text-decoration: underline;
}

.pub-authors {
  color: var(--text-dim);
  font-size: 0.78rem;
  margin-top: 2px;
}

.pub-authors .me {
  color: var(--accent);
  font-weight: 700;
}

/* ===== Contact ===== */
.contact-links {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 14px;
}

.contact-links a {
  color: var(--link);
  text-decoration: none;
  font-size: 0.9rem;
}

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

.contact-links .label {
  color: var(--text-dim);
}

/* ===== Blinking cursor ===== */
.cursor {
  display: inline-block;
  width: 8px;
  height: 1.1em;
  background: var(--accent);
  vertical-align: text-bottom;
  animation: blink 1s step-end infinite;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

/* ===== Responsive ===== */
@media (max-width: 640px) {
  html {
    font-size: 13px;
  }

  .terminal {
    padding: 10px;
  }

  .terminal-body {
    padding: 16px 14px 24px;
  }

  .title-bar .title {
    font-size: 0.7rem;
  }

  .title-bar {
    flex-wrap: wrap;
  }

  .controls {
    flex-wrap: wrap;
  }

  .project-item {
    flex-wrap: wrap;
  }

  .project-item .desc {
    white-space: normal;
  }

  .contact-links {
    flex-direction: column;
    gap: 8px;
  }
}
