/* ─── Reset & Base ─── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #0a0a0a;
  --bg-card: #111111;
  --bg-card-hover: #181818;
  --green: #4ade80;
  --green-dim: rgba(74,222,128,.18);
  --green-line: rgba(74,222,128,.12);
  --white: #f0f0f0;
  --white-mid: #a0a0a0;
  --white-dim: #5a5a5a;
  --accent-blue: #60a5fa;
  --accent-blue-dim: rgba(96,165,250,.15);
  --mono: 'IBM Plex Mono', monospace;
  --sans: 'Inter', sans-serif;
  --radius: 6px;
  --border: #1a1a1a;
  --border-soft: #2a2a2a;
  --surface: #1a1a1a;
  --nav-bg: rgba(10,10,10,.72);
  --nav-border: rgba(74,222,128,.08);
  --overlay-bg: rgba(0,0,0,.75);
  --subtle-hover: rgba(255,255,255,.02);
  --green-btn-text: #0a0a0a;
  --scrollbar-thumb: #222;
  --line-faint: rgba(255,255,255,0.06);
  --line-subtle: rgba(255,255,255,0.12);
  --line-medium: rgba(255,255,255,0.15);
}

[data-theme="light"] {
  --bg: #f8f8f8;
  --bg-card: #ffffff;
  --bg-card-hover: #f0f0f0;
  --green: #16a34a;
  --green-dim: rgba(22,163,74,.12);
  --green-line: rgba(22,163,74,.08);
  --white: #1a1a1a;
  --white-mid: #4a4a4a;
  --white-dim: #888888;
  --accent-blue: #2563eb;
  --accent-blue-dim: rgba(37,99,235,.1);
  --border: #e0e0e0;
  --border-soft: #d0d0d0;
  --surface: #f0f0f0;
  --nav-bg: rgba(248,248,248,.85);
  --nav-border: rgba(22,163,74,.15);
  --overlay-bg: rgba(0,0,0,.5);
  --subtle-hover: rgba(0,0,0,.03);
  --green-btn-text: #ffffff;
  --scrollbar-thumb: #ccc;
  --line-faint: rgba(0,0,0,0.06);
  --line-subtle: rgba(0,0,0,0.1);
  --line-medium: rgba(0,0,0,0.15);
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--white);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ─── Scrollbar ─── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--scrollbar-thumb); border-radius: 3px; }

/* ─── Top Nav ─── */
nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 40px;
  background: var(--nav-bg);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--nav-border);
}
.nav-logo {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--green);
  letter-spacing: .5px;
  text-decoration: none;
}
.nav-logo span { color: var(--white-dim); }
.nav-links { display: flex; gap: 28px; }
.nav-links a {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--white-dim);
  text-decoration: none;
  letter-spacing: .8px;
  text-transform: lowercase;
  transition: color .2s;
  position: relative;
}
.nav-links a::after {
  content: '';
  position: absolute; bottom: -4px; left: 0;
  width: 0; height: 1px;
  background: var(--green);
  transition: width .3s;
}
.nav-links a:hover { color: var(--green); }
.nav-links a:hover::after { width: 100%; }

/* ─── Theme Toggle ─── */
.theme-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--white-dim);
  background: transparent;
  border: 1px solid var(--border-soft);
  border-radius: 20px;
  padding: 5px 12px;
  cursor: pointer;
  transition: all .25s;
  letter-spacing: .5px;
  margin-left: 8px;
}
.theme-toggle:hover {
  color: var(--green);
  border-color: var(--green);
}
.theme-icon { flex-shrink: 0; }
#theme-icon-moon { display: none; }
[data-theme="light"] #theme-icon-sun { display: none; }
[data-theme="light"] #theme-icon-moon { display: block; }

/* ─── Page Sections ─── */
.page { display: none; min-height: 100vh; padding: 100px 40px 60px; }
.page.active { display: block; }

/* ─── HERO / INDEX ─── */
.hero {
  max-width: 780px;
  margin: 0 auto;
  padding-top: 20px;
}

.terminal-line {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--green);
  margin-bottom: 36px;
  display: flex; align-items: center; gap: 8px;
}
.terminal-line .prompt { color: var(--white-dim); }
.cursor {
  display: inline-block; width: 8px; height: 14px;
  background: var(--green);
  animation: blink 1.1s step-end infinite;
  vertical-align: middle;
}
@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

