:root {
  --bg:#ffffff;
  --text:#222;
  --muted:#5d6470;
  --primary:#3a86ff;
  --secondary:#8338ec;
  --accent:#ff006e;
  --success:#06d6a0;
  --radius:14px;
}

/* ================================
   BASE
   ================================ */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
html,body { height:100% }
html { scroll-behavior: smooth; }
body {
  font-family:'Inter',system-ui,-apple-system,Segoe UI,Roboto,Arial,sans-serif;
  background:var(--bg);
  color:var(--text);
  line-height:1.6;
  overflow-x:hidden;
}

/* Background Canvas */
#bgCanvas {
  position:fixed; inset:0;
  width:100%; height:100%;
  z-index:-2;
  background:linear-gradient(120deg,#fdfbfb,#ebedee);
}

/* Accessibility focus */
a:focus, button:focus, input:focus, textarea:focus {
  outline:3px solid rgba(58,134,255,.4);
  outline-offset:2px;
}

/* ================================
   HEADER
   ================================ */
.site-header {
  position:sticky; top:0; z-index:20;
  display:flex; align-items:center; justify-content:space-between;
  padding:14px 20px;
  background:rgba(255,255,255,.85);
  backdrop-filter:saturate(180%) blur(10px);
  border-bottom:1px solid #eee;
}
.logo {
  font-weight:800; font-size:1.3rem;
  color:var(--primary);
  text-decoration:none;
}
.logo .highlight { color:var(--accent); }

/* Mobile menu toggle */
.menu-toggle {
  background:var(--primary);
  border:none; width:42px; height:42px; border-radius:50%;
  display:none; align-items:center; justify-content:center;
  cursor:pointer;
}
.menu-icon, .menu-icon::before, .menu-icon::after {
  content:""; display:block;
  width:18px; height:2px; background:#fff;
  border-radius:2px; transition:.3s;
}
.menu-icon::before,.menu-icon::after { position:relative; }
.menu-icon::before { top:-6px; position:relative; }
.menu-icon::after { top:4px; position:relative; }
.menu-toggle.active .menu-icon { background:transparent; }
.menu-toggle.active .menu-icon::before {
  transform:rotate(45deg) translate(3px,3px);
}
.menu-toggle.active .menu-icon::after {
  transform:rotate(-45deg) translate(3px,-3px);
}

/* Nav */
.nav {
  display:flex;
  gap:16px;
  align-items:center;
}
.nav a {
  color: var(--muted);
  text-decoration: none;
  font-weight: 500;
  position: relative;
  padding-bottom: 2px;
}
.nav a::after {
  content:"";
  position:absolute;
  left:0; bottom:0;
  width:0%; height:2px;
  background:var(--primary);
  transition:width .3s ease;
}
.nav a:hover { color:var(--primary); }
.nav a:hover::after { width:100%; }

/* Nav CTA */
.nav .cta {
  padding:8px 12px;
  border-radius:999px;
  border:2px solid var(--primary);
  color:var(--primary);
  background:transparent;
  transition:all .2s ease;
}
.nav .cta:hover {
  background:var(--primary);
  color:#fff;
}
/* Social icons */
.nav .social {
  display:flex;
  gap:12px;
}
.nav .social a {
  font-size:1.25rem;
  color:var(--muted);
  transition:color .3s;
}
.nav .social a:hover { color:var(--primary); }

/* Mobile nav overlay */
@media (max-width:900px) {
  .menu-toggle { display:flex; }
  .nav {
    position:fixed;
    right:20px; top:70px;
    background:#fff;
    border-radius:16px;
    box-shadow:0 12px 30px rgba(0,0,0,.12);
    padding:14px;
    flex-direction:column;
    align-items:flex-start;
    display:none;
    z-index:30;
    width:min(86vw,320px);
  }
  .nav.open { display:flex; }
}

/* --- Hero --- */
.hero {
  display:flex; align-items:center; justify-content:space-between;
  gap:40px; padding:4rem 2rem;
  min-height:90vh;
  flex-wrap:nowrap;
  position:relative;
  overflow:hidden;
  z-index:1;
}
@media (max-width:1024px) {
  .hero { flex-direction:column; text-align:center; flex-wrap:wrap; }
}

/* Dashboard mockup / profile */
.dashboard-mockup {
  background:#fff;
  border-radius:1.5rem;
  box-shadow:0 10px 40px rgba(0,0,0,0.15);
  width:340px; height:380px;
  display:flex; align-items:center; justify-content:center;
  perspective:1000px;
  transition:transform .4s ease;
  position:relative;
}
.dashboard-mockup:hover {
  transform:translateY(-6px) rotateX(6deg) rotateY(6deg) scale(1.02);
}
.dashboard-mockup .avatar {
  width:80%; height:auto;
  border-radius:1rem;
  border:6px solid var(--primary);
  box-shadow:0 12px 30px rgba(0,0,0,0.25);
  object-fit:cover;
}

