:root {
  --bg: #0f0f0f;
  --surface: #1a1a1a;
  --surface2: #242424;
  --border: #2e2e2e;
  --text: #e4e4e4;
  --text-muted: #888;
  --accent: #6c9bff;
  --accent-hover: #8ab0ff;
  --radius: 12px;
}

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

html {
  scroll-behavior: smooth;
}

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

.container {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 24px;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  color: var(--accent-hover);
}

/* Hero */
.hero {
  padding: 80px 0 60px;
}

.hero-inner {
  display: flex;
  align-items: center;
  gap: 48px;
}

.hero-photo {
  flex-shrink: 0;
}

.avatar {
  width: 280px;
  height: auto;
  border-radius: 20px;
  border: 3px solid var(--border);
  box-shadow: 0 0 40px rgba(108, 155, 255, 0.08);
  display: block;
}

.hero-text {
  flex: 1;
  min-width: 0;
}

.hero h1 {
  font-size: 2.2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}

.hero .subtitle {
  font-size: 1.05rem;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.hero .tagline {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin-bottom: 20px;
}

/* Contact links */
.contact-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.contact-links a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.9rem;
  padding: 6px 14px;
  border-radius: 8px;
  border: 1px solid var(--border);
  transition: all 0.2s;
}

.contact-links a:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: rgba(108, 155, 255, 0.06);
}

.contact-links a svg {
  width: 18px;
  height: 18px;
}

/* Language toggle */
.lang-toggle {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin-top: -24px;
  margin-bottom: 24px;
}

.lang-btn {
  background: none;
  border: 1px solid transparent;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  padding: 4px 14px;
  border-radius: 8px;
  transition: all 0.2s;
  letter-spacing: 0.02em;
}

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

.lang-btn[data-active="1"] {
  color: #6c9bff;
  border-color: #6c9bff;
  background: rgba(108, 155, 255, 0.12);
}

.lang-sep {
  color: var(--border);
  font-size: 0.85rem;
}

/* Certifications */
.certs-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cert-item {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px 20px;
  flex-wrap: wrap;
}

.cert-name {
  font-weight: 600;
  font-size: 0.9rem;
  flex: 1;
  min-width: 180px;
  color: var(--accent);
  text-decoration: none;
  transition: all 0.2s;
}

.cert-name:hover {
  color: var(--accent-hover);
  text-decoration: underline;
}

.cert-org {
  color: var(--accent);
  font-size: 0.85rem;
}

.cert-date {
  color: var(--text-muted);
  font-size: 0.8rem;
  white-space: nowrap;
  margin-left: auto;
}

/* Sources */
.sources-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.source-link {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 18px;
  text-decoration: none;
  color: var(--text);
  font-size: 0.85rem;
  transition: all 0.2s;
}

.source-link:hover {
  border-color: var(--accent);
  background: rgba(108, 155, 255, 0.04);
}

.source-icon {
  color: var(--accent);
  font-size: 1rem;
  flex-shrink: 0;
}

.source-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgba(108, 155, 255, 0.1);
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 600;
  flex-shrink: 0;
}

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

/* Sections */
section {
  padding: 48px 0;
}

.section-title {
  font-size: 1.3rem;
  font-weight: 600;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.section-title::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}

.about-text {
  color: var(--text-muted);
  font-size: 0.95rem;
  max-width: 680px;
}

/* Experience */
.exp-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
}

.exp-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.exp-role {
  font-weight: 600;
  font-size: 1.05rem;
}

.exp-company {
  color: var(--accent);
  font-weight: 500;
  font-size: 0.95rem;
}

.exp-date {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-left: auto;
  white-space: nowrap;
}

.exp-desc {
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.6;
  margin-bottom: 12px;
}

.exp-achievements {
  list-style: none;
  padding: 0;
  margin: 0;
}

.exp-achievements li {
  color: var(--text-muted);
  font-size: 0.85rem;
  line-height: 1.6;
  padding: 3px 0 3px 16px;
  position: relative;
}

.exp-achievements li::before {
  content: "\25B8";
  position: absolute;
  left: 0;
  color: var(--accent);
}

/* Skills */
.skills-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.skill-tag {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 0.85rem;
  color: var(--text);
  transition: all 0.2s;
}

.skill-tag:hover {
  border-color: var(--accent);
  background: rgba(108, 155, 255, 0.06);
}

/* Repos */
.repos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
}

.repo-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  text-decoration: none;
  color: inherit;
  transition: all 0.2s;
}

.repo-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.repo-card .repo-name {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--accent);
}

.repo-card .repo-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 12px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.repo-card .repo-meta {
  display: flex;
  gap: 16px;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.repo-card .repo-meta span {
  display: flex;
  align-items: center;
  gap: 4px;
}

.repo-card .repo-lang {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-right: 4px;
}

.repo-loading,
.repo-error {
  text-align: center;
  color: var(--text-muted);
  padding: 40px;
  font-size: 0.9rem;
}

/* CV Section */
.cv-section {
  padding: 48px 0 64px;
}

.cv-viewer {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 20px;
}

.cv-frame {
  width: 100%;
  height: 600px;
  border: none;
  display: block;
}

.cv-actions {
  text-align: center;
}

.btn-cv {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--accent);
  color: #0f0f0f;
  text-decoration: none;
  padding: 14px 32px;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 600;
  transition: all 0.2s;
  border: none;
  cursor: pointer;
}

.btn-cv:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(108, 155, 255, 0.25);
}

.btn-cv svg {
  width: 20px;
  height: 20px;
}

/* Footer */
footer {
  text-align: center;
  padding: 32px 0;
  color: var(--text-muted);
  font-size: 0.8rem;
  border-top: 1px solid var(--border);
}

/* Responsive */
@media (max-width: 700px) {
  .hero {
    padding: 48px 0 32px;
  }

  .hero-inner {
    flex-direction: column;
    text-align: center;
    gap: 24px;
  }

  .hero h1 {
    font-size: 1.6rem;
  }

  .contact-links {
    justify-content: center;
  }

  .avatar {
    width: 200px;
  }

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

  .cv-frame {
    height: 400px;
  }

  .container {
    padding: 0 16px;
  }
}
