/* Design tokens */
:root {
  --bg: #0e1116;
  --card: #121722;
  --text: #e6e8eb;
  --muted: #a8b0bb;
  --brand: #7c4dff;
  --brand-2: #21c1d6;
  --border: #232938;
  --success: #2ecc71;
  --error: #ff5c5c;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

/* Base */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji",
    "Segoe UI Emoji";
  color: var(--text);
  background: radial-gradient(1200px 800px at 80% -20%, rgba(124, 77, 255, 0.15), transparent 60%),
    radial-gradient(900px 700px at 10% 0%, rgba(33, 193, 214, 0.15), transparent 55%), var(--bg);
  line-height: 1.6;
}

.container {
  width: min(1120px, 92%);
  margin-inline: auto;
}

.section {
  padding: 64px 0;
}

h1,
h2,
h3 {
  line-height: 1.2;
  margin: 0 0 16px;
}

h1 {
  font-size: clamp(28px, 4.5vw, 44px);
}

h2 {
  font-size: clamp(22px, 3.5vw, 32px);
}

h3 {
  font-size: clamp(18px, 3vw, 24px);
}

p {
  margin: 0 0 12px;
  color: var(--muted);
}

/* Accessibility helpers */
.skip-link {
  position: absolute;
  left: -9999px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}
.skip-link:focus {
  left: 16px;
  top: 16px;
  width: auto;
  height: auto;
  background: var(--brand);
  color: #fff;
  padding: 10px 14px;
  border-radius: 8px;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(14, 17, 22, 0.7);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 64px;
}

.logo {
  text-decoration: none;
  color: #fff;
  font-weight: 700;
  letter-spacing: 0.3px;
}

.hamburger {
  display: inline-flex;
  flex-direction: column;
  gap: 4px;
  width: 40px;
  height: 40px;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 10px;
  color: #fff;
  cursor: pointer;
}
.hamburger-line {
  width: 20px;
  height: 2px;
  background: #fff;
  border-radius: 2px;
  transition: transform 200ms ease, opacity 200ms ease;
}
.hamburger[aria-expanded="true"] .hamburger-line:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}
.hamburger[aria-expanded="true"] .hamburger-line:nth-child(2) {
  opacity: 0;
}
.hamburger[aria-expanded="true"] .hamburger-line:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}

.nav {
  position: fixed;
  inset: 64px 0 auto 0;
  background: rgba(14, 17, 22, 0.95);
  transform: translateY(-16px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 200ms ease, transform 200ms ease;
  border-bottom: 1px solid var(--border);
}
.nav.open {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}
.nav ul {
  list-style: none;
  padding: 12px 16px 16px;
  margin: 0;
  display: grid;
  gap: 6px;
}
.nav a {
  display: block;
  color: #fff;
  text-decoration: none;
  padding: 10px 12px;
  border-radius: 8px;
}
.nav a:hover,
.nav a:focus-visible {
  background: rgba(124, 77, 255, 0.15);
  outline: none;
}

@media (min-width: 820px) {
  .hamburger {
    display: none;
  }
  .nav {
    position: static;
    background: transparent;
    opacity: 1;
    transform: none;
    pointer-events: auto;
    border: 0;
  }
  .nav ul {
    display: flex;
    gap: 8px;
    padding: 0;
  }
  .nav a {
    padding: 10px 14px;
  }
}

/* Language switcher */
.lang-switcher {
  position: relative;
  margin-left: 8px;
}
.lang-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.06);
  color: #fff;
  cursor: pointer;
}
.lang-btn .flag {
  font-size: 16px;
  line-height: 1;
}
.lang-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: var(--shadow);
  padding: 6px;
  list-style: none;
  margin: 0;
  display: none;
  min-width: 140px;
  z-index: 20;
}
.lang-menu.open {
  display: block;
}
.lang-menu li {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 8px;
  cursor: pointer;
}
.lang-menu li:hover {
  background: rgba(255,255,255,0.06);
}

