/* /review/: the page sent by hand to someone who has just said what they think of Plugindex.
   Opened mostly on a phone, inside Instagram's own browser, with about half a minute of goodwill:
   the words come first, everything after them is optional, and the plate shows the quote as it
   would sit on the site while it is typed. Tokens are styles.css's. */

.rv-page ::selection {
  background: color-mix(in oklab, var(--accent) 45%, transparent);
  color: var(--ink);
}

.rv {
  padding-block: clamp(2rem, 6vw, 4.5rem) clamp(3.5rem, 9vw, 6.5rem);
}

.rv__in {
  max-width: 70rem;
}

.rv__head h1 {
  font-size: clamp(2.25rem, 1.5rem + 3.6vw, 4rem);
  font-variation-settings: "wdth" 122;
  font-weight: 800;
}

.rv__head h1 em {
  font-style: normal;
  color: var(--accent);
}

.rv__sub {
  margin-top: 1rem;
  max-width: 44ch;
  font-size: var(--t-body);
  line-height: 1.5;
  color: var(--ink-muted);
}

/* ------------------------------------------------------------ the form --- */

.rv__form {
  margin-top: clamp(1.75rem, 5vw, 3rem);
  display: grid;
  gap: 1.75rem;
}

.rv-fields,
.rv-close {
  display: grid;
  gap: 1.25rem;
  min-width: 0;
}

/* The fields on the left, the plate held beside them while the page scrolls. */
@media (min-width: 64rem) {
  .rv__form {
    grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
    column-gap: clamp(2.5rem, 5vw, 4.5rem);
    align-items: start;
  }

  .rv-fields,
  .rv-close,
  .rv-done {
    grid-column: 1;
  }

  .rv-plate {
    grid-column: 2;
    grid-row: 1 / span 3;
    position: sticky;
    top: 6rem;
  }
}

.rv-field {
  display: grid;
  gap: 0.45rem;
  min-width: 0;
}

.rv-pair {
  display: grid;
  gap: 1.25rem;
}

