:root {
  color-scheme: light;
  --paper: #f4f4f0;
  --ink: #0b0b0a;
  --quiet: #6f6f69;
  --line: #cfcfc8;
  --signal: #fa4b2a;
  --white: #fff;
  font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  background: var(--paper);
}

body {
  min-width: 300px;
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(90deg, transparent calc(100% - 1px), rgba(11, 11, 10, 0.045) 1px) 0 0 / 32px 100%,
    var(--paper);
}

.callback-page {
  min-height: 100%;
  display: grid;
  place-items: center;
}

.callback-card {
  width: min(520px, calc(100% - 40px));
  padding-top: 28px;
  border-top: 4px solid var(--ink);
}

.callback-card h1 {
  margin: 0 0 34px;
  font-size: clamp(34px, 8vw, 64px);
  line-height: 0.95;
  letter-spacing: -0.055em;
}

.callback-card p {
  max-width: 42ch;
}

.callback-meta {
  margin-top: 28px;
  color: var(--quiet);
  font: 12px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace;
}

button,
input {
  font: inherit;
}

button {
  color: inherit;
}

.shell {
  width: min(1120px, calc(100% - 48px));
  margin: 0 auto;
}

.masthead {
  min-height: 96px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--ink);
}

.wordmark {
  color: inherit;
  text-decoration: none;
  font-size: 28px;
  font-weight: 780;
  letter-spacing: -0.055em;
}

.wordmark span {
  color: var(--signal);
}

.connection {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font: 11px/1 ui-monospace, SFMono-Regular, Menlo, monospace;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.connection-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--quiet);
}

.connection[data-state="live"] .connection-dot {
  background: var(--signal);
  box-shadow: 0 0 0 5px color-mix(in srgb, var(--signal) 15%, transparent);
}

.maker {
  min-height: 580px;
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(300px, 0.75fr);
  gap: clamp(50px, 10vw, 150px);
  align-items: center;
  padding: 72px 0 82px;
  border-bottom: 1px solid var(--ink);
  position: relative;
}

.maker-heading h1 {
  max-width: 750px;
  margin: 0;
  font-size: clamp(64px, 8.6vw, 132px);
  font-weight: 760;
  line-height: 0.84;
  letter-spacing: -0.075em;
}

.maker-heading p {
  max-width: 470px;
  margin: 44px 0 0;
  color: var(--quiet);
  font-size: 17px;
  line-height: 1.55;
}

#hook-form {
  align-self: end;
}

#hook-form > label,
#hook-form legend,
#setup-form label {
  display: block;
  margin: 0 0 10px;
  color: var(--quiet);
  font: 11px/1.4 ui-monospace, SFMono-Regular, Menlo, monospace;
  text-transform: uppercase;
  letter-spacing: 0.07em;
}

#label,
#admin-token {
  width: 100%;
  padding: 12px 0;
  color: var(--ink);
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--ink);
  border-radius: 0;
  outline: none;
  font-size: 19px;
}

#label::placeholder {
  color: #a1a19b;
}

#label:focus,
#admin-token:focus {
  border-bottom-width: 3px;
  padding-bottom: 10px;
}

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

.ttl-options {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border: 1px solid var(--ink);
}

.ttl-options label {
  min-width: 0;
}

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

.ttl-options span {
  display: block;
  padding: 12px 6px;
  text-align: center;
  cursor: pointer;
  font-size: 13px;
  border-right: 1px solid var(--ink);
}

.ttl-options label:last-child span {
  border-right: 0;
}

.ttl-options input:checked + span {
  color: var(--paper);
  background: var(--ink);
}

.ttl-options input:focus-visible + span {
  outline: 3px solid var(--signal);
  outline-offset: -3px;
}

.make-button {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  color: var(--white);
  background: var(--signal);
  border: 0;
  cursor: pointer;
  font-weight: 720;
}

.make-button:hover {
  background: var(--ink);
}

.make-button:focus-visible,
.link-copy:focus-visible,
#setup-form button:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 3px;
}

.make-button:disabled {
  opacity: 0.5;
  cursor: wait;
}

.created {
  grid-column: 2;
  align-self: end;
  padding: 20px;
  background: var(--ink);
  color: var(--paper);
}

