:root {
  --bg: #080b14;
  --surface: rgba(18, 24, 40, 0.76);
  --surface-solid: #121828;
  --surface-soft: rgba(18, 24, 40, 0.52);
  --text: #f5f7ff;
  --muted: #98a2bb;
  --line: rgba(151, 164, 197, 0.18);
  --accent: #8b7cff;
  --accent-2: #38d9c5;
  --shadow: 0 30px 80px rgba(11, 13, 25, 0.42);
}

[data-theme="light"] {
  --bg: #f6f8fc;
  --surface: rgba(255, 255, 255, 0.82);
  --surface-solid: #ffffff;
  --surface-soft: rgba(255, 255, 255, 0.72);
  --text: #172033;
  --muted: #657089;
  --line: rgba(45, 62, 97, 0.14);
  --accent: #6557ed;
  --accent-2: #0b9e8b;
  --shadow: 0 28px 60px rgba(53, 77, 117, 0.1);
}

* { box-sizing: border-box; margin: 0; }
html { scroll-behavior: smooth; }
body {
  min-height: 100vh;
  overflow-x: hidden;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.7 Inter, "Segoe UI", sans-serif;
  letter-spacing: -0.02em;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button, input, textarea { font: inherit; }

.skip-link {
  position: absolute;
  left: -9999px;
  z-index: 999;
  padding: 0.7rem 1rem;
  border-radius: 0.5rem;
  background: var(--accent);
  color: #fff;
}
.skip-link:focus { left: 1rem; top: 1rem; }

.background-glow {
  position: fixed;
  width: 430px;
  height: 430px;
  border-radius: 50%;
  filter: blur(60px);
  opacity: 0.35;
  pointer-events: none;
  z-index: -1;
  background: var(--accent);
}
.glow-one { top: -120px; left: -80px; }
.glow-two { right: -100px; bottom: -120px; background: var(--accent-2); }

.site-header {
  position: relative;
  width: min(1120px, calc(100% - 40px));
  height: 88px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand { font-size: 1.6rem; font-weight: 800; letter-spacing: -0.06em; color: var(--text); flex-shrink: 0; }
.brand span { color: var(--accent-2); }

#main-nav { display: flex; align-items: center; gap: 1.3rem; font-size: 0.95rem; color: var(--muted); flex: 1; justify-content: center; }
#main-nav a { position: relative; display: inline-block; padding: 0.35rem 0 0.18rem; transition: color 0.2s ease; white-space: nowrap; }
#main-nav a:hover, #main-nav a.active, #main-nav a:focus-visible { color: var(--text); }
#main-nav a::after { content: ""; position: absolute; left: 0; bottom: -0.1rem; width: 0; height: 2px; background: var(--accent-2); border-radius: 999px; transition: width 0.25s ease; }
#main-nav a:hover::after, #main-nav a.active::after, #main-nav a:focus-visible::after { width: 100%; }

.header-actions { display: flex; align-items: center; gap: 0.6rem; margin-left: auto; flex-shrink: 0; }
.header-icon-btn, .nav-toggle { width: 44px; height: 44px; border: 1px solid var(--line); border-radius: 10px; color: var(--text); background: var(--surface); cursor: pointer; transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease; }
.header-icon-btn:hover, .header-icon-btn:focus-visible, .nav-toggle:hover, .nav-toggle:focus-visible { transform: translateY(-1px); border-color: var(--accent-2); background: rgba(56, 217, 197, 0.15); }
.nav-toggle { display: none; }

.container { width: min(1120px, calc(100% - 40px)); margin: 0 auto; }

.hero {
  min-height: 660px;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  align-items: center;
  gap: 5rem;
  padding: 4.5rem 0 3rem;
}

.hero-copy { display: grid; gap: 1.1rem; }

.eyebrow { display: inline-flex; align-items: center; gap: 0.7rem; font-size: 0.74rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); font-weight: 700; width: fit-content; }
.eyebrow span { width: 36px; height: 1px; background: linear-gradient(90deg, var(--accent-2), var(--accent)); }

.hero h1 { font-size: clamp(2.7rem, 5vw, 4.5rem); line-height: 0.96; letter-spacing: -0.065em; max-width: 12ch; }
.hero h1 em { color: var(--accent-2); font-style: normal; }

.hero-text { max-width: 62ch; color: var(--muted); font-size: 1.06rem; }

.hero-actions { display: flex; flex-wrap: wrap; gap: 0.9rem; margin-top: 0.4rem; }

.button { display: inline-flex; align-items: center; justify-content: center; gap: 0.6rem; min-height: 46px; padding: 0.8rem 1.2rem; border-radius: 999px; border: 1px solid var(--line); font-weight: 600; transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease; }
.button:hover, .button:focus-visible { transform: translateY(-1px); border-color: var(--accent-2); }
.button-primary { background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff; border-color: transparent; box-shadow: 0 22px 34px rgba(120, 100, 255, 0.45); }
.button-primary:hover { box-shadow: 0 26px 44px rgba(120, 100, 255, 0.55); }
.button-secondary { background: transparent; color: var(--text); }

.social-links { display: flex; align-items: center; flex-wrap: wrap; gap: 0.8rem; margin-top: 0.2rem; }
.social-links a { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: var(--surface); border: 1px solid var(--line); color: var(--text); transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease; }
.social-links a:hover, .social-links a:focus-visible { transform: translateY(-2px); border-color: var(--accent-2); background: rgba(56, 217, 197, 0.15); }

.hero-card { padding: 1rem; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); box-shadow: var(--shadow); transform: rotate(2deg); }

