/* Closing module: 10 / What you get, 11 / How we work, 12 / Start, previous-next bar.
   Every rule is scoped under its section id. Tokens and shared components come from site.css. */

/* The word-reveal clip boxes (.rv-w, from site.js) cut the right-leaning ascenders of
   italic glyphs such as the "d" in "end." Give them horizontal slack; layout is unchanged. */
#deliverables .rv .rv-w,
#process .rv .rv-w,
#cta .rv .rv-w {
  padding-inline: 0.12em;
  margin-inline: -0.12em;
}

/* ---------- 10 / What you get ---------- */

#deliverables .closing-deliv-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 40px 24px;
}

#deliverables .closing-deliv-head,
#deliverables .closing-list {
  grid-column: 1 / -1;
  min-width: 0;
}

#deliverables .closing-deliv-head .eyebrow {
  display: block;
  margin-bottom: 16px;
}

@media (min-width: 1024px) {
  #deliverables .closing-deliv-grid {
    gap: 24px;
  }

  #deliverables .closing-deliv-head {
    grid-column: 1 / span 5;
  }

  #deliverables .closing-list {
    grid-column: 6 / span 7;
  }
}

@media (min-width: 1280px) {
  #deliverables .closing-list {
    grid-column: 7 / span 6;
  }
}

#deliverables .closing-nowrap {
  white-space: nowrap;
}

#deliverables .closing-item {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 22px 0;
  border-top: 1px solid var(--line);
}

#deliverables .closing-item:last-child {
  border-bottom: 1px solid var(--line);
}

#deliverables .closing-check {
  flex: none;
  width: 20px;
  height: 20px;
  margin-top: 2px;
  color: var(--accent);
}

#deliverables .closing-item-t {
  color: var(--bone);
  text-wrap: pretty;
}

@media (min-width: 1024px) {
  #deliverables .closing-item {
    gap: 20px;
    padding: 24px 0;
  }

  #deliverables .closing-item-t {
    font-size: 1.25rem;
    line-height: 1.3;
  }

  #deliverables .closing-check {
    margin-top: 3px;
  }
}

/* ---------- 11 / How we work ---------- */

#process .closing-tl {
  position: relative;
}

#process .closing-tl-line,
#process .closing-tl-fill {
  position: absolute;
  pointer-events: none;
}

#process .closing-tl-line {
  background: var(--line);
}

#process .closing-tl-fill {
  background: var(--accent);
  transition: transform 0.2s linear;
}

#process .closing-steps {
  position: relative;
}

#process .closing-step {
  position: relative;
  min-width: 0;
}

#process .closing-step-n {
  display: block;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.5;
  letter-spacing: 0.04em;
  color: var(--ash);
  font-variant-numeric: tabular-nums;
}

#process .closing-step-dot {
  display: block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--line);
  transition: background-color 0.5s var(--ease-std);
}

#process .closing-step-dot.closing-on {
  background: var(--accent);
}

#process .closing-step-t {
  font-family: var(--font-display);
  font-weight: 500;
  letter-spacing: -0.02em;
  font-size: 1.25rem;
  line-height: 1.25;
  color: var(--bone);
}

#process .closing-step-p {
  font-size: 1rem;
  line-height: 1.6;
  color: var(--ash);
  max-width: 34rem;
}

#process .closing-step-m {
  display: block;
  margin-top: 12px;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.4;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ash);
}

/* Vertical timeline: line on the left, dots on it, text to the right. */
@media (max-width: 1023px) {
  #process .closing-tl-line,
  #process .closing-tl-fill {
    left: 12px;
    top: 8px;
    bottom: 8px;
    width: 1px;
  }

  #process .closing-tl-fill {
    transform-origin: center top;
    transform: scaleY(0);
  }

  #process .closing-step {
    padding: 20px 0 20px 48px;
  }

  #process .closing-step-dot {
    position: absolute;
    left: 9px;
    top: 24px;
  }

  #process .closing-step-n {
    font-size: 12px;
    margin-bottom: 8px;
  }

  #process .closing-step-t {
    margin-bottom: 8px;
  }
}

/* Five columns: numbers, then the dots on one line, then the text. */
@media (min-width: 1024px) {
  #process .closing-steps {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 24px;
  }

  #process .closing-tl-line,
  #process .closing-tl-fill {
    top: 52px;
    left: 0;
    width: 100%;
    height: 1px;
  }

  #process .closing-tl-fill {
    transform-origin: left center;
    transform: scaleX(0);
  }

  #process .closing-step-n {
    margin-bottom: 32px;
  }

  #process .closing-step-dot {
    margin-bottom: 32px;
  }

  #process .closing-step-t {
    font-size: 1.25rem;
    margin-bottom: 12px;
  }
}

