/* The founders page: the fan of screens in the hero, and the first version scoper.
   Values come from tokens.css; shared parts (page hero, phone, bench, points, steps,
   proof, FAQ, the ask) from styles.css. */

/* ---------- Wireframes ----------
   One drawn screen, used at every size: in the hero fan, on the scoper's phone, and as
   the thumbnails in its screen map. Each pattern is a stack of flat background layers
   placed in percentages, so the same rule draws a 60px thumbnail and a full phone screen.
   Layers sit inside the padding (background-origin), which gives every screen its margin. */

.wf {
  --wf-ink: color-mix(in srgb, var(--ink-soft) 45%, var(--white));
  --wf-a: linear-gradient(var(--teal), var(--teal));
  --wf-t: linear-gradient(var(--teal-tint), var(--teal-tint));
  --wf-i: linear-gradient(var(--wf-ink), var(--wf-ink));
  --wf-s: linear-gradient(var(--line), var(--line));
  --wf-w: linear-gradient(var(--white), var(--white));
  --wf-dot: radial-gradient(circle closest-side, var(--teal) 92%, transparent 96%);

  display: block;
  padding: 9%;
  background-color: var(--white);
  background-repeat: no-repeat;
  background-origin: content-box;
}

/* A picture, a heading, two lines, a button. */
.wf[data-wf="home"] {
  background-image: var(--wf-t), var(--wf-i), var(--wf-s), var(--wf-s), var(--wf-a);
  background-size: 100% 32%, 55% 6%, 100% 5%, 80% 5%, 45% 11%;
  background-position: 0 0, 0 43%, 0 55%, 0 65%, 0 100%;
}

/* Three labelled fields and a button. */
.wf[data-wf="form"] {
  background-image: var(--wf-i), var(--wf-s), var(--wf-i), var(--wf-s), var(--wf-i), var(--wf-s), var(--wf-a);
  background-size: 30% 4%, 100% 11%, 30% 4%, 100% 11%, 30% 4%, 100% 11%, 100% 12%;
  background-position: 0 0, 0 8%, 0 28%, 0 38%, 0 56%, 0 68%, 0 100%;
}

/* Four rows, the first one unread. */
.wf[data-wf="list"] {
  background-image: var(--wf-a), var(--wf-i), var(--wf-s), var(--wf-i), var(--wf-s), var(--wf-i), var(--wf-s), var(--wf-i);
  background-size: 16% 11%, 72% 5%, 16% 11%, 60% 5%, 16% 11%, 72% 5%, 16% 11%, 50% 5%;
  background-position: 0 0, 86% 3%, 0 30%, 60% 31%, 0 60%, 86% 59%, 0 90%, 48% 87%;
}

/* A search bar over four tiles. */
.wf[data-wf="grid"] {
  background-image: var(--wf-s), var(--wf-t), var(--wf-s), var(--wf-s), var(--wf-s), var(--wf-i);
  background-size: 100% 9%, 47% 30%, 47% 30%, 47% 30%, 47% 30%, 60% 5%;
  background-position: 0 0, 0 22%, 100% 22%, 0 72%, 100% 72%, 0 100%;
}

/* A large picture, a title, two lines, a button. */
.wf[data-wf="detail"] {
  background-image: var(--wf-t), var(--wf-i), var(--wf-s), var(--wf-s), var(--wf-a);
  background-size: 100% 40%, 65% 6%, 100% 5%, 85% 5%, 100% 12%;
  background-position: 0 0, 0 52%, 0 63%, 0 72%, 0 100%;
}

/* A month: five columns cut into four rows, one day picked. */
.wf[data-wf="cal"] {
  background-image:
    var(--wf-a),
    repeating-linear-gradient(180deg, transparent 0 20%, var(--white) 20% 26.66%),
    repeating-linear-gradient(90deg, var(--line) 0 17%, transparent 17% 20.75%),
    var(--wf-i),
    var(--wf-s);
  background-size: 17% 16.4%, 100% 82%, 100% 82%, 40% 6%, 20% 6%;
  background-position: 50% 47.7%, 0 100%, 0 100%, 0 0, 100% 0;
}

/* Three bubbles and a place to type. */
.wf[data-wf="chat"] {
  background-image: var(--wf-s), var(--wf-a), var(--wf-s), var(--wf-s);
  background-size: 62% 13%, 55% 13%, 70% 13%, 100% 10%;
  background-position: 0 6%, 100% 30%, 0 54%, 0 100%;
}

