/* Components: buttons, the Speedway wordmark, content grids, roles, forms, dialog, legal prose. */

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 48px;
  min-height: var(--touch);
  padding: 16px 20px;
  border: 1.5px solid var(--ink);
  border-radius: 0;
  background: var(--ink);
  color: var(--ground);
  font: 600 14px/1 var(--font);
  text-decoration: none;
  text-transform: uppercase;
  cursor: pointer;
}

.btn__arrow {
  transition: transform 0.15s ease;
}

.btn:hover .btn__arrow {
  transform: translate(2px, 2px);
}

.btn--line {
  background: transparent;
  color: var(--ink);
}

/* The Speedway wordmark: sliced once, lower half slipped forward. Screen readers get the plain word. */
.wordmark {
  margin-left: -0.04em;
}

/* Sized to the content width (container minus both gutters). "SPEEDWAY" is about 5.2em wide, including the cut's shift. */
.wordmark--slab {
  font-size: calc((min(100vw, var(--container)) - 2 * var(--gutter)) / 5.6);
}

.wordmark--hero {
  font-size: calc((min(100vw, var(--container)) - 2 * var(--gutter)) / 5.3);
}

.cut {
  --cut-y: 0.45em;
  --cut-gap: 0.012em;
  --cut-shift: 0.03em;

  position: relative;
  display: inline-block;
  color: transparent;
  white-space: nowrap;
}

.cut::before,
.cut::after {
  content: attr(data-text) / "";
  position: absolute;
  top: 0;
  left: 0;
  color: var(--ink);
}

.cut::before {
  clip-path: inset(0 0 calc(100% - var(--cut-y)) 0);
}

.cut::after {
  clip-path: inset(calc(var(--cut-y) + var(--cut-gap)) 0 0 0);
  transform: translateX(var(--cut-shift));
}

/* Content grids */
.cells {
  display: grid;
  grid-template-columns: 1fr;
  row-gap: 32px;
  border-top: 2px solid var(--ink);
}

.cells__item {
  display: grid;
  gap: 14px;
  align-content: start;
  padding: 24px 24px 0 0;
}

.cells__title {
  margin: 0;
  font-size: clamp(26px, 2.6vw, 40px);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.03em;
  text-wrap: balance;
}

.theme-charcoal .cells__title {
  color: var(--white);
}

.cells__text {
  max-width: 30ch;
  margin: 0;
  opacity: 0.85;
}

.cells--metrics .cells__title {
  font-size: clamp(28px, 3vw, 48px);
  line-height: 0.9;
  letter-spacing: -0.04em;
  text-transform: uppercase;
  overflow-wrap: anywhere;
}

/* Steps: Connect, Enrich, Distribute, Sell, Learn */
.steps {
  border-top: 2px solid var(--ink);
}

.steps__row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  align-items: baseline;
  padding-block: 20px;
  border-bottom: 1px solid var(--line);
}

.steps__title {
  margin: 0;
  color: var(--white);
  font-size: clamp(40px, 5.6vw, 96px);
  font-weight: 700;
  line-height: 0.9;
  letter-spacing: -0.045em;
  text-transform: uppercase;
}

.steps__text {
  max-width: 40ch;
  margin: 0;
}

/* Points: investors and careers */
.points {
  display: grid;
  grid-template-columns: 1fr;
  border-top: 1px solid var(--ink);
}

.points__item {
  display: grid;
  gap: 14px;
  align-content: start;
  padding: 28px 24px 0 0;
}

.points__item + .points__item {
  margin-top: 28px;
  border-top: 1px solid var(--line);
}

.points__title {
  margin: 0;
  font-size: clamp(26px, 2.6vw, 36px);
  font-weight: 600;
  line-height: 1.02;
  letter-spacing: -0.025em;
}

.points__text {
  max-width: 32ch;
  margin: 0;
  color: var(--muted);
}

/* Closing call to action */
.cta {
  display: grid;
  gap: 40px;
  padding-block: clamp(80px, 10vw, 144px);
  border-top: 2px solid var(--ink);
}

.cta .display {
  color: var(--white);
  font-size: clamp(64px, 12vw, 200px);
}

.cta__row {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
}

