/* Inner pages: How it works, Models, About, Questions, API, Contact and the legal pages. */

/* Small grey line with the technical name, for readers who want it */
.tech {
  color: var(--ink-3);
  font-size: var(--t-small);
}

/* A numbered list of steps, each in its own card */
.step-list {
  display: grid;
  gap: var(--s4);
  max-width: 56rem;
  margin-inline: auto;
  padding: 0;
  list-style: none;
}

.step-list > li {
  grid-template-columns: auto minmax(0, 1fr) minmax(0, 0.6fr);
  align-items: start;
  gap: var(--s5);
}

.step-list > li > div {
  display: grid;
  gap: var(--s2);
}

.step-list .card__num {
  margin-bottom: 0;
}

.step-list .tech {
  padding-top: var(--s1);
}

@media (max-width: 48rem) {
  .step-list > li {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .step-list > li > p {
    grid-column: 2;
  }
}

/* Tables inside a card */
.table-card {
  gap: var(--s4);
}

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

.spec-table {
  width: 100%;
  min-width: 34rem;
  border-collapse: collapse;
}

.spec-table th,
.spec-table td {
  padding: var(--s3) var(--s4) var(--s3) 0;
  border-bottom: 1px solid var(--rule);
  text-align: left;
  vertical-align: top;
}

.spec-table thead th {
  color: var(--ink-3);
  font-size: var(--t-small);
  font-weight: 600;
}

.spec-table tbody th {
  font-weight: 620;
}

.spec-table td {
  color: var(--ink-2);
}

.spec-table tbody tr:last-child > * {
  border-bottom: 0;
}

/* Benchmark status lists */
.bench {
  display: grid;
  padding: 0;
  list-style: none;
}

.bench li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s3);
  padding-block: var(--s3);
  border-bottom: 1px solid var(--rule);
}

.bench li:last-child {
  border-bottom: 0;
}

.bench span:first-child {
  color: var(--ink-2);
}

.status {
  display: inline-flex;
  align-items: center;
  gap: var(--s2);
  color: var(--ink-3);
  font-size: var(--t-small);
}

.status::before {
  width: 0.5rem;
  height: 0.5rem;
  border: 1.5px solid currentColor;
  border-radius: 50%;
  content: "";
}

/* Benchmark results */
.bench__model {
  display: grid;
  flex-shrink: 0;
  gap: 0.125rem;
}

.bench__model small {
  color: var(--ink-3);
  font-size: var(--t-small);
}

.bench__score {
  color: var(--ink);
  font-size: var(--t-small);
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.bench__ours .bench__model strong,
.bench__ours .bench__score {
  color: var(--accent);
}

/* Model cards */
.model-card h2 {
  font-size: 1.25rem;
}

.model-card__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s3);
}

.model-card__top .card__icon {
  margin-bottom: 0;
}

.badge {
  display: inline-flex;
  padding: var(--s1) var(--s3);
  border-radius: var(--r-pill);
  color: var(--plum);
  background: var(--plum-wash);
  font-size: var(--t-small);
  font-weight: 680;
}

.model-card dl {
  display: grid;
  gap: var(--s3);
  margin-top: var(--s2);
}

.model-card dt {
  color: var(--ink);
  font-size: var(--t-small);
  font-weight: 640;
}

.model-card dd {
  color: var(--ink-2);
}

/* Dark figure for the 3D renders (About) */
.figure-band {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--s4);
  padding: var(--s5);
  border-radius: var(--r-lg);
}

.figure-band figure {
  display: grid;
  gap: var(--s3);
}

.figure-band img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
}

.figure-band figcaption {
  color: var(--screen-ink-2);
  font-size: var(--t-small);
  text-align: center;
}

.cols > div > .lead + .lead {
  margin-top: calc(-1 * var(--s1));
}

/* Team */
.team-card {
  justify-items: center;
  text-align: center;
}