.hero-headline {
  font-family: var(--sans);
  font-size: clamp(36px, 5.5vw, 58px);
  font-weight: 300;
  line-height: 1.15;
  letter-spacing: -1.5px;
  color: var(--white);
  margin-bottom: 28px;
}
.hero-headline em {
  font-style: normal;
  color: var(--green);
  font-weight: 400;
}

.hero-sub {
  font-size: 15px;
  color: var(--white-dim);
  max-width: 680px;
  line-height: 1.7;
  margin-bottom: 28px;
}

.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 32px; }
.btn {
  font-family: var(--mono);
  font-size: 12px;
  padding: 10px 22px;
  border-radius: var(--radius);
  text-decoration: none;
  border: 1px solid;
  cursor: pointer;
  transition: all .25s;
  letter-spacing: .6px;
}
.btn-primary {
  background: var(--green);
  color: var(--green-btn-text);
  border-color: var(--green);
  font-weight: 600;
}
.btn-primary:hover { background: #22c55e; border-color: #22c55e; box-shadow: 0 0 24px rgba(74,222,128,.25); }
.btn-outline {
  background: transparent;
  color: var(--white-mid);
  border-color: var(--border-soft);
}
.btn-outline:hover { border-color: var(--green); color: var(--green); }

/* Meta row */
.meta-row { display: flex; gap: 40px; flex-wrap: wrap; }
.meta-item { display: flex; flex-direction: column; gap: 4px; }
.meta-label {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--white-dim);
  text-transform: lowercase;
  letter-spacing: 1px;
}
.meta-value {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--white-mid);
}
.meta-value a { color: var(--white-mid); text-decoration: none; transition: color .2s; }
.meta-value a:hover { color: var(--green); }

/* ─── EXPERIENCE PAGE ─── */
.exp-header { max-width: 780px; margin: 0 auto 56px; }
.page-title-row { display: flex; align-items: center; gap: 16px; margin-bottom: 12px; }
.page-title {
  font-family: var(--sans);
  font-size: clamp(28px, 4vw, 42px);
  font-weight: 300;
  letter-spacing: -1px;
  color: var(--white);
}
.page-tag {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--green);
  background: var(--green-dim);
  padding: 3px 10px;
  border-radius: 20px;
  letter-spacing: .8px;
}
.page-subtitle {
  font-size: 14px;
  color: var(--white-dim);
  max-width: 500px;
}

.exp-grid { max-width: 780px; margin: 0 auto; display: flex; flex-direction: column; gap: 2px; }

.exp-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 32px;
  position: relative;
  transition: background .25s, border-color .25s;
  cursor: default;
}
.exp-card:hover { background: var(--bg-card-hover); border-color: #252525; }

.exp-card-top { display: flex; justify-content: space-between; align-items: flex-start; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.exp-company {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 600;
  color: var(--white);
  letter-spacing: .3px;
}
.exp-date {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--white-dim);
}
.exp-role {
  font-size: 15px;
  font-weight: 500;
  color: var(--green);
  margin-bottom: 4px;
}
.exp-location {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--white-dim);
  margin-bottom: 14px;
}
.exp-bullets { list-style: none; display: flex; flex-direction: column; gap: 7px; }
.exp-bullets li {
  font-size: 13px;
  color: var(--white-mid);
  line-height: 1.6;
  padding-left: 16px;
  position: relative;
}
.exp-bullets li::before {
  content: '›';
  position: absolute; left: 0;
  color: var(--green);
  font-weight: 600;
}

.exp-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 16px; }
.tag {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--white-dim);
  background: var(--surface);
  padding: 3px 9px;
  border-radius: 3px;
  letter-spacing: .5px;
}

/* ─── PROJECTS PAGE ─── */
.proj-grid { max-width: 780px; margin: 0 auto; display: grid; grid-template-columns: 1fr 1fr; gap: 2px; }
@media (max-width: 600px) { .proj-grid { grid-template-columns: 1fr; } }

.proj-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 24px;
  transition: background .25s, border-color .25s;
}
.proj-card:hover { background: var(--bg-card-hover); border-color: #252525; }
.proj-card-label {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--green);
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-bottom: 10px;
}
.proj-card-title {
  font-size: 17px;
  font-weight: 500;
  color: var(--white);
  margin-bottom: 10px;
  line-height: 1.35;
}
.proj-card-desc {
  font-size: 13px;
  color: var(--white-dim);
  line-height: 1.6;
  margin-bottom: 16px;
}

