/* ── Hero ── */

.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.75rem;
  padding: 2.5rem 0 2rem;
  text-align: center;
  position: relative;
}

.hero-watermark {
  position: absolute;
  top: 50%;
  right: -8%;
  transform: translateY(-50%);
  width: 480px;
  opacity: 0.05;
  pointer-events: none;
  user-select: none;
}

[data-theme="light"] .hero-watermark {
  filter: invert(1) hue-rotate(180deg);
  opacity: 0.04;
}

.hero-tag {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #fff;
  background: var(--orange);
  border-radius: 999px;
  padding: 0.4rem 1.2rem;
  box-shadow: 0 2px 14px var(--orange-dim);
}

.hero-title {
  font-size: clamp(2.2rem, 5.5vw, 3.75rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.2;
  padding-bottom: 0.1em;
  background: var(--gradient-text);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-description {
  font-size: 1rem;
  color: var(--muted);
  max-width: 100%;
  line-height: 1.6;
}

/* ── Projects preview carousel ── */

.projects-preview {
  padding-top: 1.5rem;
}

.projects-preview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}

.projects-preview-title {
  font-size: 1.3rem;
  font-weight: 700;
}

.projects-preview-link {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--orange);
  text-decoration: none;
  transition: opacity 0.15s;
}

.projects-preview-link:hover {
  opacity: 0.75;
}

.carousel-wrapper {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.carousel {
  display: flex;
  gap: 1.25rem;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  /* padding gives cards room to lift/glow on hover without being clipped
     by the overflow-x scroll container's implicit clip on all sides.
     Bottom needs ~46px (shadow y-offset 10 + blur 36) to show the full glow. */
  padding: 8px 36px 3rem;
  flex: 1;
  /* Gradient mask fades cards and their glows at both edges instead of
     hard-clipping them. The fade zone matches the 36px side padding so
     partially-visible adjacent cards gracefully disappear rather than
     being cut off with a sharp edge. */
  -webkit-mask-image: linear-gradient(to right, transparent 0, black 36px, black calc(100% - 36px), transparent 100%);
  mask-image: linear-gradient(to right, transparent 0, black 36px, black calc(100% - 36px), transparent 100%);
}

.carousel::-webkit-scrollbar {
  display: none;
}

.carousel-card {
  flex: 0 0 300px;
  scroll-snap-align: center;
  scroll-snap-stop: always;
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: 20px;
  overflow: hidden;
  text-decoration: none;
  color: var(--text);
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
  /* Ensure all cards are clickable regardless of snap position */
  cursor: pointer;
}

.carousel-card:not(.carousel-card-soon):hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 36px var(--orange-dim);
  border-color: var(--orange);
}

.carousel-card img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  display: block;
}

.carousel-card-placeholder {
  height: 180px;
  background: var(--gradient);
  opacity: 0.4;
}

.carousel-card-soon {
  opacity: 0.55;
  cursor: default;
}

.carousel-card-body {
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.carousel-card-body .card-tag {
  margin-bottom: 0;
}

.carousel-card-body h3 {
  font-size: 1rem;
  font-weight: 700;
}

.carousel-card-body p {
  font-size: 0.83rem;
  color: var(--muted);
  line-height: 1.6;
}

.carousel-btn {
  flex-shrink: 0;
  width: 38px;
  height: 38px;
  border-radius: 999px;
  border: 1.5px solid var(--border);
  background: var(--bg-card);
  color: var(--muted);
  font-size: 1.3rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  align-self: center;
}

.carousel-btn:hover {
  background: var(--orange-dim);
  border-color: var(--orange);
  color: var(--orange);
}

/* On mobile, hide arrow buttons (swipe is the gesture) and let cards
   fill nearly the full content width with a small peek at the next card */
@media (max-width: 520px) {
  .hero {
    gap: 1rem;
    padding: 1.5rem 0 1rem;
  }

  .hero-description {
    display: none;
  }

  .projects-preview {
    padding-top: 0.5rem;
  }

  .carousel-btn {
    display: none;
  }

  .carousel-card {
    flex: 0 0 75vw;
  }

  .carousel-card img {
    height: 140px;
  }

  .carousel-card-placeholder {
    height: 140px;
  }
}
