/* =========================
   FONTS
========================= */

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,700;0,9..40,900;1,9..40,300&family=DM+Serif+Display:ital@0;1&display=swap');

/* =========================
   CSS VARIABLES
========================= */

:root {
  --bg: #020617;
  --card: rgba(255,255,255,0.055);
  --card-hover: rgba(255,255,255,0.09);
  --border: rgba(255,255,255,0.10);
  --border-hover: rgba(94,234,212,0.38);
  --text: #ffffff;
  --muted: rgba(255,255,255,0.65);
  --cyan: #5eead4;
  --blue: #38bdf8;
  --glow-cyan: rgba(34,211,238,0.22);
  --glow-blue: rgba(56,189,248,0.18);
  --ease-spring: cubic-bezier(0.22, 1, 0.36, 1);
}

/* =========================
   GLOBAL RESET
========================= */

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

html {
  scroll-behavior: smooth;
}

body {
  background:
    radial-gradient(ellipse at 80% 0%, rgba(56,189,248,0.13), transparent 40%),
    radial-gradient(ellipse at 0% 80%, rgba(94,234,212,0.09), transparent 40%),
    #020617;
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
  overflow-x: hidden;
}

/* =========================
   CUSTOM CURSOR
========================= */

@media (pointer: fine) {
  body, a, button { cursor: none; }
}

.cursor-glow {
  position: fixed;
  width: 420px;
  height: 420px;
  border-radius: 999px;
  pointer-events: none;
  z-index: 9990;
  background: radial-gradient(circle, rgba(56,189,248,0.13), transparent 65%);
  transform: translate(-50%, -50%);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.custom-cursor-dot {
  display: none;
}

.custom-cursor-ring {
  display: none;
}

@media (pointer: fine) {
  .custom-cursor-dot {
    display: block;
    position: fixed;
    left: 0; top: 0;
    width: 7px; height: 7px;
    border-radius: 999px;
    pointer-events: none;
    z-index: 9999;
    background: #a5f3fc;
    box-shadow: 0 0 14px rgba(103,232,249,0.95), 0 0 30px rgba(103,232,249,0.4);
    transform: translate(-50%, -50%);
    transition: transform 0.1s ease, opacity 0.2s ease;
  }

  .custom-cursor-dot.clicking {
    transform: translate(-50%, -50%) scale(0.5);
  }

  .custom-cursor-ring {
    display: block;
    position: fixed;
    left: 0; top: 0;
    width: 36px; height: 36px;
    border-radius: 999px;
    pointer-events: none;
    z-index: 9998;
    border: 1.5px solid rgba(165,243,252,0.65);
    background: rgba(103,232,249,0.04);
    box-shadow: 0 0 24px rgba(34,211,238,0.18);
    transform: translate(-50%, -50%);
    transition:
      width 0.22s var(--ease-spring),
      height 0.22s var(--ease-spring),
      border-color 0.22s ease,
      background 0.22s ease,
      opacity 0.2s ease;
  }

  .custom-cursor-ring.cursor-hover {
    width: 56px; height: 56px;
    border-color: rgba(255,255,255,0.85);
    background: rgba(255,255,255,0.07);
    box-shadow: 0 0 40px rgba(34,211,238,0.28);
  }

  .custom-cursor-ring.clicking {
    width: 28px; height: 28px;
    background: rgba(103,232,249,0.14);
    border-color: #a5f3fc;
  }
}

/* =========================
   SCROLL PROGRESS BAR
========================= */

.scroll-progress {
  position: fixed;
  top: 0; left: 0;
  height: 2px;
  width: 0%;
  z-index: 9997;
  background: linear-gradient(90deg, #38bdf8, #5eead4, #38bdf8);
  background-size: 200% 100%;
  animation: progressShimmer 2s linear infinite;
  transition: width 0.1s linear;
  box-shadow: 0 0 12px rgba(94,234,212,0.7);
}

@keyframes progressShimmer {
  0%   { background-position: 0% 0%; }
  100% { background-position: 200% 0%; }
}

/* =========================
   BACK BUTTON
========================= */

.back-home {
  position: fixed;
  top: 28px;
  left: 28px;
  z-index: 200;
}

.back-home .btn-glass {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 22px;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.back-home .btn-glass .arrow {
  display: inline-block;
  transition: transform 0.3s var(--ease-spring);
}

.back-home .btn-glass:hover .arrow {
  transform: translateX(-5px);
}

/* =========================
   HERO SECTION
========================= */

.project-hero {
  position: relative;
  min-height: 92vh;
  display: flex;
  align-items: center;
  padding: 120px 8vw 80px;
  overflow: hidden;
}

/* Subtle animated grain overlay */
.project-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.025) 1px, transparent 1px);
  background-size: 72px 72px;
  mask-image: linear-gradient(to bottom, black 0%, transparent 70%);
  pointer-events: none;
}

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

/* =========================
   PROJECT TAG
========================= */