/* ─── BLOG PAGE ─── */
.blog-list {
  max-width: 780px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
}
.blog-row {
  display: flex;
  align-items: flex-start;
  gap: 24px;
  padding: 22px 0;
  border-bottom: 1px solid var(--border);
  transition: background .2s;
}
.blog-row:first-child { border-top: 1px solid var(--border); }
.blog-row:hover { background: var(--subtle-hover); }
.blog-row-date {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--white-dim);
  letter-spacing: .5px;
  flex-shrink: 0;
  width: 64px;
  padding-top: 3px;
}
.blog-row-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.blog-row-title {
  font-size: 15px;
  font-weight: 500;
  color: var(--white);
  transition: color .2s;
  cursor: pointer;
}
.blog-row:hover .blog-row-title { color: var(--green); }
.blog-row-preview {
  font-size: 13px;
  color: var(--white-dim);
  line-height: 1.5;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.blog-row-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 4px;
}
.blog-row-tags {
  display: flex;
  gap: 6px;
}
.blog-row-links {
  display: flex;
  gap: 4px;
  margin-left: auto;
}
.blog-row-links a {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--white-dim);
  text-decoration: none;
  letter-spacing: .3px;
  padding: 2px 7px;
  border-radius: 3px;
  transition: color .2s, background .2s;
}
.blog-row-links a:hover {
  color: var(--green);
  background: var(--green-dim);
}
.blog-row-arrow {
  font-family: var(--mono);
  font-size: 18px;
  color: var(--white-dim);
  flex-shrink: 0;
  padding-top: 1px;
  cursor: pointer;
  transition: color .2s, transform .2s;
}
.blog-row:hover .blog-row-arrow {
  color: var(--green);
  transform: translateX(3px);
}

@media (max-width: 600px) {
  .blog-row { gap: 16px; padding: 18px 0; }
  .blog-row-date { width: 52px; font-size: 10px; }
  .blog-row-title { font-size: 14px; }
  .blog-row-preview { font-size: 12px; }
  .blog-row-tags { display: none; }
  .blog-row-links { margin-left: 0; }
}

/* Article Modal Overlay */
.article-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: var(--overlay-bg);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  overflow-y: auto;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s;
}
.article-overlay.open {
  opacity: 1;
  pointer-events: auto;
}
.article-modal {
  position: relative;
  width: 100%;
  max-width: 720px;
  margin: 80px 20px 60px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 48px 40px;
  transform: translateY(20px);
  transition: transform .25s;
}
.article-overlay.open .article-modal {
  transform: translateY(0);
}
.article-close {
  position: absolute;
  top: 16px;
  right: 20px;
  background: none;
  border: none;
  color: var(--white-dim);
  font-size: 28px;
  cursor: pointer;
  line-height: 1;
  transition: color .2s;
}
.article-close:hover { color: var(--green); }

/* Article Body Typography */
.article-body h2 {
  font-family: var(--sans);
  font-size: 28px;
  font-weight: 400;
  color: var(--white);
  margin-bottom: 20px;
  line-height: 1.3;
}
.article-body h3 {
  font-family: var(--sans);
  font-size: 18px;
  font-weight: 500;
  color: var(--white);
  margin: 28px 0 12px;
}
.article-body p {
  font-size: 14px;
  color: var(--white-mid);
  line-height: 1.75;
  margin-bottom: 16px;
}
.article-body ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}
.article-body ul li {
  font-size: 14px;
  color: var(--white-mid);
  line-height: 1.65;
  padding-left: 16px;
  position: relative;
}
.article-body ul li::before {
  content: '›';
  position: absolute;
  left: 0;
  color: var(--green);
  font-weight: 600;
}
.article-body pre {
  background: #0d0d0d;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  overflow-x: auto;
  margin-bottom: 16px;
}
.article-body code {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--green);
}
.article-body p code {
  background: var(--surface);
  padding: 2px 6px;
  border-radius: 3px;
}
.article-body blockquote {
  border-left: 3px solid var(--green);
  padding: 12px 20px;
  margin: 24px 0;
  background: var(--green-dim);
  border-radius: 0 var(--radius) var(--radius) 0;
}
.article-body blockquote p {
  color: var(--white);
  margin: 0;
  font-style: italic;
}
.article-body .proj-card-label {
  margin-bottom: 12px;
}

