/* The redacted permissions: a white card on a white page, in the ink and the volt yellow of a running coach app.
   What you keep is blacked out in the same ink as the words. */
:root {
  --page: #ffffff;          /* the page */
  --card: #ffffff;          /* the card */
  --ink: #131417;           /* the words, and the ink that blacks them out */
  --wet: #3a4150;           /* the ink while it is still wet */
  --muted: #6b6e75;
  --line: #ececea;
  --volt: #d9f84a;          /* the app's colour: a switch turned on, the route in its icon */
  --off: #e7e7e3;           /* a switch turned off */
  --quiet: #f2f2ef;         /* the quiet buttons */
  --shadow: 0 1px 2px rgba(19, 20, 23, 0.05), 0 14px 34px -10px rgba(19, 20, 23, 0.16), 0 44px 80px -30px rgba(19, 20, 23, 0.14);
}

* {
  box-sizing: border-box;
}

html {
  touch-action: manipulation;
}

html,
body {
  margin: 0;
}

body {
  min-height: 100svh;
  background: var(--page);
  color: var(--ink);
  font-family: 'Archivo Variable', system-ui, sans-serif;
  font-stretch: 100%;
  -webkit-font-smoothing: antialiased;
}

.stage {
  display: grid;
  place-items: center;
  min-height: 100svh;
  padding: 28px 16px;
}

/* ---------------------------------------------------------------- the card */
.permit {
  position: relative;
  width: min(404px, 100%);
  padding: 24px 22px 22px;
  border-radius: 26px;
  background: var(--card);
  box-shadow: inset 0 0 0 1px rgba(19, 20, 23, 0.07), var(--shadow);
}

.permit__head {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  column-gap: 14px;
  align-items: start;
}

/* the app's icon: the route in it grows as the data comes in */
.app {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: var(--ink);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06), 0 6px 14px -6px rgba(19, 20, 23, 0.45);
}

.app__mark {
  display: block;
  width: 48px;
  height: 48px;
  overflow: visible;
}

/* a lap of a running track: the part in yellow is how much of you the app knows */
.app__lap {
  fill: none;
  stroke: var(--volt);
  stroke-width: 3.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.app__lap--ghost {
  stroke-opacity: 0.17;
}

.app__lane {
  fill: none;
  stroke: var(--volt);
  stroke-opacity: 0.17;
  stroke-width: 2.2;
}

.permit__title {
  align-self: center;
  overflow: hidden;
  margin: 0;
  font-size: 22px;
  font-weight: 720;
  font-stretch: 96%;
  line-height: 1.15;
  letter-spacing: -0.012em;
  text-wrap: balance;
}

.permit__text {
  overflow: hidden;
  grid-column: 1 / -1;
  margin: 12px 0 0;
  font-size: 14.5px;
  line-height: 1.5;
  color: var(--muted);
}

/* each sentence on its own line */
.permit__line {
  display: block;
  text-wrap: balance;
}

/* ---------------------------------------------------------------- the kinds of data */
.kinds {
  margin: 20px 0 0;
  padding: 0;
  list-style: none;
}

.kind {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 12px 0 11px;
  border-top: 1px solid var(--line);
}

.kind[data-can] {
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.kind__words {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.kind__name {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--muted);
}

.kind__value {
  position: relative;
  display: block;
  height: 30px;
}

/* the value is SVG text, one tspan per letter: the ink is each letter's own stroke, round at the joins, so a
   thick one is the letter grown by a disc in every direction */
.ink {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 30px;
  overflow: visible;
}

.ink__body {
  color: var(--ink);
}

.ink__text {
  font-size: 20px;
  font-variant-numeric: tabular-nums;
  fill: currentColor;
  stroke: currentColor;
  stroke-width: 0;
  stroke-linejoin: round;
  stroke-linecap: round;
  white-space: pre;
}

.ink__bar {
  fill: currentColor;
}

/* the app's yellow over what it reads, as a highlighter would */
.ink__mark {
  fill: var(--volt);
}

/* the shine on the wet ink, broken like the reflection of a window */
.ink__wet {
  fill: none;
  stroke: #ffffff;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-dasharray: 64 12 10 16 120 30;
  opacity: 0;
}

.kind__tag {
  padding: 5px 9px;
  border-radius: 8px;
  background: var(--quiet);
  font-size: 12px;
  font-weight: 620;
  letter-spacing: 0.01em;
  color: var(--muted);
}

/* a switch: a real button with role switch */
.switch {
  position: relative;
  display: block;
  width: 48px;
  height: 30px;
  padding: 0;
  border: 0;
  border-radius: 15px;
  background: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.switch__track {
  position: absolute;
  inset: 0;
  border-radius: 15px;
  background: var(--off);
  transition: filter 0.2s;
}

.switch__knob {
  position: absolute;
  left: 3px;
  top: 3px;
  width: 24px;
  height: 24px;
}

/* the knob for GSAP, its face for the colour */
.switch__face {
  position: absolute;
  inset: 0;
  border-radius: 12px;
  background: #ffffff;
  box-shadow: 0 1px 2px rgba(19, 20, 23, 0.18), 0 2px 6px rgba(19, 20, 23, 0.12);
}

@media (hover: hover) {
  .kind[data-can]:hover .switch__track {
    filter: brightness(0.96);
  }
}

.switch:disabled {
  cursor: default;
}

/* ---------------------------------------------------------------- the buttons */
.actions {
  display: grid;
  gap: 8px;
  margin-top: 16px;
}

.actions[hidden] {
  display: none;
}

.actions__row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  height: 44px;
  padding: 0 12px;
  border: 0;
  border-radius: 13px;
  font: 620 14.5px 'Archivo Variable', system-ui, sans-serif;
  font-stretch: 94%;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 0.2s, transform 0.16s cubic-bezier(0.23, 1, 0.32, 1);
  -webkit-tap-highlight-color: transparent;
}

.btn:active {
  transform: scale(0.97);
}

.btn--quiet {
  background: var(--quiet);
  color: var(--ink);
}

.btn--big {
  height: 52px;
  border-radius: 15px;
  font-size: 15.5px;
}

.done__note {
  display: flex;
  gap: 8px;
  align-items: center;
  height: 44px;
  margin: 0;
  font-size: 14px;
  color: var(--muted);
}

.done__mark {
  flex: none;
  width: 22px;
  height: 22px;
  padding: 3px;
  border-radius: 7px;
  background: var(--volt);
  fill: none;
  stroke: var(--ink);
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.btn--main {
  height: 52px;
  border-radius: 15px;
  background: var(--ink);
  color: #ffffff;
  font-size: 16px;
  font-weight: 650;
  font-stretch: 98%;
}

@media (hover: hover) {
  .btn--quiet:hover {
    background: #e9e9e5;
  }

  .btn--main:hover {
    background: #2a2b30;
  }
}

.btn:focus-visible,
.switch:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
}

/* the focus moves by itself when the card changes: its ring shows only to who uses the keys */
html[data-using='pointer'] .btn:focus-visible,
html[data-using='pointer'] .switch:focus-visible {
  outline: none;
}

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

@media (max-width: 420px) {
  .permit {
    padding: 22px 18px 18px;
    border-radius: 24px;
  }

  .permit__title {
    font-size: 21px;
  }

  .btn {
    padding: 0 8px;
    font-stretch: 88%;
  }
}
