/* ─────────────────────────────────────────
   TOKENS
───────────────────────────────────────── */
:root {
  --bg:        #06060c;
  --bg2:       #0c0c16;
  --bg3:       #111120;
  --border:    rgba(255,255,255,0.07);
  --border2:   rgba(255,255,255,0.12);
  --text:      #f0f0f8;
  --muted:     #6b6b88;
  --muted2:    #9898b8;
  --accent:    #00d4ff;
  --accent2:   #7c6aff;
  --accent-glow: rgba(0,212,255,0.15);
  --radius:    14px;
  --font-display: 'Bricolage Grotesque', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

/* ─────────────────────────────────────────
   RESET & BASE
───────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-display);
  font-size: 16px;
  line-height: 1.6;
  overflow-x: hidden;
}

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



/* ─────────────────────────────────────────
   NOISE TEXTURE OVERLAY
───────────────────────────────────────── */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  opacity: 0.025;
  pointer-events: none;
  z-index: 1000;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ─────────────────────────────────────────
   NAV
───────────────────────────────────────── */
nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  padding: 0 48px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(6,6,12,0.7);
  backdrop-filter: blur(20px) saturate(1.5);
  -webkit-backdrop-filter: blur(20px) saturate(1.5);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s;
}

nav.scrolled { border-bottom-color: var(--border); }

.nav-logo {
  font-size: 15px;
  font-weight: 800;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-logo .dot {
  width: 7px; height: 7px;
  background: var(--accent);
  border-radius: 50%;
  box-shadow: 0 0 10px var(--accent);
  animation: pulse-dot 2.5s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%,100% { box-shadow: 0 0 6px var(--accent); opacity:1; }
  50% { box-shadow: 0 0 18px var(--accent); opacity:0.7; }
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 40px;
  list-style: none;
}

.nav-links a {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  transition: color 0.2s;
  position: relative;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -3px; left: 0;
  width: 0; height: 1px;
  background: var(--accent);
  transition: width 0.25s;
}

.nav-links a:hover { color: var(--text); }
.nav-links a:hover::after { width: 100%; }

.nav-cta {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border: 1px solid var(--border2);
  padding: 8px 18px;
  border-radius: 100px;
  color: var(--text) !important;
  transition: all 0.25s !important;
}

.nav-cta:hover {
  background: var(--accent) !important;
  border-color: var(--accent) !important;
  color: var(--bg) !important;
  box-shadow: 0 0 24px var(--accent-glow) !important;
}

.nav-cta::after { display: none !important; }

/* ─────────────────────────────────────────
   HERO
───────────────────────────────────────── */
#hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 0 48px;
  overflow: hidden;
}

/* Animated grid background */
.hero-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px);
  background-size: 60px 60px;
  mask-image: radial-gradient(ellipse 80% 70% at 50% 50%, black 30%, transparent 80%);
  animation: grid-drift 20s linear infinite;
}

@keyframes grid-drift {
  0% { transform: translateY(0); }
  100% { transform: translateY(60px); }
}

/* Glow blob */
.hero-blob {
  position: absolute;
  width: 600px; height: 600px;
  background: radial-gradient(circle, rgba(0,212,255,0.07) 0%, transparent 70%);
  top: 50%; left: 55%;
  transform: translate(-50%,-50%);
  animation: blob-float 8s ease-in-out infinite;
  pointer-events: none;
}

@keyframes blob-float {
  0%,100% { transform: translate(-50%,-50%) scale(1); }
  50% { transform: translate(-48%,-52%) scale(1.08); }
}

.hero-blob-2 {
  position: absolute;
  width: 400px; height: 400px;
  background: radial-gradient(circle, rgba(124,106,255,0.05) 0%, transparent 70%);
  bottom: 10%; left: 5%;
  animation: blob-float 12s ease-in-out infinite reverse;
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 1100px;
}

