/* =========================================================
   Portfolio — Main Stylesheet
   Theme: light/dark via [data-theme] on <html>
   ========================================================= */

:root {
  --accent: #6c5ce7;
  --accent-2: #00d2ff;
  --accent-grad: linear-gradient(135deg, var(--accent), var(--accent-2));

  --bg: #f6f7fb;
  --bg-alt: #ffffff;
  --surface: #ffffff;
  --surface-glass: rgba(255, 255, 255, 0.65);
  --text: #171923;
  --text-dim: #5b5f6b;
  --border: rgba(20, 20, 30, 0.08);
  --shadow: 0 10px 30px rgba(30, 30, 60, 0.08);
  --radius: 20px;
}

html[data-theme='dark'] {
  --bg: #0b0c14;
  --bg-alt: #10121c;
  --surface: #151726;
  --surface-glass: rgba(21, 23, 38, 0.6);
  --text: #f2f3f8;
  --text-dim: #9a9db3;
  --border: rgba(255, 255, 255, 0.08);
  --shadow: 0 10px 40px rgba(0, 0, 0, 0.45);
}

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

html { scroll-behavior: smooth; }

body {
  font-family: 'Poppins', 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  transition: background .4s ease, color .4s ease;
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }
a { text-decoration: none; color: inherit; }
ul { list-style: none; }

.container {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 24px;
}

section { padding: 110px 0; position: relative; }
.section-tag {
  display: inline-block;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 12px;
}
.section-title {
  font-size: clamp(28px, 4vw, 42px);
  font-weight: 700;
  margin-bottom: 16px;
}
.section-sub {
  color: var(--text-dim);
  max-width: 560px;
  margin-bottom: 56px;
  line-height: 1.7;
}
.section-head { text-align: center; }
.section-head .section-sub { margin-left: auto; margin-right: auto; }

.gradient-text {
  background: var(--accent-grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 30px;
  border-radius: 50px;
  font-weight: 600;
  font-size: 15px;
  border: none;
  cursor: pointer;
  transition: transform .25s ease, box-shadow .25s ease, opacity .25s ease;
}
.btn-primary {
  background: var(--accent-grad);
  color: #fff;
  box-shadow: 0 8px 24px rgba(108, 92, 231, 0.35);
}
.btn-primary:hover { transform: translateY(-3px); box-shadow: 0 14px 30px rgba(108, 92, 231, 0.45); }
.btn-outline {
  background: transparent;
  color: var(--text);
  border: 1.5px solid var(--border);
}
.btn-outline:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-3px); }

/* ---------- Navbar ---------- */
#navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 999;
  padding: 18px 0;
  transition: background .3s ease, box-shadow .3s ease, padding .3s ease;
}
#navbar.scrolled {
  background: var(--surface-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: var(--shadow);
  padding: 12px 0;
}
.nav-inner { display: flex; align-items: center; justify-content: space-between; }
.logo { font-weight: 700; font-size: 20px; }
.nav-links { display: flex; gap: 34px; align-items: center; }
.nav-links a {
  font-size: 15px; font-weight: 500; color: var(--text-dim);
  position: relative; transition: color .2s;
}
.nav-links a::after {
  content: ''; position: absolute; left: 0; bottom: -6px; width: 0; height: 2px;
  background: var(--accent-grad); transition: width .25s ease;
}
.nav-links a:hover { color: var(--text); }
.nav-links a:hover::after { width: 100%; }

.theme-toggle {
  width: 44px; height: 44px; border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; font-size: 18px;
  transition: transform .3s ease;
}
.theme-toggle:hover { transform: rotate(20deg) scale(1.08); }

.nav-toggle { display: none; flex-direction: column; gap: 5px; cursor: pointer; background: none; border: none; }
.nav-toggle span { width: 24px; height: 2px; background: var(--text); border-radius: 2px; }

