:root {
  --bg-main: #0b0c10;
  --panel-bg: #14171e;
  --surface: #1b1f29;
  --border-color: #222630;
  --text-main: #f0f2f5;
  --text-muted: #6c7a9c;
  --accent-color: #ff007f;
  --accent-glow: rgba(255, 0, 127, 0.15);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  background-color: var(--bg-main);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 40px 16px 60px;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

#bgCanvas {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 0;
  background-color: var(--bg-main);
  pointer-events: none;
}

.workspace {
  background: var(--panel-bg);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 16px;
  width: 100%;
  max-width: 560px;
  padding: 30px;
  position: relative;
  z-index: 10;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.35);
}

.top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.dropdown {
  position: relative;
  display: inline-block;
}

.dropdown-btn {
  background: var(--surface);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  padding: 6px 14px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  transition: border-color 0.2s ease, color 0.2s ease;
}

.dropdown-btn:hover {
  border-color: var(--accent-color);
  color: var(--accent-color);
}

.dropdown-content {
  display: none;
  position: absolute;
  top: calc(100% - 2px);
  left: 0;
  background-color: var(--panel-bg);
  min-width: 170px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.32);
  z-index: 20;
  overflow: hidden;
  padding-top: 2px;
}

.dropdown-content a {
  color: var(--text-main);
  padding: 10px 14px;
  text-decoration: none;
  display: block;
  font-size: 13px;
}

.dropdown-content a:hover {
  background-color: var(--surface);
  color: var(--accent-color);
}

.dropdown:hover .dropdown-content,
.dropdown:focus-within .dropdown-content {
  display: block;
}

.quick-links {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: center;
}

.quick-link-item {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  padding: 6px 8px;
  border-radius: 6px;
  transition: color 0.2s ease, background 0.2s ease;
}

.quick-link-item:hover {
  color: var(--accent-color);
  background: rgba(255, 255, 255, 0.03);
}

.lang-switch {
  background: var(--surface);
  border: 1px solid var(--border-color);
  padding: 4px;
  border-radius: 8px;
  display: flex;
  gap: 2px;
}

.lang-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
  padding: 4px 8px;
  cursor: pointer;
  border-radius: 5px;
}

.lang-btn.active {
  background: var(--panel-bg);
  color: var(--accent-color);
}

.profile {
  text-align: center;
  margin-top: 18px;
  margin-bottom: 10px;
}

.avatar-frame {
  width: 84px;
  height: 84px;
  border-radius: 50%;
  margin: 0 auto 14px;
  padding: 2px;
  background: var(--surface);
  border: 1px solid color-mix(in srgb, var(--accent-color) 35%, var(--border-color));
}

.avatar-frame img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  background: #1e222b;
}

.profile .brand {
  font-size: 12px;
  color: var(--accent-color);
  font-weight: 700;
  letter-spacing: 0.04em;
  margin-bottom: 4px;
}

.profile h1 {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 4px;
}

.profile .role {
  color: var(--text-muted);
  font-size: 13px;
  margin-bottom: 10px;
}

.profile .subtitle {
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.5;
  max-width: 440px;
  margin: 0 auto 12px;
}

.profile-actions {
  display: flex;
  justify-content: center;
  gap: 8px;
}

.static-section {
  margin-top: 26px;
  scroll-margin-top: 24px;
}

.static-section h2 {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 12px;
  border-left: 2px solid var(--accent-color);
  padding-left: 8px;
}

.cv-table {
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: var(--surface);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  padding: 14px;
}

.cv-row {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 15px;
  font-size: 13px;
  line-height: 1.4;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.cv-row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.cv-key {
  color: var(--text-main);
  font-weight: 600;
}

.cv-val {
  color: var(--text-muted);
}

.projects-list,
.stack-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.project-card {
  background: var(--surface);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  padding: 16px;
}

.project-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 8px;
}

.project-title h3 {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-main);
}

