:root {
  color-scheme: dark;
  --paper: #181d24;
  --ink: #eaedf0;
  --muted: #aab2bc;
  --blue: #9ac3db;
  --editor-surface: #2d4350;
  --editor-outline: #7896a8;
  background: var(--paper);
  color: var(--ink);
  font: 1rem/1.6 'Space Grotesk', system-ui, sans-serif;
}

.shell {
  width: min(38rem, calc(100% - 2.5rem));
  margin: 0 auto;
  padding-block: clamp(1.75rem, 5vw, 4rem) 4rem;
}

:where(h1, h2, h3, p, ul) { margin: 0; }
[hidden] { display: none !important; }

a { color: var(--blue); text-underline-offset: .2em; }
a:hover { color: var(--ink); }
:where(a, button):focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; }

.page-bar {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  font-size: .9rem;
}

#edit-toggle {
  margin-left: auto;
  padding: .25rem 0;
  border: 0;
  background: none;
  color: var(--blue);
  font: inherit;
  text-decoration: underline;
  text-underline-offset: .2em;
  cursor: pointer;
}

#edit-toggle:hover { color: var(--ink); }
#edit-toggle:disabled { color: var(--muted); cursor: wait; }

.edit-bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: .25rem 1rem;
  margin-block: .75rem 1.25rem;
  color: var(--muted);
  font-size: .875rem;
}

main { margin-top: 1rem; }

h1 {
  margin-bottom: .4rem;
  font-size: clamp(2.35rem, 6vw, 3.45rem);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -.055em;
}

section { margin-top: 1.8rem; }
h2 { margin-bottom: .3rem; font-size: 1.35rem; line-height: 1.3; letter-spacing: -.025em; }
ul { padding-inline-start: 1.25rem; }
li::marker { color: var(--muted); }

.entries li + li { margin-top: .55rem; }
.entries p { color: var(--muted); }
.project-stack { font-size: .875rem; }
.project-description, .preserve-lines { white-space: pre-wrap; }

.page-outline section section { margin-top: 1rem; }
.page-outline :is(h3, h4, h5, h6) { margin: 0 0 .25rem; font-size: 1.05rem; line-height: 1.35; }
.outline-actions { display: flex; flex-wrap: wrap; gap: .25rem 1rem; margin-top: .3rem; }
.page-outline > .editor-action { margin-top: 1.2rem; }

.editor-row {
  display: flex;
  gap: .4rem;
  align-items: center;
  margin-block: .3rem;
}

.editor-row :is(input, textarea) {
  flex: 1;
  min-width: 0;
  padding: .15rem .4rem;
  border: 1px solid var(--editor-outline);
  border-radius: 2px;
  background: transparent;
  color: var(--ink);
  font: inherit;
}

.editor-row :is(input, textarea):focus {
  outline: 2px solid var(--blue);
  background: var(--editor-surface);
}

.editor-row button, .editor-action {
  border: 0;
  background: none;
  color: var(--blue);
  font: inherit;
  cursor: pointer;
}

.editor-row button { min-width: 1.75rem; }
.editor-action { padding: 0; font-size: .875rem; text-decoration: underline; }
#more-pages .editor-row a { font-size: .875rem; white-space: nowrap; }
.project-editor { display: grid; grid-template-columns: minmax(0, 1fr) auto; }
.project-editor :is([name="url"], textarea, [name="stack"]) { grid-column: 1 / -1; }
.project-editor textarea { resize: vertical; }

:where(h2, h3, h4, h5, h6, li) { overflow-wrap: anywhere; }
[data-draft] { overflow-wrap: anywhere; white-space: pre-wrap; }
[data-draft][contenteditable] { min-inline-size: 1ch; min-block-size: 1lh; outline: 1px dashed var(--editor-outline); outline-offset: 3px; cursor: text; }
a[data-draft][contenteditable] { display: inline-block; max-inline-size: 100%; }
[data-draft][contenteditable]:focus { outline: 2px solid var(--blue); background: var(--editor-surface); }
