/* Home page. Layout, top to bottom: nav, split hero (words left, a live card in a phone right),
   feature tiles, three steps, the plan, questions, closing call. One column under 56rem. */
main {
  overflow-x: clip; /* the hero panel runs off the right edge on purpose */
}

.nav-in {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  height: 4.25rem;
}

.nav-links {
  display: none;
  gap: 2rem;
  font-weight: 500;
}

.nav-links a {
  color: var(--muted);
  text-decoration: none;
  transition: color 0.15s;
}

.nav-links a:hover {
  color: var(--ink);
}

@media (min-width: 56rem) {
  .nav-links {
    display: flex;
  }
}

/* On a phone the mark stays and the name gives its place to the switches and the button (still read aloud) */
@media (max-width: 30rem) {
  .nav-in {
    gap: 0.5rem;
  }

  .nav .brand {
    gap: 0;
    font-size: 0;
  }
}

/* Hero */
.hero {
  display: grid;
  gap: 3rem;
  padding-block: 2rem 4rem;
}

.hero h1 {
  font-size: clamp(2.5rem, 2.9vw + 1.25rem, 3.5rem);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.04em;
  text-wrap: balance;
}

.hero-lede {
  max-width: 31rem;
  margin-top: 1.25rem;
  color: var(--muted);
  font-size: 1.1875rem;
  line-height: 1.5;
  text-wrap: pretty;
}

.start {
  max-width: 31rem;
  margin: 2rem 0 1.25rem;
}

.start-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.start-row .input {
  flex: 1 1 12rem;
  min-height: 3.5rem;
  border-radius: 999px;
  padding-inline: 1.25rem;
}

.start-row .btn {
  flex: 1 0 auto;
  min-height: 3.5rem;
}

.hero-visual {
  position: relative;
  display: grid;
  place-items: center;
  padding-block: 2rem;
}

.hero-visual::before {
  content: "";
  position: absolute;
  inset: 0 -50vw 0 -50vw;
  z-index: -1;
  background: var(--tint);
}

#hero-card {
  transition: opacity 0.25s;
}

#hero-card.is-swapping {
  opacity: 0;
}

.hero-qr {
  position: absolute;
  bottom: 1rem;
  left: max(0rem, 50% - 13.5rem);
  width: 7rem;
  margin: 0;
  padding: 0.625rem 0.625rem 0.5rem;
  border-radius: var(--r-panel);
  background: #fff;
  box-shadow: var(--shadow);
  color: #0d0f15;
  rotate: -5deg;
}

.hero-qr figcaption {
  margin-top: 0.25rem;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.25;
  text-align: center;
  text-wrap: balance;
}

.qr svg {
  display: block;
  width: 100%;
  height: auto;
  fill: #000;
}

@media (min-width: 56rem) {
  .hero {
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr);
    align-items: center;
    min-height: calc(100dvh - 4.25rem);
    padding-block: 1rem 3rem;
  }

  .hero-visual {
    align-self: stretch;
    padding-block: 2.5rem;
  }

  .hero-visual::before {
    inset: 0 -50vw 0 14%;
    border-radius: 2rem 0 0 2rem;
  }

  .hero-qr {
    bottom: 12%;
    left: -1.5rem;
    width: 9.5rem;
  }

  /* The whole phone stays in view on a short laptop screen */
  .hero .phone {
    width: min(100%, 19.5rem, max(15.5rem, (100dvh - 13.5rem) * 0.4865));
  }
}

/* Sections */
.section {
  padding-block: clamp(4rem, 9vw, 7.5rem) 0;
}

.h2 {
  max-width: 20ch;
  font-size: clamp(1.875rem, 2.4vw + 1rem, 3rem);
  font-weight: 700;
  line-height: 1.06;
  letter-spacing: -0.035em;
  text-wrap: balance;
}

