:root {
  --bg-color: #f8f9fa;
  --card-bg: #ffffff;
  --accent: #228be6;
  --text: #212529;
  --muted: #868e96;
  --line: #e9ecef;
  --shadow: 0 4px 16px rgba(15, 23, 42, .06);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  padding-top: 3.5rem;
  background: var(--bg-color);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  line-height: 1.6;
}

h1, h2, h3, p { margin: 0; }
a { color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.navbar {
  position: fixed;
  z-index: 10;
  inset: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 3.5rem;
  padding: 0 1.5rem;
  background: rgba(255, 255, 255, .92);
  box-shadow: 0 1px 3px rgba(15, 23, 42, .08);
}

.logo { color: var(--text); font-weight: 800; letter-spacing: -.03em; text-decoration: none; }
.navbar nav { display: flex; gap: 1.25rem; }
.navbar nav a { color: #495057; font-weight: 600; text-decoration: none; }
.navbar nav a:hover { color: var(--accent); }

.wrap { max-width: 1080px; margin: 0 auto; padding: 0 1.25rem 4rem; }
.hero { padding: 3.25rem 0 2.25rem; text-align: center; }
.avatar {
  display: grid;
  place-items: center;
  width: 4.25rem;
  height: 4.25rem;
  margin: 0 auto 1rem;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-weight: 800;
}
.hero h1 { margin-bottom: .45rem; font-size: 2.15rem; font-weight: 800; letter-spacing: -.03em; }
.hero p { color: #495057; }

.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.25rem; }
.card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 1.25rem 1.3rem 1.05rem;
  background: var(--card-bg);
  border-radius: 12px;
  box-shadow: var(--shadow);
  transition: transform .2s ease, box-shadow .2s ease;
}
.card:hover { transform: translateY(-4px); box-shadow: 0 14px 28px rgba(15, 23, 42, .12); }

.tag {
  margin-bottom: .55rem;
  color: var(--accent);
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.card h2 { margin-bottom: .65rem; font-size: 1.15rem; line-height: 1.45; }
.card h2 a { color: inherit; text-decoration: none; }
.card h2 a::after { content: ""; position: absolute; inset: 0; }
.summary {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  margin-bottom: 1rem;
  color: #495057;
  line-height: 1.6;
}
.card time {
  margin-top: auto;
  padding-top: .75rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: .8rem;
}
.empty {
  grid-column: 1 / -1;
  padding: 3rem 1rem;
  background: var(--card-bg);
  border-radius: 12px;
  box-shadow: var(--shadow);
  color: var(--muted);
  text-align: center;
}

.reading { max-width: 42rem; margin: 2.5rem auto 0; }
.reading h1 { margin: .4rem 0 .8rem; font-size: 2rem; line-height: 1.35; }
.post-meta, .back { color: var(--muted); }
.post-body { margin-top: 1.25rem; line-height: 1.75; }
.post-body img { max-width: 100%; height: auto; }
.field { display: block; margin: 0 0 1rem; }
textarea, input[type="text"], input[type="password"] { width: 100%; font: inherit; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; }

@media (max-width: 900px) { .grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) {
  .grid { grid-template-columns: 1fr; }
  .navbar { padding: 0 1rem; }
}
@media (prefers-reduced-motion: reduce) { .card { transition: none; } }
