html[data-tier]:not([data-tier="0"]) .tr0,
html:not([data-tier="1"]) .tr1,
html:not([data-tier="2"]) .tr2,
html:not([data-tier="3"]) .tr3,
html:not([data-tier="4"]) .tr4,
html:not([data-tier="5"]) .tr5,
html:not([data-tier="6"]) .tr6 { display: none; }

#hero {
  text-align: center;
  header {
    max-width: 60rem;
    padding-block-start: 3rem;
    margin-inline: auto;
  }
  h1, p { margin-block-end: 0; }
  h1 { font-size: clamp(2rem, 3.3vw + 1rem, 3rem); }
  p { font-size: clamp(1rem, .8vw + .9rem, 1.25rem); }
}

#annual {
  position: fixed;
  inset: -2px auto auto;
  width: 1px;
  height: 1px;
  margin: 0 0 -1px;
  appearance: none;
  opacity: .1;
  &:checked ~ * .mn { display: none; }
  &:not(:checked) ~ * .yr { display: none; }
  &:checked ~ #estimate #fake-switch {
    background-color: #216AFF;
    &::after { inset: .125rem auto auto 1.875rem; }
  }
  &:checked ~ #mobile-annual-switch label:first-of-type,
  &:not(:checked) ~ #mobile-annual-switch label:last-of-type {
    background: none;
    box-shadow: none;
    pointer-events: all;
    cursor: pointer;
  }
}
#estimate {
  display: flex;
  flex-flow: row wrap;
  align-items: center;
  justify-content: center;
  gap: 2rem 4rem;
  width: clamp(100% - 4rem, 23rem, 100% - 2rem);
  max-width: 58rem;
  padding: 2rem;
  margin: 1rem auto 0;
  box-sizing: border-box;
  background: #F7F7FD;
  border: 1px solid #E4E6F7;
  border-radius: 1rem;
  header {
    flex: 1 1 14rem;
    h2 {
      margin: 0 0 .5em;
      font-size: 1.75rem;
    }
    p { margin: 0; }
  }
  @media(width >= 72rem){
    flex-flow: row;
    width: min(100% - 4rem, 86rem);
    max-width: none;
    padding: 2rem clamp(2rem, 20vw - 4rem, 4rem);
    header { max-width: max-content; }
    #annual-switch { order: 2; }
    #arr-slider { flex: 1 0 15rem; }
  }
  @media(width < 32rem){
    display: grid;
    grid: auto / auto;
    #annual-switch { display: none; }
    #mobile-annual-switch { display: block; }
  }
}
#annual-switch {
  display: grid;
  grid: auto / auto;
  gap: 0 .75rem;
  align-items: center;
  font-weight: 600;
  line-height: 1.25;
  cursor: pointer;
  em {
    color: #216AFF;
    font-style: normal;
  }
  #fake-switch {
    width: 3.5rem;
    height: 1.75rem;
    margin-block-start: .75rem;
    position: relative;
    background-color: #AAAACA;
    border-radius: 2rem;
    transition: background-color .1s .05s;
    &::after {
      content: "";
      display: block;
      width: 1.5rem;
      height: 1.5rem;
      position: absolute;
      inset: .125rem auto auto .125rem;
      background: white;
      border-radius: 50%;
      transition: inset .2s;
    }
  }
}
#arr-slider {
  flex: 1 0 100%;
  width: 100%;
  margin-block-start: 2rem;
  font-size: clamp(.875rem, 3vw + .25rem, 1rem);
  padding-top: 1rem;
  range-slider {
    --bar-color: #3264FB;
    --track-color: #BBBFCF;
    height: 2rem;
    padding-inline: .25rem .5rem;
    &::part(track){
      height: .375rem;
    }
    &::part(thumb){
      width: 1rem;
      height: 1rem;
      background: var(--bar-color);
      border-radius: 50%;
      position: relative;
    }
    div[slot="thumb"]{
      width: max-content;
      min-width: 2.5em;
      padding: .25rem .75rem;
      position: absolute;
      inset: auto auto 100% 50%;
      translate: -50% 0;
      font-weight: 500;
      font-size: 1.25rem;
      text-align: center;
    }
    #your-arr-label {
      position: absolute;
      inset: auto auto 100% 50%;
      translate: -50% .375rem;
      font-weight: normal;
      font-size: 1rem;
      white-space: nowrap;
    }
    &:not(:defined){
      display: grid;
      grid: auto / auto;
      place-items: center;
      color: #e20040;
      text-align: center;
      div[slot="thumb"]{ display: none; }
      &::after {
        grid-area: 1 / 1;
        content: "";
        width: 1rem;
        height: 1rem;
        border: 2px solid black;
        border-color: black black transparent transparent;
        border-radius: 50%;
        animation: spin .8s linear infinite;
      }
      noscript {
        grid-area: 1 / 1;
        background: #F7F7FD;
        z-index: 1;
      }
    }
  }
  #arr-breakpoints {
    display: flex;
    justify-content: space-between;
    padding-inline: .25rem .75rem;
    span {
      flex: 0 0 0;
      width: 0;
      display: flex;
      justify-content: center;
    }
  }
}
#mobile-annual-switch {
  display: flex;
  gap: 1rem;
  width: max-content;
  padding: .5rem;
  margin: 3.5rem auto 0;
  background: #EDEFF7;
  border-radius: .75em;
  font-weight: 600;
  label {
    padding: .5rem 1.25rem;
    background-color: white;
    border-radius: .5rem;
    box-shadow: 0 0 .5em #0003;
    pointer-events: none;
  }
  em {
    margin-inline-start: .5ch;
    color: #216AFF;
    font-style: normal;
    font-size: .875rem;
  }
  @media(width >= 32rem){ display: none; }
}
ul {
  padding: 0;
  margin: 0;
  list-style: none;
  li {
    margin-block: .75rem;
    padding-left: 1.75em;
    background: .25em .25em / 1em 1em no-repeat url("./checked.svg?v=NqtmZRG+g2");
  }
  li:first-of-type { margin-block-start: 0; }
  li:last-of-type { margin-block-end: 0; }
}

