@font-face {
  font-family: 'Barlow Condensed';
  src: url('fonts/barlow-condensed-bold.woff2') format('woff2');
  font-style: normal;
  font-weight: 700;
  font-display: swap;
}

.night {
  padding: 0;
  background-color: #152338;
  color: #faf5e9;
  color-scheme: dark;
}

.night [hidden] {
  display: none !important;
}

.night :focus-visible {
  outline: 3px solid #ffc96f;
  outline-offset: 3px;
}

.night-width {
  width: min(calc(100% - 4rem), 65rem);
  margin-inline: auto;
}

.night-hero {
  display: grid;
  align-content: end;
  min-height: clamp(15rem, 23vw, 23rem);
  padding: 2.4rem 0;
  background:
    linear-gradient(90deg, #101d31ad, #101d3144 48%, transparent 76%),
    url('driver-night-road.webp') center 67% / cover,
    #1b2d46;
}

.night-hero .night-width,
.night-form {
  position: relative;
  z-index: 1;
}

.night-hero--ascii {
  isolation: isolate;
  min-height: clamp(16rem, 31vw, 27rem);
  background: #17263b;
}

.night-hero--ascii::before {
  z-index: 1;
}

.night-hero--ascii::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, #101d31d9, #101d3170 46%, transparent 67%);
  pointer-events: none;
}

.night-art {
  position: absolute;
  inset: 0;
  width: min(100%, 110rem);
  margin-inline: auto;
}

.night-art img,
.night-art canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.night-art img {
  object-fit: cover;
  object-position: right bottom;
}

