/* briefly's one stylesheet, with no build step. Colours come from the
   variables at the top, with a dark set that follows the visitor's system
   setting. */

:root {
  color-scheme: light dark;
  --bg: #f4f5f7;
  --surface: #ffffff;
  --surface-2: #f1f2f5;
  --text: #1a1d23;
  --muted: #616c7b;
  --border: #dcdfe5;
  --accent: #4f46e5;
  --accent-hover: #4338ca;
  --on-accent: #ffffff;
  --accent-soft: #ecebfc;
  --danger: #b3261e;
  --danger-soft: #fbeae8;
  --success: #16794c;
  --success-soft: #e5f5ec;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(20, 24, 32, 0.06);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e1116;
    --surface: #171b22;
    --surface-2: #1f242d;
    --text: #e7e9ee;
    --muted: #98a2b3;
    --border: #2b323d;
    --accent: #8f89ff;
    --accent-hover: #a7a2ff;
    --on-accent: #0e1116;
    --accent-soft: #25244d;
    --danger: #ff8a80;
    --danger-soft: #3b1f1f;
    --success: #5cd39a;
    --success-soft: #16301f;
    --shadow: none;
  }
}

/* --- Base --- */

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

/* Several classes below set "display", which would override the browser's
   own rule for the hidden attribute. */
[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 var(--font);
  -webkit-text-size-adjust: 100%;
}

.wrap {
  width: 100%;
  max-width: 960px;
  margin: 0 auto;
  padding: 0 20px;
}

main.wrap {
  flex: 1;
  padding-top: 32px;
  padding-bottom: 64px;
}

.narrow {
  max-width: 520px;
  margin: 0 auto;
}

.wide {
  max-width: 760px;
  margin: 0 auto;
}

.center {
  display: flex;
  justify-content: center;
}

h1 {
  margin: 0;
  font-size: 1.6rem;
  line-height: 1.25;
  letter-spacing: -0.01em;
}

h2 {
  margin: 0;
  font-size: 1.15rem;
  line-height: 1.3;
}

p {
  margin: 0;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

hr {
  margin: 4px 0;
  border: 0;
  border-top: 1px solid var(--border);
}

time {
  white-space: nowrap;
}

/* .stack puts even space between the children of a column */
.stack > * + * {
  margin-top: 16px;
}

.inline {
  display: inline;
}

.grow {
  flex: 1 1 auto;
  min-width: 0;
}

.card {
  padding: 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

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

/* --- Top bar --- */

.topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.topbar-inner {
  display: flex;
  align-items: center;
  gap: 20px;
  height: 56px;
}

.brand {
  color: var(--text);
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

a.brand:hover {
  color: var(--accent);
  text-decoration: none;
}

.topnav {
  display: flex;
  gap: 16px;
  margin-left: 8px;
}

.topnav a {
  color: var(--muted);
  font-weight: 500;
}

.topnav a:hover {
  color: var(--text);
  text-decoration: none;
}

.topbar-inner form {
  margin-left: auto;
}

/* --- Buttons --- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 0.12s ease, border-color 0.12s ease, color 0.12s ease;
}

.btn:hover {
  background: var(--surface-2);
  text-decoration: none;
}

.btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.btn:disabled {
  opacity: 0.6;
  cursor: progress;
}

.btn.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--on-accent);
}

.btn.primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}

.btn.danger {
  color: var(--danger);
  border-color: var(--danger);
}

.btn.danger:hover {
  background: var(--danger-soft);
}

.btn.ghost {
  background: transparent;
  border-color: transparent;
  color: var(--muted);
}

.btn.small {
  padding: 6px 11px;
  font-size: 0.875rem;
}

.btn.wide {
  width: 100%;
}

/* --- Page structure --- */

.page-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.9rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 1px 8px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 600;
}

.kind-share {
  background: var(--accent-soft);
  color: var(--accent);
}

.state-active {
  background: var(--success-soft);
  color: var(--success);
}

.state-expired,
.state-exhausted {
  background: var(--danger-soft);
  color: var(--danger);
}

.columns {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
}

.row .actions {
  flex-shrink: 0;
}

.row-title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-weight: 600;
}

.row-title .title {
  color: var(--text);
}

.empty {
  padding: 48px 24px;
  color: var(--muted);
  text-align: center;
}

.tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.tabs a {
  margin-bottom: -1px;
  padding: 8px 14px;
  border-bottom: 2px solid transparent;
  color: var(--muted);
  font-weight: 500;
}

.tabs a:hover {
  color: var(--text);
  text-decoration: none;
}

.tabs a.active {
  color: var(--accent);
  border-color: var(--accent);
}

.banner {
  margin-bottom: 20px;
  border-color: var(--accent);
}

.banner h2 {
  margin-bottom: 10px;
}

.banner > * + * {
  margin-top: 10px;
}

.footnote {
  margin-top: 20px;
  color: var(--muted);
  font-size: 0.875rem;
  text-align: center;
}

/* --- Forms --- */

input,
select {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text);
  font: inherit;
}