.hero-label {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 28px;
  display: flex;
  align-items: center;
  gap: 12px;
  opacity: 0;
  animation: fade-up 0.7s 0.1s forwards;
}

.hero-label::before {
  content: '';
  display: block;
  width: 32px; height: 1px;
  background: var(--accent);
}

.hero-name {
  font-size: clamp(56px, 9vw, 124px);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 0.95;
  margin-bottom: 32px;
  opacity: 0;
  animation: fade-up 0.8s 0.25s forwards;
}

.hero-name span {
  display: block;
  color: transparent;
  -webkit-text-stroke: 1px rgba(255,255,255,0.2);
  transition: all 0.3s;
}

.hero-name span:hover {
  -webkit-text-stroke-color: var(--accent);
}

.hero-desc {
  font-size: 18px;
  color: var(--muted2);
  max-width: 480px;
  line-height: 1.7;
  margin-bottom: 48px;
  opacity: 0;
  animation: fade-up 0.8s 0.4s forwards;
}

.hero-desc strong { color: var(--text); font-weight: 600; }

.hero-actions {
  display: flex;
  gap: 16px;
  align-items: center;
  opacity: 0;
  animation: fade-up 0.8s 0.55s forwards;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--accent);
  color: var(--bg);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 14px 28px;
  border-radius: 100px;
  transition: all 0.25s;
  box-shadow: 0 0 0 rgba(0,212,255,0);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(0,212,255,0.3);
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted2);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 14px 0;
  transition: color 0.25s;
}

.btn-secondary:hover { color: var(--text); }
.btn-secondary svg { transition: transform 0.25s; }
.btn-secondary:hover svg { transform: translateX(4px); }

.hero-scroll {
  position: absolute;
  bottom: 40px; left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--muted);
  z-index: 2;
  animation: fade-up 1s 1.2s both;
}

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

@keyframes scroll-line {
  0%,100% { transform: scaleY(1); opacity: 0.5; }
  50% { transform: scaleY(0.5); opacity: 1; }
}

@keyframes fade-up {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ─────────────────────────────────────────
   SECTION UTILITIES
───────────────────────────────────────── */
section {
  padding: 120px 48px;
  max-width: 1200px;
  margin: 0 auto;
}

.section-eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.section-eyebrow::before {
  content: '';
  display: block;
  width: 24px; height: 1px;
  background: var(--accent);
}

.section-title {
  font-size: clamp(32px, 4vw, 52px);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin-bottom: 16px;
}

.section-subtitle {
  font-size: 16px;
  color: var(--muted2);
  max-width: 560px;
  line-height: 1.7;
}

/* Reveal on scroll */
.reveal {
  opacity: 0;
  transform: translateY(32px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ─────────────────────────────────────────
   ABOUT
───────────────────────────────────────── */
#about { border-top: 1px solid var(--border); }

.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 80px;
  margin-top: 64px;
  align-items: start;
}

.about-text p {
  color: var(--muted2);
  font-size: 15px;
  line-height: 1.9;
  margin-bottom: 20px;
}

.about-text p strong { color: var(--text); font-weight: 700; }

.about-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px;
  margin-top: 40px;
}

.stat-box {
  background: var(--bg2);
  border: 1px solid var(--border);
  padding: 24px;
  transition: border-color 0.2s;
}

.stat-box:first-child { border-radius: var(--radius) 0 0 0; }
.stat-box:nth-child(2) { border-radius: 0 var(--radius) 0 0; }
.stat-box:nth-child(3) { border-radius: 0 0 0 var(--radius); }
.stat-box:last-child { border-radius: 0 0 var(--radius) 0; }

.stat-box:hover { border-color: var(--border2); }

.stat-num {
  font-size: 36px;
  font-weight: 800;
  letter-spacing: -0.04em;
  color: var(--accent);
  line-height: 1;
  margin-bottom: 6px;
}

.stat-label {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.05em;
}

.about-right {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.about-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  display: flex;
  gap: 16px;
  align-items: flex-start;
  transition: border-color 0.25s, transform 0.25s;
}

.about-card:hover {
  border-color: var(--border2);
  transform: translateX(6px);
}

.about-card-icon {
  width: 40px; height: 40px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.about-card-text h4 {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 4px;
}

.about-card-text p {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.6;
}

/* ─────────────────────────────────────────
   PROJECTS
───────────────────────────────────────── */
#projects { border-top: 1px solid var(--border); }

.projects-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 56px;
}

.projects-grid {
  display: grid;
  /* This creates responsive columns. Adjust the 300px to your preferred minimum card width */
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); 
  gap: 24px; /* Adjust spacing between cards */
  align-items: stretch; /* This is the magic property that forces equal heights */
}