#plans {
  display: grid;
  grid: auto / repeat(4, minmax(0, 1fr));
  gap: 0 1rem;
  padding: 4rem max((100% - 90rem) / 2 + 2rem, 2rem);
  section {
    display: grid;
    grid: auto 1fr auto / 1fr;
    max-width: 24rem;
    padding: 2rem 1.75rem;
    position: relative;
    border: 1px solid #DADBE9;
    border-radius: 1rem;
    box-shadow: 0 0 .75rem #0001;
    &[data-badge] {
      &[data-badge*="opular"]{
        border-color: #4683FF;
        box-shadow: 0 0 .75rem #0368B74C;
      }
      &::before {
        content: attr(data-badge);
        padding: .375rem .625rem;
        position: absolute;
        inset: .6rem .6rem auto auto;
        color: #135CF2;
        background: #E1EBFF;
        border-radius: .5rem;
        font-weight: 600;
        font-size: .9rem;
      }
    }
    &[data-badge="New"]::before{
      color: #9d5800;
      background-color: #ffe7ce;
    }
    p { margin: 0; }
    header {
      margin-block-end: 2rem;
      h2 {
        margin-block: 0 1em;
        font-weight: 600;
        font-size: 1.75rem;
        line-height: 1;
      }
      strong {
        font-weight: 600;
        font-size: 2rem;
      }
      small {
        font-size: 1.5rem;
      }
      p {
        margin: 0;
        font-size: 1rem;
        color: #566075;
      }
    }
    header + p { margin-block-end: 2rem; }
    .additive {
      margin-block: 3rem 1.5rem;
      font-weight: 600;
    }
    a {
      place-self: start stretch;
      display: block;
      padding: .875rem;
      color: white;
      background: black;
      border-radius: .5rem;
      font-weight: 600;
      text-decoration: none;
      text-align: center;
      transition: background-color .2s;
      &:hover { background-color: #12324B; }
    }
    ul {
      min-height: 14rem;
      margin-inline-start: -.5rem;
    }
  }
  /* Cards share rows so each part lines up across plans, whatever the copy
     length. Parts are placed by row so a card without a label still aligns. */
  @media (width >= 72rem){
    section {
      grid-row: span 5;
      grid-template-rows: subgrid;
      > header { grid-row: 1; }
      > header + p { grid-row: 2; }
      > .additive { grid-row: 3; }
      > ul { grid-row: 4; margin-block-end: 2rem; }
      > a, > book-a-demo > a { grid-row: 5; }
    }
  }
  @media (width < 72rem){
    display: flex;
    flex-flow: row wrap;
    justify-content: center;
    gap: 2rem;
    section {
      flex: 1 0 18rem;
    }
  }
}

