:root {
  --bg: #ffffff;
  --bg-alt: #f5f5f5;
  --card: #fafafa;
  --border: #e0e0e0;
  --text: #1a1a1a;
  --text-light: #666666;
  --text-muted: #999999;
}

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

html {
  scroll-behavior: smooth;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  line-height: 1.6;
  overflow-x: hidden;
}

header {
  position: sticky;
  top: 0;
  backdrop-filter: blur(10px);
  background: rgba(255, 255, 255, 0.9);
  border-bottom: 1px solid var(--border);
  z-index: 1000;
  animation: slideDown 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes slideDown {
  from {
    transform: translateY(-100%);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

nav {
  width: min(1200px, 92%);
  margin: auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 0;
}

.logo {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--text);
  transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  display: inline-block;
}

.logo:hover {
  transform: scale(1.1) rotate(5deg);
  letter-spacing: 2px;
}

.nav-links {
  display: flex;
  gap: 2.5rem;
  list-style: none;
}

.nav-links a {
  color: var(--text-light);
  text-decoration: none;
  transition: all 0.3s ease;
  position: relative;
  font-weight: 500;
  font-size: 0.95rem;
}

.nav-links a::before {
  content: "";
  position: absolute;
  left: 0;
  bottom: -4px;
  width: 0;
  height: 2px;
  background: var(--text);
  transition: width 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.nav-links a:hover {
  color: var(--text);
}

.nav-links a:hover::before {
  width: 100%;
}

.hero {
  min-height: 90vh;
  width: min(1200px, 92%);
  margin: auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.hero h3 {
  color: var(--text-muted);
  font-weight: 500;
  font-size: 1rem;
  letter-spacing: 2px;
  text-transform: uppercase;
  animation: fadeInLeft 0.8s ease 0.1s forwards;
  opacity: 0;
}

.hero h2 {
  font-size: clamp(3rem, 7vw, 5rem);
  line-height: 1.1;
  margin: 12px 0 20px 0;
  color: var(--text);
  font-weight: 900;
  animation: fadeInLeft 0.8s ease 0.2s forwards;
  opacity: 0;
}

.hero h4 {
  color: var(--text-light);
  margin-bottom: 20px;
  font-weight: 500;
  animation: fadeInLeft 0.8s ease 0.3s forwards;
  opacity: 0;
}

.hero p {
  max-width: 650px;
  color: var(--text-light);
  margin-bottom: 30px;
  line-height: 1.8;
  animation: fadeInLeft 0.8s ease 0.4s forwards;
  opacity: 0;
}

.btn-group {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  animation: fadeInLeft 0.8s ease 0.5s forwards;
  opacity: 0;
}

button {
  padding: 16px 32px;
  border-radius: 6px;
  cursor: pointer;
  border: 2px solid transparent;
  font-size: 1rem;
  font-weight: 600;
  transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
  overflow: hidden;
}

button::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.05);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

button:active::before {
  width: 300px;
  height: 300px;
}

button:first-of-type {
  background: var(--text);
  color: var(--bg);
}

button:first-of-type:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

button:last-of-type {
  background: transparent;
  color: var(--text);
  border-color: var(--text);
}

button:last-of-type:hover {
  background: var(--text);
  color: var(--bg);
  transform: translateY(-4px);
}

section {
  width: min(1200px, 92%);
  margin: 80px auto;
}

.about,
.projects,
.journey,
.skills,
.contact {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 50px;
  transition: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
  animation: fadeInUp 0.8s ease forwards;
  opacity: 0;
}

.about {
  animation-delay: 0.1s;
}

.projects {
  animation-delay: 0.2s;
}

.journey {
  animation-delay: 0.3s;
}

.skills {
  animation-delay: 0.4s;
}

.contact {
  animation-delay: 0.5s;
}

.about:hover,
.projects:hover,
.journey:hover,
.skills:hover,
.contact:hover {
  transform: translateY(-8px);
  border-color: var(--text);
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.08);
}

.about h2,
.projects h2,
.journey h2,
.skills h2,
.contact h3 {
  font-size: 2.2rem;
  margin-bottom: 25px;
  color: var(--text);
  font-weight: 700;
}

.about p,
.projects p,
.journey p,
.contact p {
  color: var(--text-light);
  font-size: 1rem;
  line-height: 1.8;
}

.projects {
  text-align: center;
}

.projects p {
  padding: 30px;
  border: 2px solid var(--border);
  border-radius: 8px;
  transition: all 0.4s ease;
}

.projects p:hover {
  border-color: var(--text);
  background: var(--bg-alt);
}

.journey h3 {
  margin: 25px 0 10px 0;
  color: var(--text);
  line-height: 1.6;
  font-weight: 600;
}

.journey p {
  margin: 10px 0 20px 0;
}

.skills {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  align-items: center;
  background: var(--bg-alt);
}

.skills h2 {
  text-align: center;
  width: 100%;
}

.skill-tag {
  background: var(--bg);
  border: 2px solid var(--border);
  color: var(--text);
  padding: 10px 20px;
  border-radius: 20px;
  font-size: 0.95rem;
  font-weight: 500;
  transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  cursor: default;
}

.skill-tag:hover {
  border-color: var(--text);
  background: var(--text);
  color: var(--bg);
  transform: translateY(-3px);
}

.contact {
  text-align: center;
}

.contact ul {
  list-style: none;
  margin-top: 30px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.contact li {
  margin: 0;
  animation: slideInRight 0.5s ease forwards;
  opacity: 0;
}

.contact li:nth-child(1) {
  animation-delay: 0.1s;
}

.contact li:nth-child(2) {
  animation-delay: 0.2s;
}

.contact a {
  color: var(--text);
  text-decoration: none;
  transition: all 0.3s ease;
  font-weight: 500;
  position: relative;
}

.contact a::after {
  content: "";
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--text);
  transition: width 0.4s ease;
}

.contact a:hover {
  color: var(--text-light);
}

.contact a:hover::after {
  width: 100%;
}

html::-webkit-scrollbar {
  width: 10px;
}

html::-webkit-scrollbar-track {
  background: var(--bg);
}

html::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 5px;
}

html::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

@keyframes fadeInLeft {
  from {
    opacity: 0;
    transform: translateX(-30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(40px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.7;
  }
}

@keyframes bounce {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}

@keyframes rotate {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

.smiley-container {
  position: fixed;
  bottom: 30px;
  right: 30px;
  z-index: 5000;
}

.smiley {
  font-size: 4rem;
  cursor: pointer;
  transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  user-select: none;
  animation: pulse 2s ease-in-out infinite;
}

.smiley:hover {
  transform: scale(1.25) rotate(20deg);
  animation: bounce 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) infinite;
}

.smiley:active {
  animation: rotate 0.4s linear;
}

.smiley-label {
  position: absolute;
  bottom: -35px;
  right: 0;
  white-space: nowrap;
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 500;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.smiley-container:hover .smiley-label {
  opacity: 1;
  animation: fadeInUp 0.4s ease forwards;
}

.error-screen {
  position: fixed;
  inset: 0;
  background: var(--text);
  display: none;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  overflow: hidden;
  z-index: 99999;
}

.error-screen.active {
  display: flex;
  animation: screenShake 0.12s infinite, flicker 0.1s infinite;
}

.glitch-text {
  position: relative;
  color: var(--bg);
  font-size: 4.5rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 10px;
  animation: glitchShift 0.35s infinite;
  font-family: monospace;
}

.secret-msg {
  margin-top: 50px;
  color: var(--bg);
  font-size: 1.2rem;
  letter-spacing: 3px;
  text-transform: uppercase;
  font-family: monospace;
  font-weight: 700;
  animation: fadeInUp 1s ease infinite;
}

@keyframes glitchShift {
  0% {
    text-shadow: 2px 0 var(--bg-alt), -2px 0 var(--text-muted);
    transform: translate(0);
  }
  25% {
    text-shadow: -3px 0 var(--bg-alt), 3px 0 var(--text-muted);
    transform: translate(-2px, 1px);
  }
  50% {
    text-shadow: 3px 0 var(--bg-alt), -3px 0 var(--text-muted);
    transform: translate(2px, -1px);
  }
  75% {
    text-shadow: -2px 0 var(--bg-alt), 2px 0 var(--text-muted);
    transform: translate(-1px, 2px);
  }
  100% {
    text-shadow: 2px 0 var(--bg-alt), -2px 0 var(--text-muted);
    transform: translate(0);
  }
}

@keyframes screenShake {
  0% {
    transform: translate(0);
  }
  10% {
    transform: translate(-3px, 2px) rotate(0.3deg);
  }
  20% {
    transform: translate(3px, -2px) rotate(-0.3deg);
  }
  30% {
    transform: translate(-2px, 3px) rotate(0.2deg);
  }
  40% {
    transform: translate(2px, -3px) rotate(-0.2deg);
  }
  50% {
    transform: translate(-4px, 1px) rotate(0.4deg);
  }
  60% {
    transform: translate(4px, -1px) rotate(-0.4deg);
  }
  70% {
    transform: translate(-1px, 2px) rotate(0.1deg);
  }
  80% {
    transform: translate(1px, -2px) rotate(-0.1deg);
  }
  100% {
    transform: translate(0);
  }
}

@keyframes flicker {
  0% {
    opacity: 1;
  }
  5% {
    opacity: 0.95;
  }
  10% {
    opacity: 1;
  }
  15% {
    opacity: 0.9;
  }
  30% {
    opacity: 1;
  }
  50% {
    opacity: 0.98;
  }
  70% {
    opacity: 1;
  }
  85% {
    opacity: 0.92;
  }
  100% {
    opacity: 1;
  }
}

@media (max-width: 900px) {
  nav {
    flex-direction: column;
    gap: 20px;
  }

  .nav-links {
    flex-wrap: wrap;
    justify-content: center;
    gap: 1.5rem;
  }

  .hero h2 {
    font-size: 2.8rem;
  }

  .hero h3 {
    font-size: 0.9rem;
  }

  section {
    margin: 60px auto;
    padding: 30px;
  }

  .about,
  .projects,
  .journey,
  .skills,
  .contact {
    padding: 35px;
  }

  .btn-group {
    flex-direction: column;
    gap: 12px;
  }

  button {
    width: 100%;
    padding: 14px 24px;
  }

  .skills {
    justify-content: center;
  }

  .smiley-container {
    bottom: 20px;
    right: 20px;
  }

  .smiley {
    font-size: 3rem;
  }

  .glitch-text {
    font-size: 3rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
