:root {
  --bg: #050507;
  --bg-soft: #0d0a14;
  --text: #f4f0ff;
  --muted: #b7abd2;
  --primary: #6c3bff;
  --accent: #9f7dff;
  --glass: rgba(255, 255, 255, 0.055);
  --border: rgba(255, 255, 255, 0.12);
  --radius: 24px;
  --container: min(1120px, 92vw);
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: "Segoe UI", "SF Pro Text", "Helvetica Neue", Arial, sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 12% 16%, rgba(108, 59, 255, 0.24), transparent 44%),
    radial-gradient(circle at 92% 8%, rgba(132, 87, 255, 0.2), transparent 40%),
    linear-gradient(180deg, #030304 0%, #06050a 42%, #090612 100%);
  line-height: 1.6;
  overflow-x: hidden;
}

#particles {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -2;
}

.loader {
  position: fixed;
  inset: 0;
  background: #060608;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 1rem;
  z-index: 9999;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}

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

.loader-core {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.15);
  border-top-color: var(--primary);
  animation: spin 0.8s linear infinite;
  box-shadow: 0 0 30px rgba(108, 59, 255, 0.5);
}

.loader p {
  color: var(--muted);
  font-size: 0.95rem;
}

.topbar {
  width: var(--container);
  margin: 1rem auto 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.7rem 1rem;
  background: rgba(18, 12, 27, 0.6);
  border: 1px solid var(--border);
  border-radius: 22px;
  backdrop-filter: blur(18px) saturate(140%);
  position: sticky;
  top: 12px;
  z-index: 100;
  box-shadow: 0 20px 40px rgba(3, 2, 7, 0.5);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--text);
  text-decoration: none;
  font-family: "Segoe UI", "SF Pro Display", "Helvetica Neue", Arial, sans-serif;
  font-weight: 700;
  font-size: 1.05rem;
}

.nav-links {
  display: flex;
  gap: 1.2rem;
}

.header-tools {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.lang-switch {
  display: inline-flex;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 999px;
  padding: 0.24rem;
  gap: 0.24rem;
}

.lang-btn {
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.8rem;
  font-weight: 700;
  border-radius: 999px;
  padding: 0.34rem 0.6rem;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  cursor: pointer;
  transition: background 0.25s ease, color 0.25s ease;
}

.lang-btn.active {
  color: #ffffff;
  background: linear-gradient(140deg, rgba(108, 59, 255, 0.7), rgba(154, 112, 255, 0.65));
}

.nav-links a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.95rem;
  transition: color 0.3s ease;
}

.nav-links a:hover {
  color: var(--text);
}

.menu-toggle {
  display: none;
}

.section {
  width: var(--container);
  margin: 0 auto;
  padding: 6.5rem 0;
}

.hero {
  min-height: 88vh;
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  align-items: center;
  position: relative;
}

.hero-content {
  max-width: 860px;
}

.hero-glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(55px);
  z-index: -1;
}

.hero-glow-1 {
  width: 280px;
  height: 280px;
  background: rgba(108, 59, 255, 0.4);
  top: 10%;
  left: -8%;
}

.hero-glow-2 {
  width: 220px;
  height: 220px;
  background: rgba(160, 112, 255, 0.3);
  bottom: 10%;
  right: 8%;
}

.eyebrow {
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.72rem;
  margin-bottom: 1rem;
}

h1,
h2,
h3 {
  font-family: "Segoe UI", "SF Pro Display", "Helvetica Neue", Arial, sans-serif;
  line-height: 1.2;
}

h1 {
  font-size: clamp(2.4rem, 5vw, 4.3rem);
  margin-bottom: 1rem;
}

.hero-subtitle {
  font-size: clamp(1rem, 2.2vw, 1.35rem);
  color: #ddd0ff;
  margin-bottom: 1rem;
}

.hero-text {
  color: var(--muted);
  max-width: 62ch;
  margin-bottom: 2rem;
}

.hero-actions {
  display: flex;
  gap: 0.85rem;
  flex-wrap: wrap;
}

.btn {
  padding: 0.8rem 1.2rem;
  border-radius: 12px;
  text-decoration: none;
  border: 1px solid transparent;
  font-weight: 700;
  transition: transform 0.3s ease, box-shadow 0.3s ease, background 0.3s ease;
}

.btn:hover {
  transform: translateY(-2px);
}