input:focus-visible,
select:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  border-color: var(--accent);
}

input[readonly] {
  background: var(--surface-2);
  font-family: var(--mono);
  font-size: 0.9rem;
}

.field {
  display: block;
}

.field > span:not(.prefix-input) {
  display: block;
  margin-bottom: 6px;
  font-size: 0.9rem;
  font-weight: 600;
}

.field > span.sr-only {
  position: absolute;
  margin: 0;
}

.field em {
  color: var(--muted);
  font-style: normal;
  font-weight: 400;
}

.grid {
  display: grid;
  gap: 16px;
}

.grid.two {
  grid-template-columns: 1fr 1fr;
}

.prefix-input {
  display: flex;
  align-items: stretch;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
}

.prefix-input > span {
  display: flex;
  align-items: center;
  padding-left: 12px;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.875rem;
  white-space: nowrap;
}

.prefix-input input {
  min-width: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.hint {
  color: var(--muted);
  font-size: 0.875rem;
}

.lead {
  color: var(--muted);
}

.alert {
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 0.925rem;
}

.alert.error {
  background: var(--danger-soft);
  color: var(--danger);
}

.alert.success {
  background: var(--success-soft);
  color: var(--success);
}

.copy-row {
  display: flex;
  gap: 8px;
}

.copy-row input {
  flex: 1 1 auto;
  min-width: 0;
}

/* --- Files --- */

.files {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.file {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
}

.file .actions {
  flex-shrink: 0;
}

.thumb {
  display: flex;
  flex: 0 0 56px;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  overflow: hidden;
  border-radius: 8px;
  background: var(--surface-2);
}

.thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.thumb.ext {
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

/* A picture's preview is fetched only when its thumb is clicked, since the
   fetch uses up one of the link's downloads. Until then the thumb shows the
   file's extension, like any other file's. */
button.thumb-ext {
  appearance: none;
  border: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  font: inherit;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--accent);
  background: var(--accent-soft);
  cursor: zoom-in;
}

.file-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.file-name {
  overflow-wrap: anywhere;
  color: var(--text);
  font-weight: 600;
}

.file-info video,
.file-info audio {
  width: 100%;
  max-width: 420px;
  margin-top: 8px;
}

.file-info video {
  max-height: 260px;
  border-radius: 8px;
  background: #000;
}

/* --- Uploading --- */

.dropzone {
  padding: 28px 20px;
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  text-align: center;
  cursor: pointer;
  transition: border-color 0.12s ease, background-color 0.12s ease;
}

.dropzone:hover,
.dropzone.dragging {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.dropzone:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.dropzone-text {
  font-weight: 600;
}

.dropzone .hint {
  margin-top: 4px;
}

.linklike {
  color: var(--accent);
}

.queue {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.queue:empty {
  display: none;
}

.q-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 4px 12px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.9rem;
}

.q-name {
  overflow: hidden;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.q-size,
.q-status {
  color: var(--muted);
  white-space: nowrap;
}

.q-bar {
  grid-column: 1 / -1;
  height: 4px;
  overflow: hidden;
  border-radius: 2px;
  background: var(--surface-2);
}

.q-fill {
  width: 0;
  height: 100%;
  background: var(--accent);
  transition: width 0.15s linear;
}

.q-item.done .q-bar {
  visibility: hidden;
}

.q-item.done .q-status {
  color: var(--success);
}

.q-item.done .q-name {
  color: var(--muted);
  font-weight: 400;
}

.q-item.failed .q-status {
  color: var(--danger);
  text-align: right;
  white-space: normal;
}

/* --- Special pages --- */

.lock-card,
.error-card {
  text-align: center;
}

.lock {
  position: relative;
  width: 48px;
  height: 48px;
  margin: 0 auto;
  border-radius: 50%;
  background: var(--accent-soft);
}

.lock::before {
  content: "";
  position: absolute;
  top: 10px;
  left: 19px;
  width: 10px;
  height: 12px;
  border: 2.5px solid var(--accent);
  border-bottom: 0;
  border-radius: 6px 6px 0 0;
}

.lock::after {
  content: "";
  position: absolute;
  top: 22px;
  left: 13px;
  width: 22px;
  height: 17px;
  border-radius: 4px;
  background: var(--accent);
}

.error-card {
  padding: 40px 28px;
}

.error-code {
  color: var(--accent);
  font-size: 3.5rem;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.04em;
}

/* --- Small screens --- */

@media (max-width: 720px) {
  .topnav {
    display: none;
  }

  .grid.two,
  .columns {
    grid-template-columns: 1fr;
  }

  .row,
  .file {
    flex-wrap: wrap;
  }

  .file .actions {
    width: 100%;
    justify-content: flex-end;
  }

  .card {
    padding: 18px;
  }
}
