:root {
  --bg-color: oklch(0.02 0 0);
  --text-color: oklch(0.9 0 0);
  --primary: oklch(0.45 0.26 290);
  --secondary: oklch(0.85 0.18 230);
  --accent: oklch(0.6 0.25 15);
  --glass-bg: oklch(1 0 0 / 0.03);
  --glass-border: oklch(1 0 0 / 0.05);
  --font-heading: "Space Grotesk", sans-serif;
  --font-body: "Outfit", sans-serif;
  --gap: 2rem;
}

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

html {
  scroll-behavior: smooth;
}

body {
  background-color: var(--bg-color);
  color: var(--text-color);
  font-family: var(--font-body);
  line-height: 1.6;
  overflow-x: hidden;
  cursor: none; /* Custom cursor */
  
  /* Subtle Grid Background to fill empty space */
  background-image: 
      linear-gradient(oklch(1 0 0 / 0.03) 1px, transparent 1px),
      linear-gradient(90deg, oklch(1 0 0 / 0.03) 1px, transparent 1px);
  background-size: 50px 50px;
}

/* Noise Overlay */
.noise-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 9998;
  opacity: 0.05;
  background: url('data:image/svg+xml;utf8,%3Csvg viewBox="0 0 200 200" xmlns="http://www.w3.org/2000/svg"%3E%3Cfilter id="noiseFilter"%3E%3CfeTurbulence type="fractalNoise" baseFrequency="0.65" numOctaves="3" stitchTiles="stitch"/%3E%3C/filter%3E%3Crect width="100%25" height="100%25" filter="url(%23noiseFilter)"/%3E%3C/svg%3E');
}

/* Canvas Background */
#hero-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  opacity: 0.6;
}

/* Premium Loader */
.loader-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-color);
    z-index: 99999; /* Top level */
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.8s ease-in-out, visibility 0.8s;
}

.loader-container.hidden {
    opacity: 0;
    visibility: hidden;
}

.loader-content {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
}

.loader-logo {
    font-size: 3rem;
    font-weight: 700;
    font-family: var(--font-heading);
    color: #fff;
    opacity: 0;
    animation: fadeUp 0.8s ease forwards;
}

.loader-logo .dot {
    color: var(--primary);
    display: inline-block;
    animation: pulse 1.5s infinite;
}

.loader-bar-wrapper {
    width: 200px;
    height: 4px;
    background: oklch(1 0 0 / 0.1);
    border-radius: 4px;
    overflow: hidden;
    opacity: 0;
    animation: fadeUp 0.8s ease 0.2s forwards;
    position: relative;
}

.loader-bar {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    box-shadow: 0 0 10px var(--primary);
    border-radius: 4px;
    animation: loadProgress 2s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.loader-text {
    font-family: 'Fira Code', monospace;
    font-size: 0.8rem;
    color: oklch(0.6 0 0);
    opacity: 0;
    animation: fadeUp 0.8s ease 0.4s forwards;
}

@keyframes loadProgress {
    0% { width: 0%; }
    50% { width: 70%; }
    100% { width: 100%; }
}

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

@keyframes pulse {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.2); opacity: 0.7; }
    100% { transform: scale(1); opacity: 1; }
}

/* Custom Cursor */
.cursor-glow {
  position: fixed;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, oklch(0.45 0.26 290 / 0.15), transparent 70%);
  border-radius: 50%;
  pointer-events: none;
  transform: translate(-50%, -50%);
  z-index: 9999;
  transition: transform 0.1s ease;
  mix-blend-mode: screen;
}

/* Typography */
h1,
h2,
h3 {
  font-family: var(--font-heading);
  font-weight: 700;
}

a {
  text-decoration: none;
  color: inherit;
  transition: 0.3s;
  cursor: none; /* Let js handle cursor hover state */
}

/* A11y Skip Link */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--primary);
    color: white;
    padding: 8px;
    z-index: 10001;
    transition: top 0.3s;
}

