:root {
  --bg: #ffffff;
  --bg-glass: rgba(255, 255, 255, 0.92);
  --bg-secondary: #f5f5f5;
  --ink: #1a1a1a;
  --body-color: #4b5563;
  --muted: #6b7280;
  --accent: #14B8A6;
  --accent-soft: rgba(20, 184, 166, 0.35);
  --accent-wash: rgba(20, 184, 166, 0.18);
  --line: #ececec;
  --progress-bg: rgba(0, 0, 0, 0.08);
  --code-bg: #f4f4f5;
  --max-width: 720px;
  --header-height: 60px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f0f0f;
    --bg-glass: rgba(15, 15, 15, 0.92);
    --bg-secondary: #1a1a1a;
    --ink: #e5e5e5;
    --body-color: #b0b0b0;
    --muted: #6b7280;
    --accent: #5EEAD4;
    --accent-soft: rgba(94, 234, 212, 0.35);
    --accent-wash: rgba(94, 234, 212, 0.18);
    --line: #2a2a2a;
    --progress-bg: rgba(255, 255, 255, 0.08);
    --code-bg: #1e1e1e;
  }
}

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

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

::selection {
  background: var(--accent-wash);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--body-color);
  line-height: 1.7;
  font-size: 18px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

a:hover {
  color: var(--accent);
  text-decoration: underline;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg-glass);
  backdrop-filter: saturate(160%) blur(8px);
  -webkit-backdrop-filter: saturate(160%) blur(8px);
  border-bottom: 1px solid var(--line);
  height: var(--header-height);
}

.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.site-brand {
  display: flex;
  align-items: center;
  gap: 11px;
  text-decoration: none;
  color: var(--ink);
}

.site-brand:hover {
  text-decoration: none;
  color: var(--ink);
}

.site-brand svg {
  height: 26px;
  width: auto;
  display: block;
  color: var(--accent);
}

.site-brand span {
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 26px;
}

.header-nav a {
  color: var(--body-color);
  font-size: 15px;
  font-weight: 500;
  text-decoration: none;
  position: relative;
  transition: color 0.15s ease;
}

.header-nav a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -4px;
  height: 2px;
  width: 0;
  background: var(--accent);
  transition: width 0.18s ease;
}

.header-nav a:hover {
  color: var(--accent);
  text-decoration: none;
}

.header-nav a:hover::after {
  width: 100%;
}

/* Main content */
main {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 64px 24px 80px;
}

/* About page */
.about-intro {
  margin-bottom: 48px;
}

.about-intro h1 {
  font-size: 42px;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.15;
  color: var(--ink);
  margin-bottom: 20px;
}

.about-intro p {
  color: var(--body-color);
  font-size: 18px;
  line-height: 1.8;
  text-wrap: pretty;
}

/* 404 page */
.not-found {
  text-align: center;
}

.not-found h1 {
  font-size: 72px;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--ink);
  margin-bottom: 12px;
}

.not-found p {
  color: var(--body-color);
  font-size: 18px;
  margin-bottom: 32px;
}

.not-found img {
  width: 100%;
  max-width: 720px;
  height: auto;
  border-radius: 12px;
  display: block;
  margin: 0 auto;
}

/* Contact section */
.contact-section {
  padding-top: 32px;
  border-top: 1px solid var(--line);
}

.contact-section h2 {
  font-size: 20px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 16px;
}

.contact-section p {
  color: var(--body-color);
  margin-bottom: 20px;
}

