:root {
  --bg: #08080e;
  --surface: #0f0f18;
  --surface2: #14141f;
  --border: rgba(255,255,255,0.06);
  --border-hi: rgba(255,255,255,0.12);
  --accent: #a0f060;
  --accent2: #60a0ff;
  --accent3: #ff6eb0;
  --accent4: #ffc060;
  --text: #ddddf0;
  --muted: #5a5a72;
  --mono: 'Space Mono', monospace;
  --sans: 'Syne', sans-serif;
  --r: 16px;
  --r-sm: 10px;
}

:root.light-mode {
  --bg: #fafaf9;
  --surface: #ffffff;
  --surface2: #f3f3f1;
  --border: rgba(0,0,0,0.08);
  --border-hi: rgba(0,0,0,0.12);
  --accent: #7dc633;
  --accent2: #2563eb;
  --accent3: #ec4899;
  --accent4: #ea8b1a;
  --text: #1f2937;
  --muted: #6b7280;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  min-height: 100vh;
  overflow-x: hidden;
  transition: background-color 0.5s ease, color 0.5s ease;
}

body::after {
  content: '';
  position: fixed; inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='1'/%3E%3C/svg%3E");
  opacity: 0.022; pointer-events: none; z-index: 9999;
  transition: opacity 0.5s ease;
}

.glow { position: fixed; border-radius: 50%; filter: blur(130px); pointer-events: none; z-index: 0; }
.glow-1 { width: 700px; height: 700px; background: rgba(160,240,96,0.055); top: -250px; left: -150px; }
.glow-2 { width: 600px; height: 600px; background: rgba(96,160,255,0.055); bottom: -200px; right: -100px; }

.shell { position: relative; z-index: 1; max-width: 1380px; margin: 0 auto; padding: 22px 22px 56px; }

/* NAV */
nav {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 20px; padding: 13px 22px;
  background: var(--surface); border: 1px solid var(--border-hi);
  border-radius: var(--r); backdrop-filter: blur(12px);
  animation: fadeDown 0.5s ease both;
  transition: background-color 0.5s ease, border-color 0.5s ease;
}
.nav-logo { font-family: var(--mono); font-size: 13px; color: var(--accent); letter-spacing: 0.05em; }
.nav-links { display: flex; gap: 4px; list-style: none; }
.nav-links a {
  font-size: 11px; font-family: var(--mono); color: var(--muted);
  text-decoration: none; padding: 6px 13px; border-radius: 6px; transition: all 0.2s, color 0.5s ease;
}
.nav-links a:hover { color: var(--text); background: var(--surface2); }
.nav-status { display: flex; align-items: center; gap: 8px; font-family: var(--mono); font-size: 11px; color: var(--muted); }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 9px var(--accent); animation: pulse 2s infinite; }

/* THEME TOGGLE */
.theme-toggle {
  display: flex; align-items: center; gap: 8px;
  background: var(--surface2);
  border: 1px solid var(--border-hi);
  border-radius: 999px;
  padding: 6px 10px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: var(--mono);
  font-size: 14px;
}
.theme-toggle:hover {
  border-color: var(--accent);
  background: var(--surface);
}
.theme-toggle-icon {
  display: flex; align-items: center; justify-content: center;
  width: 20px; height: 20px;
}
.toggle-sun { display: none; }
:root.light-mode .toggle-sun { display: block; }
:root.light-mode .toggle-moon { display: none; }
.toggle-moon { display: block; }

/* BENTO */
.bento { display: grid; grid-template-columns: repeat(12, 1fr); gap: 14px; }

/* CARD */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r); padding: 26px; position: relative; overflow: hidden;
  transition: border-color 0.3s, transform 0.3s, background-color 0.5s ease, box-shadow 0.5s ease;
  animation: fadeUp 0.55s ease both;
}
.card:hover { border-color: var(--border-hi); transform: translateY(-2px); }
.card::before {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(ellipse at 0% 0%, rgba(255,255,255,0.02) 0%, transparent 60%);
  pointer-events: none;
}

.c4  { grid-column: span 4; }
.c5  { grid-column: span 5; }
.c6  { grid-column: span 6; }
.c7  { grid-column: span 7; }
.c8  { grid-column: span 8; }
.c12 { grid-column: span 12; }