.skip-link:focus {
    top: 0;
}

/* Focus States for Accessibility */
:focus-visible {
    outline: 2px solid var(--secondary);
    outline-offset: 4px;
}

/* Navbar */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  padding: 1.5rem 5%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 100;
  background: oklch(0.02 0 0 / 0.7);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--glass-border);
}

.logo {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.05em;
}

.logo .dot {
  color: var(--primary);
}

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

.nav-links a {
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  opacity: 0.7;
}

.nav-links a:hover {
  opacity: 1;
  color: var(--secondary);
}

.menu-toggle {
  display: none;
}

/* Hero Section */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 10%;
  position: relative;
  overflow: hidden;
}

.hero-content {
  z-index: 2;
  max-width: 600px;
}

.hero-title {
  font-size: 5rem;
  line-height: 1.1;
  margin-bottom: 1.5rem;
  display: flex;
  flex-direction: column;
}

.gradient-text {
  background: linear-gradient(
    45deg,
    var(--secondary),
    var(--primary),
    var(--accent)
  );
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  background-size: 200% auto;
  animation: gradientMove 5s ease infinite;
}

.hero-subtitle {
  font-size: 1.2rem;
  opacity: 0.8;
  margin-bottom: 2.5rem;
  max-width: 400px;
}

.hero-actions {
  display: flex;
  gap: 1.5rem;
}

.btn {
  padding: 1rem 2rem;
  border-radius: 50px;
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  cursor: pointer; /* Change to custom later */
  position: relative;
  overflow: hidden;
}

.btn-primary {
  background: var(--text-color);
  color: var(--bg-color);
  border: 1px solid var(--text-color);
}

.btn-primary:hover {
  background: transparent;
  color: var(--text-color);
}

.btn-secondary {
  border: 1px solid var(--glass-border);
  background: var(--glass-bg);
  color: var(--text-color);
  backdrop-filter: blur(5px);
}

.btn-secondary:hover {
  border-color: var(--text-color);
}

/* Visuals */
.glowing-orb {
  position: absolute;
  top: 50%;
  right: 10%;
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, var(--primary), var(--accent));
  filter: blur(80px); /* Extreme blur */
  border-radius: 50%;
  opacity: 0.6;
  animation: float 6s ease-in-out infinite;
  z-index: 1;
}

/* Sections */
.section {
  padding: 8rem 10%;
}

.section-title {
  font-size: 3rem;
  margin-bottom: 4rem;
  position: relative;
}

.section-title .highlight {
  color: var(--secondary);
}

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

.glass-card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(10px);
  border-radius: 20px;
  padding: 2rem;
}

.skills-list {
  list-style: none;
  margin-top: 2rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}


.skills-list li {
    display: flex;
    align-items: center;
    font-size: 1.1rem;
    color: #ccc;
}

.skills-list li i {
    margin-right: 12px;
    color: var(--secondary);
    font-size: 1.2rem;
}

.skills-list li.skill-more {
    color: var(--primary);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 0.9rem;
    animation: pulse-more 2s infinite ease-in-out;
}

@keyframes pulse-more {
    0%, 100% { opacity: 0.7; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.05); }
}

.skills-list li::before {
    content: none; /* remove old dot */
}

/* Code Block Look */
pre {
  background: #000;
  padding: 1.5rem;
  border-radius: 10px;
  font-family: "Fira Code", monospace;
  font-size: 0.9rem;
  color: #a5b3ce;
  overflow-x: auto;
}

/* Projects */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 3rem;
}

.project-card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  overflow: hidden; /* Keep for image */
  transition: transform 0.1s ease, border-color 0.3s; /* Faster transform for tilt */
  transform-style: preserve-3d;
  perspective: 1000px;
}

.project-card:hover {
  transform: translateY(-10px);
  border-color: var(--primary);
}

.project-image {
  height: 250px;
  width: 100%;
  overflow: hidden;
}

.placeholder-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s;
}

