:root {
  color-scheme: light;
  --paper: #ffffff;
  --panel: #f7f7f7;
  --ink: #111111;
  --muted: #666666;
  --line: #d5d5d5;
  --accent: #0000ee;
  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
}

html.dark,
body.dark {
  color-scheme: dark;
  --paper: #1a1a1a;
  --panel: #222222;
  --ink: #e0e0e0;
  --muted: #aaaaaa;
  --line: #555555;
  --accent: #66b3ff;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--paper);
  color: var(--ink);
}

body {
  width: min(100%, 672px);
  min-height: 100dvh;
  margin: 0 auto;
  padding: max(32px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(56px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
  background: var(--paper);
  color: var(--ink);
  font: 16px/1.6 var(--mono);
}

html.theme-ready body {
  transition: background 180ms ease, color 180ms ease;
}

a {
  color: var(--accent);
  text-decoration: none;
  text-underline-offset: 3px;
}

a:hover {
  text-decoration: underline;
}

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.site-header {
  margin-bottom: 30px;
}

.title-row,
.page-bar {
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
}

.site-title,
.page-title {
  margin: 0;
  font-size: 24px;
  line-height: 1.25;
}

.page-title {
  margin-top: 28px;
}

.theme-toggle {
  display: inline-flex;
  min-width: 78px;
  min-height: 44px;
  flex: 0 0 auto;
  gap: 7px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 0 10px;
  background: var(--panel);
  color: var(--ink);
  font: 750 12px/1 var(--mono);
  cursor: pointer;
}

.theme-toggle [data-theme-icon] {
  font-size: 18px;
}

.social-links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  margin-top: 12px;
}

.social-links a {
  display: inline-flex;
  min-height: 36px;
  align-items: center;
  white-space: nowrap;
}

.site-quote {
  margin: 22px 0 0;
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: 7px;
  padding: 14px 16px;
  background: var(--panel);
}

.site-quote p,
.site-quote footer {
  margin: 0;
}

.site-quote footer {
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
}

.site-section {
  margin-top: 30px;
}

.section-title {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.section-title a {
  display: inline-flex;
  min-height: 32px;
  align-items: center;
  color: inherit;
}

.item-list,
.post-list {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.item-list li,
.post-list li {
  min-height: 32px;
  padding: 0;
}

.item-list li {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  align-items: baseline;
}

.item-list li > a,
.item-actions,
.item-actions a,
.post-list a {
  display: inline-flex;
  min-height: 32px;
  align-items: center;
}

.item-actions a {
  min-width: 24px;
}

.item-actions {
  color: var(--muted);
  font-size: 13px;
}

.post-list li {
  display: grid;
  grid-template-columns: 11ch minmax(0, 1fr);
  gap: 12px;
  align-items: baseline;
}

.post-list time {
  color: var(--muted);
  font-size: 13px;
}

.home-link {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  font-weight: 750;
}

@media (max-width: 430px) {
  body {
    width: 100%;
    padding: max(20px, env(safe-area-inset-top)) max(14px, env(safe-area-inset-right)) max(56px, env(safe-area-inset-bottom)) max(14px, env(safe-area-inset-left));
  }

  .theme-toggle {
    min-width: 72px;
  }

  .post-list li {
    grid-template-columns: minmax(0, 1fr);
    gap: 1px;
  }
}
