* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: Inter, system-ui;
}

body {
  background: linear-gradient(180deg, #0b1228 0%, #0a1220 100%); /* slightly brighter with subtle depth */
  color: #d6e6ff;
  overflow-x: hidden;
}

.hero {
  height: 80vh;
  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center;

  position: relative;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;

  background: url("background.png") left center / cover no-repeat;

  opacity: 0.34; /* brighter/more visible background */
  z-index: 0;

  -webkit-mask-image: linear-gradient(
    to bottom,
    rgba(0,0,0,1) 0%,
    rgba(0,0,0,1) 65%,
    rgba(0,0,0,0) 100%
  );

    mask-image: linear-gradient(
    to bottom,
    rgba(0,0,0,1) 0%,
    rgba(0,0,0,1) 70%,
    rgba(0,0,0,0) 100%
    );
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  backdrop-filter: blur(0.6px);
}

.hero-content {
  position: relative;
  z-index: 2;
}

.section-separator {
  width: 60%;
  height: 1px;
  margin: 0 auto;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(77,163,255,0.6),
    transparent
  );
}

.section {
  padding: 110px 15%;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 26px;
}

.card {
  padding: 26px;
  border-radius: 14px;

  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(100,150,255,0.15);

  transition: 0.25s;

  display: flex;
  flex-direction: column;
  gap: 12px;

  min-height: 160px;
}

.card:hover {
  transform: translateY(-6px);
  border-color: #4da3ff;
}

.card h3 {
  font-size: 1.25rem;
  color: #e6f0ff;
}

.stars {
  color: #ffd166;
  font-weight: 500;
}

.card a {
  margin-top: auto;
  color: #4da3ff;
  text-decoration: none;
}

.navbar {
  position: fixed;
  top: 0;
  width: 100%;
  padding: 14px 40px;

  display: flex;
  justify-content: space-between;
  align-items: center;

  background: rgba(10, 14, 30, 0.92);
  border-bottom: 1px solid rgba(120,160,255,0.15);

  backdrop-filter: blur(12px);
  z-index: 1000;
}

.logo {
  font-weight: 700;
  color: #4da3ff;
}

nav a {
  margin: 0 12px;
  text-decoration: none;
  color: #cfe3ff;
}

nav a:hover {
  color: #4da3ff;
}

.github {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #fff;
  text-decoration: none;
  padding: 6px 12px;
  border: 1px solid #4da3ff;
  border-radius: 8px;
}

.hero {
  height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center;
}

.hero h1 {
  font-size: clamp(2.6rem, 6vw + 1rem, 3.5rem);
  line-height: 1.02;
  color: #4da3ff;
}

.section {
  padding: 110px 15%;
}

.dark {
  background: rgba(10, 15, 35, 0.45);
}

h2 {
  color: #4da3ff;
  margin-bottom: 20px;
  text-align: center;
}

/* small centered separator under the Main Projects title */
#projects h2 {
  position: relative;
}

#projects h2::after {
  content: '';
  display: block;
  width: 140px; /* smaller than the full text width */
  height: 1px;
  margin: 10px auto 0 auto;
  background: linear-gradient(90deg, transparent, rgba(77,163,255,0.28), transparent);
  border-radius: 2px;
}

.grid {
  display: grid;
  grid-template-columns: 1fr; /* one project per row */
  gap: 20px;
  max-width: 900px;
  margin: 0 auto;
}

.card {
  padding: 18px;
  border-radius: 12px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(100,150,255,0.15);
  transition: transform 0.45s cubic-bezier(.2,.9,.2,1), border-color 0.2s, opacity 0.45s;
  min-height: 140px; /* reduced height */
  display: flex;
  flex-direction: column;
  position: relative; /* allow absolute close button inside */
}

.card:hover {
  transform: translateY(-6px);
  border-color: #4da3ff;
}

/* Slide-in animations */
.card {
  opacity: 0;
  transform: translateX(0) translateY(12px);
  --i: 0; /* index for stagger */
}

.card.from-left {
  transform: translateX(-48px) translateY(8px); /* stronger slide */
}

.card.from-right {
  transform: translateX(48px) translateY(8px); /* stronger slide */
}

.card.in-view {
  opacity: 1;
  transform: translateX(0) translateY(0);
  transition-delay: calc(var(--i) * 80ms);
}

/* Image layout for cards */
.card.has-image {
  flex-direction: row;
  align-items: stretch;
  gap: 18px;
}

