:root {
  /* Catppuccin Frappe palette */
  --base: #303446;
  --mantle: #292c3c;
  --crust: #232634;
  --text: #c6d0f5;
  --subtext1: #b5bfe2;
  --subtext0: #a5adce;
  --overlay2: #949cbb;
  --overlay1: #838ba7;
  --overlay0: #737994;
  --surface2: #626880;
  --surface1: #51576d;
  --surface0: #414559;
  --pink: #f4b8e4;
  --mauve: #ca9ee6;
  --red: #e78284;
  --maroon: #ea999c;
  --peach: #ef9f76;
  --yellow: #e5c890;
  --green: #a6d189;
  --teal: #81c8be;
  --sky: #99d1db;
  --sapphire: #85c1dc;
  --blue: #8caaee;
  --lavender: #babbf1;
  --font-mono: 'Fira Code', 'JetBrains Mono', monospace;
  --font-sans: 'Inter', 'SF Pro Display', -apple-system, BlinkMacSystemFont, sans-serif;
}

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

body {
  font-family: var(--font-sans);
  line-height: 1.6;
  color: var(--text);
  background-color: var(--base);
  overflow-x: hidden;
  scroll-behavior: smooth;
}

::selection {
  background: var(--mauve);
  color: var(--crust);
}

/* Header and Hero Section */
header {
  background-color: var(--mantle);
  padding: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  position: relative;
  background: linear-gradient(rgba(35, 38, 52, 0.8), rgba(35, 38, 52, 0.8)), url('images/main-bg.png') center/cover;
}

.header-content {
  text-align: center;
  z-index: 2;
}

.hero-title {
  font-size: 5rem;
  margin-bottom: 1rem;
  font-weight: 800;
  overflow: hidden;
  background: linear-gradient(90deg, var(--blue), var(--mauve), var(--pink));
  background-size: 200% auto;
  background-clip: text;
  -webkit-background-clip: text;
  color: transparent;
  animation: gradient 5s ease infinite;
}

@keyframes gradient {
  0% {
    background-position: 0% 50%;
  }

  50% {
    background-position: 100% 50%;
  }

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

.hero-subtitle {
  font-size: 1.5rem;
  margin-bottom: 2rem;
  color: var(--subtext0);
}

/* Terminal Component */
.terminal {
  background-color: var(--crust);
  border-radius: 0.5rem;
  padding: 1rem;
  width: 80%;
  max-width: 600px;
  margin: 2rem auto;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  font-family: var(--font-mono);
  position: relative;
}

.terminal-header {
  display: flex;
  align-items: center;
  margin-bottom: 1rem;
}

.terminal-buttons {
  display: flex;
  gap: 0.5rem;
  margin-right: 1rem;
}

.terminal-button {
  width: 0.75rem;
  height: 0.75rem;
  border-radius: 50%;
}

.terminal-button.red {
  background-color: var(--red);
}

.terminal-button.yellow {
  background-color: var(--yellow);
}

.terminal-button.green {
  background-color: var(--green);
}

.terminal-title {
  color: var(--subtext1);
  font-size: 0.8rem;
  flex-grow: 1;
  text-align: center;
}

.terminal-content {
  color: var(--text);
  display: flex;
  align-items: center;
}

.prompt {
  color: var(--green);
  margin-right: 0.5rem;
  display: inline-block;
  flex-shrink: 0;
}

.typing-container {
  display: inline-flex;
  align-items: center;
  overflow: hidden;
}

.terminal-text {
  white-space: nowrap;
  overflow: hidden;
  width: 0;
  display: inline-block;
  animation: typing 3s steps(40, end) forwards;
}

.cursor {
  background-color: var(--text);
  display: inline-block;
  width: 0.6rem;
  height: 1.2rem;
  vertical-align: middle;
  margin-left: 0.2rem;
  animation: blink 1s step-end infinite;
  flex-shrink: 0;
}

@keyframes blink {

  from,
  to {
    opacity: 0;
  }

  50% {
    opacity: 1;
  }
}

@keyframes typing {
  from {
    width: 0;
  }

  to {
    width: 100%;
  }
}

/* Background Code */
.background-code {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1;
  opacity: 0.05;
  font-family: var(--font-mono);
  overflow: hidden;
  color: var(--lavender);
  font-size: 1rem;
  padding: 2rem;
}

/* Navigation */
nav {
  background-color: var(--crust);
  position: sticky;
  top: 0;
  z-index: 100;
  padding: 1rem 0;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 2rem;
}

.logo {
  font-weight: bold;
  font-size: 1.5rem;
  color: var(--lavender);
  text-decoration: none;
}

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

.nav-links a {
  color: var(--subtext0);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.3s;
  position: relative;
}

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

.nav-links a::after {
  content: '';
  position: absolute;
  width: 0;
  height: 2px;
  bottom: -5px;
  left: 0;
  background-color: var(--mauve);
  transition: width 0.3s;
}

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

/* Main Content */
main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 4rem 2rem;
}

