/* The vibehuus look (vibehuus.be): blue on off-white by day, off-white on
   deep blue by night; square frames, Bebas Neue for display words,
   letter-spaced Space Mono for everything else. Fonts are self-hosted:
   the CSP only allows this origin, and senders' browsers shouldn't call
   Google. */

@font-face {
  font-family: "Bebas Neue";
  font-weight: 400;
  font-display: swap;
  src: url(/_/fonts/bebas-neue-latin-400-normal.woff2) format("woff2");
}
@font-face {
  font-family: "Space Mono";
  font-weight: 400;
  font-display: swap;
  src: url(/_/fonts/space-mono-latin-400-normal.woff2) format("woff2");
}
@font-face {
  font-family: "Space Mono";
  font-weight: 700;
  font-display: swap;
  src: url(/_/fonts/space-mono-latin-700-normal.woff2) format("woff2");
}

:root {
  color-scheme: light;
  /* vibehuus palette */
  --blue: #2e72b8;
  --blue-deep: #1f5a99;
  --blue-dim: #8aaed0;
  --offwhite: #f4f6f9;

  --bg: var(--offwhite);
  --fg: var(--blue);
  --dim: var(--blue-dim);
  --surface: #ffffff;
  --error: #b3261e;
  --display: "Bebas Neue", "Arial Narrow", sans-serif;
  --mono: "Space Mono", ui-monospace, monospace;
}
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    /* Off-white on vibehuus's deep blue; boxes filled in its main blue. */
    --bg: var(--blue-deep);
    --fg: var(--offwhite);
    --dim: #a9c4e0;
    --surface: var(--blue);
    --error: #ffc2b8;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--fg);
  font: 15px/1.5 var(--mono);
  -webkit-font-smoothing: antialiased;
}
main {
  min-height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

/* The TRANSFER logo: one framed word, like the vibehuus poster. The
   splash page and the 404 are just the logo; the drop page has it at the
   top. */
.logo {
  margin: 0;
  padding: 0.25em 0.45em 0.12em;
  border: 2px solid var(--fg);
  background: var(--surface);
  font: 400 clamp(28px, 6.5vw, 75px)/0.9 var(--display);
  letter-spacing: 0.02em;
  text-transform: uppercase;
  text-align: center;
  max-width: 100%;
  overflow-wrap: anywhere;
}

/* Drop page: the logo pinned at the top, the drop box centred on the
   page itself. main reserves the logo's height above *and* below, so the
   centre stays the page's centre and the box can't slide under the logo
   on a short screen. */
body.drop { position: relative; }
.drop .brand {
  position: absolute;
  top: 24px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  padding: 0 16px;
}
.drop main {
  /* logo height (font × 1.27 + border) + its 24px offset + a gap */
  --logo-space: calc(clamp(28px, 6.5vw, 75px) * 1.27 + 48px);
  padding: var(--logo-space) 16px;
}
.panel {
  width: 100%;
  max-width: 760px;
  border: 2px solid var(--fg);
  background: var(--surface);
  padding: 20px;
}
.message {
  margin: 0 0 18px;
  text-align: center;
  white-space: pre-line;
  overflow-wrap: anywhere;
}
.zone {
  border: 1.5px dashed var(--fg);
  padding: clamp(48px, 9vh, 88px) 16px clamp(40px, 8vh, 80px);
  text-align: center;
  cursor: pointer;
  transition: background 0.15s;
}
.zone:hover, .zone:focus-visible, .zone.over {
  border-style: solid;
  outline: none;
  background: color-mix(in srgb, var(--fg) 7%, transparent);
}
.zone p { margin: 0; }
.zone-title {
  font: 400 clamp(38px, 8vw, 60px)/1 var(--display);
  letter-spacing: 0.03em;
  text-transform: uppercase;
}
.zone-sub {
  margin-top: 6px !important;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--dim);
}

/* "3 files uploaded", between the zone and the list. */
.uploaded {
  margin: 32px 0 0;
  font: 400 clamp(26px, 5vw, 34px)/1 var(--display);
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.files { list-style: none; margin: 16px 0 0; padding: 0; }
.files:not(:empty) { margin-top: 32px; }
.uploaded:not([hidden]) + .files { margin-top: 16px; }
.file {
  border: 1.5px solid var(--fg);
  padding: 14px 16px 12px;
  margin-bottom: 12px;
}
.file:last-child { margin-bottom: 0; }
.file-head, .file-foot {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
}
.file-foot { align-items: center; min-height: 18px; }
.file-name { overflow-wrap: anywhere; font-weight: 700; }
.file-size, .file-status {
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--dim);
}
.file-size { white-space: nowrap; }
.file progress {
  display: block;
  width: 100%;
  height: 6px;
  margin: 10px 0 8px;
  appearance: none;
  border: none;
  border-radius: 0;
  background: color-mix(in srgb, var(--fg) 18%, transparent);
  accent-color: var(--fg);
}
.file progress::-webkit-progress-bar { background: color-mix(in srgb, var(--fg) 18%, transparent); }
.file progress::-webkit-progress-value { background: var(--fg); }
.file progress::-moz-progress-bar { background: var(--fg); }
/* A sent file gets a checkmark in the logo's square frame. */
.file-state { display: inline-flex; align-items: center; gap: 8px; }
.check {
  display: none;
  position: relative;
  flex: none;
  width: 16px;
  height: 16px;
  border: 1.5px solid var(--fg);
}
.check::after {
  content: "";
  position: absolute;
  left: 4.5px;
  top: 1.5px;
  width: 4px;
  height: 8px;
  border: solid var(--fg);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
.file[data-state="done"] .check { display: block; }
.file[data-state="done"] .file-status { color: var(--fg); font-weight: 700; }
.file[data-state="error"] { border-color: var(--error); }
.file[data-state="error"] .file-status { color: var(--error); text-transform: none; letter-spacing: 0; font-size: 13px; }
.file[data-state="error"] progress::-webkit-progress-value { background: var(--error); }
.file[data-state="cancelled"] { opacity: 0.55; }
.file-action {
  flex: none;
  font: 700 10px/1.2 var(--mono);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--surface);
  background: var(--fg);
  border: none;
  border-radius: 0;
  padding: 6px 10px;
  cursor: pointer;
}
.file-action:hover { background: var(--dim); }
