.glass-nav {
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.dark .glass-nav {
  background: rgba(15, 23, 42, 0.8);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.hero-pattern {
  background-image: radial-gradient(#cbd5e1 1px, transparent 1px);
  background-size: 30px 30px;
}

.dark .hero-pattern {
  background-image: radial-gradient(#1e293b 1px, transparent 1px);
}

.text-gradient {
  background: linear-gradient(to right, #3b82f6, #06b6d4);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* ── 1080p Viewport Fit ──────────────────────────────────── */
.hub-viewport {
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - 64px - 56px); /* nav + footer */
  padding-top: 64px;
}

@media (min-width: 640px) {
  .hub-viewport { padding-top: 80px; min-height: calc(100vh - 80px - 56px); }
}

/* ── Carousel ────────────────────────────────────────────── */
.carousel-wrapper {
  position: relative;
  overflow: visible;
  padding: 0 52px;
}

.carousel-clip {
  overflow: hidden;
  border-radius: 16px;
}

.carousel-track {
  display: flex;
  gap: 16px;
  transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  will-change: transform;
}

.carousel-slide {
  flex: 0 0 100%;
  min-width: 0;
}

@media (min-width: 640px) {
  .carousel-slide { flex: 0 0 calc(50% - 8px); }
}

@media (min-width: 1024px) {
  .carousel-slide { flex: 0 0 calc(33.333% - 11px); }
}

/* Carousel arrows */
.carousel-btn {
  position: absolute;
  top: 40%;
  transform: translateY(-50%);
  z-index: 10;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid rgba(148, 163, 184, 0.3);
  background: rgba(255, 255, 255, 0.9);
  color: #334155;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 14px;
}

.dark .carousel-btn {
  background: rgba(30, 41, 59, 0.9);
  border-color: rgba(148, 163, 184, 0.2);
  color: #e2e8f0;
}

.carousel-btn:hover:not(:disabled) {
  background: #3b82f6;
  color: #fff;
  border-color: #3b82f6;
}

.carousel-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.carousel-btn-prev { left: -48px; }
.carousel-btn-next { right: -48px; }

@media (min-width: 640px) {
  .carousel-btn-prev { left: -52px; }
  .carousel-btn-next { right: -52px; }
}

/* Dots */
.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #cbd5e1;
  border: none;
  cursor: pointer;
  padding: 0;
  transition: all 0.2s;
}

.dark .dot { background: #475569; }

.dot.active {
  background: #3b82f6;
  width: 24px;
  border-radius: 4px;
}

/* ── App Cards ───────────────────────────────────────────── */
.app-card {
  transition: transform 250ms ease-out, box-shadow 250ms ease-out, border-color 250ms ease-out;
}

.app-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 25px -10px rgba(59, 130, 246, 0.2);
}

/* ── Mobile polish ───────────────────────────────────────── */
@media (max-width: 639px) {
  body { overflow-x: hidden; }
  .carousel-btn { display: none; }
  .carousel-wrapper { padding: 0; }
}

/* line-clamp utility for non-tailwind */
.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ── 1080p viewport layout ───────────────────────────────── */
html, body { height: 100%; margin: 0; }
body { display: flex; flex-direction: column; }

.hub-viewport {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding-top: 4rem; /* nav height */
  min-height: 0;
}

@media (min-width: 640px) {
  .hub-viewport { padding-top: 5rem; }
}

/* ── Carousel ────────────────────────────────────────────── */
.carousel-wrapper { position: relative; }

.carousel-track {
  display: flex;
  gap: 1rem;
  transition: transform 400ms cubic-bezier(.25,.8,.25,1);
  will-change: transform;
}

.carousel-slide {
  flex: 0 0 calc(100% - 0.5rem);
  min-width: 0;
}

@media (min-width: 640px) {
  .carousel-slide { flex: 0 0 calc(50% - 0.5rem); }
  .carousel-track { gap: 1rem; }
}

@media (min-width: 1024px) {
  .carousel-slide { flex: 0 0 calc(33.333% - 0.667rem); }
}

.carousel-btn {
  position: absolute;
  top: 40%;
  transform: translateY(-50%);
  z-index: 10;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 9999px;
  border: 1px solid rgba(148, 163, 184, 0.3);
  background: rgba(255,255,255,0.9);
  color: #334155;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 200ms;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  font-size: 0.75rem;
}

.dark .carousel-btn {
  background: rgba(30, 41, 59, 0.9);
  color: #cbd5e1;
  border-color: rgba(100, 116, 139, 0.3);
}

.carousel-btn:hover {
  background: #3b82f6;
  color: #fff;
  border-color: #3b82f6;
}

.carousel-btn-prev { left: -0.5rem; }
.carousel-btn-next { right: -0.5rem; }

@media (min-width: 640px) {
  .carousel-btn { width: 2.5rem; height: 2.5rem; font-size: 0.875rem; }
  .carousel-btn-prev { left: -1rem; }
  .carousel-btn-next { right: -1rem; }
}

.carousel-btn:disabled { opacity: 0.3; pointer-events: none; }

/* carousel dots */
#carousel-dots .dot {
  width: 8px;
  height: 8px;
  border-radius: 9999px;
  background: #94a3b8;
  cursor: pointer;
  transition: all 200ms;
}

#carousel-dots .dot.active {
  width: 20px;
  background: #3b82f6;
}

/* line clamp */
.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ── Mobile ──────────────────────────────────────────────── */
@media (max-width: 639px) {
  body { overflow-x: hidden; }
  .carousel-btn { display: none; }
}

/* touch swipe hint */
@media (pointer: coarse) {
  .carousel-track { scroll-snap-type: x mandatory; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
  .carousel-track::-webkit-scrollbar { display: none; }
  .carousel-slide { scroll-snap-align: start; }
}

/* ── Mobile hardening (OD request) ──────────────────────── */
@media (max-width: 639px) {
  .hub-viewport {
    display: block;
    padding-top: 4rem;
    min-height: auto;
  }

  .hub-controls {
    gap: 0.35rem;
    min-width: 0;
  }

  .hub-lang-switch {
    padding: 2px;
    gap: 2px;
  }

  .hub-lang-switch button {
    min-width: 30px;
    min-height: 30px;
    padding: 0.2rem 0.4rem;
    font-size: 0.66rem;
  }

  #theme-toggle {
    width: 34px;
    height: 34px;
  }

  .carousel-track {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.75rem;
    transform: none !important;
    overflow: visible !important;
    scroll-snap-type: none !important;
  }

  .carousel-slide {
    flex: none;
    width: 100%;
    scroll-snap-align: none;
  }

  .carousel-clip {
    overflow: visible;
    border-radius: 0;
  }

  .carousel-wrapper {
    padding: 0;
    height: auto !important;
  }

  .app-card {
    border-radius: 1rem;
    min-height: 100%;
  }

  .app-card > div:last-child {
    padding: 0.9rem;
  }

  .app-card h2 {
    white-space: normal;
    line-height: 1.25;
  }

  .line-clamp-2 {
    -webkit-line-clamp: 3;
  }

  #carousel-dots {
    display: none;
  }

  .hub-viewport > section:last-of-type {
    flex: none !important;
    min-height: auto !important;
  }

  .hub-viewport > section:last-of-type .h-full {
    height: auto !important;
    min-height: auto !important;
  }

  .carousel-clip,
  .carousel-slide {
    height: auto !important;
  }

  footer .max-w-7xl {
    gap: 0.45rem;
  }
}

@media (max-width: 420px) {
  .hub-lang-switch button {
    min-width: 28px;
    padding: 0.18rem 0.34rem;
  }
}

/* Commented out: this override disabled native touch scrolling and
   conflicted with the earlier `@media (pointer: coarse)` rules that
   enable overflow-x:auto + scroll-snap. Keeping the native-scroll
   behavior for touch devices improves swipe fluidity. If needed,
   re-enable by uncommenting. */
/*
@media (pointer: coarse) {
  .carousel-track {
    scroll-snap-type: none;
    overflow-x: hidden;
  }

  .carousel-slide {
    scroll-snap-align: none;
  }
}
*/
