:root {
  --bg: #07090f; --panel: #0d1119; --border: rgba(167,139,250,0.12);
  --border-hover: rgba(167,139,250,0.3);
  --text: #f1f4fa; --text-dim: #8b95ab; --text-faint: #4a5268;
  --p0: #a78bfa; --p1: #5eead4; --p2: #fbbf24; --p3: #f472b6;
  --grad-hero: linear-gradient(135deg, #a78bfa 0%, #5eead4 40%, #f472b6 100%);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg); color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", system-ui, sans-serif;
  font-size: 16px; line-height: 1.5; -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
body::before {
  content: ''; position: fixed; inset: 0; pointer-events: none;
  background:
    radial-gradient(ellipse 80% 60% at 15% 0%, rgba(167,139,250,0.10), transparent 50%),
    radial-gradient(ellipse 60% 50% at 85% 15%, rgba(94,234,212,0.06), transparent 50%);
}
a { color: inherit; text-decoration: none; }
.grad { background: var(--grad-hero); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }

nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100; height: 64px;
  display: flex; align-items: center; justify-content: space-between; padding: 0 64px;
  background: rgba(7,9,15,0.8); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(167,139,250,0.06);
}
.nav-brand { font-weight: 600; font-size: 14px; color: var(--text-dim); }
.nav-brand strong { color: var(--text); font-weight: 700; }
.nav-back { font-size: 14px; color: var(--text-faint); transition: color 0.2s; }
.nav-back:hover { color: var(--text); }

.hero {
  min-height: 50vh; display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 120px 64px 80px; position: relative;
}
.hero .eyebrow { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 2px; color: var(--p0); margin-bottom: 16px; }
.hero h1 { font-size: clamp(40px, 6vw, 64px); font-weight: 700; line-height: 1.0; letter-spacing: -1.5px; }
.hero .subtitle { font-size: 20px; color: var(--text-dim); margin-top: 20px; max-width: 580px; line-height: 1.6; font-weight: 300; }
.hero-iso {
  width: 100%; max-width: 1000px; border-radius: 16px; margin-bottom: 48px;
  box-shadow: 0 20px 80px rgba(167,139,250,0.12), 0 4px 20px rgba(0,0,0,0.5);
}

section { max-width: 1100px; margin: 0 auto; padding: 100px 64px; }
.divider { border: none; height: 1px; background: linear-gradient(90deg, transparent, rgba(167,139,250,0.15), transparent); margin: 0 64px; max-width: 1100px; margin-left: auto; margin-right: auto; }
.section-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 2px; color: var(--p0); margin-bottom: 24px; display: block; }
h2 { font-size: clamp(32px, 4vw, 48px); font-weight: 700; line-height: 1.1; letter-spacing: -1px; margin-bottom: 16px; }
p { font-size: 18px; line-height: 1.8; color: var(--text-dim); font-weight: 300; }
p + p { margin-top: 12px; }
.points { list-style: none; margin-top: 20px; display: flex; flex-direction: column; gap: 12px; }
.points li { font-size: 16px; color: var(--text-dim); padding-left: 18px; position: relative; line-height: 1.6; font-weight: 300; }
.points li::before { content: ''; position: absolute; left: 0; top: 10px; width: 5px; height: 5px; border-radius: 50%; background: var(--p0); }
.points li strong { color: var(--text); font-weight: 600; }

.card-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; margin-top: 32px; border: 1px solid var(--border); border-radius: 14px; overflow: hidden; background: var(--panel); }
.card { padding: 28px; border-right: 1px solid var(--border); }
.card:last-child { border-right: none; }
.card h4 { font-size: 18px; font-weight: 700; margin-bottom: 6px; }
.card .card-sub { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 1.5px; color: var(--text-faint); margin-bottom: 16px; }
.card p { font-size: 14px; color: var(--text-faint); line-height: 1.5; }

.phase-divider {
  padding: 100px 64px; text-align: center; position: relative;
}
.phase-divider::before { content: ''; position: absolute; top: 0; left: 10%; right: 10%; height: 1px; background: linear-gradient(90deg, transparent, rgba(167,139,250,0.2), transparent); }
.phase-divider::after { content: ''; position: absolute; bottom: 0; left: 10%; right: 10%; height: 1px; background: linear-gradient(90deg, transparent, rgba(167,139,250,0.2), transparent); }
.phase-divider .phase-num { font-size: 56px; font-weight: 700; opacity: 0.1; letter-spacing: -2px; }
.phase-divider .phase-name { font-size: 28px; font-weight: 700; margin-top: 8px; letter-spacing: -0.5px; }
.phase-divider .phase-sub { font-size: 16px; color: var(--text-dim); margin-top: 10px; max-width: 500px; margin-left: auto; margin-right: auto; font-weight: 300; }
.phase-divider.p0 .phase-num, .phase-divider.p0 .phase-name { color: var(--p0); }
.phase-divider.p1 .phase-num, .phase-divider.p1 .phase-name { color: var(--p1); }
.phase-divider.p2 .phase-num, .phase-divider.p2 .phase-name { color: var(--p2); }
.phase-divider.p3 .phase-num, .phase-divider.p3 .phase-name { color: var(--p3); }