/* A title over four bars. */
.wf[data-wf="chart"] {
  background-image: var(--wf-i), var(--wf-s), var(--wf-s), var(--wf-s), var(--wf-a);
  background-size: 45% 6%, 17% 30%, 17% 52%, 17% 40%, 17% 68%;
  background-position: 0 0, 0 100%, 33.3% 100%, 66.6% 100%, 100% 100%;
}

/* Two roads and a pin. */
.wf[data-wf="map"] {
  background-image: var(--wf-dot), var(--wf-w), var(--wf-w), var(--wf-t);
  background-size: 22% 16%, 100% 4%, 5% 100%, 100% 100%;
  background-position: 58% 34%, 0 60%, 30% 0, 0 0;
}

/* A face, a name, three settings. */
.wf[data-wf="profile"] {
  background-image: var(--wf-dot), var(--wf-i), var(--wf-s), var(--wf-s), var(--wf-s);
  background-size: 34% 24%, 50% 6%, 100% 9%, 100% 9%, 100% 9%;
  background-position: 50% 0, 50% 36%, 0 58%, 0 76%, 0 94%;
}

/* ---------- Hero: three prototype screens, fanned ---------- */

.page-hero-art {
  display: none;
}

@media (min-width: 900px) {
  .page-hero-art {
    display: block;
  }

  .hero-fan {
    position: relative;
    block-size: calc(var(--space-10) * 2.75);
    max-inline-size: calc(var(--space-10) * 2.75);
    margin-inline: auto;
  }

  .hero-fan .wf {
    position: absolute;
    inset-block-start: 50%;
    inset-inline-start: 50%;
    inline-size: 44%;
    aspect-ratio: 9 / 16;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-device);
    translate: -50% -50%;
  }

  .hero-fan .wf:nth-child(1) {
    transform: translateX(-60%) rotate(-9deg);
  }

  .hero-fan .wf:nth-child(2) {
    z-index: 1;
    inline-size: 50%;
  }

  .hero-fan .wf:nth-child(3) {
    transform: translateX(60%) rotate(9deg);
  }
}

/* ---------- The scoper ----------
   Three panes on one bench: the choices, the app so far, and the plan.
   They stack on a phone, sit two up from 900px, and three across from 1180px. */

.scoper-nojs {
  padding: var(--space-5);
  color: var(--fg-soft);
}

.scoper {
  display: grid;
}

.scoper-pane {
  display: grid;
  gap: var(--space-6);
  align-content: start;
  min-width: 0;
  padding: var(--space-5);
}

.scoper-pane + .scoper-pane {
  border-top: var(--hair) solid var(--rule);
}

.scoper-status {
  padding: var(--space-3) var(--space-5);
  border-top: var(--hair) solid var(--rule);
  color: var(--fg-soft);
  font-size: var(--text-sm);
}

@media (min-width: 900px) {
  .scoper {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }

  .scoper-pane {
    padding: var(--space-6);
  }

  .scoper-stage {
    border-inline-start: var(--hair) solid var(--rule);
  }

  .scoper-pane.scoper-stage {
    border-top: 0;
  }

  .scoper-plan {
    grid-column: 1 / -1;
  }
}

@media (min-width: 1180px) {
  .scoper {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr) minmax(0, 0.95fr);
  }

  .scoper-pane.scoper-plan {
    grid-column: auto;
    border-top: 0;
    border-inline-start: var(--hair) solid var(--rule);
  }
}

/* The choices */

.scoper-step {
  display: grid;
  gap: var(--space-3);
  min-width: 0;
  padding: 0;
  border: 0;
}

.scoper-step legend {
  display: flex;
  align-items: baseline;
  gap: var(--space-3);
  margin-block-end: var(--space-4);
  padding: 0;
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: var(--heading-weight);
  font-stretch: var(--heading-stretch);
  line-height: var(--leading-snug);
  letter-spacing: var(--tracking-heading);
}

.scoper-step legend span {
  color: var(--accent-text);
  font-size: var(--text-sm);
  font-weight: 500;
  font-stretch: 100%;
}

.kinds {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(var(--space-10), 1fr));
  gap: var(--space-2);
}

.kind,
.feat {
  position: relative;
  display: block;
}

