/*
 * Heissenberger Laboratory CI v2, Palette B (spec 0012). The fonts are the fonts of the system.
 * Raspberry #d9507a is 3.9:1 on white: only for primary buttons with large bold text, headlines
 * of 24px or more, and shapes. Small text uses Deep Raspberry. Teal as text is always Deep Teal.
 */
:root {
  /* The theme follows the setting of the system: color-scheme and light-dark(). */
  color-scheme: light dark;

  --raspberry: #d9507a;
  --teal: #3d9aa2;
  --purple: #7a5f99;
  --ink: #1a1a19;
  --mist: #f1f1ee;

  --background: light-dark(#ffffff, #1a1a19);
  --foreground: light-dark(#1a1a19, #f1f1ee);
  --card: light-dark(#f1f1ee, #242422);
  --muted-foreground: light-dark(#6a6a64, #b4b4af);
  /* On Ink, the button color is Light Raspberry with Ink text (6.3:1). */
  --primary: light-dark(#d9507a, #e8789a);
  --primary-hover: light-dark(#b03663, #f09ab4);
  --primary-deep: light-dark(#b03663, #e8789a);
  --primary-foreground: light-dark(#ffffff, #1a1a19);
  /* Selected states and the focus outline: Deep Teal, 5:1 or more on each ground. */
  --selected: light-dark(#2a6f78, #7cc5cb);
  --selected-foreground: light-dark(#ffffff, #1a1a19);
  --border: light-dark(color-mix(in srgb, #6a6a64 25%, white), color-mix(in srgb, #f1f1ee 16%, #1a1a19));
  /* Borders of controls: 3:1 or more against the background (WCAG 1.4.11). */
  --input: light-dark(color-mix(in srgb, #6a6a64 80%, white), color-mix(in srgb, #f1f1ee 40%, #1a1a19));
  --gradient: linear-gradient(100deg, light-dark(#b03663, #e8789a) 10%, light-dark(#7a5f99, #b39ad1) 55%, light-dark(#2a6f78, #7cc5cb) 100%);
  --splash-opacity: 0.28;

  --radius: 0.5rem;
  --header-height: 4rem;
  --control-height: 2.75rem;
  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  /* Keyboard focus does not go below the sticky header. */
  scroll-padding-top: calc(var(--header-height) + 1rem);
}

/* light-dark() takes only colors: the opacity changes with a media query. */
@media (prefers-color-scheme: dark) {
  :root {
    --splash-opacity: 0.22;
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
  margin: 0;
  background: var(--background);
  color: var(--foreground);
  font: 1rem/1.6 var(--font-sans);
  overflow-wrap: break-word;
  -webkit-font-smoothing: antialiased;
}

/* One clearly visible focus outline for each control (WCAG 2.4.7). */
:focus-visible {
  outline: 2px solid var(--selected);
  outline-offset: 2px;
}

::selection {
  background: color-mix(in srgb, var(--primary) 28%, transparent);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  border: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.container {
  width: 100%;
  max-width: 80rem;
  margin-inline: auto;
  padding-inline: 1rem;
}

@media (min-width: 37.5em) {
  .container {
    padding-inline: 1.5rem;
  }
}

a {
  color: var(--primary-deep);
  text-underline-offset: 0.2em;
}

/* Header */

.skip-link {
  position: absolute;
  top: 0.5rem;
  left: 0.5rem;
  z-index: 100;
  padding: 0.5rem 1rem;
  border-radius: var(--radius);
  background: var(--background);
  font-weight: 600;
  translate: 0 -200%;
}

.skip-link:focus-visible {
  translate: 0;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--background) 92%, transparent);
  backdrop-filter: blur(8px);
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: var(--header-height);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--foreground);
  font-weight: 700;
  text-decoration: none;
}

/* CI: the simple logo has a minimum width of 100px. */
.brand img {
  display: block;
  width: 100px;
  height: auto;
}

.brand-name {
  display: none;
  padding-left: 0.75rem;
  border-left: 1px solid var(--border);
  color: var(--muted-foreground);
  letter-spacing: 0.01em;
  white-space: nowrap;
}

@media (min-width: 37.5em) {
  .brand img {
    width: 120px;
  }

  .brand-name {
    display: block;
  }
}

.site-header nav {
  display: flex;
  gap: 0.25rem;
}

.site-header nav a {
  display: flex;
  align-items: center;
  min-height: var(--control-height);
  padding-inline: 0.75rem;
  border-radius: var(--radius);
  color: var(--foreground);
  font-weight: 600;
  text-decoration: none;
}

.site-header nav a:hover {
  background: var(--card);
}

.site-header nav a[aria-current] {
  color: var(--primary-deep);
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 0.4em;
}

/* Narrow screens (spec 0030): "Request" and "Inbox" are in a popover behind the menu button. */
.nav-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: var(--control-height);
  height: var(--control-height);
  padding: 0;
  border: 0;
  border-radius: var(--radius);
  background: transparent;
  color: var(--foreground);
  cursor: pointer;
}

.nav-toggle:hover,
.nav-toggle:has(+ .nav-more:popover-open) {
  background: var(--card);
}

.nav-more {
  position: fixed;
  inset: auto;
  inset-block-start: var(--header-height);
  inset-inline-end: 1rem;
  flex-direction: column;
  gap: 0.25rem;
  min-inline-size: 12rem;
  max-inline-size: calc(100dvw - 2rem);
  margin: 0.25rem 0 0;
  padding: 0.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--background);
  color: var(--foreground);
  box-shadow: 0 1.5rem 3rem -1.5rem color-mix(in srgb, var(--ink) 30%, transparent);
}

.nav-more:popover-open {
  display: flex;
}

@media (min-width: 37.5em) {
  .nav-toggle {
    display: none;
  }

  /* The same container is inline: the popover attribute stays, but it does not show as a popover. */
  .nav-more {
    position: static;
    display: flex;
    flex-direction: row;
    min-inline-size: 0;
    max-inline-size: none;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
  }
}

/* Views */

main {
  position: relative;
  z-index: 1;
  flex: 1;
  max-width: 44rem;
  padding-block: 1.5rem 3rem;
}

main:focus {
  outline: none;
}

@media (min-width: 37.5em) {
  main {
    padding-block: 3rem 4rem;
  }

  section {
    padding: 2.5rem;
    border: 1px solid var(--border);
    border-radius: calc(var(--radius) * 1.8);
    background: var(--card);
  }
}

h1 {
  margin: 0 0 0.75rem;
  font-size: clamp(1.75rem, 1.5rem + 1.2vw, 2.25rem);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.01em;
  text-wrap: balance;
  hyphens: auto;
}

h1:focus {
  outline: none;
}

h2 {
  margin: 2rem 0 0.25rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.25;
}

p,
li {
  text-wrap: pretty;
}

section > p {
  margin: 0 0 1.25rem;
}

h1 + p {
  color: var(--muted-foreground);
  font-size: 1.0625rem;
}

.eyebrow {
  margin: 0 0 0.5rem;
  color: var(--selected);
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1.4;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.hint {
  margin: 0;
  color: var(--muted-foreground);
  font-size: 0.875rem;
  line-height: 1.5;
}

/* Form: a label is above its field, a hint is below. Groups are farther apart than their parts. */

form {
  display: grid;
  gap: 1.75rem;
  margin-top: 1.5rem;
}

.stack {
  display: grid;
  gap: 0.375rem;
}

.group {
  display: grid;
  gap: 0.25rem;
}

label,
legend {
  font-weight: 600;
}

fieldset {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

legend {
  margin-bottom: 0.5rem;
  padding: 0;
}

textarea,
input[type="text"],
input[type="password"],
input[type="number"],
input[type="datetime-local"] {
  width: 100%;
  min-height: var(--control-height);
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--input);
  border-radius: var(--radius);
  background: var(--background);
  color: var(--foreground);
  font: inherit;
  /* 1rem or more: iOS does not zoom into the field. */
  font-size: max(1rem, 1em);
}

textarea,
input[readonly],
pre {
  font-family: var(--font-mono);
  /* The digit 0 with a slash, if the font has the feature `zero` (spec 0031). */
  font-variant-numeric: slashed-zero;
}

textarea {
  display: block;
  min-height: 8rem;
  resize: vertical;
}

input[type="number"] {
  width: 6rem;
}

input[type="datetime-local"] {
  width: auto;
}

input:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

[aria-invalid="true"] {
  border-color: var(--primary-deep);
  box-shadow: 0 0 0 1px var(--primary-deep);
}

.field {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.375rem 1rem;
}

/* The fields of a switch: below the switch, in line with its text. */
.detail {
  margin: 0.25rem 0 0.75rem 1.25rem;
  padding-left: 1.5rem;
  border-left: 2px solid var(--border);
}

/*
 * Desktop: the create view shows the secret and all options without a scroll operation.
 * The options are in columns. The sequence in the DOM is the reading sequence: secret,
 * expiry, views, remember, options, button.
 */

#secret-field {
  grid-area: secret;
  grid-template-rows: auto 1fr auto;
}

#expiry-field {
  grid-area: expiry;
}

#views-field {
  grid-area: views;
}

#remember-field {
  grid-area: remember;
}

#options-field {
  grid-area: options;
  align-content: start;
}

#create-error {
  grid-area: error;
}

#submit-field {
  grid-area: submit;
}

form {
  grid-template-areas: "secret" "expiry" "views" "remember" "options" "error" "submit";
}

@media (min-width: 48em) {
  main:has(#create-view:not([hidden])) {
    max-width: 80rem;
    padding-block: 1.5rem;
  }

  #create-view {
    padding: 1.75rem 2rem;
  }

  #create-view h1 {
    margin-bottom: 0;
  }

  form {
    grid-template-areas:
      "secret expiry"
      "secret views"
      "secret remember"
      "secret options"
      "error error"
      "submit submit";
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 1rem 2rem;
    margin-top: 0.75rem;
  }

  #secret-field textarea {
    height: 100%;
  }

  /* The hint is left of the button. The button is the last item in the reading sequence. */
  #submit-field {
    display: flex;
    flex-direction: row-reverse;
    align-items: center;
    justify-content: flex-start;
    gap: 1.25rem;
  }

  #submit-field button {
    width: auto;
    min-width: 16rem;
  }
}

@media (min-width: 60em) {
  form {
    grid-template-areas:
      "secret expiry options"
      "secret views options"
      "secret remember options"
      "secret . options"
      "error error error"
      "submit submit submit";
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr) minmax(0, 1.1fr);
    grid-template-rows: auto auto auto 1fr;
  }

  .detail {
    margin-block: 0 0.5rem;
  }

  /* The two password fields are side by side: each label stays above its field. */
  #password-field {
    grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr));
    grid-auto-flow: column;
    grid-template-rows: auto auto;
    column-gap: 0.75rem;
  }

  #show-password {
    grid-row: 3;
    grid-column: 1 / -1;
  }

  #password-error {
    grid-row: 4;
    grid-column: 1 / -1;
  }
}