.social-links {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.social-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  font-size: 15px;
  font-weight: 500;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.social-link:hover {
  border-color: var(--accent);
  background: var(--bg-secondary);
  text-decoration: none;
}

.social-link svg {
  width: 18px;
  height: 18px;
  color: var(--muted);
}

/* Blog index */
.blog-header {
  margin-bottom: 40px;
}

.blog-header h1 {
  font-size: 42px;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.15;
  color: var(--ink);
}

.blog-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.blog-post-card {
  padding: 28px 0;
  border-bottom: 1px solid var(--line);
}

.blog-post-card:last-child {
  border-bottom: none;
}

.blog-post-card h2 {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 8px;
  letter-spacing: -0.01em;
}

.blog-post-card h2 a {
  color: var(--ink);
}

.blog-post-card h2 a:hover {
  color: var(--accent);
  text-decoration: none;
}

.blog-post-card .post-date {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.blog-post-card .post-date .dot {
  display: inline-block;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
}

.blog-post-card .post-excerpt {
  color: var(--body-color);
  font-size: 16px;
  line-height: 1.6;
}

/* Blog article */
.article-header {
  margin-bottom: 40px;
}

.article-eyebrow {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 18px;
}

.article-eyebrow .dot {
  display: inline-block;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
}

.article-header h1 {
  font-size: 42px;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.15;
  color: var(--ink);
}

.article-content {
  line-height: 1.8;
}

.article-content h2 {
  color: var(--ink);
  font-size: 26px;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.01em;
  margin-top: 48px;
  margin-bottom: 20px;
}

.article-content h3 {
  color: var(--ink);
  font-size: 20px;
  font-weight: 600;
  margin-top: 32px;
  margin-bottom: 12px;
}

.article-content h2 a,
.article-content h3 a {
  color: var(--ink);
  text-decoration: none;
  border-bottom: none;
}

.article-content h2 a:hover,
.article-content h3 a:hover {
  color: var(--accent);
}

.article-content p {
  margin-bottom: 24px;
  color: var(--body-color);
  text-wrap: pretty;
}

.article-content a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid var(--accent-soft);
  transition: border-color 0.15s ease;
}

.article-content a:hover {
  border-bottom-color: var(--accent);
  text-decoration: none;
}

.article-content ul,
.article-content ol {
  margin-bottom: 24px;
  padding-left: 26px;
  color: var(--body-color);
}

.article-content li {
  margin-bottom: 12px;
}

.article-content li::marker {
  color: var(--accent);
}

.article-content ol li::marker {
  color: var(--muted);
  font-weight: 600;
}

.article-content strong {
  color: var(--ink);
  font-weight: 650;
}

.article-content blockquote {
  margin: 32px 0;
  padding: 6px 0 6px 26px;
  border-left: 3px solid var(--accent);
  color: var(--ink);
  font-style: italic;
  font-size: 19px;
  line-height: 1.6;
}

.article-content blockquote cite {
  display: block;
  margin-top: 12px;
  font-style: normal;
  font-size: 15px;
  color: var(--muted);
}

.article-content code {
  background: var(--code-bg);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.9em;
  font-family: "SF Mono", "Fira Code", monospace;
}

.article-content pre {
  background: var(--code-bg);
  padding: 16px;
  border-radius: 8px;
  overflow-x: auto;
  margin-bottom: 24px;
}

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

.article-content hr {
  border: none;
  border-top: 1px solid var(--line);
  margin: 48px 0;
}

/* Reading progress bar */
.reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  z-index: 101;
  background: var(--progress-bg);
}

.reading-progress-fill {
  height: 100%;
  background: var(--accent);
  transform-origin: left;
}

@supports (animation-timeline: scroll()) {
  .reading-progress-fill {
    animation: progress-grow linear;
    animation-timeline: scroll();
  }

  @keyframes progress-grow {
    from { transform: scaleX(0); }
    to { transform: scaleX(1); }
  }
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--line);
}

.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 28px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

.footer-copy {
  font-size: 14px;
  color: var(--muted);
}

.footer-social {
  display: flex;
  gap: 18px;
}

.footer-social a {
  color: var(--muted);
  display: inline-flex;
  transition: color 0.15s ease;
}

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

.footer-social svg {
  width: 20px;
  height: 20px;
}

/* Tracking pixel */
.tracking-pixel {
  position: absolute;
  top: -9999px;
}

/* Responsive */
@media (max-width: 600px) {
  body {
    font-size: 17px;
  }

  .about-intro h1,
  .blog-header h1,
  .article-header h1 {
    font-size: 32px;
  }

  .article-content h2 {
    font-size: 22px;
  }

  main {
    padding: 44px 22px 64px;
  }

  .header-nav {
    gap: 16px;
  }

  .social-links {
    flex-direction: column;
  }

  .footer-inner {
    flex-direction: column;
    align-items: flex-start;
  }
}
