/* "Harbor slate": sky blue leads, everything else is a cool slate neutral.
   Change the colors here; the dark theme below mirrors each one. */
:root {
  --bg: #f6f7f9;
  --surface: #eceff3;
  --text: #1a2230;
  --muted: #5b6576;
  --rule: #dde2e9;
  --accent: #2f5d8a;       /* deep sky: links on hover, small details */
  --accent-soft: #93bee9;  /* sky: link underlines, highlights */

  --font-display: "Schibsted Grotesk", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-body: "Literata", Georgia, "Times New Roman", serif;
  --font-ui: var(--font-display);

  --measure: 38rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #10141b;
    --surface: #171d27;
    --text: #e4e9f0;
    --muted: #9aa6b8;
    --rule: #232b37;
    --accent: #93bee9;
    --accent-soft: #2f5378;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1.125rem;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

.wrap {
  max-width: var(--measure);
  margin: 0 auto;
  padding-left: max(1.25rem, env(safe-area-inset-left));
  padding-right: max(1.25rem, env(safe-area-inset-right));
}

a {
  color: inherit;
  text-decoration: underline;
  text-decoration-color: var(--accent-soft);
  text-decoration-thickness: 0.15em;
  text-underline-offset: 0.2em;
  transition: color 0.15s, text-decoration-color 0.15s;
}
a:hover { color: var(--accent); text-decoration-color: var(--accent); }
a:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.015em;
  text-wrap: balance;
}

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

/* Small uppercase labels: section headings, dates */
.label {
  font-family: var(--font-ui);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

/* Header */
.site-header .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem 1.5rem;
  padding-top: 1.5rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--rule);
}
.site-title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text);
  text-decoration: none;
}
.site-header nav { display: flex; gap: 1.5rem; font-family: var(--font-ui); font-size: 0.95rem; }
.site-header nav a { color: var(--muted); text-decoration: none; }
.site-header nav a:hover,
.site-header nav a[aria-current="page"] { color: var(--text); }

main.wrap { padding-top: 3rem; padding-bottom: 4rem; }

/* Home page */
.hero { margin-bottom: 3.5rem; }
.hero h1 { font-size: clamp(2.3rem, 8vw, 3.1rem); line-height: 1.05; margin: 0 0 1rem; }
.hero .bio { font-size: 1.175rem; line-height: 1.65; color: var(--muted); margin: 0 0 1.75rem; }

.button {
  display: inline-block;
  padding: 0.65rem 1.25rem;
  border-radius: 999px;
  border: 1px solid var(--text);
  font-family: var(--font-ui);
  font-size: 0.95rem;
  font-weight: 500;
  text-decoration: none;
}
.button:hover { background: var(--text); color: var(--bg); }

.section-heading { margin: 0 0 0.25rem; }
.more { font-family: var(--font-ui); font-size: 0.95rem; }

/* Post lists */
.post-list { list-style: none; padding: 0; margin: 0 0 1.75rem; }
.post-list li {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.25rem 1rem;
  padding: 1.25rem 0;
  border-bottom: 1px solid var(--rule);
}
.post-list a {
  min-width: 0;
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 600;
  line-height: 1.3;
  text-decoration: none;
}
.post-list time {
  font-family: var(--font-ui);
  font-size: 0.85rem;
  color: var(--muted);
  white-space: nowrap;
  padding-top: 0.35rem;
}
.post-list p { grid-column: 1 / -1; margin: 0; color: var(--muted); font-size: 1.05rem; }

.page-title { font-size: clamp(2.1rem, 7vw, 2.75rem); margin: 0 0 1.5rem; }

/* Single post */
.post header { margin-bottom: 2.25rem; }
.post h1 { font-size: clamp(2rem, 6.5vw, 2.75rem); margin: 0 0 0.75rem; }
.post .meta { margin: 0; }
.post-body h2 { font-size: 1.6rem; margin: 2.5rem 0 0.75rem; }
.post-body h3 { font-size: 1.3rem; margin: 2rem 0 0.5rem; }
.post-body img { max-width: 100%; height: auto; border-radius: 6px; }
.post-body hr { border: 0; border-top: 1px solid var(--rule); margin: 2.5rem 0; }
.post-body blockquote {
  margin: 2rem 0;
  padding: 0.1rem 0 0.1rem 1.25rem;
  border-left: 2px solid var(--accent);
  font-style: italic;
  color: var(--muted);
}
.post-body pre, .post-body code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.88em;
  background: var(--surface);
  border-radius: 4px;
}
.post-body pre { padding: 1rem 1.25rem; overflow-x: auto; line-height: 1.5; }
.post-body code { padding: 0.1em 0.3em; }
.post-body pre code { padding: 0; background: none; }
.back { margin-top: 3.5rem; font-family: var(--font-ui); font-size: 0.95rem; }
.back a { text-decoration: none; color: var(--muted); }
.back a:hover { color: var(--accent); }

/* Footer */
.site-footer { color: var(--muted); font-family: var(--font-ui); font-size: 0.875rem; }
.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  padding-top: 1.5rem;
  padding-bottom: 2.5rem;
  border-top: 1px solid var(--rule);
}
.site-footer a { color: var(--muted); text-decoration: none; }
.site-footer a:hover { color: var(--accent); }

@media (prefers-reduced-motion: reduce) {
  a { transition: none; }
}