.avatar {
  display: inline-grid;
  width: 4rem;
  height: 4rem;
  place-items: center;
  margin-bottom: var(--s2);
  border-radius: 50%;
  color: var(--on-plum);
  background: linear-gradient(135deg, var(--plum), var(--plum-strong));
  font-size: 1.125rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.avatar--photo {
  width: 8.5rem;
  height: 8.5rem;
  margin-bottom: var(--s3);
  overflow: hidden;
  padding: 4px;
  background: var(--plum-wash);
  box-shadow: inset 0 0 0 2px var(--plum);
}

.avatar--photo img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

/* Questions */
.faq {
  display: grid;
  gap: var(--gap);
  max-width: 52rem;
}

.faq__group > h2 {
  display: flex;
  align-items: center;
  gap: var(--s3);
  font-size: 1.25rem;
}

.faq__group > h2 .card__icon {
  margin-bottom: 0;
}

.faq__items details {
  border-bottom: 1px solid var(--rule);
}

.faq__items details:last-child {
  border-bottom: 0;
}

.faq__items summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s4);
  padding-block: var(--s4);
  font-weight: 620;
  list-style: none;
  cursor: pointer;
}

.faq__items summary:hover {
  color: var(--plum);
}

.faq__items summary::-webkit-details-marker {
  display: none;
}

.faq__items summary::after {
  width: 0.55rem;
  height: 0.55rem;
  flex: 0 0 auto;
  border-right: 2px solid var(--ink-3);
  border-bottom: 2px solid var(--ink-3);
  content: "";
  transform: translateY(-25%) rotate(45deg);
  transition: transform 160ms var(--ease);
}

.faq__items details[open] summary::after {
  transform: translateY(25%) rotate(-135deg);
}

.faq__items details > div {
  display: grid;
  gap: var(--s3);
  padding-bottom: var(--s4);
  color: var(--ink-2);
}

/* API */
.code {
  overflow: hidden;
  border-radius: var(--r-lg);
}

.code__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s3);
  padding: var(--s3) var(--s4);
  border-bottom: 1px solid var(--screen-rule);
  color: var(--screen-ink-2);
  font-size: var(--t-small);
}

.code__head button {
  display: inline-flex;
  align-items: center;
  gap: var(--s2);
  padding: var(--s1) var(--s3);
  border: 1px solid var(--screen-rule);
  border-radius: var(--r-sm);
  color: var(--screen-ink);
  background: transparent;
  font-size: var(--t-small);
}

.code pre {
  margin: 0;
  padding: var(--s4);
  overflow-x: auto;
  font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
  font-size: 0.875rem;
  line-height: 1.6;
}

code {
  font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
  font-size: 0.875em;
}

.endpoint {
  display: inline-block;
  padding: var(--s1) var(--s2);
  border-radius: 6px;
  color: var(--plum);
  background: var(--plum-wash);
  white-space: nowrap;
}

/* Contact */
.card-label {
  color: var(--ink-3);
  font-size: var(--t-small);
  font-weight: 600;
  letter-spacing: 0;
  line-height: 1.4;
}

.card .big {
  color: var(--ink);
  font-size: 1.25rem;
  font-weight: 680;
  overflow-wrap: anywhere;
}

.link-card {
  text-decoration: none;
  transition: border-color 160ms var(--ease), transform 160ms var(--ease);
}

.link-card:hover {
  border-color: var(--plum);
  transform: translateY(-2px);
}

.link-card:hover h3 {
  color: var(--plum);
}

/* Legal pages: a contents list beside the text */
.legal {
  display: grid;
  grid-template-columns: minmax(11rem, 0.32fr) minmax(0, 1fr);
  gap: var(--s7);
  align-items: start;
}

.legal__toc {
  position: sticky;
  top: calc(var(--header-h) + var(--s5));
  display: grid;
  gap: var(--s3);
  font-size: var(--t-small);
}

.legal__toc h2 {
  font-size: var(--t-small);
  font-weight: 680;
  letter-spacing: 0;
}

.legal__toc ol {
  display: grid;
  gap: var(--s2);
  padding-left: var(--s5);
  color: var(--ink-3);
}

.legal__toc a {
  color: var(--ink-2);
  text-decoration: none;
}

.legal__toc a:hover {
  color: var(--plum);
  text-decoration: underline;
}

.prose {
  gap: var(--s6);
  max-width: 46rem;
}

.prose section {
  display: grid;
  gap: var(--s3);
  scroll-margin-top: calc(var(--header-h) + var(--s5));
}

.prose h2 {
  font-size: 1.25rem;
}

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

.prose ul {
  display: grid;
  gap: var(--s2);
  padding-left: var(--s5);
}

.prose a {
  color: var(--plum);
}