.card.has-image.image-right {
  flex-direction: row-reverse;
}

.card-image {
  width: 40%;
  min-width: 160px;
  /* fill the card height */
  height: 100%;
  border-radius: 16px; /* more rounded */
  background-size: cover;
  background-position: center;
  flex-shrink: 0;
  overflow: hidden;
  box-shadow: 0 6px 18px rgba(80, 40, 120, 0.12);
}

/* make images non-interactive: remove pointer cursor and keep only gentle transitions */
.card-image {
  cursor: default;
  transition: box-shadow 420ms ease, height 420ms ease;
}

/* In-place card enlargement (no overlay). When a card is toggled to .image-enlarged
   increase its min-height and scale up the child .card-image to make the image larger
   while keeping it in the same layout position. */
.card {
  transition: transform 0.45s cubic-bezier(.2,.9,.2,1), border-color 0.2s, opacity 0.45s, min-height 700ms cubic-bezier(.22,.9,.25,1);
}

.card.image-enlarged {
  /* disabled: enlargement through JS is removed; keep this rule inert */
  min-height: unset;
}

.card.image-enlarged .card-image {
  transform: none !important;
}

/* Transition for smooth height change and subtle scaleY animation */
.card-image {
  transition: height 700ms cubic-bezier(.22,.9,.25,1), transform 700ms cubic-bezier(.22,.9,.25,1), box-shadow 560ms;
}

/* close button for enlarged image (touch-friendly) */
.image-close-btn {
  position: absolute;
  right: 12px;
  top: 12px;
  background: rgba(0,0,0,0.45);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 6px 8px;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  backdrop-filter: blur(4px);
}

.image-close-btn:active { transform: scale(0.98); }

/* When image sits next to body, scale image to card height while keeping it square */
.card.has-image .card-image {
  height: auto;
  align-self: stretch;
  width: 36%;
  min-width: 160px;
}

.card.has-image .card-body {
  flex: 1 1 auto;
}

.card-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.card-actions {
  display: flex;
  flex-direction: column;
  gap: 12px; /* increased vertical space between action buttons */
  margin-top: 8px;
}

/* Contact / My Info styling */
.contact-section .contact-content {
  max-width: 640px;
  margin: 0 auto;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
}

.contact-line { color: #d6e6ff; }

.cv-btn {
  margin-top: 8px;
  background: rgba(77,163,255,0.12);
  border: 1px solid rgba(77,163,255,0.18);
  color: #cfe3ff;
  text-decoration: none;
  padding: 8px 14px;
  border-radius: 10px;
}

.cv-btn:hover { transform: translateY(-3px); }

/* Button styles for action links */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 10px;
  background: rgba(77,163,255,0.08);
  color: #cfe3ff;
  text-decoration: none;
  border: 1px solid rgba(77,163,255,0.18);
  font-weight: 600;
  font-size: 0.95rem;
  transition: transform 180ms ease, background 180ms ease, box-shadow 180ms ease;
}

.btn svg { display: block; flex-shrink: 0; }

.btn:hover, .btn:focus {
  transform: translateY(-3px);
  background: rgba(77,163,255,0.12);
  box-shadow: 0 6px 18px rgba(77,163,255,0.06);
}

/* Slightly different visual for GitHub button */
.see-github-link {
  background: rgba(8,10,12,0.65);
  border: 1px solid rgba(255,255,255,0.06);
  color: #fff;
}

.see-github-link:hover, .see-github-link:focus {
  background: rgba(8,10,12,0.78);
}

@media (max-width: 720px) {
  .card.has-image,
  .card.has-image.image-right {
    flex-direction: column;
  }

  .card-image {
    width: 100%;
    min-height: 120px;
    border-radius: 12px;
  }
}

/* subtle purple tint layer on entire page */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(90,40,140,0.02), rgba(60,30,100,0.02));
  z-index: 0;
}

/* make the transition a bit longer for a smoother slide */
.card,
.card.from-left,
.card.from-right,
.card.in-view {
  transition-duration: 520ms;
  transition-timing-function: cubic-bezier(.15,.9,.3,1);
}

@media (prefers-reduced-motion: reduce) {
  .card,
  .card.from-left,
  .card.from-right,
  .card.in-view {
    transition: none !important;
    transform: none !important;
    opacity: 1 !important;
  }
}
.card a {
  color: #4da3ff;
  text-decoration: none;
}

footer {
  text-align: center;
  padding: 40px;
  opacity: 0.6;
}