@media (min-width: 110rem) {
  .night-art { mask-image: linear-gradient(90deg, transparent, #000 2% 98%, transparent); }
}

.night-title {
  margin: 0 0 .6rem;
  color: #fff6de;
  font: 750 clamp(3.25rem, 6.3vw, 6rem)/1 system-ui, sans-serif;
  letter-spacing: -.06em;
}

.night-hero p {
  max-width: 38ch;
  margin: 0;
  font-size: 1.04rem;
  line-height: 1.5;
  color: #fff7ea;
}

.night-form {
  padding-block: clamp(1.4rem, 3vw, 2.6rem) 2.5rem;
}

.night-form fieldset {
  min-inline-size: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.night-form legend {
  padding: 0;
}

.night-progress {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .6rem;
  margin: 0 0 1.4rem;
  padding: 0;
  list-style: none;
}

.night-progress li {
  display: flex;
  align-items: center;
  gap: .45rem;
  font-size: .85rem;
  color: #b4c1d0;
}

.night-progress li + li::before {
  content: '';
  width: 1.8rem;
  height: 1px;
  margin-right: .2rem;
  background: #718398;
}

.night-progress span {
  display: grid;
  place-items: center;
  width: 1.45rem;
  height: 1.45rem;
  border: 1px solid #8594a7;
  border-radius: 50%;
  font-weight: 700;
}

.night-progress [aria-current] {
  color: #ffc675;
  font-weight: 700;
}

.night-progress [aria-current] span {
  border-color: transparent;
  background: #ffc675;
  color: #162338;
}

.night-grid,
.night-pair {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, .9fr);
  gap: clamp(2rem, 5vw, 5rem);
}

.night-pair {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.night-choices legend {
  margin-bottom: .6rem;
  font: 700 clamp(1.55rem, 2vw, 1.9rem)/1.15 'Barlow Condensed', 'Arial Narrow', sans-serif;
}

.night-choices label {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .2rem .75rem;
  min-height: 3rem;
  padding: .5rem .65rem;
  border-top: 1px solid #68778c;
  cursor: pointer;
}

.night-choices label:last-child {
  border-bottom: 1px solid #68778c;
}

.night-choices label:hover {
  background: #203047;
}

.night-choices label:has(:checked) {
  background: #2b3b50;
  box-shadow: inset 3px 0 #ffc675;
}

.night-choices input {
  appearance: none;
  flex: none;
  width: 1.1rem;
  height: 1.1rem;
  margin: 0;
  border: 2px solid #adbdce;
  border-radius: 50%;
  cursor: pointer;
}

.night-choices input:checked {
  border-color: #ffc675;
  background: radial-gradient(circle, #ffc675 0 40%, transparent 47%);
}

.night-choices label > span {
  font-weight: 650;
}

.night-choices small {
  margin-left: auto;
  color: #c9d2dc;
  font-size: .82rem;
}

.night-selection {
  margin: 0 0 .85rem;
  color: #ffd69b;
  font-weight: 600;
}

.night-contact {
  display: grid;
  gap: 1rem;
}

.night-field {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: .35rem;
}

.night-field span {
  font-size: .87rem;
  font-weight: 650;
}

.night-field small {
  font-size: .85em;
  font-weight: 400;
}

.night-field input,
.night-field textarea {
  width: 100%;
  min-width: 0;
  min-height: 2.75rem;
  padding: .5rem .7rem;
  border: 1px solid #788aa0;
  border-radius: .2rem;
  background: #1c2d44;
  color: #fff;
  font: inherit;
  font-size: 1rem;
  line-height: 1.45;
}

.night-field textarea {
  resize: vertical;
}

.night-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .75rem 1.1rem;
  margin-top: 1.45rem;
}

.night-button {
  min-height: 3rem;
  margin-left: auto;
  padding: .7rem 1.35rem;
  border: 0;
  border-radius: .25rem;
  background: #ffc26a;
  color: #152338;
  font: inherit;
  font-weight: 700;
  line-height: 1.3;
  cursor: pointer;
}

.night-button:hover {
  background: #ffd18d;
}

.night-button:disabled,
.night-form:has(.night-button[type='submit']:disabled) .night-back {
  cursor: wait;
  opacity: .65;
}

.night-back {
  min-height: 2.75rem;
  padding: 0;
  border: 0;
  background: transparent;
  color: #ffcd88;
  font: inherit;
  text-decoration: underline;
  text-underline-offset: .25em;
  cursor: pointer;
}

.night .preview-status,
.night .form-status.is-pending {
  color: #c6d2df;
}

.night .form-status {
  margin: .75rem 0 0;
}

.night .form-status:empty {
  min-height: 0;
  margin: 0;
}

.night .form-status.is-error {
  color: #ffb4a5;
}

.night .form-status.is-success {
  color: #a8e7c4;
}

.night-step:not([hidden]) + .night-step:not([hidden]) {
  margin-top: 1.5rem;
}

@media (prefers-reduced-motion: no-preference) {
  .night {
    overflow-x: clip;
  }

  [data-lane-change="forward"] [data-contact],
  [data-lane-change="back"] [data-run] {
    animation: night-lane-change 470ms cubic-bezier(.2, .75, .25, 1);
  }

  [data-lane-change="back"] [data-run] {
    --lane-direction: -1;
  }
}

@keyframes night-lane-change {
  from {
    opacity: .2;
    transform: translateX(calc(var(--lane-direction, 1) * clamp(2rem, 15vw, 9rem)));
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@media (forced-colors: active) {
  .night-choices input { appearance: auto; }
}

@media (max-width: 820px) {
  .night-grid { column-gap: 2rem; }
}

@media (max-width: 680px) {
  .night-width { width: min(calc(100% - 2.5rem), 32rem); }
  .night-hero { min-height: 13.5rem; padding-block: 1.65rem; background-position: center, 68% 65%; }
  .night-hero--ascii { min-height: clamp(16.5rem, 66vw, 22rem); }
  .night-hero--ascii::after { background: linear-gradient(90deg, #101d31e8, #101d31a0 55%, transparent 92%); }
  .night-title { max-width: 13ch; font-size: clamp(2.9rem, 9.5vw, 4rem); }
  .night-hero p { max-width: 29ch; font-size: .96rem; }
  .night-hero--ascii p { max-width: 25ch; }
  .night-grid { grid-template-columns: minmax(0, 1fr); gap: 1.3rem; }
  .night-choices label { min-height: 2.95rem; }
  .night-progress { margin-bottom: 1.2rem; }
  .night-actions { align-items: start; flex-direction: column; gap: .6rem; }
  .night-actions .preview-status { order: 1; }
  .night-button { width: 100%; }
}

@media (max-width: 380px) {
  .night-pair { grid-template-columns: 1fr; }
  .night-choices small { font-size: .76rem; }
}