.project-card {
  position: relative;
  background: var(--bg2);
  border: 1px solid var(--border);
  padding: 32px;
  transition: all 0.3s;
  overflow: hidden;
  cursor: pointer;
  
  /* NEW ADDITIONS */
  height: 100%; 
  flex-direction: column;
}

/* Optional: Pushes the project stack and arrow to the bottom of the card */
.project-card .project-stack {
  margin-top: auto; 
}

.project-card:first-child { border-radius: var(--radius) 0 0 0; }
.project-card:nth-child(3) { border-radius: 0 var(--radius) 0 0; }
.project-card:nth-child(4) { border-radius: 0 0 0 var(--radius); }
.project-card:last-child { border-radius: 0 0 var(--radius) 0; }

.project-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 80% 80% at 50% 0%, rgba(0,212,255,0.06), transparent 60%);
  opacity: 0;
  transition: opacity 0.35s;
}

.project-card:hover { border-color: var(--border2); }
.project-card:hover::before { opacity: 1; }

.project-card:hover .project-arrow { transform: translate(3px,-3px); opacity: 1; }

.project-num {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.1em;
  margin-bottom: 20px;
}

.project-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent2);
  background: rgba(124,106,255,0.1);
  border: 1px solid rgba(124,106,255,0.2);
  padding: 4px 10px;
  border-radius: 100px;
  margin-bottom: 16px;
}

.project-image {
  width: 50%;
  height: 50%;
  margin-bottom: 5%;
  transition: filter 0.3s;
}