@media (max-width: 600px) {
  .article-modal {
    margin: 60px 12px 40px;
    padding: 36px 20px;
  }
  .article-body h2 { font-size: 22px; }
}

/* ─── SKILLS PAGE ─── */
.skills-layout { max-width: 780px; margin: 0 auto; }

/* Spacing when skills-layout follows network wrapper */
.skills-network-wrapper + .skills-layout {
  margin-top: 80px;
  padding-top: 40px;
  border-top: 1px solid var(--line-faint);
}
.skills-section { margin-bottom: 40px; }
.skills-section-title {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--green);
  letter-spacing: 1.2px;
  text-transform: uppercase;
  margin-bottom: 14px;
  display: flex; align-items: center; gap: 10px;
}
.skills-section-title::after {
  content: '';
  flex: 1; height: 1px;
  background: linear-gradient(90deg, var(--green-line), transparent);
}

.skills-tags { display: flex; flex-wrap: wrap; gap: 7px; }
.skill-tag {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--white-mid);
  background: var(--bg-card);
  border: 1px solid #1e1e1e;
  padding: 6px 14px;
  border-radius: var(--radius);
  transition: all .2s;
}
.skill-tag:hover { border-color: var(--green); color: var(--green); background: var(--green-dim); }

/* ─── EDUCATION ─── */
.edu-grid { max-width: 780px; margin: 0 auto; display: flex; flex-direction: column; gap: 2px; }
.edu-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 32px;
  display: flex; justify-content: space-between; align-items: flex-start; flex-wrap: wrap; gap: 12px;
  transition: background .25s;
}
.edu-card:hover { background: var(--bg-card-hover); }
.edu-name { font-size: 15px; font-weight: 500; color: var(--white); margin-bottom: 3px; }
.edu-degree { font-size: 13px; color: var(--white-mid); margin-bottom: 3px; }
.edu-loc { font-family: var(--mono); font-size: 11px; color: var(--white-dim); }
.edu-right { text-align: right; }
.edu-date { font-family: var(--mono); font-size: 11px; color: var(--white-dim); margin-bottom: 4px; }
.edu-gpa { font-family: var(--mono); font-size: 12px; color: var(--green); }

/* ─── FOOTER ─── */
footer {
  max-width: 780px;
  margin: 40px auto 0;
  padding: 32px 0 40px;
  border-top: 1px solid var(--border);
  display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px;
}
.footer-left {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--white-dim);
}
.footer-left a { color: var(--white-dim); text-decoration: none; transition: color .2s; }
.footer-left a:hover { color: var(--green); }
.footer-right {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--white-dim);
}

/* ─── Animations on load ─── */
.fade-up {
  opacity: 0;
  transform: translateY(18px);
  animation: fadeUp .5s cubic-bezier(.22,1,.36,1) forwards;
}
@keyframes fadeUp {
  to { opacity: 1; transform: translateY(0); }
}
.delay-1 { animation-delay: .08s; }
.delay-2 { animation-delay: .16s; }
.delay-3 { animation-delay: .24s; }
.delay-4 { animation-delay: .32s; }
.delay-5 { animation-delay: .40s; }

/* ─── Responsive ─── */
@media (max-width: 600px) {
  nav { padding: 16px 20px; }
  .nav-links { gap: 16px; }
  .theme-toggle { padding: 4px 8px; font-size: 10px; gap: 4px; }
  #theme-label { display: none; }
  .page { padding: 100px 20px 60px; }
  .exp-card, .proj-card { padding: 22px 18px; }
  .edu-card { 
    padding: 20px 18px; 
    flex-direction: column; 
    gap: 8px; 
  }
  .edu-right { 
    text-align: left; 
    display: flex; 
    gap: 12px; 
    align-items: center; 
  }
  .edu-date { margin-bottom: 0; }
  footer { padding: 28px 0 36px; }
}

