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

:root {
  --bg: #f4f4f8;
  --bg-surface: #eeeef4;
  --bg-elevated: #e8e8f0;
  --fg: #444458;
  --fg-strong: #1a1a2e;
  --accent: #6a6aff;
  --accent-dim: rgba(106, 106, 255, 0.1);
  --accent-glow: rgba(106, 106, 255, 0.05);
  --muted: #8888a0;
  --border: rgba(106, 106, 255, 0.12);
  --code-bg: #eaeaf2;
  --code-fg: #555568;
  --font: 'Outfit', system-ui, sans-serif;
  --mono: 'JetBrains Mono', monospace;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font);
  font-weight: 300;
  background: var(--bg);
  color: var(--fg);
  line-height: 1.8;
  max-width: 660px;
  margin: 0 auto;
  padding: 3.5rem 1.5rem 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* subtle gradient backdrop */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 100vh;
  background:
    radial-gradient(ellipse 80% 50% at 50% -5%, rgba(106, 106, 255, 0.08) 0%, transparent 70%),
    radial-gradient(ellipse 40% 30% at 85% 60%, rgba(106, 106, 255, 0.04) 0%, transparent 60%);
  pointer-events: none;
  z-index: -1;
}

::selection {
  background: rgba(106, 106, 255, 0.2);
  color: var(--fg-strong);
}

/* links */
a {
  color: var(--accent);
  text-decoration: none;
  transition: opacity 0.2s ease;
}
a:hover { opacity: 0.65; }

/* ——— header ——— */
header {
  position: relative;
  text-align: center;
  margin-bottom: 2.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
}
.site-title {
  display: block;
  font-weight: 200;
  font-size: 1.8rem;
  color: var(--fg-strong);
  letter-spacing: 0.18em;
}
.site-title:hover { color: var(--accent); opacity: 1; }

.nav-icons {
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.nav-icons a {
  color: var(--muted);
  transition: color 0.2s ease;
  opacity: 0.4;
}
.nav-icons a:nth-child(2) {
  opacity: 0.55;
}
.nav-icons a:nth-child(3) {
  opacity: 0.3;
}
.nav-icons a:hover { color: var(--accent); opacity: 0.9; }

/* ——— post index ——— */
.post-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}
.post-preview {
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--border);
}
.post-preview:first-child { padding-top: 0; }
.post-preview:last-child { border-bottom: none; }

.post-line {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1.5rem;
  text-align: right;
}
.post-preview h2 {
  font-weight: 300;
  font-size: 1.15rem;
  line-height: 1.4;
  color: var(--fg-strong);
  letter-spacing: 0.01em;
  flex-shrink: 0;
}
.post-preview h2 a { color: inherit; }
.post-preview h2 a:hover { color: var(--accent); opacity: 1; }
.post-line .post-meta {
  display: flex;
  gap: 0.75rem;
  align-items: baseline;
  flex-shrink: 0;
}

.post-meta {
  font-size: 0.73rem;
  font-weight: 300;
  color: var(--muted);
  display: flex;
  gap: 0.75rem;
  align-items: baseline;
  letter-spacing: 0.04em;
}
.post-meta a { color: var(--muted); }
.post-meta a:hover { color: var(--accent); opacity: 1; }
.post-excerpt {
  margin-top: 0.45rem;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 300;
  line-height: 1.7;
}

/* ——— single post ——— */
.post-header {
  margin-bottom: 2rem;
}
.post-title-line {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  margin-bottom: 0;
}
.post-header h1 {
  font-weight: 200;
  font-size: 1.5rem;
  line-height: 1.3;
  color: var(--fg-strong);
  letter-spacing: 0.02em;
  flex-shrink: 0;
}
.post-header .post-meta {
  flex-shrink: 0;
}

