/* ===== Variables & Reset ===== */
:root {
  --bg: #070912;
  --bg-soft: #0d1020;
  --bg-card: #11152a;
  --border: rgba(255, 255, 255, 0.08);
  --text: #e8eaf2;
  --muted: #9aa0b5;
  --primary: #6c5ce7;
  --primary-2: #00d2ff;
  --accent: #ff6bcb;
  --grad: linear-gradient(120deg, #6c5ce7, #00d2ff 55%, #ff6bcb);
  --radius: 18px;
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
  --maxw: 1160px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 90px; }

body {
  font-family: "Inter", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  overflow-x: hidden;
}

h1, h2, h3, .brand-text, .hero-title, .section-title {
  font-family: "Space Grotesk", sans-serif;
  line-height: 1.15;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 22px; }

.gradient-text {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* ===== Animated Background ===== */
.bg-grid {
  position: fixed; inset: 0; z-index: -3;
  background-image:
    linear-gradient(rgba(108, 92, 231, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 210, 255, 0.06) 1px, transparent 1px);
  background-size: 46px 46px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 40%, transparent 100%);
}
.bg-glow {
  position: fixed; z-index: -2; border-radius: 50%;
  filter: blur(120px); opacity: 0.55; pointer-events: none;
}
.glow-1 { width: 480px; height: 480px; background: #6c5ce7; top: -120px; left: -80px; animation: float1 16s ease-in-out infinite; }
.glow-2 { width: 420px; height: 420px; background: #00d2ff; bottom: -120px; right: -60px; animation: float2 18s ease-in-out infinite; }
@keyframes float1 { 50% { transform: translate(60px, 80px) scale(1.1); } }
@keyframes float2 { 50% { transform: translate(-50px, -60px) scale(1.15); } }

/* ===== Navbar ===== */
.navbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  transition: background 0.3s, box-shadow 0.3s, padding 0.3s;
  padding: 18px 0;
}
.navbar.scrolled {
  background: rgba(7, 9, 18, 0.8);
  backdrop-filter: blur(14px);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.35);
  border-bottom: 1px solid var(--border);
  padding: 12px 0;
}
.nav-inner { display: flex; align-items: center; justify-content: space-between; }
.brand { display: flex; align-items: center; gap: 12px; font-weight: 700; }
.brand-mark {
  display: grid; place-items: center;
  width: 40px; height: 40px; border-radius: 12px;
  background: var(--grad); color: #fff; font-family: "Space Grotesk";
  font-weight: 700; box-shadow: 0 6px 18px rgba(108, 92, 231, 0.5);
}
.brand-text { font-size: 1.05rem; }
.nav-links { display: flex; align-items: center; gap: 6px; }
.nav-link {
  padding: 9px 14px; border-radius: 10px; color: var(--muted);
  font-size: 0.94rem; font-weight: 500; transition: color 0.2s, background 0.2s;
}
.nav-link:hover { color: var(--text); background: rgba(255, 255, 255, 0.05); }
.nav-cta {
  background: var(--grad); color: #fff !important; font-weight: 600;
  box-shadow: 0 6px 18px rgba(108, 92, 231, 0.4);
}
.nav-cta:hover { transform: translateY(-1px); }
.nav-toggle { display: none; flex-direction: column; gap: 5px; background: none; border: 0; cursor: pointer; padding: 6px; }
.nav-toggle span { width: 26px; height: 2.5px; background: var(--text); border-radius: 2px; transition: 0.3s; }
.nav-toggle.open span:nth-child(1) { transform: translateY(7.5px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-7.5px) rotate(-45deg); }

/* ===== Buttons ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 13px 26px; border-radius: 12px; font-weight: 600; font-size: 0.96rem;
  cursor: pointer; border: 1px solid transparent; transition: transform 0.2s, box-shadow 0.2s, background 0.2s;
}
.btn-primary { background: var(--grad); color: #fff; box-shadow: 0 10px 26px rgba(108, 92, 231, 0.45); }
.btn-primary:hover { transform: translateY(-3px); box-shadow: 0 16px 34px rgba(108, 92, 231, 0.55); }
.btn-ghost { background: rgba(255, 255, 255, 0.04); border-color: var(--border); color: var(--text); }
.btn-ghost:hover { background: rgba(255, 255, 255, 0.09); transform: translateY(-3px); }
.btn-full { width: 100%; }

/* ===== Hero ===== */
.hero { position: relative; padding: 160px 0 90px; min-height: 100vh; display: flex; align-items: center; }
.hero-inner { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 50px; align-items: center; width: 100%; }
.eyebrow {
  display: inline-block; font-size: 0.82rem; letter-spacing: 0.5px; color: var(--primary-2);
  background: rgba(0, 210, 255, 0.08); border: 1px solid rgba(0, 210, 255, 0.2);
  padding: 7px 14px; border-radius: 100px; margin-bottom: 22px; font-weight: 500;
}
.hero-title { font-size: clamp(2.4rem, 5.5vw, 4rem); font-weight: 700; margin-bottom: 18px; }
.hero-sub { color: var(--muted); font-size: 1.1rem; max-width: 540px; margin-bottom: 30px; }
.hero-sub strong { color: var(--text); }
.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 44px; }
.hero-stats { display: flex; gap: 36px; flex-wrap: wrap; }
.stat { display: flex; flex-direction: column; }
.stat-num { font-family: "Space Grotesk"; font-size: 2rem; font-weight: 700; }
.stat-num::after { content: "+"; color: var(--primary-2); }
.stat-label { color: var(--muted); font-size: 0.85rem; }