.gallery { padding: 20px 0; }
.gallery-item {
  padding: 20px 64px;
  opacity: 0; transform: translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.gallery-item.visible { opacity: 1; transform: translateY(0); }
.gallery-item img {
  width: 100%; max-width: 1200px; display: block; margin: 0 auto;
  border-radius: 14px; border: 1px solid var(--border);
  box-shadow: 0 8px 40px rgba(0,0,0,0.4);
  transition: box-shadow 0.3s, transform 0.3s;
}
.gallery-item img:hover { box-shadow: 0 12px 50px rgba(167,139,250,0.1); transform: scale(1.005); }
.gallery-item .caption {
  text-align: center; font-size: 14px; color: var(--text-faint);
  margin-top: 14px; max-width: 660px; margin-left: auto; margin-right: auto; font-weight: 300;
}

.results-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 28px; }
.result-card {
  background: var(--panel); border: 1px solid var(--border); border-radius: 10px;
  padding: 20px; position: relative; overflow: hidden;
  transition: border-color 0.3s, transform 0.3s, box-shadow 0.3s;
}
.result-card::after {
  content: ''; position: absolute; inset: -1px; border-radius: 11px;
  background: linear-gradient(135deg, rgba(140,100,255,0.22), rgba(40,210,190,0.14), rgba(230,80,160,0.18));
  opacity: 0; transition: opacity 0.3s; z-index: -1; mix-blend-mode: screen;
}
.result-card:hover { transform: translateY(-2px); border-color: rgba(167,139,250,0.25); box-shadow: 0 8px 24px rgba(167,139,250,0.08); }
.result-card:hover::after { opacity: 1; }
.result-card h4 { font-size: 16px; font-weight: 700; margin-bottom: 4px; }
.result-card p { font-size: 13px; color: var(--text-faint); line-height: 1.4; transition: color 0.3s; }
.result-card:hover p { color: var(--text-dim); }

.case-nav {
  display: flex; justify-content: space-between; align-items: center;
  max-width: 1100px; margin: 0 auto; padding: 60px 64px 0;
}
.case-nav-btn {
  font-size: 15px; font-weight: 500; color: var(--text-dim);
  padding: 8px 18px; border-radius: 8px; border: 1px solid var(--border);
  transition: border-color 0.2s, color 0.2s;
}
.case-nav-btn:hover { border-color: var(--border-hover); color: var(--text); }

footer {
  text-align: center; padding: 60px 64px; color: var(--text-faint); font-size: 14px; border: none;
}
footer a { color: var(--p0); transition: color 0.2s; }
footer a:hover { color: var(--text); }
footer a { color: var(--p0); transition: color 0.2s; }
footer a:hover { color: var(--text); }

.fade-in { opacity: 0; transform: translateY(20px); transition: opacity 0.6s ease, transform 0.6s ease; }
.fade-in.visible { opacity: 1; transform: translateY(0); }

/* Fullscreen lightbox */
.lightbox {
  display: none; position: fixed; inset: 0; z-index: 9999;
  background: rgba(0,0,0,0.95); align-items: center; justify-content: center;
  padding: 20px;
}
.lightbox.active { display: flex; }
.lightbox img {
  max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 8px;
}
.lightbox-close {
  position: absolute; top: 16px; right: 16px; width: 36px; height: 36px;
  border-radius: 50%; background: rgba(255,255,255,0.1); border: none;
  color: #fff; font-size: 20px; cursor: pointer; display: flex; align-items: center; justify-content: center;
  z-index: 10001;
}
.lightbox-close:hover { background: rgba(255,255,255,0.2); }
.lightbox-nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 48px; height: 48px; border-radius: 50%; border: none;
  background: transparent; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  z-index: 10001;
}
.lightbox-nav svg { width: 24px; height: 24px; }
.lightbox-nav:hover svg { opacity: 0.9; }
.lightbox-prev { left: 16px; }
.lightbox-next { right: 16px; }

/* Carousel layout */
.carousel, [id="carousel"] { position: relative; }
.carousel-frame { display: flex; align-items: center; justify-content: center; gap: 16px; position: relative; }
.carousel-track { overflow: hidden; border-radius: 14px; border: 1px solid var(--border); box-shadow: 0 8px 40px rgba(0,0,0,0.4); display: inline-flex; align-items: center; justify-content: center; position: relative; }
.carousel-btn { display: none; }
.carousel-slide img { max-height: 840px; width: auto; max-width: 100%; object-fit: contain; display: block; margin: 0 auto; }

/* Carousel overlay arrows */
.carousel-nav-overlay {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 44px; height: 44px; border-radius: 50%;
  border: 1px solid rgba(128,128,128,0.4);
  background: rgba(128,128,128,0.15); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  z-index: 10; backdrop-filter: blur(4px);
}
.carousel-nav-overlay svg { width: 20px; height: 20px; }
.carousel-nav-overlay:hover { background: rgba(128,128,128,0.3); border-color: rgba(128,128,128,0.6); }
.carousel-nav-overlay:hover svg { opacity: 0.9; }
.carousel-nav-prev { left: 16px; }
.carousel-nav-next { right: 16px; }

@media (max-width: 768px) {
  nav, .hero, section, .gallery-item, .phase-divider { padding-left: 24px; padding-right: 24px; }
  .card-row, .results-grid { grid-template-columns: 1fr; gap: 12px; border: none; background: none; }
  .card { border-right: none; border-bottom: none; border: 1px solid var(--border); border-radius: 14px; background: var(--panel); }
  .card:last-child { border-bottom: none; }
  /* Carousel: full-width on mobile */
  .carousel-frame { gap: 0; }
  .carousel-track { width: 100%; border-radius: 8px; }
  .carousel-slide img { max-height: none; width: 100%; max-width: 100%; height: auto; cursor: zoom-in; }
  [id="carousel"] { padding: 20px 0 !important; }
  .carousel-nav-overlay { width: 36px; height: 36px; }
  .carousel-nav-overlay svg { width: 16px; height: 16px; }
}