/* A mouse needs smaller targets than a finger: 36px (WCAG 2.5.8 asks for 24px). */
@media (min-width: 48em) and (pointer: fine) {
  :root {
    --control-height: 2.25rem;
  }

  textarea,
  input[type="text"],
  input[type="password"],
  input[type="number"],
  input[type="datetime-local"] {
    padding-block: 0.35rem;
  }

  .choices {
    gap: 0.375rem;
  }

  .choices label {
    padding-inline: 0.7rem;
  }
}

/* Expiry: radio buttons that look like chips */

.choices {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.choices input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.choices label {
  display: flex;
  align-items: center;
  min-height: var(--control-height);
  padding-inline: 1rem;
  border: 1px solid var(--input);
  border-radius: 999px;
  background: var(--background);
  font-weight: 400;
  cursor: pointer;
}

.choices label:hover {
  border-color: var(--selected);
}

.choices input:checked + label {
  border-color: var(--selected);
  background: var(--selected);
  color: var(--selected-foreground);
  font-weight: 600;
}

.choices input:focus-visible + label {
  outline: 2px solid var(--selected);
  outline-offset: 2px;
}

/* Switches and checkboxes: native inputs with a custom look */

.switch,
.check {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-height: var(--control-height);
  font-weight: 400;
  cursor: pointer;
}

.switch:has(:disabled),
.check:has(:disabled) {
  color: var(--muted-foreground);
  cursor: not-allowed;
}

.switch input,
.check input {
  position: relative;
  flex: none;
  margin: 0;
  border: 1px solid var(--input);
  background: var(--background);
  appearance: none;
  cursor: inherit;
}

.switch input {
  width: 2.75rem;
  height: 1.5rem;
  border-radius: 999px;
}

.switch input::before {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 1.125rem;
  height: 1.125rem;
  border-radius: 50%;
  background: var(--muted-foreground);
}

.switch input:checked,
.check input:checked {
  border-color: var(--selected);
  background: var(--selected);
}

.switch input:checked::before {
  background: var(--selected-foreground);
  translate: 1.25rem 0;
}

.check input {
  width: 1.375rem;
  height: 1.375rem;
  border-radius: 0.3rem;
}

.check input:checked::before {
  content: "";
  position: absolute;
  top: 0.125rem;
  left: 0.4rem;
  width: 0.4rem;
  height: 0.75rem;
  border: solid var(--selected-foreground);
  border-width: 0 2px 2px 0;
  rotate: 45deg;
}

.member-list {
  display: grid;
  padding: 0.25rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--background);
}