/* ---------- Hero ---------- */
#hero {
  min-height: 100vh;
  display: flex; align-items: center;
  padding-top: 120px;
  position: relative;
}
#hero::before {
  content: '';
  position: absolute; inset: 0;
  background:
    radial-gradient(circle at 15% 20%, rgba(108,92,231,0.18), transparent 45%),
    radial-gradient(circle at 85% 75%, rgba(0,210,255,0.15), transparent 45%);
  pointer-events: none;
}
.hero-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 50px;
  align-items: center;
}
.hero-badge {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--surface); border: 1px solid var(--border);
  padding: 8px 16px; border-radius: 50px; font-size: 13px; font-weight: 500;
  margin-bottom: 24px; color: var(--text-dim);
}
.hero-badge .dot { width: 8px; height: 8px; border-radius: 50%; background: #2ecc71; box-shadow: 0 0 0 4px rgba(46,204,113,0.2); }
.hero-title { font-size: clamp(36px, 6vw, 62px); font-weight: 800; line-height: 1.1; margin-bottom: 20px; }
.hero-role { font-size: clamp(18px, 2.4vw, 24px); color: var(--text-dim); font-weight: 500; margin-bottom: 18px; min-height: 32px; }
.hero-role .cursor { display: inline-block; width: 2px; background: var(--accent); margin-left: 3px; animation: blink 1s step-start infinite; }
@keyframes blink { 50% { opacity: 0; } }
.hero-desc { color: var(--text-dim); line-height: 1.8; max-width: 520px; margin-bottom: 34px; }
.hero-actions { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 46px; }
.hero-stats { display: flex; gap: 40px; flex-wrap: wrap; }
.hero-stats .stat-num { font-size: 30px; font-weight: 800; }
.hero-stats .stat-label { font-size: 13px; color: var(--text-dim); }

.hero-visual { position: relative; display: flex; justify-content: center; }
.hero-photo-wrap {
  position: relative; width: 320px; height: 320px;
  border-radius: 34% 66% 64% 36% / 45% 40% 60% 55%;
  overflow: hidden; animation: morph 10s ease-in-out infinite;
  box-shadow: var(--shadow);
  border: 3px solid var(--border);
}
.hero-photo-wrap img { width: 100%; height: 100%; object-fit: cover; }
@keyframes morph {
  0%, 100% { border-radius: 34% 66% 64% 36% / 45% 40% 60% 55%; }
  50% { border-radius: 60% 40% 30% 70% / 55% 60% 40% 45%; }
}
.hero-orbit {
  position: absolute; inset: -30px;
  border: 1.5px dashed var(--border);
  border-radius: 50%;
  animation: spin 18s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.hero-float-card {
  position: absolute; background: var(--surface); border: 1px solid var(--border);
  border-radius: 16px; padding: 12px 16px; box-shadow: var(--shadow);
  font-size: 13px; font-weight: 600; display: flex; align-items: center; gap: 8px;
  animation: float 4s ease-in-out infinite;
}
.hero-float-card.card-1 { top: 6%; right: -6%; }
.hero-float-card.card-2 { bottom: 10%; left: -10%; animation-delay: 1.5s; }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-14px); } }

.scroll-cue {
  position: absolute; bottom: 30px; left: 50%; transform: translateX(-50%);
  font-size: 12px; color: var(--text-dim); display: flex; flex-direction: column; align-items: center; gap: 8px;
}
.scroll-cue .line { width: 1px; height: 34px; background: var(--border); position: relative; overflow: hidden; }
.scroll-cue .line::after {
  content: ''; position: absolute; top: -100%; left: 0; width: 100%; height: 100%;
  background: var(--accent-grad); animation: scrollDown 1.8s ease-in-out infinite;
}
@keyframes scrollDown { to { top: 100%; } }

