:root {
  --font-sans: "Inter", system-ui, sans-serif;
  --font-writing-mono: "JetBrains Mono", ui-monospace, monospace;
  --font-writing-sans: "IBM Plex Sans", system-ui, sans-serif;
  --font-writing-serif: "Literata", Georgia, serif;
  --font-writing: var(--font-writing-mono);
  --font-size-editor: 1rem;
  --line-height-editor: 1.6;
  --measure: 66ch;
  --spacing-editor-x: 1.5rem;
  --spacing-editor-y: 2rem;
  --default-transition-duration: 120ms;
  --default-transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);

  --color-surface: #ffffff;
  --color-surface-secondary: #f6f8fa;
  --color-text-primary: #24292e;
  --color-text-secondary: #586069;
  --color-text-muted: #6a737d;
  --color-border: #e1e4e8;
  --color-accent: #0366d6;
  --color-accent-muted: #c8e1ff;
  --color-clarus-blue: oklch(0.55 0.17 240);
}

[data-font="sans"] {
  --font-writing: var(--font-writing-sans);
}

[data-font="serif"] {
  --font-writing: var(--font-writing-serif);
}

[data-theme="solarized-light"] {
  --color-surface: #fdf6e3;
  --color-surface-secondary: #eee8d5;
  --color-text-primary: #657b83;
  --color-text-secondary: #586e75;
  --color-text-muted: #93a1a1;
  --color-border: #eee8d5;
  --color-accent: #268bd2;
  --color-accent-muted: #d3e9f5;
}

[data-theme="one-light"] {
  --color-surface: #fafafa;
  --color-surface-secondary: #f0f0f0;
  --color-text-primary: #383a42;
  --color-text-secondary: #696c77;
  --color-text-muted: #a0a1a7;
  --color-border: #e5e5e6;
  --color-accent: #4078f2;
  --color-accent-muted: #d4e2fc;
}

[data-theme="catppuccin-latte"] {
  --color-surface: #eff1f5;
  --color-surface-secondary: #e6e9ef;
  --color-text-primary: #4c4f69;
  --color-text-secondary: #5c5f77;
  --color-text-muted: #8c8fa1;
  --color-border: #dce0e8;
  --color-accent: #1e66f5;
  --color-accent-muted: #bcc7f5;
}

[data-theme="quiet-light"] {
  --color-surface: #f5f5f5;
  --color-surface-secondary: #e8e8e8;
  --color-text-primary: #333333;
  --color-text-secondary: #555555;
  --color-text-muted: #aaaaaa;
  --color-border: #d4d4d4;
  --color-accent: #4b69c6;
  --color-accent-muted: #c9d0e8;
}

[data-theme="one-dark"] {
  --color-surface: #282c34;
  --color-surface-secondary: #21252b;
  --color-text-primary: #abb2bf;
  --color-text-secondary: #8b929c;
  --color-text-muted: #5c6370;
  --color-border: #3e4451;
  --color-accent: #61afef;
  --color-accent-muted: #3b5f7a;
}

[data-theme="dracula"] {
  --color-surface: #282a36;
  --color-surface-secondary: #21222c;
  --color-text-primary: #f8f8f2;
  --color-text-secondary: #bfbfbf;
  --color-text-muted: #6272a4;
  --color-border: #44475a;
  --color-accent: #bd93f9;
  --color-accent-muted: #5a4a7a;
}

[data-theme="nord"] {
  --color-surface: #2e3440;
  --color-surface-secondary: #3b4252;
  --color-text-primary: #eceff4;
  --color-text-secondary: #d8dee9;
  --color-text-muted: #9aa7b8;
  --color-border: #434c5e;
  --color-accent: #88c0d0;
  --color-accent-muted: #4c6a75;
}

[data-theme="catppuccin-mocha"] {
  --color-surface: #1e1e2e;
  --color-surface-secondary: #181825;
  --color-text-primary: #cdd6f4;
  --color-text-secondary: #bac2de;
  --color-text-muted: #6c7086;
  --color-border: #313244;
  --color-accent: #89b4fa;
  --color-accent-muted: #45597d;
}

[data-theme="tokyo-night"] {
  --color-surface: #1a1b26;
  --color-surface-secondary: #16161e;
  --color-text-primary: #c0caf5;
  --color-text-secondary: #a9b1d6;
  --color-text-muted: #565f89;
  --color-border: #292e42;
  --color-accent: #7aa2f7;
  --color-accent-muted: #3d4f7a;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-family: var(--font-sans);
  background: var(--color-surface);
  color: var(--color-text-primary);
  -webkit-font-smoothing: antialiased;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--color-surface);
  color: var(--color-text-primary);
}

a {
  color: inherit;
}

.public-share-page {
  min-height: 100vh;
  background: var(--color-surface);
}

.public-share-enter {
  animation: public-share-fade-in 250ms ease-out both;
}

