:root {
  --bg: #eef3f7;
  --surface: rgba(255, 255, 255, 0.88);
  --surface-strong: #ffffff;
  --line: rgba(28, 52, 84, 0.14);
  --text: #17304f;
  --muted: #61758f;
  --accent: #0f6abf;
  --accent-soft: rgba(15, 106, 191, 0.1);
  --shadow: 0 24px 70px rgba(28, 52, 84, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--text);
  font-family: "Noto Sans SC", sans-serif;
  font-size: 16px;
  background:
    radial-gradient(circle at top left, rgba(15, 106, 191, 0.12), transparent 28%),
    radial-gradient(circle at top right, rgba(70, 144, 226, 0.12), transparent 22%),
    linear-gradient(180deg, #f6fbff 0%, var(--bg) 100%);
  line-height: 1.65;
}

a {
  color: inherit;
  text-decoration: none;
}

#cursor-trail {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 30;
}

#cursor-trail {
  overflow: hidden;
}

.site-shell {
  width: min(1120px, calc(100% - 40px));
  margin: 0 auto;
  padding: 28px 0 56px;
  position: relative;
  z-index: 2;
}

.site-header,
.site-footer,
.hero,
.content-page,
.post-card,
.category-card {
  border: 1px solid var(--line);
  background: var(--surface);
  backdrop-filter: blur(14px);
  box-shadow: var(--shadow);
}

.site-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  padding: 18px 22px;
  border-radius: 24px;
  position: sticky;
  top: 18px;
  z-index: 10;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand strong,
.hero h1,
.content-header h1,
.post-card h2,
.post-card h3 {
  letter-spacing: -0.03em;
}

.brand span {
  display: flex;
  flex-direction: column;
}

.brand strong {
  font-size: 1.28rem;
}

.brand em,
.site-nav a,
.post-meta,
.eyebrow,
.section-head a,
.site-footer {
  color: var(--muted);
}

.brand em {
  font-style: normal;
  font-size: 1.06rem;
}

.brand-mark {
  width: 46px;
  height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(15, 106, 191, 0.16);
  background: #fff;
  box-shadow: 0 8px 20px rgba(15, 106, 191, 0.12);
}

.brand-mark img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.site-nav {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  font-size: 1.1rem;
}

.site-nav a:hover,
.section-head a:hover,
.post-card h2 a:hover,
.post-card h3 a:hover {
  color: var(--accent);
}

.site-main {
  padding-top: 28px;
}

.hero {
  border-radius: 36px;
  padding: 44px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  animation: rise 0.6s ease-out both;
}

.hero-eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.hero-eyebrow-logo {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  border: 1px solid rgba(15, 106, 191, 0.18);
  box-shadow: 0 4px 10px rgba(15, 106, 191, 0.12);
  object-fit: cover;
}

.eyebrow {
  margin: 0;
  font-size: 1rem;
  letter-spacing: 0.16em;
  font-family: "JetBrains Mono", monospace;
}

.hero h1 {
  margin: 0;
  font-size: clamp(2rem, 4.2vw, 3.4rem);
  line-height: 1.12;
}

.hero-text {
  max-width: 42rem;
  font-size: 1.12rem;
  color: var(--muted);
}

.hero-panel {
  border-radius: 28px;
  padding: 24px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.95), rgba(242, 248, 255, 0.9));
  border: 1px solid rgba(15, 106, 191, 0.12);
}

.panel-label,
.section-head h2 {
  margin: 0 0 12px;
  font-weight: 700;
}

.hero-panel,
.post-card p,
.category-card span,
.markdown-body,
.site-footer,
.section-head a {
  font-size: 1rem;
}

.section {
  margin-top: 28px;
  animation: rise 0.7s ease-out both;
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  gap: 16px;
}

.section-head h2 {
  font-size: 1.4rem;
}

.category-grid,
.post-list {
  display: grid;
  gap: 18px;
}

.category-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.category-card,
.post-card,
.content-page {
  border-radius: 28px;
}