/* Code window */
.code-window {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); overflow: hidden; transform: perspective(900px) rotateY(-8deg) rotateX(3deg);
  transition: transform 0.5s;
}
.code-window:hover { transform: perspective(900px) rotateY(0) rotateX(0); }
.code-bar { display: flex; align-items: center; gap: 8px; padding: 12px 16px; background: rgba(255, 255, 255, 0.03); border-bottom: 1px solid var(--border); }
.dot { width: 12px; height: 12px; border-radius: 50%; }
.dot.red { background: #ff5f57; } .dot.yellow { background: #febc2e; } .dot.green { background: #28c840; }
.code-title { margin-left: 10px; color: var(--muted); font-size: 0.82rem; font-family: monospace; }
.code-body { padding: 22px; font-family: "Fira Code", monospace; font-size: 0.92rem; line-height: 1.8; overflow-x: auto; }
.c-key { color: #ff6bcb; } .c-var { color: #00d2ff; } .c-prop { color: #c8b3ff; }
.c-str { color: #7ee787; } .c-num { color: #ffab70; }

/* Hero photo */
.photo-frame { position: relative; max-width: 420px; margin: 0 auto; }
.photo-glow {
  position: absolute; inset: 6% 4% 10%; border-radius: 50%;
  background: var(--grad); filter: blur(46px); opacity: 0.55; z-index: 0;
  animation: pulseGlow 6s ease-in-out infinite;
}
@keyframes pulseGlow { 50% { opacity: 0.8; transform: scale(1.04); } }
.photo-ring {
  position: relative; z-index: 1; border-radius: 28px; padding: 3px;
  background: linear-gradient(150deg, rgba(108,92,231,0.9), rgba(0,210,255,0.5) 45%, rgba(255,107,203,0.7));
  box-shadow: var(--shadow);
}
.photo-ring::before {
  content: ""; position: absolute; inset: 3px; border-radius: 26px;
  background: radial-gradient(120% 90% at 50% 0%, rgba(0,210,255,0.18), rgba(13,16,32,0.95) 70%);
  z-index: 0;
}
.hero-photo {
  position: relative; z-index: 1; width: 100%; display: block;
  border-radius: 26px; filter: drop-shadow(0 18px 30px rgba(0,0,0,0.5));
  animation: floatPhoto 5s ease-in-out infinite;
}
@keyframes floatPhoto { 50% { transform: translateY(-12px); } }

.photo-badge {
  position: absolute; z-index: 3; background: rgba(17, 21, 42, 0.82);
  backdrop-filter: blur(10px); border: 1px solid var(--border); border-radius: 14px;
  padding: 10px 14px; font-size: 0.85rem; font-weight: 600; box-shadow: 0 10px 30px rgba(0,0,0,0.4);
  display: flex; align-items: center; gap: 8px;
}
.badge-top { top: 18px; left: -18px; animation: floatBadge 4s ease-in-out infinite; }
.badge-bottom { bottom: 26px; right: -16px; flex-direction: column; gap: 0; align-items: flex-start; animation: floatBadge 4.6s ease-in-out infinite 0.4s; }
.badge-bottom strong { font-family: "Space Grotesk"; font-size: 1.25rem; color: var(--primary-2); line-height: 1.1; }
.badge-bottom span { font-size: 0.74rem; color: var(--muted); font-weight: 500; }
.badge-side { bottom: 38%; left: -26px; animation: floatBadge 5s ease-in-out infinite 0.8s; }
.badge-dot { width: 9px; height: 9px; border-radius: 50%; background: #28c840; box-shadow: 0 0 0 4px rgba(40,200,64,0.2); }
@keyframes floatBadge { 50% { transform: translateY(-9px); } }

/* Scroll cue */
.scroll-cue { position: absolute; bottom: 28px; left: 50%; transform: translateX(-50%); width: 26px; height: 42px; border: 2px solid var(--border); border-radius: 20px; display: grid; place-items: start center; padding-top: 8px; }
.scroll-cue span { width: 5px; height: 8px; background: var(--primary-2); border-radius: 4px; animation: scrollDot 1.6s infinite; }
@keyframes scrollDot { 0% { opacity: 0; transform: translateY(0); } 40% { opacity: 1; } 80% { opacity: 0; transform: translateY(14px); } }

/* ===== Sections ===== */
.section { padding: 100px 0; position: relative; }
.section-alt { background: var(--bg-soft); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.section-head { text-align: center; max-width: 720px; margin: 0 auto 56px; }
.section-tag { color: var(--primary-2); font-weight: 600; font-size: 0.85rem; letter-spacing: 1px; text-transform: uppercase; }
.section-title { font-size: clamp(1.9rem, 4vw, 2.8rem); margin: 12px 0; }
.section-desc { color: var(--muted); font-size: 1.05rem; }

/* About */
.about-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 50px; align-items: center; }
.about-text p { color: var(--muted); margin-bottom: 18px; }
.about-text strong { color: var(--text); }
.about-text .btn { margin-top: 10px; }
.about-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.info-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; transition: transform 0.3s, border-color 0.3s; }
.info-card:hover { transform: translateY(-6px); border-color: rgba(108, 92, 231, 0.5); }
.info-icon { font-size: 1.8rem; margin-bottom: 12px; }
.info-card h3 { font-size: 1.1rem; margin-bottom: 6px; }
.info-card p { color: var(--muted); font-size: 0.9rem; }

/* Skills */
.skills-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 28px 50px; max-width: 900px; margin: 0 auto; }
.skill-top { display: flex; justify-content: space-between; margin-bottom: 10px; font-weight: 500; }
.skill-top span:last-child { color: var(--primary-2); }
.bar { height: 9px; background: rgba(255, 255, 255, 0.06); border-radius: 100px; overflow: hidden; }
.bar i { display: block; height: 100%; width: 0; background: var(--grad); border-radius: 100px; transition: width 1.4s cubic-bezier(.2,.8,.2,1); }
.bar.animate i { width: var(--w); }

/* Projects */
.projects-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 26px; }
.project-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; transition: transform 0.3s, border-color 0.3s, box-shadow 0.3s; display: flex; flex-direction: column; }
.project-card:hover { transform: translateY(-8px); border-color: rgba(0, 210, 255, 0.4); box-shadow: var(--shadow); }
.project-thumb { height: 150px; display: grid; place-items: center; position: relative; overflow: hidden; }
.project-emoji { font-size: 3rem; position: relative; z-index: 1; transition: transform 0.4s; }
.project-card:hover .project-emoji { transform: scale(1.2) rotate(-6deg); }
.thumb-1 { background: linear-gradient(135deg, #6c5ce7, #00d2ff); }
.thumb-2 { background: linear-gradient(135deg, #ff6bcb, #6c5ce7); }
.thumb-3 { background: linear-gradient(135deg, #00d2ff, #28c840); }
.thumb-4 { background: linear-gradient(135deg, #febc2e, #ff6bcb); }
.thumb-5 { background: linear-gradient(135deg, #6c5ce7, #ff6bcb); }
.thumb-6 { background: linear-gradient(135deg, #00d2ff, #6c5ce7); }
.project-body { padding: 22px; flex: 1; display: flex; flex-direction: column; }
.project-tag { font-size: 0.74rem; text-transform: uppercase; letter-spacing: 1px; color: var(--primary-2); font-weight: 600; }
.project-body h3 { font-size: 1.25rem; margin: 8px 0 10px; }
.project-body p { color: var(--muted); font-size: 0.92rem; flex: 1; }
.project-tech { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0; }
.project-tech span { font-size: 0.74rem; padding: 4px 10px; border-radius: 100px; background: rgba(255, 255, 255, 0.05); border: 1px solid var(--border); color: var(--muted); }
.project-link { color: var(--primary-2); font-weight: 600; font-size: 0.92rem; transition: gap 0.2s; }
.project-link:hover { letter-spacing: 0.3px; }

/* Classes */
.classes-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 26px; align-items: stretch; }
.class-card { position: relative; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 32px 26px; transition: transform 0.3s, border-color 0.3s; display: flex; flex-direction: column; }
.class-card:hover { transform: translateY(-6px); }
.class-card.featured { border-color: rgba(108, 92, 231, 0.6); box-shadow: 0 14px 50px rgba(108, 92, 231, 0.25); transform: scale(1.03); }
.class-card.featured:hover { transform: scale(1.03) translateY(-6px); }
.popular { position: absolute; top: -13px; left: 50%; transform: translateX(-50%); background: var(--grad); color: #fff; font-size: 0.74rem; font-weight: 600; padding: 5px 16px; border-radius: 100px; white-space: nowrap; }
.class-card h3 { font-size: 1.3rem; }
.class-price { color: var(--primary-2); font-weight: 600; margin: 4px 0 18px; }
.class-card ul { list-style: none; margin-bottom: 24px; flex: 1; }
.class-card li { color: var(--muted); padding: 8px 0 8px 26px; position: relative; font-size: 0.94rem; border-bottom: 1px solid var(--border); }
.class-card li::before { content: "✓"; position: absolute; left: 0; color: var(--primary-2); font-weight: 700; }

/* Contact */
.contact-grid { display: grid; grid-template-columns: 0.9fr 1.1fr; gap: 36px; }
.contact-info { display: flex; flex-direction: column; gap: 16px; }
.contact-item { display: flex; align-items: center; gap: 16px; background: var(--bg-card); border: 1px solid var(--border); border-radius: 14px; padding: 18px 20px; transition: transform 0.25s, border-color 0.25s; }
a.contact-item:hover { transform: translateX(6px); border-color: rgba(0, 210, 255, 0.4); }
.contact-ic { font-size: 1.5rem; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; background: rgba(255, 255, 255, 0.04); }
.contact-item span:last-child { display: flex; flex-direction: column; font-size: 0.95rem; }
.contact-item strong { font-family: "Space Grotesk"; font-size: 0.8rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.5px; }
.contact-form { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 30px; }
.field { margin-bottom: 18px; }
.field label { display: block; font-size: 0.88rem; margin-bottom: 7px; color: var(--muted); font-weight: 500; }
.field input, .field textarea {
  width: 100%; background: var(--bg-soft); border: 1px solid var(--border); border-radius: 12px;
  padding: 13px 15px; color: var(--text); font-family: inherit; font-size: 0.95rem; resize: vertical; transition: border-color 0.2s, box-shadow 0.2s;
}
.field input:focus, .field textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(108, 92, 231, 0.2); }
.form-note { margin-top: 14px; padding: 12px 16px; border-radius: 10px; font-size: 0.9rem; background: rgba(40, 200, 64, 0.12); border: 1px solid rgba(40, 200, 64, 0.4); color: #7ee787; }

/* ===== Footer ===== */
.footer { border-top: 1px solid var(--border); padding: 44px 0; background: var(--bg-soft); }
.footer-inner { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 24px; }
.footer-brand { display: flex; align-items: center; gap: 14px; }
.footer-brand p { color: var(--muted); font-size: 0.85rem; }
.footer-links { display: flex; gap: 22px; flex-wrap: wrap; }
.footer-links a { color: var(--muted); font-size: 0.92rem; transition: color 0.2s; }
.footer-links a:hover { color: var(--text); }
.footer-copy { color: var(--muted); font-size: 0.85rem; width: 100%; text-align: center; padding-top: 22px; border-top: 1px solid var(--border); }

/* ===== Reveal Animation ===== */
.reveal { opacity: 0; transform: translateY(36px); transition: opacity 0.7s ease, transform 0.7s ease; }
.reveal.visible { opacity: 1; transform: translateY(0); }

/* ===== Responsive ===== */
@media (max-width: 900px) {
  .hero-inner { grid-template-columns: 1fr; gap: 40px; }
  .hero-card { order: -1; max-width: 460px; }
  .about-grid, .contact-grid { grid-template-columns: 1fr; }
  .skills-grid { grid-template-columns: 1fr; gap: 22px; }
  .projects-grid { grid-template-columns: repeat(2, 1fr); }
  .classes-grid { grid-template-columns: 1fr; max-width: 460px; margin: 0 auto; }
  .class-card.featured { transform: scale(1); }
  .class-card.featured:hover { transform: translateY(-6px); }
}

@media (max-width: 760px) {
  .nav-links {
    position: fixed; top: 0; right: 0; height: 100vh; width: min(78%, 320px);
    flex-direction: column; align-items: flex-start; justify-content: center; gap: 10px;
    background: var(--bg-soft); border-left: 1px solid var(--border); padding: 40px 30px;
    transform: translateX(100%); transition: transform 0.35s ease; box-shadow: -20px 0 60px rgba(0,0,0,0.5);
  }
  .nav-links.open { transform: translateX(0); }
  .nav-links .nav-link { width: 100%; font-size: 1.05rem; padding: 12px 14px; }
  .nav-toggle { display: flex; z-index: 110; }
  .hero { padding-top: 130px; }
  .section { padding: 72px 0; }
  .hero-stats { gap: 24px; }
}

@media (max-width: 520px) {
  .projects-grid { grid-template-columns: 1fr; }
  .about-cards { grid-template-columns: 1fr; }
  .brand-text { display: none; }
  .hero-actions .btn { flex: 1; }
  .footer-inner { flex-direction: column; text-align: center; }
  .photo-frame { max-width: 300px; }
  .photo-badge { font-size: 0.76rem; padding: 8px 11px; }
  .badge-top { left: -6px; }
  .badge-bottom { right: -6px; }
  .badge-side { left: -10px; }
  .badge-bottom strong { font-size: 1.05rem; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
}