@keyframes public-share-fade-in {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

.editor-surface-fade-top,
.editor-surface-fade-bottom {
  --editor-surface-fade-height: clamp(3rem, 8vw, 6rem);
  pointer-events: none;
  z-index: 30;
}

.public-share-top-edge-fade {
  display: none;
}

.editor-surface-fade-bottom {
  position: sticky;
  bottom: 0;
  height: var(--editor-surface-fade-height);
  margin-top: calc(-1 * var(--editor-surface-fade-height));
  background: linear-gradient(to top, var(--color-surface) 0%, transparent 100%);
}

.public-share-top-bar {
  position: relative;
  z-index: 40;
}

.public-share-top-bar-outer {
  width: 100%;
  max-width: 80rem;
  margin: 0 auto;
  padding: 1rem 1.5rem 0;
}

.public-share-top-bar-inner {
  width: 100%;
  max-width: var(--measure);
  margin: 0 auto;
  padding: 0 var(--spacing-editor-x) 0.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.public-share-logo-link {
  color: var(--color-text-primary);
  opacity: 0.5;
  text-decoration: none;
  transition: opacity 300ms ease;
}

.public-share-top-bar[data-scrolled="true"] .public-share-logo-link {
  opacity: 0.25;
}

.public-share-logo-link:hover {
  opacity: 1;
}

.clarus-wordmark {
  font-family: "Gabarito", sans-serif;
  font-size: 1.875rem;
  font-weight: 600;
  letter-spacing: -0.045em;
  line-height: 1;
}

.clarus-wordmark--foreground {
  color: var(--color-text-primary);
}

.public-share-theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  padding: 0;
  border: 0;
  border-radius: 0.75rem;
  background: transparent;
  color: var(--color-text-secondary);
  cursor: pointer;
}

.public-share-theme-toggle:hover {
  background: var(--color-surface-secondary);
  color: var(--color-text-primary);
}

.theme-icon {
  width: 1rem;
  height: 1rem;
}

.theme-icon-sun {
  display: none;
}

html[data-public-share-mode="dark"] .theme-icon-sun {
  display: block;
}

html[data-public-share-mode="dark"] .theme-icon-moon {
  display: none;
}

.public-share-shell {
  width: 100%;
  max-width: 80rem;
  margin: 0 auto;
  padding: 1.5rem 1.5rem 4rem;
}

.public-share-content-shell,
.public-share-unavailable {
  width: 100%;
  max-width: var(--measure);
  margin: 0 auto;
}

.public-share-editor {
  padding: 0.75rem var(--spacing-editor-x) 18vh;
}

.public-share-author-block {
  margin-bottom: 1.5rem;
}

.public-share-author-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.public-share-avatar {
  position: relative;
  flex: 0 0 auto;
  width: 2rem;
  height: 2rem;
  border-radius: 999px;
  overflow: hidden;
  background: var(--color-surface-secondary);
}

.public-share-avatar-fallback {
  display: flex;
  width: 100%;
  height: 100%;
  align-items: center;
  justify-content: center;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-text-secondary);
}

.public-share-avatar-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity 180ms ease;
}

.public-share-author-meta {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
  padding-top: 0.375rem;
}

.public-share-author-name {
  font-size: 0.875rem;
  font-weight: 700;
  line-height: 1.1;
  color: var(--color-text-primary);
}

.public-share-date-row {
  font-size: 0.75rem;
  line-height: 1.3;
  color: var(--color-text-secondary);
}

.ProseMirror {
  font-family: var(--font-writing);
  font-variant-ligatures: none;
  font-size: var(--font-size-editor);
  line-height: var(--line-height-editor);
  color: var(--color-text-primary);
}

.public-share-article {
  min-height: 70vh;
}

.public-share-article h1,
.public-share-article h2,
.public-share-article h3,
.public-share-article h4,
.public-share-article h5,
.public-share-article p,
.public-share-article blockquote,
.public-share-article ul,
.public-share-article ol,
.public-share-article pre,
.public-share-article .tableWrapper,
.public-share-article hr {
  margin-top: 0;
}

.public-share-article h1 {
  font-size: 2em;
  font-weight: 700;
  margin-bottom: 0.5em;
  line-height: 1.2;
}

.public-share-article h2 {
  font-size: 1.5em;
  font-weight: 600;
  margin-bottom: 0.5em;
  line-height: 1.3;
}

.public-share-article h3 {
  font-size: 1.25em;
  font-weight: 600;
  margin-bottom: 0.5em;
  line-height: 1.4;
}

.public-share-article h4 {
  font-size: 1.1em;
  font-weight: 600;
  margin-bottom: 0.5em;
  line-height: 1.4;
}

.public-share-article h5 {
  font-size: 1em;
  font-weight: 600;
  margin-bottom: 0.5em;
  line-height: 1.5;
}