.status { display: inline-flex; align-items: center; gap: 0.6rem; color: var(--muted); font-size: 0.82rem; margin-bottom: 1rem; }
.status span { width: 10px; height: 10px; border-radius: 50%; background: #3ee09a; box-shadow: 0 0 0 4px rgba(62, 224, 154, 0.2); }

.code-window { border: 1px solid var(--line); border-radius: 14px; background: rgba(9, 12, 20, 0.72); overflow: hidden; }
.window-bar { display: flex; align-items: center; gap: 0.5rem; padding: 0.8rem 1rem; border-bottom: 1px solid var(--line); background: rgba(255,255,255,0.03); }
.window-bar span { width: 10px; height: 10px; border-radius: 50%; background: rgba(255,255,255,0.35); }
.window-bar span:nth-child(1) { background: #ff5f57; }
.window-bar span:nth-child(2) { background: #ffbd2e; }
.window-bar span:nth-child(3) { background: #28c840; }
.window-bar b { margin-left: 0.5rem; color: var(--text); font-size: 0.8rem; }
.code-window pre { margin: 0; padding: 1.2rem 1rem 1.3rem; color: #dfe7ff; font-size: 0.9rem; line-height: 1.8; overflow-x: auto; }
.code-window i { color: #68d3ff; font-style: normal; }
.code-window strong { color: #fff; }
.code-window u { color: #a4ffdb; text-decoration: none; }

.section { padding: 4.5rem 0; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 1.5rem; margin-bottom: 2.2rem; }
.section-heading h2, .contact-card h2 { font-size: clamp(2rem, 3vw, 2.6rem); line-height: 1.1; letter-spacing: -0.05em; }
.section-heading h2 span { color: var(--accent-2); }

.about-grid, .profile-grid, .projects-grid, .skills-grid { display: grid; gap: 1rem; }
.about-grid { grid-template-columns: 1.35fr 1fr; align-items: start; }
.about-text { display: grid; gap: 1rem; color: var(--muted); }
.skill-stat { display: flex; align-items: center; gap: 0.9rem; padding: 1rem 1.1rem; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); transition: border-color 0.2s ease, background 0.2s ease; }
.skill-stat:hover { border-color: var(--accent-2); background: rgba(56, 217, 197, 0.05); }
.skill-stat + .skill-stat { margin-top: 1rem; }
.stat-icon { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; background: rgba(56, 217, 197, 0.15); color: var(--accent-2); font-size: 1.1rem; flex-shrink: 0; }
.stat-label { font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin-bottom: 0.15rem; }
.stat-value { color: var(--text); }

.profile-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.profile-card { height: 100%; padding: 1.6rem; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); transition: border-color 0.2s ease, box-shadow 0.2s ease; }
.profile-card:hover { border-color: var(--accent-2); box-shadow: 0 8px 20px rgba(56, 217, 197, 0.1); }
.profile-card h3 { font-size: 1.15rem; margin-bottom: 0.5rem; }
.profile-list { display: grid; gap: 0.8rem; margin-top: 1rem; padding: 0; list-style: none; color: var(--muted); }
.profile-list li { display: flex; gap: 0.7rem; align-items: center; }
.profile-list i, .mini-link i { width: 1.3rem; color: var(--accent-2); text-align: center; font-size: 0.95rem; flex-shrink: 0; }
.link-stack { display: grid; gap: 0.7rem; margin-top: 1.2rem; }
.mini-link { display: inline-flex; gap: 0.7rem; align-items: center; padding: 0.75rem 1rem; border: 1px solid var(--line); border-radius: 10px; color: var(--text); transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease; }
.mini-link:hover, .mini-link:focus-visible { border-color: var(--accent-2); transform: translateX(4px); background: rgba(56, 217, 197, 0.08); }

.skills-grid { grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); }
.skill-tag { display: inline-flex; align-items: center; justify-content: center; min-height: 52px; padding: 0.7rem 0.9rem; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease; }
.skill-tag:hover { border-color: var(--accent-2); background: rgba(56, 217, 197, 0.12); box-shadow: 0 4px 12px rgba(56, 217, 197, 0.15); }

.projects-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.project-card { display: grid; gap: 1rem; min-height: 280px; padding: 1.5rem; border: 1px solid var(--line); border-radius: 18px; background: linear-gradient(180deg, rgba(18,24,40,0.95), rgba(18,24,40,0.75)); transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease; }
.project-card:hover, .project-card:focus-visible { transform: translateY(-3px); border-color: var(--accent-2); box-shadow: 0 18px 45px rgba(56, 217, 197, 0.2); }
.project-header { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.project-card h3 { font-size: 1.12rem; letter-spacing: -0.03em; }
.project-card p { color: var(--muted); }
.project-tags { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: auto; }
.project-tags span { display: inline-flex; align-items: center; padding: 0.38rem 0.7rem; border-radius: 999px; background: rgba(139, 124, 255, 0.12); border: 1px solid rgba(139, 124, 255, 0.3); color: #a4a1ff; font-size: 0.78rem; }

.contact-card { display: flex; align-items: center; justify-content: space-between; gap: 2rem; margin: 4.5rem 0 5rem; padding: 2.5rem 2rem; border: 1px solid var(--line); border-radius: 18px; background: linear-gradient(135deg, rgba(139, 124, 255, 0.08), rgba(56, 217, 197, 0.08)); transition: border-color 0.2s ease, box-shadow 0.2s ease; }
.contact-card:hover { border-color: var(--accent-2); box-shadow: 0 12px 30px rgba(56, 217, 197, 0.15); }
.contact-card p { color: var(--muted); max-width: 60ch; }
.contact-card > div:last-child { display: flex; flex-wrap: wrap; gap: 0.8rem; }

.scroll-to-top { position: fixed; bottom: 2rem; right: 2rem; width: 48px; height: 48px; border: 1px solid var(--line); border-radius: 50%; background: var(--surface); color: var(--text); cursor: pointer; display: none; align-items: center; justify-content: center; transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease; z-index: 50; }
.scroll-to-top.visible { display: flex; }
.scroll-to-top:hover, .scroll-to-top:focus-visible { transform: translateY(-4px); border-color: var(--accent-2); background: rgba(56, 217, 197, 0.15); box-shadow: 0 8px 20px rgba(56, 217, 197, 0.25); }

footer { display: flex; justify-content: space-between; gap: 1rem; padding: 1rem 0 2.5rem; color: var(--muted); font-size: 0.92rem; }

.reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.6s ease, transform 0.6s ease; }
.reveal.visible { opacity: 1; transform: translateY(0); }

@media (max-width: 1024px) {
  .hero { grid-template-columns: 1fr; gap: 3rem; }
  .section { padding: 3.5rem 0; }
  .section-heading { flex-direction: column; align-items: flex-start; gap: 1rem; }
  .about-grid { grid-template-columns: 1fr; }
  .projects-grid { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  .site-header { position: relative; height: 70px; }
  .nav-toggle { display: flex; border-radius: 50%; }
  #main-nav { display: none; position: absolute; top: calc(100% + 0.5rem); left: 0.5rem; right: 0.5rem; z-index: 100; flex-direction: column; align-items: stretch; padding: 0.7rem; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3); }
  #main-nav.is-open { display: flex; }
  #main-nav a { padding: 0.8rem 1rem; border-bottom: 1px solid var(--line); }
  #main-nav a:last-child { border-bottom: none; }
  #main-nav a::after { display: none; }
  .profile-grid { grid-template-columns: 1fr; }
  .hero { display: block; padding: 4.5rem 0 3rem; }
  .hero-card { margin-top: 2.7rem; transform: none; }
  .section { padding: 2.5rem 0; }
  .contact-card { flex-direction: column; align-items: flex-start; padding: 1.7rem 1.2rem; }
  footer { flex-direction: column; gap: 0.45rem; }
  .scroll-to-top { bottom: 1.5rem; right: 1.5rem; width: 44px; height: 44px; font-size: 1rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, html { scroll-behavior: auto !important; transition-duration: 0.01ms !important; }
  .reveal { opacity: 1; transform: none; }
}
