/* ============================================
   DESIGN SYSTEM — Kavin Portfolio v3
   Clean + 3D + Interactive Drawing in Skills
   ============================================ */

:root {
  --bg: #060611;
  --bg-2: #0c0c1d;
  --bg-card: rgba(14, 14, 30, 0.65);

  --accent: #6c63ff;
  --accent-2: #00d4ff;
  --grad: linear-gradient(135deg, var(--accent), var(--accent-2));
  --grad-text: linear-gradient(135deg, #fff 30%, var(--accent-2));
  --grad-card: linear-gradient(135deg, rgba(108, 99, 255, .06), rgba(0, 212, 255, .03));

  --text: #e2e2f0;
  --text-2: #8888a8;
  --text-3: #55556e;

  --border: rgba(255, 255, 255, .05);
  --border-h: rgba(108, 99, 255, .3);

  --font: 'Inter', system-ui, sans-serif;
  --mono: 'JetBrains Mono', monospace;

  --section-py: 8rem;
  --max-w: 1080px;
  --radius: 16px;
  --ease: cubic-bezier(.16, 1, .3, 1);
}

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
  -webkit-font-smoothing: antialiased
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  overflow-x: hidden
}

a {
  color: inherit;
  text-decoration: none
}

ul {
  list-style: none
}

img {
  max-width: 100%;
  display: block
}

strong {
  color: var(--accent-2);
  font-weight: 600
}

.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 1.5rem
}

/* ============================================
   CANVASES
   ============================================ */
#particle-canvas {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none
}

/* ============================================
   NAVBAR
   ============================================ */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 100;
  padding: 1.2rem 0;
  transition: all .4s ease;
}

.navbar.scrolled {
  background: rgba(6, 6, 17, .85);
  backdrop-filter: blur(24px);
  border-bottom: 1px solid var(--border);
  padding: .7rem 0;
}

.nav-container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  font-family: var(--mono);
  font-size: 1.2rem;
  font-weight: 700;
  background: var(--grad);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.nav-links {
  display: flex;
  gap: 2.2rem
}

.nav-link {
  font-size: .85rem;
  font-weight: 500;
  color: var(--text-2);
  position: relative;
  padding: .3rem 0;
  transition: color .3s;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--grad);
  border-radius: 2px;
  transition: width .3s var(--ease);
}

.nav-link:hover,
.nav-link.active {
  color: var(--text)
}

.nav-link:hover::after,
.nav-link.active::after {
  width: 100%
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  padding: .5rem;
  cursor: pointer
}

.nav-toggle span {
  width: 24px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: all .3s
}

/* ============================================
   BUTTONS
   ============================================ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .6rem;
  padding: .9rem 2rem;
  border-radius: 50px;
  font-weight: 600;
  font-size: .88rem;
  letter-spacing: .02em;
  transition: all .45s var(--ease);
  border: none;
  position: relative;
  overflow: hidden;
  cursor: pointer;
}

.btn span {
  position: relative;
  z-index: 2
}

.btn svg {
  position: relative;
  z-index: 2;
  transition: transform .3s
}

.btn:hover svg {
  transform: translate(3px, -3px)
}

.btn--primary {
  background: var(--grad);
  color: #fff;
  box-shadow: 0 4px 30px rgba(108, 99, 255, .3);
}

.btn--primary::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--accent-2), var(--accent));
  opacity: 0;
  transition: opacity .4s;
  border-radius: 50px;
}

.btn--primary:hover::before {
  opacity: 1
}

.btn--primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 40px rgba(108, 99, 255, .45)
}

.btn--glass {
  background: rgba(255, 255, 255, .04);
  color: var(--text);
  border: 1px solid var(--border);
  backdrop-filter: blur(10px);
}

.btn--glass:hover {
  border-color: var(--accent);
  background: rgba(108, 99, 255, .08);
  transform: translateY(-3px)
}

.btn--xl {
  padding: 1.1rem 3rem;
  font-size: 1rem;
  margin-top: 2.5rem
}

/* ============================================
   HERO
   ============================================ */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 2;
}

.hero-content {
  text-align: center;
  position: relative;
  padding: 0 1.5rem
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: .6rem;
  padding: .45rem 1.2rem;
  border-radius: 50px;
  background: rgba(108, 99, 255, .08);
  border: 1px solid rgba(108, 99, 255, .15);
  font-size: .78rem;
  font-weight: 500;
  color: var(--accent);
  margin-bottom: 2rem;
}

.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #4ade80;
  position: relative;
}

.pulse-dot::after {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  border: 1px solid #4ade80;
  animation: pulse-ring 2s ease-out infinite;
}