.card:nth-child(1){animation-delay:.05s} .card:nth-child(2){animation-delay:.10s}
.card:nth-child(3){animation-delay:.15s} .card:nth-child(4){animation-delay:.20s}
.card:nth-child(5){animation-delay:.25s} .card:nth-child(6){animation-delay:.30s}
.card:nth-child(7){animation-delay:.35s} .card:nth-child(8){animation-delay:.40s}
.card:nth-child(9){animation-delay:.45s}

.lbl {
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--muted); margin-bottom: 16px;
  display: flex; align-items: center; gap: 8px;
}
.lbl::after { content: ''; flex: 1; height: 1px; background: var(--border-hi); }

/* HERO */
.hero {
  grid-column: span 7; min-height: 280px;
  display: flex; flex-direction: column; justify-content: space-between;
  background: linear-gradient(140deg,#0f0f1e,#080810); border-color: var(--border-hi);
}
.hero-tag {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--mono); font-size: 11px; color: var(--accent);
  background: rgba(160,240,96,0.07); border: 1px solid rgba(160,240,96,0.18);
  padding: 5px 14px; border-radius: 999px; width: fit-content; margin-bottom: 18px;
}
.hero-name {
  font-size: clamp(34px,4vw,58px); font-weight: 800;
  line-height: 1.05; letter-spacing: -0.03em; margin-bottom: 10px;
}
.hero-name span { color: var(--accent); }
.hero-role { font-family: var(--mono); font-size: 12px; color: var(--muted); margin-bottom: 22px; line-height: 1.8; }
.hero-cta { display: flex; gap: 10px; flex-wrap: wrap; }
.btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 10px 20px; border-radius: 8px;
  font-family: var(--mono); font-size: 12px; font-weight: 700;
  cursor: pointer; text-decoration: none; transition: all 0.2s; letter-spacing: 0.03em;
}
.btn-p { background: var(--accent); color: #0a0a0f; border: none; }
.btn-p:hover { background: #c2ff80; transform: scale(1.03); }
.btn-g { background: transparent; color: var(--text); border: 1px solid var(--border-hi); }
.btn-g:hover { background: var(--surface2); border-color: var(--accent2); color: var(--accent2); }
.hero-deco {
  position: absolute; right: -50px; top: -50px;
  width: 300px; height: 300px; border-radius: 50%;
  border: 1px solid rgba(160,240,96,0.07); pointer-events: none;
}
.hero-deco::after {
  content: ''; position: absolute; inset: 24px; border-radius: 50%;
  border: 1px solid rgba(160,240,96,0.04);
}

/* STATS */
.stats { grid-column: span 5; display: flex; flex-direction: column; gap: 12px; min-height: 280px; }
.stat-row {
  flex: 1; display: flex; flex-direction: column; justify-content: center;
  padding: 16px 18px; background: var(--surface2);
  border-radius: var(--r-sm); border: 1px solid var(--border); transition: border-color 0.2s;
}
.stat-row:hover { border-color: var(--border-hi); }
.stat-lbl { font-family: var(--mono); font-size: 9px; color: var(--muted); letter-spacing: 0.1em; text-transform: uppercase; margin-bottom: 5px; }
.stat-val { font-size: 26px; font-weight: 800; line-height: 1; }
.stat-sub { font-family: var(--mono); font-size: 9px; color: var(--muted); margin-top: 4px; }

/* ABOUT */
.about { grid-column: span 4; }
.about-text { font-size: 13px; line-height: 1.85; color: #8080a8; }
.contact-links { display: flex; flex-direction: column; gap: 7px; margin-top: 18px; }
.ci {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--mono); font-size: 11px; color: var(--muted);
  text-decoration: none; padding: 8px 10px; border-radius: 7px;
  transition: all 0.2s; border: 1px solid transparent;
}
.ci:hover { color: var(--text); background: var(--surface2); border-color: var(--border-hi); }
.ci-icon {
  width: 28px; height: 28px; border-radius: 7px;
  display: flex; align-items: center; justify-content: center; font-size: 14px; flex-shrink: 0;
}

/* SKILLS */
.skills { grid-column: span 8; }
.skills-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.skill-sec { font-family: var(--mono); font-size: 9px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); margin: 12px 0 6px; width: 100%; }
.skill-sec:first-child { margin-top: 0; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 14px; border-radius: 999px; font-family: var(--mono); font-size: 11px;
  border: 1px solid var(--border-hi); background: var(--surface2);
  color: var(--text); transition: all 0.2s; cursor: default;
}
.chip:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(0,0,0,0.35); }
.chip.py   { border-color: rgba(160,240,96,0.35);  color: var(--accent);  }
.chip.js   { border-color: rgba(255,192,96,0.35);  color: var(--accent4); }
.chip.fw   { border-color: rgba(96,160,255,0.35);  color: var(--accent2); }
.chip.db   { border-color: rgba(255,110,176,0.35); color: var(--accent3); }
.chip.tool { border-color: rgba(255,255,255,0.10); color: var(--muted); }