/* ─── AI CHAT SECTION ─── */
.chat-section {
  margin-bottom: 48px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.chat-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  background: var(--green-dim);
}
.chat-header-icon {
  font-family: var(--mono);
  font-size: 14px;
  color: var(--green);
}
.chat-header-title {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--white);
  letter-spacing: .5px;
}
.chat-messages {
  height: 220px;
  overflow-y: auto;
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.chat-message {
  max-width: 85%;
  padding: 10px 14px;
  border-radius: var(--radius);
  font-size: 13px;
  line-height: 1.5;
}
.chat-message.bot {
  align-self: flex-start;
  background: var(--surface);
  color: var(--white-mid);
  border-left: 2px solid var(--green);
}
.chat-message.user {
  align-self: flex-end;
  background: var(--green);
  color: var(--green-btn-text);
}
.chat-quick-replies {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 20px 12px;
}
.chat-quick-btn {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--white-dim);
  background: transparent;
  border: 1px solid var(--border-soft);
  padding: 6px 12px;
  border-radius: 20px;
  cursor: pointer;
  transition: all .2s;
}
.chat-quick-btn:hover {
  border-color: var(--green);
  color: var(--green);
  background: var(--green-dim);
}
.chat-input-row {
  display: flex;
  gap: 10px;
  padding: 12px 20px;
  border-top: 1px solid var(--border);
  background: var(--subtle-hover);
}
.chat-input {
  flex: 1;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--white);
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 10px 14px;
  outline: none;
  transition: border-color .2s;
}
.chat-input::placeholder { color: var(--white-dim); }
.chat-input:focus { border-color: var(--green); }
.chat-send {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--green-btn-text);
  background: var(--green);
  border: none;
  border-radius: var(--radius);
  padding: 10px 18px;
  cursor: pointer;
  font-weight: 600;
  transition: all .2s;
}
.chat-send:hover { background: #22c55e; box-shadow: 0 0 16px rgba(74,222,128,.25); }
.chat-typing {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 10px 14px;
  background: var(--surface);
  border-radius: var(--radius);
  border-left: 2px solid var(--green);
  align-self: flex-start;
}
.chat-typing span {
  width: 6px;
  height: 6px;
  background: var(--white-dim);
  border-radius: 50%;
  animation: typingDot 1.4s infinite;
}
.chat-typing span:nth-child(2) { animation-delay: .2s; }
.chat-typing span:nth-child(3) { animation-delay: .4s; }
@keyframes typingDot {
  0%, 60%, 100% { opacity: .3; transform: scale(1); }
  30% { opacity: 1; transform: scale(1.2); }
}

/* ─── LLM Toggle & Progress ─── */
.llm-toggle {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--green);
  background: transparent;
  border: 1px solid var(--green);
  border-radius: 20px;
  padding: 4px 12px;
  cursor: pointer;
  transition: all .25s;
  text-transform: uppercase;
  letter-spacing: .5px;
  white-space: nowrap;
}
.llm-toggle:hover:not(:disabled) {
  background: var(--green);
  color: var(--green-btn-text);
}
.llm-toggle:disabled {
  opacity: .5;
  cursor: not-allowed;
}
.llm-toggle.active {
  background: var(--green);
  color: var(--green-btn-text);
  border-color: var(--green);
}

.llm-progress {
  display: none;
  height: 2px;
  background: var(--surface);
  overflow: hidden;
}
.llm-progress-fill {
  height: 100%;
  width: 0%;
  background: var(--green);
  transition: width .3s ease;
}

/* ─── Streaming Cursor ─── */
.chat-message.streaming {
  min-height: 20px;
}
.stream-cursor {
  display: inline-block;
  width: 7px;
  height: 14px;
  background: var(--green);
  margin-left: 2px;
  vertical-align: text-bottom;
  animation: streamBlink .6s step-end infinite;
}
@keyframes streamBlink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

.chat-message.llm-error {
  border-left-color: #ef4444;
  color: #f87171;
}

@media (max-width: 600px) {
  .chat-messages { height: 200px; }
  .chat-message { max-width: 90%; }
  .llm-toggle { font-size: 9px; padding: 3px 8px; }
}

/* ─── SKILLS NETWORK - Agentic Style ─── */