.project-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 18px;
  border-radius: 999px;
  border: 1px solid rgba(94,234,212,0.28);
  background: rgba(94,234,212,0.06);
  backdrop-filter: blur(20px);
  color: #a7f3d0;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.project-tag::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 999px;
  background: #5eead4;
  box-shadow: 0 0 8px #5eead4;
  animation: pulse 2.4s ease-in-out infinite;
}

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

/* =========================
   TITLES & TEXT
========================= */

.project-title {
  margin-top: 24px;
  font-family: 'DM Serif Display', serif;
  font-size: clamp(3.8rem, 8vw, 7rem);
  line-height: 0.95;
  letter-spacing: -0.03em;
  background: linear-gradient(135deg, #ffffff 30%, rgba(94,234,212,0.85) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.project-subtitle {
  margin-top: 26px;
  max-width: 640px;
  font-size: 1.1rem;
  line-height: 1.85;
  color: var(--muted);
  font-weight: 300;
}

/* =========================
   BUTTONS
========================= */

.button-row {
  display: flex;
  gap: 16px;
  margin-top: 40px;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 28px;
  border-radius: 999px;
  font-family: 'DM Sans', sans-serif;
  font-weight: 700;
  font-size: 0.9rem;
  text-decoration: none;
  border: none;
  transition:
    transform 0.28s var(--ease-spring),
    box-shadow 0.28s ease,
    background 0.28s ease,
    border-color 0.28s ease;
  position: relative;
  overflow: hidden;
  letter-spacing: 0.02em;
}

/* Ripple layer */
.btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0.08);
  border-radius: inherit;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.btn:active::after {
  opacity: 1;
}

.btn:active {
  transform: scale(0.96) !important;
}

.btn-primary {
  background: #ffffff;
  color: #020617;
}

.btn-primary:hover {
  transform: translateY(-4px);
  box-shadow: 0 0 48px rgba(255,255,255,0.28), 0 12px 32px rgba(0,0,0,0.2);
}

.btn-glass {
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.06);
  color: white;
  backdrop-filter: blur(20px);
}

.btn-glass:hover {
  transform: translateY(-4px);
  border-color: var(--border-hover);
  box-shadow: 0 0 40px var(--glow-cyan), 0 12px 32px rgba(0,0,0,0.2);
  background: rgba(94,234,212,0.07);
}

/* =========================
   HERO VIDEO FLOAT
========================= */

.hero-video-float {
  position: absolute;
  top: 50%;
  right: 7vw;
  transform: translateY(-50%);
  width: clamp(280px, 27vw, 450px);
  border-radius: 22px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.04);
  backdrop-filter: blur(20px);
  box-shadow:
    0 30px 90px rgba(0,0,0,0.45),
    0 0 0 1px rgba(94,234,212,0.06),
    0 0 60px rgba(34,211,238,0.08);
  overflow: hidden;
  z-index: 3;
  transition: box-shadow 0.4s ease, transform 0.4s var(--ease-spring);
}

.hero-video-float:hover {
  box-shadow:
    0 40px 100px rgba(0,0,0,0.5),
    0 0 0 1px rgba(94,234,212,0.18),
    0 0 80px rgba(34,211,238,0.16);
  transform: translateY(calc(-50% - 6px));
}

.hero-video-label {
  padding: 10px 16px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.45);
  border-bottom: 1px solid rgba(255,255,255,0.07);
  display: flex;
  align-items: center;
  gap: 8px;
}

.hero-video-label::before {
  content: '';
  width: 5px; height: 5px;
  border-radius: 999px;
  background: #5eead4;
  box-shadow: 0 0 6px #5eead4;
  animation: pulse 2s ease-in-out infinite;
}

.hero-video-player {
  width: 100%;
  display: block;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  background: rgba(0,0,0,0.6);
}

@media (max-width: 1100px) {
  .hero-video-float { display: none; }
}

/* =========================
   CONTENT SECTIONS
========================= */

.content-section {
  padding: 80px 8vw;
}

