:root {
  --bg: #05060f;
  --panel: rgba(13, 16, 32, 0.55);
  --line: rgba(255, 255, 255, 0.08);
  --text: #e8ecf8;
  --muted: #8b93ad;
  --cyan: #00f0ff;
  --violet: #8b5cf6;
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", sans-serif;
  overflow-x: hidden;
}

::selection { background: rgba(0, 240, 255, 0.25); }

::-webkit-scrollbar { width: 9px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb {
  background: linear-gradient(var(--cyan), var(--violet));
  border-radius: 99px;
}

#bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  display: block;
}

body.no-webgl #bg { display: none; }
body.no-webgl::before {
  content: "";
  position: fixed;
  inset: -10%;
  z-index: 0;
  background:
    radial-gradient(55% 45% at 18% 22%, rgba(0, 240, 255, 0.13), transparent 60%),
    radial-gradient(50% 40% at 82% 28%, rgba(139, 92, 246, 0.15), transparent 60%),
    radial-gradient(45% 40% at 50% 85%, rgba(255, 122, 217, 0.09), transparent 60%);
  animation: drift 16s ease-in-out infinite alternate;
}
@keyframes drift {
  to { transform: scale(1.12) translateY(-2%); filter: hue-rotate(25deg); }
}

main { position: relative; z-index: 1; }

#loader {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  gap: 22px;
  align-items: center;
  justify-content: center;
  transition: opacity 0.7s ease, visibility 0.7s;
}
#loader.done { opacity: 0; visibility: hidden; }
.loader-ring {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.08);
  border-top-color: var(--cyan);
  animation: spin 0.9s linear infinite;
}
#loader p {
  font-family: "JetBrains Mono", monospace;
  font-size: 12px;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--muted);
}
@keyframes spin { to { transform: rotate(360deg); } }

nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px clamp(20px, 6vw, 72px);
  background: linear-gradient(rgba(5, 6, 15, 0.75), transparent);
  backdrop-filter: blur(2px);
}
.logo {
  font-family: "Space Grotesk", sans-serif;
  font-weight: 700;
  font-size: 24px;
  color: var(--text);
  text-decoration: none;
}
.logo span { color: var(--cyan); }
.nav-links {
  display: flex;
  gap: 30px;
  list-style: none;
}
.nav-links a {
  position: relative;
  color: var(--muted);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: color 0.25s;
}
.nav-links a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -6px;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--cyan), var(--violet));
  transition: width 0.3s;
}
.nav-links a:hover, .nav-links a.active { color: var(--text); }
.nav-links a:hover::after, .nav-links a.active::after { width: 100%; }
.nav-resume {
  font-family: "JetBrains Mono", monospace;
  font-size: 13px;
  color: var(--cyan);
  text-decoration: none;
  border: 1px solid rgba(0, 240, 255, 0.4);
  border-radius: 8px;
  padding: 8px 16px;
  transition: background 0.25s, box-shadow 0.25s;
}
.nav-resume:hover {
  background: rgba(0, 240, 255, 0.08);
  box-shadow: 0 0 24px rgba(0, 240, 255, 0.25);
}

section {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 110px clamp(20px, 6vw, 72px) 60px;
}
.container { width: min(1100px, 100%); }

.reveal {
  opacity: 0;
  transform: translateY(36px);
  transition: opacity 0.9s ease, transform 0.9s ease;
}
.reveal.visible { opacity: 1; transform: none; }

