:root {
  --bg: #0d1117;
  --bg-secondary: #161b22;
  --surface: #1c2333;
  --surface-hover: #21293a;
  --border: #21303f;
  --border-subtle: #192030;
  --accent: #58a6ff;
  --accent-dim: rgba(88, 166, 255, 0.1);
  --text: #e6edf3;
  --text-muted: #8b949e;
  --text-dim: #3d4f6b;
  --header-h: 60px;
  /* JSON syntax colors */
  --json-key: #79c0ff;
  --json-str: #a5d6ff;
  --json-num: #79c0ff;
  --json-bool: #ff7b72;
  --json-null: #ff7b72;
  --json-brace: #e6edf3;
  --json-bracket: #d2a8ff;
  --json-comma: #8b949e;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

a { color: inherit; text-decoration: none; }

/* ─── TOP HEADER ────────────────────────────────────────────── */

.top-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--header-h);
  background: rgba(13, 17, 23, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  z-index: 500;
  display: flex;
  align-items: center;
}

.header-inner {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.header-logo {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 8px;
}

.header-logo span {
  display: inline-block;
  width: 30px; height: 30px;
  background: var(--accent);
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 700;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  letter-spacing: 0;
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 4px;
}

.header-nav a {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-muted);
  padding: 6px 12px;
  border-radius: 6px;
  transition: color 0.15s, background 0.15s;
}

.header-nav a:hover,
.header-nav a.active {
  color: var(--text);
  background: var(--surface);
}

.hamburger-btn {
  display: none;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.1rem;
  cursor: pointer;
  padding: 6px 8px;
  border-radius: 6px;
  transition: color 0.15s;
  font-family: inherit;
}

.hamburger-btn:hover { color: var(--text); }

/* Mobile drawer */
.mobile-drawer {
  display: none;
  position: fixed;
  top: var(--header-h); left: 0; right: 0;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  padding: 12px 20px 20px;
  flex-direction: column;
  gap: 2px;
  z-index: 400;
}

.mobile-drawer.open { display: flex; }

.mobile-drawer a {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-muted);
  padding: 10px 12px;
  border-radius: 6px;
  transition: all 0.15s;
}

.mobile-drawer a:hover { color: var(--text); background: var(--surface); }

/* ─── MAIN ──────────────────────────────────────────────────── */

main {
  padding-top: var(--header-h);
}

section {
  max-width: 1100px;
  margin: 0 auto;
  padding: 80px 40px;
  border-bottom: 1px solid var(--border-subtle);
  scroll-margin-top: var(--header-h);
}

.section-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--accent);
  margin-bottom: 36px;
}

.section-tag::before {
  content: '';
  display: block;
  width: 16px; height: 1px;
  background: var(--accent);
}

/* ─── HERO ──────────────────────────────────────────────────── */

#about {
  min-height: calc(100vh - var(--header-h));
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--border-subtle);
  padding: 60px 40px;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 80px;
  align-items: center;
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
}

/* Left side */
.hero-left {
  display: flex;
  flex-direction: column;
}

.hero-photo-wrap {
  position: relative;
  width: fit-content;
  margin-bottom: 24px;
}

.hero-photo {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  object-fit: cover;
  object-position: top center;
  border: 2px solid var(--border);
  display: block;
}

.hero-photo-badge {
  position: absolute;
  bottom: 0; right: 0;
  background: var(--accent);
  color: #fff;
  font-size: 0.6rem;
  font-weight: 700;
  width: 24px; height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  letter-spacing: 0;
  border: 2px solid var(--bg);
}

.hero-greeting {
  font-size: 1.1rem;
  color: var(--text-muted);
  margin-bottom: 4px;
  font-weight: 400;
}

.hero-name {
  font-size: 3rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.04em;
  line-height: 1.0;
  margin-bottom: 6px;
}

.hero-name .accent { color: var(--accent); }

.hero-title {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 20px;
  line-height: 1.2;
}

.hero-bio {
  font-size: 0.875rem;
  line-height: 1.85;
  color: var(--text-muted);
  max-width: 480px;
  margin-bottom: 32px;
}