.member-list:empty {
  display: none;
}

/* The name of a member, with the shared groups below it. */
.member-text {
  display: grid;
  padding-block: 0.25rem;
  overflow-wrap: anywhere;
}

.member-groups {
  color: var(--muted-foreground);
  font-size: 0.875rem;
}

/* Buttons: one primary button for each view (CI: 19px bold on Raspberry). */

button,
a.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  min-height: 3rem;
  padding: 0.5rem 1.5rem;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: var(--primary);
  color: var(--primary-foreground);
  font: inherit;
  font-size: 1.1875rem;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}

button:hover,
a.button:hover {
  background: var(--primary-hover);
}

button:active,
a.button:active {
  translate: 0 1px;
}

button.secondary,
a.button.secondary {
  border-color: var(--foreground);
  background: transparent;
  color: var(--foreground);
  font-size: 1rem;
  font-weight: 600;
}

button.secondary:hover,
a.button.secondary:hover {
  background: color-mix(in srgb, var(--foreground) 8%, transparent);
}

button.secondary[aria-pressed="true"] {
  background: color-mix(in srgb, var(--foreground) 14%, transparent);
}

/* A small toggle button below a field, for example "Show password" (spec 0035). */
button.small {
  justify-self: start;
  min-height: var(--control-height);
  padding: 0.25rem 0.75rem;
  font-size: 0.875rem;
}