h3 {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

/* Feature tiles: five tiles, five contents */
.bento {
  display: grid;
  gap: 1rem;
  margin-top: 2.5rem;
}

.cell {
  display: grid;
  align-content: space-between;
  gap: 1.5rem;
  min-width: 0;
  padding: 1.75rem;
  overflow: hidden;
  border-radius: var(--r-panel);
  background: var(--surface);
}

.cell p {
  max-width: 34ch;
  margin-top: 0.5rem;
  color: var(--muted);
  text-wrap: pretty;
}

/* The example card in a tile keeps its own text colour, picked for the card colour */
.cell .cv p {
  color: inherit;
}

/* The one dark tile. In dark mode it becomes a normal surface so it still stands out from the page */
.cell-qr {
  background: #0d0f15;
  color: #f6f6f8;
}

:root[data-theme="dark"] .cell-qr {
  background: var(--surface);
}

.cell-qr p {
  color: inherit;
  opacity: 0.72;
}

/* A printed card with the code on it: what the person hands out */
.print {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 40%;
  align-items: end;
  gap: 1rem;
  justify-self: center;
  width: min(100%, 23rem);
  aspect-ratio: 85 / 55;
  padding: 1.25rem;
  border-radius: 0.875rem;
  background: #fdfdfe;
  box-shadow: 0 22px 40px -20px rgb(0 0 0 / 0.6);
  color: #0d0f15;
  rotate: -3deg;
}

.print b {
  display: block;
  font-size: 1.125rem;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.print span {
  display: block;
  margin-top: 0.25rem;
  color: #5b6172;
  font-size: 0.8125rem;
  line-height: 1.3;
}

.print .qr {
  align-self: center;
}

/* Outside a phone the rows sit on the page: in dark mode their colours would be too dim */
:root[data-theme="dark"] .cell-rows .cv-rows li {
  --row: var(--ink);
}

.cell-rows .cv,
.cell-color .cv {
  align-self: center;
}

.cell-rows .cv-face,
.cell-color .cv-rows {
  display: none;
}

.cell-rows .cv-rows {
  margin: 0;
}

.cell-rows .cv-rows a {
  background: var(--bg);
  box-shadow: none;
}

.cell-edit {
  background: var(--tint);
}

.cell .edit-demo {
  display: grid;
  gap: 0.125rem;
  margin: 0;
  font-size: 1.5rem;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}

.edit-demo s {
  font-size: 1.125rem;
  text-decoration-thickness: 1.5px;
}

.edit-demo b {
  color: var(--ink);
  font-weight: 700;
}

.cell-save {
  background: var(--accent);
  color: #fff;
}

.cell-save .icon {
  width: 2.75rem;
  height: 2.75rem;
}

.cell-save p {
  color: inherit;
  opacity: 0.85;
}

.cell-color {
  padding-bottom: 0;
}

.cell-color > :first-child {
  padding-bottom: 1.75rem;
}

.cell-color .cv {
  align-self: end;
  width: min(100%, 20rem);
  justify-self: center;
}

.cell-color .cv-face {
  margin: 0;
  padding: 1.5rem 1.25rem;
  border-radius: 1.5rem 1.5rem 0 0;
}

.cell-color .cv-avatar {
  width: 5rem;
  font-size: 1.75rem;
}

.cell-color .cv-actions {
  display: none;
}

.swatches {
  display: flex;
  flex-wrap: wrap;
  gap: 0.625rem;
  margin-top: 1.25rem;
}

.swatch {
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  border: 3px solid var(--surface);
  border-radius: 50%;
  outline: 1.5px solid var(--line);
  cursor: pointer;
  transition: transform 0.15s var(--ease);
}

.swatch[aria-pressed="true"] {
  outline: 2px solid var(--ink);
}

.swatch:active {
  transform: scale(0.94);
}

@media (min-width: 56rem) {
  .bento {
    grid-template-columns: repeat(12, minmax(0, 1fr));
  }

  .cell-qr {
    grid-column: span 5;
  }

  .cell-rows {
    grid-column: span 7;
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
    align-items: center;
  }

  .cell-edit {
    grid-column: span 4;
  }

  .cell-save {
    grid-column: span 3;
  }

  .cell-color {
    grid-column: span 5;
  }
}

/* Three steps: the title stays put while the steps scroll past */
.how-steps {
  display: grid;
  gap: 2.5rem;
  margin: 2.5rem 0 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
}

.how-steps li {
  display: grid;
  grid-template-columns: 3.5rem minmax(0, 1fr);
  counter-increment: step;
}

.how-steps li::before {
  content: counter(step);
  grid-row: span 2;
  color: var(--accent-text);
  font-size: 2.5rem;
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1;
}

.how-steps h3 {
  font-size: 1.5rem;
}

.how-steps p {
  max-width: 44ch;
  margin-top: 0.5rem;
  color: var(--muted);
  font-size: 1.0625rem;
}

@media (min-width: 56rem) {
  .how {
    display: grid;
    grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
    align-items: start;
    gap: 2rem;
  }

  .how .h2 {
    position: sticky;
    top: 6rem;
  }

  .how-steps {
    gap: 4rem;
    margin-top: 0.5rem;
  }
}

/* One plan: the price on the left, everything it includes on the right */
.plan {
  display: grid;
  gap: 2rem;
  margin-top: 2.5rem;
  padding: 2rem;
  border-radius: var(--r-panel);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.plan-price {
  display: grid;
  align-content: start;
  justify-items: start;
  gap: 0.5rem;
}

.was {
  margin-top: 0.75rem;
  color: var(--muted);
  font-weight: 500;
}

.was s {
  text-decoration-thickness: 1.5px;
}

.price {
  font-size: 4rem;
  font-weight: 700;
  letter-spacing: -0.05em;
  line-height: 1;
}

.price small {
  color: var(--muted);
  font-size: 1.125rem;
  font-weight: 500;
  letter-spacing: 0;
}

.plan-note {
  color: var(--muted);
}

.plan .btn {
  margin-top: 1rem;
}

.ticks {
  display: grid;
  gap: 0.875rem 2rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.ticks li {
  display: flex;
  gap: 0.75rem;
  font-weight: 500;
}

.ticks .icon {
  margin-top: 0.125rem;
  color: var(--accent-text);
}

@media (min-width: 56rem) {
  .plan {
    grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
    align-items: center;
    padding: 2.5rem;
  }

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

/* Questions */
.faq-list {
  max-width: 46rem;
  margin-top: 2rem;
}

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

.faq-list summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.25rem 0;
  font-size: 1.125rem;
  font-weight: 600;
  list-style: none;
  cursor: pointer;
}

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

.faq-list summary::after {
  content: "+";
  flex: none;
  color: var(--muted);
  font-size: 1.5rem;
  font-weight: 400;
  line-height: 1;
  transition: rotate 0.2s var(--ease);
}

.faq-list details[open] summary::after {
  rotate: 45deg;
}

.faq-list details p {
  max-width: 60ch;
  padding-bottom: 1.25rem;
  color: var(--muted);
}

/* Closing call */
.closing {
  display: grid;
  justify-items: start;
  gap: 1.75rem;
  margin-top: clamp(4rem, 9vw, 7.5rem);
  padding: clamp(2rem, 6vw, 4.5rem);
  border-radius: 2rem;
  background: var(--tint);
}

.btn-lg {
  min-height: 3.5rem;
  padding-inline: 1.75rem;
  font-size: 1.0625rem;
}

@media (min-width: 56rem) {
  .closing {
    grid-template-columns: 1fr auto;
    align-items: center;
  }
}

/* Motion: the hero rises once on load, sections rise as they scroll into view.
   Both are skipped for people who ask for less motion, and the scroll one needs a browser that has it. */
@media (prefers-reduced-motion: no-preference) {
  .hero-copy > *,
  .hero-visual > * {
    animation: rise 0.7s var(--ease) both;
  }

  .hero-copy > :nth-child(2) {
    animation-delay: 0.06s;
  }

  .hero-copy > :nth-child(n + 3),
  .hero-visual > .phone {
    animation-delay: 0.12s;
  }

  .hero-visual > .hero-qr {
    animation-delay: 0.3s;
  }

  @supports (animation-timeline: view()) {
    .reveal {
      animation: rise linear both;
      animation-timeline: view();
      animation-range: entry 0% entry 45%;
    }
  }
}

/* The six products: each tile is one link */
.tools {
  display: grid;
  gap: 1rem;
  margin-top: 2.5rem;
}

.tools-note {
  max-width: 44ch;
  margin-top: 1rem;
  color: var(--muted);
  font-size: 1.0625rem;
}

.tool {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  align-content: start;
  gap: 1rem;
  padding: 1.25rem 1.5rem;
  border-radius: var(--r-panel);
  background: var(--surface);
  text-decoration: none;
  transition: box-shadow 0.15s;
}

.tool .icon {
  width: 1.75rem;
  height: 1.75rem;
  color: var(--accent-text);
}

.tool p {
  margin-top: 0.25rem;
  color: var(--muted);
}

@media (hover: hover) {
  .tool:hover {
    box-shadow: var(--shadow);
  }
}

@media (min-width: 40rem) {
  .tools {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* In two columns an odd last tile takes its whole row, not half of it. */
@media (min-width: 40rem) and (max-width: 63.99rem) {
  .tool:last-child:nth-child(odd) {
    grid-column: 1 / -1;
  }
}

@media (min-width: 64rem) {
  .tools {
    grid-template-columns: repeat(3, minmax(0, 1fr)); /* six tiles: two rows of three */
  }

  .tool {
    grid-template-columns: minmax(0, 1fr);
    padding: 1.5rem;
  }
}
