/* "How WeLoop works": why it exists, then muted words tried on a feed.
   The phone is the home page's (phone.css); this lays out the page around it
   and adds what muted words draw in the feed. */

.features {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 var(--gutter) 40px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ------------------------------------------------------------------ why */

.why {
  padding: clamp(40px, 8vw, 96px) 0 clamp(40px, 6vw, 72px);
}

.why h1 {
  margin: 0 0 18px;
  font: 800 clamp(40px, 6.5vw, 72px) / 1.02 var(--display);
  letter-spacing: -0.02em;
}

.why .lede {
  max-width: 46ch;
  margin: 0 0 40px;
  color: var(--muted);
  font-size: clamp(18px, 2vw, 21px);
}

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

.why-points li {
  padding: 22px 22px 20px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--card);
}

.why-points h2 {
  margin: 0 0 8px;
  font: 700 20px/1.25 var(--display);
}

.why-points p {
  margin: 0;
  color: var(--muted);
  font-size: 16px;
}

.why-founders {
  margin: 22px 0 0;
  color: var(--muted);
  font-size: 15px;
}

.why-founders a {
  color: var(--primary);
}

/* --------------------------------------------------------- muted words */

.mute {
  padding: clamp(40px, 7vw, 80px) 0;
  border-top: 1px solid var(--line);
}

.mute h2 {
  margin: 0 0 14px;
  font: 800 clamp(30px, 4.4vw, 48px) / 1.06 var(--display);
  letter-spacing: -0.015em;
}

.mute-text > p {
  max-width: 52ch;
  color: var(--muted);
}

.mute h3 {
  margin: 28px 0 12px;
  font: 700 13px/1.2 var(--body);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.sets {
  display: grid;
  gap: 10px;
}

.set {
  padding: 14px 14px 14px 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--card);
  transition: border-color 0.2s ease, background 0.2s ease;
}

.set.on {
  border-color: color-mix(in srgb, var(--primary) 45%, transparent);
  background: color-mix(in srgb, var(--primary) 7%, transparent);
}

.set-head {
  display: flex;
  align-items: center;
  gap: 14px;
}

.set-head > span {
  flex: 1;
  min-width: 0;
}

.set-head b {
  display: block;
  font-weight: 600;
}

.set-head small {
  display: block;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.4;
}

/* An on/off switch. Not .switch: the phone has its own, with words in it. */
.set-switch {
  flex: none;
  position: relative;
  width: 52px;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.16);
  cursor: pointer;
  transition: background 0.2s ease;
}

.set-switch i {
  position: absolute;
  top: 4px;
  left: 4px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.2s ease;
}

.set-switch[aria-checked="true"] {
  background: var(--primary);
}

.set-switch[aria-checked="true"] i {
  transform: translateX(20px);
}

/* Hide the word / Hide the post. */
.choice {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  margin-top: 12px;
  padding: 4px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.06);
}

.choice button {
  min-height: 40px;
  padding: 6px 10px;
  border: 0;
  border-radius: 10px;
  background: none;
  color: var(--muted);
  font: 600 14px/1.2 var(--body);
  cursor: pointer;
}

.choice button[aria-pressed="true"] {
  background: var(--primary);
  color: var(--on-primary);
}

.own-add {
  display: flex;
  gap: 8px;
}

.own-add input {
  flex: 1;
  min-width: 0;
  min-height: 46px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--card);
  color: var(--ink);
  font: 400 16px var(--body);
}

.own-add input:focus {
  outline: 2px solid color-mix(in srgb, var(--primary) 60%, transparent);
  outline-offset: 1px;
}

.own-add .btn {
  min-height: 46px;
}

.own-hint {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.own-words {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.own-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 0 12px 0 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--card);
  color: var(--ink);
  font: 500 15px var(--body);
  cursor: pointer;
}

.own-chip span {
  color: var(--muted);
  font-size: 18px;
  line-height: 1;
}

.limits {
  margin-top: 32px;
  padding: 18px 20px 6px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--card);
}

.limits h3 {
  margin-top: 0;
  color: var(--ink);
}

