/* figade styles, shared by every page.

   COLOURS
   The :root block is the light theme. The block under it is the dark theme,
   which browsers use when the visitor's device is set to dark mode.
   To change a colour, change it in both blocks.

     --bg      page background          --panel  the boxes that sit on the page
     --fg      normal text              --mut    quieter text
     --bd      box borders              --line   faint dividing lines
     --acc     links                    --btn    the Compress button

   FONTS
   Headings use Georgia. To go back to one font everywhere, delete the
   "font-family" line in the "Headings" section below.
*/

:root {
  --bg: #f4f3f1;
  --panel: #ffffff;
  --fg: #2a2a2a;
  --mut: #5b5652;
  --bd: #d9d5d0;
  --line: #e6e2dd;
  --acc: #35708f;
  --btn: #35708f;
  --btn-fg: #ffffff;
  --ok: #1f6b43;
  --err: #a8342a;
  --warn: #7a5510;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #2a2a2a;
    --panel: #333333;
    --fg: #e9e7e4;
    --mut: #afafaf;
    --bd: #555555;
    --line: #443f3a;
    --acc: #6fb0d4;
    --btn: #5196bd;
    --btn-fg: #1e2427;
    --ok: #7fc79b;
    --err: #e98b80;
    --warn: #d8b070;
  }
}

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

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 17px/1.65 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

main {
  max-width: 40rem;
  margin: 0 auto;
  padding: 18px 18px 36px;
}

/* ---------- Headings ---------- */

h1,
h2,
.brand {
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 700;
}

h1 {
  font-size: clamp(1.6rem, 5vw, 1.95rem);
  line-height: 1.2;
  margin: 0 0 10px;
}

h2 {
  font-size: 1.25rem;
  margin: 36px 0 10px;
}

p {
  margin: 0 0 14px;
}

.s {
  color: var(--mut);
}

a {
  color: var(--acc);
}

/* ---------- Menu ---------- */

nav {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 18px;
  align-items: baseline;
  padding: 4px 0 16px;
  border-bottom: 1px solid var(--bd);
  margin-bottom: 24px;
}

nav .brand {
  font-size: 1.2rem;
  color: var(--fg);
  text-decoration: none;
  margin-right: auto;
}

nav a.l {
  color: var(--mut);
  text-decoration: none;
  font-size: 0.92rem;
}

nav a.l:hover,
nav a.l:focus-visible {
  color: var(--fg);
}

/* ---------- The big limit number ---------- */

.limit {
  display: flex;
  gap: 16px;
  align-items: center;
  border-left: 4px solid var(--acc);
  padding: 4px 0 4px 16px;
  margin: 22px 0;
}

.limit b {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 2.3rem;
  line-height: 1;
  white-space: nowrap;
}

.limit span {
  color: var(--mut);
  font-size: 0.95rem;
  line-height: 1.35;
}

/* ---------- The compressor box ---------- */

.tool {
  background: var(--panel);
  border: 1px solid var(--bd);
  border-radius: 4px;
  padding: 18px;
  margin: 22px 0;
}

label {
  display: block;
  font-weight: 600;
  margin: 0 0 6px;
}

.hint {
  font-weight: 400;
  color: var(--mut);
  font-size: 0.9rem;
}

@media (hover: none) {
  .hint {
    display: none;
  }
}

input[type="file"],
input[type="number"] {
  padding: 9px 10px;
  border: 1px solid var(--bd);
  border-radius: 4px;
  background: var(--bg);
  color: var(--fg);
  font: inherit;
}

input[type="file"] {
  width: 100%;
  padding: 8px;
  margin-bottom: 16px;
}

input[type="file"]::file-selector-button {
  margin-right: 10px;
  padding: 7px 14px;
  border: 1px solid var(--bd);
  border-radius: 4px;
  background: var(--panel);
  color: var(--fg);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

input[type="file"]::file-selector-button:hover {
  border-color: var(--acc);
}

/* size buttons */
.row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 0 0 12px;
}

.chip {
  padding: 6px 12px;
  border: 1px solid var(--bd);
  border-radius: 4px;
  background: var(--bg);
  color: var(--fg);
  font: inherit;
  cursor: pointer;
}

.chip:hover {
  border-color: var(--acc);
}