@media (min-width: 36rem) {
  .rv-pair {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.rv-label {
  padding: 0;
  font-size: 1.0625rem;
  font-weight: 650;
  font-variation-settings: "wdth" 106;
  line-height: 1.3;
  color: var(--ink);
}

/* "Optional" is a legend, as it is on the help page's setup rows. */
.rv-opt {
  margin-left: 0.5rem;
  font-family: var(--mono);
  font-size: 0.75rem;
  font-weight: 500;
  font-variation-settings: "wdth" 85;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.rv-input {
  width: 100%;
  min-width: 0;
  padding: 0.8rem 1rem;
  border-radius: var(--r-control);
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  caret-color: var(--accent);
  font: inherit;
  /* 16px or more, or iOS zooms the page when the field takes the focus */
  font-size: 1.0625rem;
  line-height: 1.4;
  transition: border-color 0.2s var(--ease);
}

.rv-input::placeholder {
  color: var(--ink-faint);
  opacity: 1;
}

.rv-input:hover {
  border-color: var(--accent-dim);
}

.rv-input:focus {
  border-color: var(--accent);
}

/* A field the form sent back. Brighter, never red: the sentence under the button says why. */
.rv-input[aria-invalid="true"] {
  border-color: var(--ink);
}

.rv-input--words {
  display: block;
  min-height: 8.5rem;
  padding-block: 0.9rem;
  font-size: 1.1875rem;
  line-height: 1.5;
  resize: vertical;
}

.rv-count {
  justify-self: end;
  font-family: var(--mono);
  font-size: 0.75rem;
  font-variation-settings: "wdth" 85;
  letter-spacing: 0.04em;
  line-height: 1.4;
  color: var(--ink-faint);
  font-variant-numeric: tabular-nums;
}

.rv-at {
  position: relative;
}

.rv-at__sign {
  position: absolute;
  left: 1rem;
  top: 50%;
  translate: 0 -50%;
  color: var(--ink-faint);
  font-size: 1.0625rem;
  line-height: 1;
  pointer-events: none;
}

.rv-at .rv-input {
  padding-left: 2.15rem;
}

/* What you do, and your DAW: keys to press, each a label round a real checkbox. A chosen key
   fills with the accent and takes the dark ink, the home page's lit keycap. No dot and no glow
   anywhere on this page: a grid of lit dots read as generated (Dylan, 2026-10-12). Nothing moves
   under a press: a key keeps its size, its edge and the weight of its name. */
.rv-daws {
  margin: 0;
  padding: 0;
  border: 0;
  min-width: 0;
}

.rv-daws legend {
  margin-bottom: 0.65rem;
}

/* Even blocks, never an odd key out: ten roles as five pairs, nine DAWs three by three. The
   names were measured in this face: "Mastering engineer" needs a half of the form, and the
   DAWs fit a third under the names producers say. Rows share one height. */
.rv-keys {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-auto-rows: 1fr;
  gap: 0.5rem;
}

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

/* The keycap's face and its 3px bottom edge, with the name centred like a legend on a key. */
.rv-key {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 3rem;
  padding: 0.5rem 0.7rem;
  border: 1px solid var(--line);
  border-bottom-width: 3px;
  border-radius: var(--r-control);
  background: var(--surface-2);
  color: var(--ink-muted);
  font-size: 0.9375rem;
  font-weight: 620;
  line-height: 1.2;
  text-align: center;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  transition:
    background-color 0.15s var(--ease),
    border-color 0.15s var(--ease),
    color 0.15s var(--ease);
}

.rv-keys--3 .rv-key {
  padding-inline: 0.4rem;
}

@media (min-width: 36rem) {
  .rv-key {
    font-size: 1rem;
  }
}

/* A 360px phone: one step smaller, or "Mastering engineer" breaks in its half. */
@media (max-width: 23.4rem) {
  .rv-key {
    padding-inline: 0.5rem;
    font-size: 0.875rem;
  }
}

@media (hover: hover) {
  .rv-key:not(.is-on):hover {
    background: oklch(0.345 0.013 250);
  }
}

.rv-key.is-on,
.rv-key:has(input:checked) {
  border-color: var(--accent);
  border-bottom-color: var(--accent-dim);
  background: var(--accent);
  color: var(--accent-ink);
}

.rv-key input,
.rv-yes input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.rv-key:has(input:focus-visible),
.rv-yes:has(input:focus-visible) .rv-yes__box {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.rv-trap {
  position: absolute;
  left: -200vw;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* The yes. A drawn box, ticked in the button's own blue with its dark ink. */
.rv-yes {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 0.85rem;
  align-items: start;
  font-size: 1.0625rem;
  line-height: 1.45;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.rv-yes__box {
  width: 1.5rem;
  height: 1.5rem;
  margin-top: 0.05rem;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: var(--surface) center / 0.95rem no-repeat;
  transition:
    background-color 0.2s var(--ease),
    border-color 0.2s var(--ease);
}

.rv-yes:hover .rv-yes__box {
  border-color: var(--accent-dim);
}

.rv-yes:has(input:checked) .rv-yes__box {
  border-color: var(--accent);
  background-color: var(--accent);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23071226' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3.2 8.4l3.1 3.1 6.5-7'/%3E%3C/svg%3E");
}

.rv-yes[data-invalid] .rv-yes__box {
  border-color: var(--ink);
}

.rv-send {
  display: grid;
  gap: 0.75rem;
}

.rv-send__btn {
  width: 100%;
  min-height: 3.5rem;
}

@media (min-width: 36rem) {
  .rv-send__btn {
    width: auto;
    justify-self: start;
    min-width: 13rem;
  }
}

.rv-send__btn[aria-busy="true"] {
  pointer-events: none;
  background: var(--accent-dim);
  transform: none;
}

.rv-status {
  min-height: 1.6em;
  font-size: 1.0625rem;
  color: var(--ink);
}

.rv-status:empty {
  display: none;
}

.rv-fine {
  max-width: 52ch;
  font-size: 0.875rem;
  line-height: 1.55;
  color: var(--ink-faint);
}

.rv-fine a,
.rv-done a:not(.btn) {
  color: var(--ink);
  text-underline-offset: 3px;
}

/* ----------------------------------------------------------- the plate --- */

.rv-plate {
  min-width: 0;
  padding: 1.1rem 1.25rem 1.3rem;
  background: var(--surface);
  border-radius: var(--r-panel);
}

@media (min-width: 64rem) {
  .rv-plate {
    padding: 1.4rem 1.6rem 1.6rem;
  }
}

.rv-plate__state {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--mono);
  font-size: 0.75rem;
  font-weight: 500;
  font-variation-settings: "wdth" 85;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  line-height: 1.6;
  color: var(--ink-faint);
}

.rv-plate__words {
  margin: 0.9rem 0 0;
  font-size: clamp(1.3125rem, 1.15rem + 0.8vw, 1.625rem);
  font-weight: 640;
  font-variation-settings: "wdth" 108;
  line-height: 1.28;
  letter-spacing: -0.012em;
  color: var(--ink);
  text-wrap: pretty;
  overflow-wrap: anywhere;
  white-space: pre-line;
}

.rv-plate__words:not(:empty)::before {
  content: "\201C";
}

.rv-plate__words:not(:empty)::after {
  content: "\201D";
}

.rv-plate__words:empty::before,
.rv-plate__name:empty::before {
  content: attr(data-empty);
  color: var(--ink-faint);
  font-weight: 450;
  font-variation-settings: "wdth" 100;
  letter-spacing: 0;
}

.rv-plate__who {
  margin-top: 1.1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line-soft);
}

.rv-plate__name {
  font-size: 1.0625rem;
  font-weight: 700;
  font-variation-settings: "wdth" 106;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.rv-plate__role {
  margin-top: 0.15rem;
  font-size: 1rem;
  line-height: 1.4;
  color: var(--ink-muted);
  overflow-wrap: anywhere;
}

.rv-plate__role:empty,
.rv-plate__daws:empty,
.rv-plate__links:not(:has(span:not(:empty))) {
  display: none;
}

.rv-plate__daws {
  list-style: none;
  margin: 0.85rem 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.rv-plate__daws li {
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
  background: var(--surface-2);
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--ink-muted);
}

.rv-plate__links {
  margin-top: 0.85rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1rem;
  font-size: 0.9375rem;
  line-height: 1.5;
  color: var(--ink-muted);
  overflow-wrap: anywhere;
}

.rv-plate__links span:first-child {
  color: var(--accent);
}

/* Sent: a tick draws itself beside the legend, once, and the legend takes the accent. The one
   authored motion on the page. */
.rv-plate__tick {
  display: none;
  flex: none;
  color: var(--accent);
}

.rv-plate.is-sent .rv-plate__tick {
  display: block;
}

.rv-plate.is-sent .rv-plate__tick path {
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  animation: rv-tick 0.5s 0.15s var(--ease) forwards;
}

.rv-plate.is-sent .rv-plate__state {
  color: var(--ink);
}

@keyframes rv-tick {
  to {
    stroke-dashoffset: 0;
  }
}

/* ---------------------------------------------------------------- sent --- */

.rv__form.is-sent [data-rv-part] {
  display: none;
}

/* The thanks lead and the plate stays under them as the receipt. Clear of the site's fixed header. */
.rv-done {
  order: -1;
  scroll-margin-top: 6rem;
  display: grid;
  gap: 0.9rem;
  justify-items: start;
  font-size: var(--t-body);
  line-height: 1.5;
}

.rv-done[hidden] {
  display: none;
}

.rv-done:focus {
  outline: none;
}

.rv-done h2 {
  font-size: clamp(1.75rem, 1.3rem + 2vw, 2.75rem);
}

.rv-done .btn {
  margin-top: 0.6rem;
}

@media (prefers-reduced-motion: reduce) {
  .rv-plate.is-sent .rv-plate__tick path {
    animation: none;
    stroke-dashoffset: 0;
  }

  .rv-key,
  .rv-input,
  .rv-yes__box {
    transition: none;
  }
}