/* Roles */
.roles {
  border-top: 2px solid var(--ink);
}

.role {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  align-items: baseline;
  padding-block: 28px;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
}

.role__body {
  display: grid;
  gap: 16px;
}

.role__title {
  margin: 0;
  font-size: clamp(28px, 3vw, 48px);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.03em;
  text-wrap: balance;
}

.role__text {
  max-width: 54ch;
  margin: 0;
  color: var(--white);
}

.role__go {
  justify-self: start;
  padding-bottom: 2px;
  border-bottom: 1.5px solid var(--ink);
  font-size: 14px;
  font-weight: 600;
  text-transform: uppercase;
}

.role--link:hover .role__title {
  color: var(--white);
}

.tag {
  justify-self: start;
  padding: 6px 9px;
  border: 1px solid var(--muted);
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  white-space: nowrap;
}

.back {
  display: inline-flex;
  align-items: center;
  min-height: var(--touch);
  color: var(--muted);
}

.back:hover {
  color: var(--ink);
}

/* Email line */
.mail {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
}

.mail--spaced {
  margin-top: 48px;
}

.mail__link {
  display: inline-flex;
  align-items: center;
  min-height: var(--touch);
  font: 600 20px/1 var(--font);
  text-decoration: none;
  overflow-wrap: anywhere;
}

.mail__link:hover {
  color: var(--white);
}

.mail__link--large {
  color: var(--color-paper);
  font-size: 30px;
  letter-spacing: -0.02em;
}

.mail__link--large:hover {
  color: var(--ink);
}

/* Forms */
.form {
  display: grid;
  gap: 20px;
}

.form__field {
  display: grid;
  gap: 8px;
}

.form__label {
  font-size: 14px;
  font-weight: 500;
  text-transform: uppercase;
}

.form__required {
  color: var(--muted);
  text-transform: none;
}

.form__input {
  width: 100%;
  min-height: var(--touch);
  padding: 8px 0;
  border: 0;
  border-bottom: 1.5px solid var(--ink);
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  font: 400 16px/1.45 var(--font);
}

.form__input--area {
  min-height: 72px;
  resize: vertical;
}

.form__input:focus,
.form__input:focus-visible {
  outline: none;
  border-bottom-color: var(--color-white);
  box-shadow: 0 1.5px 0 var(--color-white);
}

/* Browsers paint autofilled fields pale blue. Cover it with the page colour so filled fields match the rest. */
.form__input:-webkit-autofill {
  -webkit-box-shadow: inset 0 0 0 100vmax var(--ground);
  box-shadow: inset 0 0 0 100vmax var(--ground);
  -webkit-text-fill-color: var(--ink);
  caret-color: var(--ink);
  transition: background-color 600000s 0s;
}

.form__input:-webkit-autofill:focus {
  -webkit-box-shadow: inset 0 0 0 100vmax var(--ground), 0 1.5px 0 var(--color-white);
  box-shadow: inset 0 0 0 100vmax var(--ground), 0 1.5px 0 var(--color-white);
}

.dialog .form__input:-webkit-autofill:focus,
.page-speedway .form__input:-webkit-autofill:focus {
  -webkit-box-shadow: inset 0 0 0 100vmax var(--ground), 0 1.5px 0 var(--color-charcoal);
  box-shadow: inset 0 0 0 100vmax var(--ground), 0 1.5px 0 var(--color-charcoal);
}

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

.form .btn {
  justify-self: start;
}

.form__note {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.form__note a {
  color: inherit;
}

/* Honeypot: hidden from people, visible to bots. */
.form__trap {
  position: absolute;
  left: -9999px;
}

/* Contact dialog: full screen on phones, a centred panel from 576px. */
.dialog {
  --ink: var(--color-charcoal);
  --ground: var(--color-blush);
  --muted: var(--color-muted-on-blush);
  --white: var(--color-charcoal);

  width: 100vw;
  max-width: none;
  height: 100dvh;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: var(--color-blush);
  color: var(--color-charcoal);
  overflow-y: auto;
}

.dialog::backdrop {
  background: var(--color-backdrop);
}

.dialog__inner {
  display: grid;
  gap: 16px;
  padding: 16px 24px 32px;
}

.dialog .form {
  gap: 12px;
}

.dialog .form__field {
  gap: 0;
}

.dialog__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-right: -12px;
}

