:root {
  color-scheme: dark;
  accent-color: #eeeeea;
  --background: #050505;
  --foreground: #eeeeea;
  --muted: #aaa9a3;
  --line: #333331;
  --selection: #eeeeea;
  --selection-text: #050505;
  font-family:
    ui-sans-serif,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--background);
}

body {
  width: 100%;
  margin: 0;
  padding: 8px 12px 36px;
  overflow-wrap: break-word;
  background: var(--background);
  color: var(--foreground);
  font-size: clamp(16px, calc(14px + 0.2vw), 22px);
  line-height: 1.42;
  text-rendering: optimizeLegibility;
}

::selection {
  background: var(--selection);
  color: var(--selection-text);
}

a {
  color: inherit;
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.14em;
}

a:hover {
  text-decoration-thickness: 0.14em;
}

.site-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
  padding: 0 0 7px;
  border-bottom: 1px solid var(--line);
  font-family:
    ui-monospace,
    SFMono-Regular,
    Consolas,
    "Liberation Mono",
    monospace;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
}

.site-name {
  font-weight: 700;
  text-decoration: none;
}

.site-description {
  color: var(--muted);
}

.post-roll {
  margin: 0;
  padding: 0;
  list-style: none;
}

.post-preview {
  width: 100%;
  padding: clamp(14px, 1.4vw, 30px) 0;
  border-bottom: 1px solid var(--line);
}

.preview-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 18px;
  width: 100%;
}

.preview-title {
  margin: 0;
  font-size: clamp(1.35rem, calc(1rem + 1.15vw), 3.25rem);
  font-weight: 650;
  letter-spacing: -0.025em;
  line-height: 1.05;
}

.preview-title a {
  text-decoration: none;
}

.preview-header time,
.article-header time {
  flex: 0 0 auto;
  color: var(--muted);
  font-family:
    ui-monospace,
    SFMono-Regular,
    Consolas,
    "Liberation Mono",
    monospace;
  font-size: 0.68rem;
  text-transform: uppercase;
  white-space: nowrap;
}

.preview-summary {
  width: 100%;
  max-width: none;
  margin: 0.65rem 0 0;
  font-size: clamp(1rem, calc(0.9rem + 0.3vw), 1.5rem);
  line-height: 1.38;
}

.article-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  width: 100%;
  padding: clamp(20px, 3vw, 64px) 0 14px;
  border-bottom: 1px solid var(--line);
}

.article-header h1 {
  margin: 0;
  font-size: clamp(2rem, calc(1.25rem + 3vw), 6.5rem);
  font-weight: 650;
  letter-spacing: -0.05em;
  line-height: 0.94;
}

.post-content {
  width: 100%;
  max-width: none;
  padding-top: 0.2rem;
  font-size: clamp(1.04rem, calc(0.9rem + 0.38vw), 1.65rem);
}

.post-content > :first-child {
  margin-top: 1rem;
}

.post-content p,
.post-content ul,
.post-content ol,
.post-content blockquote,
.post-content pre,
.post-content figure,
.post-content table,
.post-content h2,
.post-content h3,
.post-content h4 {
  max-width: none;
}

.post-content h2 {
  margin: 1.25em 0 0.25em;
  padding-top: 0.2em;
  border-top: 1px solid var(--line);
  font-size: 1.65em;
  letter-spacing: -0.035em;
  line-height: 1;
}

.post-content h3 {
  margin: 1.15em 0 0.25em;
  font-size: 1.3em;
  line-height: 1.08;
}

.post-content p {
  margin: 0.7em 0;
}

.post-content li + li {
  margin-top: 0.25em;
}

.post-content blockquote {
  margin: 1em 0;
  padding-left: 0.8em;
  border-left: 2px solid var(--foreground);
}

.post-content figure {
  margin: 1.1em 0;
}

.post-content figcaption {
  margin-top: 0.35em;
  color: var(--muted);
  font-size: 0.74em;
}

.post-content img,
.post-content video,
.post-content canvas,
.post-content object,
.post-content embed {
  display: block;
  max-width: 100%;
  height: auto;
}

.post-content iframe {
  display: block;
  width: 100%;
  max-width: 100%;
  min-height: min(72vh, 760px);
  border: 1px solid var(--line);
}

.post-content audio {
  width: min(100%, 760px);
}

.post-content pre,
.post-content code,
.post-content kbd,
.post-content samp {
  font-family:
    ui-monospace,
    SFMono-Regular,
    Consolas,
    "Liberation Mono",
    monospace;
}

.post-content pre {
  margin: 1em 0;
  padding: 0.75em;
  overflow-x: auto;
  border: 1px solid var(--line);
  background: #0d0d0c;
  color: var(--foreground);
  font-size: 0.68em !important;
  line-height: 1.35;
  overflow-wrap: normal;
  white-space: pre;
}

.post-content code {
  overflow-wrap: normal;
}

.post-content table {
  width: 100%;
  border-collapse: collapse;
}

.post-content th,
.post-content td {
  padding: 0.35em;
  border: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.post-content .has-black-color,
.post-content .has-text-color {
  color: inherit !important;
}

.not-found {
  padding: 2rem 0;
}

.auth-shell {
  width: min(100%, 760px);
  padding: clamp(28px, 6vw, 96px) 0;
}

.auth-shell h1 {
  margin: 0 0 0.35em;
  font-size: clamp(2.4rem, 7vw, 6.5rem);
  letter-spacing: -0.055em;
  line-height: 0.92;
}

.auth-shell p {
  margin: 0.8em 0;
}

.auth-eyebrow,
.auth-form label span {
  color: var(--muted);
  font-family:
    ui-monospace,
    SFMono-Regular,
    Consolas,
    "Liberation Mono",
    monospace;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.auth-form {
  display: flex;
  align-items: end;
  gap: 8px;
  margin-top: 1.4rem;
}

.auth-form label {
  display: grid;
  flex: 1 1 auto;
  gap: 5px;
}

.auth-form input,
.auth-form button {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 0;
  font: inherit;
}

.auth-form input {
  width: 100%;
  padding: 7px 9px;
  background: #0d0d0c;
  color: var(--foreground);
}

.auth-form button {
  padding: 7px 12px;
  background: var(--foreground);
  color: var(--background);
  cursor: pointer;
  white-space: nowrap;
}

.auth-error {
  color: #e0c889;
}

.auth-footnote {
  color: var(--muted);
  font-size: 0.85em;
}

.draft-banner {
  display: flex;
  align-items: baseline;
  gap: 16px;
  width: 100%;
  padding: 9px 0;
  border-bottom: 1px solid #8a7440;
  color: #e0c889;
  font-family:
    ui-monospace,
    SFMono-Regular,
    Consolas,
    "Liberation Mono",
    monospace;
  font-size: 0.72rem;
}

.draft-banner span {
  color: var(--muted);
}

.draft-banner a {
  margin-left: auto;
}

.draft-preview-frame {
  display: block;
  width: 100%;
  min-height: 70vh;
  margin: 0;
  border: 0;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 600px) {
  body {
    padding-inline: 8px;
  }

  .preview-header,
  .article-header {
    display: block;
  }

  .preview-header time,
  .article-header time {
    display: block;
    margin-top: 0.4rem;
  }

  .site-description {
    display: none;
  }

  .draft-banner {
    flex-wrap: wrap;
  }

  .draft-banner a {
    margin-left: 0;
  }

  .auth-form {
    display: grid;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}