.section-title {
  font-family: 'DM Serif Display', serif;
  font-size: clamp(2rem, 4vw, 3.6rem);
  letter-spacing: -0.03em;
  margin-bottom: 16px;
  background: linear-gradient(135deg, #ffffff 40%, rgba(94,234,212,0.8) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.section-text {
  max-width: 820px;
  color: var(--muted);
  line-height: 1.95;
  font-size: 1.05rem;
  font-weight: 300;
}

/* =========================
   GLASS CARDS
========================= */

.glass-card {
  margin-top: 40px;
  border: 1px solid var(--border);
  background: var(--card);
  backdrop-filter: blur(28px);
  border-radius: 28px;
  padding: 36px 40px;
  box-shadow: 0 20px 80px rgba(0,0,0,0.22);
  transition:
    border-color 0.35s ease,
    background 0.35s ease,
    box-shadow 0.35s ease,
    transform 0.35s var(--ease-spring);
}

.glass-card:hover {
  border-color: rgba(94,234,212,0.22);
  background: var(--card-hover);
  box-shadow:
    0 28px 100px rgba(0,0,0,0.28),
    0 0 0 1px rgba(94,234,212,0.08),
    inset 0 1px 0 rgba(255,255,255,0.08);
  transform: translateY(-4px);
}

/* =========================
   TECH STACK
========================= */

.tech-stack {
  margin-top: 28px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.tech {
  padding: 10px 18px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.05);
  color: #d1fae5;
  font-weight: 700;
  font-size: 0.82rem;
  letter-spacing: 0.04em;
  transition:
    border-color 0.28s ease,
    background 0.28s ease,
    box-shadow 0.28s ease,
    transform 0.28s var(--ease-spring),
    color 0.28s ease;
}

.tech:hover {
  border-color: rgba(94,234,212,0.45);
  background: rgba(94,234,212,0.09);
  box-shadow: 0 0 22px rgba(94,234,212,0.18);
  color: #ffffff;
  transform: translateY(-3px) scale(1.04);
}

/* =========================
   3D CAROUSEL
========================= */

.carousel-container {
  position: relative;
  width: 100%;
  height: 520px;
  margin-top: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.carousel {
  position: relative;
  width: 100%;
  height: 100%;
  perspective: 1800px;
}

.carousel-track {
  width: 100%;
  height: 100%;
  position: relative;
  transform-style: preserve-3d;
}

.carousel-item {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 62%;
  max-width: 900px;
  transform-style: preserve-3d;
  transition:
    transform 0.9s var(--ease-spring),
    opacity 0.9s ease,
    filter 0.9s ease,
    box-shadow 0.4s ease;
  border-radius: 28px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(255,255,255,0.04);
  box-shadow:
    0 30px 100px rgba(0,0,0,0.35),
    0 0 40px rgba(34,211,238,0.07);
}

/* Active carousel item glow */
.carousel-item.is-active {
  border-color: rgba(94,234,212,0.22);
  box-shadow:
    0 40px 120px rgba(0,0,0,0.45),
    0 0 60px rgba(34,211,238,0.14),
    0 0 0 1px rgba(94,234,212,0.1);
}

/* Play icon overlay */
.carousel-item::before {
  content: '▶';
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  color: rgba(255,255,255,0.18);
  z-index: 2;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.carousel-item video {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  aspect-ratio: 16 / 9;
}

/* =========================
   CAROUSEL BUTTONS
========================= */

.carousel-btn {
  position: absolute;
  z-index: 20;
  width: 58px; height: 58px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.07);
  backdrop-filter: blur(20px);
  color: white;
  font-size: 1.3rem;
  transition:
    transform 0.3s var(--ease-spring),
    border-color 0.3s ease,
    background 0.3s ease,
    box-shadow 0.3s ease;
}

.carousel-btn:hover {
  transform: scale(1.1);
  border-color: rgba(94,234,212,0.45);
  background: rgba(94,234,212,0.08);
  box-shadow: 0 0 36px rgba(34,211,238,0.25);
}

.carousel-btn:active {
  transform: scale(0.94);
}

.carousel-btn.left { left: 2%; }
.carousel-btn.right { right: 2%; }

/* =========================
   CAROUSEL DOT INDICATORS
========================= */

.carousel-dots {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 28px;
}

.carousel-dot {
  width: 6px; height: 6px;
  border-radius: 999px;
  background: rgba(255,255,255,0.22);
  border: none;
  transition:
    background 0.3s ease,
    width 0.3s var(--ease-spring),
    box-shadow 0.3s ease;
}

.carousel-dot.active {
  background: #5eead4;
  width: 22px;
  box-shadow: 0 0 12px rgba(94,234,212,0.6);
}

/* =========================
   REVEAL ON SCROLL
========================= */

.reveal {
  opacity: 0;
  transform: translateY(32px);
  transition:
    opacity 0.7s ease,
    transform 0.7s var(--ease-spring);
}

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

/* =========================
   HERO ANIMATIONS (fade-up)
========================= */

.fade-up {
  opacity: 0;
  transform: translateY(36px);
  animation: fadeUp 0.8s var(--ease-spring) forwards;
}

.fade-delay-1 { animation-delay: 0.12s; }
.fade-delay-2 { animation-delay: 0.26s; }
.fade-delay-3 { animation-delay: 0.40s; }

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

/* =========================
   SCROLLBAR
========================= */

::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #38bdf8, #22d3ee);
  border-radius: 999px;
  box-shadow: 0 0 10px rgba(56,189,248,0.5);
}

* {
  scrollbar-width: thin;
  scrollbar-color: #0d3344 transparent;
}

/* =========================
   MOBILE
========================= */

@media (max-width: 900px) {
  .carousel-container { height: 340px; }
  .carousel-item { width: 84%; }
  .carousel-btn { width: 48px; height: 48px; font-size: 1.1rem; }
}

@media (max-width: 768px) {
  .project-title { font-size: 3.6rem; }
  .button-row { flex-direction: column; }
  .btn { width: 100%; }
  .glass-card { padding: 26px 22px; }
  .content-section { padding: 60px 6vw; }
  .project-hero { padding: 100px 6vw 60px; }
}