.limits ul {
  margin: 0;
  padding-left: 20px;
  color: var(--muted);
  font-size: 15px;
}

.limits li {
  margin-bottom: 10px;
}

/* -------------------------------------------- what muted words draw */

/* How many posts muted words left out, under the phone. */
.mute-stage .left-out {
  min-height: 1.4em;
  margin: 14px 0 0;
  color: var(--ink);
  font-size: 14px;
  text-align: center;
}

/* The phone's stories and chips are for show here. */
.mute-stage .story,
.mute-stage .chip {
  cursor: default;
}

/* A covered word: the word itself, blurred past reading, in a pill. */
.post .mw {
  display: inline;
  padding: 0 4px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.12);
  color: inherit;
  font: inherit;
  filter: blur(4px);
  cursor: pointer;
}

.post .mw:focus-visible {
  filter: none;
  outline: 2px solid var(--p);
}

.post .mw-note {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 10px 0 0 13px;
  padding: 6px 12px;
  border-radius: 16px;
  font-size: 12px;
  color: color-mix(in srgb, var(--on-surf) 65%, transparent);
}

.post .mw-note .ic {
  width: 15px;
  height: 15px;
}

.post .mw-note b {
  margin-left: 4px;
  color: var(--p);
  font-weight: 600;
}

/* ----------------------------------------------------- the fixed phone */

/* The chapters on the left; one phone fixed on the right, showing the demo
   of the chapter being read (features.js). */
.tour {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 420px);
  gap: clamp(28px, 5vw, 72px);
}

.tour-chapters {
  min-width: 0;
}

.tour-stage {
  position: sticky;
  top: 84px;
  align-self: start;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 24px;
}

.tour-phones {
  position: relative;
}

.demo {
  position: absolute;
  inset: 0;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0s 0.3s;
}

.demo.active {
  opacity: 1;
  visibility: visible;
  transition: opacity 0.3s ease;
}

.tour-stage .stage-note {
  margin: 16px 0 0;
  font-size: 12px;
  color: var(--muted);
  opacity: 0.8;
}

/* Muted words' count of posts left out sits just under its phone, as wide
   as the window allows so it stays on one line under a small phone. */
.mute-stage .left-out {
  position: absolute;
  top: 100%;
  left: 50%;
  width: min(92vw, 440px);
  transform: translateX(-50%);
}

/* Room for it, while muted words is showing. */
.tour-stage:has(.mute-stage.active) .stage-note {
  margin-top: 44px;
}

/* ----------------------------------------------------------------- more */

.more-section {
  padding: clamp(32px, 6vw, 56px) 0 0;
  border-top: 1px solid var(--line);
}

.more-section h2 {
  margin: 0 0 18px;
  font: 700 clamp(24px, 3vw, 32px) / 1.15 var(--display);
}

.more-links {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.more-links a {
  display: block;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--card);
  color: var(--ink);
  text-decoration: none;
  transition: border-color 0.2s ease;
}

.more-links a:hover {
  border-color: color-mix(in srgb, var(--primary) 50%, transparent);
}

.more-links b {
  display: block;
  font: 700 18px/1.3 var(--display);
}

.more-links span {
  color: var(--muted);
  font-size: 15px;
}

/* ------------------------------------------------------------- narrow */

@media (max-width: 899px) {
  .why-points,
  .more-links {
    grid-template-columns: 1fr;
  }

  /* The phone pinned small at the top of the chapters, switching as they
     scroll under it. */
  .tour {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .tour-stage {
    order: -1;
    top: 64px;
    z-index: 5;
    margin: 0 -16px;
    padding: 10px 0 12px;
    background: var(--page);
  }

  .tour-stage::after {
    content: "";
    position: absolute;
    inset: 100% 0 auto;
    height: 24px;
    background: linear-gradient(var(--page), transparent);
    pointer-events: none;
  }

  .tour-stage .stage-note {
    margin-top: 6px;
  }

  .tour-stage:has(.mute-stage.active) .stage-note {
    margin-top: 34px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .set-switch,
  .set-switch i,
  .set {
    transition: none;
  }
}
