/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 12px;
  border-radius: 999px;
  border: none;
  font: 500 14px/20px var(--font-body);
  letter-spacing: -0.07px;
  color: var(--foreground);
  white-space: nowrap;
  cursor: pointer;
  outline: none;
  box-sizing: border-box;
  transition:
    background-color var(--duration-base) var(--ease-standard),
    box-shadow var(--duration-base) var(--ease-standard),
    transform var(--duration-press) var(--ease-standard);
}

.btn--secondary {
  background: var(--background);
  box-shadow:
    inset 0 0 0 1px #fff,
    0 0 0 1px var(--border);
}

.btn--secondary:hover {
  background: var(--muted);
}

.btn--secondary:focus-visible {
  box-shadow:
    inset 0 0 0 1px #fff,
    0 0 0 1px var(--border),
    0 0 0 2px var(--background),
    0 0 0 3px var(--ring);
}

.btn--primary {
  background: var(--brand);
  box-shadow:
    inset 0 0 0 1px #fff,
    0 0 0 1px var(--brand-border);
}

.btn--primary:hover {
  background: var(--brand-hover);
}

.btn--primary:focus-visible {
  box-shadow:
    inset 0 0 0 1px #fff,
    0 0 0 1px var(--brand-border),
    0 0 0 2px var(--background),
    0 0 0 3px var(--ring-brand);
}

.btn:active:not(:disabled) {
  transform: translateY(var(--press-offset));
}

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

@media (prefers-reduced-motion: reduce) {
  .btn,
  .top-nav__link,
  .field__input,
  .field__select {
    transition-duration: 0.01ms;
  }
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 24px;
  padding: 4px 8px;
  background: var(--color-background);
  border-radius: 999px;
  font-size: var(--text-small-size);
  font-weight: 500;
  line-height: var(--text-small-line);
  letter-spacing: var(--text-small-spacing);
  white-space: nowrap;
  box-shadow:
    0 0 0 1px var(--color-brand),
    0 0 0 2px var(--color-background),
    0 0 0 3px var(--color-alpha-brand-20);
}

/* Top Navigation */
.top-nav {
  position: fixed;
  top: 32px;
  left: 50%;
  transform: translateX(-50%);
  z-index: var(--z-nav);
  display: flex;
  align-items: center;
  gap: 64px;
  width: max-content;
  height: 58px;
  padding: 12px 16px;
  background: var(--color-alpha-light-40);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  border: 1px solid var(--color-background);
  border-radius: 99px;
}

.top-nav__logo {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 185px;
  flex-shrink: 0;
}

.top-nav__logo-full {
  display: block;
  width: 94.72px;
  height: 32px;
}

/* Icon-only variant, shown on mobile */
.top-nav__logo-mark {
  display: none;
  width: 32px;
  height: 32px;
}

.top-nav__links {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-shrink: 0;
}

.top-nav__link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 8px;
  border-radius: 99px;
  font: 500 14px/20px var(--font-body);
  letter-spacing: -0.07px;
  color: var(--foreground);
  white-space: nowrap;
  cursor: pointer;
  outline: none;
  box-sizing: border-box;
  transition:
    background-color var(--duration-base) var(--ease-standard),
    box-shadow var(--duration-base) var(--ease-standard),
    transform var(--duration-press) var(--ease-standard);
}

.top-nav__link:hover {
  background: var(--muted);
}

.top-nav__link:focus-visible {
  background: var(--background);
  box-shadow:
    0 0 0 1px var(--ring-nav),
    0 0 0 2px var(--ring-nav-outer);
}

.top-nav__link:active {
  background: var(--muted);
  transform: translateY(var(--press-offset));
}

.footer__link:focus-visible {
  outline: 2px solid var(--color-brand);
  outline-offset: 2px;
}

/* Phone Frame */
.phone-frame {
  position: relative;
  width: var(--phone-width);
  height: var(--phone-height);
  border-radius: var(--phone-radius);
  overflow: hidden;
  pointer-events: none;
  box-shadow:
    0 0 0 var(--phone-ring) var(--color-phone-ring),
    inset 0 0 0 var(--phone-inset) var(--color-alpha-dark-6);
}

