/* The admin page. Plain and roomy: it gets used on a phone as often as a laptop. */

@font-face {
  font-family: 'Libre Franklin';
  src: url('fonts/libre-franklin-latin-wght-normal.woff2') format('woff2');
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --bg: #0e0c0b;
  --panel: #171412;
  --field: #211d1a;
  --ink: #efe9df;
  --soft: #a59c8f;
  --line: rgb(239 233 223 / 0.16);
  --accent: #e8743b;
  --good: #8fc79a;
  --bad: #f08b78;
  color-scheme: dark;
}
*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  background: var(--bg);
  scroll-behavior: smooth;
  scroll-padding-top: 84px;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 16px/1.5 'Libre Franklin', system-ui, -apple-system, 'Segoe UI', sans-serif;
  -webkit-font-smoothing: antialiased;
}
h1,
h2,
p {
  margin: 0;
}
a {
  color: inherit;
}
button,
input,
textarea {
  font: inherit;
  color: inherit;
}
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.wait {
  padding: 40px 20px;
  text-align: center;
  color: var(--soft);
}

/* ---------- buttons and fields ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 8px 16px;
  border: 1px solid rgb(239 233 223 / 0.3);
  border-radius: 6px;
  background: none;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.btn:hover:not(:disabled) {
  background: rgb(239 233 223 / 0.08);
  border-color: rgb(239 233 223 / 0.5);
}
.btn.main {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--bg);
  font-weight: 600;
}
.btn.main:hover:not(:disabled) {
  background: #fff;
}
.btn.quiet {
  border-color: transparent;
  color: var(--soft);
}
.btn:disabled {
  opacity: 0.4;
  cursor: default;
}
.fields {
  display: grid;
  gap: 20px;
}
.field {
  display: grid;
  gap: 6px;
  min-width: 0;
}
label,
.label {
  font-size: 14px;
  font-weight: 600;
}
input[type='text'],
input[type='email'],
input[type='password'],
textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--field);
  font-size: 16px;
}
textarea {
  resize: vertical;
  line-height: 1.5;
}
input:focus,
textarea:focus {
  outline: none;
  border-color: var(--accent);
}
.hint {
  font-size: 14px;
  color: var(--soft);
}
.field.check {
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 10px;
}
.field.check input {
  width: 20px;
  height: 20px;
  accent-color: var(--accent);
}
.field.check label {
  font-weight: 400;
  font-size: 16px;
}
.note {
  font-size: 14px;
  color: var(--soft);
}
.note.bad {
  color: var(--bad);
}
.note.warn {
  padding: 10px 14px;
  border: 1px solid rgb(232 116 59 / 0.5);
  border-radius: 6px;
  color: var(--ink);
}
.note.top {
  margin-bottom: 8px;
}
.buttons {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
}

/* ---------- signing in ---------- */

.door {
  display: grid;
  gap: 18px;
  width: min(100% - 40px, 380px);
  margin: 0 auto;
  padding: 18vh 0 40px;
}
.door h1 {
  font-size: 30px;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.03em;
}
.door .note:empty {
  display: none;
}

/* ---------- the editor ---------- */

.bar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px clamp(14px, 3vw, 32px);
  border-bottom: 1px solid var(--line);
  background: rgb(14 12 11 / 0.94);
}
.bar b {
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.01em;
}
.status {
  margin-left: auto;
  font-size: 14px;
  color: var(--soft);
  text-align: right;
}
.status.warn {
  color: var(--accent);
}
.status.good {
  color: var(--good);
}
.status.bad {
  color: var(--bad);
}
.layout {
  display: grid;
  grid-template-columns: 200px minmax(0, 720px);
  gap: clamp(20px, 4vw, 56px);
  padding: 28px clamp(14px, 3vw, 32px) 120px;
}
.side {
  position: sticky;
  top: 90px;
  align-self: start;
  display: grid;
  gap: 2px;
}
.side a,
.side .out {
  padding: 7px 10px;
  border: 0;
  border-radius: 6px;
  background: none;
  color: var(--soft);
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}
.side a:hover,
.side .out:hover {
  background: rgb(239 233 223 / 0.07);
  color: var(--ink);
}
.side .out {
  margin-top: 14px;
}
.sheet {
  display: grid;
  gap: 18px;
}
.sheet > section {
  padding: 22px clamp(16px, 2.4vw, 26px) 26px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
}
.sheet h2 {
  margin-bottom: 18px;
  font-size: 24px;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.025em;
}

/* A photo or clip */
.media-row {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}
.thumb {
  display: grid;
  place-items: center;
  aspect-ratio: 4 / 5;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--field);
  overflow: hidden;
}
.thumb img,
.thumb video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.thumb .empty {
  padding: 8px;
  font-size: 12px;
  color: var(--soft);
  text-align: center;
}
.media-side {
  display: grid;
  gap: 10px;
}

/* Lists: projects, links, rows of photos */
.items {
  display: grid;
  gap: 12px;
}
.items.tiles {
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
}
.items:empty {
  display: none;
}
.item {
  display: grid;
  gap: 14px;
  align-content: start;
  padding: 12px 14px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg);
}
.item-head {
  display: flex;
  align-items: center;
  gap: 4px;
}
.item-head b {
  margin-right: auto;
  font-size: 15px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.icon {
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 6px;
  background: none;
  font-size: 18px;
  line-height: 1;
  color: var(--soft);
  cursor: pointer;
}
.icon:hover:not(:disabled) {
  background: rgb(239 233 223 / 0.08);
  color: var(--ink);
}
.icon:disabled {
  opacity: 0.25;
  cursor: default;
}

@media (max-width: 820px) {
  .layout {
    grid-template-columns: 1fr;
    padding-top: 0;
    gap: 14px;
  }
  .side {
    position: sticky;
    top: 63px;
    z-index: 5;
    display: flex;
    gap: 4px;
    margin: 0 calc(clamp(14px, 3vw, 32px) * -1);
    padding: 8px clamp(14px, 3vw, 32px);
    overflow-x: auto;
    background: var(--bg);
    border-bottom: 1px solid var(--line);
    scrollbar-width: none;
    white-space: nowrap;
  }
  .side .out {
    margin: 0;
  }
  html {
    scroll-padding-top: 130px;
  }
  .bar b {
    display: none;
  }
  .status {
    margin-left: 0;
    margin-right: auto;
    text-align: left;
  }
}