.dialog__title {
  font-size: min(64px, calc((100vw - 48px) / 5.6));
}

@media (min-width: 576px) {
  .dialog {
    width: min(560px, calc(100vw - 32px));
    height: auto;
    max-height: calc(100dvh - 32px);
    margin: auto;
  }

  .dialog__inner {
    gap: 20px;
    padding: 24px 32px 32px;
  }

  .dialog .form {
    gap: 20px;
  }

  .dialog .form__field {
    gap: 8px;
  }
}

/* On blush, a white line is too faint to see, so focus uses charcoal there. */
.dialog .form__input:focus,
.dialog .form__input:focus-visible,
.page-speedway .form__input:focus,
.page-speedway .form__input:focus-visible {
  border-bottom-color: var(--color-charcoal);
  box-shadow: 0 1.5px 0 var(--color-charcoal);
}

.dialog__close {
  display: grid;
  place-items: center;
  width: var(--touch);
  height: var(--touch);
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
}

.dialog__x {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
}

/* Cookie consent banner: equal-weight Accept and Decline, fixed to the bottom. */
.consent {
  --ink: var(--color-blush);
  --ground: var(--color-charcoal);

  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 20;
  padding-bottom: env(safe-area-inset-bottom, 0px);
  border-top: 1px solid var(--color-blush);
  background: var(--color-charcoal);
  color: var(--color-blush);
}

.consent__inner {
  display: grid;
  gap: 16px;
  padding-block: 20px;
}

.consent__text {
  max-width: 70ch;
  margin: 0;
  font-size: 16px;
  line-height: 1.4;
}

.consent__text a {
  text-underline-offset: 3px;
}

.consent__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

/* Legal and simple text pages */
.prose {
  max-width: 70ch;
  padding-block: 48px 96px;
}

.prose h1 {
  margin: 0 0 32px;
  font-size: clamp(48px, 7.5vw, 128px);
}

.prose h2 {
  margin: 48px 0 12px;
  font-size: 24px;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.prose p,
.prose li {
  color: var(--white);
}

.prose a {
  text-underline-offset: 3px;
}

.prose .todo {
  padding: 0 4px;
  background: var(--ink);
  color: var(--ground);
}

.table-wrap {
  overflow-x: auto;
}

.prose table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
}