#compare {
  padding: 4rem max((100% - 86rem) / 2 + 2rem, 2rem);
  position: relative;
  font-size: clamp(1rem, 1vw + .5rem, 1.125rem);
  table {
    display: grid;
    grid: auto / 2fr 1fr 1fr 1fr 1fr;
  }
  thead, tbody, tr, thead th { display: contents; }
  h2 { margin: 0; }
  [colspan="4"]{ grid-column: 1 / -1; }
  thead th {
    &::before {
      content: "";
      grid-row: 1;
      place-self: center;
      z-index: 1;
    }
    &[data-badge]::before {
      content: attr(data-badge);
      padding: .375rem .875rem;
      color: #135CF2;
      background: #E1EBFF;
      border-radius: .5rem;
      font-weight: 600;
      font-size: .875rem;
      white-space: nowrap;
    }
    &[data-badge="New"]::before{
      color: #9d5800;
      background-color: #ffe7ce;
    }
    h2, span {
      padding: .5em 1.5rem .875em;
      position: sticky;
      top: .5em;
      border-bottom: 1px solid #CFD3DE;
      background: white;
      box-shadow: 0 -.5em 0 white;
    }
    h2 { font-size: 1.5rem; }
    span { font-size: clamp(1.25rem, 2.5vw + .7rem, 1.5rem); }
  }
  tbody th {
    padding-block: clamp(.5rem, 5vw - .75rem, .75rem);
    padding-inline: clamp(1rem, 10vw - 1.5rem, 1.5rem);
    background: #f0f3f9;
    border-bottom: 1px solid #CFD3DE;
    font-weight: 600;
  }
  td, th {
    &:first-of-type { text-align: start; }
    text-align: center;
  }
  tbody tr:first-of-type td { padding-block-start: 3rem; }
  td {
    padding-block: clamp(.5rem, 5vw - .75rem, .75rem);
    padding-inline: clamp(1rem, 10vw - 1.5rem, 1.5rem);
    border-bottom: 1px solid #D6DAE3;
    &:not(:first-of-type){
      display: flex;
      align-items: center;
      justify-content: center;
      &:not(:has(img)) {
        font-size: .9rem;
      }
    }
    &:nth-of-type(2n + 3){ background: #F5F7FC; }
    p {
      margin-block: .5em 0;
      color: #727682;
      font-size: .875rem;
      a {
        color: #135CF2;
        text-decoration: none;
        &:hover { text-decoration: underline; }
      }
    }
  }
  button { display: none; }
  img {
    width: 1em;
    height: auto;
  }
  table.collapsible {
    button {
      display: inline-block;
      padding: 0;
      margin: 0 .75rem 0 0;
      background: none;
      border: none;
    }
    tbody th {
      cursor: pointer;
    }
    tbody.collapsed {
      button img {
        rotate: -90deg;
      }
      td { display: none; }
    }
  }
  @media (width < 60rem){ padding: 0; }
  @media (width < 50rem){
    table {
      grid: auto / 1fr 1fr 1fr 1fr;
    }
    th:first-of-type {
      &::before { content: none; }
      h2 {
        grid-area: 1 / 1 / 2 / -1;
        border: none;
        position: static;
      }
    }
    thead th::before { grid-row: 2; }
    td:first-of-type {
      padding-block-start: 2rem;
      grid-column: 1 / -1;
    }
    td:nth-child(n) { background: none; }
  }
}