.kind input,
.feat input {
  position: absolute;
  inset: 0;
  inline-size: 100%;
  block-size: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.kind-card {
  display: grid;
  gap: var(--hair-strong);
  align-content: start;
  block-size: 100%;
  min-height: calc(var(--control-h) + var(--space-5));
  padding: var(--space-3) var(--space-4);
  border: var(--hair) solid var(--rule);
  border-radius: var(--radius-md);
  transition:
    background-color var(--fast) var(--ease),
    border-color var(--fast) var(--ease);
}

.kind-card strong {
  font-size: var(--text-sm);
  font-weight: 600;
  line-height: var(--leading-snug);
}

.kind-card small {
  color: var(--fg-soft);
  font-size: var(--text-xs);
  line-height: var(--leading-snug);
}

.kind:hover .kind-card {
  border-color: var(--fg-soft);
}

.kind input:checked + .kind-card {
  border-color: var(--brass);
  background: var(--navy-700);
  box-shadow: inset 0 0 0 var(--hair) var(--brass);
}

.kind input:focus-visible + .kind-card,
.feat input:focus-visible + span {
  outline: var(--focus-w) solid var(--focus);
  outline-offset: var(--hair-strong);
}

.feats {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.feat span {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  min-height: var(--control-h-sm);
  padding: var(--space-1) var(--space-4) var(--space-1) var(--space-3);
  border: var(--hair) solid var(--rule);
  border-radius: var(--radius-pill);
  font-size: var(--text-sm);
  font-weight: 500;
  line-height: var(--leading-snug);
  transition:
    background-color var(--fast) var(--ease),
    border-color var(--fast) var(--ease),
    color var(--fast) var(--ease);
}

/* The tick box, drawn. */
.feat span::before {
  content: "";
  flex: none;
  inline-size: var(--space-4);
  block-size: var(--space-4);
  border: var(--hair-strong) solid var(--fg-soft);
  border-radius: var(--radius-sm);
}

.feat:hover span {
  border-color: var(--fg-soft);
}

.feat input:checked + span {
  border-color: var(--on-navy);
  background: var(--on-navy);
  color: var(--ink);
  font-weight: 600;
}

.feat input:checked + span::before {
  border-color: var(--teal);
  background: var(--teal);
}

/* The tick inside it. */
.feat input:checked + span::after {
  content: "";
  position: absolute;
  inset-block-start: 50%;
  inset-inline-start: calc(var(--space-3) + var(--space-1) + var(--hair-strong));
  inline-size: calc(var(--space-1) + var(--hair));
  block-size: calc(var(--space-2) + var(--hair));
  border: solid var(--white);
  border-width: 0 var(--hair-strong) var(--hair-strong) 0;
  translate: 0 -62%;
  rotate: 45deg;
}

/* The app so far: the phone, and beside it every screen the picks add up to. */

.scoper-stage {
  --phone-w: calc(var(--space-10) + var(--space-9));

  background: var(--navy-950);
  container-type: inline-size;
}

.stage-grid {
  display: grid;
  gap: var(--space-6);
  justify-items: center;
}

.stage-grid .phone {
  flex: none;
}

.screen-map {
  display: grid;
  gap: var(--space-5);
  align-content: start;
  inline-size: 100%;
}

/* Wide enough for the phone and three thumbnails across beside it. */
@container (min-width: 440px) {
  .stage-grid {
    grid-template-columns: var(--phone-w) minmax(0, 1fr);
    align-items: start;
    justify-items: stretch;
    column-gap: var(--space-4);
  }
}

.map-group {
  display: grid;
  gap: var(--space-3);
}

.map-group h4,
.plan-list h4 {
  color: var(--fg-soft);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 400;
  line-height: var(--leading-body);
  letter-spacing: var(--tracking-mono);
}

.map-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(calc(var(--space-8) - var(--space-2)), 1fr));
  gap: var(--space-3) var(--space-2);
}

.thumb {
  display: grid;
  gap: var(--space-1);
  justify-items: center;
  align-content: start;
  color: var(--fg-soft);
  font-family: var(--font-mono);
  font-size: var(--text-2xs);
  line-height: var(--leading-snug);
  text-align: center;
}

.thumb .wf {
  inline-size: 100%;
  max-inline-size: calc(var(--space-8) - var(--space-2));
  aspect-ratio: 9 / 14;
  border-radius: var(--radius-sm);
}

/* A screen that is waiting for later: fainter, with a dashed edge. */
.thumb[data-phase="later"] .wf {
  outline: var(--hair) dashed var(--on-navy-soft);
  outline-offset: var(--hair-strong);
  opacity: 0.55;
}

/* Inside the phone: the kind of product, the current screen, and the tabs. */

.wapp {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-height: 0;
}

.wapp-head {
  display: flex;
  flex: none;
  align-items: center;
  gap: var(--space-2);
  padding: 0 var(--space-3) var(--space-2);
  border-bottom: var(--hair) solid var(--line);
}

.wapp-head > div {
  min-width: 0;
}

