:root {
  --bg: #faf9f6;
  --text: #1c1e21;
  --muted: #687078;
  --accent: #3b5bdb;
  --accent-soft: #eef1fc;
  --card-bg: #ffffff;
  --border: #e6e4df;
  --term-bg: #1b1d23;
  --term-text: #d7dce2;
  --term-muted: #8a93a0;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Inter", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
}

.container {
  max-width: 760px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

a {
  color: var(--accent);
}

/* ---- header ---- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 5;
  background: rgba(250, 249, 246, 0.9);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
  padding: 0.9rem 0;
}

.site-header nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  font-weight: 800;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -0.01em;
}

.nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1.2rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-links a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 500;
}

.nav-links a:hover {
  color: var(--accent);
}

.nav-links a.nav-hot {
  color: var(--accent);
  font-weight: 600;
}

/* ---- hero ---- */
.hero {
  padding: 4.5rem 1.25rem 3rem;
}

.hero h1 {
  font-size: clamp(2.2rem, 6vw, 3.4rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  margin: 0 0 0.6rem;
}

.tagline {
  font-family: "JetBrains Mono", monospace;
  font-size: 1.05rem;
  color: var(--accent);
  min-height: 1.8em;
  margin: 0 0 0.4rem;
}

.cursor {
  animation: blink 1s steps(1) infinite;
}

@keyframes blink {
  50% { opacity: 0; }
}

.hero-sub {
  color: var(--muted);
  margin: 0;
}

/* ---- lab callout ---- */
.lab-callout {
  display: block;
  margin-top: 2.4rem;
  padding: 1.3rem 1.5rem;
  background: var(--accent);
  color: #fff;
  text-decoration: none;
  border-radius: 14px;
  font-size: 1.15rem;
  box-shadow: 0 10px 30px rgba(59, 91, 219, 0.28);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.lab-callout:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 36px rgba(59, 91, 219, 0.36);
}

.lab-callout strong {
  font-weight: 800;
}

.lab-callout .callout-text small {
  display: block;
  font-size: 0.8em;
  opacity: 0.85;
  margin-top: 0.25rem;
}

/* ---- sections ---- */
section {
  padding: 2.6rem 1.25rem;
}

h2 {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 0 0 1.2rem;
}

/* ---- pdf lab ---- */
.hidden {
  display: none !important;
}

.uplink-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.75rem;
  font-weight: 400;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.2rem 0.7rem;
  margin-left: 0.7rem;
  vertical-align: middle;
}

.uplink-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--muted);
}

.uplink-badge.online {
  color: #1a7f37;
  border-color: #b7e0c3;
  background: #f0faf2;
}

.uplink-badge.online .uplink-dot {
  background: #2da44e;
}

.uplink-badge.offline {
  color: #b42318;
  border-color: #f1c0bb;
  background: #fdf3f2;
}

.uplink-badge.offline .uplink-dot {
  background: #d92d20;
}

.lab-intro {
  margin: 0 0 0.4rem;
}

.lab-joke {
  color: var(--muted);
  font-style: italic;
  margin: 0 0 1.4rem;
}

/* ---- terminal ---- */
.terminal {
  background: var(--term-bg);
  color: var(--term-text);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 14px 38px rgba(28, 30, 33, 0.18);
  font-family: "JetBrains Mono", monospace;
  font-size: 0.92rem;
}

.terminal-bar {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 0.6rem 1rem;
  background: #24262e;
}

.dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
}

