/* App chrome and components. The header, hero, footer, dropzone, status and
   progress styles follow enigmeta-tools. */

.site-header {
  border-bottom: 1px solid var(--border);
}
.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-4);
  padding-block: var(--s-3);
}
.brand {
  color: var(--heading);
  font-weight: 650;
  letter-spacing: -0.01em;
}
.brand:hover {
  color: var(--heading);
  text-decoration: none;
}
.brand .dot {
  color: var(--accent);
}

.theme-toggle {
  width: 2.25rem;
  height: 2.25rem;
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--border);
  background: var(--surface);
  cursor: pointer;
  transition:
    background var(--ease),
    border-color var(--ease);
}
.theme-toggle:hover {
  border-color: var(--muted);
  background: var(--surface-2);
}

.site-main {
  padding-block: var(--s-6) var(--s-7);
}

.hero {
  border-bottom: 1px solid var(--border);
  padding-block: var(--s-6);
}
.hero p {
  color: var(--muted);
  font-size: var(--step-1);
}

.site-footer {
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: var(--step--1);
}
.site-footer .wrap {
  padding-block: var(--s-5);
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2) var(--s-4);
  justify-content: space-between;
}
.site-footer a {
  color: var(--muted);
}
.site-footer a:hover {
  color: var(--text);
}

/* Forms. 16px minimum font size keeps iOS from zooming on focus. */
.form {
  max-width: 44rem;
}
.form.stack-lg > * + * {
  margin-top: var(--s-5);
}
.field {
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
}
.field > label {
  color: var(--heading);
  font-weight: 600;
}
input[type="text"],
input[type="password"],
select {
  width: 100%;
  font-family: var(--font-mono);
  font-size: max(16px, var(--step--1));
  line-height: 1.5;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  padding: var(--s-3);
  transition:
    border-color var(--ease),
    box-shadow var(--ease);
}
select {
  width: auto;
  align-self: flex-start;
  min-width: 10rem;
}
input:hover,
select:hover {
  border-color: var(--muted);
}
input:focus,
select:focus {
  border-color: var(--accent);
  outline: none;
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--focus) 28%, transparent);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-3);
}
.actions .btn {
  padding: 0.65em 1.2em;
}

/* Dropzone. */
.dropzone {
  display: grid;
  place-items: center;
  gap: var(--s-3);
  text-align: center;
  padding: var(--s-7) var(--s-4);
  border: 2px dashed var(--border);
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
  transition:
    border-color var(--ease),
    background var(--ease),
    color var(--ease);
}
.dropzone:hover {
  border-color: var(--muted);
}
.dropzone.dragover {
  border-color: var(--accent);
  border-style: solid;
  background: var(--surface-2);
  color: var(--text);
}
.dropzone:has(input:focus-visible) {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}
.dropzone strong {
  color: var(--heading);
  font-size: var(--step-1);
}

/* Status line. */
.status {
  font-family: var(--font-mono);
  font-size: var(--step--1);
  color: var(--muted);
}
.status:empty {
  display: none;
}
.status[data-kind="error"] {
  color: var(--danger);
}

/* Progress bar. */
.progress[hidden] {
  display: none;
}
.progress {
  height: 4px;
  background: var(--surface-2);
  overflow: hidden;
}
.progress-bar {
  height: 100%;
  width: 0;
  background: var(--accent);
  transition: width 0.1s linear;
}

/* File and link rows: name, detail, then buttons pushed to the right. */
.files[hidden] {
  display: none;
}
.files {
  list-style: none;
  padding: 0;
  border: 1px solid var(--border);
  background: var(--surface);
}
.files li {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s-2) var(--s-3);
  padding: var(--s-3) var(--s-4);
}
.files li + li {
  border-top: 1px solid var(--border);
}
.files .name {
  font-family: var(--font-mono);
  font-size: var(--step--1);
  color: var(--heading);
  word-break: break-all;
}
.files .label {
  font-size: var(--step--1);
  font-weight: 550;
  color: var(--heading);
  word-break: break-word;
}
.files .detail {
  font-size: var(--step--1);
  color: var(--muted);
  margin-right: auto;
}
.files .btn[data-armed] {
  border-color: var(--danger);
  color: var(--danger);
}

/* Result panel: the link of the upload that just finished. */
.result {
  border: 1px solid var(--accent);
  background: var(--surface);
}
.result-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-3);
  padding: var(--s-3) var(--s-4);
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
}
.result-head .summary {
  font-size: var(--step--1);
  color: var(--heading);
  font-weight: 550;
}
.result .link {
  display: block;
  padding: var(--s-5) var(--s-4);
  font-family: var(--font-mono);
  font-size: var(--step-2);
  color: var(--muted);
  word-break: break-all;
}
.result .link strong {
  color: var(--heading);
  letter-spacing: 0.06em;
}