.wapp-logo {
  flex: none;
  inline-size: calc(var(--space-6) - var(--space-1));
  block-size: calc(var(--space-6) - var(--space-1));
  border-radius: var(--radius-md);
  background: var(--teal);
}

.wapp-kind {
  font-family: var(--font-display);
  font-size: var(--text-xs);
  font-weight: var(--heading-weight);
  line-height: var(--leading-snug);
  letter-spacing: var(--tracking-heading);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.wapp-sub {
  color: var(--ink-soft);
  font-size: var(--text-2xs);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.wapp-title {
  flex: none;
  padding: var(--space-3) var(--space-4) 0;
  font-family: var(--font-display);
  font-size: var(--text-base);
  font-weight: var(--display-weight);
  line-height: var(--leading-snug);
  letter-spacing: var(--tracking-display);
}

.wapp .wf {
  flex: 1 1 auto;
  min-height: 0;
}

.wapp-tabs {
  display: flex;
  flex: none;
  justify-content: space-around;
  padding: var(--space-1) var(--space-1) var(--space-3);
  border-top: var(--hair) solid var(--line);
  overflow: hidden;
}

.wapp-tabs button {
  min-height: var(--space-6);
  padding: 0 var(--space-1);
  border: 0;
  border-radius: var(--radius-sm);
  background: none;
  color: var(--ink-soft);
  font-family: var(--font-body);
  font-size: var(--text-2xs);
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  transition: color var(--fast) var(--ease);
}

.wapp-tabs button:hover {
  color: var(--ink);
}

/* The pressed tab changes colour and gains a bar, not weight, so the row never reflows. */
.wapp-tabs button[aria-pressed="true"] {
  color: var(--teal-deep);
  box-shadow: inset 0 var(--hair-strong) 0 var(--teal);
}

/* The plan */

.scoper-plan {
  container-type: inline-size;
}

.scoper-plan h3 {
  font-size: var(--text-lg);
}

.plan-count {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: var(--space-1) var(--space-3);
  margin-block-start: calc(var(--space-4) * -1);
  color: var(--fg-soft);
  font-size: var(--text-sm);
}

.plan-count strong {
  color: var(--fg);
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: var(--display-weight);
  font-stretch: var(--heading-stretch);
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-display);
  font-variant-numeric: tabular-nums;
}

.plan-lists {
  display: grid;
  gap: var(--space-5);
}

@container (min-width: 600px) {
  .plan-lists {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: var(--space-6);
    align-items: start;
  }
}

.plan-list {
  display: grid;
  align-content: start;
}

.plan-list h4 {
  padding-block-end: var(--space-2);
  border-bottom: var(--hair) solid var(--rule);
}

.plan-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  min-height: var(--control-h);
  padding-block: var(--space-1);
  border-bottom: var(--hair) solid var(--rule);
  font-size: var(--text-sm);
  font-weight: 500;
  line-height: var(--leading-snug);
}

.plan-list--later .plan-item > span {
  color: var(--fg-soft);
}

.plan-item button {
  position: relative;
  flex: none;
  min-height: var(--space-6);
  padding: 0 var(--space-3);
  border: var(--hair) solid var(--rule);
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--fg-soft);
  font-size: var(--text-xs);
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  transition:
    border-color var(--fast) var(--ease),
    color var(--fast) var(--ease);
}

/* Grow the tap target to 44px without growing the button. */
.plan-item button::after {
  content: "";
  position: absolute;
  inset: calc((var(--control-h-sm) - var(--space-6)) / -2) 0;
}

.plan-item button:hover {
  border-color: var(--fg);
  color: var(--fg);
}

.plan-empty {
  padding-block: var(--space-3);
  color: var(--fg-soft);
  font-size: var(--text-sm);
}

/* What we make of the size. It takes a brass edge when version one has grown too big. */
.plan-size {
  display: grid;
  gap: var(--space-3);
  justify-items: start;
  padding: var(--space-4);
  border-radius: var(--radius-md);
  background: var(--navy-950);
  font-size: var(--text-sm);
  transition: box-shadow var(--medium) var(--ease);
}

/* Focus lands on the reading after a trim, so it is announced; it is not a control, so no ring. */
.plan-size p:focus-visible {
  outline: 0;
}

.plan-size[data-size="big"] {
  box-shadow: inset var(--space-1) 0 0 var(--brass);
}

.plan-fixed {
  margin-block-start: calc(var(--space-3) * -1);
  color: var(--fg-soft);
  font-size: var(--text-sm);
}

.scoper-plan .btn {
  justify-self: stretch;
}

@container (min-width: 600px) {
  .scoper-plan .btn {
    justify-self: start;
  }
}