@keyframes pulse-ring {
  0% {
    transform: scale(1);
    opacity: 1
  }

  100% {
    transform: scale(2.5);
    opacity: 0
  }
}

.hero-name {
  font-size: clamp(3.5rem, 10vw, 7rem);
  font-weight: 900;
  line-height: 1.05;
  margin-bottom: 1.2rem;
  background: var(--grad-text);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-title-wrapper {
  font-size: clamp(1.1rem, 3vw, 1.5rem);
  color: var(--text-2);
  margin-bottom: 1.5rem;
  min-height: 2.2em;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .45rem;
}

.hero-typed {
  color: var(--accent-2);
  font-weight: 600
}

.hero-cursor {
  color: var(--accent);
  animation: blink 1s step-end infinite
}

@keyframes blink {

  0%,
  100% {
    opacity: 1
  }

  50% {
    opacity: 0
  }
}

.hero-description {
  max-width: 520px;
  margin: 0 auto 2.5rem;
  color: var(--text-2);
  font-size: 1.05rem;
}

.hero-cta {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 5rem
}

.hero-scroll {
  display: flex;
  justify-content: center
}

.scroll-line {
  width: 1px;
  height: 60px;
  background: linear-gradient(to bottom, var(--accent), transparent);
  animation: scroll-pulse 2s ease-in-out infinite;
}

@keyframes scroll-pulse {

  0%,
  100% {
    opacity: .3;
    transform: scaleY(.6)
  }

  50% {
    opacity: 1;
    transform: scaleY(1)
  }
}

/* ============================================
   SECTIONS
   ============================================ */
.section {
  padding: var(--section-py) 0;
  position: relative;
  z-index: 2
}

.section--dark {
  background: var(--bg-2)
}

.section-header {
  margin-bottom: 3.5rem
}

.section-tag {
  font-family: var(--mono);
  font-size: .78rem;
  font-weight: 500;
  color: var(--accent);
  letter-spacing: .08em;
  display: block;
  margin-bottom: .6rem;
}

.section-title {
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 800;
  line-height: 1.15
}

/* ============================================
   ABOUT
   ============================================ */
.about-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 3rem;
  align-items: start
}

.about-text p {
  margin-bottom: 1.3rem;
  color: var(--text-2);
  font-size: .98rem;
  line-height: 1.85
}

.about-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem
}

.stat-card {
  background: var(--grad-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.6rem;
  text-align: center;
  transition: all .45s var(--ease);
  transform-style: preserve-3d;
}

.stat-card:hover {
  border-color: var(--border-h);
  box-shadow: 0 10px 40px rgba(108, 99, 255, .1)
}

.stat-number {
  display: block;
  font-size: 2.6rem;
  font-weight: 900;
  background: var(--grad);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.1;
}

.stat-label {
  font-size: .72rem;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: .1em;
  margin-top: .3rem;
  display: block
}

/* ============================================
   SKILLS — Simple Card Grid
   ============================================ */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
  margin-bottom: 3rem;
}

.skill-category {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem;
  transition: all .45s var(--ease);
  transform-style: preserve-3d;
  position: relative;
  overflow: hidden;
}

.skill-category::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--grad);
  opacity: 0;
  transition: opacity .4s;
}

.skill-category:hover {
  border-color: var(--border-h);
  box-shadow: 0 10px 40px rgba(108, 99, 255, .08)
}

.skill-category:hover::before {
  opacity: 1
}

.skill-category-header {
  display: flex;
  align-items: center;
  gap: .75rem;
  margin-bottom: 1.25rem
}

.skill-icon {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: rgba(108, 99, 255, .1);
  color: var(--accent);
  flex-shrink: 0;
}

.skill-icon svg {
  width: 18px;
  height: 18px
}

.skill-category h3 {
  font-size: 1rem;
  font-weight: 600
}

.skill-tags {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem
}

.skill-tag {
  font-size: .8rem;
  padding: .35rem .85rem;
  border-radius: 50px;
  background: rgba(108, 99, 255, .08);
  color: var(--accent-2);
  border: 1px solid rgba(108, 99, 255, .12);
  font-weight: 500;
  transition: all .3s;
}

.skill-tag:hover {
  background: rgba(108, 99, 255, .15);
  border-color: rgba(108, 99, 255, .3)
}

/* ============================================
   DRAWING SECTION (inside Skills)
   ============================================ */
.draw-section {
  margin-top: 2rem;
  padding: 2rem;
  background: var(--grad-card);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  text-align: center;
}

.draw-section-header h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: .4rem
}

.draw-section-header p {
  font-size: .85rem;
  color: var(--text-2);
  margin-bottom: 1.5rem
}