.chip.on {
  border-color: var(--acc);
  box-shadow: inset 0 0 0 1px var(--acc);
  font-weight: 600;
}

/* the exact number, with MB after it */
.num {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
}

.num input {
  width: 7rem;
}

.num span {
  color: var(--mut);
}

#go {
  width: 100%;
  padding: 12px;
  border: 0;
  border-radius: 4px;
  background: var(--btn);
  color: var(--btn-fg);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

#go:hover {
  filter: brightness(1.07);
}

#go:disabled {
  opacity: 0.5;
  cursor: default;
  filter: none;
}

button:focus-visible,
input:focus-visible,
a:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--acc);
  outline-offset: 2px;
}

/* progress and status */
#bar {
  height: 5px;
  background: var(--bd);
  border-radius: 3px;
  overflow: hidden;
  margin: 10px 0 0;
  display: none;
}

#bar i {
  display: block;
  height: 100%;
  width: 0;
  background: var(--acc);
}

#est {
  margin: 0 0 12px;
  font-size: 0.95rem;
  color: var(--mut);
}

#est:empty {
  display: none;
}

#est.warn {
  color: var(--warn);
}

#st {
  margin: 10px 0 0;
}

#st:empty {
  margin: 0;
}

#st.err {
  color: var(--err);
}

#st.ok {
  color: var(--ok);
  font-weight: 600;
}

video {
  width: 100%;
  border-radius: 4px;
  margin-top: 12px;
  max-height: 60vh;
  background: #000;
}

.acts {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

a.dl,
.share {
  flex: 1;
  display: block;
  text-align: center;
  padding: 12px;
  border-radius: 4px;
  font: inherit;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}

a.dl {
  background: var(--btn);
  color: var(--btn-fg);
}

.share {
  background: var(--panel);
  color: var(--fg);
  border: 1px solid var(--bd);
}

.share:hover {
  border-color: var(--acc);
}

details {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  color: var(--mut);
  font-size: 0.85rem;
}

summary {
  cursor: pointer;
}

pre {
  white-space: pre-wrap;
  margin: 8px 0 0;
  overflow-x: auto;
}

/* ---------- Other sizes ---------- */

.more-h {
  margin: 0 0 8px;
  font-weight: 600;
  font-size: 0.95rem;
}

.more {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 8px;
}

.more a,
.more span {
  display: inline-block;
  padding: 7px 13px;
  border: 1px solid var(--bd);
  border-radius: 4px;
  text-decoration: none;
  color: var(--fg);
  font-size: 0.95rem;
}

.more a:hover,
.more a:focus-visible {
  border-color: var(--acc);
}

.more span {
  color: var(--mut);
  border-style: dashed;
}

/* ---------- Lists, questions, tables ---------- */

ul {
  padding-left: 20px;
  margin: 0 0 14px;
}

li {
  margin-bottom: 8px;
}

dt {
  font-weight: 700;
  margin-top: 16px;
}

dd {
  margin: 2px 0 0;
}

.text ul {
  margin-bottom: 18px;
}

.tw {
  overflow-x: auto;
  margin: 18px 0;
}

table {
  border-collapse: collapse;
  width: 100%;
  font-size: 0.95rem;
}

caption {
  text-align: left;
  color: var(--mut);
  font-size: 0.9rem;
  padding-bottom: 8px;
}

th,
td {
  text-align: left;
  padding: 9px 12px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

thead th {
  border-bottom: 1px solid var(--bd);
  font-weight: 600;
}

tbody th {
  font-weight: 700;
}

/* ---------- Ads ---------- */

.ad {
  margin: 26px 0;
  min-height: 100px;
}

/* ---------- Footer ---------- */

footer {
  max-width: 40rem;
  margin: 0 auto;
  padding: 16px 18px 44px;
  color: var(--mut);
  font-size: 0.9rem;
  border-top: 1px solid var(--bd);
}

footer p {
  margin: 0 0 8px;
}

.fl {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
}

/* ---------- Drag and drop ---------- */

body.drag .tool {
  border-color: var(--acc);
  box-shadow: 0 0 0 2px var(--acc);
}

body.drag::after {
  content: "Drop the video to load it";
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  color: var(--fg);
  font-size: 1.4rem;
  font-weight: 700;
  border: 3px dashed var(--acc);
  pointer-events: none;
  z-index: 10;
}
