/* Layout of the start page. Tokens and components live in system.css. */

.wrap {
  width: 100%;
  max-width: 1152px;
  margin-inline: auto;
  padding-inline: 20px;
}

/* Jump link for keyboard users: invisible until it has focus. */
.skip {
  position: absolute;
  left: 20px;
  top: -5rem;
  z-index: 20;
  padding: 0.6rem 1rem;
  border-radius: var(--r-field);
  background: var(--text);
  color: var(--bg);
  font-weight: 700;
  text-decoration: none;
}

.skip:focus {
  top: 12px;
}

/* ---------- Header and footer ---------- */

.site-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-4);
  padding-block: var(--s-4);
}

.site-top img {
  width: 7.5rem;
  height: auto;
}

.site-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-2) var(--s-5);
  padding-block: var(--s-5) calc(var(--s-5) + env(safe-area-inset-bottom));
  color: var(--text-3);
  font-size: 0.9375rem;
}

.site-foot nav {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-1) var(--s-5);
}

.site-foot a {
  display: inline-block;
  padding-block: var(--s-2);
  color: var(--text-2);
  font-weight: 600;
}

/* ---------- Hero ---------- */

.hero {
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--s-6);
  padding-block: var(--s-6) var(--s-7);
}

/* A fine grid, only visible where the light from the top left falls. */
.hero::before {
  content: "";
  position: absolute;
  inset: -1rem 0 auto 0;
  height: 30rem;
  z-index: -1;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.055) 1px, transparent 1px);
  background-size: 48px 48px;
  -webkit-mask-image: radial-gradient(70% 90% at 12% 0%, #000 0%, transparent 72%);
  mask-image: radial-gradient(70% 90% at 12% 0%, #000 0%, transparent 72%);
  pointer-events: none;
}

.hero-copy {
  display: grid;
  gap: var(--s-4);
}

.hero-status {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s-2) var(--s-3);
}

.hero-action {
  display: grid;
  gap: var(--s-4);
  justify-items: start;
  max-width: 30rem;
}

.hero-stage {
  position: relative;
}

/*
  Stage light behind the switchboard: warm where the sun rises, blue on the other side.
  It sits behind the glass and only shows above its top edge. Both lights fade out
  well inside the box, so no edge of the box ever shows.
*/
.hero-stage::before {
  content: "";
  position: absolute;
  inset: -3rem -1rem auto -1rem;
  height: 20rem;
  z-index: -1;
  background:
    radial-gradient(30% 42% at 84% 56%, rgba(252, 196, 11, 0.2), transparent 100%),
    radial-gradient(46% 44% at 30% 56%, rgba(61, 125, 255, 0.28), transparent 100%);
  pointer-events: none;
}

.stage-note {
  margin-top: var(--s-3);
  text-align: center;
}

/* The consent text next to the button. Small, but never below 14px, and with a readable line length. */
.consent {
  max-width: 34rem;
}

.consent a {
  color: var(--text-2);
}

/* ---------- Sections ---------- */

.section {
  padding-block: var(--s-8);
  border-top: 1px solid var(--line);
}

.section-head {
  display: grid;
  gap: var(--s-3);
  max-width: 40rem;
  margin-bottom: var(--s-6);
}

.perk-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--s-6);
  align-items: start;
}

.modules {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--s-4);
}

/* The last tile is the open slot: what is not here, people will be able to build themselves. */
.card-idea {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--s-3);
  align-content: start;
  justify-items: start;
  padding: var(--s-5);
  border: 1px dashed var(--line-ctl);
  border-radius: var(--r-card);
}

.card-idea .card-module-top {
  width: 100%;
}

.faq-list {
  max-width: 46rem;
  border-top: 1px solid var(--line);
}

/* ---------- Closing ---------- */

.closing {
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--s-5);
  justify-items: center;
  padding-block: var(--s-8);
  text-align: center;
}

/* The lighter strip is its own layer and fades out at the sides, like the hairlines above and below it. */
.closing::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(180deg, rgba(61, 125, 255, 0.09), rgba(61, 125, 255, 0.03));
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 18%, #000 82%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 18%, #000 82%, transparent);
}

.closing .consent {
  max-width: 36rem;
}

/* ---------- Sticky bar: phones only ---------- */

/* Room at the bottom, so the bar never covers the element that has keyboard focus. */
html {
  scroll-padding-bottom: 5rem;
}

@media (min-width: 768px) {
  .stickybar--fixed {
    display: none;
  }

  html {
    scroll-padding-bottom: 0;
  }
}

/* ---------- Wider screens ---------- */

@media (min-width: 600px) {
  .modules {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 900px) {
  .hero {
    grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
    column-gap: var(--s-7);
    align-items: end;
    padding-block: var(--s-7) var(--s-8);
  }

  .hero-stage {
    grid-column: 1 / -1;
  }

  /* From 900px the chat preview sits next to the switches. Below, it sits above them. */
  .board--wide {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    grid-template-areas:
      "head head"
      "rows chat";
    align-items: start;
  }

  .board--wide .board-head {
    grid-area: head;
  }

  .board--wide .chat {
    grid-area: chat;
    height: 100%;
    min-height: 16rem;
  }

  .board--wide .board-controls {
    grid-area: rows;
  }

  .section {
    padding-block: var(--s-9);
  }

  .perk-grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: var(--s-7);
  }

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

  .closing {
    padding-block: var(--s-9);
  }
}

/* Narrow phones: the Preview pill replaces the subline in the head of the switchboard. */
@media (max-width: 419px) {
  .board-sub {
    display: none;
  }
}