.btn-primary {
  color: white;
  background: linear-gradient(130deg, #6128ff, #9b62ff);
  box-shadow: 0 10px 32px rgba(108, 59, 255, 0.4);
}

.btn-primary:hover {
  box-shadow: 0 18px 38px rgba(108, 59, 255, 0.5);
}

.btn-secondary {
  color: var(--text);
  border-color: var(--border);
  background: rgba(255, 255, 255, 0.02);
}

.hero-card,
.glass,
.project-card,
.terminal,
.metrics {
  background: var(--glass);
  border: 1px solid var(--border);
  backdrop-filter: blur(18px) saturate(140%);
  border-radius: var(--radius);
}

.hero-card {
  padding: 1.5rem;
}

.hero-card ul {
  list-style: none;
  margin-top: 1rem;
  color: var(--muted);
}

.hero-card li + li {
  margin-top: 0.55rem;
}

.section-head {
  margin-bottom: 2rem;
}

.section-head h2 {
  font-size: clamp(1.5rem, 2.8vw, 2.6rem);
  max-width: 20ch;
}

.about-grid,
.contact-grid,
.work-grid,
.skills-layout {
  display: grid;
  gap: 1rem;
}

.about-grid,
.contact-grid,
.skills-layout {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.glass {
  padding: 1.3rem 1.2rem;
}

.glass p {
  color: var(--muted);
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.project-card {
  padding: 1.3rem;
  position: relative;
  overflow: hidden;
  transition: transform 0.35s ease, border-color 0.35s ease;
}

.project-card::before {
  content: "";
  position: absolute;
  inset: -2px;
  background: linear-gradient(130deg, rgba(108, 59, 255, 0.45), rgba(180, 135, 255, 0.24));
  opacity: 0;
  transition: opacity 0.35s ease;
  z-index: -1;
}

.project-card:hover {
  transform: translateY(-6px);
  border-color: rgba(108, 59, 255, 0.5);
}

.project-card:hover::before {
  opacity: 1;
}

.project-card p {
  color: var(--muted);
}

.stack {
  margin-top: 0.7rem;
  margin-bottom: 1rem;
  font-size: 0.92rem;
}

.btn-link {
  color: #e0d1ff;
  text-decoration: none;
  font-weight: 700;
}

.btn-link:hover {
  color: white;
}

.skill-list {
  display: grid;
  gap: 0.8rem;
  margin-top: 0.8rem;
}

.skill-item span {
  display: inline-block;
  margin-bottom: 0.35rem;
}

.bar {
  width: 100%;
  height: 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.bar i {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--primary), #b489ff);
  box-shadow: 0 0 15px rgba(108, 59, 255, 0.65);
  transition: width 1.1s ease;
}

.interest-list {
  list-style: none;
  margin-top: 1rem;
}

.interest-list li {
  padding: 0.55rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--muted);
}

.work-grid {
  grid-template-columns: 1.2fr 0.8fr;
}

.terminal {
  overflow: hidden;
}

.terminal header {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.75rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.terminal header p {
  margin-left: 0.4rem;
  color: #b8abd9;
  font-size: 0.9rem;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.red { background: #ff5f57; }
.yellow { background: #ffbd2e; }
.green { background: #28c840; }

.terminal-body {
  min-height: 220px;
  padding: 1rem;
  color: #e0d4ff;
  font-family: "Consolas", "Courier New", monospace;
  font-size: 0.9rem;
}

.metrics h3 {
  margin-bottom: 0.6rem;
}

.metric-cards {
  margin-top: 1rem;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.7rem;
}

.metric-cards div {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 0.75rem;
  text-align: center;
}

.metric-cards strong {
  display: block;
  font-size: 1.1rem;
}

.contact form {
  display: grid;
  gap: 0.8rem;
}

.form-status {
  min-height: 1.2rem;
  font-size: 0.9rem;
  color: #c8b8eb;
}

.form-status.success {
  color: #baf7c8;
}

.form-status.error {
  color: #ffb8c8;
}

.mailto-fallback-link {
  color: #ffd6e2;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.mailto-fallback-link:hover {
  color: #ffffff;
}

.hp-field {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

#sendMessageBtn:disabled {
  opacity: 0.65;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

label {
  display: grid;
  gap: 0.35rem;
  font-size: 0.95rem;
}

input,
textarea {
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  padding: 0.65rem 0.75rem;
  font: inherit;
}

input:focus,
textarea:focus {
  outline: none;
  border-color: rgba(108, 59, 255, 0.8);
  box-shadow: 0 0 0 3px rgba(108, 59, 255, 0.2);
}

.footer {
  width: var(--container);
  margin: 0 auto;
  padding: 2rem 0 2.6rem;
  text-align: center;
  color: #b59ecf;
  border-top: 1px solid rgba(255, 255, 255, 0.09);
}

.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.65s ease, transform 0.65s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

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

@media (max-width: 960px) {
  .hero,
  .work-grid,
  .about-grid,
  .contact-grid,
  .skills-layout,
  .project-grid {
    grid-template-columns: 1fr;
  }

  .topbar {
    flex-wrap: wrap;
    gap: 0.7rem;
  }

  .header-tools {
    margin-left: auto;
  }

  .menu-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.02);
    color: var(--text);
    padding: 0.45rem 0.75rem;
    border-radius: 999px;
    cursor: pointer;
  }

  .nav-links {
    width: 100%;
    display: none;
    padding-top: 0.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
  }

  .nav-links.open {
    display: flex;
    flex-wrap: wrap;
    gap: 0.9rem;
  }
}