/* Hero */
.hero {
  padding-top: 48px;
}
.hero-inner {
  display: grid;
  gap: 24px;
  align-items: center;
}
.hero-media {
  display: flex;
  justify-content: center;
}
.hero-photo {
  width: 180px;
  height: 180px;
  border-radius: 20px;
  object-fit: cover;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  transform: translateY(10px);
  opacity: 0;
  animation: fadeInUp 700ms ease 150ms forwards;
}
.lead {
  font-size: 16px;
}
.hero-cta {
  display: flex;
  gap: 10px;
  margin-top: 14px;
}

.btn {
  display: inline-block;
  text-decoration: none;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  color: #fff;
  transition: transform 120ms ease, background 120ms ease, border-color 120ms ease;
  overflow: hidden; /* avoid gradient bleed on rounded corners */
}
.btn:hover {
  transform: translateY(-1px);
}
.btn.primary {
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  border: none; /* remove border to avoid 1px artifact */
  background-clip: padding-box; /* ensure gradient doesn't paint under border area */
}
.btn.secondary {
  background: rgba(255, 255, 255, 0.06);
}

@media (min-width: 820px) {
  .hero-inner {
    grid-template-columns: 320px 1fr;
    gap: 48px;
  }
  .hero-photo {
    width: 260px;
    height: 260px;
  }
  .lead {
    font-size: 18px;
  }
}

/* Skills */
.skills-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 0;
  margin: 16px 0 0;
  list-style: none;
}
.skill {
  padding: 10px 12px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  opacity: 0;
  transform: translateY(8px);
}
.skill.in-view {
  animation: fadeInUp 500ms ease forwards;
}
.skill:nth-child(2) { animation-delay: 60ms; }
.skill:nth-child(3) { animation-delay: 120ms; }
.skill:nth-child(4) { animation-delay: 180ms; }
.skill:nth-child(5) { animation-delay: 240ms; }
.skill:nth-child(6) { animation-delay: 300ms; }
.skill:nth-child(7) { animation-delay: 360ms; }
.skill:nth-child(8) { animation-delay: 420ms; }

@media (min-width: 640px) {
  .skills-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
@media (min-width: 960px) {
  .skills-list {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

/* Languages */
.languages-list {
  display: grid;
  gap: 20px;
  padding: 0;
  margin: 24px 0 0;
  list-style: none;
}
.language-item {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px;
  opacity: 0;
  transform: translateY(10px);
}
.language-item.in-view {
  animation: fadeInUp 600ms ease forwards;
}
.language-item:nth-child(2) { animation-delay: 100ms; }
.language-item:nth-child(3) { animation-delay: 200ms; }
.language-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}
.language-name {
  font-weight: 600;
  color: var(--text);
  font-size: 16px;
}
.language-level {
  font-size: 13px;
  color: var(--muted);
  background: rgba(124, 77, 255, 0.15);
  padding: 4px 10px;
  border-radius: 12px;
  border: 1px solid rgba(124, 77, 255, 0.3);
}
.language-bar {
  height: 8px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 4px;
  overflow: hidden;
  position: relative;
}
.language-progress {
  height: 100%;
  background: linear-gradient(90deg, var(--brand), var(--brand-2));
  border-radius: 4px;
  position: relative;
  transition: width 1.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 0 10px rgba(124, 77, 255, 0.4);
}
.language-progress.native {
  background: linear-gradient(90deg, var(--brand-2), #2ecc71);
  box-shadow: 0 0 12px rgba(33, 193, 214, 0.5);
}
.language-progress::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  animation: shimmer 2s infinite;
}
@keyframes shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

@media (min-width: 640px) {
  .languages-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (min-width: 960px) {
  .languages-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* Cards (Experience) */
.cards {
  display: grid;
  gap: 14px;
  margin-top: 16px;
}
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(10px);
}
.card.in-view {
  animation: fadeInUp 600ms ease forwards;
}
.card-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}
.card .meta {
  color: var(--muted);
  font-size: 14px;
}
.card ul {
  margin: 8px 0 0;
  padding-left: 18px;
}

@media (min-width: 820px) {
  .cards {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* Projects */
.projects-grid {
  display: grid;
  gap: 14px;
  margin-top: 16px;
}
.project {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  display: grid;
  grid-template-rows: auto 1fr;
  opacity: 0;
  transform: translateY(10px);
}
.project.in-view {
  animation: fadeInUp 600ms ease forwards;
}
.project img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  display: block;
  border-bottom: 1px solid var(--border);
}
.project-content {
  padding: 12px;
}
.project-link {
  color: #fff;
  text-decoration: none;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.5);
}
.project-link:hover {
  color: var(--brand-2);
  border-bottom-color: var(--brand-2);
}

@media (min-width: 820px) {
  .projects-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .project img {
    height: 200px;
  }
}

/* Horizontal scroll carousels */
.hscroll {
  position: relative;
  margin-top: 16px;
}
.hscroll-track {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 85%;
  gap: 14px;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scroll-padding-inline: 16px;
  padding-bottom: 6px;
}
.hscroll-track::-webkit-scrollbar {
  height: 8px;
}
.hscroll-track::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.12);
  border-radius: 8px;
}
.hscroll-item {
  scroll-snap-align: start;
}
@media (min-width: 640px) {
  .hscroll-track {
    grid-auto-columns: 60%;
  }
}
@media (min-width: 1024px) {
  .hscroll-track {
    grid-auto-columns: minmax(380px, 1fr);
  }
}