.draw-controls {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem
}

.draw-toggle {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .7rem 1.6rem;
  border-radius: 50px;
  border: 1px solid var(--border);
  background: rgba(10, 10, 20, .6);
  color: var(--text-2);
  font-family: var(--font);
  font-size: .85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all .35s var(--ease);
}

.draw-toggle:hover,
.draw-toggle.active {
  border-color: var(--accent);
  color: var(--accent);
  box-shadow: 0 0 25px rgba(108, 99, 255, .15);
}

.draw-toggle-icon {
  width: 16px;
  height: 16px
}

.draw-toolbar {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .6rem 1rem;
  border-radius: 50px;
  background: rgba(10, 10, 20, .8);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  opacity: 0;
  max-height: 0;
  overflow: hidden;
  pointer-events: none;
  transition: all .35s var(--ease);
}

.draw-toolbar.visible {
  opacity: 1;
  max-height: 60px;
  pointer-events: auto
}

.draw-color {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid transparent;
  background: var(--c);
  transition: all .2s;
  cursor: pointer;
}

.draw-color.active,
.draw-color:hover {
  border-color: #fff;
  transform: scale(1.2)
}

.draw-sep {
  width: 1px;
  height: 20px;
  background: var(--border);
  margin: 0 .25rem
}

.draw-size {
  -webkit-appearance: none;
  appearance: none;
  width: 60px;
  height: 4px;
  background: var(--border);
  border-radius: 4px;
  outline: none;
}

.draw-size::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
}

.draw-action {
  background: none;
  border: 1px solid var(--border);
  border-radius: 50%;
  width: 28px;
  height: 28px;
  color: var(--text-2);
  font-size: .8rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all .2s;
}

.draw-action:hover {
  border-color: #ff6b6b;
  color: #ff6b6b
}

/* ============================================
   PROJECTS — Stacked Cards
   ============================================ */
.projects-stack {
  display: flex;
  flex-direction: column;
  gap: 1.5rem
}

.project-card {
  display: flex;
  align-items: center;
  gap: 2rem;
  padding: 2rem 2.5rem;
  border-radius: var(--radius);
  background: var(--bg-card);
  border: 1px solid var(--border);
  transition: all .5s var(--ease);
  transform-style: preserve-3d;
  position: relative;
  overflow: hidden;
}

.project-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(108, 99, 255, .04), transparent);
  opacity: 0;
  transition: opacity .4s;
}

.project-card:hover {
  border-color: var(--border-h);
  box-shadow: 0 20px 60px rgba(108, 99, 255, .08)
}

.project-card:hover::before {
  opacity: 1
}

.project-number {
  font-size: 4rem;
  font-weight: 900;
  background: var(--grad);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  opacity: .15;
  line-height: 1;
  flex-shrink: 0;
  min-width: 80px;
  text-align: center;
}

.project-body {
  flex: 1
}

.project-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: .2rem
}

.project-label {
  font-family: var(--mono);
  font-size: .72rem;
  color: var(--accent);
  display: block;
  margin-bottom: .8rem
}

.project-description {
  color: var(--text-2);
  font-size: .9rem;
  line-height: 1.7;
  margin-bottom: 1rem
}

.project-tech {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem
}

.project-tech span {
  font-family: var(--mono);
  font-size: .68rem;
  color: var(--text-3);
  padding: .25rem .6rem;
  background: rgba(255, 255, 255, .03);
  border-radius: 4px;
}

.project-arrow {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-3);
  flex-shrink: 0;
  transition: all .35s var(--ease);
}

.project-arrow:hover {
  border-color: var(--accent);
  color: var(--accent);
  box-shadow: 0 0 20px rgba(108, 99, 255, .2)
}

/* ============================================
   EDUCATION
   ============================================ */
.edu-timeline {
  max-width: 650px;
  margin: 0 auto;
  border-left: 2px solid rgba(108, 99, 255, .12);
  padding-left: 2.5rem;
}

.edu-item {
  position: relative;
  margin-bottom: 2.5rem;
  padding: 1.5rem 2rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: all .4s var(--ease);
  transform-style: preserve-3d;
}

.edu-item:hover {
  border-color: var(--border-h);
  box-shadow: 0 10px 40px rgba(108, 99, 255, .08)
}

.edu-dot {
  position: absolute;
  left: -2.85rem;
  top: 1.8rem;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 15px rgba(108, 99, 255, .5);
}

.edu-date {
  font-family: var(--mono);
  font-size: .78rem;
  color: var(--accent);
  margin-bottom: .3rem;
  display: block
}

