/* ============================================
   Radial Cards Slider — True circle · full width
   ============================================ */

:root {
  --bg: #0a0a0a;
  --bg-deep: #000000;
  --paper: #f4f0ea;
  --paper-edge: #e8e2d9;
  --ink: #1c1f1d;
  --muted: rgba(244, 240, 234, 0.5);
  --dot: rgba(244, 240, 234, 0.3);
  --dot-on: #f4f0ea;
  --shadow: 0 20px 48px rgba(0, 0, 0, 0.45), 0 4px 14px rgba(0, 0, 0, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.22);
  --shadow-on: 0 28px 64px rgba(0, 0, 0, 0.55), 0 10px 28px rgba(0, 0, 0, 0.28),
    0 0 0 1px rgba(255, 255, 255, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.32);
  --glass: linear-gradient(
    155deg,
    rgba(255, 255, 255, 0.22) 0%,
    rgba(255, 255, 255, 0.1) 42%,
    rgba(255, 255, 255, 0.06) 100%
  );
  --glass-border: rgba(255, 255, 255, 0.28);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --font: "Syne", system-ui, sans-serif;
  --body: "DM Sans", system-ui, sans-serif;
}

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

html,
body {
  width: 100%;
  height: 100%;
}

body {
  font-family: var(--body);
  color: var(--paper);
  background: var(--bg);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

button {
  font: inherit;
  border: 0;
  background: none;
  color: inherit;
  cursor: pointer;
}

/* ---------- Full-viewport app ---------- */

.app {
  width: 100vw;
  height: 100%;
  height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(ellipse 90% 70% at 50% 42%, #1a1a1a 0%, transparent 62%),
    linear-gradient(180deg, #141414 0%, var(--bg) 48%, var(--bg-deep) 100%);
}

.radial {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: center;
  gap: 0;
}

/* Stage is full width — circle geometry lives here */
.radial__stage {
  position: relative;
  width: 100%;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  touch-action: pan-y;
  user-select: none;
  -webkit-user-select: none;
  cursor: grab;
}

.radial__stage.is-dragging {
  cursor: grabbing;
}

.radial__stage.is-dragging .card {
  cursor: grabbing;
}

/* Optional subtle guide of the true circle (debug-friendly, very faint) */
.radial__circle {
  position: absolute;
  left: 50%;
  top: 0;
  width: 0;
  height: 0;
  pointer-events: none;
  opacity: 0;
}

/* Track origin = top-center of the circle (12 o'clock) */
.radial__track {
  position: absolute;
  left: 50%;
  top: 0;
  width: 0;
  height: 0;
  transform-style: preserve-3d;
}

/* ---------- Glass morphism card ---------- */

.card {
  position: absolute;
  left: 0;
  top: 0;
  width: var(--card-w, 210px);
  height: var(--card-h, 280px);
  margin: 0;
  border-radius: 20px;
  padding: 12px 12px 0;
  display: flex;
  flex-direction: column;
  transform-origin: center center;
  will-change: transform, opacity;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  cursor: grab;

  /* Frosted glass shell */
  background: var(--glass);
  backdrop-filter: blur(22px) saturate(165%);
  -webkit-backdrop-filter: blur(22px) saturate(165%);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow);
  isolation: isolate;
  overflow: hidden;
  transition:
    box-shadow 0.45s var(--ease),
    border-color 0.45s var(--ease),
    background 0.45s var(--ease);
}

.card.is-active {
  background: linear-gradient(
    155deg,
    rgba(255, 255, 255, 0.3) 0%,
    rgba(255, 255, 255, 0.14) 45%,
    rgba(255, 255, 255, 0.08) 100%
  );
  border-color: rgba(255, 255, 255, 0.4);
  box-shadow: var(--shadow-on);
}

/* Specular rim + soft inner glow */
.card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(
    145deg,
    rgba(255, 255, 255, 0.38) 0%,
    rgba(255, 255, 255, 0.06) 28%,
    transparent 52%,
    rgba(255, 255, 255, 0.04) 100%
  );
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.45),
    inset 0 -1px 0 rgba(255, 255, 255, 0.06);
  pointer-events: none;
  z-index: 3;
}