.public-share-article p,
.public-share-article li,
.public-share-article blockquote {
  font-size: inherit;
  line-height: inherit;
}

.public-share-article p,
.public-share-article ul,
.public-share-article ol,
.public-share-article blockquote,
.public-share-article pre,
.public-share-article .tableWrapper {
  margin-bottom: 1.5em;
}

.public-share-article hr {
  margin-bottom: 1.5rem;
  border: 0;
  border-top: 1px solid color-mix(in srgb, var(--color-border) 80%, transparent);
}

.public-share-article blockquote {
  padding-left: 1rem;
  border-left: 3px solid color-mix(in srgb, var(--color-accent) 40%, transparent);
  color: var(--color-text-secondary);
  font-style: italic;
}

.public-share-article ul,
.public-share-article ol {
  padding-left: 2rem;
}

.public-share-article li {
  margin-bottom: 0.5em;
  display: list-item;
}

.public-share-article li > p {
  margin-bottom: 0.25em;
}

.public-share-article li::marker {
  color: var(--color-text-muted);
}

.public-share-article a {
  color: var(--color-accent);
  text-decoration: underline;
  text-underline-offset: 0.16em;
}

.public-share-article code {
  font-family: var(--font-writing-mono);
  font-size: 0.94em;
  background: color-mix(in srgb, var(--color-surface-secondary) 80%, transparent);
  border-radius: 0.35rem;
  padding: 0.1rem 0.35rem;
}

.public-share-article pre {
  overflow-x: auto;
  padding: 1rem;
  border: 1px solid color-mix(in srgb, var(--color-border) 85%, transparent);
  border-radius: 0.75rem;
  background: color-mix(in srgb, var(--color-surface-secondary) 80%, transparent);
}

.public-share-article pre code {
  padding: 0;
  background: transparent;
  border-radius: 0;
}

.public-share-article .tableWrapper {
  overflow-x: auto;
}

.public-share-article table {
  width: 100%;
  border-collapse: collapse;
}

.public-share-article th,
.public-share-article td {
  border: 1px solid var(--color-border);
  padding: 0.625rem 0.75rem;
  text-align: left;
  vertical-align: top;
}

.public-share-article th {
  background: color-mix(in srgb, var(--color-surface-secondary) 80%, transparent);
}

.public-share-article sup {
  font-size: 0.72em;
}

.public-share-article .footnotes {
  margin-top: 2rem;
  padding-left: 1.5rem;
  border-top: 1px solid color-mix(in srgb, var(--color-border) 85%, transparent);
  padding-top: 1.25rem;
}

.public-share-article .footnote-backref {
  margin-left: 0.4rem;
  text-decoration: none;
}

.public-share-footer-note {
  margin-top: 12rem;
  padding-top: 2rem;
  border-top: 1px solid color-mix(in srgb, var(--color-text-primary) 50%, transparent);
  text-align: center;
  font-size: 0.75rem;
  line-height: 1.7;
  color: var(--color-text-primary);
  opacity: 0.75;
}

.public-share-footer-note .clarus-wordmark {
  display: inline;
  font-size: 1rem;
  opacity: 0.75;
}

.public-share-unavailable {
  padding: 6rem var(--spacing-editor-x);
}

.public-share-unavailable h1 {
  margin: 0 0 0.75rem;
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1.1;
}

.public-share-unavailable p {
  margin: 0;
  max-width: 42rem;
  font-size: 1.05rem;
  line-height: 1.7;
  color: var(--color-text-secondary);
}

@media (min-width: 1024px) {
  .public-share-top-edge-fade {
    display: block;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--editor-surface-fade-height);
    background: linear-gradient(to bottom, var(--color-surface) 0%, transparent 100%);
  }

  .public-share-top-bar {
    position: fixed;
    inset: 0 0 auto 0;
  }

  .public-share-top-bar-outer {
    max-width: none;
    padding: 1.25rem 0 0;
  }

  .public-share-top-bar-inner {
    max-width: none;
    padding: 0 3rem 1rem;
  }

  .public-share-shell {
    padding-top: 10rem;
  }

  .public-share-editor {
    padding-top: 3rem;
    padding-bottom: 22vh;
  }
}

@media (min-width: 1280px) {
  .public-share-shell {
    padding-top: 11rem;
  }
}

@media (min-width: 1536px) {
  .public-share-shell {
    padding-top: 12rem;
  }
}

@media (max-width: 640px) {
  .public-share-top-bar-outer {
    padding-top: 1rem;
  }

  .public-share-top-bar-inner {
    padding-bottom: 0.75rem;
  }

  .public-share-editor {
    padding-top: 0.75rem;
    padding-bottom: 18vh;
  }

  .public-share-article h1,
  .public-share-article h2,
  .public-share-article h3,
  .public-share-article h4,
  .public-share-article h5 {
    margin-top: 0;
  }

  .public-share-footer-note {
    margin-top: 8rem;
  }
}