.gradient-1 {
  background: linear-gradient(135deg, #1a2a6c, #b21f1f, #fdbb2d);
}
.gradient-2 {
  background: linear-gradient(135deg, #00f260, #0575e6);
}

.project-card:hover .placeholder-img {
  transform: scale(1.1);
}

.project-info {
  padding: 2rem;
}

.project-info h3 {
  margin-bottom: 0.5rem;
  font-size: 1.5rem;
}

.project-info p {
  font-size: 0.9rem;
  color: #aaa;
  margin-bottom: 1.5rem;
}

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

.tags span {
  font-size: 0.75rem;
  padding: 0.3rem 0.8rem;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 50px;
}

.btn-link {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--secondary);
}

/* Contact */
.contact-wrapper {
  text-align: center;
  padding: 5rem 2rem;
}

.big-btn {
  display: inline-block;
  margin: 2rem 0;
  font-size: 1.5rem;
  padding: 1.5rem 3rem;
}

.socials {
  display: flex;
  justify-content: center;
  gap: 2rem;
}

/* Footer */
footer {
  padding: 2rem;
  text-align: center;
  font-size: 0.8rem;
  color: #666;
  border-top: 1px solid var(--glass-border);
}

.heart {
  color: var(--accent);
}

/* Floating Terminal */
.floating-terminal {
    width: 100%;
    max-width: 500px;
    min-height: 300px;
    background: oklch(0.1 0.02 280 / 0.9);
    border: 1px solid oklch(1 0 0 / 0.1);
    border-radius: 12px;
    box-shadow: 0 20px 50px oklch(0 0 0 / 0.5);
    font-family: 'Fira Code', monospace;
    overflow: hidden;
    animation: float 6s ease-in-out infinite;
    position: relative;
}

.terminal-header {
    background: oklch(1 0 0 / 0.05);
    padding: 10px 15px;
    display: flex;
    gap: 8px;
    border-bottom: 1px solid oklch(1 0 0 / 0.05);
}

.dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
}

.dot.red { background: oklch(0.65 0.2 25); }
.dot.yellow { background: oklch(0.8 0.15 80); }
.dot.green { background: oklch(0.7 0.18 140); }

.terminal-body {
    padding: 20px;
    color: #e0e0e0;
    font-size: 0.9rem;
}