.post-content {
  font-size: 0.95rem;
  font-weight: 300;
  line-height: 1.85;
}
.post-content h2 {
  font-weight: 300;
  font-size: 1.25rem;
  color: var(--fg-strong);
  margin-top: 3rem;
  margin-bottom: 0.75rem;
  letter-spacing: 0.01em;
}
.post-content h3 {
  font-weight: 400;
  font-size: 1rem;
  color: var(--fg-strong);
  margin-top: 2rem;
  margin-bottom: 0.5rem;
  letter-spacing: 0.02em;
}
.post-content p {
  margin-bottom: 1.35rem;
}
.post-content ul, .post-content ol {
  margin-bottom: 1.35rem;
  padding-left: 1.25rem;
}
.post-content li {
  margin-bottom: 0.35rem;
}
.post-content li::marker { color: var(--muted); }

/* inline code */
.post-content code {
  font-family: var(--mono);
  font-weight: 400;
  background: var(--code-bg);
  color: var(--code-fg);
  padding: 0.15em 0.45em;
  border-radius: 3px;
  font-size: 0.82em;
  border: 1px solid var(--border);
}

/* code blocks */
.post-content pre {
  background: var(--code-bg);
  border: 1px solid var(--border);
  padding: 1.25rem 1.5rem;
  border-radius: 5px;
  overflow-x: auto;
  margin-bottom: 1.5rem;
  line-height: 1.6;
}
.post-content pre code {
  background: none;
  border: none;
  padding: 0;
  font-size: 0.8rem;
  font-weight: 300;
  color: var(--code-fg);
}

/* blockquote */
.post-content blockquote {
  border-left: 1px solid var(--accent);
  padding: 0.25rem 0 0.25rem 1.5rem;
  margin-bottom: 1.5rem;
  color: var(--muted);
  font-style: italic;
  font-weight: 300;
}
.post-content blockquote p:last-child { margin-bottom: 0; }

.post-content img {
  max-width: 100%;
  border-radius: 4px;
  margin: 1.25rem 0;
}

.post-content hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 3rem 0;
}

.post-content strong { color: var(--fg-strong); font-weight: 500; }
.post-content em { font-style: italic; }

/* ——— tags ——— */
.tags::before {
  content: '//';
  color: var(--muted);
  opacity: 0.35;
  margin-right: 0.25rem;
}
.tags {
  display: inline-flex;
  align-items: baseline;
  gap: 0.5rem;
}
.tags a {
  font-size: 0.73rem;
  font-weight: 300;
  color: rgba(106, 106, 255, 0.55);
  letter-spacing: 0.03em;
  transition: color 0.15s ease;
}
.tags a:hover {
  color: var(--accent);
  opacity: 1;
}

/* ——— about page ——— */
.about-page h1 {
  font-weight: 200;
  font-size: 1.5rem;
  color: var(--fg-strong);
  margin-bottom: 1rem;
}
.about-page h2 {
  font-weight: 300;
  font-size: 1rem;
  color: var(--fg-strong);
  margin-top: 2rem;
  margin-bottom: 0.75rem;
}
.about-page p {
  font-weight: 300;
  font-size: 0.95rem;
  line-height: 1.8;
  margin-bottom: 1rem;
}
.about-author {
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
  font-weight: 300;
}
.about-author strong {
  color: var(--fg-strong);
  font-weight: 400;
  margin-right: 0.5rem;
}
.about-author a {
  color: var(--muted);
  font-size: 0.8rem;
}

/* ——— footer marquee ——— */
footer {
  margin-top: auto;
  padding-top: 3rem;
}
.marquee {
  overflow: hidden;
  white-space: nowrap;
  border-top: 1px solid var(--border);
  padding: 0.75rem 0;
}
.marquee-inner {
  display: inline-flex;
  animation: scroll-left 25s linear infinite;
  font-size: 0.7rem;
  font-weight: 300;
  letter-spacing: 0.08em;
  color: var(--muted);
}
@keyframes scroll-left {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* ——— responsive ——— */
@media (max-width: 600px) {
  html { font-size: 15px; }
  body { padding: 2.5rem 1.25rem 0; }
  .site-title { font-size: 1.4rem; }
  .post-header h1 { font-size: 1.65rem; }
}