@media (max-width: 48rem) {
  .legal {
    grid-template-columns: 1fr;
    gap: var(--s6);
  }

  .legal__toc {
    position: static;
  }
}

/* About: how a detector reads a face, in three steps from a real clip */
.why-steps {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr;
  gap: var(--s3);
  align-items: start;
  align-self: center;
  padding: var(--s5);
  border-radius: var(--r-lg);
}

.why-step {
  display: grid;
  gap: var(--s2);
  min-width: 0;
  margin: 0;
}

.why-step__media {
  position: relative;
  display: block;
  overflow: hidden;
  aspect-ratio: 1 / 1;
  border-radius: var(--r-sm);
}

.why-step--frame .why-step__media {
  aspect-ratio: 16 / 10;
}

.why-step__media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* The box sits where the detector found the face in why-frame.webp */
.why-step__box {
  position: absolute;
  left: 40%;
  top: 34%;
  width: 25%;
  height: 42%;
  border: 2px solid #f08ad8;
  border-radius: 0.375rem;
  box-shadow: 0 0 0 999px rgba(0, 0, 0, 0.28);
}

.why-step figcaption {
  display: flex;
  align-items: flex-start;
  gap: var(--s2);
  color: var(--screen-ink-2);
  font-size: var(--t-small);
  line-height: 1.3;
}

.why-step__num {
  flex: 0 0 auto;
  display: inline-grid;
  place-items: center;
  width: 1.25rem;
  height: 1.25rem;
  border-radius: 50%;
  background: #8f4fa0;
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
}

.why-steps__note {
  grid-column: 1 / -1;
  margin: var(--s1) 0 0;
  color: var(--screen-ink-2);
  font-size: 0.78rem;
  opacity: 0.8;
}

@media (max-width: 40rem) {
  .why-steps {
    grid-template-columns: 1fr 1fr;
    padding: var(--s4);
  }

  .why-step--frame {
    grid-column: 1 / -1;
  }
}

/* Benchmarks (Models): the result cards slide sideways, with arrows and dots, the next card peeking in */
.carousel-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: var(--s4) var(--s6);
  align-items: end;
  margin-bottom: var(--s5);
}

.carousel-head .section-head {
  margin-bottom: 0;
}

.carousel-arrows {
  display: flex;
  gap: var(--s2);
}

.carousel-arrow {
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 50%;
}

.carousel-arrow:disabled {
  cursor: default;
  opacity: 0.35;
}

.carousel__track {
  --carousel-gap: var(--gap);
  --carousel-show: 2.6;
  display: grid;
  grid-auto-columns: calc((100% - (var(--carousel-show) - 1) * var(--carousel-gap)) / var(--carousel-show));
  grid-auto-flow: column;
  gap: var(--carousel-gap);
  margin: calc(-1 * var(--s2));
  padding: var(--s2);
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-padding-inline: var(--s2);
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}

.carousel__track::-webkit-scrollbar {
  display: none;
}

.carousel__track:focus-visible {
  outline: 3px solid var(--plum);
  outline-offset: 2px;
  border-radius: var(--r-lg);
}

