@import url("https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500;700&family=Space+Grotesk:wght@400;500;700&family=Syne:wght@700;800&display=swap");

:root {
  --color-bg: #f0f5f8;
  --color-text: #111111;
  --color-accent: #ffd000;
  --color-dark: #1e3a2f;
  --color-border: #b8c9d9;
  --color-muted: #4a6070;
  --color-header: #4a6070;
  --font-mono: "IBM Plex Mono", "Courier New", monospace;
  --font-sans: "Space Grotesk", system-ui, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ── Terminal prompt header ── */

.site-header {
  background: var(--color-header);
  padding: 0.5rem 1rem;
  font-family: var(--font-mono);
  font-size: 0.9rem;
}

.prompt__user {
  color: #28ca41;
}
.prompt__sep {
  color: var(--color-border);
}
.prompt__path {
  color: var(--color-accent);
}
.prompt__dollar {
  color: var(--color-border);
}

.prompt__link {
  color: var(--color-accent);
  text-decoration: none;
}

.prompt__link:hover {
  text-decoration: underline;
}

/* ── Layout ── */

main {
  max-width: 800px;
  margin: 0 auto;
  padding: 2rem 1rem;
  flex: 1;
  width: 100%;
}

/* ── Homepage intro ── */

.home-intro {
  display: flex;
  gap: 1.25rem;
  align-items: flex-start;
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px dashed var(--color-border);
}

.home-avatar-wrap {
  width: 200px;
  height: 200px;
  flex-shrink: 0;
  background: var(--color-border);
  border-radius: 2px;
  overflow: hidden;
}

.home-avatar {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.home-intro__text p {
  font-size: 0.95rem;
  margin-bottom: 0.35rem;
}

.home-intro__text p:last-child {
  margin-bottom: 0;
  color: var(--color-muted);
  font-size: 0.9rem;
}

/* ── Post list ── */

.posts-section-header {
  color: var(--color-muted);
  margin-bottom: 1rem;
  font-size: 0.85rem;
  font-family: var(--font-mono);
  letter-spacing: 0.05em;
}

.post-list {
  list-style: none;
  border-top: 1px dashed var(--color-border);
}

.post-item {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  padding: 0.65rem 0.5rem;
  border-bottom: 1px dashed var(--color-border);
  text-decoration: none;
  color: var(--color-text);
  cursor: pointer;
  transition:
    background 0.05s,
    color 0.05s;
}

.post-item:hover,
.post-item--focused,
.post-item:focus {
  background: var(--color-text);
  color: var(--color-bg);
  outline: none;
}

.post-item__row {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
}

.post-item__arrow {
  color: var(--color-accent);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  flex-shrink: 0;
  width: 1.2ch;
}

.post-item__title {
  font-size: 0.95rem;
  font-weight: 600;
  flex: 1;
}

.post-item__badges {
  display: flex;
  gap: 0.5rem;
  align-items: baseline;
  flex-shrink: 0;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--color-muted);
}

.post-item__sub {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  padding-left: 1.7ch;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--color-muted);
}

.post-item__date {
  flex-shrink: 0;
}

.post-item__excerpt {
  opacity: 0.8;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.post-item:hover .post-item__badges,
.post-item--focused .post-item__badges,
.post-item:focus .post-item__badges,
.post-item:hover .post-item__sub,
.post-item--focused .post-item__sub,
.post-item:focus .post-item__sub {
  color: var(--color-bg);
  opacity: 0.65;
}

.post-item:hover .post-item__arrow,
.post-item--focused .post-item__arrow,
.post-item:focus .post-item__arrow {
  color: var(--color-accent);
  opacity: 1;
}

/* ── Individual post ── */

.post-header {
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px dashed var(--color-border);
}

.post-header h1 {
  font-family: "Syne", sans-serif;
  font-size: 2rem;
  line-height: 1.2;
  margin-bottom: 0.4rem;
}

.post-meta {
  color: var(--color-muted);
  font-family: var(--font-mono);
  font-size: 0.82rem;
}

.post-content {
  max-width: 65ch;
  margin-top: 1.5rem;
}

.post-content p,
.post-content ul,
.post-content ol {
  margin-bottom: 1rem;
}

.post-content h2,
.post-content h3 {
  font-family: "Syne", sans-serif;
  margin: 1.75rem 0 0.5rem;
}

.post-content a {
  color: var(--color-dark);
}

.post-content code {
  font-family: var(--font-mono);
  background: var(--color-border);
  padding: 0.1em 0.35em;
  border-radius: 2px;
  font-size: 0.88em;
}

.post-content pre {
  background: var(--color-dark);
  color: #f0f5f8;
  padding: 1rem;
  overflow-x: auto;
  margin-bottom: 1rem;
  border-radius: 2px;
  font-family: var(--font-mono);
}

.post-content pre code {
  background: none;
  padding: 0;
}

.back-link {
  display: inline-block;
  margin-bottom: 1.5rem;
  color: var(--color-muted);
  text-decoration: none;
  font-family: var(--font-mono);
  font-size: 0.85rem;
}

.back-link:hover {
  color: var(--color-text);
}

/* ── Footer ── */

.site-footer {
  background: var(--color-header);
  color: var(--color-border);
  padding: 0.4rem 1rem;
  font-size: 0.8rem;
  font-family: var(--font-mono);
  display: flex;
  align-items: center;
}

.site-footer__left {
  display: flex;
  gap: 1.5rem;
}

.footer-link {
  color: var(--color-border);
  text-decoration: none;
}

.footer-link:hover {
  color: white;
}

.site-footer__keys {
  margin-left: auto;
  display: flex;
  gap: 1.5rem;
}

.site-footer kbd {
  background: var(--color-accent);
  color: #111;
  padding: 0 4px;
  border-radius: 2px;
  font-size: 0.75rem;
  font-family: inherit;
}
