@import url(https://fonts.bunny.net/css?family=atkinson-hyperlegible-next:200,200i,300,300i,400,400i,500,500i,600,600i,700,700i,800,800i|inter:200,300,300i,400,400i,500,500i,600,600i,700,800,900);

:root {
  color-scheme: light dark;
  --bg: #ebebeb;
  --fg: #1b1b1b;
  --muted: #666;
  --link: #0b57d0;
  --border: #7e7a7a;
  --hover: salmon;
  --font-text: "Atkinson Hyperlegible Next", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  --font-heading: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  --text-sm: 0.95rem;
  --text-base: clamp(1rem, 0.95rem + 0.55vw, 1.125rem);
  --text-lg: clamp(1.125rem, 1rem + 0.75vw, 1.375rem);
  --text-xl: clamp(1.25rem, 0.9rem + 1.5vw, 1.75rem);
  --text-2xl: clamp(1.5rem, 1rem + 2vw, 2.25rem);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #171717;
    --fg: #e5e5e5;
    --muted: #bbbbbb;
    --link: #8ab4f8;
    --border: #686666;
    --hover: color-mix(in srgb, salmon 85%, transparent);
  }
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--font-text);
  font-size: var(--text-base);
  font-weight: 400;
  background: var(--bg);
  color: var(--fg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
.container {
  max-width: 52rem;
  margin: 0 auto;
}
header.site-header {
  position: sticky;
  top: 0;
  backdrop-filter: blur(6px);
  background: color-mix(in oklab, var(--bg) 85%, transparent);
  border-bottom: 1px solid color-mix(in srgb, var(--hover) 70%, transparent);
}
.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 2rem 0;
}
.site-header-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.site-title {
  font-weight: 500;
  margin: 0;
  font-family: var(--font-heading);
}
.site-title a { color: var(--link); text-decoration: none; }
nav.site-nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 0.75rem; }

nav.site-nav a {
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
}
nav.site-nav a[aria-current="page"] {
  font-weight: 550;
}
nav.site-nav a:hover {
  text-decoration: dotted underline;
}
main { padding: 1.25rem 0 3rem; }
footer.site-footer {
  color: var(--muted);
  padding: 1rem 0 2rem;
}

h1, h2, h3 { line-height: 1.2; 
  font-weight: 500; 
  font-family: var(--font-heading); 
}

h1 { font-size: var(--text-2xl); }
h2 { font-size: var(--text-xl); }
h3 { font-size: var(--text-lg); }

img, video { max-width: 100%; height: auto; }
pre, code { font-family: var(--font-mono); }

.post-list { display: grid; gap: 1rem; }
.post-item { padding: 0.75rem; border: 1px solid var(--border); border-radius: 6px; }
.post-meta { color: var(--muted); font-size: var(--text-sm); }
.tags { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.tag { font-size: var(--text-sm); }
.tag-cloud .count { color: var(--muted); }
.post-nav { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-top: 1.5rem; padding-top: 1rem; border-top: 1px solid var(--border); }

a { color: var(--link); text-decoration: underline; }
a:hover, a:focus { color: var(--hover); text-decoration: dotted underline;}

.pagination { margin-top: 1rem; }

/* Cards */
.card {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem;
  background: var(--bg);
}
.card-title {
  margin: 0 0 0.5rem;
  font-family: var(--font-heading);
}
.card-list {
  margin: 0;
  padding-left: 1.25rem;
}
.card-list li {
  margin-bottom: 0.25rem;
}

/* Grid layout */
.card-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

/* Sections */
.section-writing,
.section-web {
  margin-bottom: 1.5rem;
}

/* Around the Web */
.web-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

/* Search */
.site-search {
  position: relative;
  display: flex;
  align-items: center;
}
.search-toggle {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--fg);
  padding: 0.35rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  flex-shrink: 0;
  transition: color 0.15s;
}
.search-toggle:hover {
  color: var(--hover);
}
#search-input {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.4rem 0.75rem;
  font-family: var(--font-text);
  font-size: var(--text-sm);
  color: var(--fg);
  width: 0;
  opacity: 0;
  overflow: hidden;
  pointer-events: none;
  transition: width 0.25s ease, opacity 0.2s ease;
}
.site-search.is-open #search-input {
  width: 12rem;
  opacity: 1;
  pointer-events: auto;
}
#search-input:focus {
  outline: none;
  border-color: var(--link);
}
.search-results {
  position: absolute;
  top: calc(100% + 0.5rem);
  right: 0;
  width: 18rem;
  max-height: 20rem;
  overflow-y: auto;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  z-index: 100;
}
.search-result {
  display: block;
  padding: 0.75rem 1rem;
  text-decoration: none;
  border-bottom: 1px solid var(--border);
}
.search-result:last-child {
  border-bottom: none;
}
.search-result:hover {
  background: color-mix(in oklab, var(--border) 30%, transparent);
}
.search-title {
  display: block;
  font-weight: 600;
  color: var(--fg);
  margin-bottom: 0.25rem;
}
.search-desc {
  display: block;
  font-size: var(--text-sm);
  color: var(--muted);
}
.no-results {
  padding: 1rem;
  color: var(--muted);
  text-align: center;
  margin: 0;
}

small {
  font-size: var(--text-sm);
}

@media (max-width: 600px) {
  .site-header .wrap { flex-direction: column; align-items: flex-start; gap: 0.5rem; }
  .card-grid { grid-template-columns: 1fr; }
  .site-search.is-open #search-input { width: 10rem; }
  .search-results { width: 100%; right: auto; left: 0; }
}