/* A soft fade on the edge that still has more cards behind it */
.carousel__track.has-more-end {
  mask-image: linear-gradient(90deg, #000 calc(100% - 4rem), transparent);
}

.carousel__track.has-more-start.has-more-end {
  mask-image: linear-gradient(90deg, transparent, #000 3rem, #000 calc(100% - 4rem), transparent);
}

.carousel__track.has-more-start:not(.has-more-end) {
  mask-image: linear-gradient(90deg, transparent, #000 3rem);
}

.carousel__track > .card {
  align-content: start;
  scroll-snap-align: start;
}

.carousel__eyebrow {
  color: var(--plum);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.carousel__track > .card .carousel__eyebrow + h3 {
  margin-top: calc(-1 * var(--s3));
}

.carousel__dots {
  display: flex;
  justify-content: center;
  gap: var(--s2);
  margin-top: var(--s4);
}

.carousel__dots:empty {
  display: none;
}

.carousel__dots button {
  width: 0.5rem;
  height: 0.5rem;
  padding: 0;
  border: 0;
  border-radius: var(--r-pill);
  background: var(--rule);
  cursor: pointer;
  transition: width 0.2s ease, background-color 0.2s ease;
}

.carousel__dots button[aria-current="true"] {
  width: 1.5rem;
  background: var(--plum);
}

.carousel__dots button:focus-visible {
  outline: 3px solid var(--plum);
  outline-offset: 3px;
}

@media (max-width: 62rem) {
  .carousel__track {
    --carousel-show: 1.6;
  }
}

@media (max-width: 40rem) {
  .carousel-head {
    grid-template-columns: 1fr;
  }

  .carousel-arrows {
    justify-self: end;
  }

  .carousel__track {
    --carousel-show: 1.12;
  }
}

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

/* Models: the four detectors side by side in one table */
.det-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--rule);
  border-radius: var(--r-lg);
  background: var(--sheet);
  box-shadow: var(--shadow);
}

.det-table {
  width: 100%;
  min-width: 46rem;
  border-collapse: collapse;
}

.det-table th,
.det-table td {
  padding: var(--s4) var(--s5);
  border-bottom: 1px solid var(--rule);
  text-align: left;
  vertical-align: top;
  line-height: 1.5;
}

.det-table tbody tr:last-child > * {
  border-bottom: 0;
}

.det-table thead > tr > * {
  background: var(--tint);
  vertical-align: middle;
}

.det-name {
  display: inline-flex;
  align-items: center;
  gap: var(--s3);
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 1.125rem;
  font-weight: 700;
}

.det-name .card__icon {
  flex: 0 0 auto;
  margin: 0;
}

.det-table tbody th {
  width: 11rem;
  color: var(--ink-3);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.det-table td {
  color: var(--ink-2);
  font-size: 0.95rem;
}

.det-set {
  display: inline-block;
  padding: 0.125rem 0.6rem;
  border-radius: var(--r-pill);
  background: var(--plum-wash);
  color: var(--plum);
  font-size: 0.82rem;
  font-weight: 700;
}

.det-table td small {
  display: block;
  margin-top: var(--s1);
  color: var(--ink-3);
  font-size: 0.8rem;
}

/* Models: one results table per card in the carousel */
.bench-table {
  width: 100%;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
}

.bench-table th,
.bench-table td {
  padding: var(--s3) var(--s2);
  border-bottom: 1px solid var(--rule);
  text-align: right;
  font-size: 0.92rem;
  white-space: nowrap;
}

.bench-table th:first-child {
  padding-left: var(--s3);
  text-align: left;
  white-space: normal;
}

.bench-table td:last-child,
.bench-table th:last-child {
  padding-right: var(--s3);
}

.bench-table thead th {
  color: var(--ink-3);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.bench-table tbody tr:last-child > * {
  border-bottom: 0;
}

.bench-table tbody th {
  color: var(--ink);
  font-weight: 600;
}

.bench-table tbody th small {
  display: block;
  color: var(--ink-3);
  font-size: 0.78rem;
  font-weight: 400;
}

.bench-table td {
  color: var(--ink-2);
}

.bench-table td.na {
  color: var(--ink-3);
}

.bench-table .is-ours > * {
  color: var(--plum);
  font-weight: 700;
  background: var(--tint);
}

.bench-table .is-ours > :first-child {
  border-radius: var(--r-sm) 0 0 var(--r-sm);
}

.bench-table .is-ours > :last-child {
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
}

.bench-table .is-ours small {
  color: color-mix(in srgb, var(--plum) 70%, var(--ink-3));
}

/* Two result tables in view on wide screens, the next one peeking in */
.carousel__track {
  --carousel-show: 2.15;
}

@media (max-width: 62rem) {
  .carousel__track {
    --carousel-show: 1.25;
  }
}

@media (max-width: 40rem) {
  .carousel__track {
    --carousel-show: 1.06;
  }

  .bench-table th,
  .bench-table td {
    padding-inline: var(--s1);
    font-size: 0.85rem;
  }
}

.det-name {
  white-space: nowrap;
}

/* On phones the table scrolls sideways; the row names stay pinned on the left */
@media (max-width: 40rem) {
  .det-table th,
  .det-table td {
    padding: var(--s3) var(--s4);
  }

  .det-table tbody th,
  .det-table thead td {
    position: sticky;
    left: 0;
    z-index: 1;
    width: 6.5rem;
    background: var(--sheet);
    box-shadow: 1px 0 0 var(--rule);
  }

  .det-table thead td {
    background: var(--tint);
  }
}