/* EXPERIENCE */
.exp { grid-column: span 5; }
.tl-item { display: flex; gap: 14px; padding: 16px 0; border-bottom: 1px solid var(--border); }
.tl-item:last-child { border-bottom: none; padding-bottom: 0; }
.tl-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 10px rgba(160,240,96,0.5); margin-top: 5px; flex-shrink: 0; }
.tl-body { flex: 1; }
.tl-role { font-size: 14px; font-weight: 700; margin-bottom: 2px; }
.tl-meta { font-family: var(--mono); font-size: 10px; color: var(--muted); margin-bottom: 8px; }
.tl-list { list-style: none; display: flex; flex-direction: column; gap: 5px; }
.tl-list li { font-size: 12px; color: #6a6a90; padding-left: 14px; position: relative; line-height: 1.55; }
.tl-list li::before { content: '→'; position: absolute; left: 0; color: var(--accent); font-size: 10px; top: 1px; }

/* EDUCATION */
.edu { grid-column: span 7; }
.edu-item {
  padding: 16px 18px; background: var(--surface2);
  border-radius: var(--r-sm); border: 1px solid var(--border);
  margin-bottom: 10px; position: relative; overflow: hidden; transition: border-color 0.2s;
}
.edu-item:last-child { margin-bottom: 0; }
.edu-item:hover { border-color: var(--border-hi); }
.edu-item::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; border-radius: 3px 0 0 3px; }
.edu-item:nth-child(1)::before { background: var(--accent2); }
.edu-item:nth-child(2)::before { background: var(--accent); }
.edu-head { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 3px; padding-left: 12px; }
.edu-deg { font-size: 13px; font-weight: 700; }
.edu-period { font-family: var(--mono); font-size: 9px; color: var(--muted); white-space: nowrap; margin-left: 10px; margin-top: 2px; }
.edu-uni { font-family: var(--mono); font-size: 10px; color: var(--muted); padding-left: 12px; margin-bottom: 10px; }
.edu-courses { display: flex; flex-wrap: wrap; gap: 5px; padding-left: 12px; }
.ctag { font-family: var(--mono); font-size: 9px; padding: 3px 8px; border-radius: 4px; background: rgba(255,255,255,0.04); color: var(--muted); border: 1px solid var(--border); }