.phone-frame__screen {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: var(--phone-radius);
  opacity: 0;
  transform: translateY(var(--screen-offset));
  transition:
    opacity var(--screen-duration) var(--screen-easing),
    transform var(--screen-duration) var(--screen-easing);
}

/* Screens already passed exit upwards, so the next one always rises from below */
.phone-frame__screen--above {
  transform: translateY(calc(var(--screen-offset) * -1));
}

.phone-frame__screen--active {
  opacity: 1;
  transform: translateY(0);
}

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

  .phone-frame__screen--above {
    transform: none;
  }
}

.phone-frame--static {
  display: none;
}

.phone-frame--static .phone-frame__screen {
  opacity: 1;
  transform: none;
  transition: none;
}

/* Mileage Table */
.mileage-table {
  position: relative;
  /* 1158px of columns plus the 1px side borders */
  width: 100%;
  border-left: 1px solid var(--color-border);
  border-right: 1px solid var(--color-border);
}

.mileage-table__header {
  display: grid;
  grid-template-columns: 40px 120px 240px 240px 128px 238px 152px;
  background: var(--color-muted);
  border-bottom: 1px solid var(--color-border);
}

.mileage-table__header-cell {
  padding: 8px 12px;
  font-size: var(--text-small-size);
  font-weight: 500;
  line-height: var(--text-small-line);
  letter-spacing: var(--text-small-spacing);
  color: var(--color-muted-foreground);
  border-right: 1px solid var(--color-border);
}

.mileage-table__header-cell:last-child {
  border-right: none;
}

.mileage-table__row {
  display: grid;
  grid-template-columns: 40px 120px 240px 240px 128px 238px 152px;
  background: var(--color-background);
  border-bottom: 1px solid var(--color-border);
}

.mileage-table__cell {
  display: flex;
  align-items: center;
  padding: 8px 12px;
  font-size: var(--text-body-size);
  line-height: var(--text-body-line);
  letter-spacing: var(--text-body-spacing);
  border-right: 1px solid var(--color-border);
  min-height: 72px;
}

.mileage-table__cell:last-child {
  border-right: none;
}

.mileage-table__cell--number {
  justify-content: flex-end;
}

.mileage-table__cell--split {
  flex-direction: column;
  align-items: stretch;
  justify-content: center;
  padding: 0;
  min-height: 72px;
}

.mileage-table__cell-line {
  display: flex;
  align-items: center;
  padding: 8px 12px;
  flex: 1;
}

.mileage-table__cell-line + .mileage-table__cell-line {
  border-top: 1px solid var(--color-border);
}

.mileage-table__fade {
  position: absolute;
  left: -1px;
  right: -1px;
  bottom: 0;
  height: 129px;
  background: linear-gradient(to bottom, rgba(255, 255, 255, 0) 0%, #ffffff 70.312%);
  pointer-events: none;
  z-index: 7;
}

/* Hatching divider */
/*
 * The dash pattern is a mask, so the gradient underneath can travel across the
 * strokes while the strokes themselves stay put. Every stroke is 1px on a 4px
 * pitch, with coincident stops so the edges stay crisp.
 */
.hatching-divider {
  position: relative;
  width: 100%;
  height: 21px;
  overflow: hidden;
  opacity: 0.7;
  -webkit-mask-image: repeating-linear-gradient(
    90deg,
    #000 0px,
    #000 1px,
    transparent 1px,
    transparent 4px
  );
  mask-image: repeating-linear-gradient(
    90deg,
    #000 0px,
    #000 1px,
    transparent 1px,
    transparent 4px
  );
}

/*
 * One tile spans light -> brand -> dark and then ramps back to light, so the
 * loop has no seam. Sliding by exactly one tile makes the restart invisible.
 */
.hatching-divider::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: calc(var(--divider-sweep-period) * -1);
  right: 0;
  background-image: linear-gradient(
    90deg,
    var(--color-brand-tint) 0%,
    var(--color-brand) 40%,
    var(--color-brand-shadow) 80%,
    var(--color-brand-tint) 100%
  );
  background-size: var(--divider-sweep-period) 100%;
  animation: divider-sweep var(--divider-sweep-duration) linear infinite;
  will-change: transform;
}