/* A button is disabled only while its request runs. */
button:disabled {
  opacity: 0.7;
  cursor: progress;
}

button:disabled::before {
  content: "";
  width: 1em;
  height: 1em;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
}

@media (prefers-reduced-motion: no-preference) {
  button:disabled::before {
    animation: spin 0.8s linear infinite;
  }

  .switch input,
  .switch input::before,
  button,
  a.button,
  .choices label {
    transition:
      background-color 0.15s,
      border-color 0.15s,
      translate 0.15s;
  }
}

@keyframes spin {
  to {
    rotate: 1turn;
  }
}

form button[type="submit"],
#show-secret,
#register-button,
#show-inbox {
  width: 100%;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

/* A row with only hidden buttons takes no space. */
.actions:not(:has(> :not([hidden]))) {
  display: none;
}

.copy-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-block: 0.75rem;
}

.copy-row input {
  flex: 1 1 14rem;
  width: auto;
  min-height: 3rem;
  text-overflow: ellipsis;
}

.copy-row button {
  flex: 1 0 auto;
}

/* Messages: an icon and text, not only color */

.error,
[role="status"]:not(.visually-hidden) {
  display: flex;
  gap: 0.75rem;
  margin: 0;
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--message) 10%, transparent);
  color: var(--foreground);
  outline: 1px solid color-mix(in srgb, var(--message) 45%, transparent);
  outline-offset: -1px;
}

.error {
  --message: var(--primary-deep);
}

[role="status"] {
  --message: var(--selected);
}

/* The icons have an empty alternative text: screen readers do not read them (spec 0033). */
.error::before,
[role="status"]:not(.visually-hidden)::before {
  content: "!";
  content: "!" / "";
  flex: none;
  width: 1.5rem;
  height: 1.5rem;
  margin-top: 0.05rem;
  border-radius: 50%;
  background: var(--message);
  color: var(--background);
  font-weight: 700;
  line-height: 1.5rem;
  text-align: center;
}

[role="status"]:not(.visually-hidden)::before {
  content: "✓";
  content: "✓" / "";
}

/* A message that is not a success, for example the empty inbox: no check mark. */
[role="status"].note::before {
  content: none;
}