/* ---------- About ---------- */
.about-grid { display: grid; grid-template-columns: 0.8fr 1.2fr; gap: 60px; align-items: center; }
.about-photo { position: relative; }
.about-photo img { border-radius: var(--radius); box-shadow: var(--shadow); border: 1px solid var(--border); }
.about-stats-row { display: flex; gap: 20px; margin-top: 30px; flex-wrap: wrap; }
.mini-stat { background: var(--surface); border: 1px solid var(--border); padding: 18px 22px; border-radius: 16px; flex: 1; min-width: 130px; }
.mini-stat .num { font-size: 26px; font-weight: 800; color: var(--accent); }
.mini-stat .label { font-size: 13px; color: var(--text-dim); }
.about-text p { color: var(--text-dim); line-height: 1.9; margin-bottom: 18px; white-space: pre-line; }

.skills-wrap { margin-top: 36px; }
.skill-item { margin-bottom: 18px; }
.skill-top { display: flex; justify-content: space-between; margin-bottom: 8px; font-size: 14px; font-weight: 600; }
.skill-bar { height: 8px; border-radius: 8px; background: var(--border); overflow: hidden; }
.skill-fill { height: 100%; border-radius: 8px; background: var(--accent-grad); width: 0; transition: width 1.2s ease; }

/* ---------- Projects ---------- */
.filter-row { display: flex; justify-content: center; gap: 10px; margin-bottom: 44px; flex-wrap: wrap; }
.filter-btn {
  padding: 10px 22px; border-radius: 50px; border: 1px solid var(--border);
  background: var(--surface); font-size: 13px; font-weight: 600; cursor: pointer; color: var(--text-dim);
  transition: all .25s ease;
}
.filter-btn.active, .filter-btn:hover { background: var(--accent-grad); color: #fff; border-color: transparent; }

.projects-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 30px; }
.project-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; transition: transform .35s ease, box-shadow .35s ease;
  display: flex; flex-direction: column;
}
.project-card:hover { transform: translateY(-8px); box-shadow: var(--shadow); }
.project-thumb { position: relative; aspect-ratio: 16/11; overflow: hidden; background: var(--bg-alt); }
.project-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease; }
.project-card:hover .project-thumb img { transform: scale(1.08); }
.featured-badge {
  position: absolute; top: 14px; left: 14px; background: var(--accent-grad); color: #fff;
  font-size: 11px; font-weight: 700; padding: 5px 12px; border-radius: 50px; letter-spacing: .5px;
}
.project-body { padding: 24px; display: flex; flex-direction: column; gap: 12px; flex: 1; }
.project-body h3 { font-size: 19px; font-weight: 700; }
.project-body p { color: var(--text-dim); font-size: 14px; line-height: 1.6; flex: 1; }
.tech-tags { display: flex; gap: 8px; flex-wrap: wrap; }
.tech-tag { font-size: 11px; font-weight: 600; padding: 4px 10px; border-radius: 50px; background: var(--bg); border: 1px solid var(--border); color: var(--text-dim); }
.project-links { display: flex; gap: 14px; margin-top: 6px; }
.project-links a { font-size: 13px; font-weight: 600; color: var(--accent); display: flex; align-items: center; gap: 5px; }
.project-links a:hover { text-decoration: underline; }