.prose th,
.prose td {
  padding: 10px 12px 10px 0;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

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

/* sm: 576px */
@media (min-width: 576px) {
  .steps__row {
    grid-template-columns: 120px minmax(0, 1.2fr) minmax(0, 1.4fr);
    gap: 24px;
  }

  .cells--2,
  .cells--3,
  .cells--4 {
    grid-template-columns: 1fr 1fr;
  }

  .cells__item:nth-child(even) {
    padding-left: 24px;
    border-left: 1px solid var(--line);
  }
}

/* md: 768px */
@media (min-width: 768px) {
  .consent__inner {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
  }

  .role {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 24px;
  }

  .role > .label {
    grid-column: 1;
  }

  .role__body {
    grid-column: 2 / span 2;
  }

  .role .tag,
  .role__go {
    grid-column: 4;
    justify-self: end;
  }
}

/* lg: 992px */
@media (min-width: 992px) {
  .cells {
    row-gap: 0;
  }

  .cells--3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .cells--4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .cells--3 .cells__item + .cells__item,
  .cells--4 .cells__item + .cells__item {
    padding-left: 24px;
    border-left: 1px solid var(--line);
  }

  .points {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .points__item + .points__item {
    margin-top: 0;
    padding-left: 24px;
    border-top: 0;
    border-left: 1px solid var(--line);
  }
}

/* Job spec pages: each section is a row, label on the left like Open roles. */
.spec {
  border-top: 2px solid var(--ink);
}

.spec__row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  align-items: start;
  padding-block: 32px;
  border-bottom: 1px solid var(--line);
}

.spec__body {
  display: grid;
  gap: 16px;
  max-width: 62ch;
  color: var(--white);
  font-size: 18px;
  line-height: 1.5;
}

.spec__body p,
.spec__body ul,
.spec__body ol {
  margin: 0;
}

.spec__body ul,
.spec__body ol {
  display: grid;
  gap: 8px;
  padding-left: 1.2em;
}

.spec__body strong {
  color: var(--ink);
  font-weight: 600;
}

.spec__label {
  align-content: start;
}

@media (min-width: 768px) {
  .spec__row {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 24px;
  }

  .spec__label {
    grid-column: 1;
  }

  .spec__body {
    grid-column: 2 / span 3;
  }
}

/* Speedway FAQ: questions and answers inside the spec rows. */
.faq {
  gap: 32px;
}

.faq__item {
  display: grid;
  gap: 8px;
}

.faq__q {
  margin: 0;
  color: var(--ink);
  font-size: 22px;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.01em;
}

.faq a {
  color: inherit;
}

/* Email addresses: with a mouse, a "Copy email" label follows the cursor (js/email.js). */
.cursor-tip {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 30;
  padding: 6px 8px;
  background: var(--ink);
  color: var(--ground);
  font: 600 12px/1 var(--font);
  text-transform: uppercase;
  white-space: nowrap;
  pointer-events: none;
}


/* Reversed-out text: each line sits on its own solid band, like a highlight. */
.highlight {
  padding: 0.06em 0.2em;
  background: var(--ink);
  color: var(--ground);
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}

/* The ACOMM Index (the-acomm-index/, built by tools/build_acomm_index.py) */
.index-lead {
  max-width: 52ch;
  margin: -32px 0 48px;
}

.index-cite {
  margin: 24px 0 0;
  font-size: 14px;
}

.index-quote {
  max-width: 40ch;
  margin: -32px 0 48px;
  color: var(--white);
  font-size: clamp(24px, 2.6vw, 40px);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.photo {
  margin: 0 0 64px;
}

.photo img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 70vh;
  object-fit: cover;
  filter: grayscale(100%) contrast(1.05);
}

.index-essay {
  padding-block: 0;
}

.index-essay h3 {
  margin: 48px 0 12px;
  font-size: 24px;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.tag--solid {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--ground);
}

/* Ranked list: each retailer opens to show its evidence. Works without JavaScript. */
.rank {
  margin: 0;
  padding: 0;
  border-top: 2px solid var(--ink);
  list-style: none;
}

.rank__item {
  border-bottom: 1px solid var(--line);
}

.rank__summary {
  display: grid;
  grid-template-columns: 44px 1fr auto;
  gap: 8px 16px;
  align-items: baseline;
  min-height: var(--touch);
  padding-block: 20px;
  cursor: pointer;
  list-style: none;
}

.rank__summary::-webkit-details-marker {
  display: none;
}

.rank__num {
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
}

.rank__name {
  font-size: clamp(24px, 2.6vw, 40px);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.03em;
  text-transform: uppercase;
}

.rank__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  grid-column: 2;
  grid-row: 2;
}

.rank__tags:empty {
  display: none;
}

.rank__score {
  grid-column: 3;
  grid-row: 1;
  font-size: clamp(32px, 3.6vw, 56px);
  font-weight: 700;
  line-height: 0.9;
  letter-spacing: -0.04em;
}

.rank__row[open] .rank__name,
.rank__summary:hover .rank__name {
  color: var(--white);
}

.rank__detail {
  display: grid;
  gap: 16px;
  padding: 0 0 28px 60px;
}

.rank__evidence {
  display: grid;
  gap: 8px;
  max-width: 62ch;
  margin: 0;
  padding-left: 1.2em;
  color: var(--white);
}

.rank__dims {
  color: var(--muted);
}

.steps--list .steps__title {
  font-size: clamp(22px, 2.2vw, 32px);
  line-height: 1.05;
}

.leaders {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.leaders li {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  max-width: 30ch;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}

@media (min-width: 768px) {
  .rank__summary {
    grid-template-columns: 60px minmax(0, 1fr) auto auto;
  }

  .rank__tags {
    grid-column: 3;
    grid-row: 1;
  }

  .rank__score {
    grid-column: 4;
    min-width: 2.2ch;
    text-align: right;
  }

  .rank__detail {
    padding-left: 76px;
  }
}