/* Skills Network Wrapper */
.skills-network-wrapper {
  position: relative;
  width: 100%;
  min-height: calc(100vh - 160px);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Corner Brackets */
.corner-bracket {
  position: absolute;
  width: 24px;
  height: 24px;
  border: 1px solid var(--line-medium);
  pointer-events: none;
  z-index: 50;
}
.corner-bracket.top-left {
  top: 0;
  left: 0;
  border-right: none;
  border-bottom: none;
}
.corner-bracket.top-right {
  top: 0;
  right: 0;
  border-left: none;
  border-bottom: none;
}
.corner-bracket.bottom-left {
  bottom: 0;
  left: 0;
  border-right: none;
  border-top: none;
}
.corner-bracket.bottom-right {
  bottom: 0;
  right: 0;
  border-left: none;
  border-top: none;
}

/* Floating Labels Container */
.floating-labels {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 10;
}

/* Individual Floating Label */
.floating-label {
  position: absolute;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--white-dim);
  padding: 6px 14px;
  border: 1px solid var(--line-subtle);
  background: rgba(17,17,17,0.95);
  border-radius: 3px;
  transition: transform 0.15s ease-out, background 0.2s ease, color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  pointer-events: auto;
  cursor: default;
  white-space: nowrap;
  transform: translate(-50%, -50%);
  opacity: 1;
  will-change: transform;
}
.floating-label.highlighted {
  background: var(--white);
  color: var(--bg);
  border-color: var(--white);
  box-shadow: 0 0 24px var(--line-medium);
  z-index: 20;
}

/* Category color indicators on labels */
.floating-label::before {
  content: '';
  position: absolute;
  left: -1px;
  top: -1px;
  bottom: -1px;
  width: 3px;
  border-radius: 2px 0 0 2px;
}
.floating-label[data-category="languages"]::before { background: var(--green); }
.floating-label[data-category="cloud"]::before { background: #60a5fa; }
.floating-label[data-category="data"]::before { background: #f59e0b; }
.floating-label[data-category="ai"]::before { background: #a855f7; }
.floating-label[data-category="databases"]::before { background: #ec4899; }
.floating-label[data-category="research"]::before { background: #6b7280; }

/* Label animation handled by JS */

/* Connecting Lines SVG */
.connecting-lines {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
  overflow: visible;
}
.connecting-lines .connecting-line {
  stroke: var(--line-subtle);
  stroke-width: 1;
  transition: stroke 0.25s ease, stroke-width 0.25s ease;
}
.connecting-lines .connecting-line.highlighted {
  stroke: rgba(74,222,128,0.6);
  stroke-width: 2;
}
/* Category-specific line colors on hover */
.connecting-lines .connecting-line[data-category="languages"].highlighted { stroke: rgba(74,222,128,0.6); }
.connecting-lines .connecting-line[data-category="cloud"].highlighted { stroke: rgba(96,165,250,0.6); }
.connecting-lines .connecting-line[data-category="data"].highlighted { stroke: rgba(245,158,11,0.6); }
.connecting-lines .connecting-line[data-category="ai"].highlighted { stroke: rgba(168,85,247,0.6); }
.connecting-lines .connecting-line[data-category="databases"].highlighted { stroke: rgba(236,72,153,0.6); }
.connecting-lines .connecting-line[data-category="research"].highlighted { stroke: rgba(107,114,128,0.6); }

/* Skills Center Content */
.skills-center {
  position: relative;
  z-index: 20;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.skills-title {
  font-family: var(--sans);
  font-size: clamp(32px, 5vw, 48px);
  font-weight: 300;
  letter-spacing: -1px;
  color: var(--white);
  margin: 0;
}

.skills-subtitle {
  font-size: 14px;
  color: var(--white-dim);
  max-width: 400px;
  margin: 0;
}

/* Pixel Grid */
.pixel-grid {
  display: grid;
  grid-template-columns: repeat(5, 8px);
  gap: 3px;
  margin-bottom: 12px;
}
.pixel-grid .pixel {
  width: 8px;
  height: 8px;
  background: var(--green);
  opacity: 0.3;
  transition: opacity 0.4s ease;
}

/* Skills Legend */
.skills-legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 16px;
  margin-top: 24px;
  padding: 16px 24px;
  background: var(--subtle-hover);
  border: 1px solid var(--line-faint);
  border-radius: var(--radius);
}
.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--white-dim);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

/* ─── Skills Network Responsive ─── */
@media (max-width: 1024px) {
  .floating-label {
    font-size: 10px;
    padding: 5px 10px;
  }
  .corner-bracket {
    width: 18px;
    height: 18px;
  }
}

@media (max-width: 768px) {
  .skills-network-wrapper {
    min-height: auto;
    padding: 40px 0;
  }
  .floating-labels,
  .connecting-lines,
  .corner-bracket {
    display: none;
  }
  .skills-legend {
    gap: 12px;
    padding: 12px 16px;
  }
  .legend-item {
    font-size: 9px;
  }
}