section {
  margin-bottom: 6rem;
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

section.visible {
  opacity: 1;
  transform: translateY(0);
}

.section-title {
  font-size: 2.5rem;
  margin-bottom: 2rem;
  color: var(--blue);
  position: relative;
  display: inline-block;
}

.section-title::after {
  content: '';
  position: absolute;
  bottom: -10px;
  left: 0;
  width: 60px;
  height: 4px;
  background-color: var(--mauve);
}

/* About Section */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: center;
}

.about-text p {
  margin-bottom: 1.5rem;
  color: var(--subtext1);
  font-size: 1.1rem;
}

.profile-image {
  border: 4px solid var(--blue);
  border-radius: 50%;
  max-width: 80%;
  transition: transform 0.3s ease;
}

.profile-image:hover {
  transform: scale(1.05);
}

/* Skills Section */
.skills-container {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 2rem;
}

.skill-tag {
  background-color: var(--surface0);
  color: var(--text);
  padding: 0.5rem 1rem;
  border-radius: 2rem;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  transition: transform 0.3s, background-color 0.3s;
}

.skill-tag:hover {
  transform: translateY(-5px);
  background-color: var(--surface1);
}

.skill-tag.language {
  border-left: 3px solid var(--red);
}

.skill-tag.framework {
  border-left: 3px solid var(--blue);
}

.skill-tag.tool {
  border-left: 3px solid var(--green);
}

.skill-tag.database {
  border-left: 3px solid var(--yellow);
}

/* Projects Section */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 2rem;
}

.project-card {
  background-color: var(--mantle);
  border-radius: 0.5rem;
  overflow: hidden;
  transition: transform 0.3s, box-shadow 0.3s;
  position: relative;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
  opacity: 0;
  transform: translateY(30px);
  visibility: hidden;
}

.project-card.fade-in {
  opacity: 1;
  transform: translateY(0);
  visibility: visible;
}

.project-card:hover {
  transform: translateY(-10px);
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.2);
}

.project-image {
  width: 100%;
  height: 200px;
  position: relative;
  overflow: hidden;
}

