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

:root {
  --bg: #ffffff;
  --text: #0a0a0a;
  --text-muted: #666666;
  --border: #eaeaea;
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --surface: #f5f5f5;
  --radius: 8px;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --max-width: 680px;
  --header-height: 64px;
}

[data-theme="dark"] {
  --bg: #0a0a0a;
  --text: #ededed;
  --text-muted: #999999;
  --border: #333333;
  --accent: #60a5fa;
  --accent-hover: #93bbfd;
  --surface: #1a1a1a;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  color-scheme: light;
}

html[data-theme="dark"] {
  color-scheme: dark;
}

body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background 0.3s ease, color 0.3s ease;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.2s ease;
}

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

img {
  max-width: 100%;
  height: auto;
}

.skip-link {
  position: absolute;
  top: -48px;
  left: 16px;
  z-index: 200;
  padding: 8px 16px;
  background: var(--accent);
  color: #fff;
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: var(--radius);
  transition: top 0.2s ease;
}

.skip-link:focus {
  top: 16px;
  color: #fff;
}

.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  height: var(--header-height);
  transition: background 0.3s ease;
}

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

.header__logo {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
}

.header__logo:hover {
  color: var(--accent);
}

.header__nav {
  display: flex;
  align-items: center;
  gap: 24px;
}

.header__link {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-muted);
  transition: color 0.2s ease;
}

.header__link:hover {
  color: var(--text);
}

.theme-toggle {
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  padding: 6px 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 1rem;
  transition: color 0.2s ease, border-color 0.2s ease;
  line-height: 1;
}

.theme-toggle:hover {
  color: var(--text);
  border-color: var(--text-muted);
}

.theme-toggle__icon--light {
  display: inline;
}

.theme-toggle__icon--dark {
  display: none;
}

[data-theme="dark"] .theme-toggle__icon--light {
  display: none;
}

[data-theme="dark"] .theme-toggle__icon--dark {
  display: inline;
}

.main {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 48px 24px 96px;
  min-height: calc(100vh - var(--header-height) - 120px);
}

.hero {
  margin-bottom: 64px;
}

.hero__title {
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.03em;
  margin-bottom: 16px;
}

.hero__subtitle {
  font-size: 1.125rem;
  color: var(--text-muted);
  line-height: 1.6;
  max-width: 520px;
}

.section-title {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 24px;
  letter-spacing: -0.02em;
}

.page__title {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  margin-bottom: 32px;
}

.page__content h2 {
  font-size: 1.5rem;
  font-weight: 600;
  margin-top: 40px;
  margin-bottom: 16px;
  letter-spacing: -0.02em;
}

.page__content h3 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-top: 32px;
  margin-bottom: 12px;
}

.page__content p {
  margin-bottom: 16px;
  color: var(--text-muted);
}

.page__content ul,
.page__content ol {
  margin-bottom: 16px;
  padding-left: 24px;
  color: var(--text-muted);
}

.page__content li {
  margin-bottom: 8px;
}

.post-card {
  padding: 20px 0;
  border-bottom: 1px solid var(--border);
  transition: opacity 0.2s ease;
}

.post-card:first-of-type {
  padding-top: 0;
}

.post-card:hover {
  opacity: 0.8;
}

.post-card__link {
  display: block;
  color: inherit;
}

.post-card__title {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 6px;
  letter-spacing: -0.02em;
  color: var(--text);
}

.post-card__date {
  display: block;
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.post-card__excerpt {
  font-size: 0.9375rem;
  color: var(--text-muted);
  margin-top: 8px;
  line-height: 1.6;
}

.post-card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 4px;
}

.tag-pill {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 500;
  padding: 2px 10px;
  border-radius: 100px;
  background: var(--surface);
  color: var(--text-muted);
  transition: background 0.2s ease, color 0.2s ease;
}

a.tag-pill:hover {
  background: var(--accent);
  color: #fff;
}

.post__header {
  margin-bottom: 40px;
}

.post__title {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  margin-bottom: 12px;
  line-height: 1.2;
}

.post__date {
  display: block;
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.post__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.post__content {
  font-size: 1.0625rem;
  line-height: 1.8;
  color: var(--text-muted);
}

.post__content h2 {
  font-size: 1.5rem;
  font-weight: 600;
  margin-top: 48px;
  margin-bottom: 16px;
  color: var(--text);
  letter-spacing: -0.02em;
}

.post__content h3 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-top: 36px;
  margin-bottom: 12px;
  color: var(--text);
}

.post__content p {
  margin-bottom: 20px;
}

.post__content ul,
.post__content ol {
  margin-bottom: 20px;
  padding-left: 24px;
}

.post__content li {
  margin-bottom: 8px;
}

.post__content blockquote {
  border-left: 3px solid var(--accent);
  padding-left: 20px;
  margin: 24px 0;
  color: var(--text-muted);
  font-style: italic;
}

.post__content code {
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 0.875em;
  background: var(--surface);
  padding: 2px 6px;
  border-radius: 4px;
}

.post__back {
  display: inline-block;
  margin-top: 48px;
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--text-muted);
  transition: color 0.2s ease;
}

.post__back:hover {
  color: var(--accent);
}

.about__intro {
  font-size: 1.125rem;
  color: var(--text-muted);
  line-height: 1.7;
  margin-bottom: 40px;
}

.about__section {
  margin-bottom: 40px;
}

.about__section-title {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 16px;
  letter-spacing: -0.02em;
}

.skills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.skill-tag {
  font-size: 0.8125rem;
  font-weight: 500;
  padding: 4px 14px;
  border-radius: 100px;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
}

.project-card {
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
}

.project-card:last-of-type {
  border-bottom: none;
}

.project-card__title {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 4px;
}

.project-card__desc {
  font-size: 0.9375rem;
  color: var(--text-muted);
  line-height: 1.6;
}

.project-card__tech {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.project-card__links {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 8px;
  font-size: 0.875rem;
  font-weight: 500;
}

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

.social-link {
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--text-muted);
  transition: color 0.2s ease;
}

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

.footer {
  border-top: 1px solid var(--border);
  padding: 24px 0;
  transition: background 0.3s ease;
}

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

.footer__copy {
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.footer__social {
  display: flex;
  gap: 16px;
}

.footer__link {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-muted);
  transition: color 0.2s ease;
}

.footer__link:hover {
  color: var(--accent);
}

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

  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}

@media (max-width: 600px) {
  .header__inner {
    padding: 0 16px;
  }

  .header__nav {
    gap: 16px;
  }

  .main {
    padding: 32px 16px 64px;
  }

  .hero__title {
    font-size: 1.75rem;
  }

  .footer__inner {
    flex-direction: column;
    gap: 12px;
    text-align: center;
    padding: 0 16px;
  }
}