.card-worryfree .project-image        { filter: drop-shadow(0 0 8px #6dbf6d); }
.card-worryfree:hover .project-image  { filter: drop-shadow(0 0 18px #6dbf6d); }

.card-unireserve .project-image       { filter: drop-shadow(0 0 8px #c23b3b); }
.card-unireserve:hover .project-image { filter: drop-shadow(0 0 18px #c23b3b); }

.card-autotest .project-image         { filter: drop-shadow(0 0 8px #4a90e2); }
.card-autotest:hover .project-image   { filter: drop-shadow(0 0 18px #4a90e2); }

.project-name {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 10px;
  line-height: 1.2;
}

.project-desc {
  font-size: 13px;
  color: var(--muted2);
  line-height: 1.7;
  margin-bottom: 24px;
}

.project-stack {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.stack-chip {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--muted);
  background: var(--bg3);
  border: 1px solid var(--border);
  padding: 3px 10px;
  border-radius: 100px;
}

.project-arrow {
  color: var(--accent);
  font-size: 18px;
  opacity: 0.4;
  transition: all 0.25s;
  display: inline-block;
}

/* ─────────────────────────────────────────
   SKILLS
───────────────────────────────────────── */
#skills { border-top: 1px solid var(--border); }

.skills-layout {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 80px;
  margin-top: 64px;
  align-items: start;
}

.skills-categories {
  display: flex;
  flex-direction: column;
  gap: 4px;
  position: sticky;
  top: 90px;
}

.skill-cat-btn {
  background: none;
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 14px 18px;
  color: var(--muted);
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 600;
  text-align: left;
  cursor: none;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 10px;
}

.skill-cat-btn:hover { color: var(--text); background: var(--bg2); }

.skill-cat-btn.active {
  color: var(--text);
  background: var(--bg2);
  border-color: var(--border);
}

.skill-cat-btn .cat-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--muted);
  flex-shrink: 0;
  transition: background 0.2s, box-shadow 0.2s;
}

.skill-cat-btn.active .cat-dot {
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
}

.skills-panel { display: none; }
.skills-panel.active { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.skill-item {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  transition: border-color 0.25s, transform 0.25s;
}

.skill-item:hover {
  border-color: var(--border2);
  transform: translateY(-3px);
}

.skill-item-icon { font-size: 24px; margin-bottom: 10px; }
.skill-item-name { font-size: 14px; font-weight: 700; margin-bottom: 4px; }
.skill-item-level {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--muted);
  letter-spacing: 0.08em;
  margin-bottom: 12px;
}

.skill-bar {
  height: 3px;
  background: var(--bg3);
  border-radius: 100px;
  overflow: hidden;
}

.skill-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent2), var(--accent));
  border-radius: 100px;
  transition: width 0.8s cubic-bezier(.25,.8,.25,1);
  width: 0;
}

/* ─────────────────────────────────────────
   CONTACT
───────────────────────────────────────── */
#contact { border-top: 1px solid var(--border); }

.contact-inner {
  margin-top: 80px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  align-items: start;
}

.contact-info h3 {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 12px;
}

.contact-info p {
  color: var(--muted2);
  font-size: 15px;
  line-height: 1.7;
  margin-bottom: 40px;
}

.social-links {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.social-link {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 12px;
  transition: all 0.25s;
}

.social-link:hover {
  border-color: var(--border2);
  transform: translateX(6px);
}

.social-icon {
  width: 36px; height: 36px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  transition: background 0.2s;
}

.social-link:hover .social-icon { background: var(--bg3); border-color: var(--accent); }

.social-name { font-size: 14px; font-weight: 700; }
.social-handle { font-family: var(--font-mono); font-size: 11px; color: var(--muted); }

.contact-form { display: flex; flex-direction: column; gap: 16px; }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.form-group { display: flex; flex-direction: column; gap: 8px; }

.form-group label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.form-group input,
.form-group textarea {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
  color: var(--text);
  font-family: var(--font-display);
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  resize: none;
}

.form-group input:focus,
.form-group textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(0,212,255,0.08);
}

.form-group textarea { min-height: 120px; }

.form-submit {
  background: var(--accent);
  border: none;
  border-radius: 100px;
  padding: 15px 32px;
  color: var(--bg);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: none;
  transition: all 0.25s;
  align-self: flex-start;
  display: flex;
  align-items: center;
  gap: 8px;
}

.form-submit:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,212,255,0.3);
}

/* ─────────────────────────────────────────
   FOOTER
───────────────────────────────────────── */
footer {
  border-top: 1px solid var(--border);
  padding: 32px 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.footer-copy {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.05em;
}

.footer-back {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 8px;
  transition: color 0.2s;
}

.footer-back:hover { color: var(--accent); }

/* ─────────────────────────────────────────
   RESPONSIVE
───────────────────────────────────────── */
@media (max-width: 900px) {
  nav { padding: 0 24px; }
  .nav-links { display: none; }
  #hero, section, footer { padding-left: 24px; padding-right: 24px; }
  .hero-name { font-size: clamp(40px, 12vw, 80px); }
  .about-grid, .contact-inner, .skills-layout { grid-template-columns: 1fr; gap: 40px; }
  .projects-grid { grid-template-columns: 1fr; }
  .project-card { border-radius: var(--radius) !important; }
  .skills-categories { position: static; flex-direction: row; flex-wrap: wrap; }
  .skills-panel.active { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
}