/* PROJECTS */
.projects { grid-column: span 12; }
.proj-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); gap: 12px; }
.proj-item {
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: var(--r-sm); padding: 22px;
  transition: all 0.25s; position: relative; overflow: hidden;
}
.proj-item::after {
  content: ''; position: absolute; bottom: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  transform: scaleX(0); transform-origin: left; transition: transform 0.3s;
}
.proj-item:hover { border-color: var(--border-hi); transform: translateY(-3px); box-shadow: 0 12px 40px rgba(0,0,0,0.4); }
.proj-item:hover::after { transform: scaleX(1); }
.proj-head { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 8px; gap: 10px; }
.proj-name { font-size: 14px; font-weight: 700; margin-bottom: 2px; }
.proj-period { font-family: var(--mono); font-size: 9px; color: var(--muted); }
.proj-link {
  font-family: var(--mono); font-size: 9px; color: var(--accent2);
  text-decoration: none; padding: 4px 8px;
  border: 1px solid rgba(96,160,255,0.22); border-radius: 4px; white-space: nowrap; transition: all 0.2s; flex-shrink: 0;
}
.proj-link:hover { background: rgba(96,160,255,0.08); }
.proj-desc { font-size: 12px; color: #5e5e8a; line-height: 1.65; margin-bottom: 12px; }
.proj-bullets { list-style: none; display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; }
.proj-bullets li { font-size: 11px; color: #6868a0; padding-left: 14px; position: relative; line-height: 1.5; }
.proj-bullets li::before { content: '▸'; position: absolute; left: 0; color: var(--accent); font-size: 9px; top: 2px; }
.proj-stack { display: flex; flex-wrap: wrap; gap: 5px; }
.stag { font-family: var(--mono); font-size: 9px; padding: 3px 8px; border-radius: 4px; background: rgba(255,255,255,0.04); color: var(--muted); border: 1px solid var(--border); }

/* CERTS */
.cert { grid-column: span 12; }
.cert-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 10px; }
.cert-item {
  display: flex; gap: 13px; padding: 14px 16px;
  background: var(--surface2); border-radius: var(--r-sm);
  border: 1px solid var(--border); transition: all 0.2s;
}
.cert-item:hover { border-color: rgba(255,192,96,0.3); transform: translateY(-2px); }
.cert-icon {
  width: 40px; height: 40px; border-radius: 10px; flex-shrink: 0;
  background: rgba(255,192,96,0.08); border: 1px solid rgba(255,192,96,0.18);
  display: flex; align-items: center; justify-content: center; font-size: 19px;
}
.cert-name { font-size: 13px; font-weight: 700; margin-bottom: 3px; }
.cert-sub { font-family: var(--mono); font-size: 10px; color: var(--muted); line-height: 1.5; }

/* ANIMATIONS */
@keyframes fadeUp   { from { opacity:0; transform:translateY(20px);  } to { opacity:1; transform:translateY(0); } }
@keyframes fadeDown { from { opacity:0; transform:translateY(-10px); } to { opacity:1; transform:translateY(0); } }
@keyframes slideUp  { from { opacity:0; transform:translateY(10px); } to { opacity:1; transform:translateY(0); } }
@keyframes pulse    { 0%,100% { opacity:1; } 50% { opacity:.35; } }

::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--surface2); border-radius: 3px; }

/* RESPONSIVE */
@media (max-width: 1080px) {
  .hero  { grid-column: span 12; }
  .stats { grid-column: span 12; flex-direction: row; }
  .about { grid-column: span 5; }
  .skills{ grid-column: span 7; }
  .exp   { grid-column: span 6; }
  .edu   { grid-column: span 6; }
}

/* ASSISTANT STYLES */
.assistant-widget {
  position: fixed; bottom: 24px; right: 24px; z-index: 999;
  font-family: var(--sans);
}

.assistant-button {
  width: 50px; height: 50px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 24px; box-shadow: 0 4px 20px rgba(0,0,0,0.3);
  transition: all 0.3s ease;
}

.assistant-button:hover { transform: scale(1.1); box-shadow: 0 6px 30px rgba(0,0,0,0.4); }
.assistant-button:active { transform: scale(0.95); }

/* VOICE WIDGET */
.voice-widget {
  position: fixed; bottom: 100px; right: 24px; z-index: 1000;
}

.voice-button {
  width: 50px; height: 50px; border-radius: 50%;
  background: linear-gradient(135deg, #ff6eb0, #ffc060);
  border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 28px; box-shadow: 0 4px 20px rgba(255, 110, 176, 0.4);
  transition: all 0.3s ease;
  position: relative;
}

.voice-button:hover { transform: scale(1.12); box-shadow: 0 8px 30px rgba(255, 110, 176, 0.6); }
.voice-button:active { transform: scale(0.95); }

.voice-button.listening {
  animation: pulse-voice-float 1s infinite;
}

.voice-button.speaking {
  animation: pulse-voice-float 0.6s infinite;
}

.voice-transcript {
  position: absolute; bottom: 85px; right: 0;
  background: var(--surface); border: 1px solid var(--border-hi);
  border-radius: 12px; padding: 12px 16px;
  min-width: 200px; max-width: 300px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.3);
  font-size: 13px; color: var(--text);
  opacity: 0; visibility: hidden; transform: translateY(10px);
  transition: all 0.3s ease;
  pointer-events: none;
}