.dot:nth-child(1) { background: #ff5f57; }
.dot:nth-child(2) { background: #febc2e; }
.dot:nth-child(3) { background: #28c840; }

.terminal-title {
  margin-left: 0.6rem;
  color: var(--term-muted);
  font-size: 0.8rem;
}

.terminal-body {
  padding: 1.2rem 1.3rem;
}

.prompt {
  color: #7ea6ff;
}

.lab-offline p {
  color: #ffb4ab;
  margin: 0 0 1rem;
}

.btn {
  font-family: "Inter", system-ui, sans-serif;
  font-size: 0.92rem;
  font-weight: 600;
  padding: 0.55rem 1.3rem;
  border-radius: 8px;
  border: 1px solid var(--term-muted);
  background: transparent;
  color: var(--term-text);
  cursor: pointer;
  transition: background 0.15s ease;
}

.btn:hover {
  background: rgba(255, 255, 255, 0.08);
}

.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.btn-primary:hover {
  background: #3350c4;
}

.dropzone {
  display: block;
  border: 1.5px dashed var(--term-muted);
  border-radius: 10px;
  padding: 1.6rem 1rem;
  text-align: center;
  color: var(--term-muted);
  cursor: pointer;
  transition: all 0.15s ease;
  margin-bottom: 1rem;
}

.dropzone:hover,
.dropzone.dragover {
  border-color: #7ea6ff;
  color: #7ea6ff;
  background: rgba(126, 166, 255, 0.06);
}

.dropzone.indexed {
  border-style: solid;
  border-color: #2da44e;
  color: var(--term-text);
}

.dropzone.busy {
  pointer-events: none;
  opacity: 0.6;
}

.ask-form {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin-bottom: 1.2rem;
}

.ask-form input[type="text"] {
  flex: 1;
  font-family: inherit;
  font-size: 0.92rem;
  color: var(--term-text);
  background: #14161b;
  border: 1px solid #34373f;
  border-radius: 8px;
  padding: 0.6rem 0.8rem;
  outline: none;
  min-width: 0;
}

.ask-form input[type="text"]:focus {
  border-color: #7ea6ff;
}

.ask-form input[type="text"]:disabled,
.ask-form .btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.lab-log {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

.lab-log .log-q {
  color: #7ea6ff;
  margin: 0;
}

.lab-log .log-a {
  color: var(--term-text);
  margin: 0;
  white-space: pre-wrap;
  border-left: 2px solid #7ea6ff;
  padding-left: 0.8rem;
}

.lab-log .log-info {
  color: var(--term-muted);
  margin: 0;
}

.lab-log .log-err {
  color: #ffb4ab;
  margin: 0;
}

.lab-log .log-busy {
  color: var(--term-muted);
  margin: 0;
  animation: blink 1.1s steps(1) infinite;
}

.lab-log details {
  border: 1px solid #34373f;
  border-radius: 8px;
  padding: 0.5rem 0.8rem;
}

.lab-log summary {
  cursor: pointer;
  color: var(--term-muted);
  font-size: 0.82rem;
}

.lab-log .source-chunk {
  color: var(--term-muted);
  font-size: 0.8rem;
  margin: 0.6rem 0 0;
  white-space: pre-wrap;
  border-left: 2px solid #4d5360;
  padding-left: 0.7rem;
}

/* ---- skills ---- */
.skill-groups {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.4rem;
}

.skill-group h3 {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin: 0 0 0.7rem;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.chips li {
  font-size: 0.85rem;
  font-weight: 500;
  padding: 0.25rem 0.7rem;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
}

/* ---- projects ---- */
.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.2rem;
}

.project-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.4rem;
  transition: box-shadow 0.18s ease, transform 0.18s ease;
}

.project-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 26px rgba(28, 30, 33, 0.08);
}

.card-meta {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
  margin: 0 0 0.5rem;
}

.project-card h3 {
  font-size: 1.08rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 0 0 0.6rem;
}

.project-card p {
  margin: 0 0 0.8rem;
  color: var(--muted);
  font-size: 0.93rem;
}

.project-card .tech {
  font-family: "JetBrains Mono", monospace;
  color: var(--accent);
  font-size: 0.76rem;
  margin: 0;
}

.project-card .repo {
  margin: 0.6rem 0 0;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.76rem;
  word-break: break-all;
}

/* ---- timeline ---- */
.timeline {
  list-style: none;
  margin: 0;
  padding: 0;
  border-left: 2px solid var(--border);
}

.timeline li {
  position: relative;
  padding: 0 0 1.8rem 1.6rem;
}

.timeline li::before {
  content: "";
  position: absolute;
  left: -7px;
  top: 0.45em;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent);
  border: 2.5px solid var(--bg);
}

.timeline .time {
  font-family: "JetBrains Mono", monospace;
  color: var(--muted);
  font-size: 0.8rem;
}

.timeline h3 {
  font-size: 1rem;
  font-weight: 700;
  margin: 0.25rem 0 0.4rem;
}

.timeline p {
  margin: 0;
  color: var(--muted);
  font-size: 0.93rem;
}

/* ---- contact ---- */
.contact-links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.contact-links a {
  font-weight: 500;
  text-decoration: none;
}

.contact-links a:hover {
  text-decoration: underline;
}

/* ---- footer ---- */
.site-footer {
  border-top: 1px solid var(--border);
  margin-top: 3rem;
  padding: 1.6rem 0;
  color: var(--muted);
  font-size: 0.88rem;
}

@media (prefers-reduced-motion: reduce) {
  .cursor, .lab-log .log-busy {
    animation: none;
  }
  .lab-callout, .project-card {
    transition: none;
  }
  html {
    scroll-behavior: auto;
  }
}