/* Bottom glass highlight under caption */
.card::after {
  content: "";
  position: absolute;
  left: 8%;
  right: 8%;
  bottom: 0;
  height: 42%;
  border-radius: 0 0 18px 18px;
  background: linear-gradient(
    180deg,
    transparent 0%,
    rgba(255, 255, 255, 0.04) 45%,
    rgba(255, 255, 255, 0.1) 100%
  );
  pointer-events: none;
  z-index: 1;
}

.card__frame {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  border-radius: 13px;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.25);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.12),
    inset 0 0 0 1px rgba(255, 255, 255, 0.08);
  z-index: 2;
}

.card__frame::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.14),
    inset 0 12px 28px rgba(255, 255, 255, 0.06);
  pointer-events: none;
  z-index: 2;
}

.card__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transform: scale(1.03);
  transition: transform 0.65s var(--ease);
  pointer-events: none;
}

.card.is-active .card__img {
  transform: scale(1.07);
}

.card__shine {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(
    125deg,
    rgba(255, 255, 255, 0.32) 0%,
    rgba(255, 255, 255, 0.08) 32%,
    transparent 58%
  );
  pointer-events: none;
  z-index: 1;
  mix-blend-mode: soft-light;
}

.card__caption {
  position: relative;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  padding: 0 0.35rem 0.15rem;
  z-index: 2;
}

.card__title {
  font-family: var(--font);
  font-weight: 700;
  font-size: clamp(0.72rem, 1.1vw, 0.92rem);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.94);
  line-height: 1;
  white-space: nowrap;
  text-shadow: 0 1px 12px rgba(0, 0, 0, 0.35);
}

/* ---------- Controls ---------- */

.radial__controls {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.9rem;
  padding: 0.35rem 1rem 1.6rem;
  z-index: 20;
}

.nav-btn {
  width: 48px;
  height: 48px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: rgba(244, 240, 234, 0.08);
  border: 1px solid rgba(244, 240, 234, 0.14);
  color: #f4f0ea;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.2);
  transition:
    background 0.28s var(--ease),
    border-color 0.28s var(--ease),
    transform 0.28s var(--ease),
    box-shadow 0.28s var(--ease);
}

.nav-btn svg {
  width: 21px;
  height: 21px;
}

.nav-btn:hover {
  background: rgba(244, 240, 234, 0.16);
  border-color: rgba(244, 240, 234, 0.3);
  transform: translateY(-1px);
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.26);
}

.nav-btn:active {
  transform: scale(0.96);
}

.nav-btn:focus-visible {
  outline: 2px solid rgba(244, 240, 234, 0.55);
  outline-offset: 3px;
}

.dots {
  display: flex;
  align-items: center;
  gap: 0.48rem;
  min-height: 48px;
  padding: 0 0.25rem;
}

.dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--dot);
  transition:
    width 0.35s var(--ease),
    background 0.35s var(--ease);
}

.dot.is-active {
  width: 22px;
  background: var(--dot-on);
}

.dot:focus-visible {
  outline: 2px solid rgba(244, 240, 234, 0.55);
  outline-offset: 3px;
}

/* ---------- Responsive cards ---------- */

@media (max-width: 900px) {
  .card {
    border-radius: 16px;
    padding: 10px 10px 0;
  }

  .card__frame {
    border-radius: 10px;
  }

  .card__caption {
    height: 44px;
  }
}

@media (max-width: 560px) {
  .card {
    border-radius: 14px;
    padding: 8px 8px 0;
  }

  .card__frame {
    border-radius: 9px;
  }

  .card__caption {
    height: 40px;
  }

  .card__title {
    letter-spacing: 0.12em;
  }

  .nav-btn {
    width: 44px;
    height: 44px;
  }

  .radial__controls {
    padding-bottom: 1.25rem;
    gap: 0.65rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .card,
  .card__img,
  .nav-btn,
  .dot {
    transition: none !important;
  }
}
