:root {
  --bg: #0b0c10;
  --surface: #111217;
  --text: #e6e8ef;
  --muted: #a6adbb;
  --border: #232531;
  --accent-500: #7c3aed; /* violet */
  --accent-300: #a78bfa;
  --radius: 12px;
}

* { box-sizing: border-box; }
html, body {
  height: 100%;
  max-width: 100%;
}
body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  scroll-behavior: smooth;
  position: relative;
  width: 100%;
}

/* Animated background */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  opacity: 0.4;
  background:
    radial-gradient(circle at var(--mouse-x, 50%) var(--mouse-y, 50%),
      color-mix(in oklab, var(--accent-500) 15%, transparent 85%) 0%,
      transparent 50%),
    radial-gradient(ellipse 800px 600px at calc(var(--scroll-progress, 0%) * 1.5) calc(20% + var(--scroll-progress, 0%) * 0.5),
      color-mix(in oklab, var(--accent-300) 8%, transparent 92%),
      transparent),
    radial-gradient(ellipse 600px 800px at calc(100% - var(--scroll-progress, 0%) * 1.2) calc(60% + var(--scroll-progress, 0%) * 0.3),
      color-mix(in oklab, var(--accent-500) 6%, transparent 94%),
      transparent);
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.container {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 20px;
}

main {
  width: 100%;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in oklab, var(--bg) 92%, black 8%);
  backdrop-filter: saturate(120%) blur(8px);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 64px;
  position: relative;
  gap: 16px;
}
.brand {
  font-weight: 700;
  text-decoration: none;
  color: var(--text);
}
.nav {
  display: flex;
  gap: 14px;
  align-items: center;
  flex-grow: 0;
  justify-content: center;
}
.nav > a {
  color: var(--muted);
  text-decoration: none;
  padding: 8px 10px;
  border-radius: 8px;
  white-space: nowrap;
}
.nav > a:hover { color: var(--text); background: var(--surface); }

/* Contact dropdown in nav */
.nav-dropdown {
  position: relative;
}
.nav-dropdown-toggle {
  color: var(--muted);
  background: transparent;
  border: none;
  padding: 8px 10px;
  border-radius: 8px;
  cursor: pointer;
  font: inherit;
  display: flex;
  align-items: center;
  gap: 6px;
}
.nav-dropdown-toggle:hover {
  color: var(--text);
  background: var(--surface);
}
.dropdown-arrow {
  font-size: 10px;
  transition: transform 0.3s ease;
}
.nav-dropdown-toggle[aria-expanded="true"] .dropdown-arrow {
  transform: rotate(180deg);
}
.nav-dropdown-menu {
  position: absolute;
  top: 100%;
  right: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-top: 6px;
  min-width: 160px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s;
  z-index: 100;
}
.nav-dropdown-menu.active {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.nav-dropdown-menu a {
  display: block;
  color: var(--muted);
  text-decoration: none;
  padding: 10px 14px;
  border-radius: 6px;
  margin: 4px;
}
.nav-dropdown-menu a:hover {
  color: var(--text);
  background: var(--bg);
}


/* Hero */
.hero {
  padding: 80px 0 60px;
  width: 100%;
}
.hero-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: center;
  width: 100%;
  max-width: 100%;
  padding-left: 80px;
}
.hero-copy {
  min-width: 0;
  max-width: 100%;
}
.hero-copy h1 {
  font-size: clamp(32px, 5vw, 48px);
  margin: 0 0 20px;
  word-wrap: break-word;
  overflow-wrap: break-word;
  line-height: 1.15;
}
.accent { color: var(--accent-300); }
.lead {
  color: var(--muted);
  font-size: 18px;
  word-wrap: break-word;
  overflow-wrap: break-word;
  margin: 0 0 28px;
  line-height: 1.7;
}
.actions { display: flex; gap: 12px; margin-top: 0; flex-wrap: wrap; }
.hero-art {
  display: grid;
  place-items: center;
  position: relative;
  min-width: 0;
  max-width: 100%;
}
.blob {
  width: min(340px, 80%);
  height: auto;
  filter: drop-shadow(0 20px 40px rgba(0,0,0,.25));
  max-width: 100%;
}
.avatar {
  position: absolute;
  inset: 50% auto auto 50%;
  transform: translate(-50%, -50%);
  width: clamp(140px, 24vw, 200px);
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  overflow: hidden;
  border: 4px solid color-mix(in oklab, var(--bg) 70%, transparent 30%);
  box-shadow: 0 8px 30px rgba(0,0,0,.35);
  background: radial-gradient(120px 120px at 30% 30%, rgba(255,255,255,.08), transparent),
              linear-gradient(135deg, var(--surface), color-mix(in oklab, var(--surface), black 6%));
  z-index: 2;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* Sections */
.section {
  padding: 72px 0;
  border-top: 1px solid var(--border);
  position: relative;
  width: 100%;
}
.section h2 {
  font-size: 28px;
  margin: 0 0 16px;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.about-content {
  max-width: 800px;
  margin-bottom: 32px;
  width: 100%;
}
.about-content p {
  margin: 0 0 16px;
  line-height: 1.8;
  color: var(--muted);
  word-wrap: break-word;
  overflow-wrap: break-word;
}
.about-content p:last-child { margin-bottom: 0; }

.skills {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr));
  gap: 32px;
  width: 100%;
}
.skill-category h3 {
  margin: 0 0 16px;
  font-size: 16px;
  color: var(--accent-300);
}
.skill-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.skill-tag {
  display: inline-block;
  background: color-mix(in oklab, var(--accent-500) 12%, transparent 88%);
  border: 1px solid color-mix(in oklab, var(--accent-500) 25%, transparent 75%);
  color: var(--accent-300);
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
  word-wrap: break-word;
  overflow-wrap: break-word;
  transition: all 0.2s ease;
}
.skill-tag:hover {
  background: color-mix(in oklab, var(--accent-500) 20%, transparent 80%);
  border-color: var(--accent-300);
}