.hatching-divider--reverse::before {
  animation-direction: reverse;
}

/* Nothing to animate until the block has been revealed */
.reveal:not(.is-visible) .hatching-divider::before {
  animation-play-state: paused;
}

@keyframes divider-sweep {
  to {
    transform: translate3d(var(--divider-sweep-period), 0, 0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .hatching-divider::before {
    animation: none;
  }
}

/* Waitlist modal */
.waitlist-modal {
  width: 600px;
  max-width: calc(100vw - 48px);
  max-height: calc(100vh - 48px);
  margin: auto;
  padding: 40px;
  overflow: auto;
  border: none;
  border-radius: 24px;
  background: var(--background);
  color: var(--foreground);
  box-shadow: none;
}

.waitlist-modal::backdrop {
  background: rgba(17, 19, 10, 0.4);
}

.waitlist-modal__close {
  position: absolute;
  top: 16px;
  right: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 6px;
  border: none;
  border-radius: 999px;
  background: var(--background);
  cursor: pointer;
}

.waitlist-modal__close:hover {
  background: var(--muted);
}

.waitlist-modal__close:focus-visible {
  outline: none;
  box-shadow:
    0 0 0 1px var(--ring-nav),
    0 0 0 2px var(--ring-nav-outer);
}

.waitlist-modal__close img {
  display: block;
  width: 14px;
  height: 14px;
}

.waitlist-modal__header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  width: 100%;
  text-align: center;
}

.waitlist-modal__badge {
  box-shadow:
    0 0 0 0.5px var(--brand),
    inset 0 0 0 1px var(--brand-border);
}

.waitlist-modal__title {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: var(--text-h3-size);
  line-height: var(--text-h3-line);
  letter-spacing: var(--text-h3-spacing);
}

.waitlist-modal__copy {
  font-weight: 400;
  font-size: var(--text-large-size);
  line-height: var(--text-large-line);
  letter-spacing: var(--text-large-spacing);
  color: var(--color-muted-foreground);
}

.hp {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.waitlist-modal__form {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 24px;
  width: 400px;
  max-width: 100%;
  margin: 32px auto 0;
}

.waitlist-modal__submit {
  width: 100%;
}

.waitlist-modal__consents {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Consent checkbox */
.consent {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  cursor: pointer;
}

.consent__input {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  border: 0;
  clip: rect(0 0 0 0);
  overflow: hidden;
  white-space: nowrap;
}

.consent__box {
  position: relative;
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  border-radius: 6px;
  background: var(--background);
  box-shadow:
    0 1px 2px 0 rgba(17, 19, 10, 0.08),
    0 0 0 1px var(--border);
  transition:
    background-color var(--duration-base) var(--ease-standard),
    box-shadow var(--duration-base) var(--ease-standard);
}

.consent__box::after {
  content: "";
  position: absolute;
  top: 4px;
  left: 4px;
  width: 12px;
  height: 12px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' fill='none'%3E%3Cpath d='M10 3L4.5 8.5L2 6' stroke='%2311130a' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat center;
  opacity: 0;
  transition: opacity var(--duration-base) var(--ease-standard);
}

.consent__input:checked + .consent__box {
  background: var(--brand);
  box-shadow:
    0 1px 2px 0 rgba(17, 19, 10, 0.08),
    0 0 0 1px var(--brand-border);
}

.consent__input:checked + .consent__box::after {
  opacity: 1;
}

.consent__input:focus-visible + .consent__box {
  box-shadow:
    0 1px 2px 0 rgba(17, 19, 10, 0.08),
    0 0 0 1px var(--border),
    0 0 0 2px var(--background),
    0 0 0 3px var(--ring);
}

.consent__input:checked:focus-visible + .consent__box {
  box-shadow:
    0 1px 2px 0 rgba(17, 19, 10, 0.08),
    0 0 0 1px var(--brand-border),
    0 0 0 2px var(--background),
    0 0 0 3px var(--ring-brand);
}

.consent__input:disabled + .consent__box {
  opacity: 1;
  cursor: default;
}

.consent__input:disabled {
  cursor: default;
}

.consent.is-invalid .consent__box {
  box-shadow:
    0 1px 2px 0 rgba(17, 19, 10, 0.08),
    0 0 0 1px #b42318;
}

.consent__label {
  font-weight: 400;
  font-size: var(--text-small-size);
  line-height: var(--text-small-line);
  letter-spacing: var(--text-small-spacing);
  color: var(--color-muted-foreground);
}

.consent__required {
  color: #dd1010;
}

.waitlist-modal__legal {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 400px;
  max-width: 100%;
  margin: 32px auto 0;
  font-weight: 400;
  font-size: var(--text-legal-size);
  line-height: var(--text-legal-line);
  letter-spacing: var(--text-legal-spacing);
  color: var(--color-muted-foreground);
  text-align: center;
}

.waitlist-modal__legal a {
  text-decoration: underline;
}

.waitlist-modal__error {
  display: none;
  margin: 0;
  font-size: var(--text-small-size);
  line-height: var(--text-small-line);
  color: #b42318;
  text-align: center;
}

.waitlist-modal__error.is-visible {
  display: block;
}

/* Form fields */
.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
}

.field__label {
  font-weight: 500;
  font-size: var(--text-small-size);
  line-height: var(--text-small-line);
  letter-spacing: var(--text-small-spacing);
}

.field__control {
  position: relative;
  width: 100%;
}

.field__input,
.field__select {
  display: block;
  width: 100%;
  height: 36px;
  padding: 8px 12px;
  border: 1px solid var(--color-border);
  border-radius: 99px;
  background: var(--background);
  color: var(--foreground);
  font: 400 14px/20px var(--font-body);
  letter-spacing: var(--text-body-spacing);
  transition:
    background-color var(--duration-base) var(--ease-standard),
    border-color var(--duration-base) var(--ease-standard),
    box-shadow var(--duration-base) var(--ease-standard);
}

.field__select {
  padding-right: 36px;
  appearance: none;
  color: var(--color-muted-foreground);
  cursor: pointer;
}

.field__select:valid {
  color: var(--foreground);
}

.field__input::placeholder {
  color: var(--color-muted-foreground);
}

.field__input:hover,
.field__select:hover {
  background: var(--muted);
}

.field__input:focus-visible,
.field__select:focus-visible {
  outline: none;
  border-color: var(--brand-border);
  background: var(--background);
  box-shadow: 0 0 0 1px var(--brand-border);
}

.field.is-invalid .field__input,
.field.is-invalid .field__select,
.field__input:user-invalid,
.field__select:user-invalid {
  border-color: #b42318;
}

.field__hint {
  display: none;
  margin: 0;
  font-weight: 400;
  font-size: var(--text-small-size);
  line-height: var(--text-small-line);
  letter-spacing: var(--text-small-spacing);
  color: #b42318;
}

.field.is-invalid .field__hint {
  display: block;
}

.field__chevron {
  position: absolute;
  top: 50%;
  right: 12px;
  width: 16px;
  height: 16px;
  transform: translateY(-50%);
  pointer-events: none;
}

.field__chevron img {
  width: 16px;
  height: 16px;
  object-fit: contain;
}

/* Toast banner */
.toast {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: var(--z-toast);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 12px 24px;
  background: var(--brand);
  color: var(--foreground);
  font-weight: 500;
  font-size: var(--text-body-size);
  line-height: var(--text-body-line);
  letter-spacing: var(--text-body-spacing);
  text-align: center;
  transform: translateY(-100%);
  transition: transform var(--duration-base) var(--ease-standard);
  pointer-events: none;
}

.toast.is-visible {
  transform: translateY(0);
  pointer-events: auto;
}

@media (prefers-reduced-motion: reduce) {
  .toast {
    transition-duration: 0.01ms;
  }
}
