@font-face {
  font-family: "Jockey One";
  src: url("/fonts/JockeyOne-Regular.ttf") format("truetype");
  font-style: normal;
  font-weight: 400;
  font-display: block;
}

:root {
  color-scheme: dark;
  --bg: #090b0b;
  --panel: #111515;
  --panel-2: #171c1c;
  --line: #293030;
  --text: #f3f3ef;
  --muted: #939d9a;
  --acid: #bef103;
  --cyan: #06edff;
  --danger: #ff7d73;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html { font-family: "Geist", sans-serif; background: var(--bg); color: var(--text); }

body { margin: 0; min-height: 100vh; background: radial-gradient(circle at 76% 10%, #15201d 0, transparent 30rem), var(--bg); }

button, input, textarea, select { font: inherit; }
button { cursor: pointer; }

.topbar {
  height: 70px;
  padding: 0 3vw;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 24px;
  background: rgba(9, 11, 11, .88);
  backdrop-filter: blur(14px);
}

.wordmark, .brand {
  font-family: "Jockey One", sans-serif;
  font-weight: 400;
  font-synthesis: none;
}

.brand {
  color: var(--text);
  text-decoration: none;
  font-size: 40px;
  line-height: 1;
  letter-spacing: -.035em;
}

.brand b { color: var(--acid); }
.admin-label { color: var(--muted); border-left: 1px solid var(--line); padding-left: 24px; font-size: 13px; text-transform: uppercase; letter-spacing: .12em; }
.view-site { margin-left: auto; color: var(--text); text-decoration: none; font-size: 14px; }
.view-site + .view-site { margin-left: 0; }
.secondary-link { color: var(--muted); }
.view-site:hover { color: var(--acid); }

.auth-panel {
  width: min(640px, calc(100% - 40px));
  margin: 12vh auto 0;
  padding: clamp(30px, 6vw, 68px);
  border: 1px solid var(--line);
  background: linear-gradient(145deg, rgba(23, 28, 28, .96), rgba(13, 16, 16, .96));
}

.kicker { margin: 0 0 15px; color: var(--cyan); font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .17em; }
.auth-panel h1, .editor-heading h1 { margin: 0; font-size: clamp(32px, 5vw, 58px); line-height: .98; letter-spacing: -.055em; font-weight: 500; }
.auth-copy { color: var(--muted); line-height: 1.65; max-width: 480px; margin: 26px 0 34px; }

.google-button {
  border: 0;
  min-height: 52px;
  padding: 0 22px;
  background: #fff;
  color: #111;
  display: inline-flex;
  align-items: center;
  gap: 13px;
  font-weight: 600;
}

.google-button:hover { background: var(--acid); }
.google-button svg { width: 21px; height: 21px; }
.auth-status { min-height: 22px; margin: 18px 0 0; color: var(--danger); font-size: 14px; }

.admin-shell { min-height: calc(100vh - 70px); display: grid; grid-template-columns: 300px minmax(0, 1fr); }
.sidebar { padding: 24px; border-right: 1px solid var(--line); background: rgba(17, 21, 21, .74); display: flex; flex-direction: column; }
.profile { display: flex; align-items: center; gap: 12px; padding-bottom: 24px; border-bottom: 1px solid var(--line); }
.profile img { width: 40px; height: 40px; border-radius: 50%; background: var(--panel-2); object-fit: cover; }
.profile div { min-width: 0; }
.profile strong, .profile span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profile span { margin-top: 4px; color: var(--muted); font-size: 12px; }
.sidebar-heading { display: flex; align-items: center; justify-content: space-between; margin: 28px 0 12px; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .13em; }
.sidebar-heading button { border: 0; color: var(--acid); background: none; text-transform: uppercase; letter-spacing: .08em; font-size: 11px; }
.sidebar-heading > div { display: flex; gap: 7px; }
.sidebar-heading > div button:first-child { color: var(--cyan); }
.post-list { display: grid; gap: 7px; overflow-y: auto; max-height: calc(100vh - 270px); }
.post-item { width: 100%; text-align: left; border: 1px solid transparent; background: transparent; color: var(--text); padding: 13px; }
.post-item:hover, .post-item.active { border-color: var(--line); background: var(--panel-2); }
.post-item strong { display: block; margin-bottom: 6px; font-size: 14px; }
.post-item span { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .1em; }
.post-item .published { color: var(--cyan); }
.empty-posts { color: var(--muted); font-size: 13px; line-height: 1.5; padding: 12px; }
.sign-out { margin-top: auto; border: 1px solid var(--line); background: transparent; color: var(--muted); padding: 11px; }
.sign-out:hover { color: var(--text); border-color: var(--muted); }

.editor { padding: clamp(28px, 4vw, 64px); max-width: 1200px; width: 100%; margin: 0 auto; }
.editor-heading { display: flex; justify-content: space-between; align-items: end; gap: 30px; margin-bottom: 46px; }
.editor-heading h1 { font-size: clamp(30px, 4vw, 52px); }
.editor-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.editor-actions button { min-height: 42px; padding: 0 17px; border: 1px solid var(--line); color: var(--text); background: transparent; }
.editor-actions button:hover { border-color: var(--muted); }
.editor-actions .publish { color: #0b0d0c; border-color: var(--acid); background: var(--acid); font-weight: 600; }
.editor-actions .danger { color: var(--danger); }

#post-form, #milestone-form, #page-form { display: grid; gap: 26px; }
.field { position: relative; display: grid; gap: 9px; }
.field > span { color: var(--muted); font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .14em; }
.field input, .field textarea, .field select {
  width: 100%;
  border: 1px solid var(--line);
  outline: 0;
  border-radius: 0;
  padding: 14px 15px;
  background: var(--panel);
  color: var(--text);
  resize: vertical;
}
.field input:focus, .field textarea:focus, .field select:focus { border-color: var(--cyan); box-shadow: 0 0 0 1px var(--cyan); }
.field input:disabled { color: var(--muted); cursor: not-allowed; }
.field small { color: #6f7976; font-size: 12px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.title-field input { padding: 17px; font-size: 22px; }
.slug-control { display: flex; align-items: center; border: 1px solid var(--line); background: var(--panel); }
.slug-control:focus-within { border-color: var(--cyan); box-shadow: 0 0 0 1px var(--cyan); }
.slug-control small { padding-left: 14px; white-space: nowrap; }
.slug-control input { padding-left: 3px; border: 0; box-shadow: none !important; }
.counter { position: absolute; right: 12px; bottom: 12px; }
.counter b { font-weight: 400; }
.body-field textarea { line-height: 1.7; }
.markdown-heading { display: flex; justify-content: space-between; align-items: center; gap: 15px; }
.markdown-heading > span { color: var(--muted); font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .14em; }
.markdown-heading > div { display: flex; gap: 8px; }
.markdown-heading button, .markdown-heading a { padding: 7px 9px; border: 1px solid var(--line); background: transparent; color: var(--muted); font-size: 10px; text-decoration: none; text-transform: uppercase; letter-spacing: .08em; }
.markdown-heading button:hover, .markdown-heading a:hover { color: var(--text); border-color: var(--muted); }
.save-status { min-height: 22px; color: var(--cyan); margin: 20px 0 0; font-size: 13px; }
.save-status.error { color: var(--danger); }
.page-editor { min-height: calc(100vh - 70px); }
.admin-nav { margin-left: auto; display: flex; align-items: stretch; height: 100%; }
.admin-nav a {
  padding: 0 14px;
  display: grid;
  place-items: center;
  border-bottom: 2px solid transparent;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: .09em;
  text-transform: uppercase;
}
.admin-nav a:hover, .admin-nav a.active { color: var(--text); border-bottom-color: var(--acid); }
.three-fields { grid-template-columns: repeat(3, 1fr); }
.field-label {
  margin: 0 0 9px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .14em;
}
.media-editor {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 22px;
  align-items: stretch;
}
.upload-drop {
  min-height: 150px;
  padding: 25px;
  display: grid;
  place-content: center;
  border: 1px dashed #52605d;
  color: var(--muted);
  background: rgba(19,25,24,.6);
  cursor: pointer;
  text-align: center;
}
.upload-drop:hover { border-color: var(--acid); }
.upload-drop b { color: var(--text); font-size: 14px; }
.upload-drop span { margin-top: 8px; font-size: 12px; line-height: 1.45; }
.image-status { min-height: 18px; margin: 9px 0 0; color: var(--cyan); font-size: 12px; }
.image-status.error { color: var(--danger); }
.image-preview {
  min-height: 180px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--line);
  background: #090c0c;
  color: #65706c;
  font-size: 12px;
}
.image-preview img { width: 100%; height: 100%; object-fit: cover; }
.social-settings {
  margin-top: 28px;
  padding-top: 34px;
  display: grid;
  gap: 22px;
  border-top: 1px solid var(--line);
}
.social-settings h2 { margin: 8px 0 0; font-size: 28px; }

dialog {
  width: min(900px, calc(100% - 30px));
  max-height: calc(100vh - 30px);
  padding: 0;
  color: var(--text);
  background: #0d1010;
  border: 1px solid var(--line);
}
dialog::backdrop { background: rgba(0, 0, 0, .8); backdrop-filter: blur(8px); }
.close-preview { position: sticky; z-index: 2; float: right; top: 18px; right: 18px; width: 42px; height: 42px; border: 1px solid var(--line); background: #111; color: var(--text); font-size: 26px; }
.preview-article { max-width: 760px; margin: 0 auto; padding: 70px 30px; }
.preview-article h1 { font-size: clamp(38px, 7vw, 74px); line-height: .98; letter-spacing: -.055em; margin: 25px 0; }
.preview-cover img { width: 100%; max-height: 430px; object-fit: cover; margin-bottom: 40px; }
.preview-excerpt { color: #bdc6c3; font-size: 21px; line-height: 1.55; }
.preview-meta { display: flex; flex-wrap: wrap; gap: 8px; margin: 24px 0 42px; }
.preview-meta span { border: 1px solid var(--line); padding: 6px 9px; color: var(--muted); font-size: 11px; text-transform: uppercase; }
.preview-body { color: #d8ddda; font-size: 18px; line-height: 1.75; }
.preview-body h2 { margin: 2em 0 .7em; color: var(--text); font-size: 29px; }
.preview-body h1 { font-size: 40px; line-height: 1; }
.preview-body h3 { margin-top: 1.8em; font-size: 22px; }
.preview-body a { color: var(--cyan); }
.preview-body blockquote { margin: 2em 0; padding: 10px 0 10px 22px; border-left: 2px solid var(--cyan); color: #bfc9c6; font-size: 1.2em; }
.preview-body pre { overflow-x: auto; padding: 18px; background: #080a0a; border: 1px solid var(--line); }
.preview-body code { font-family: ui-monospace, monospace; color: var(--acid); }
.preview-body figure { margin: 2.2em 0; }
.preview-body figure img { max-width: 100%; }
.preview-body figcaption { margin-top: 8px; color: var(--muted); font-size: 12px; }

@media (max-width: 860px) {
  .topbar { flex-wrap: wrap; height: auto; min-height: 70px; padding-block: 12px; }
  .admin-nav { order: 4; width: 100%; height: 42px; margin: 8px 0 0; overflow-x: auto; }
  .admin-shell { grid-template-columns: 1fr; }
  .sidebar { border-right: 0; border-bottom: 1px solid var(--line); }
  .post-list { max-height: 220px; }
  .sign-out { margin-top: 20px; }
  .editor-heading { align-items: start; flex-direction: column; }
  .editor-actions { justify-content: flex-start; }
}

@media (max-width: 620px) {
  .admin-label { display: none; }
  .topbar { padding: 0 20px; }
  .field-row, .three-fields, .media-editor { grid-template-columns: 1fr; }
  .editor { padding: 30px 20px; }
  .editor-actions button { flex: 1 1 auto; }
  .slug-control { display: block; }
  .slug-control small { display: block; padding: 10px 14px 0; }
}