/* Projects */
.projects {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr));
  gap: 18px;
  width: 100%;
}
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  display: grid;
  gap: 10px;
  min-width: 0;
  max-width: 100%;
}
.card h3 {
  margin: 0;
  font-size: 18px;
  word-wrap: break-word;
  overflow-wrap: break-word;
}
.card p {
  margin: 0;
  color: var(--muted);
  word-wrap: break-word;
  overflow-wrap: break-word;
}
.tags { display: flex; gap: 8px; flex-wrap: wrap; }
.tag {
  font-size: 12px;
  color: var(--muted);
  border: 1px dashed var(--border);
  padding: 4px 8px;
  border-radius: 999px;
  white-space: nowrap;
}
.card .links { display: flex; gap: 10px; flex-wrap: wrap; }
.card .links a {
  text-decoration: none;
  color: var(--text);
  word-break: break-all;
}
.card .links a:hover { color: var(--accent-300); }

/* Contact */
.contact { display: grid; gap: 12px; }
.contact .row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.contact label { display: grid; gap: 6px; font-weight: 500; }
.contact input, .contact textarea {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  font: inherit;
}
.note { color: var(--muted); min-height: 1.2em; }

/* Footer */
.site-footer { border-top: 1px solid var(--border); padding: 22px 0; }
.footer-inner { display: flex; justify-content: center; align-items: center; text-align: center; flex-wrap: wrap; }
.footer-inner p { margin: 0; color: var(--muted); width: 100%; }
.socials { display: flex; gap: 12px; }
.socials a { color: var(--muted); text-decoration: none; }
.socials a:hover { color: var(--text); }

.direct-contacts { margin-top: 10px; display: flex; gap: 10px; align-items: center; color: var(--muted); flex-wrap: wrap; }
.direct-contacts a { color: var(--muted); text-decoration: none; }
.direct-contacts a:hover { color: var(--text); }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 10px;
  color: white;
  background: linear-gradient(135deg, var(--accent-500), var(--accent-300));
  text-decoration: none;
  border: 1px solid transparent;
  white-space: nowrap;
  max-width: 100%;
}
.btn:hover { filter: brightness(1.05); }
.btn:active { transform: translateY(1px); }
.btn-outline {
  background: transparent;
  color: var(--text);
  border-color: var(--border);
}


/* Responsive */
@media (max-width: 900px) {
  .hero {
    padding: 60px 0 40px;
  }

  .hero-inner {
    grid-template-columns: 1fr;
    gap: 40px;
    width: 100%;
    padding-left: 0;
  }

  .hero-copy h1 {
    font-size: clamp(28px, 7vw, 36px);
  }

  .lead {
    font-size: 17px;
  }

  .contact .row {
    grid-template-columns: 1fr;
    width: 100%;
  }

  /* Fix header layout on mobile */
  .header-inner {
    height: 56px;
  }

  /* Center all content on mobile */
  .hero-copy, .about-content, .section h2 {
    text-align: center;
  }

  .actions {
    justify-content: center;
  }

  .skills {
    text-align: center;
  }

  .skills ul {
    list-style-position: inside;
  }

  .projects {
    justify-items: center;
  }

}

/* Mobile-specific tweaks (JS sets data-device="mobile") */
[data-device="mobile"] .container {
  padding: 0 16px;
  max-width: 100vw;
}
[data-device="mobile"] .site-header .header-inner { height: 56px; }
[data-device="mobile"] .hero { padding: 48px 0 28px; }
[data-device="mobile"] .hero-copy h1 {
  font-size: clamp(24px, 7vw, 32px);
  max-width: 100%;
}
[data-device="mobile"] .lead {
  font-size: 16px;
  max-width: 100%;
}
[data-device="mobile"] .section { padding: 56px 0; }
[data-device="mobile"] .btn {
  padding: 10px 14px;
  max-width: 100%;
}

/* Additional overflow fixes for small screens */
@media (max-width: 600px) {
  .container {
    padding: 0 12px;
  }

  .header-inner {
    padding-left: 12px;
    padding-right: 12px;
  }

  .hero-copy h1 {
    font-size: clamp(22px, 6vw, 28px);
  }

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

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