/* Hero Text */
.hero__text { flex:1 1 45%; max-width:550px; z-index:2; }
.gradient-title {
  font-size:clamp(2.5rem,5vw,3.6rem);
  font-weight:800;
  background:linear-gradient(90deg,#3a86ff,#8338ec,#ff006e,#06d6a0);
  -webkit-background-clip:text;
  -webkit-text-fill-color:transparent;
}
.subtitle { color:var(--muted); margin:12px 0 18px; }


/* Typing effect */
.typing {
  display:inline-block;
  border-right:3px solid var(--primary);
  white-space:nowrap;
  overflow:hidden;
  animation:typing 3s steps(30,end) infinite, blink-caret .7s step-end infinite;
}
@keyframes typing {
  0%,100% { width:0; }
  50% { width:100%; }
}
@keyframes blink-caret { 50% { border-color:transparent; } }

/* Tags */
.hero-tags {
  display:flex; flex-wrap:wrap; gap:8px;
  margin:0 0 18px; padding:0;
  list-style:none;
}
.hero-tags li {
  background:#eef4ff;
  color:#225;
  border:1px dashed #dbe6ff;
  padding:6px 12px;
  border-radius:999px;
  font-size:0.9rem; font-weight:500;
}

/* Hero CTA */
.hero__cta {
  display:flex; gap:12px; margin-top:14px; flex-wrap:wrap;
}

/* Hero Media */
.hero__media {
  flex:1 1 45%;
  display:flex; justify-content:center; align-items:center;
  position:relative;
}

/* Widgets */
.widget {
  position:absolute;
  background:#fff;
  border-radius:0.8rem;
  box-shadow:0 6px 18px rgba(0,0,0,0.08);
  padding:0.8rem;
  animation:float 5s ease-in-out infinite;
  font-size:0.85rem;
}
.widget.kpi { top:8%; right:-18%; }
.widget.bar { bottom:10%; left:-16%; display:flex; gap:4px; }
.widget.pie {
  bottom:14%; right:-16%;
  width:60px; height:60px;
  border-radius:50%;
  background:conic-gradient(#3a86ff 30%, #ff006e 40%, #06d6a0 30%);
}
.widget.bar .bar-fill {
  width:8px;
  background:linear-gradient(180deg,#3a86ff,#8338ec);
  border-radius:3px;
}
@keyframes float {
  0%,100% { transform:translateY(0px); }
  50% { transform:translateY(-10px); }
}
/* ================================
   BUTTON SYSTEM
   ================================ */
.btn {
  display:inline-block;
  font-family:inherit;
  font-size:0.95rem;
  font-weight:600;
  padding:0.75rem 1.5rem;
  border-radius:0.75rem;
  cursor:pointer;
  text-decoration:none;
  text-align:center;
  transition:all .3s ease;
  border:none; outline:none;
  line-height:1.2;
}
.btn--primary { background:var(--primary); color:#fff; }
.btn--primary:hover { background:#0056d2; box-shadow:0 6px 16px rgba(0,91,187,.25); }
.btn--ghost {
  background:transparent;
  color:var(--primary);
  border:2px solid var(--primary);
}
.btn--ghost:hover { background:var(--primary); color:#fff; }
.btn--resume {
  background:var(--accent);
  color:#fff;
  box-shadow:0 0 16px rgba(255,0,110,.4);
  animation:pulse 2.5s infinite;
}
.btn--resume i { margin-right:6px; }
@keyframes pulse {
  0%,100% { box-shadow:0 0 12px rgba(255,0,110,.3) }
  50% { box-shadow:0 0 24px rgba(255,0,110,.6) }
}
.btn--3d {
  background:linear-gradient(135deg,#007bff,#0056d2);
  color:#fff;
  box-shadow:0 6px 0 #0041a8;
  transform:translateY(0);
}
.btn--3d:hover {
  transform:translateY(-3px);
  box-shadow:0 9px 0 #0041a8, 0 9px 20px rgba(0,0,0,0.15);
}
@media (max-width:480px) {
  .btn { font-size:0.9rem; padding:0.65rem 1.2rem; border-radius:0.6rem; }
}

/* ================================
   SECTIONS & DIVIDERS
   ================================ */
.section {
  max-width: 1100px;
  margin: 56px auto;
  padding: 0 20px;
}
.section__title {
  font-size: 1.8rem;
  margin: 0 0 16px;
}
.section-divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(0,0,0,.08), transparent);
  max-width: 1100px;
  margin: 32px auto;
}

/* ================================
   SKILLS / CHARTS
   ================================ */
.skills-grid {
  display: grid;
  gap: 24px;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}
.chart-wrap {
  background: #fff;
  border: 1px solid #eee;
  border-radius: 16px;
  padding: 16px;
  box-shadow: 0 6px 18px rgba(0,0,0,.06);
  min-height: 260px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ================================
   PROJECTS / CARDS
   ================================ */
.project-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
  margin-top: 2rem;
}

.proj-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: #fff;
  border-radius: 1rem;
  box-shadow: 0 6px 12px rgba(0,0,0,0.12);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  text-decoration: none;
  color: inherit;
  overflow: hidden;
  position: relative;
  min-height: 340px;
}

.proj-card:hover {
  transform: translateY(-8px) rotateX(2deg) rotateY(-2deg);
  box-shadow: 0 16px 36px rgba(0,0,0,0.18);
}

.proj-card img {
  border-radius: 0.75rem;
  width: 100%;
  height: 200px;
  object-fit: cover;
  margin-bottom: 1rem;
}

.proj-card h3 {
  font-size: 1.2rem;
  font-weight: 600;
  margin: 0 0 0.5rem;
  color: var(--text-dark, #222);
}

.proj-card p {
  flex-grow: 1;
  font-size: 0.95rem;
  line-height: 1.5;
  color: var(--text-light, #555);
}

.proj-card a {
  margin-top: auto;
}

/* Responsive Adjustments */
@media (max-width: 1024px) {
  .project-gallery {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
  }
  .proj-card img { height: 180px; }
}
@media (max-width: 768px) {
  .project-gallery { grid-template-columns: 1fr 1fr; }
  .proj-card { min-height: 300px; }
  .proj-card h3 { font-size: 1.1rem; }
}
@media (max-width: 480px) {
  .project-gallery { grid-template-columns: 1fr; }
  .proj-card img { height: 160px; }
  .proj-card { min-height: 280px; }
}

/* ================================
   TIMELINE
   ================================ */
.timeline {
  position: relative;
  margin: 32px 0;
}
.timeline::before {
  content:"";
  position: absolute;
  top: 0; bottom: 0; left: 50%;
  width: 4px;
  background: linear-gradient(var(--primary), var(--secondary));
  transform: translateX(-50%);
}
.tl-item {
  width: 50%;
  padding: 16px;
  position: relative;
}
.tl-item.left { left: 0; text-align: right; }
.tl-item.right { left: 50%; }
.tl-content {
  background: #fff;
  border: 1px solid #eee;
  border-radius: 16px;
  box-shadow: 0 8px 20px rgba(0,0,0,.05);
  padding: 14px;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.tl-content:hover {
  transform: translateY(-6px);
  box-shadow: 0 14px 32px rgba(0,0,0,.12);
}
.tl-content time {
  font-weight: 700;
  color: var(--secondary);
}

/* Responsive Timeline */
@media (max-width: 1024px) {
  .timeline::before { left: 12px; transform: none; }
  .tl-item { width: 100%; padding-left: 32px; }
  .tl-item.left,.tl-item.right { text-align: left; left: 0; }
}
/* ================================
   CONTACT FORM
   ================================ */
.contact {
  display: grid;
  gap: 14px;
  max-width: 640px;
}
.field label { font-weight: 600; }
.field input, .field textarea {
  width: 100%;
  padding: 10px;
  border-radius: 12px;
  border: 1px solid #ddd;
  background: #fff;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.field input:focus, .field textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(58,134,255,0.2);
  outline: none;
}

/* ================================
   FOOTER
   ================================ */
.site-footer {
  padding: 20px;
  border-top: 1px solid #eee;
  background: #fff;
  text-align: center;
}
.footer__links a {
  margin: 0 8px;
  color: var(--primary);
  text-decoration: none;
}
/* ================================
   BUTTON SYSTEM
   ================================ */
.btn {
  display: inline-block;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  padding: 0.75rem 1.5rem;
  border-radius: 0.75rem;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
  transition: all 0.3s ease;
  border: none;
  outline: none;
  line-height: 1.2;
}

.btn--primary {
  background: var(--primary, #007bff);
  color: #fff;
}
.btn--primary:hover {
  background: #0056d2;
  box-shadow: 0 6px 16px rgba(0, 91, 187, 0.25);
}

.btn--ghost {
  background: transparent;
  color: var(--primary, #007bff);
  border: 2px solid var(--primary, #007bff);
}
.btn--ghost:hover {
  background: var(--primary, #007bff);
  color: #fff;
}

.btn--resume {
  background: var(--accent, #28a745);
  color: #fff;
}
.btn--resume:hover {
  background: #218838;
  box-shadow: 0 6px 16px rgba(33, 136, 56, 0.25);
}

.btn--3d {
  background: linear-gradient(135deg, #007bff, #0056d2);
  color: #fff;
  box-shadow: 0 6px 0 #0041a8;
  transform: translateY(0);
}
.btn--3d:hover {
  transform: translateY(-3px);
  box-shadow: 0 9px 0 #0041a8, 0 9px 20px rgba(0,0,0,0.15);
}

@media (max-width: 480px) {
  .btn {
    font-size: 0.9rem;
    padding: 0.65rem 1.2rem;
    border-radius: 0.6rem;
  }
}