/*
 * A caution, for example whitespace at the end of a secret (spec 0036): an icon and a
 * border, the foreground color. It is not an error.
 */
.caution {
  display: flex;
  gap: 0.6rem;
  margin: 0;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--input);
  border-radius: var(--radius);
  background: var(--background);
  font-size: 0.875rem;
  line-height: 1.5;
}

.caution::before {
  content: "i";
  content: "i" / "";
  flex: none;
  width: 1.25rem;
  height: 1.25rem;
  margin-top: 0.05rem;
  border: 1.5px solid currentColor;
  border-radius: 50%;
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1.1rem;
  text-align: center;
}

section > .caution {
  margin-top: 1rem;
}

/*
 * The preview below a secret field (spec 0037): the text with the markers, on Ink as the
 * secret panel, with less padding.
 */
.preview {
  max-height: 12rem;
  padding: 0.6rem 0.75rem;
  overflow: auto;
  border-color: transparent;
  background: #1a1a19;
  color: #f1f1ee;
  font-size: 0.9375rem;
  line-height: 1.6;
}

.preview::selection,
.preview ::selection {
  background: color-mix(in srgb, #e8789a 45%, transparent);
}

/* The character counter of a secret field near the limit (spec 0038). */
.count {
  font-variant-numeric: tabular-nums;
}

.count.over {
  color: var(--primary-deep);
  font-weight: 600;
}

/* The legend of the markers in the secret panel (spec 0036). */
.legend {
  margin-top: 0.75rem;
  color: var(--muted-foreground);
  font-size: 0.875rem;
  line-height: 1.5;
}

.legend ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.25rem;
  margin: 0 0 0.25rem;
  padding: 0;
  list-style: none;
}

.legend-mark {
  margin-right: 0.4em;
  color: var(--foreground);
  font-family: var(--font-mono);
}

.legend p {
  margin: 0;
}

/* The message of one field, directly below the field (spec 0033). */
.field-error {
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  line-height: 1.5;
}

.field-error::before {
  width: 1.25rem;
  height: 1.25rem;
  line-height: 1.25rem;
}

/* The reason below a disabled switch, in line with the switch text. */
.switch-note {
  margin: 0 0 0.5rem 3.5rem;
}

section > .error,
section > [role="status"],
section > .hint {
  margin-top: 1rem;
}

/* Status, inbox, confirmation */

#status-lines,
.inbox {
  display: grid;
  margin: 0 0 1.5rem;
  padding: 0;
  list-style: none;
}

#status-lines li {
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border);
}

#status-lines li:first-child {
  font-weight: 700;
}

.inbox {
  gap: 0.75rem;
}

.inbox li {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--background);
}

/* One entry (spec 0041): the type, the title, the status, the times; "Open" is filled. */
.inbox-text {
  display: grid;
  flex: 1 1 16rem;
  gap: 0.25rem;
  min-width: 0;
}

.inbox .eyebrow {
  margin: 0;
}

.inbox-title {
  margin: 0;
  padding: 0;
  border: 0;
  font-size: 1.25rem;
  font-weight: 800;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.inbox-status {
  margin: 0;
  font-weight: 600;
}

.inbox-times {
  display: grid;
  gap: 0.125rem;
  margin: 0.5rem 0 0;
  color: var(--muted-foreground);
  font-size: 0.875rem;
  font-variant-numeric: tabular-nums;
}

.inbox-times div {
  display: grid;
  grid-template-columns: 7.5rem 1fr;
  gap: 0.75rem;
}

.inbox-times dd {
  margin: 0;
}

.inbox a.button {
  min-height: var(--control-height);
  font-size: 1rem;
}

/* After the first load, "Refresh" is a small button (spec 0041). */
#show-inbox.secondary {
  width: auto;
  min-height: var(--control-height);
  margin-top: 0;
}

#burn-confirm {
  margin-top: 1.5rem;
  padding: 1rem;
  border: 1px solid var(--input);
  border-radius: var(--radius);
  background: var(--background);
}

#burn-confirm p {
  margin: 0;
  font-weight: 600;
}

#burn-confirm .actions {
  margin-top: 1rem;
}

#show-inbox {
  margin-top: 1rem;
}

#reveal-form {
  margin-top: 0;
}

/* Notifications (spec 0026) */

#notify-inbox-field {
  margin-top: 1rem;
}

