/* supoku brand layer for Walker. Kept separate from the theme for safe upgrades. */
:root {
  --supoku-bg: #f7f8fa;
  --supoku-surface: #ffffff;
  --supoku-text: #111827;
  --supoku-text-secondary: #4b5563;
  --supoku-text-muted: #8a94a3;
  --supoku-border: #e5e7eb;
  --supoku-primary: #2f5d7c;
  --supoku-primary-hover: #244a63;
  --supoku-accent: #2f8f83;
  --supoku-accent-soft: #e8f5f3;
  --supoku-radius: 14px;
  color-scheme: light;
}

[data-theme="dark"] {
  --supoku-bg: #0f141a;
  --supoku-surface: #161c23;
  --supoku-text: #f3f4f6;
  --supoku-text-secondary: #c7ced6;
  --supoku-text-muted: #94a3b8;
  --supoku-border: #2a3440;
  --supoku-primary: #68b7d9;
  --supoku-primary-hover: #91d2ec;
  --supoku-accent: #55b8a9;
  --supoku-accent-soft: #173c3a;
  color-scheme: dark;
}

html {
  scroll-behavior: smooth;
}

body {
  background: var(--supoku-bg);
  color: var(--supoku-text);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

body > header,
body > main,
body > footer {
  width: min(100% - 32px, 1200px);
  margin-inline: auto;
}

a {
  color: var(--supoku-primary);
  text-underline-offset: 0.18em;
}

a:hover {
  color: var(--supoku-primary-hover);
}

article,
.post,
.card {
  border-color: var(--supoku-border);
  border-radius: var(--supoku-radius);
  transition: transform 180ms ease, border-color 180ms ease, background-color 180ms ease;
}

.card:hover {
  transform: translateY(-2px);
}

#post-content,
.markdown-body,
.prose {
  max-width: 760px;
  margin-inline: auto;
  color: var(--supoku-text);
  font-size: 17px;
  line-height: 1.8;
}

#post-content :where(p, li),
.markdown-body :where(p, li),
.prose :where(p, li) {
  color: var(--supoku-text-secondary);
}

#post-content :where(h1, h2, h3, h4),
.markdown-body :where(h1, h2, h3, h4),
.prose :where(h1, h2, h3, h4) {
  color: var(--supoku-text);
  letter-spacing: -0.018em;
}

#post-content :where(code, pre),
.markdown-body :where(code, pre),
.prose :where(code, pre) {
  font-family: "SFMono-Regular", "Cascadia Code", Consolas, "Liberation Mono", Menlo, monospace;
}

#post-content :not(pre) > code,
.markdown-body :not(pre) > code,
.prose :not(pre) > code {
  border: 1px solid var(--supoku-border);
  border-radius: 6px;
  background: var(--supoku-surface);
  padding: 0.12em 0.35em;
}

#post-content blockquote,
.markdown-body blockquote,
.prose blockquote {
  border-inline-start: 3px solid var(--supoku-accent);
  color: var(--supoku-text-secondary);
}

::selection {
  background: var(--supoku-accent-soft);
  color: var(--supoku-text);
}

.supoku-footer-extra {
  display: flex;
  justify-content: center;
  color: var(--supoku-text-muted);
  font-size: 14px;
  padding: 12px 16px 24px;
}

/* Walker layout refinements. */
body {
  min-height: 100vh;
  background:
    radial-gradient(
      circle at 12% 8%,
      color-mix(in srgb, var(--supoku-accent) 9%, transparent),
      transparent 28rem
    ),
    radial-gradient(
      circle at 88% 2%,
      color-mix(in srgb, var(--supoku-primary) 8%, transparent),
      transparent 32rem
    ),
    var(--supoku-bg) !important;
}

.main {
  width: min(100%, 1240px);
  max-width: 1240px !important;
  align-items: flex-start;
  gap: 2rem;
  padding: 1.5rem 1.5rem 4rem !important;
}

.content-wrapper {
  min-width: 0;
}

.content-wrapper > h2:first-child {
  margin-bottom: 1.75rem !important;
  font-size: 0.95rem !important;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.post-item {
  border: 0;
  padding-bottom: 0.25rem !important;
}

.post-item .post-title {
  margin-top: 0 !important;
  color: var(--supoku-text);
  font-size: clamp(1.35rem, 2.2vw, 1.75rem) !important;
  line-height: 1.4;
  letter-spacing: -0.025em;
}

.post-item .post-abstract {
  margin-block: 1rem 1.25rem !important;
  color: var(--supoku-text-secondary) !important;
  font-size: 1rem;
  line-height: 1.85;
}

.post-item .flex.gap-2\.5 {
  flex-wrap: wrap;
  row-gap: 0.65rem;
}

.post-detail > h1,
.post-detail > div:first-child h1 {
  color: var(--supoku-text);
  line-height: 1.35;
  letter-spacing: -0.035em;
}

footer {
  background: transparent !important;
}

footer > hr {
  border-color: var(--supoku-border) !important;
}

@media (min-width: 1024px) {
  #sidebar.sidebar-wrapper {
    flex: 0 0 18rem;
    width: 18rem !important;
  }

  #sidebar .sidebar-content {
    height: auto !important;
  }

  #sidebar .static.left-0.right-0.top-0 {
    padding: 1.5rem !important;
    border: 1px solid var(--supoku-border);
    border-radius: 1.5rem;
    background: color-mix(in srgb, var(--supoku-surface) 92%, transparent);
    box-shadow: 0 20px 60px rgb(15 23 42 / 8%);
    backdrop-filter: blur(14px);
  }

  #sidebar .group.relative.mt-32 {
    margin-top: 3.5rem !important;
  }

  #sidebar h1 {
    margin-top: 1.5rem !important;
    font-size: 2.25rem !important;
    letter-spacing: -0.04em;
  }

  #sidebar p {
    line-height: 1.75;
  }

  .content-wrapper {
    flex: 1 1 auto;
    width: auto !important;
    margin-top: 1.5rem;
    padding: 2rem 2.25rem !important;
    border: 1px solid var(--supoku-border);
    border-radius: 1.5rem;
    background: color-mix(in srgb, var(--supoku-surface) 94%, transparent);
    box-shadow: 0 20px 60px rgb(15 23 42 / 8%);
    backdrop-filter: blur(14px);
  }
}

@media (max-width: 640px) {
  body > header,
  body > main,
  body > footer {
    width: min(100% - 24px, 1200px);
  }

  #post-content,
  .markdown-body,
  .prose {
    font-size: 16px;
  }
}

@media (max-width: 1023px) {
  .main {
    width: 100%;
    padding: 5.75rem 1rem 3rem !important;
  }

  .content-wrapper {
    width: 100%;
    padding-top: 0 !important;
  }

  .post-item {
    padding: 1.25rem !important;
    border: 1px solid var(--supoku-border);
    border-radius: 1.1rem;
    background: var(--supoku-surface);
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  article,
  .post,
  .card {
    transition: none;
  }
}