.hero { max-width: 860px; }
.eyebrow {
  font-family: "JetBrains Mono", monospace;
  color: var(--cyan);
  font-size: 15px;
  margin-bottom: 18px;
}
h1 {
  font-family: "Space Grotesk", sans-serif;
  font-size: clamp(56px, 11vw, 128px);
  line-height: 0.95;
  letter-spacing: -2px;
  margin-bottom: 26px;
  min-height: 1.9em;
}
h1 span.grad {
  background: linear-gradient(90deg, var(--cyan), var(--violet));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.type-line.typing::after {
  content: "";
  display: inline-block;
  width: 0.07em;
  height: 0.82em;
  margin-left: 0.06em;
  vertical-align: -0.04em;
  background: var(--cyan);
  box-shadow: 0 0 14px rgba(0, 240, 255, 0.8);
  animation: blink 0.9s steps(2, start) infinite;
}
@keyframes blink { to { visibility: hidden; } }
.tagline {
  font-size: clamp(16px, 2vw, 19px);
  line-height: 1.7;
  color: var(--muted);
  max-width: 640px;
  margin-bottom: 38px;
}
.tagline b { color: var(--text); font-weight: 600; }
.hero-actions { display: flex; gap: 16px; flex-wrap: wrap; }
.btn {
  font-family: "Space Grotesk", sans-serif;
  font-weight: 600;
  font-size: 15px;
  text-decoration: none;
  padding: 14px 28px;
  border-radius: 12px;
  transition: transform 0.25s, box-shadow 0.25s, background 0.25s;
}
.btn.primary {
  color: #04121a;
  background: linear-gradient(90deg, var(--cyan), #4dd8ff);
  box-shadow: 0 8px 32px rgba(0, 240, 255, 0.3);
}
.btn.primary:hover { transform: translateY(-3px); box-shadow: 0 12px 40px rgba(0, 240, 255, 0.45); }
.btn.ghost {
  color: var(--text);
  border: 1px solid var(--line);
  background: var(--panel);
  backdrop-filter: blur(12px);
}
.btn.ghost:hover { transform: translateY(-3px); border-color: rgba(139, 92, 246, 0.6); }
.scroll-hint {
  margin-top: 70px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: "JetBrains Mono", monospace;
  font-size: 12px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--muted);
}
.scroll-hint span {
  width: 44px;
  height: 1px;
  background: linear-gradient(90deg, var(--cyan), transparent);
  animation: pulse-line 2s ease-in-out infinite;
}
@keyframes pulse-line { 50% { opacity: 0.3; } }

.section-title {
  font-family: "Space Grotesk", sans-serif;
  font-size: clamp(30px, 4.5vw, 44px);
  margin-bottom: 46px;
  letter-spacing: -1px;
}
.section-title .num {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.55em;
  color: var(--cyan);
  vertical-align: super;
  margin-right: 14px;
}
.section-title.center { text-align: center; }

.glass {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 18px;
  backdrop-filter: blur(14px);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
}
.card { padding: 30px; transition: transform 0.3s, border-color 0.3s; }
.card:hover { transform: translateY(-5px); border-color: rgba(0, 240, 255, 0.35); }

.about-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 24px;
  align-items: start;
}
.about-text p { line-height: 1.85; color: var(--muted); }
.about-text p + p { margin-top: 18px; }
.about-text b { color: var(--text); }
.about-side { display: grid; gap: 24px; }
.stat-card h3 {
  font-family: "JetBrains Mono", monospace;
  font-size: 12px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--cyan);
  margin-bottom: 12px;
}
.stat-big {
  font-family: "Space Grotesk", sans-serif;
  font-size: 42px;
  font-weight: 700;
  line-height: 1;
  margin-bottom: 8px;
}
.stat-card p { color: var(--muted); font-size: 14px; line-height: 1.6; }
.stat-card b { color: var(--text); }
.muted { color: var(--muted); }

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 24px;
}
.project-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
}
.project-icon { font-size: 26px; color: var(--cyan); }
.project-date {
  font-family: "JetBrains Mono", monospace;
  font-size: 12px;
  color: var(--muted);
}
.project-card h3 {
  font-family: "Space Grotesk", sans-serif;
  font-size: 24px;
  margin-bottom: 6px;
}
.project-sub { color: var(--violet); font-size: 14px; margin-bottom: 18px; }
.project-card ul { list-style: none; margin-bottom: 22px; }
.project-card li {
  position: relative;
  padding-left: 20px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.65;
  margin-bottom: 9px;
}
.project-card li::before {
  content: "\25B8";
  position: absolute;
  left: 0;
  color: var(--cyan);
}

.tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tags span {
  font-family: "JetBrains Mono", monospace;
  font-size: 12px;
  color: var(--cyan);
  background: rgba(0, 240, 255, 0.06);
  border: 1px solid rgba(0, 240, 255, 0.18);
  padding: 5px 12px;
  border-radius: 99px;
}

.showcase-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
  gap: 24px;
}
.showcase-card {
  position: relative;
  overflow: hidden;
}
.showcase-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(60% 40% at 50% 0%, rgba(139, 92, 246, 0.12), transparent 70%);
  pointer-events: none;
}
.showcase-card h3 { font-size: 30px; }
.project-links { display: flex; align-items: center; gap: 10px; }
.badge {
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--violet);
  border: 1px solid rgba(139, 92, 246, 0.4);
  background: rgba(139, 92, 246, 0.08);
  padding: 4px 10px;
  border-radius: 99px;
}
.live-link {
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--cyan);
  text-decoration: none;
  border: 1px solid rgba(0, 240, 255, 0.35);
  padding: 4px 10px;
  border-radius: 99px;
  transition: background 0.25s, box-shadow 0.25s;
}
.live-link:hover {
  background: rgba(0, 240, 255, 0.08);
  box-shadow: 0 0 18px rgba(0, 240, 255, 0.3);
}

.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
}
.skill-group h3 {
  font-family: "JetBrains Mono", monospace;
  font-size: 12px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--violet);
  margin-bottom: 16px;
}

.contact-wrap { text-align: center; }
.contact-lead { color: var(--muted); margin-bottom: 34px; font-size: 17px; }
.contact-email {
  display: inline-block;
  font-family: "Space Grotesk", sans-serif;
  font-size: clamp(22px, 4vw, 38px);
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
  margin-bottom: 40px;
  background: linear-gradient(90deg, var(--cyan), var(--violet));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  transition: filter 0.3s;
}
.contact-email:hover { filter: brightness(1.3); }
.socials {
  display: flex;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 80px;
}
.socials a {
  color: var(--muted);
  text-decoration: none;
  font-size: 14px;
  border: 1px solid var(--line);
  background: var(--panel);
  backdrop-filter: blur(12px);
  padding: 10px 22px;
  border-radius: 99px;
  transition: color 0.25s, border-color 0.25s, transform 0.25s;
}
.socials a:hover {
  color: var(--cyan);
  border-color: rgba(0, 240, 255, 0.4);
  transform: translateY(-3px);
}
footer {
  font-family: "JetBrains Mono", monospace;
  font-size: 12px;
  color: var(--muted);
}

@media (max-width: 860px) {
  .about-grid { grid-template-columns: 1fr; }
  .nav-links { display: none; }
}

@media (max-width: 520px) {
  section { padding-left: 18px; padding-right: 18px; }
  .card { padding: 22px; }
  .hero-actions .btn { width: 100%; text-align: center; }
}