.voice-transcript.active {
  opacity: 1; visibility: visible; transform: translateY(0);
}

.voice-label {
  font-family: var(--mono); font-size: 11px; color: var(--muted);
  margin-bottom: 6px; text-transform: uppercase; letter-spacing: 0.05em;
}

@keyframes pulse-voice-float {
  0%, 100% { box-shadow: 0 4px 20px rgba(255, 110, 176, 0.4), 0 0 0 0 rgba(255, 110, 176, 0.7); }
  50% { box-shadow: 0 4px 20px rgba(255, 110, 176, 0.6), 0 0 0 12px rgba(255, 110, 176, 0); }
}

.assistant-panel {
  position: fixed; bottom: 160px; right: 24px;
  width: 380px; max-height: 520px;
  background: var(--surface); border: 1px solid var(--border-hi);
  border-radius: 16px; box-shadow: 0 12px 50px rgba(0,0,0,0.3);
  display: flex; flex-direction: column;
  opacity: 0; visibility: hidden; transform: scale(0.9) translateY(10px);
  transition: all 0.3s ease;
  overflow: hidden;
  max-height: 80vh;
}

.assistant-panel.active {
  opacity: 1; visibility: visible; transform: scale(1) translateY(0);
}

.assistant-header {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #0a0a0f; padding: 16px; font-weight: 700;
  display: flex; justify-content: space-between; align-items: center;
}

.assistant-close {
  background: none; border: none; color: #0a0a0f; cursor: pointer;
  font-size: 20px; padding: 0; width: 24px; height: 24px;
}

.assistant-messages {
  flex: 1; overflow-y: auto; padding: 12px; display: flex;
  flex-direction: column; gap: 10px;
}

.assistant-message {
  display: flex; gap: 10px; animation: slideUp 0.3s ease;
  max-width: 100%;
}

.assistant-message.bot {
  justify-content: flex-start;
}

.assistant-message.user {
  justify-content: flex-end;
}

.message-bubble {
  padding: 12px 14px; border-radius: 12px; max-width: 80%;
  word-wrap: break-word; line-height: 1.4; font-size: 13px;
}

.bot .message-bubble {
  background: var(--surface2); color: var(--text); border: 1px solid var(--border);
}

.user .message-bubble {
  background: var(--accent); color: #0a0a0f; font-weight: 500;
}

.assistant-input {
  padding: 12px; border-top: 1px solid var(--border);
  display: flex; gap: 8px;
}

.assistant-input input {
  flex: 1; border: 1px solid var(--border-hi); border-radius: 8px;
  background: var(--surface2); color: var(--text);
  padding: 10px 12px; font-family: var(--sans); font-size: 13px;
  transition: all 0.2s;
}

.assistant-input input:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 2px rgba(160,240,96,0.1);
}

.assistant-send {
  width: 36px; height: 36px; border: none; border-radius: 8px;
  background: var(--accent); color: #0a0a0f; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; transition: all 0.2s;
}

.assistant-send:hover { transform: scale(1.05); }
.assistant-send:active { transform: scale(0.95); }

.assistant-suggestions {
  display: flex; flex-direction: row; gap: 6px;
  padding: 8px 12px; flex-wrap: wrap;
  justify-content: flex-start;
}

.suggestion-chip {
  padding: 6px 10px; border-radius: 8px; border: 1px solid var(--border-hi);
  background: var(--surface2); color: var(--text); cursor: pointer;
  font-size: 11px; text-align: center; transition: all 0.2s;
  white-space: nowrap; flex: 1; min-width: 120px;
}

.suggestion-chip:hover {
  background: var(--surface); border-color: var(--accent); color: var(--accent);
}

@media (max-width: 740px) {
  .shell { padding: 12px 12px 36px; }
  .bento { grid-template-columns: 1fr; gap: 10px; }
  .hero,.stats,.about,.skills,.exp,.edu,.projects,.cert { grid-column: span 1 !important; }
  .stats { flex-direction: column; }
  .nav-links { display: none; }
  .hero-name { font-size: 32px; }
  .assistant-panel { width: calc(100vw - 32px); max-width: 380px; max-height: 55vh; }
}
