/* dealerstep.com coming-soon page (PRD R17).
   Brand: the original DealerStep wordmark's navy and red, with the italic lean carried into the
   headline type and the slanted sign-up panel. Fonts are self-hosted (see fonts/LICENSE.txt). */

@font-face {
  font-family: "Barlow Condensed";
  src: url("/fonts/barlow-condensed-latin-800-italic.woff2") format("woff2");
  font-weight: 800;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "Barlow Condensed";
  src: url("/fonts/barlow-condensed-latin-700-normal.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("/fonts/inter-latin-wght-normal.woff2") format("woff2-variations");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --navy: #002060;
  --navy-deep: #00163f;
  --red: #ca1e39;
  --red-dark: #a3152c;
  --paper: #f6f5f1;
  --ink: #0e1a33;
  --muted: #4a5570;
  --on-navy: #ffffff;
  --on-navy-muted: rgba(255, 255, 255, 0.78);
  --error-on-navy: #ffc2cb;

  --display: "Barlow Condensed", "Arial Narrow", sans-serif;
  --body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;

  --gutter: clamp(1rem, 4vw, 3rem);
  --lean: 72px; /* horizontal run of the panel's slanted edge */
  --stripe: 12px; /* width of the red band along that edge */
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-size: 1rem;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

h1,
h2,
h3 {
  margin: 0;
  font-family: var(--display);
  font-weight: 800;
  font-style: italic;
  line-height: 0.92;
  letter-spacing: 0.005em;
  text-transform: uppercase;
}

p {
  margin: 0;
}

a {
  color: inherit;
}

:focus-visible {
  outline: 3px solid var(--red);
  outline-offset: 3px;
}

.skip {
  position: absolute;
  left: var(--gutter);
  top: -100px;
  z-index: 10;
  padding: 0.5rem 1rem;
  background: var(--navy);
  color: var(--on-navy);
  font-weight: 600;
}
.skip:focus {
  top: 0.75rem;
}

.eyebrow {
  font-family: var(--display);
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--red);
}

/* ---------- Top bar ---------- */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.25rem var(--gutter);
}

.brand {
  display: inline-block;
  width: clamp(140px, 18vw, 190px);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.8rem 0.3rem;
  border: 1.5px solid currentColor;
  border-radius: 999px;
  font-family: var(--display);
  font-weight: 700;
  font-size: 0.9rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--navy);
  white-space: nowrap;
}

.dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: var(--red);
  animation: pulse 2.4s ease-in-out infinite;
}

@keyframes pulse {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(202, 30, 57, 0.55);
  }
  50% {
    box-shadow: 0 0 0 6px rgba(202, 30, 57, 0);
  }
}

/* ---------- Hero ---------- */

.hero {
  display: grid;
  grid-template-columns: 1fr;
  /* The entrance animations start off to the side; never let them cause a sideways scroll. */
  overflow-x: clip;
}

.hero-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 1.25rem;
  padding: 1.5rem var(--gutter) 3rem;
  container-type: inline-size;
}

/* Sized to the copy column, not the window. The longest line ("Put your whole") is 6.34em wide,
   so 14.5% of the column keeps each of the three lines on one line at every width. The vw value
   is the fallback for browsers without container units. */
.hero h1 {
  font-size: clamp(2.75rem, 12vw, 7rem);
  font-size: clamp(2.75rem, 14.5cqi, 7rem);
  color: var(--navy);
}

.hero h1 .line {
  display: block;
  animation: lean-in 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}
.hero h1 .line:nth-child(2) {
  animation-delay: 0.08s;
}
.hero h1 .line:nth-child(3) {
  animation-delay: 0.16s;
}
.hero h1 .accent {
  color: var(--red);
}