.prompt { color: var(--secondary); margin-right: 10px; }
.output { color: #888; margin-bottom: 10px; display: block; }
.output.success { color: var(--accent); }

.cursor {
    animation: blink-caret 1s step-end infinite;
    background: var(--primary);
    color: var(--primary);
}

/* Premium Text-Only Cards */
.project-card.text-only {
    padding: 2.5rem;
    position: relative;
    background: linear-gradient(145deg, oklch(1 0 0 / 0.03) 0%, oklch(1 0 0 / 0.01) 100%);
    border: 1px solid oklch(1 0 0 / 0.05);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 300px;
    overflow: hidden;
    transition: all 0.4s ease;
}

.project-card.text-only:hover {
    transform: translateY(-10px) scale(1.02);
    border-color: var(--primary);
    box-shadow: 0 15px 40px oklch(0.45 0.26 290 / 0.1);
}

.card-header {
    margin-bottom: 1.5rem;
}

.card-icon {
    font-size: 2.5rem;
    color: var(--secondary);
    margin-bottom: 1.5rem;
    display: block;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.project-card.text-only:hover .card-icon {
    transform: scale(1.2) rotate(5deg);
    color: var(--primary);
}

.project-card h3 {
    font-size: 1.8rem;
    margin-bottom: 1rem;
    background: linear-gradient(to right, oklch(1 0 0), oklch(0.8 0 0));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.card-glow {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 50% 0%, var(--primary), transparent 70%);
    opacity: 0;
    transition: opacity 0.4s;
    pointer-events: none;
    z-index: 0;
    mix-blend-mode: overlay;
}

.project-card.text-only:hover .card-glow {
    opacity: 0.15;
}

.card-content {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.project-card p {
    flex-grow: 1;
    margin-bottom: 2rem;
    font-size: 1rem;
    color: #a0a0a0;
    line-height: 1.7;
}

/* Animations */
@keyframes typing {
  from { width: 0 }
  to { width: 100% }
}

@keyframes blink-caret {
  from, to { opacity: 0; }
  50% { opacity: 1; }
}

.typing-effect {
    overflow: hidden; /* Ensures the content is not revealed until the animation */
    white-space: nowrap; /* Keeps the content on a single line */
    margin: 0 auto; /* Gives that scrolling effect as the typing happens */
    animation: typing 3.5s steps(40, end);
}

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

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

/* Reveal Animation State Class */
.reveal-text,
.reveal-text-delay,
.reveal-buttons {
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

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

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 10px;
}
::-webkit-scrollbar-track {
  background: #0a0a0a;
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 5px;
  border: 2px solid #0a0a0a;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--primary);
}

/* Capabilities Grid */
.capabilities-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    padding: 2.5rem;
    width: 100%;
}

.capability-item {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    transition: transform 0.3s ease, border-color 0.3s ease;
}

.capability-item:hover {
    transform: translateY(-5px);
    border-color: var(--primary);
    background: rgba(255, 255, 255, 0.06);
}

.icon-box {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
    font-size: 1.5rem;
    color: #fff;
    box-shadow: 0 10px 20px rgba(0,0,0,0.3);
}

.capability-item h3 {
    font-size: 1.1rem;
    color: #fff;
    margin-bottom: 0.5rem;
}

.capability-item p {
    font-size: 0.85rem;
    color: #aaa;
    margin-bottom: 0;
}

/* Responsive */
@media (max-width: 768px) {
  .navbar {
    padding: 1rem 5%;
  }

  .nav-links {
    display: flex;
    position: fixed;
    top: 0;
    right: -100%;
    height: 100vh;
    width: 70%;
    background: oklch(0.01 0 0 / 0.95);
    backdrop-filter: blur(10px);
    flex-direction: column;
    justify-content: center;
    align-items: center;
    transition: right 0.3s ease;
    border-left: 1px solid var(--glass-border);
  }

  .nav-links.active {
    right: 0;
  }

  .menu-toggle {
    display: block;
    cursor: pointer;
    z-index: 101;
    background: none;
    border: none;
  }

  .bar {
    display: block;
    width: 25px;
    height: 3px;
    margin: 5px auto;
    -webkit-transition: all 0.3s ease-in-out;
    transition: all 0.3s ease-in-out;
    background-color: var(--text-color);
  }

  /* Hamburger Animation */
  .menu-toggle.open .bar:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
  }
  .menu-toggle.open .bar:nth-child(2) {
    opacity: 0;
  }
  .menu-toggle.open .bar:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
  }

  .hero {
    flex-direction: column;
    padding-top: 8rem;
    text-align: center;
    padding-bottom: 4rem;
  }

  .hero-content {
    margin-bottom: 3rem;
  }

  .hero-title {
    font-size: 3rem;
    align-items: center;
  }
  
  .hero-subtitle {
     margin-left: auto;
     margin-right: auto;
  }
  
  .hero-actions {
      justify-content: center;
  }

  .floating-terminal {
    max-width: 100%;
    min-height: 250px;
  }

  .about-grid {
    grid-template-columns: 1fr;
    gap: 3rem;
  }
  
  .about-visual {
      order: -1;
  }

  .section {
    padding: 4rem 5%;
  }

  .section-title {
      font-size: 2.5rem;
  }

  .cursor-glow {
    display: none;
  }
  body {
    cursor: auto;
  }
  
  .project-card.text-only {
      padding: 1.5rem;
  }
  
  /* Fix Email Button */
  .big-btn {
      padding: 1rem 1.5rem;
      font-size: 1rem;
      width: 100%;
      word-break: break-all;
  }
}