/* ---------- Reviews ---------- */
.reviews-track-wrap { overflow: hidden; }
.reviews-track { display: flex; gap: 26px; transition: transform .5s ease; }
.review-card {
  min-width: calc(33.333% - 18px); background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 30px; flex-shrink: 0;
}
.review-stars { color: #f5b301; margin-bottom: 14px; letter-spacing: 2px; }
.review-text { color: var(--text-dim); line-height: 1.8; margin-bottom: 22px; font-size: 14.5px; }
.review-person { display: flex; align-items: center; gap: 14px; }
.review-person img { width: 48px; height: 48px; border-radius: 50%; object-fit: cover; }
.review-person h5 { font-size: 15px; }
.review-person span { font-size: 12.5px; color: var(--text-dim); }
.review-nav { display: flex; justify-content: center; gap: 14px; margin-top: 40px; }
.review-nav button {
  width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--border); background: var(--surface);
  cursor: pointer; font-size: 16px; transition: all .2s;
}
.review-nav button:hover { background: var(--accent-grad); color: #fff; border-color: transparent; }

/* ---------- Hire Me / Contact ---------- */
.contact-grid { display: grid; grid-template-columns: 0.9fr 1.1fr; gap: 50px; }
.contact-info-card {
  background: var(--accent-grad); border-radius: var(--radius); padding: 40px; color: #fff;
  display: flex; flex-direction: column; gap: 26px; position: relative; overflow: hidden;
}
.contact-info-card h3 { font-size: 24px; margin-bottom: 6px; }
.contact-info-card p { opacity: .92; line-height: 1.7; font-size: 14.5px; }
.contact-item { display: flex; gap: 14px; align-items: center; font-size: 14.5px; }
.contact-item .ic { width: 40px; height: 40px; border-radius: 12px; background: rgba(255,255,255,0.18); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.social-row { display: flex; gap: 12px; margin-top: auto; }
.social-row a { width: 40px; height: 40px; border-radius: 50%; background: rgba(255,255,255,0.18); display: flex; align-items: center; justify-content: center; transition: transform .2s; }
.social-row a:hover { transform: translateY(-4px); background: rgba(255,255,255,0.3); }

.contact-form { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 40px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.form-group { margin-bottom: 20px; }
.form-group label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 8px; }
.form-group input, .form-group select, .form-group textarea {
  width: 100%; padding: 13px 16px; border-radius: 12px; border: 1px solid var(--border);
  background: var(--bg); color: var(--text); font-family: inherit; font-size: 14px;
  transition: border-color .2s;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus { outline: none; border-color: var(--accent); }
.form-group textarea { resize: vertical; min-height: 120px; }
.form-msg { padding: 14px 18px; border-radius: 12px; margin-bottom: 20px; font-size: 14px; font-weight: 500; }
.form-msg.success { background: rgba(46,204,113,0.15); color: #1c9c58; }
.form-msg.error { background: rgba(231,76,60,0.15); color: #c0392b; }

/* ---------- Footer ---------- */
footer { padding: 50px 0; border-top: 1px solid var(--border); text-align: center; }
footer p { color: var(--text-dim); font-size: 14px; }
.footer-socials { display: flex; justify-content: center; gap: 16px; margin-bottom: 20px; }
.footer-socials a { width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--border); display: flex; align-items: center; justify-content: center; transition: all .2s; }
.footer-socials a:hover { background: var(--accent-grad); border-color: transparent; color: #fff; }

/* ---------- Reveal animation ---------- */
.reveal { opacity: 0; transform: translateY(30px); transition: opacity .7s ease, transform .7s ease; }
.reveal.in { opacity: 1; transform: translateY(0); }

/* ---------- Back to top ---------- */
#backToTop {
  position: fixed; bottom: 26px; right: 26px; width: 48px; height: 48px; border-radius: 50%;
  background: var(--accent-grad); color: #fff; border: none; cursor: pointer; font-size: 18px;
  display: flex; align-items: center; justify-content: center; box-shadow: var(--shadow);
  opacity: 0; pointer-events: none; transition: opacity .3s ease, transform .3s ease; z-index: 500;
}
#backToTop.show { opacity: 1; pointer-events: auto; }
#backToTop:hover { transform: translateY(-4px); }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .hero-grid, .about-grid, .contact-grid { grid-template-columns: 1fr; }
  .hero-visual { order: -1; margin-bottom: 10px; }
  .projects-grid { grid-template-columns: repeat(2, 1fr); }
  .review-card { min-width: calc(50% - 13px); }
}
@media (max-width: 720px) {
  .nav-links { position: fixed; top: 74px; left: 0; right: 0; background: var(--surface); flex-direction: column; padding: 24px; gap: 20px; border-bottom: 1px solid var(--border); transform: translateY(-130%); transition: transform .35s ease; }
  .nav-links.open { transform: translateY(0); }
  .nav-toggle { display: flex; }
  .projects-grid { grid-template-columns: 1fr; }
  .review-card { min-width: 100%; }
  .form-row { grid-template-columns: 1fr; }
  section { padding: 80px 0; }
}
