/* One gap between sections. Padding on both sides of a seam had doubled it in places. */
main > * + * {
  margin-top: var(--gap);
}

.stage + * {
  margin-top: clamp(16px, 2vw, 32px);
}

.section__head {
  max-width: 760px;
  margin: 0 auto var(--head-gap);
  text-align: center;
}

.section__head h2 {
  margin-bottom: 16px;
  font-size: var(--t-h2);
}

.section__head p {
  color: var(--muted);
  font-size: var(--t-lead);
}

.words__pair {
  display: flex;
  justify-content: center;
  gap: 0 0.25em;
  font-size: clamp(54px, 17vw, 240px);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1;
}

.band {
  max-width: 1200px;
  margin: clamp(48px, 6vw, 80px) auto 0;
  padding-inline: var(--margin);
}

.band img {
  aspect-ratio: 8 / 3;
  border-radius: var(--radius);
}

.table-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

th,
td {
  padding: 18px 20px;
  text-align: left;
  vertical-align: top;
  font-size: var(--t-body);
  font-weight: 400;
  border-bottom: 1px solid var(--line);
}

tr:last-child th,
tr:last-child td {
  border-bottom: 0;
}

thead th {
  background: var(--soft);
  font-weight: 600;
}

tbody th {
  font-weight: 600;
}

thead th.featured,
.featured {
  background: var(--ruby-100);
  color: var(--ruby-700);
  font-weight: 600;
}

.steps__list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

/* Subgrid keeps every card's text on one line, even when only some titles wrap. */
.steps__list li {
  display: grid;
  grid-row: span 2;
  grid-template-rows: subgrid;
  row-gap: 12px;
  padding: 28px;
  border-radius: var(--radius);
  background: var(--soft);
}

.steps__list h3 {
  font-size: var(--t-title);
}

.steps__list p {
  color: var(--muted);
}

.steps__list li:last-child {
  background: var(--ruby-600);
  color: var(--on-ruby);
}

.steps__list li:last-child p {
  color: inherit;
}

.stone {
  display: grid;
  grid-template-columns: 7fr 5fr;
  gap: 24px;
}

.stone img {
  border-radius: var(--radius);
}

/* The big picture stretches so both columns end on the same line. */
.stone__big {
  display: flex;
  flex-direction: column;
}

.stone__big img {
  flex: 1 1 0;
  min-height: 0;
}

.stone__side {
  display: grid;
  gap: 24px;
}

.stone__side img {
  height: auto;
}

/* Cropped to keep the stone and lose the temple and sky at its edges. */
.stone__side figure:last-child img {
  aspect-ratio: 3 / 2;
  object-position: 35% 50%;
}

.faq {
  max-width: 820px;
  margin-inline: auto;
}

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

.faq summary {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  padding-block: 20px;
  font-size: var(--t-lead);
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}

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

.faq summary::after {
  content: "+";
  color: var(--ruby-600);
  transition: transform 240ms var(--ease);
}

.faq details[open] summary::after {
  transform: rotate(45deg);
}

.faq details p {
  padding-bottom: 20px;
  color: var(--muted);
}

.close {
  position: relative;
  padding-block: clamp(96px, 12vw, 160px);
  padding-inline: var(--margin);
  border-radius: 28px;
  background: var(--ruby-600);
  color: var(--on-ruby);
  overflow: hidden;
  text-align: center;
}

.close__body {
  position: relative;
}

.close h2 {
  margin-bottom: 16px;
  font-size: var(--t-display);
}

.close p {
  margin-bottom: 32px;
  font-size: var(--t-lead);
}

@media (max-width: 900px) {
  .steps__list {
    grid-template-columns: 1fr 1fr;
  }

}

@media (max-width: 760px) {
  /* Long centred paragraphs read badly on a phone, so text starts from one edge. */
  .section__head {
    max-width: none;
    text-align: left;
  }

  .stone {
    grid-template-columns: 1fr;
  }

  /* One column has nothing to line up with. Without auto height the picture fills its figure and pushes the caption out. */
  .stone__big {
    display: block;
  }

  .stone__big img {
    height: auto;
    aspect-ratio: 4 / 3;
  }

  .band img {
    aspect-ratio: 3 / 2;
  }

  .steps__list {
    grid-template-columns: 1fr;
  }

  /* Each row becomes a block, so nothing needs sideways scrolling. */
  table,
  tbody,
  tr,
  th,
  td {
    display: block;
    width: 100%;
  }

  thead {
    display: none;
  }

  tbody tr {
    padding: 16px;
    border-bottom: 1px solid var(--line);
  }

  tbody tr:last-child {
    border-bottom: 0;
  }

  tbody th,
  td {
    padding: 4px 0;
    border: 0;
  }

  tbody th {
    margin-bottom: 8px;
    font-size: var(--t-lead);
  }

  td.featured {
    margin-block: 4px 8px;
    padding: 8px 12px;
    border-radius: 10px;
  }

  td:nth-of-type(1)::before {
    content: "Ardam: ";
  }

  td:nth-of-type(2)::before {
    content: "Chatbot: ";
    font-weight: 600;
  }

  td:nth-of-type(3)::before {
    content: "Translator: ";
    font-weight: 600;
  }
}