.edu-content h3 {
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: .15rem
}

.edu-content p {
  font-size: .88rem;
  color: var(--text-2)
}

/* ============================================
   CONTACT
   ============================================ */
.contact-content {
  text-align: center;
  max-width: 700px;
  margin: 0 auto
}

.contact-text {
  font-size: 1.1rem;
  color: var(--text-2);
  line-height: 1.8;
  margin-bottom: 2.5rem
}

.contact-links {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
  text-align: left
}

.contact-link {
  display: flex;
  align-items: center;
  gap: 1.2rem;
  padding: 1.3rem 1.5rem;
  border-radius: var(--radius);
  background: var(--bg-card);
  border: 1px solid var(--border);
  transition: all .45s var(--ease);
  transform-style: preserve-3d;
}

.contact-link:hover {
  border-color: var(--border-h);
  box-shadow: 0 10px 40px rgba(108, 99, 255, .1)
}

.contact-link-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: rgba(108, 99, 255, .08);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  flex-shrink: 0;
  transition: all .3s;
}

.contact-link:hover .contact-link-icon {
  background: var(--accent);
  color: #fff
}

.contact-link-icon svg {
  width: 20px;
  height: 20px
}

.contact-link-label {
  font-size: .7rem;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--text-3);
  display: block
}

.contact-link-value {
  font-size: .88rem;
  font-weight: 500;
  color: var(--text)
}

/* ============================================
   FOOTER
   ============================================ */
.footer {
  text-align: center;
  padding: 2.5rem 0;
  border-top: 1px solid var(--border);
  color: var(--text-3);
  font-size: .82rem;
  z-index: 2;
  position: relative;
}

.footer strong {
  color: var(--text-2)
}

/* ============================================
   ANIMATIONS
   ============================================ */
.anim-reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity .8s var(--ease), transform .8s var(--ease);
}

.anim-reveal.visible {
  opacity: 1;
  transform: translateY(0)
}

.about-stats .anim-reveal:nth-child(2) {
  transition-delay: .08s
}

.about-stats .anim-reveal:nth-child(3) {
  transition-delay: .16s
}

.about-stats .anim-reveal:nth-child(4) {
  transition-delay: .24s
}

.skills-grid .anim-reveal:nth-child(2) {
  transition-delay: .06s
}

.skills-grid .anim-reveal:nth-child(3) {
  transition-delay: .12s
}

.skills-grid .anim-reveal:nth-child(4) {
  transition-delay: .18s
}

.skills-grid .anim-reveal:nth-child(5) {
  transition-delay: .24s
}

.skills-grid .anim-reveal:nth-child(6) {
  transition-delay: .3s
}

.projects-stack .anim-reveal:nth-child(2) {
  transition-delay: .1s
}

.projects-stack .anim-reveal:nth-child(3) {
  transition-delay: .2s
}

.contact-links .anim-reveal:nth-child(2) {
  transition-delay: .06s
}

.contact-links .anim-reveal:nth-child(3) {
  transition-delay: .12s
}

.contact-links .anim-reveal:nth-child(4) {
  transition-delay: .18s
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media(max-width:900px) {
  :root {
    --section-py: 5rem
  }

  .about-grid {
    grid-template-columns: 1fr
  }

  .skills-grid {
    grid-template-columns: repeat(2, 1fr)
  }

  .contact-links {
    grid-template-columns: 1fr
  }
}

@media(max-width:640px) {
  :root {
    --section-py: 4rem
  }

  .nav-links {
    position: fixed;
    top: 0;
    right: -100%;
    width: 75%;
    height: 100vh;
    background: rgba(6, 6, 17, .97);
    backdrop-filter: blur(30px);
    flex-direction: column;
    justify-content: center;
    gap: 2rem;
    transition: right .4s var(--ease);
    border-left: 1px solid var(--border);
  }

  .nav-links.open {
    right: 0
  }

  .nav-toggle {
    display: flex
  }

  .nav-toggle.open span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px)
  }

  .nav-toggle.open span:nth-child(2) {
    opacity: 0
  }

  .nav-toggle.open span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px)
  }

  .nav-link {
    font-size: 1.2rem
  }

  .skills-grid {
    grid-template-columns: 1fr
  }

  .project-card {
    flex-direction: column;
    align-items: flex-start;
    padding: 1.5rem
  }

  .project-number {
    font-size: 2.5rem;
    min-width: auto
  }

  .project-arrow {
    align-self: flex-end
  }

  .hero-cta {
    flex-direction: column;
    align-items: center
  }

  .btn {
    width: 100%;
    max-width: 260px;
    justify-content: center
  }
}