.category-card,
.post-card {
  padding: 22px;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.category-card:hover,
.post-card:hover {
  transform: translateY(-4px);
  border-color: rgba(15, 106, 191, 0.3);
}

.category-card strong {
  display: block;
  margin-bottom: 10px;
  font-size: 1.24rem;
}

.category-card span,
.post-card p,
.markdown-body {
  color: var(--muted);
}

.post-meta {
  display: flex;
  gap: 12px;
  align-items: center;
  font-size: 1.04rem;
  margin: 0 0 10px;
  font-family: "JetBrains Mono", monospace;
}

.post-card h2,
.post-card h3,
.content-header h1 {
  margin: 0 0 12px;
}

.post-card h2,
.post-card h3 {
  font-size: 1.42rem;
}

.content-page {
  padding: 34px;
  animation: rise 0.5s ease-out both;
}

.content-header {
  margin-bottom: 24px;
}

.content-header h1 {
  font-size: clamp(1.9rem, 3.1vw, 2.75rem);
}

.markdown-body h2,
.markdown-body h3 {
  color: var(--text);
  margin-top: 2rem;
}

.markdown-body h2 {
  font-size: 1.56rem;
}

.markdown-body h3 {
  font-size: 1.28rem;
}

.markdown-body p,
.markdown-body li,
.markdown-body blockquote {
  font-size: 1.02rem;
  line-height: 1.82;
  color: var(--text);
}

.post-page .markdown-body {
  font-size: 1.02rem;
  color: var(--text);
}

.markdown-body code,
.markdown-body pre {
  font-family: "JetBrains Mono", monospace;
}

.markdown-body code {
  background: var(--accent-soft);
  padding: 0.15rem 0.35rem;
  border-radius: 8px;
}

.markdown-body pre {
  overflow: auto;
  padding: 16px;
  border-radius: 16px;
  background: #10233a;
  color: #dcecff;
}

.markdown-body ul,
.markdown-body ol {
  padding-left: 1.4rem;
}

.markdown-body img {
  display: block;
  width: min(100%, 920px);
  margin: 24px auto;
  border-radius: 22px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.markdown-body video {
  display: block;
  width: min(100%, 920px);
  margin: 24px auto;
  border-radius: 22px;
  box-shadow: var(--shadow);
}

.site-footer {
  margin-top: 28px;
  border-radius: 24px;
  padding: 18px 22px;
  display: flex;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}

.site-footer p {
  margin: 0;
}

.site-footer a {
  color: var(--accent);
}

.empty-state {
  padding: 32px;
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.78);
  border: 1px dashed rgba(15, 106, 191, 0.22);
}

.empty-state p {
  margin-top: 0;
  margin-bottom: 16px;
  color: var(--muted);
}

.empty-link {
  color: var(--accent);
  font-weight: 700;
}

.trail-star {
  position: absolute;
  left: 0;
  top: 0;
  font-size: 16px;
  line-height: 1;
  font-weight: 700;
  color: var(--star-color, #ffd166);
  text-shadow:
    0 0 8px rgba(255, 255, 255, 0.65),
    0 0 16px rgba(158, 208, 255, 0.45);
  user-select: none;
  transform: translate(-50%, -50%) rotate(var(--rot, 0deg)) scale(var(--scale, 1));
  animation: star-fall 900ms ease-out forwards;
}

.trail-star::selection {
  background: transparent;
}

@keyframes star-fall {
  from {
    opacity: 1;
    transform: translate(-50%, -50%) rotate(var(--rot, 0deg)) scale(var(--scale, 1));
  }
  to {
    opacity: 0;
    transform: translate(calc(-50% + var(--dx, 0px)), calc(-50% + 30px))
      rotate(calc(var(--rot, 0deg) + 120deg)) scale(0.35);
  }
}

.markdown-body img.logo-ainote {
  width: min(220px, 65%);
  max-width: 220px;
  height: auto;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 820px) {
  .site-shell {
    width: min(100% - 24px, 1120px);
  }

  .site-header,
  .hero,
  .content-page,
  .site-footer {
    padding: 20px;
  }

  .site-header,
  .hero {
    grid-template-columns: 1fr;
  }

  .site-header {
    position: static;
    flex-direction: column;
    align-items: flex-start;
  }

  .category-grid {
    grid-template-columns: 1fr;
  }

  .hero h1 {
    font-size: 2.2rem;
  }
}