.project-title span {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.project-year {
  font-size: 12px;
  font-weight: 700;
  background: rgba(255, 0, 127, 0.1);
  color: var(--accent-color);
  padding: 2px 8px;
  border-radius: 6px;
  white-space: nowrap;
}

.project-desc {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 12px;
}

.detail-card .detail-lead {
  color: var(--text-main);
  font-weight: 500;
}

.detail-list {
  margin: 0 0 12px;
  padding-left: 18px;
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.5;
}

.detail-list li {
  margin-bottom: 4px;
}

.detail-note {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.45;
  margin-bottom: 12px;
  opacity: 0.9;
}

.detail-pubs h4 {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.detail-pubs ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.detail-pubs li {
  margin-bottom: 6px;
}

.detail-pubs a {
  color: var(--accent-color);
  text-decoration: none;
  font-size: 13px;
  line-height: 1.4;
}

.detail-pubs a:hover {
  text-decoration: underline;
}

.changelog-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.changelog-entry h4 {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 6px;
  line-height: 1.35;
}

.changelog-entry ul {
  margin: 0;
  padding-left: 18px;
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.45;
}

.changelog-entry li {
  margin-bottom: 3px;
}

.project-btn,
.text-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: var(--panel-bg);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  font-size: 12px;
  font-weight: 600;
  padding: 7px 12px;
  border-radius: 6px;
  text-decoration: none;
  cursor: pointer;
  transition: border-color 0.2s ease, color 0.2s ease;
}

.project-btn:hover,
.text-btn:hover {
  border-color: var(--accent-color);
  color: var(--accent-color);
}

.show-more-wrap {
  display: flex;
  justify-content: center;
  margin-top: 4px;
}

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

.project-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  background: var(--surface);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease;
  text-align: left;
  width: 100%;
  color: inherit;
  font: inherit;
}

.project-item:hover {
  border-color: var(--accent-color);
  background: rgba(255, 255, 255, 0.02);
}

.link-text h3 {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 2px;
}

.link-text span {
  font-size: 11px;
  color: var(--text-muted);
}

.section-divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.06);
  margin: 26px 0;
}

.footer-copyright {
  text-align: center;
  font-size: 12px;
  color: var(--text-muted);
  opacity: 0.75;
  padding: 28px 0 8px;
  margin-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.04);
}

.footer-copyright button {
  background: none;
  border: none;
  color: var(--accent-color);
  cursor: pointer;
  font: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  background: rgba(5, 5, 8, 0.85);
  backdrop-filter: blur(8px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
  padding: 20px;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-content {
  background: var(--panel-bg);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 16px;
  width: 100%;
  max-width: 520px;
  max-height: min(86vh, 720px);
  overflow: auto;
  padding: 28px;
  position: relative;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.4);
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 24px;
  cursor: pointer;
  line-height: 1;
}

.modal-close:hover {
  color: var(--accent-color);
}

.modal-body h2 {
  font-size: 20px;
  margin-bottom: 12px;
  padding-right: 28px;
}

.modal-body p {
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.6;
  margin-bottom: 16px;
}

.modal-info-box {
  margin-top: 12px;
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  font-size: 13px;
  line-height: 1.45;
  color: var(--text-muted);
}

.modal-info-box p {
  margin: 0 0 10px;
}

.modal-info-box p:last-child {
  margin-bottom: 0;
}

.modal-info-box a {
  color: var(--accent-color);
}

.modal-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.btn-download {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--accent-color);
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  padding: 14px;
  border-radius: 10px;
  text-decoration: none;
  border: none;
  cursor: pointer;
}

.btn-download:hover {
  opacity: 0.92;
}

.btn-secondary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--surface);
  color: var(--text-main);
  border: 1px solid var(--border-color);
  font-weight: 600;
  font-size: 14px;
  padding: 14px;
  border-radius: 10px;
  text-decoration: none;
  cursor: pointer;
}

.btn-secondary:hover {
  border-color: var(--text-muted);
}

.email-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 8px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group label {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 600;
}

.form-group input,
.form-group textarea {
  background: var(--surface);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  color: var(--text-main);
  padding: 12px;
  font-size: 14px;
  outline: none;
  font-family: inherit;
}

.form-group input:focus,
.form-group textarea:focus {
  border-color: var(--accent-color);
}

.form-group textarea {
  resize: vertical;
  min-height: 100px;
}

.form-status {
  font-size: 13px;
  margin-bottom: 5px;
  font-weight: 500;
  display: none;
}

@media (max-width: 600px) {
  body {
    padding: 20px 10px 40px;
  }

  .workspace {
    padding: 22px 16px;
  }

  .quick-links {
    gap: 4px;
  }

  .quick-link-item {
    font-size: 11px;
    padding: 4px 6px;
  }

  .cv-row {
    grid-template-columns: 1fr;
    gap: 4px;
  }
}

@media (max-width: 440px) {
  .quick-links {
    display: none;
  }

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

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  * {
    transition: none !important;
    animation: none !important;
  }
}