.hero-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 28px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 10px 18px;
  border-radius: 6px;
  font-size: 0.82rem;
  font-weight: 500;
  transition: all 0.15s;
  cursor: pointer;
  border: none;
  font-family: inherit;
  line-height: 1;
}

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

.btn-primary:hover { background: #4090e0; }

.btn-outline {
  border: 1px solid var(--border);
  color: var(--text-muted);
  background: transparent;
}

.btn-outline:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-dim);
}

.hero-social {
  display: flex;
  gap: 16px;
}

.hero-social-icon {
  color: var(--text-dim);
  font-size: 1.1rem;
  transition: color 0.15s;
}

/* org logos inline with company / school name */
.org-logo {
  height: 20px;
  width: 20px;
  object-fit: contain;
  border-radius: 3px;
  vertical-align: middle;
  margin-right: 4px;
  flex-shrink: 0;
}

.hero-social-icon:hover { color: var(--accent); }

/* ─── JSON PANEL ────────────────────────────────────────────── */

.json-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
}

.json-panel-titlebar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
}

.traffic-lights {
  display: flex;
  gap: 6px;
}

.tl {
  width: 12px; height: 12px;
  border-radius: 50%;
  display: block;
}

.tl-red    { background: #ff5f57; }
.tl-yellow { background: #ffbd2e; }
.tl-green  { background: #28c840; }

.json-panel-filename {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
  flex: 1;
  text-align: center;
  margin-right: 52px; /* offset for traffic lights */
}

.json-panel-body {
  padding: 20px 24px 24px;
  overflow-x: auto;
}

.json-code {
  font-family: 'SF Mono', 'Fira Code', 'Consolas', 'Courier New', monospace;
  font-size: 0.82rem;
  line-height: 1.9;
  white-space: pre;
  color: var(--text);
}

.jk  { color: var(--json-key);     } /* key */
.js  { color: var(--json-str);     } /* string value */
.jn  { color: #d2a8ff;             } /* number */
.jb  { color: var(--json-bool);    } /* boolean/null */
.jbr { color: #e6edf3;             } /* brace / bracket */
.jco { color: var(--json-comma);   } /* comma, colon */
.jlb { color: #d2a8ff;             } /* array bracket */
.jln { color: #3d4f6b; user-select: none; } /* line numbers */

/* ─── EXPERIENCE ────────────────────────────────────────────── */

.exp-item {
  padding: 28px 0;
  border-bottom: 1px solid var(--border-subtle);
}

.exp-item:last-child  { border-bottom: none; padding-bottom: 0; }
.exp-item:first-child { padding-top: 0; }

.exp-meta {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 4px;
}

.exp-company {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  transition: color 0.15s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.exp-company:hover { color: var(--accent); }

.exp-date {
  font-size: 0.72rem;
  color: var(--text-dim);
  white-space: nowrap;
  padding: 3px 10px;
  border: 1px solid var(--border);
  border-radius: 20px;
  flex-shrink: 0;
  margin-top: 2px;
}

.exp-role {
  font-size: 0.75rem;
  color: var(--accent);
  font-weight: 500;
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.exp-desc {
  font-size: 0.875rem;
  line-height: 1.85;
  color: var(--text-muted);
}

/* ─── EDUCATION ─────────────────────────────────────────────── */

.edu-item {
  padding: 28px 0;
  border-bottom: 1px solid var(--border-subtle);
}

.edu-item:last-child  { border-bottom: none; padding-bottom: 0; }
.edu-item:first-child { padding-top: 0; }

.edu-meta {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 4px;
}

.edu-school {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  transition: color 0.15s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.edu-school:hover { color: var(--accent); }

.edu-date {
  font-size: 0.72rem;
  color: var(--text-dim);
  white-space: nowrap;
  padding: 3px 10px;
  border: 1px solid var(--border);
  border-radius: 20px;
  flex-shrink: 0;
  margin-top: 2px;
}

.edu-degree {
  font-size: 0.75rem;
  color: var(--accent);
  font-weight: 500;
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.edu-desc {
  font-size: 0.875rem;
  line-height: 1.85;
  color: var(--text-muted);
}

/* ─── PROJECTS ──────────────────────────────────────────────── */

.project-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.project-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  transition: border-color 0.2s, transform 0.2s;
  display: flex;
  flex-direction: column;
}

.project-card:hover {
  border-color: rgba(88, 166, 255, 0.4);
  transform: translateY(-2px);
}

.project-card-img {
  width: 100%;
  height: 150px;
  object-fit: cover;
  display: block;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
}

.project-card-body {
  padding: 16px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.project-card-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 8px;
}

.project-card-desc {
  font-size: 0.78rem;
  line-height: 1.75;
  color: var(--text-muted);
  flex: 1;
  margin-bottom: 14px;
}

.project-card-links { display: flex; gap: 12px; }

.project-link {
  font-size: 0.75rem;
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: opacity 0.15s;
}

.project-link:hover { opacity: 0.7; }

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 28px;
}

.page-btn {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 7px 16px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.82rem;
  transition: all 0.15s;
  font-family: inherit;
}

.page-btn:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.page-btn:disabled { opacity: 0.25; cursor: not-allowed; }

#pageIndicator {
  font-size: 0.78rem;
  color: var(--text-muted);
  min-width: 80px;
  text-align: center;
}

/* ─── SKILLS ────────────────────────────────────────────────── */

.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 14px;
}

.skill-group {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px 18px 18px;
  transition: border-color 0.2s;
}

.skill-group:hover {
  border-color: rgba(88, 166, 255, 0.35);
}

.skill-group-label {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent);
  margin-bottom: 12px;
}

.skill-group-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.skill-tag {
  padding: 4px 11px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: 20px;
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 500;
  transition: border-color 0.15s, color 0.15s;
}

.skill-tag:hover { border-color: var(--accent); color: var(--text); }

/* ─── CONTACT ───────────────────────────────────────────────── */

.contact-form { max-width: 500px; }
.form-group { margin-bottom: 14px; }

.form-input {
  width: 100%;
  padding: 11px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-size: 0.875rem;
  font-family: inherit;
  transition: border-color 0.15s;
  outline: none;
}

.form-input:focus { border-color: var(--accent); }
.form-input::placeholder { color: var(--text-dim); }
textarea.form-input { min-height: 130px; resize: vertical; }

/* ─── FOOTER ────────────────────────────────────────────────── */

footer {
  max-width: 1100px;
  margin: 0 auto;
  padding: 28px 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.footer-copy { font-size: 0.72rem; color: var(--text-dim); }

.footer-top {
  font-size: 0.78rem;
  color: var(--text-dim);
  cursor: pointer;
  transition: color 0.15s;
  background: none;
  border: none;
  font-family: inherit;
  padding: 0;
  display: flex;
  align-items: center;
  gap: 5px;
}

.footer-top:hover { color: var(--accent); }

/* ─── SCROLLBAR ─────────────────────────────────────────────── */

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

/* ─── RESPONSIVE ────────────────────────────────────────────── */

@media (max-width: 1024px) {
  .hero-grid { gap: 48px; }
  .hero-name { font-size: 2.4rem; }
  .project-grid { grid-template-columns: repeat(2, 1fr); }
  .skills-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .header-nav { display: none; }
  .hamburger-btn { display: block; }

  #about { padding: 48px 24px; }

  .hero-grid {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .json-panel { display: none; }

  section { padding: 56px 24px; }

  .hero-name { font-size: 2rem; }
  .hero-title { font-size: 1.2rem; }

  .project-grid { grid-template-columns: 1fr; }
  .skills-grid { grid-template-columns: 1fr; }

  footer { padding: 24px; flex-direction: column; gap: 12px; align-items: flex-start; }

  .exp-meta, .edu-meta { flex-direction: column; gap: 6px; }
  .exp-date, .edu-date { align-self: flex-start; }

  .header-inner { padding: 0 20px; }
}

@media (max-width: 480px) {
  section { padding: 48px 18px; }
  .hero-name { font-size: 1.75rem; }
}
