:root {
  --bg: #ebebdd;
  --surface: #f5f5eb;
  --ink: #111;
  --ink-hover: #2c2c29;
  --muted: #76766d;
  --line: #c7c7ba;
  --accent: #0066cc;
  --accent-wash: #e3edf5;
  --changed: #c45a16;
  --changed-wash: #f6e4d7;
  --changed-wash-hover: #f1d5c1;
  --highlight: #ffad5c;
  --online: #238636;
}

* {
  box-sizing: border-box;
  font-family: "Merriweather", Georgia, serif;
  font-weight: 400;
  font-style: normal;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-size: 20px;
  line-height: 1.5;
}

main {
  padding: 24px 16px 80px;
}

.blog-page main {
  padding-top: 8px;
}

p,
h1,
h2,
h3,
h4,
h5,
h6 {
  margin: 0 0 20px;
  font-size: inherit;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.site-nav {
  position: relative;
  z-index: 3;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 20px;
  padding: 24px 16px 0;
}

#viewer {
  position: fixed;
  inset: 0;
  z-index: 0;
}

#viewer canvas {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
}

.hint {
  position: fixed;
  top: 50%;
  left: 0;
  right: 0;
  z-index: 2;
  margin: 0;
  text-align: center;
  font-size: 14px;
  color: var(--muted);
}

.text,
.post-entry {
  width: min(720px, calc(100vw - 32px));
}

.text {
  position: relative;
  z-index: 2;
}

.blog-feed {
  margin-top: 12px;
}

.post-entry {
  margin: 0 0 28px;
}

.post-entry > p:first-child {
  margin: 0 0 12px;
}

.back {
  margin-top: 32px;
}

.post-body p {
  margin: 0 0 16px;
}

.post-body::after {
  content: "";
  display: block;
  clear: both;
}

.post-body img {
  float: right;
  clear: right;
  width: 360px;
  height: auto;
  margin: 0 -420px 16px 0;
}

/* Zotter Pull */

.pull-page,
.pull-page main,
.pull-app {
  display: flex;
  flex-direction: column;
}

.pull-page {
  min-height: 100vh;
  min-height: 100dvh;
}

.pull-page main,
.pull-app {
  flex: 1 1 auto;
}

.pull-page main {
  padding: 24px;
}

.pull-page.is-connected main {
  padding-top: 88px;
}

.pull-page.is-connected .site-nav {
  display: none;
}

.pull-app {
  width: 100%;
}

.pull-connect {
  display: grid;
  flex: 1 1 auto;
  place-items: center;
}

.pull-connect-stack {
  display: flex;
  align-items: center;
  flex-direction: column;
  gap: 12px;
}

.pull-home-notice {
  max-width: 560px;
  margin: 8px 0 0;
  color: var(--muted);
  text-align: center;
}

.pull-appbar {
  position: fixed;
  inset: 0 0 auto;
  z-index: 10;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
  background: var(--bg);
}

.pull-appbar-content {
  display: flex;
  width: 100%;
  min-width: 0;
  min-height: 64px;
  align-items: center;
  padding: 10px 16px;
}

.pull-control {
  display: inline-flex;
  width: auto;
  min-width: 44px;
  height: 44px;
  flex: none;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 12px;
  border: 0;
  border-radius: 8px;
  color: var(--ink);
  background: rgba(255, 255, 255, .38);
  font-size: inherit;
  cursor: pointer;
  text-decoration: none;
  transition: color 140ms ease, background 140ms ease,
    transform 140ms ease;
}

.pull-control:hover:not(:disabled) {
  background: rgba(255, 255, 255, .72);
  transform: translateY(-1px);
  text-decoration: none;
}

.pull-control--primary {
  color: var(--bg);
  background: var(--ink);
}

.pull-control--primary:hover:not(:disabled) {
  background: var(--ink-hover);
}

.pull-copy:hover:not(:disabled) {
  color: var(--accent);
  background: var(--accent-wash);
}

.pull-save.has-changes:not(:disabled) {
  color: var(--changed);
  background: var(--changed-wash);
}

.pull-save.has-changes:hover:not(:disabled) {
  background: var(--changed-wash-hover);
}

.pull-control:disabled {
  color: var(--muted);
  background: transparent;
  cursor: default;
}

.pull-connect-button {
  height: auto;
  gap: 10px;
  padding: 16px 22px;
}

.pull-connect-button .pull-icon {
  color: var(--highlight);
}

.pull-icon {
  width: 20px;
  height: 20px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.6;
}

.pull-workspace {
  flex: 1 1 auto;
}

.pull-session,
.pull-connection,
.pull-breadcrumb,
.pull-file-crumb,
.pull-actions {
  display: flex;
  align-items: center;
}

.pull-session {
  width: 100%;
  min-width: 0;
  gap: 12px;
}

.pull-connection {
  flex: none;
  gap: 9px;
  white-space: nowrap;
}

.pull-breadcrumb,
.pull-file-crumb {
  min-width: 0;
  flex: 1 1 auto;
  gap: 8px;
}

.pull-editor-title {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pull-crumb {
  padding: 0;
  border: 0;
  color: var(--accent);
  background: transparent;
  font-size: inherit;
  cursor: pointer;
}

.pull-crumb:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.pull-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--online);
}

.pull-note-list {
  display: flex;
  align-items: flex-start;
  flex-direction: column;
  gap: 12px;
}

.pull-note-link {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pull-actions {
  flex: none;
  gap: 8px;
}

.pull-editor {
  display: block;
  width: 100%;
  min-height: 60vh;
  overflow: hidden;
  resize: none;
  padding: 0;
  border: 0;
  outline: 0;
  color: var(--ink);
  background: transparent;
  font-size: inherit;
  line-height: 1.7;
}

.pull-notice {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 20;
  max-width: calc(100vw - 32px);
  margin: 0;
  padding: 12px 16px;
  transform: translateX(-50%);
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  box-shadow: 0 8px 24px rgba(17, 17, 17, .1);
  text-align: center;
}

@media (prefers-reduced-motion: reduce) {
  #viewer canvas {
    cursor: grab;
  }

  #viewer canvas:active {
    cursor: grabbing;
  }
}

@media (max-width: 1200px) {
  .post-body img {
    float: none;
    width: 100%;
    margin: 0 0 16px;
  }
}

@media (max-width: 820px) {
  .pull-connection,
  .pull-control-label,
  .pull-breadcrumb > [aria-hidden],
  .pull-crumb,
  .pull-file-crumb > [aria-hidden],
  .pull-editor-title {
    display: none;
  }

  .pull-appbar .pull-control {
    width: 44px;
    min-width: 44px;
    padding: 0;
  }

  .pull-session {
    gap: 8px;
  }

  .pull-file-crumb {
    gap: 0;
  }
}

@media (max-width: 600px) {
  :root {
    --frame-height: 300px;
  }

  main {
    position: relative;
    padding: 8px 12px;
  }

  .site-nav {
    padding: 12px 12px 0;
  }

  #viewer {
    position: absolute;
    top: 0;
    left: 0;
    height: calc(var(--frame-height) + 260px);
  }

  .text {
    margin-top: var(--frame-height);
  }

  .hint {
    position: absolute;
    top: 150px;
  }

  .pull-page main {
    padding: 12px;
  }

  .pull-page.is-connected main {
    padding-top: 80px;
  }

  .pull-appbar-content {
    padding: 8px 12px;
  }
}