.created-label,
.created-expiry {
  margin: 0;
  font: 11px/1.4 ui-monospace, SFMono-Regular, Menlo, monospace;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.created-label {
  color: var(--signal);
}

.link-copy {
  width: 100%;
  display: flex;
  gap: 16px;
  justify-content: space-between;
  align-items: center;
  margin: 16px 0 22px;
  padding: 14px 0;
  color: inherit;
  background: transparent;
  border: solid var(--paper);
  border-width: 1px 0;
  cursor: pointer;
  text-align: left;
}

#link-value {
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font: 13px/1.3 ui-monospace, SFMono-Regular, Menlo, monospace;
}

.copy-mark {
  color: var(--signal);
  font-size: 12px;
}

.created-expiry {
  color: #989891;
}

.created-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.created-foot button {
  padding: 0;
  color: var(--paper);
  background: transparent;
  border: 0;
  border-bottom: 1px solid #66665f;
  cursor: pointer;
  font: 11px/1.4 ui-monospace, SFMono-Regular, Menlo, monospace;
}

.inbox {
  padding: 36px 0 100px;
}

.section-title {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--ink);
}

.section-title h2 {
  margin: 0;
  font-size: 18px;
  letter-spacing: -0.025em;
}

.section-title span {
  font: 12px/1 ui-monospace, SFMono-Regular, Menlo, monospace;
}

.empty {
  min-height: 220px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  color: var(--quiet);
}

.empty-mark {
  width: 14px;
  height: 14px;
  border: 1px solid currentColor;
  border-radius: 50%;
}

.empty p {
  margin: 0;
  font-size: 14px;
}

.events {
  margin: 0;
  padding: 0;
  list-style: none;
}

.event {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr) auto;
  gap: 26px;
  padding: 24px 0;
  border-bottom: 1px solid var(--line);
}

.event-time,
.event-source,
.event-status {
  font: 11px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.event-source {
  display: block;
  margin-top: 4px;
  color: var(--quiet);
}

.event-title {
  margin: 0 0 7px;
  font-size: 19px;
  line-height: 1.15;
  letter-spacing: -0.025em;
}

.event-message {
  max-width: 680px;
  margin: 0;
  color: var(--quiet);
  line-height: 1.5;
  white-space: pre-wrap;
}

.event-status {
  color: var(--signal);
}

dialog {
  width: min(460px, calc(100% - 32px));
  padding: 0;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--ink);
  box-shadow: 14px 14px 0 var(--ink);
}

dialog::backdrop {
  background: rgba(244, 244, 240, 0.9);
  backdrop-filter: blur(5px);
}

#setup-form {
  padding: 34px;
}

.setup-kicker {
  color: var(--signal);
  font: 11px/1 ui-monospace, SFMono-Regular, Menlo, monospace;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

#setup-form h2 {
  margin: 24px 0 10px;
  font-size: 40px;
  line-height: 0.95;
  letter-spacing: -0.055em;
}

#setup-form > p:not(.setup-kicker):not(.setup-error) {
  color: var(--quiet);
  line-height: 1.5;
  margin-bottom: 28px;
}

.setup-error {
  min-height: 20px;
  color: var(--signal);
  font-size: 13px;
}

#setup-form button {
  width: 100%;
  margin-top: 8px;
  padding: 15px;
  color: var(--paper);
  background: var(--ink);
  border: 0;
  cursor: pointer;
  font-weight: 700;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translate(-50%, 20px);
  padding: 10px 14px;
  color: var(--paper);
  background: var(--ink);
  font-size: 13px;
  opacity: 0;
  pointer-events: none;
  transition: 180ms ease;
}

.toast[data-visible="true"] {
  opacity: 1;
  transform: translate(-50%, 0);
}

@media (max-width: 760px) {
  .shell {
    width: min(100% - 28px, 560px);
  }

  .masthead {
    min-height: 74px;
  }

  .maker {
    min-height: 0;
    display: block;
    padding: 54px 0 60px;
  }

  .maker-heading h1 {
    font-size: clamp(54px, 17vw, 86px);
  }

  .maker-heading p {
    margin-top: 28px;
  }

  #hook-form {
    margin-top: 54px;
  }

  .created {
    margin-top: 24px;
  }

  .event {
    grid-template-columns: 1fr auto;
    gap: 12px 20px;
  }

  .event > div:first-child {
    grid-column: 1 / -1;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}