.card-img-top {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.project-card:hover .card-img-top {
  transform: scale(1.05);
}

.project-content {
  padding: 1.5rem;
}

.project-title {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
  color: var(--lavender);
}

.project-description {
  color: var(--subtext0);
  margin-bottom: 1rem;
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.project-tag {
  background-color: var(--surface0);
  color: var(--subtext1);
  padding: 0.2rem 0.6rem;
  border-radius: 0.3rem;
  font-size: 0.75rem;
  font-family: var(--font-mono);
}

.tech-stack {
  margin-top: 1.5rem;
}

.tech-stack i {
  font-size: 30px;
  margin: 0 10px;
  color: var(--text);
  transition: color 0.3s ease, transform 0.3s ease;
}

.tech-stack i:hover {
  color: var(--blue);
  transform: translateY(-5px);
}

/* Contact Section */
.contact-section {
  background-color: var(--mantle);
  padding: 3rem;
  border-radius: 0.5rem;
  text-align: center;
}

.contact-section .btn {
  margin: 1rem 0.5rem;
  background-color: transparent;
  border: 2px solid var(--blue);
  color: var(--blue);
  padding: 0.8rem 1.5rem;
  border-radius: 0.3rem;
  font-weight: bold;
  cursor: pointer;
  transition: background-color 0.3s, color 0.3s, transform 0.3s;
  text-decoration: none;
  display: inline-block;
}

.contact-section .btn:hover {
  background-color: var(--blue);
  color: var(--crust);
  transform: translateY(-3px);
}

/* Footer */
footer {
  background-color: var(--mantle);
  color: var(--overlay1);
  text-align: center;
  padding: 2rem;
  margin-top: 4rem;
}

/* Animations */
.fade-in {
  animation: fadeIn 1s ease forwards;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

.slide-in-left {
  animation: slideInLeft 1s ease forwards;
}

@keyframes slideInLeft {
  from {
    transform: translateX(-50px);
    opacity: 0;
  }

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

.slide-in-right {
  animation: slideInRight 1s ease forwards;
}

@keyframes slideInRight {
  from {
    transform: translateX(50px);
    opacity: 0;
  }

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

.slide-in-up {
  animation: slideInUp 1s ease forwards;
}

@keyframes slideInUp {
  from {
    transform: translateY(50px);
    opacity: 0;
  }

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

/* Code block styling */
.code-block {
  background-color: var(--crust);
  border-radius: 0.5rem;
  padding: 1.5rem;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  line-height: 1.5;
  margin-bottom: 1.5rem;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
  position: relative;
  overflow: hidden;
}

.code-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 1rem;
  color: var(--subtext0);
  font-size: 0.8rem;
}

.language-badge {
  color: var(--blue);
  background-color: rgba(140, 170, 238, 0.1);
  padding: 0.2rem 0.5rem;
  border-radius: 0.3rem;
}

.keyword {
  color: var(--mauve);
}

.string {
  color: var(--green);
}

.comment {
  color: var(--overlay0);
}

.function {
  color: var(--blue);
}

.variable {
  color: var(--text);
}

.type {
  color: var(--yellow);
}

.constant {
  color: var(--peach);
}

/* Floating shapes */
.floating-shapes {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  z-index: 1;
}

.shape {
  position: absolute;
  opacity: 0.05;
  border-radius: 50%;
  animation: float 10s ease-in-out infinite alternate;
}

@keyframes float {
  0% {
    transform: translate(0, 0) rotate(0deg);
  }

  100% {
    transform: translate(50px, 50px) rotate(360deg);
  }
}

/* Responsive styles */
@media (max-width: 992px) {
  .hero-title {
    font-size: 3.5rem;
  }

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

@media (max-width: 768px) {
  .hero-title {
    font-size: min(2.5rem, 10vw);
  }

  .hero-subtitle {
    font-size: min(1.2rem, 5vw);
  }

  .terminal {
    width: 95%;
    padding: 0.8rem;
  }

  .terminal-text {
    font-size: 0.9rem;
  }

  .nav-container {
    flex-direction: column;
    gap: 1rem;
    padding: 0 1rem;
  }

  .nav-links {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 0.8rem;
    font-size: 0.9rem;
  }

  .section-title {
    font-size: min(2rem, 8vw);
  }

  .about-text p {
    font-size: 1rem;
  }

  .code-block {
    width: 100%;
    overflow-x: auto;
    max-width: 100%;
    font-size: 0.8rem;
    padding: 1rem;
  }

  .code-block pre {
    white-space: pre-wrap;
    word-break: break-all;
  }

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

  .project-card {
    max-width: 100%;
  }

  .project-title {
    font-size: 1.3rem;
  }

  .contact-section {
    padding: 2rem 1rem;
  }

  .contact-section .btn {
    padding: 0.6rem 1.2rem;
    margin: 0.5rem;
    font-size: 0.9rem;
    width: auto;
    display: inline-block;
  }

  main {
    padding: 2rem 1rem;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }

  section {
    margin-bottom: 3rem;
  }
}

/* Small mobile devices */
@media (max-width: 480px) {
  .hero-title {
    font-size: min(2rem, 9vw);
  }

  .terminal {
    width: 100%;
    padding: 0.5rem;
  }

  .terminal-buttons {
    gap: 0.3rem;
  }

  .terminal-button {
    width: 0.6rem;
    height: 0.6rem;
  }

  .terminal-text {
    font-size: 0.8rem;
  }

  .typing-container {
    max-width: 80vw;
  }

  .cursor {
    width: 0.4rem;
    height: 1rem;
  }

  .nav-links a {
    font-size: 0.8rem;
    padding: 0.3rem 0.5rem;
  }

  .skill-tag {
    padding: 0.3rem 0.7rem;
    font-size: 0.8rem;
  }

  .project-description {
    font-size: 0.9rem;
  }

  .project-tag {
    font-size: 0.7rem;
  }

  .tech-stack i {
    font-size: 24px;
    margin: 0 5px;
  }

  .contact-section .btn {
    width: calc(100% - 2rem);
    margin: 0.5rem 1rem;
  }
}