
  /* ── TOKENS ── */
  :root {
    --bg:        #0e0e12;
    --bg2:       #13131a;
    --bg3:       #1a1a26;
    --border:    rgba(167,139,250,0.12);
    --border2:   rgba(167,139,250,0.22);
    --violet:    oklch(72% 0.19 280);
    --violet-dim:oklch(60% 0.14 280);
    --violet-glow: rgba(139,92,246,0.18);
    --text:      #e8e6f0;
    --text2:     #9490aa;
    --text3:     #5e5a72;
    --mono:      'JetBrains Mono', monospace;
    --display:   'Syne', sans-serif;
    --body:      'DM Sans', sans-serif;
    --radius:    6px;
    --nav-w:     220px;
  }

  /* ── LIGHT MODE ── */
  body.light {
    --bg:        #f5f4f7;
    --bg2:       #eeedf2;
    --bg3:       #e6e4ec;
    --border:    rgba(120,80,220,0.12);
    --border2:   rgba(120,80,220,0.22);
    --violet:    oklch(48% 0.20 280);
    --violet-dim:oklch(40% 0.16 280);
    --violet-glow: rgba(120,80,220,0.10);
    --text:      #18161f;
    --text2:     #4a4660;
    --text3:     #9490aa;
  }
  body.light #intro { background: #f0eef8; }
  body.light .terminal { background: #f5f4f7; box-shadow: 0 0 60px rgba(120,80,220,0.08); }
  body.light .term-bar { background: #e6e4ec; }
  body.light #sidenav { background: linear-gradient(to right, rgba(245,244,247,0.97), rgba(245,244,247,0.85)); }
  body.light .hero-query { background: var(--bg3); }
  body.light .result-table table th { color: var(--violet); }
  body, body.light { transition: background 0.3s, color 0.3s; }

  /* ── THEME TOGGLE BTN ── */
  #theme-toggle {
    width: 32px; height: 32px;
    border: 1px solid var(--border2);
    border-radius: var(--radius);
    background: transparent;
    display: flex; align-items: center; justify-content: center;
    color: var(--text3);
    cursor: pointer;
    transition: border-color 0.2s, color 0.2s, background 0.2s;
    flex-shrink: 0;
  }
  #theme-toggle:hover { border-color: var(--violet); color: var(--violet); background: var(--violet-glow); }
  #theme-toggle svg { width: 14px; height: 14px; }

  *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
  html { scroll-behavior: smooth; }
  body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--body);
    font-size: 15px;
    line-height: 1.65;
    overflow-x: hidden;
  }

  /* ── SQL INTRO OVERLAY ── */
  #intro {
    position: fixed; inset: 0; z-index: 1000;
    background: #080810;
    display: flex; align-items: center; justify-content: center;
    transition: opacity 0.8s ease, visibility 0.8s ease;
  }
  #intro.gone { opacity: 0; visibility: hidden; pointer-events: none; }

  .terminal {
    width: min(700px, 90vw);
    background: #0d0d14;
    border: 1px solid var(--border2);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 0 80px rgba(139,92,246,0.15), 0 0 0 1px rgba(139,92,246,0.08);
  }
  .term-bar {
    background: #1a1a24;
    padding: 10px 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    border-bottom: 1px solid var(--border);
  }
  .term-dot { width: 11px; height: 11px; border-radius: 50%; }
  .term-dot:nth-child(1){ background:#ff5f56; }
  .term-dot:nth-child(2){ background:#ffbd2e; }
  .term-dot:nth-child(3){ background:#27c93f; }
  .term-title {
    margin-left: auto; margin-right: auto;
    font-family: var(--mono); font-size: 11px;
    color: var(--text3); letter-spacing: 0.06em;
  }
  .term-body {
    padding: 24px 28px 28px;
    min-height: 240px;
    font-family: var(--mono);
    font-size: 13px;
    line-height: 1.9;
  }
  .term-line { display: block; white-space: pre; }
  .term-line .kw  { color: #bd93f9; }
  .term-line .fn  { color: #50fa7b; }
  .term-line .str { color: #f1fa8c; }
  .term-line .op  { color: #ff79c6; }
  .term-line .cm  { color: #6272a4; }
  .term-line .tbl { color: #8be9fd; }
  .term-line .plain { color: #ccc9e4; }
  .cursor {
    display: inline-block; width: 8px; height: 14px;
    background: var(--violet); vertical-align: middle;
    animation: blink 1s step-end infinite;
    margin-left: 2px;
  }
  @keyframes blink { 0%,100%{opacity:1} 50%{opacity:0} }

  .result-table {
    margin-top: 12px;
    border-top: 1px solid var(--border2);
    padding-top: 12px;
    opacity: 0;
    transition: opacity 0.6s ease;
  }
  .result-table.show { opacity: 1; }
  .result-table table {
    border-collapse: collapse;
    width: 100%;
    font-size: 12px;
  }
  .result-table th {
    color: var(--violet);
    font-weight: 500;
    padding: 3px 12px 3px 0;
    text-align: left;
    border-bottom: 1px solid var(--border);
  }
  .result-table td {
    color: var(--text2);
    padding: 3px 12px 3px 0;
  }
  .result-row { color: var(--text3); font-size: 11px; margin-top: 8px; }

  /* ── MAIN LAYOUT ── */
  #site { visibility: hidden; }
  #site.visible { visibility: visible; }

  /* ERD Background */
  #erd-bg {
    position: fixed; inset: 0; z-index: 0;
    pointer-events: none;
    opacity: 0.35;
  }

  /* Side Nav */
  #sidenav {
    position: fixed; left: 0; top: 0; bottom: 0;
    width: var(--nav-w);
    z-index: 100;
    display: flex; flex-direction: column;
    padding: 40px 0 40px 28px;
    border-right: 1px solid var(--border);
    background: linear-gradient(to right, rgba(14,14,18,0.97), rgba(14,14,18,0.85));
    backdrop-filter: blur(8px);
  }
  .nav-brand {
    font-family: var(--display);
    font-size: 18px; font-weight: 700;
    color: var(--text);
    letter-spacing: -0.01em;
    margin-bottom: 4px;
  }
  .nav-sub {
    font-family: var(--mono);
    font-size: 10px;
    color: var(--text3);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom: 40px;
    line-height: 1.6;
  }

  .nav-section-label {
    font-family: var(--mono);
    font-size: 9px;
    color: var(--text3);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    margin-bottom: 10px;
    margin-top: 4px;
  }

  .nav-items { display: flex; flex-direction: column; gap: 2px; }
  .nav-item {
    display: flex; align-items: center; gap: 10px;
    padding: 7px 0;
    cursor: pointer;
    text-decoration: none;
    color: var(--text3);
    font-family: var(--mono);
    font-size: 11px;
    letter-spacing: 0.04em;
    transition: color 0.2s;
    position: relative;
  }
  .nav-item::before {
    content: '';
    width: 18px; height: 1px;
    background: var(--text3);
    transition: width 0.25s, background 0.25s;
  }
  .nav-item.active, .nav-item:hover {
    color: var(--violet);
  }
  .nav-item.active::before, .nav-item:hover::before {
    background: var(--violet);
    width: 28px;
  }
  .nav-item .nav-table-badge {
    font-size: 9px;
    color: var(--text3);
    font-style: italic;
    margin-left: auto;
    padding-right: 18px;
    opacity: 0;
    transition: opacity 0.2s;
  }
  .nav-item.active .nav-table-badge { opacity: 1; color: var(--violet-dim); }

  .nav-links {
    margin-top: auto;
    display: flex; gap: 14px;
    padding-right: 18px;
  }
  .nav-link-icon {
    width: 32px; height: 32px;
    border: 1px solid var(--border2);
    border-radius: var(--radius);
    display: flex; align-items: center; justify-content: center;
    color: var(--text3);
    text-decoration: none;
    transition: border-color 0.2s, color 0.2s, background 0.2s;
  }
  .nav-link-icon:hover { border-color: var(--violet); color: var(--violet); background: var(--violet-glow); }
  .nav-link-icon svg { width: 14px; height: 14px; }

  /* ── MAIN CONTENT ── */
  #main {
    margin-left: var(--nav-w);
    padding: 0 60px 120px 60px;
    max-width: 960px;
    position: relative; z-index: 10;
  }

  section {
    min-height: 100vh;
    padding-top: 100px;
    padding-bottom: 60px;
  }
  section:first-child { padding-top: 80px; }

  /* ── SECTION HEADERS ── */
  .section-header {
    margin-bottom: 56px;
  }
  .section-kicker {
    font-family: var(--mono);
    font-size: 11px;
    color: var(--violet-dim);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    margin-bottom: 10px;
    display: flex; align-items: center; gap: 10px;
  }
  .section-kicker::after {
    content: '';
    flex: 1; height: 1px;
    background: var(--border);
    max-width: 80px;
  }
  h2.section-title {
    font-family: var(--display);
    font-size: clamp(32px, 4vw, 48px);
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.025em;
    line-height: 1.1;
  }
  .section-desc {
    margin-top: 14px;
    color: var(--text2);
    max-width: 480px;
    font-size: 15px;
  }

  /* ── HERO ── */
  #about { position: relative; }
  .hero-eyebrow {
    font-family: var(--mono);
    font-size: 12px;
    color: var(--violet-dim);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    margin-bottom: 18px;
    display: flex; align-items: center; gap: 8px;
  }
  .hero-eyebrow .dot {
    width: 6px; height: 6px; border-radius: 50%;
    background: var(--violet);
    box-shadow: 0 0 10px var(--violet);
    animation: pulse 2s ease-in-out infinite;
  }
  @keyframes pulse { 0%,100%{opacity:1;transform:scale(1)} 50%{opacity:0.5;transform:scale(0.8)} }

  h1.hero-name {
    font-family: var(--display);
    font-size: clamp(52px, 7vw, 88px);
    font-weight: 800;
    line-height: 0.95;
    letter-spacing: -0.035em;
    color: var(--text);
    margin-bottom: 20px;
  }
  h1.hero-name span {
    color: var(--violet);
    display: block;
  }
  .hero-tagline {
    font-family: var(--mono);
    font-size: 13px;
    color: var(--text2);
    margin-bottom: 40px;
    display: flex; align-items: center; gap: 8px;
    flex-wrap: wrap;
  }
  .hero-tagline .sep { color: var(--border2); }

  .hero-bio {
    max-width: 520px;
    color: var(--text2);
    font-size: 15px;
    line-height: 1.75;
    margin-bottom: 28px;
    font-weight: 300;
  }

  .hero-query {
    display: inline-block;
    background: var(--bg3);
    border: 1px solid var(--border2);
    border-radius: var(--radius);
    padding: 16px 20px;
    font-family: var(--mono);
    font-size: 12px;
    color: var(--text2);
    line-height: 1.8;
    margin-top: 8px;
  }
  .hero-query .kw  { color: #bd93f9; }
  .hero-query .fn  { color: #50fa7b; }
  .hero-query .str { color: #f1fa8c; }
  .hero-query .tbl { color: #8be9fd; }
  .hero-query .cm  { color: #6272a4; }

  /* ── ERD ENTITY BOX ── */
  .entity-box {
    border: 1px solid var(--border2);
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--bg2);
    transition: border-color 0.3s, box-shadow 0.3s;
  }
  .entity-box:hover, .entity-box.active {
    border-color: var(--violet);
    box-shadow: 0 0 20px var(--violet-glow);
  }
  .entity-header {
    background: var(--bg3);
    border-bottom: 1px solid var(--border);
    padding: 10px 16px;
    display: flex; align-items: center; gap: 8px;
  }
  .entity-icon {
    width: 20px; height: 20px;
    border-radius: 4px;
    background: var(--violet-glow);
    border: 1px solid var(--border2);
    display: flex; align-items: center; justify-content: center;
  }
  .entity-icon svg { width: 10px; height: 10px; }
  .entity-name {
    font-family: var(--mono);
    font-size: 11px;
    color: var(--violet);
    font-weight: 500;
    letter-spacing: 0.05em;
    text-transform: uppercase;
  }
  .entity-pk { margin-left: auto; font-family: var(--mono); font-size: 9px; color: var(--text3); }
  .entity-rows { padding: 0; }
  .entity-row {
    display: flex; align-items: center;
    padding: 8px 16px;
    border-bottom: 1px solid var(--border);
    gap: 12px;
  }
  .entity-row:last-child { border-bottom: none; }
  .entity-row .col-key {
    font-family: var(--mono); font-size: 11px;
    color: var(--text2); min-width: 140px;
  }
  .entity-row .col-type {
    font-family: var(--mono); font-size: 10px;
    color: var(--text3);
    background: rgba(167,139,250,0.07);
    border: 1px solid var(--border);
    border-radius: 3px;
    padding: 1px 6px;
  }
  .entity-row .col-val {
    margin-left: auto;
    font-size: 13px;
    color: var(--text);
    text-align: right;
  }
  .pk-badge {
    font-family: var(--mono); font-size: 9px;
    color: #f1fa8c;
    border: 1px solid rgba(241,250,140,0.3);
    border-radius: 3px;
    padding: 1px 5px;
  }
  .fk-badge {
    font-family: var(--mono); font-size: 9px;
    color: #8be9fd;
    border: 1px solid rgba(139,233,253,0.3);
    border-radius: 3px;
    padding: 1px 5px;
  }

  /* ── SKILLS ── */
  .skills-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
  .skill-card {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg2);
    padding: 14px 16px;
    transition: border-color 0.2s, background 0.2s, transform 0.2s;
    cursor: default;
  }
  .skill-card:hover {
    border-color: var(--violet);
    background: var(--bg3);
    transform: translateY(-2px);
  }
  .skill-name {
    font-family: var(--mono);
    font-size: 12px;
    color: var(--text);
    font-weight: 500;
    margin-bottom: 6px;
  }
  .skill-category {
    font-family: var(--mono);
    font-size: 10px;
    color: var(--text3);
    letter-spacing: 0.06em;
    text-transform: uppercase;
  }
  .skill-bar {
    margin-top: 10px;
    height: 2px;
    background: var(--border);
    border-radius: 1px;
    overflow: hidden;
  }
  .skill-bar-fill {
    height: 100%;
    background: var(--violet);
    border-radius: 1px;
    transform-origin: left;
    transform: scaleX(0);
    transition: transform 0.8s cubic-bezier(0.16,1,0.3,1);
  }
  .skill-card.visible .skill-bar-fill { transform: scaleX(1); }

  /* ── WORK EXPERIENCE ── */
  .timeline { display: flex; flex-direction: column; gap: 0; }
  .timeline-item {
    display: grid;
    grid-template-columns: 1px 1fr;
    gap: 0 28px;
    padding-bottom: 48px;
    position: relative;
  }
  .timeline-item:last-child { padding-bottom: 0; }
  .timeline-line {
    background: var(--border2);
    position: relative;
    margin-top: 4px;
  }
  .timeline-line::before {
    content: '';
    position: absolute;
    top: 4px; left: 50%;
    transform: translateX(-50%);
    width: 9px; height: 9px;
    border-radius: 50%;
    background: var(--violet);
    box-shadow: 0 0 12px var(--violet-glow);
  }
  .timeline-content {}
  .tl-period {
    font-family: var(--mono);
    font-size: 10px;
    color: var(--text3);
    letter-spacing: 0.08em;
    margin-bottom: 6px;
  }
  .tl-role {
    font-family: var(--display);
    font-size: 20px; font-weight: 600;
    color: var(--text);
    letter-spacing: -0.015em;
    margin-bottom: 2px;
  }
  .tl-company {
    font-family: var(--mono);
    font-size: 12px;
    color: var(--violet-dim);
    margin-bottom: 14px;
  }
  .tl-desc { color: var(--text2); font-size: 14px; line-height: 1.7; }
  .tl-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }

  /* ── EDUCATION ── */
  .edu-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
  .edu-card {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg2);
    padding: 20px;
    transition: border-color 0.2s;
  }
  .edu-card:hover { border-color: var(--violet); }
  .edu-degree {
    font-family: var(--display);
    font-size: 16px; font-weight: 600;
    color: var(--text); margin-bottom: 4px;
  }
  .edu-school { font-family: var(--mono); font-size: 11px; color: var(--violet-dim); margin-bottom: 4px; }
  .edu-year { font-family: var(--mono); font-size: 10px; color: var(--text3); }

  /* ── PROJECTS ── */
  .projects-grid { display: flex; flex-direction: column; gap: 20px; }
  .project-card {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg2);
    overflow: hidden;
    transition: border-color 0.25s, box-shadow 0.25s;
  }
  .project-card:hover {
    border-color: var(--violet);
    box-shadow: 0 4px 40px rgba(139,92,246,0.1);
  }
  .project-inner { padding: 24px 28px; }
  .project-title {
    font-family: var(--display);
    font-size: 20px; font-weight: 700;
    color: var(--text);
    letter-spacing: -0.015em;
    margin-bottom: 6px;
  }
  .project-subtitle {
    font-family: var(--mono);
    font-size: 11px; color: var(--violet-dim);
    margin-bottom: 14px;
  }
  .project-desc { color: var(--text2); font-size: 14px; line-height: 1.7; max-width: 560px; }
  .project-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 16px; }
  .project-bottom {
    padding: 12px 28px;
    border-top: 1px solid var(--border);
    background: var(--bg3);
    display: flex; align-items: center; gap: 12px;
  }
  .proj-type-badge {
    font-family: var(--mono); font-size: 9px;
    text-transform: uppercase; letter-spacing: 0.08em;
    color: var(--text3); padding: 2px 8px;
    border: 1px solid var(--border); border-radius: 3px;
  }
  .proj-type-badge.work { color: #8be9fd; border-color: rgba(139,233,253,0.25); }
  .proj-type-badge.personal { color: #50fa7b; border-color: rgba(80,250,123,0.25); }

  /* ── TAGS ── */
  .tag {
    display: inline-flex; align-items: center;
    font-family: var(--mono); font-size: 10px;
    padding: 3px 9px;
    border-radius: 3px;
    background: rgba(167,139,250,0.08);
    border: 1px solid var(--border);
    color: var(--text2);
    transition: border-color 0.2s, color 0.2s;
    cursor: default;
  }
  .tag:hover { border-color: var(--violet); color: var(--violet); }

  /* ── CONTACT ── */
  .contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
  .contact-card {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg2);
    padding: 20px 22px;
    display: flex; align-items: center; gap: 16px;
    text-decoration: none;
    color: var(--text);
    transition: border-color 0.2s, background 0.2s, transform 0.2s;
  }
  .contact-card:hover {
    border-color: var(--violet);
    background: var(--bg3);
    transform: translateY(-2px);
  }
  .contact-icon {
    width: 38px; height: 38px; flex-shrink: 0;
    border-radius: var(--radius);
    background: var(--violet-glow);
    border: 1px solid var(--border2);
    display: flex; align-items: center; justify-content: center;
    color: var(--violet);
  }
  .contact-icon svg { width: 17px; height: 17px; }
  .contact-label { font-family: var(--mono); font-size: 10px; color: var(--text3); text-transform: uppercase; letter-spacing: 0.08em; }
  .contact-val { font-size: 14px; color: var(--text); margin-top: 2px; }

  /* ── ERD DECORATIVE BG ── */
  #erd-bg {
    position: fixed; inset: 0; z-index: 0;
    pointer-events: none;
  }
  #erd-canvas {
    position: absolute; inset: 0;
    width: 100%; height: 100%;
  }

  /* ── SCROLL FADE ── */
  .fade-in {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.6s ease, transform 0.6s ease;
  }
  .fade-in.visible { opacity: 1; transform: translateY(0); }

  /* ── JOIN CONNECTOR ── */
  .join-line {
    display: flex; align-items: center; gap: 12px;
    margin: 32px 0;
    font-family: var(--mono); font-size: 11px;
    color: var(--text3);
  }
  .join-line::before, .join-line::after {
    content: ''; flex: 1; height: 1px;
    background: linear-gradient(to right, transparent, var(--border2));
  }
  .join-line::before { background: linear-gradient(to left, transparent, var(--border2)); }
  .join-badge {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 4px 12px;
    border: 1px solid var(--border2);
    border-radius: 20px;
    background: var(--bg2);
    color: var(--violet-dim);
    font-size: 10px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
  }

  /* ── UPLOAD BUTTON ── */
  #upload-btn {
    position: fixed;
    bottom: 28px; right: 28px;
    z-index: 200;
    display: flex; align-items: center; gap: 8px;
    padding: 10px 16px;
    background: var(--bg2);
    border: 1px solid var(--border2);
    border-radius: var(--radius);
    color: var(--text2);
    font-family: var(--mono);
    font-size: 11px;
    cursor: pointer;
    transition: border-color 0.2s, color 0.2s, background 0.2s, box-shadow 0.2s;
    letter-spacing: 0.04em;
  }
  #upload-btn:hover {
    border-color: var(--violet);
    color: var(--violet);
    background: var(--bg3);
    box-shadow: 0 4px 20px var(--violet-glow);
  }
  #upload-btn svg { width: 13px; height: 13px; flex-shrink: 0; }
  #upload-input { display: none; }

  /* Upload toast */
  #upload-toast {
    position: fixed; bottom: 80px; right: 28px;
    z-index: 201;
    background: var(--bg3);
    border: 1px solid var(--border2);
    border-radius: var(--radius);
    padding: 10px 16px;
    font-family: var(--mono); font-size: 11px;
    color: var(--text2);
    opacity: 0; pointer-events: none;
    transition: opacity 0.3s;
    max-width: 280px;
  }
  #upload-toast.show { opacity: 1; }
  #upload-toast .toast-ok { color: #50fa7b; }
  #upload-toast .toast-err { color: #ff5555; }

  /* Responsive */
  @media (max-width: 900px) {
    :root { --nav-w: 0px; }
    #sidenav { display: none; }
    #main { margin-left: 0; padding: 0 24px 80px; }
    .edu-grid, .contact-grid { grid-template-columns: 1fr; }
  }