#notify-inbox {
  width: 100%;
  margin-top: 0.75rem;
}

#notify-inbox-state {
  margin-top: 0.5rem;
}

pre {
  margin: 0;
  padding: 1rem;
  border: 1px solid var(--input);
  border-radius: var(--radius);
  background: var(--background);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

/*
 * The views of the recipient: customers see them. They show the CI with the color fields of
 * the logo, a gradient headline (24px or more), and an Ink panel for the secret.
 */

.splash-stage {
  display: none;
  position: absolute;
  inset: 0;
  overflow: clip;
  pointer-events: none;
}

body:has(:is(#reveal-view, #secret-view, #fulfil-view):not([hidden])) .splash-stage {
  display: block;
}

.splash {
  position: absolute;
  border-radius: 50%;
  filter: blur(64px);
  opacity: var(--splash-opacity);
}

.splash:nth-child(1) {
  top: 1rem;
  left: calc(50% - 28rem);
  width: 24rem;
  height: 24rem;
  background: var(--raspberry);
}

.splash:nth-child(2) {
  top: 10rem;
  left: calc(50% + 6rem);
  width: 22rem;
  height: 22rem;
  background: var(--teal);
}

.splash:nth-child(3) {
  top: 24rem;
  left: calc(50% - 12rem);
  width: 18rem;
  height: 18rem;
  background: var(--purple);
}

:is(#reveal-view, #secret-view, #fulfil-view) {
  padding: 1.5rem;
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) * 2.5);
  background: color-mix(in srgb, var(--background) 80%, transparent);
  box-shadow: 0 1.5rem 3rem -1.5rem color-mix(in srgb, var(--ink) 30%, transparent);
  backdrop-filter: blur(20px);
}

@media (min-width: 37.5em) {
  main:has(:is(#reveal-view, #secret-view, #fulfil-view):not([hidden])) {
    padding-block-start: 5rem;
  }

  :is(#reveal-view, #secret-view, #fulfil-view) {
    padding: 3rem;
  }
}

.text-gradient {
  background: var(--gradient);
  background-clip: text;
  -webkit-background-clip: text;
  color: transparent;
  /* The descenders stay inside the clipped background. */
  padding-bottom: 0.1em;
}

.points {
  display: grid;
  gap: 1rem;
  margin: 1.75rem 0 2rem;
  padding: 0;
  list-style: none;
}

.points li {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.points svg {
  flex: none;
  width: 2.75rem;
  height: 2.75rem;
  padding: 0.65rem;
  border-radius: calc(var(--radius) * 1.4);
  background: color-mix(in srgb, var(--selected) 14%, transparent);
  color: var(--selected);
}

/* After a failed reveal, only the heading and the message stay. */
#reveal-text[hidden] ~ .points,
#reveal-view:has(#reveal-text[hidden]) .eyebrow {
  display: none;
}

#reveal-view .error {
  margin-top: 1.25rem;
}