#crm, #onboarding {
  max-width: 60rem;
  padding: 7rem clamp(1rem, 20vw - 3rem, 5rem);
  margin-inline: auto;
  h2 {
    margin-block: 1.5em;
    font-size: 2rem;
  }
  p, ul { font-size: clamp(1rem, .8vw + .9rem, 1.2rem); }
  a {
    display: block;
    width: max-content;
    padding: .875rem 1.5rem;
    margin: 5rem auto 2rem;
    color: white;
    background: black;
    border-radius: .5rem;
    font-weight: 600;
    text-decoration: none;
    transition: background-color .2s;
    &:hover { background-color: #12324B; }
  }
  blockquote {
    display: grid;
    grid: auto auto / auto 1fr;
    gap: 0 .5rem;
    padding: 0 2rem 0 0;
    margin: 5rem 0 6rem;
    color: #514E4D;
    background: linear-gradient(344deg, white 25%, #FFFAF8 70%, #D7D0CE);
    font-weight: 600;
    border-radius: 2rem;
    img {
      grid-area: 1 / 1 / -1 / 2;
      width: auto;
      height: 15rem;
      border-radius: 2rem;
      translate: -3rem 2rem;
    }
    p { margin-block-start: 3rem; }
    cite, .role { font-style: normal; }
    .role { font-weight: normal; }
    @media (width < 48rem){
      display: flex;
      flex-flow: column;
      padding: 2rem;
      margin-block: 2rem 1rem;
      img {
        align-self: center;
        translate: 0;
      }
    }
  }
  #why-crm {
    display: flex;
    flex-flow: row wrap;
    gap: 2rem 4rem;
    section {
      flex: 1 0 12rem;
      display: inline-block;
      padding: 0;
      h3 {
        font-weight: 600;
        font-size: 1.5rem;
      }
      p { font-size: 1.125rem; }
    }
  }
  #we-handle-it {
    display: grid;
    grid: auto auto / auto 1fr;
    gap: 1rem 4rem;
    place-items: end stretch;
    margin: 4rem 0;
    img {
      grid-area: 1 / 1 / -1 / 2;
      align-self: center;
      width: 21rem;
      height: auto;
    }
    p { margin: 0; }
    ul { place-self: start stretch; }
    li { font-size: 0.95rem; }
    @media (width < 50rem){
      display: flex;
      gap: 1rem;
      flex-flow: column;
      align-items: start;
      img {
        align-self: start;
        margin-block-end: 2rem;
      }
    }
  }
  @media (width >= 50rem){
    #onboarding-cta { text-align: center; }
  }
}

#testimonial-slider {
  padding: 2rem;
  background: #EEF3F9;
  border-radius: 2rem;
}

#faq {
  padding-block: 8rem 10rem;
  color: white;
  background: #091121;
  header::after { filter: invert(100%); }
  .question {
    padding-inline: 0 1rem;
    border-color: #434D60;
    h3 { font-weight: normal; }
  }
  a { color: #78baff; }
}

.footer-cta {
  background: none;
  a {
    padding: .875rem 1.5rem;
    border-radius: .5rem;
  }
  a:first-child {
    border: 2px solid black;
    transition: border-color .2s, background-color .2s;
    &:hover {
      border-color: #12324B;
      background-color: #12324B;
      opacity: 1;
    }
  }
  a:last-child {
    color: black;
    background: none;
    border: 2px solid #7A87A2;
    transition: border-color .2s;
    &:hover {
      border-color: black;
      text-decoration: none;
    }
  }
}

footer-menu {
  border-top: 1px solid #00000021;
}

@keyframes spin {
  from { rotate: 0; }
  to { rotate: 1turn; }
}
