/* Rolodex CSS for the homepage. */

/* Root variables define the card dimensions and text colors used throughout. */
:root {
  --card-w: 360px;
  --card-h: 420px;
  --text-main: #0f172a;
  --text-muted: #94a3b8;
}

/* Outer container for the rolodex layout, centered horizontally. */
.rolodex-outer {
  width: 100%;
  display: flex;
  justify-content: center;
  padding: 80px 0;
  overflow: hidden;
}

/* Wrap contains the rolodex viewport and control elements. */
.wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: "Poppins", sans-serif;
  flex-direction: row;
  width: 100%;
  min-height: 65vh;
  position: relative;
  touch-action: pan-y;
}

/* Viewport adds 3D perspective to the cylinder element inside. */
.viewport {
  perspective: 3000px;
}

/* Cylinder is the 3D container that will rotate to present cards like a rolodex. */
.cylinder {
  transform-style: preserve-3d;
  width: var(--card-w);
  height: var(--card-h);
  position: relative;
  cursor: grab;
}

/* Change cursor while dragging the cylinder. */
.cylinder:active {
  cursor: grabbing;
}

/* Individual card styling inside the rolodex. */
.card {
  width: var(--card-w);
  height: var(--card-h);
  position: absolute;
  left: 50%;
  top: 50%;
  margin-left: calc(var(--card-w) * -0.5);
  margin-top: calc(var(--card-h) * -0.5);
  background: #ffffff;
  border-radius: 24px;
  border: 1px solid #f1f5f9;
  box-shadow: 0 40px 100px -20px rgba(0, 0, 0, 0.06);
  padding: 50px 40px;
  display: flex;
  flex-direction: column;
  backface-visibility: hidden !important;
  overflow: hidden;
}

/* Prevent pointer events on card children to allow drag interactions on the card itself. */
.card * {
  pointer-events: none !important;
}

/* Title text shown on each card. */
.card .title {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 3px;
  color: var(--text-muted);
  font-weight: 600;
  margin-bottom: 8px;
}

/* Main large number or headline text for the card. */
.card .h-value {
  font-size: 64px;
  font-weight: 800;
  line-height: 0.9;
  color: var(--text-main);
  margin-bottom: auto;
}

/* Chart container positioned at the bottom of the card. */
.chart {
  height: 160px;
  width: 100%;
  position: absolute;
  bottom: 1px;
  left: 0;
}

/* Control panel for rolodex navigation buttons. */
.controls {
  display: flex;
  flex-direction: column;
  gap: 12px;
  z-index: 10;
  margin-right: 80px;
}

/* Dot buttons used as indicators or navigation controls. */
.dot {
  width: 4px;
  height: 24px;
  background: #e2e8f0;
  border-radius: 2px;
  border: none;
  cursor: pointer;
  padding: 0 !important;
  transition: all 0.4s ease;
}

/* Active dot styling to highlight the selected card. */
.dot.active {
  padding: 0 !important;
  background-color: #b52164;
  height: 48px;
}

/* Mobile adjustments for smaller screens. */
@media screen and (max-width: 768px) {
  .rolodex-outer {
    padding: 20px;
  }
}

/* Responsive layout changes for medium screens and smaller. */
@media screen and (max-width: 1100px) {
  /* Reduce card size variables for smaller viewports. */
  :root {
    --card-w: 280px;
    --card-h: 320px;
  }

  /* Stack content vertically and add spacing. */
  .wrap {
    flex-direction: column;
    gap: 40px;
    min-height: 45vh;
  }

  /* Reposition controls below the main content and center them. */
  .controls {
    flex-direction: row;
    order: 2;
    width: auto;
    height: 40px;
    justify-content: center;
    margin: 0 !important;
    margin-top: 30px !important;
  }

  /* Wider dot controls for touch-friendly interaction on smaller screens. */
  .dot {
    width: 40px;
    height: 8px;
    padding: 0 !important;
  }

  /* Keep active dot width consistent with the rest of the dots. */
  .dot.active {
    width: 40px;
    padding: 0 !important;
    height: 8px;
    background-color: #b52164;
  }

  /* Scale down headline text for smaller cards. */
  .card .h-value {
    font-size: 44px !important;
  }

  /* Reduce chart height on smaller screens. */
  .chart {
    height: 110px;
  }

  /* Reduce perspective amount for tighter layouts. */
  .viewport {
    perspective: 1500px;
  }
}
