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

:root {
  --bg: #ffffff;
  --text: #000000;
  --text-muted: #525252;
  --card-bg: #f5f5f5;
  --border: #e5e5e5;
  --accent: #000000;
  --shadow: rgba(0, 0, 0, 0.1);
  --particle-color: #000000;
}

[data-theme="dark"] {
  --bg: #000000;
  --text: #ffffff;
  --text-muted: #a3a3a3;
  --card-bg: #0a0a0a;
  --border: rgba(255, 255, 255, 0.1);
  --accent: #ffffff;
  --shadow: rgba(0, 0, 0, 0.9);
  --particle-color: #ffffff;
}

body {
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  overflow-x: hidden;
  line-height: 1.7;
  letter-spacing: 0.01em;
  font-weight: 200;
  transition: background 0.3s ease, color 0.3s ease;
}

.cursor {
  display: none;
}

.cursor-follower {
  display: none;
}

.animated-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  opacity: 0;
  pointer-events: none;
}

.particle {
  position: fixed;
  background: var(--particle-color);
  border-radius: 50%;
  opacity: 0.05;
  pointer-events: none;
  z-index: 1;
  transition: background 0.3s ease;
}

@keyframes float {

  0%,
  100% {
    transform: translateY(0) translateX(0);
  }

  25% {
    transform: translateY(-20px) translateX(10px);
  }

  50% {
    transform: translateY(-40px) translateX(-10px);
  }

  75% {
    transform: translateY(-20px) translateX(5px);
  }
}

.hero {
  position: relative;
  z-index: 2;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 2rem;
  overflow: hidden;
}

.hero-title {
  font-size: clamp(3rem, 10vw, 8rem);
  font-weight: 300;
  letter-spacing: 0.02em;
  text-align: center;
  margin-bottom: 2rem;
  position: relative;
  text-transform: lowercase;
}

.hero-title::after {
  content: '';
  position: absolute;
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 3px;
  background: var(--text);
  animation: drawLine 2s ease-out forwards;
  animation-delay: 0.5s;
}

@keyframes drawLine {
  to {
    width: 60%;
  }
}

