@font-face {
  font-family: "Inter Tight";
  src: url("fonts/of-inter-tight-800.woff2") format("woff2");
  font-weight: 800;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Inter";
  src: url("fonts/of-inter-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  --field: #151513;
  --lime: #faff69;
  --band: #414141;
  --panel: #1c1c19;
  --panel-2: #242420;
  --ink: #f4f4ef;

  --pad: clamp(18px, 3.2vw, 52px);
  --quote: clamp(3.2rem, 9vw, 8.1rem);
  --price: clamp(3.6rem, 9.5vw, 8.7rem);
}

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

html {
  height: 100%;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100%;
  background: var(--field);
  color: var(--ink);
  font-family: "Inter", -apple-system, "Helvetica Neue", Arial, sans-serif;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.frame {
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
}

/* masthead */

.head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding: var(--pad) var(--pad) clamp(14px, 1.5vw, 22px);
  border-bottom: 1px solid var(--band);
}

.kicker,
.axis {
  margin: 0;
  font-size: clamp(10px, 0.9vw, 12px);
  line-height: 1;
  letter-spacing: 0.18em;
}

.kicker {
  color: rgba(244, 244, 239, 0.58);
}

.axis {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--lime);
  text-transform: uppercase;
  white-space: nowrap;
}

.axis::before {
  content: "";
  width: 7px;
  height: 7px;
  flex: none;
  background: var(--lime);
}

/* the board */

.board {
  position: relative;
  min-height: 0;
  overflow: hidden;
  background: var(--panel);
}

.track {
  display: flex;
  flex-direction: column;
  height: 400%;
  transform: translateY(0);
  transition: transform 260ms steps(3, end);
  will-change: transform;
}

.board[data-row="1"] .track {
  transform: translateY(-25%);
}

.board[data-row="2"] .track {
  transform: translateY(-50%);
}

.board[data-row="3"] .track {
  transform: translateY(-75%);
}

.row {
  flex: 0 0 25%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: baseline;
  align-content: center;
  gap: clamp(20px, 3vw, 64px);
  padding: 0 var(--pad) 0 calc(var(--pad) + clamp(24px, 2.2vw, 38px));
}

.model {
  font-family: "Inter Tight", "Inter", sans-serif;
  font-weight: 800;
  font-size: var(--quote);
  line-height: 0.84;
  letter-spacing: -0.035em;
  color: var(--ink);
  white-space: nowrap;
}

.price {
  display: flex;
  align-items: baseline;
  justify-self: end;
  gap: 0.02em;
  font-family: "Inter Tight", "Inter", sans-serif;
  font-weight: 800;
  font-size: var(--price);
  line-height: 0.84;
  letter-spacing: -0.03em;
  white-space: nowrap;
}

.cur {
  font-size: 0.42em;
  letter-spacing: 0;
  opacity: 0.55;
  transition: opacity 200ms steps(2, end);
}

.num {
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
  transition: color 200ms steps(2, end);
}

.price.up .num {
  color: var(--lime);
}

.price.up .cur {
  opacity: 0.8;
}

.price.down .num {
  color: var(--band);
}

.price.down .cur {
  opacity: 0.3;
}

.price.glow .num {
  animation: tick-up 820ms ease-out;
}

@keyframes tick-up {
  0% {
    text-shadow: 0 0 0 rgba(250, 255, 105, 0);
  }
  22% {
    text-shadow: 0 0 46px rgba(250, 255, 105, 0.6), 0 0 120px rgba(250, 255, 105, 0.22);
  }
  100% {
    text-shadow: 0 0 0 rgba(250, 255, 105, 0);
  }
}

/* index rail */

.rail {
  position: absolute;
  left: clamp(12px, 1.8vw, 24px);
  top: 50%;
  transform: translateY(-50%);
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 13px;
  pointer-events: none;
}

.rail li {
  width: 20px;
  height: 1px;
  background: var(--band);
  transition: width 240ms steps(2, end), background-color 240ms steps(2, end);
}

.rail li.on {
  width: 36px;
  background: var(--lime);
}

/* footer */

.foot {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px 28px;
  padding: clamp(16px, 1.7vw, 24px) var(--pad) var(--pad);
}

.claim {
  margin: 0;
  font-size: clamp(13px, 1.1vw, 16px);
  line-height: 1.35;
  letter-spacing: 0.005em;
  color: rgba(244, 244, 239, 0.8);
}

.site {
  font-size: clamp(13px, 1.1vw, 16px);
  line-height: 1.35;
  color: var(--lime);
  text-decoration: none;
  padding-bottom: 2px;
  border-bottom: 1px solid rgba(250, 255, 105, 0.35);
  transition: border-color 140ms linear;
}

.site:hover {
  border-bottom-color: var(--lime);
}

.site:focus-visible {
  outline: 1px solid var(--lime);
  outline-offset: 5px;
  border-bottom-color: var(--lime);
}

/* phone */

@media (max-width: 720px) {
  .row {
    grid-template-columns: minmax(0, 1fr);
    align-items: end;
    align-content: center;
    gap: 2px;
    padding: 0 var(--pad);
  }

  .model {
    font-size: clamp(2.4rem, 12.6vw, 3.2rem);
    line-height: 0.9;
    letter-spacing: -0.032em;
  }

  .price {
    justify-self: start;
    font-size: clamp(4.4rem, 29vw, 7rem);
    line-height: 0.8;
  }

  .rail {
    left: 50%;
    top: auto;
    bottom: clamp(16px, 4vw, 30px);
    transform: translateX(-50%);
    flex-direction: row;
    gap: 9px;
  }

  .rail li {
    width: 20px;
    height: 2px;
  }

  .rail li.on {
    width: 20px;
  }

  .foot {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .track {
    transition: none;
  }

  .rail li {
    transition: none;
  }

  .num,
  .cur {
    transition: none;
  }

  .price.glow .num {
    animation: none;
  }
}
