:root {
  color-scheme: dark;
  --ink: #1c1914;
  --paper: #f3ecdf;
  --muted: #6d655a;
  --line: #d9d0c0;
  --red: #d23a16;
  --green: #0e6a42;
  --bg: #16140f;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(ellipse at 0 0, #2a241c 0, transparent 42%),
    var(--bg);
  color: var(--paper);
  font: 16px/1.45 "Segoe UI", "Avenir Next", sans-serif;
}

h1, h2 {
  font-family: Georgia, "Liberation Serif", serif;
  font-weight: 500;
  letter-spacing: -0.03em;
  margin: 0;
}

h1 { font-size: clamp(2.4rem, 5vw, 4.2rem); line-height: 0.95; }
h2 { font-size: 1.7rem; color: var(--ink); }

.eyebrow {
  margin: 0 0 0.4rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.72rem;
}

.lede { max-width: 36rem; color: var(--muted); }

.screen { padding: 2.2rem clamp(1rem, 4vw, 3rem) 3rem; }
.screen[hidden] { display: none !important; }

#login:not([hidden]) {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.sheet {
  background: var(--paper);
  color: var(--ink);
  border: 1px solid #1c1914;
  box-shadow: 8px 8px 0 #d23a16;
  padding: 1.3rem 1.3rem 1.4rem;
  position: relative;
}

.login-sheet { margin: 0; width: min(34rem, 100%); }

label {
  display: block;
  margin: 1rem 0 0.35rem;
  font-size: 0.92rem;
}

label span { color: var(--muted); }

input, textarea, button, .file {
  font: inherit;
}

input, textarea {
  width: 100%;
  border: 1px solid var(--ink);
  background: #fffdf8;
  color: var(--ink);
  padding: 0.7rem 0.75rem;
}

textarea { resize: vertical; min-height: 7rem; }

button, .file {
  border: 1px solid var(--ink);
  background: var(--ink);
  color: var(--paper);
  padding: 0.7rem 0.9rem;
  cursor: pointer;
}

button:hover, .file:hover { background: var(--red); border-color: var(--red); }
button:disabled { opacity: 0.55; cursor: progress; }

.file { display: inline-block; }
.file input { display: none; }

.actions { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-top: 0.8rem; }

.top {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 1rem;
  margin-bottom: 1.2rem;
}

.top button {
  background: transparent;
  color: var(--paper);
  border-color: #8a8174;
}

.top button:hover { background: var(--red); border-color: var(--red); color: var(--paper); }

.layout { display: grid; gap: 1.4rem; }
@media (min-width: 980px) {
  .layout { grid-template-columns: 1.25fr 0.85fr; align-items: start; }
}

.drop.is-over { outline: 3px solid var(--red); outline-offset: 4px; }

.crop::before, .crop::after {
  content: "";
  position: absolute;
  width: 14px;
  height: 14px;
  border: 0 solid var(--ink);
}
.crop::before { top: 8px; left: 8px; border-top-width: 2px; border-left-width: 2px; }
.crop::after { right: 8px; bottom: 8px; border-bottom-width: 2px; border-right-width: 2px; }

.msg { min-height: 1.3rem; margin: 0.8rem 0 0; }
.msg.error { color: var(--red); }
.msg.ok { color: var(--green); }
.msg a { color: inherit; }

#sites { list-style: none; padding: 0; margin: 1rem 0 0; }
#sites li {
  border-top: 1px solid var(--line);
  padding: 0.85rem 0;
}
#sites .row { display: flex; justify-content: space-between; gap: 0.6rem; align-items: baseline; }
#sites .tools { display: flex; gap: 0.45rem; justify-content: flex-start; }
#sites a { color: var(--ink); font-weight: 650; }
#sites .meta { color: var(--muted); font-size: 0.85rem; margin: 0.2rem 0 0.5rem; }
#sites .row button, #sites .ghost {
  background: transparent;
  color: var(--ink);
  padding: 0.35rem 0.55rem;
}
#sites .danger { color: var(--red); }

.curl { margin-top: 1.4rem; }
.curl p { color: var(--muted); }
pre {
  overflow: auto;
  background: #1c1914;
  color: #f3ecdf;
  padding: 0.9rem 1rem;
  margin: 0.6rem 0 0;
  font: 0.86rem/1.45 ui-monospace, "Cascadia Code", monospace;
}
code { font-family: inherit; }

:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
