/* ---------------------------------------------------
   rohand.blog — base styles
   Palette: black / grey / white only. Monospace type.
--------------------------------------------------- */

:root {
  --bg: #ffffff;
  --fg: #111111;
  --muted: #5f5f5f;
  --border: #e0e0e0;
  --surface: #f6f6f6;
  --link: #111111;
  --link-underline: #b5b5b5;

  --font-mono: "JetBrains Mono", "Söhne Mono", ui-monospace, "SFMono-Regular",
    Menlo, Consolas, "Liberation Mono", monospace;

  --max-width: 680px;
  --nav-height: 64px;

  --accent: #3b6ea5;
  --accent-soft: #e8eef4;
}

:root[data-theme="dark"] {
  --bg: #111111;
  --fg: #ededed;
  --muted: #9a9a9a;
  --border: #2a2a2a;
  --surface: #191919;
  --link: #ededed;
  --link-underline: #4a4a4a;
  --accent: #79b0e8;
  --accent-soft: #1b2a36;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #111111;
    --fg: #ededed;
    --muted: #9a9a9a;
    --border: #2a2a2a;
    --surface: #191919;
    --link: #ededed;
    --link-underline: #4a4a4a;
    --accent: #79b0e8;
    --accent-soft: #1b2a36;
  }
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-mono);
  font-size: 16px;
  line-height: 1.65;
  transition: background 0.2s ease, color 0.2s ease;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

main {
  flex: 1 0 auto;
}

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

a:hover {
  text-decoration-color: currentColor;
}

.wrap {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 20px;
}

/* ---------- Nav ---------- */

.site-nav {
  height: var(--nav-height);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.site-nav .wrap {
  max-width: 760px;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-left,
.nav-right {
  display: flex;
  align-items: center;
  gap: 18px;
}

.icon-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  color: var(--fg);
  text-decoration: none;
  opacity: 0.75;
  transition: opacity 0.15s ease;
}

.icon-link:hover {
  opacity: 1;
}

.icon-link svg {
  width: 100%;
  height: 100%;
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  background: none;
  border: none;
  padding: 0;
  color: var(--fg);
  cursor: pointer;
  opacity: 0.75;
  transition: opacity 0.15s ease;
}

.theme-toggle:hover {
  opacity: 1;
}

.theme-toggle svg {
  width: 100%;
  height: 100%;
}

.theme-toggle .icon-moon {
  display: none;
}

:root[data-theme="dark"] .theme-toggle .icon-sun {
  display: none;
}

:root[data-theme="dark"] .theme-toggle .icon-moon {
  display: block;
}

/* ---------- Hero (home page only) ---------- */

.hero {
  padding: 56px 0 44px;
}

.hero .wrap {
  display: flex;
  align-items: center;
  gap: 28px;
}

.hero-photo {
  width: 84px;
  height: 84px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--border);
  flex-shrink: 0;
}

.hero-text h1 {
  margin: 0 0 2px;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.hero-title {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 14px;
}

.hero-tagline {
  margin: 0;
  font-size: 14px;
  color: var(--fg);
  max-width: 40ch;
}

@media (max-width: 520px) {
  .hero .wrap {
    flex-direction: column;
    align-items: flex-start;
    gap: 18px;
  }
}

/* ---------- Section headers ---------- */

.section-label {
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin: 0 0 18px;
}

/* ---------- Blog index ---------- */

.post-list {
  list-style: none;
  margin: 0;
  padding: 0 0 60px;
}

.post-item {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  padding: 16px 0;
}

.post-item a {
  font-size: 15px;
  text-decoration: underline;
  text-decoration-color: var(--link-underline);
  text-underline-offset: 3px;
}

.post-item a:hover {
  text-decoration-color: currentColor;
}

.post-date {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  flex-shrink: 0;
}

.post-excerpt {
  margin: 4px 0 0;
  font-size: 13px;
  color: var(--muted);
}

@media (max-width: 520px) {
  .post-item {
    flex-direction: column;
    gap: 4px;
  }
}

/* ---------- Post page ---------- */

.post-header {
  padding: 44px 0 8px;
}

.back-link {
  display: inline-block;
  font-size: 13px;
  color: var(--muted);
  text-decoration: none;
  margin-bottom: 22px;
}

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

.post-title {
  font-size: 24px;
  line-height: 1.3;
  margin: 0 0 10px;
  letter-spacing: -0.01em;
}

.post-meta {
  font-size: 12px;
  color: var(--muted);
}

.post-tags {
  margin-top: 10px;
}

.tag {
  display: inline-block;
  font-size: 11px;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 2px 7px;
  margin-right: 6px;
}

.post-body {
  padding: 36px 0 80px;
  font-size: 15.5px;
}

.post-body p {
  margin: 0 0 20px;
}

.post-body h2 {
  font-size: 17px;
  color: var(--accent);
  margin: 40px 0 16px;
  letter-spacing: -0.01em;
}

.post-body blockquote {
  margin: 0 0 28px;
  padding-left: 16px;
  border-left: 2px solid var(--accent);
  color: var(--muted);
  font-style: italic;
}

.post-body code {
  background: var(--accent-soft);
  color: var(--accent);
  border-radius: 3px;
  padding: 2px 6px;
  font-size: 0.9em;
}

.post-figure {
  margin: 8px 0 28px;
  text-align: center;
}

.post-figure svg {
  width: 100%;
  max-width: 560px;
  height: auto;
}

.post-figure .nn-edges line {
  stroke: var(--border);
  stroke-width: 1;
}

.post-figure .nn-nodes circle {
  fill: var(--bg);
  stroke: var(--fg);
  stroke-width: 1.4;
}

.post-figure .nn-dots circle {
  fill: var(--muted);
}

.post-figure .nn-labels text {
  fill: var(--muted);
  font-family: var(--font-mono);
  font-size: 12px;
}

.post-figure figcaption {
  font-size: 12px;
  color: var(--muted);
  max-width: 48ch;
  margin: 10px auto 0;
}

.post-body pre {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 4px;
  padding: 14px 16px;
  overflow-x: auto;
  font-size: 13.5px;
  margin: 0 0 28px;
}

.post-body pre code {
  background: none;
  color: var(--fg);
  padding: 0;
  font-size: 1em;
}

/* ---------- Footer ---------- */

.site-footer {
  flex-shrink: 0;
  padding: 20px 0 32px;
  font-size: 12px;
  color: var(--muted);
}

.site-footer .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