@keyframes lean-in {
  from {
    opacity: 0;
    transform: translateX(-2rem) skewX(-8deg);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.lede {
  max-width: 34rem;
  font-size: clamp(1.05rem, 1.6vw, 1.2rem);
  color: var(--muted);
  animation: rise 0.8s 0.3s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(1rem);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* The sign-up panel: navy, with a red band along a slanted left edge on wide screens. */
.hero-panel {
  position: relative;
  background: var(--navy);
  color: var(--on-navy);
  scroll-margin-top: 1rem;
}

.panel-inner {
  position: relative;
  max-width: 30rem;
  margin: 0 auto;
  padding: 2.5rem var(--gutter) 3rem;
}

.hero-panel h2 {
  font-size: clamp(2.25rem, 7vw, 3rem);
}

.panel-sub {
  margin-top: 0.6rem;
  color: var(--on-navy-muted);
}

.signup-form {
  display: grid;
  gap: 1rem;
  margin-top: 1.75rem;
}
.signup-form[hidden] {
  display: none;
}

.field {
  display: grid;
  gap: 0.35rem;
}

.field label {
  font-weight: 600;
  font-size: 0.92rem;
}

.optional {
  font-weight: 400;
  color: var(--on-navy-muted);
}

.field input {
  width: 100%;
  padding: 0.8rem 0.9rem;
  border: 2px solid transparent;
  border-radius: 4px;
  background: #ffffff;
  color: var(--ink);
  font: inherit;
  font-size: 1rem;
  box-shadow: inset 0 -3px 0 0 transparent;
  transition:
    box-shadow 0.25s ease,
    border-color 0.2s ease;
}
.field input:focus {
  outline: none;
  box-shadow: inset 0 -3px 0 0 var(--red);
}
.field input:focus-visible {
  outline: 3px solid #ffffff;
  outline-offset: 2px;
}
.field input[aria-invalid="true"] {
  border-color: var(--red);
}

.field-error {
  min-height: 0;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--error-on-navy);
}
.field-error:empty {
  display: none;
}

/* Honeypot: off-screen, not display:none, so naive bots still see and fill it. */
.trap {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  min-height: 3.25rem;
  padding: 0.75rem 1.75rem;
  border: 0;
  border-radius: 4px;
  font-family: var(--display);
  font-weight: 800;
  font-style: italic;
  font-size: 1.3rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  transition:
    transform 0.2s ease,
    background-color 0.2s ease,
    color 0.2s ease;
}
.btn:hover {
  transform: translateX(4px);
}
.btn:active {
  transform: translateX(2px) scale(0.99);
}

.btn-red {
  width: 100%;
  margin-top: 0.5rem;
  background: var(--red);
  color: #ffffff;
}
.btn-red:hover {
  background: var(--red-dark);
}
.btn-red:focus-visible {
  outline: 3px solid #ffffff;
}
.btn-red[aria-busy="true"] {
  cursor: progress;
  opacity: 0.85;
  transform: none;
}
.btn-red[aria-busy="true"]::after {
  content: "";
  width: 1rem;
  height: 1rem;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.form-status {
  font-weight: 600;
  color: var(--error-on-navy);
}
.form-status:empty {
  display: none;
}

.privacy {
  font-size: 0.85rem;
  color: var(--on-navy-muted);
}

.success {
  display: grid;
  justify-items: start;
  gap: 0.75rem;
  margin-top: 2rem;
}
.success[hidden] {
  display: none;
}
.success:focus {
  outline: none;
}
.success h3 {
  font-size: 2.25rem;
}
.success p {
  color: var(--on-navy-muted);
}

.check {
  width: 64px;
  height: 64px;
  fill: none;
  stroke-width: 3.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.check circle {
  stroke: var(--red);
  stroke-dasharray: 151;
  stroke-dashoffset: 151;
  animation: draw 0.6s ease-out forwards;
}
.check path {
  stroke: #ffffff;
  stroke-dasharray: 36;
  stroke-dashoffset: 36;
  animation: draw 0.35s 0.45s ease-out forwards;
}

@keyframes draw {
  to {
    stroke-dashoffset: 0;
  }
}

/* ---------- The three steps ---------- */

.process {
  padding: clamp(4rem, 9vw, 7rem) var(--gutter);
}

.section-head {
  display: grid;
  gap: 1rem;
  max-width: 40rem;
}
.section-head h2 {
  font-size: clamp(2.5rem, 7vw, 4.5rem);
  color: var(--navy);
}
.section-head p:last-child {
  font-size: 1.1rem;
  color: var(--muted);
}

.stairs {
  display: grid;
  gap: 1.25rem;
  margin: clamp(2.5rem, 6vw, 4rem) 0 0;
  padding: 0;
  list-style: none;
}

.stair {
  display: grid;
  gap: 0.9rem;
}

.block {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.25rem 1.5rem;
  border-top: 6px solid var(--red);
  background: var(--navy);
  color: var(--on-navy);
}

.num {
  font-family: var(--display);
  font-weight: 800;
  font-style: italic;
  font-size: 3.5rem;
  line-height: 1;
}

.label {
  font-family: var(--display);
  font-weight: 800;
  font-style: italic;
  font-size: 1.6rem;
  line-height: 1;
  text-transform: uppercase;
}

.stair p {
  max-width: 22rem;
  color: var(--muted);
}

/* On a phone the steps descend: each one sits a little further in. */
.s2 {
  margin-left: 8%;
}
.s3 {
  margin-left: 16%;
}

/* Rise into place when the section scrolls into view. Only when the script is running, so the
   steps are never stuck hidden without it. */
.js .stair {
  opacity: 0;
  transform: translateY(2.5rem);
  transition:
    opacity 0.6s ease,
    transform 0.7s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.js .stairs.in-view .stair {
  opacity: 1;
  transform: none;
}
.js .stairs.in-view .s2 {
  transition-delay: 0.12s;
}
.js .stairs.in-view .s3 {
  transition-delay: 0.24s;
}

/* ---------- Customer + coaching ---------- */

.pair {
  display: grid;
  gap: 2.5rem;
  padding: clamp(3.5rem, 8vw, 6rem) var(--gutter);
  background: #ffffff;
}

.pair-item {
  display: grid;
  gap: 1rem;
  align-content: start;
  padding-top: 1.5rem;
  border-top: 4px solid var(--red);
}
.pair-item h2 {
  font-size: clamp(2.1rem, 5vw, 3.1rem);
  color: var(--navy);
}
.pair-item p {
  max-width: 30rem;
  font-size: 1.08rem;
  color: var(--muted);
}

/* ---------- Final call to action ---------- */

.final {
  display: grid;
  justify-items: start;
  gap: 1.1rem;
  padding: clamp(4rem, 10vw, 7rem) var(--gutter);
  background:
    repeating-linear-gradient(
      -62deg,
      transparent 0 46px,
      rgba(255, 255, 255, 0.035) 46px 58px
    ),
    var(--navy);
  color: var(--on-navy);
}
.final h2 {
  font-size: clamp(3rem, 11vw, 6.5rem);
}
.final p {
  font-size: 1.15rem;
  color: var(--on-navy-muted);
}

.btn-white {
  margin-top: 0.5rem;
  background: #ffffff;
  color: var(--navy);
}
.btn-white:hover {
  background: var(--red);
  color: #ffffff;
}
.btn-white:focus-visible {
  outline: 3px solid #ffffff;
}

/* ---------- Footer ---------- */

.footer {
  padding: 1.5rem var(--gutter);
  background: var(--navy-deep);
  color: var(--on-navy-muted);
  font-size: 0.9rem;
}

/* ---------- Simple pages: thanks, oops, 404 ---------- */

.notice {
  display: grid;
  justify-items: start;
  gap: 1.25rem;
  max-width: 44rem;
  min-height: 60vh;
  align-content: center;
  padding: 3rem var(--gutter) 5rem;
}
.notice h1 {
  font-size: clamp(3rem, 11vw, 6rem);
  color: var(--navy);
}
.notice h1 .accent {
  color: var(--red);
}
.notice p {
  font-size: 1.15rem;
  color: var(--muted);
}
.notice .btn-white {
  background: var(--navy);
  color: #ffffff;
}
.notice .btn-white:hover {
  background: var(--red);
}
.notice .btn-white:focus-visible {
  outline-color: var(--red);
}

/* ---------- Links to the privacy policy (footer, note under the form) ---------- */

.footer a,
.privacy a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 0.15em;
}
.footer a:hover,
.privacy a:hover {
  color: var(--on-navy);
}
.footer a:focus-visible,
.privacy a:focus-visible {
  outline: 2px solid var(--on-navy);
  outline-offset: 2px;
}

/* ---------- Privacy policy (R17.22) ---------- */

.policy {
  max-width: 44rem;
  padding: 2rem var(--gutter) 5rem;
  overflow-wrap: break-word;
}
.policy h1 {
  margin-bottom: 0.25rem;
  font-size: clamp(3rem, 11vw, 5rem);
  color: var(--navy);
}
.policy h1 .accent {
  color: var(--red);
}
.policy h2 {
  margin: 2.25rem 0 0.5rem;
  font-size: clamp(1.6rem, 5vw, 2rem);
  color: var(--navy);
}
.policy > p,
.policy > ul {
  margin: 0.75rem 0 0;
  font-size: 1.05rem;
}
.policy ul {
  padding-left: 1.25rem;
}
.policy a:not(.btn) {
  color: var(--red-dark);
  text-underline-offset: 0.15em;
}
.policy a:not(.btn):focus-visible {
  outline: 2px solid var(--red);
  outline-offset: 2px;
}
.policy > .policy-updated {
  margin-top: 0;
  color: var(--muted);
}
.policy .btn-white {
  margin-top: 2.5rem;
  background: var(--navy);
  color: #ffffff;
}
.policy .btn-white:hover {
  background: var(--red);
}
.policy .btn-white:focus-visible {
  outline-color: var(--red);
}

/* ---------- Wide screens ---------- */

@media (min-width: 900px) {
  .topbar {
    position: absolute;
    inset: 0 0 auto 0;
    z-index: 2;
  }
  .topbar-plain {
    position: static;
  }
  /* The badge sits over the navy panel here, so it turns white. */
  .badge {
    color: var(--on-navy);
  }

  .hero {
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
    min-height: min(100svh, 60rem);
  }

  .hero-copy {
    padding: 8rem var(--gutter) 4rem;
  }

  .hero-panel {
    background: transparent;
    display: flex;
    align-items: center;
  }
  /* Two slanted layers: red behind, navy in front and shifted right by --stripe, which leaves a
     red band of the same slant along the navy's leading edge. */
  .hero-panel::before,
  .hero-panel::after {
    content: "";
    position: absolute;
    inset: 0;
    clip-path: polygon(var(--lean) 0, 100% 0, 100% 100%, 0 100%);
  }
  .hero-panel::before {
    left: calc(-1 * var(--stripe));
    background: var(--red);
  }
  .hero-panel::after {
    background:
      repeating-linear-gradient(
        -62deg,
        transparent 0 46px,
        rgba(255, 255, 255, 0.035) 46px 58px
      ),
      var(--navy);
  }
  .panel-inner {
    z-index: 1;
    width: 100%;
    padding: 7rem var(--gutter) 4rem calc(var(--lean) + 2.5rem);
    animation: panel-in 0.9s 0.1s cubic-bezier(0.2, 0.8, 0.2, 1) both;
  }

  @keyframes panel-in {
    from {
      opacity: 0;
      transform: translateX(2.5rem);
    }
    to {
      opacity: 1;
      transform: none;
    }
  }

  .stairs {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: end;
    gap: clamp(1rem, 2.5vw, 2rem);
  }
  .s2,
  .s3 {
    margin-left: 0;
  }
  /* On wide screens they climb: each block is taller than the last. */
  .s1 .block {
    min-height: 13rem;
  }
  .s2 .block {
    min-height: 17rem;
  }
  .s3 .block {
    min-height: 21rem;
  }
  .num {
    font-size: 4.5rem;
  }

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

/* Very wide screens: hold the content to a 1320px measure. The hero's copy column only takes the
   left inset; its right edge already meets the sign-up panel. */
@media (min-width: 1400px) {
  .process,
  .pair,
  .final {
    padding-left: max(var(--gutter), calc((100vw - 1320px) / 2));
    padding-right: max(var(--gutter), calc((100vw - 1320px) / 2));
  }
  .hero-copy {
    padding-left: max(var(--gutter), calc((100vw - 1320px) / 2));
  }
}

/* Printed pages show the steps even if the visitor never scrolled to them. */
@media print {
  .js .stair {
    opacity: 1;
    transform: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-delay: 0s !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    transition-delay: 0s !important;
  }
}