/* The secret: an Ink panel in each theme, with a border in the colors of the logo. */
#secret-text {
  min-height: 5rem;
  margin-top: 1.5rem;
  padding: 1.25rem;
  border: 2px solid transparent;
  border-radius: calc(var(--radius) * 1.8);
  background:
    linear-gradient(#1a1a19, #1a1a19) padding-box,
    linear-gradient(100deg, #d9507a 10%, #7a5f99 55%, #3d9aa2 100%) border-box;
  color: #f1f1ee;
  font-size: 1.0625rem;
  line-height: 1.6;
}

#secret-text::selection {
  background: color-mix(in srgb, #e8789a 45%, transparent);
}

/*
 * The markers of spec 0031. Each marker is ::before content with an empty alternative text:
 * screen readers do not read it, and a copy does not contain it.
 */
.marked .mark {
  position: relative;
}

/* 60% of Mist on Ink is 6:1: the code points are small text (WCAG 1.4.3). */
.marked .mark::before {
  color: color-mix(in srgb, #f1f1ee 60%, transparent);
  pointer-events: none;
}

.marked.marks [data-kind="space"]::before {
  content: "·" / "";
  position: absolute;
  inset: 0;
  text-align: center;
}

.marked.marks [data-kind="tab"]::before {
  content: "→" / "";
  position: absolute;
  left: 0;
}

.marked.marks [data-kind="newline"]::before {
  content: "⏎" / "";
}

/* A special space and an invisible character: always marked, with the code point. */
.marked [data-kind="special-space"]::before,
.marked [data-kind="invisible"]::before {
  content: attr(data-code) / "";
  margin-inline: 0.15em;
  padding-inline: 0.25em;
  border: 1px solid currentColor;
  border-radius: 0.25em;
  font-size: 0.7em;
  vertical-align: 0.15em;
}

@media (prefers-reduced-motion: no-preference) {
  /* The fields slowly swell: 6s out and 6s back, each field at a different phase. */
  .splash {
    animation: splash-breathe 6s ease-in-out infinite alternate;
  }

  .splash:nth-child(2) {
    animation-delay: -4s;
  }

  .splash:nth-child(3) {
    animation-delay: -8s;
  }

  :is(#reveal-view, #secret-view, #fulfil-view) {
    animation: view-in 0.5s ease-out both;
  }
}

/* The peak opacity stays low: the text keeps its contrast. */
@keyframes splash-breathe {
  from {
    scale: 1;
    opacity: var(--splash-opacity);
  }

  to {
    scale: 1.08;
    opacity: calc(var(--splash-opacity) * 1.25);
  }
}

@keyframes view-in {
  from {
    opacity: 0;
    translate: 0 0.75rem;
  }
}

/* Footer: an Ink band in each theme */

.site-footer {
  color-scheme: dark;
  padding-block: 1.5rem;
  background: var(--background);
  color: var(--muted-foreground);
  font-size: 0.875rem;
}

.site-footer .container {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1.5rem;
}

.site-footer p {
  margin: 0;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
}

.site-footer a {
  color: var(--foreground);
  font-weight: 600;
  text-decoration: none;
}

.site-footer a:hover {
  color: #e8789a;
}

@media (prefers-color-scheme: dark) {
  .site-footer {
    border-top: 1px solid var(--border);
    background: #121211;
  }
}

/* Forced colors: the native controls and system colors replace the custom look. */
@media (forced-colors: active) {
  .switch input,
  .check input {
    width: 1.25rem;
    height: 1.25rem;
    appearance: auto;
  }

  .switch input::before,
  .check input::before {
    display: none;
  }

  .choices input:checked + label {
    border-width: 3px;
  }

  .text-gradient {
    background: none;
    color: CanvasText;
  }

  .splash-stage {
    display: none !important;
  }
}

/* Request view and fulfil view (spec 0028): one column, without the areas of the create form. */

#request-form,
#fulfil-form,
#reveal-form {
  grid-template-areas: none;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: none;
}

#request-form > p {
  margin: 0;
}

select {
  min-height: var(--control-height);
  padding: 0.35rem 0.75rem;
  border: 1px solid var(--input);
  border-radius: var(--radius);
  background: var(--background);
  color: var(--foreground);
  font: inherit;
  /* 1rem or more: iOS does not zoom into the field. */
  font-size: max(1rem, 1em);
}

#request-result {
  margin-top: 1.5rem;
}

#request-result .actions {
  margin-top: 0.5rem;
}

.request-asks {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 700;
  overflow-wrap: anywhere;
}

/* The caution next to the name of the member (spec 0034). */
#fulfil-trust {
  margin: 0.5rem 0 0;
  font-size: 0.9375rem;
  line-height: 1.5;
}

#fulfil-start .points {
  margin-block: 1.25rem 0;
}

/* A used request link and a sent secret: only the heading and the message stay. */
#fulfil-view:has(#fulfil-start[hidden]):has(#fulfil-form[hidden]) .eyebrow {
  display: none;
}

/* The subject of a request (spec 0039): the question to the person, in large text. */
.request-subject {
  margin: 0.25rem 0 0.5rem;
  padding: 0.25rem 0 0.25rem 1rem;
  border-left: 4px solid var(--primary);
  color: var(--foreground);
  font-size: clamp(1.5rem, 1.3rem + 1vw, 1.875rem);
  font-weight: 800;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

/* Without JavaScript the page has no view (spec 0035). */
.noscript {
  margin: 0 0 1rem;
  padding: 0.75rem 1rem;
  border: 1px solid var(--input);
  border-radius: var(--radius);
  background: var(--card);
}

@media print {
  .site-header,
  .site-footer,
  .splash-stage {
    display: none !important;
  }
}