.hero-subtitle {
  font-size: clamp(1rem, 3vw, 1.5rem);
  font-weight: 300;
  letter-spacing: 0.15em;
  text-transform: lowercase;
  opacity: 0;
  animation: fadeInUp 1s ease-out forwards;
  animation-delay: 1s;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.morph-logo {
  width: 150px;
  height: 150px;
  margin: 3rem 0;
}

.morph-shape {
  fill: none;
  stroke: var(--text);
  stroke-width: 2;
  animation: morph 8s ease-in-out infinite;
}

@keyframes morph {

  0%,
  100% {
    d: path("M75,25 Q100,50 75,75 Q50,100 25,75 Q0,50 25,25 Q50,0 75,25");
  }

  25% {
    d: path("M75,10 Q110,40 90,75 Q60,110 25,90 Q-10,60 10,25 Q40,-10 75,10");
  }

  50% {
    d: path("M75,20 Q105,45 80,80 Q55,105 20,80 Q-5,55 20,20 Q45,-5 75,20");
  }

  75% {
    d: path("M75,15 Q108,48 85,78 Q58,108 22,85 Q-8,58 15,22 Q42,-8 75,15");
  }
}

.scroll-section {
  position: relative;
  z-index: 2;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6rem 2rem;
}

.glass-card {
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  padding: 3rem;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.glass-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
  transition: left 0.5s ease;
}

.glass-card:hover::before {
  left: 100%;
}

.glass-card:hover {
  transform: translateY(-10px);
  border-color: rgba(255, 255, 255, 0.3);
  box-shadow: 0 20px 60px rgba(255, 255, 255, 0.1);
}

.about-container {
  max-width: 600px;
  text-align: center;
}

.section-title {
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 400;
  margin-bottom: 2.5rem;
  letter-spacing: 0.03em;
  text-transform: lowercase;
}

.section-text {
  font-size: 1.1rem;
  line-height: 2;
  color: var(--text-muted);
  font-weight: 200;
  letter-spacing: 0.02em;
}

.projects-section {
  padding: 8rem 2rem;
  position: relative;
  z-index: 2;
}

.projects-grid {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2.5rem;
}

.project-card {
  background: var(--card-bg);
  border-radius: 20px;
  padding: 2.5rem;
  position: relative;
  cursor: pointer;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  box-shadow:
    8px 8px 16px var(--shadow),
    -8px -8px 16px rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
}

.project-card:hover {
  transform: scale(1.05) rotate(1deg);
  box-shadow:
    12px 12px 24px var(--shadow),
    -12px -12px 24px rgba(255, 255, 255, 0.1);
}

.project-icon {
  width: 60px;
  height: 60px;
  margin-bottom: 1.5rem;
  position: relative;
}

.icon-circle {
  width: 100%;
  height: 100%;
  border: 2px solid var(--text);
  border-radius: 50%;
  position: absolute;
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {

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

  50% {
    transform: scale(1.1);
    opacity: 0.7;
  }
}

.project-title {
  font-size: 1.5rem;
  font-weight: 400;
  margin-bottom: 1rem;
  text-transform: lowercase;
  letter-spacing: 0.03em;
}

.project-desc {
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.8;
  margin-bottom: 1.5rem;
  letter-spacing: 0.01em;
}

.project-tag {
  display: inline-block;
  padding: 0.4rem 0.8rem;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  font-size: 0.75rem;
  text-transform: lowercase;
  letter-spacing: 0.05em;
  margin-right: 0.5rem;
  margin-top: 0.5rem;
  font-weight: 200;
}

.skills-section {
  padding: 8rem 2rem;
  position: relative;
  z-index: 2;
  text-align: center;
}

.skills-container {
  max-width: 800px;
  margin: 3rem auto;
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  justify-content: center;
}

.skill-blob {
  padding: 1rem 2rem;
  background: var(--text);
  color: var(--bg);
  border-radius: 50px;
  font-weight: 200;
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
  animation: blobFloat 3s ease-in-out infinite;
  text-transform: lowercase;
  text-decoration: none;
  display: inline-block;
  cursor: pointer;
}

.skill-blob:nth-child(odd) {
  animation-delay: 0.5s;
}

.skill-blob:nth-child(even) {
  animation-delay: 1s;
}

@keyframes blobFloat {

  0%,
  100% {
    border-radius: 50px 40px 45px 55px;
    transform: rotate(0deg);
  }

  25% {
    border-radius: 40px 50px 55px 45px;
    transform: rotate(1deg);
  }

  50% {
    border-radius: 55px 45px 40px 50px;
    transform: rotate(-1deg);
  }

  75% {
    border-radius: 45px 55px 50px 40px;
    transform: rotate(0.5deg);
  }
}

.skill-blob:hover {
  transform: scale(1.1);
  opacity: 0.8;
}

.experiments-section {
  padding: 8rem 2rem;
  position: relative;
  z-index: 2;
}

.experiments-grid {
  max-width: 1000px;
  margin: 3rem auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2.5rem;
}

.experiment-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 15px;
  padding: 2.5rem;
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.3s ease;
}

.experiment-card:hover {
  transform: perspective(1000px) rotateX(5deg) rotateY(5deg) translateZ(20px);
}

.experiment-title {
  font-size: 1.2rem;
  font-weight: 400;
  margin-bottom: 1rem;
  text-transform: lowercase;
  letter-spacing: 0.03em;
}

.experiment-desc {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.8;
  letter-spacing: 0.01em;
}

.contact-section {
  padding: 8rem 2rem;
  position: relative;
  z-index: 2;
  text-align: center;
  min-height: 60vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.contact-links {
  display: flex;
  gap: 2.5rem;
  justify-content: center;
  margin-top: 3rem;
  flex-wrap: wrap;
}

.contact-link {
  color: var(--text);
  text-decoration: none;
  font-size: 1.2rem;
  font-weight: 200;
  position: relative;
  padding: 1rem 2rem;
  border: 2px solid var(--text);
  border-radius: 50px;
  transition: all 0.3s ease;
  overflow: hidden;
  text-transform: lowercase;
}

.contact-link::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: var(--text);
  transform: translate(-50%, -50%);
  transition: width 0.4s ease, height 0.4s ease;
  z-index: -1;
}

.contact-link:hover::before {
  width: 300px;
  height: 300px;
}

.contact-link:hover {
  color: var(--bg);
}

.skeleton {
  background: linear-gradient(90deg, #1a1a1a 25%, #2a2a2a 50%, #1a1a1a 75%);
  background-size: 200% 100%;
  animation: loading 1.5s ease-in-out infinite;
  border-radius: 10px;
}

@keyframes loading {
  0% {
    background-position: 200% 0;
  }

  100% {
    background-position: -200% 0;
  }
}

.scroll-indicator {
  position: fixed;
  top: 0;
  left: 0;
  height: 4px;
  background: var(--text);
  z-index: 9999;
  transform-origin: left;
  transition: transform 0.1s ease;
}

.doodle-container {
  position: fixed;
  top: 20%;
  right: 5%;
  width: 200px;
  height: 200px;
  pointer-events: none;
  z-index: 1;
  opacity: 0.3;
}

.doodle-path {
  stroke: var(--text);
  stroke-width: 2;
  fill: none;
  stroke-dasharray: 1000;
  stroke-dashoffset: 1000;
  animation: drawDoodle 10s ease-in-out infinite;
  opacity: 0.3;
}

@keyframes drawDoodle {

  0%,
  100% {
    stroke-dashoffset: 1000;
  }

  50% {
    stroke-dashoffset: 0;
  }
}

.iso-grid {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  opacity: 0.03;
  background-image:
    linear-gradient(30deg, transparent 49%, var(--text) 49%, var(--text) 51%, transparent 51%),
    linear-gradient(150deg, transparent 49%, var(--text) 49%, var(--text) 51%, transparent 51%);
  background-size: 60px 60px;
  animation: isoMove 20s linear infinite;
}

@keyframes isoMove {
  0% {
    background-position: 0 0;
  }

  100% {
    background-position: 60px 60px;
  }
}

.stop-motion-element {
  opacity: 0;
  transform: translateY(50px);
  transition: none;
}

.stop-motion-element.visible {
  animation: stopMotion 0.6s steps(6) forwards;
}

@keyframes stopMotion {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.mixed-media {
  position: relative;
  display: inline-block;
}

.mixed-media::after {
  content: '';
  position: absolute;
  width: 100%;
  height: 100%;
  top: 5px;
  left: 5px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 10px;
  z-index: -1;
  transition: all 0.3s ease;
}

.mixed-media:hover::after {
  top: 10px;
  left: 10px;
  border-color: rgba(255, 255, 255, 0.6);
}

.toc {
  position: fixed;
  top: 2rem;
  right: 2rem;
  background: rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 15px;
  padding: 1.5rem;
  z-index: 1000;
  transition: all 0.3s ease;
  opacity: 0.6;
}

.toc:hover {
  opacity: 1;
  background: rgba(0, 0, 0, 0.5);
}

.toc-title {
  font-size: 0.75rem;
  font-weight: 300;
  letter-spacing: 0.1em;
  margin-bottom: 1rem;
  color: var(--gray-400);
  text-transform: lowercase;
}

.toc-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.toc-link {
  color: var(--white);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 200;
  transition: all 0.2s ease;
  display: block;
  text-transform: lowercase;
  position: relative;
  padding-left: 0;
}

.toc-link::before {
  content: '';
  position: absolute;
  left: -10px;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 4px;
  background: var(--text);
  border-radius: 50%;
  opacity: 0;
  transition: all 0.2s ease;
}

.toc-link:hover {
  opacity: 0.7;
  padding-left: 15px;
}

.toc-link:hover::before {
  opacity: 1;
  left: 0;
}

.toc-link.active {
  opacity: 1;
  font-weight: 300;
}

.theme-toggle {
  position: fixed;
  top: 2rem;
  left: 2rem;
  z-index: 1000;
  cursor: pointer;
}

.toggle-container {
  width: 60px;
  height: 30px;
  background: var(--border);
  border-radius: 30px;
  position: relative;
  transition: background 0.3s ease;
  border: 2px solid var(--text);
}

.toggle-slider {
  width: 22px;
  height: 22px;
  background: var(--text);
  border-radius: 50%;
  position: absolute;
  top: 2px;
  left: 2px;
  transition: transform 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
}

[data-theme="dark"] .toggle-slider {
  transform: translateX(30px);
}

.toggle-icon {
  font-size: 14px;
}

@media (max-width: 768px) {
  .hero-title {
    font-size: 3rem;
  }

  .projects-grid,
  .experiments-grid {
    grid-template-columns: 1fr;
  }

  .contact-links {
    flex-direction: column;
    align-items: center;
  }

  .toc {
    top: 1rem;
    right: 1rem;
    padding: 1rem;
  }

  .toc-title {
    font-size: 0.65rem;
  }

  .toc-link {
    font-size: 0.75rem;
  }

  .theme-toggle {
    top: 1rem;
    left: 1rem;
  }
}