/* ==========================================================================
   Index Wipe — BEM class names
   ========================================================================== */

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

html,
body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #101010;
}

.index-wipe {
  --index-wipe-bg: #101010;
  --index-wipe-fg: rgba(255, 250, 242, 0.92);
  --index-wipe-fg-soft: rgba(255, 255, 255, 0.78);
  --index-wipe-fg-dim: rgba(255, 255, 255, 0.4);
  --index-wipe-line: rgba(255, 255, 255, 0.2);
  --index-wipe-margin: 40px;
  --index-wipe-font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;

  position: relative;
  width: 100%;
  height: 100dvh;
  overflow: hidden;
  background: var(--index-wipe-bg);
  font-family: var(--index-wipe-font);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Declarative data only — never shown */
.index-wipe__data {
  display: none;
}

.index-wipe__stage {
  position: relative;
  width: 100%;
  height: 100%;
}

/* --------------------------------------------------------------------------
   Background stack
   -------------------------------------------------------------------------- */

.index-wipe__media {
  position: absolute;
  inset: 0;
  z-index: 1;
}

.index-wipe__layer {
  position: absolute;
  inset: 0;
  will-change: clip-path;
}

.index-wipe__image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
  transform: scale(var(--index-wipe-img-scale, 1));
  transform-origin: 50% 50%;
  filter: brightness(0.72) saturate(0.92);
  will-change: transform;
  user-select: none;
  -webkit-user-drag: none;
}

.index-wipe__scrim {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background: linear-gradient(
    to right,
    rgba(10, 10, 10, 0.75) 0%,
    rgba(10, 10, 10, 0.35) 45%,
    rgba(10, 10, 10, 0.15) 100%
  );
}

/* --------------------------------------------------------------------------
   Word list
   -------------------------------------------------------------------------- */

.index-wipe__list {
  position: absolute;
  left: var(--index-wipe-margin);
  top: 50%;
  z-index: 4;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
}

.index-wipe__item {
  position: relative;
  display: block;
  border: none;
  background: transparent;
  padding: 0;
  margin: 0;
  cursor: pointer;
  text-align: left;
  -webkit-tap-highlight-color: transparent;
  font: inherit;
  color: inherit;
}

.index-wipe__word {
  position: relative;
  display: block;
  overflow: visible;
  padding-block: 4px;
}

.index-wipe__label {
  position: relative;
  display: inline-block;
  white-space: nowrap;
  font-size: clamp(40px, 7vw, 96px);
  font-weight: 300;
  letter-spacing: -0.03em;
  line-height: 1.02;
  color: var(--index-wipe-fg-dim);
  opacity: 0.55;
}

.index-wipe__label.is-active {
  color: var(--index-wipe-fg);
  opacity: 1;
}

/* Character roll cells (text hover animation) */
.index-wipe__char {
  position: relative;
  display: inline-block;
  overflow-x: visible;
  overflow-y: hidden;
  padding-bottom: 0.1em;
  margin-bottom: -0.1em;
  vertical-align: top;
}

.index-wipe__char-inner {
  position: relative;
  display: inline-block;
  will-change: transform;
}

.index-wipe__char-face {
  display: block;
}

.index-wipe__char-face--next {
  position: absolute;
  left: 0;
  top: 0;
  transform: translateY(110%);
}

.index-wipe__char-space {
  display: inline-block;
  white-space: pre;
}

.index-wipe__item:focus-visible {
  outline: none;
}

.index-wipe__item:focus-visible .index-wipe__label {
  color: var(--index-wipe-fg);
  opacity: 1;
}

/* --------------------------------------------------------------------------
   Index odometer + badge
   -------------------------------------------------------------------------- */

.index-wipe__counter {
  position: absolute;
  left: var(--index-wipe-margin);
  bottom: var(--index-wipe-margin);
  z-index: 4;
  display: flex;
  align-items: baseline;
  gap: 2px;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--index-wipe-fg-soft);
  pointer-events: none;
}

.index-wipe__digit {
  position: relative;
  display: inline-block;
  overflow-x: visible;
  overflow-y: hidden;
  height: 1em;
  width: 0.62em;
  vertical-align: top;
}

.index-wipe__digit-roller {
  position: absolute;
  left: 0;
  top: 0;
  display: flex;
  flex-direction: column;
  will-change: transform;
}

.index-wipe__digit-roller span {
  display: block;
  height: 1em;
  line-height: 1;
}

.index-wipe__counter-sep {
  color: var(--index-wipe-line);
  padding-inline: 1px;
}

.index-wipe__counter-total {
  color: var(--index-wipe-fg-dim);
}

.index-wipe__badge {
  position: absolute;
  right: var(--index-wipe-margin);
  top: var(--index-wipe-margin);
  z-index: 4;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--index-wipe-fg-soft);
  pointer-events: none;
}

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

@media (max-width: 767px) {
  .index-wipe {
    --index-wipe-margin: 20px;
  }

  .index-wipe__label {
    font-size: clamp(32px, 11vw, 56px);
  }

  .index-wipe__scrim {
    background: linear-gradient(
      to top,
      rgba(10, 10, 10, 0.8) 0%,
      rgba(10, 10, 10, 0.3) 55%,
      rgba(10, 10, 10, 0.15) 100%
    );
  }
}
