:root {
  --bg: #070a12;
  --panel: #111a2a;
  --text: #e6eaf2;
  --muted: #9fb3c8;
  --accent: #5b8cff;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: system-ui, sans-serif;
  font-size: 16px;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

body.light {
  --bg: #f5f7fb;
  --panel: #ffffff;
  --text: #111827;
  --muted: #4b5563;
  --accent: #2563eb;
}

button {
  cursor: pointer;
}


.left h1 {
  text-align: center;
}

h2,
h3 {
  border-left: 3px solid var(--accent);
  padding-left: 8px;
  font-size: 1rem;
}

a {
  color: var(--text);
  text-decoration: none;
  display: inline-block;
  padding: 2px 6px;
  border-radius: 8px;
  border: 1px solid transparent;
  transition: 0.2s ease;
  position: relative;
}

a:hover {
  border-color: rgba(91, 140, 255, 0.55);
  background: rgba(91, 140, 255, 0.08);
  color: var(--accent);
  box-shadow: 0 0 12px rgba(91, 140, 255, 0.25);
  transform: translateY(-1px);
}

a:active {
  transform: scale(0.98);
  box-shadow: 0 0 6px rgba(91, 140, 255, 0.2);
}

.brand {
  font-weight: 700;
  padding-left: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.copy {
  padding: 0 0 10px 10px;
  font-size: 0.875rem;
}

.topbar {
  display: flex;
  justify-content: space-between;
  padding: 10px;
  background: #0b1020;
  border-bottom: 1px solid #1b2440;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
  position: sticky;
  top: 0;
  z-index: 1000;
}

body.light .topbar {
  background: #f8fafc;
  border-bottom: 1px solid #d7deea;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
}

.switch {
  display: flex;
  gap: 6px;
  align-items: center;
}

.switch button {
  background: #111a2a;
  border: 1px solid #2a3555;
  color: #9fb3c8;
  padding: 6px 10px;
  height: 32px;
  min-width: 70px;
  border-radius: 6px;
  font-size: 0.875rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
}

.switch .active {
  background: #5b8cff;
  color: #ffffff;
}

body.light .switch button {
  background: #ffffff;
  border-color: #d7deea;
  color: #334155;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
}

body.light .switch .active {
  background: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
}

.grid3 {
  display: grid;
  grid-template-columns: 260px 1fr 260px;
  gap: 12px;
  padding: 12px;
}

.left,
.right {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 12px;
}

.center {
  background: var(--panel);
  border-radius: 16px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  display: block;
  margin: 8px auto 0;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 10px;
}

.projects > h2 {
    grid-column: 1 / -1;
}

.card,
.node,
.cli-window,
.link-card {
  background: var(--panel);
  color: var(--text);
}

.card {
  padding: 10px;
  margin: 6px 0;
  border-radius: 10px;
}

.single-panel {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 14px;
  padding: 18px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
  margin-bottom: 10px;
}

.single-panel .card {
  background: transparent;
  border: 0;
  box-shadow: none;
  padding: 8px 0;
  color: var(--text);
}

.chips span {
  display: inline-block;
  padding: 3px 6px;
  margin: 2px;
  background: rgba(255, 255, 255, 0.06);
  font-size: 0.85rem;
}

body.light .chips span {
  background: rgba(0, 0, 0, 0.05);
}

.node {
  padding: 6px;
  margin: 6px 0;
  border-radius: 8px;
  cursor: pointer;
  position: relative;
  z-index: 2;
}

.node:hover {
  background: #1a2742;
}

.node.focus {
  background: var(--accent);
}

.graph-wrap {
  position: relative;
}

.accordion button {
  width: 100%;
  padding: 8px;
  background: #111a2a;
  color: #ffffff;
  border: none;
  cursor: pointer;
}

.hidden {
  display: none;
}

iframe {
  width: 100%;
  height: 400px;
  border: 0;
  transition: filter 0.25s ease, transform 0.2s ease;
}

iframe:hover {
  transform: translateY(-1px);
}

body.dark iframe {
  filter: invert(0.92) hue-rotate(180deg);
}

body.light iframe {
  filter: none;
}

.cli {
  padding: 12px;
}

.cli-window {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-sizing: border-box;
  overflow: hidden;
}

.cli-output {
  font-family: monospace;
  font-size: 0.875rem;
  min-height: 120px;
  color: var(--muted);
  margin-bottom: 8px;
}

.cli input {
  width: 100%;
  box-sizing: border-box;
  background: var(--panel);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text);
  padding: 8px;
  border-radius: 8px;
  font-family: monospace;
  font-size: 0.875rem;
}

.link-card {
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  border: 1px solid transparent;
  transition: 0.2s ease;
  white-space: nowrap;
  font-size: 0.9rem;
}

#scrollTopBtn {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: var(--panel);
  color: var(--text);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
  opacity: 0;
  transform: translateY(10px);
  transition: 0.2s ease;
  z-index: 999;
}

#scrollTopBtn.show {
  opacity: 1;
  transform: translateY(0);
}

#loader {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.7);
  z-index: 9999;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

#loader.hidden {
  opacity: 0;
  visibility: hidden;
}

.loader-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 24px 28px;
  border-radius: 24px;
  background: rgba(6, 10, 18, 0.88);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.28);
}

.loader-status {
  color: rgba(255, 255, 255, 0.96);
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.loader-progress {
  width: 260px;
  max-width: 80vw;
  height: 8px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.12);
}

.loader-progress-fill {
  width: 100%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), #7dd3fc);
  transform: scaleX(0);
  transform-origin: left center;
  will-change: transform;
}

.spinner {
  width: 42px;
  height: 42px;
  border: 3px solid rgba(255, 255, 255, 0.15);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

body.light .spinner {
  border: 3px solid rgba(0, 0, 0, 0.1);
  border-top-color: var(--accent);
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}



@media (max-width: 768px) {
  .grid3,
  .center,
  .left,
  .right {
    width: 100%;
  }

  .grid3 {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .left,
  .center,
  .block {
    display: contents;
  }

  .user {
    order: 1;
  }

  .about {
    order: 2;
  }

  .user-skills {
    order: 3;
  }

  .grid {
    order: 4;
  }

  .right {
    order: 5;
  }

  .contact {
    order: 6;
  }
  
  .topbar {
    flex-direction: column;
    gap: 12px;
    align-items: flex-start;
  }

  .switch {
    width: 100%;
    flex-wrap: wrap;
  }

  .switch button {
    flex: 1;
  }

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

  iframe {
    height: 85vh;
    min-height: 600px;
  }

  .center {
    padding: 12px;
  }

  body {
    font-size: 15px;
  }
}