@media (min-width: 1280px) {
  #process .closing-steps {
    gap: 40px;
  }
}

@media (prefers-reduced-motion: reduce) {
  #process .closing-tl-fill,
  #process .closing-step-dot {
    transition: none;
  }
}

/* ---------- 12 / Start ---------- */

#cta {
  border-top: 1px solid var(--line);
}

#cta.grid-paper::before {
  -webkit-mask-image: radial-gradient(62% 72% at 50% 50%, #000 0%, transparent 100%);
  mask-image: radial-gradient(62% 72% at 50% 50%, #000 0%, transparent 100%);
}

@media (min-width: 1024px) {
  #cta {
    padding-block: 160px;
  }
}

#cta .closing-cta-in > .eyebrow {
  display: block;
  margin-bottom: 16px;
}

#cta .closing-cta-t {
  max-width: 16ch;
}

#cta .closing-cta-p {
  margin-top: 32px;
}

#cta .closing-cta-btns {
  margin-top: 40px;
}

#cta .closing-cta-alt {
  margin-top: 28px;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.5;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ash);
}

#cta .closing-cta-mail {
  color: var(--bone);
  text-transform: none;
  letter-spacing: 0.04em;
  font-size: 14px;
  padding-block: 14px; /* inline: no layout change, 44px tap target */
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 5px;
  text-decoration-color: var(--line);
  transition: color 0.3s var(--ease-std), text-decoration-color 0.3s var(--ease-std);
}

#cta .closing-cta-mail:hover {
  color: var(--accent);
  text-decoration-color: var(--accent);
}

@media (max-width: 479px) {
  #cta .closing-cta-btns .btn {
    width: 100%;
  }
}

/* ---------- Previous / next automation ---------- */

#footnav {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  margin-bottom: -1px; /* its bottom line and the footer's top line coincide */
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.5;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ash);
}

#footnav .closing-footnav-in {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 62px; /* 64px including the two hairlines */
}

#footnav .closing-footnav-prev {
  flex: none;
  min-height: 44px;
  white-space: nowrap;
}

#footnav .closing-footnav-count {
  flex: none;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

#footnav .closing-footnav-count b {
  font-weight: 400;
  color: var(--bone);
}

#footnav .closing-footnav-next {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  white-space: nowrap;
}

#footnav .closing-footnav-next-b {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

#footnav .closing-footnav-chip {
  padding: 4px 10px;
  font-size: 12px;
  color: var(--ash);
}

#footnav .closing-footnav-arrow-m {
  display: none;
}

/* Under 768px the bar keeps its three items on one line and drops the next
   automation's name (with its chip) to a second line. */
@media (max-width: 767px) {
  #footnav .closing-footnav-in {
    display: grid;
    grid-template-columns: auto 1fr auto;
    grid-template-rows: 62px auto;
    gap: 0 16px;
    min-height: 0;
  }

  #footnav .closing-footnav-count {
    justify-self: center;
  }

  #footnav .closing-footnav-next {
    display: contents;
  }

  #footnav .closing-footnav-next-k {
    justify-self: end;
  }

  #footnav .closing-footnav-colon,
  #footnav .closing-footnav-arrow-d {
    display: none;
  }

  #footnav .closing-footnav-arrow-m {
    display: inline;
  }

  #footnav .closing-footnav-next-b {
    grid-column: 1 / -1;
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px 12px;
    padding: 0 0 20px;
    margin-top: -8px;
    white-space: normal;
  }
}

@media (max-width: 479px) {
  #footnav .closing-footnav-next-name {
    font-size: 12px;
  }
}

/* ---------- Review fixes ---------- */

#deliverables .closing-check {
  color: var(--bone-70);
}

#deliverables .closing-deliv-lead {
  margin-top: 24px;
  max-width: 30ch;
}

/* The next automation is a real link now */
#footnav a.closing-footnav-next {
  color: var(--bone);
  transition: color 0.3s var(--ease-std);
}

#footnav a.closing-footnav-next:hover,
#footnav a.closing-footnav-next:hover .closing-footnav-next-name {
  color: var(--accent);
}