.experience-track .card p,
.experience-track .card li {
  font-size: 0.92rem;
  line-height: 1.45;
}

@media (min-width: 1024px) {
  .experience-track {
    grid-auto-columns: calc((100% - 28px) / 3);
  }
}

.projects-track .project-content h3 {
  font-size: 1.05rem;
}
.projects-track .project-content p {
  font-size: 0.92rem;
  line-height: 1.5;
}

@media (min-width: 1024px) {
  .projects-track {
    grid-auto-columns: calc((100% - 28px) / 3);
  }
}
.hscroll-controls {
  position: absolute;
  inset: -52px 0 auto 0;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}
.hscroll-btn {
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
  cursor: pointer;
}
.hscroll-btn:hover {
  background: rgba(255, 255, 255, 0.12);
}
.hscroll-btn[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Contact */
.contact-grid {
  display: grid;
  gap: 20px;
  align-items: start;
}
.contact-details {
  list-style: none;
  padding: 0;
  margin: 10px 0 0;
}
.contact-details li {
  margin: 6px 0;
}
.contact-details a {
  color: #fff;
}
.contact-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(10px);
}
.contact-card.in-view {
  animation: fadeInUp 600ms ease forwards;
}
.contact-form {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
  display: grid;
  gap: 12px;
  opacity: 0;
  transform: translateY(10px);
}
.contact-form.in-view {
  animation: fadeInUp 600ms ease forwards;
}
.form-row {
  display: grid;
  gap: 6px;
}
.form-row label {
  font-weight: 600;
}
.form-row input,
.form-row textarea {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #0c0f14;
  color: var(--text);
  outline: none;
}
.form-row input:focus,
.form-row textarea:focus {
  border-color: var(--brand-2);
  box-shadow: 0 0 0 3px rgba(33, 193, 214, 0.2);
}
.form-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}
.form-status {
  font-size: 14px;
  color: var(--muted);
}
.form-status.success {
  color: var(--success);
}
.form-status.error {
  color: var(--error);
}

@media (min-width: 820px) {
  .contact-grid {
    grid-template-columns: 1.1fr 1fr;
    gap: 32px;
    align-items: stretch;
  }
  .contact-card,
  .contact-form {
    height: 100%;
    display: flex;
    flex-direction: column;
  }
  .contact-form .form-actions {
    margin-top: auto;
  }
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 24px 0 40px;
  color: var(--muted);
}
.footer-content {
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-items: center;
}
.hashtags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-top: 8px;
}
.hashtag {
  font-size: 13px;
  color: var(--muted);
  padding: 4px 10px;
  background: rgba(124, 77, 255, 0.1);
  border: 1px solid rgba(124, 77, 255, 0.2);
  border-radius: 12px;
  transition: all 200ms ease;
}
.hashtag:hover {
  color: var(--brand-2);
  background: rgba(124, 77, 255, 0.15);
  border-color: rgba(124, 77, 255, 0.4);
  transform: translateY(-1px);
}

@media (min-width: 640px) {
  .footer-content {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }
  .hashtags {
    margin-top: 0;
  }
}

/* Animations */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Respect user's motion preference */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  * {
    animation: none !important;
    transition: none !important;
  }
}


