:root {
  color-scheme: light;
  --bg: #f6f7fb;
  --bg-accent: #ffffff;
  --text: #1d1f2f;
  --text-muted: #5d6070;
  --primary: #3a5dff;
  --primary-dark: #2b48c6;
  --border: rgba(29, 31, 47, 0.08);
  --shadow: 0 20px 45px rgba(20, 24, 56, 0.08);
  --radius: 18px;
  --max-width: 1080px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--text);
  background-color: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

a:hover,
a:focus {
  text-decoration: underline;
}

img {
  max-width: 100%;
  display: block;
}

.container {
  width: min(100% - 3rem, var(--max-width));
  margin: 0 auto;
}

.site-header {
  position: sticky;
  top: 0;
  backdrop-filter: blur(14px);
  background: rgba(246, 247, 251, 0.85);
  border-bottom: 1px solid var(--border);
  z-index: 10;
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.2rem 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.brand__avatar-frame {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  padding: 3px;
  background: linear-gradient(135deg, rgba(58, 93, 255, 0.5), rgba(122, 140, 255, 0.15));
  box-shadow: 0 12px 30px rgba(20, 24, 56, 0.18);
  overflow: hidden;
}

.brand__avatar {
  width: 100%;
  height: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  object-fit: cover;
  object-position: 50% 5%;
  border: 2px solid rgba(255, 255, 255, 0.85);
}

.brand__name {
  font-weight: 600;
  font-size: 1.05rem;
}

.brand__tagline {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.site-nav {
  display: flex;
  gap: 1.5rem;
  font-size: 0.95rem;
  font-weight: 500;
}

.site-nav__link {
  position: relative;
}

.site-nav__link::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -0.35rem;
  width: 100%;
  height: 2px;
  background: var(--primary);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.2s ease;
}

.site-nav__link:focus::after,
.site-nav__link:hover::after {
  transform: scaleX(1);
}

.hero {
  padding: 6rem 0 5rem;
  position: relative;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 20% 20%, rgba(122, 140, 255, 0.16), transparent 55%),
    radial-gradient(circle at 80% 0%, rgba(58, 93, 255, 0.25), transparent 60%);
  z-index: -1;
}

.hero__content {
  max-width: 620px;
}

.hero__eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--primary);
}

.hero__title {
  margin: 0.9rem 0 1.2rem;
  font-size: clamp(2.5rem, 5vw, 3.4rem);
  font-family: 'Playfair Display', serif;
  font-weight: 600;
  line-height: 1.1;
}

.hero__subtitle {
  font-size: 1.1rem;
  color: var(--text-muted);
  margin-bottom: 2.2rem;
}

.hero__cta {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  background: var(--primary);
  color: #fff;
  padding: 0.85rem 1.6rem;
  border-radius: 999px;
  font-weight: 600;
  box-shadow: 0 18px 30px rgba(58, 93, 255, 0.25);
  transition: background 0.2s ease, transform 0.2s ease;
}

.hero__cta:hover,
.hero__cta:focus {
  background: var(--primary-dark);
  transform: translateY(-2px);
}

.section-heading {
  text-align: center;
  margin-bottom: 3rem;
}

.section-heading__eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--primary);
}

.section-heading__title {
  font-size: clamp(2rem, 4vw, 2.6rem);
  margin-bottom: 0.7rem;
}

.section-heading__subtitle {
  color: var(--text-muted);
  margin: 0 auto;
  max-width: 520px;
}

.posts {
  padding: 5rem 0;
}

.posts__grid {
  display: grid;
  gap: 2rem;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.post-card {
  background: var(--bg-accent);
  border-radius: var(--radius);
  padding: 2rem;
  border: 1px solid rgba(255, 255, 255, 0.6);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.post-card:hover,
.post-card:focus-within {
  transform: translateY(-6px);
  box-shadow: 0 30px 55px rgba(20, 24, 56, 0.12);
}

.post-card__meta {
  display: flex;
  gap: 1rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 500;
}

.post-card__title {
  margin: 0;
  font-size: 1.6rem;
  line-height: 1.3;
}

.post-card__excerpt {
  margin: 0;
  color: var(--text-muted);
}

.post-card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.post-card__tag {
  background: rgba(58, 93, 255, 0.08);
  color: var(--primary);
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 500;
}

.post-card__link {
  align-self: flex-start;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--primary);
}

.about {
  padding: 5rem 0 6rem;
}

.about__content {
  display: grid;
  gap: 2.5rem;
  grid-template-columns: minmax(0, 1fr) minmax(0, 320px);
}

.about__panel {
  background: var(--bg-accent);
  padding: 2rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid rgba(255, 255, 255, 0.6);
}

.about__cta {
  display: inline-block;
  margin-top: 1rem;
  font-weight: 600;
  color: var(--primary);
}

.site-footer {
  border-top: 1px solid var(--border);
  padding: 2.5rem 0 2rem;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.site-footer .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

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

.post-page main.post {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(0, 1.2fr);
  gap: 3rem;
  width: min(100% - 3rem, var(--max-width));
  margin: 5rem auto;
  align-items: start;
}

.post__container {
  background: var(--bg-accent);
  padding: 3rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid rgba(255, 255, 255, 0.6);
}

.post__meta {
  margin-bottom: 2rem;
}

.post__date {
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--primary);
  font-weight: 600;
}

.post__title {
  margin: 0.6rem 0 0.3rem;
  font-size: clamp(2.1rem, 4vw, 2.8rem);
  font-family: 'Playfair Display', serif;
  line-height: 1.15;
}

.post__reading {
  font-size: 0.95rem;
  color: var(--text-muted);
}

.post__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
}

.post__tag {
  background: rgba(58, 93, 255, 0.08);
  color: var(--primary);
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 500;
}

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

.post__content > *:first-child {
  margin-top: 0;
}

.post__content > *:last-child {
  margin-bottom: 0;
}

.post__content h1,
.post__content h2,
.post__content h3,
.post__content h4 {
  font-family: 'Playfair Display', serif;
  font-weight: 700;
  line-height: 1.2;
  margin-top: 3rem;
  margin-bottom: 1.2rem;
}

.post__content h1 {
  font-size: clamp(2rem, 4vw, 2.6rem);
}

.post__content h2 {
  font-size: clamp(1.6rem, 3vw, 2rem);
}

.post__content h3 {
  font-size: clamp(1.3rem, 2.2vw, 1.6rem);
}

.post__content h4 {
  font-size: 1.2rem;
}

.post__content p {
  margin: 0 0 1.6rem;
}

.post__content .repo-card {
  display: flex;
  align-items: center;
  gap: 1.4rem;
  margin: 2.5rem 0;
  padding: 1.4rem 1.6rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-accent);
  box-shadow: 0 18px 40px rgba(20, 24, 56, 0.08);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  color: inherit;
}

.post__content .repo-card:hover,
.post__content .repo-card:focus {
  transform: translateY(-3px);
  box-shadow: 0 24px 50px rgba(20, 24, 56, 0.12);
  border-color: rgba(58, 93, 255, 0.35);
}

.post__content .repo-card:focus-visible {
  outline: 3px solid rgba(58, 93, 255, 0.5);
  outline-offset: 4px;
}

.post__content .repo-card__icon {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(58, 93, 255, 0.16), rgba(122, 140, 255, 0.06));
  color: var(--primary);
}

.post__content .repo-card__icon svg {
  width: 28px;
  height: 28px;
  fill: currentColor;
}

.post__content .repo-card__body {
  flex: 1;
  display: grid;
  gap: 0.35rem;
}

.post__content .repo-card__eyebrow {
  font-size: 0.75rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--primary);
}

.post__content .repo-card__title {
  font-size: 1.05rem;
  font-weight: 600;
}

.post__content .repo-card__description {
  margin: 0;
  color: var(--text-muted);
}

.post__content .repo-card__arrow {
  font-size: 1.4rem;
}

.post__content strong {
  font-weight: 600;
}

.post__content em {
  font-style: italic;
}

.post__content a {
  position: relative;
  color: var(--primary);
  font-weight: 600;
  text-decoration: none;
  border-radius: 0.25em;
  transition: color 0.2s ease, box-shadow 0.2s ease;
  box-shadow: inset 0 -0.25em rgba(58, 93, 255, 0.18);
}

.post__content a:hover,
.post__content a:focus {
  color: var(--primary-dark);
  box-shadow: inset 0 -0.9em rgba(58, 93, 255, 0.28);
}

.post__content a:focus-visible {
  outline: 2px solid rgba(43, 72, 198, 0.5);
  outline-offset: 3px;
}

.post__content ul,
.post__content ol {
  margin: 0 0 1.8rem;
  padding-left: 1.6rem;
}

.post__content ul {
  list-style: disc;
}

.post__content ol {
  list-style: decimal;
}

.post__content li + li {
  margin-top: 0.4rem;
}

.post__content blockquote {
  margin: 0 0 2rem;
  padding: 1.6rem 2rem;
  background: rgba(58, 93, 255, 0.08);
  border-left: 4px solid var(--primary);
  border-radius: calc(var(--radius) / 2);
  color: var(--text);
  font-style: italic;
}

.post__content code {
  font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
  font-size: 0.95rem;
  background: rgba(29, 31, 47, 0.08);
  padding: 0.2em 0.4em;
  border-radius: 6px;
}

.post__content pre {
  margin: 0 0 2.2rem;
  padding: 1.6rem;
  background: #0f172a;
  color: #f8fafc;
  border-radius: var(--radius);
  overflow-x: auto;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}

.post__content pre code {
  background: transparent;
  padding: 0;
  color: inherit;
  font-size: 0.95rem;
}

.post__content hr {
  border: none;
  border-top: 1px solid rgba(29, 31, 47, 0.12);
  margin: 3rem 0;
}

.post__content img,
.post__content figure {
  margin: 2.5rem 0;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.post__content figure figcaption {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-top: 0.6rem;
  text-align: center;
}

.post__content table {
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 2.2rem;
  font-size: 0.98rem;
}

.post__content th,
.post__content td {
  border: 1px solid rgba(29, 31, 47, 0.15);
  padding: 0.75rem 1rem;
  text-align: left;
}

.post__content thead th {
  background: rgba(58, 93, 255, 0.08);
}

.post__content tbody tr:nth-child(even) {
  background: rgba(29, 31, 47, 0.03);
}

.post__content mark {
  background: #fde68a;
  padding: 0.1em 0.25em;
  border-radius: 4px;
}

.post__content kbd {
  font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
  font-size: 0.85rem;
  background: rgba(29, 31, 47, 0.1);
  border-radius: 6px;
  padding: 0.2em 0.5em;
  box-shadow: inset 0 -1px 0 rgba(29, 31, 47, 0.2);
}

.post__aside {
  position: sticky;
  top: 110px;
}

.post__card {
  background: var(--bg-accent);
  padding: 2.5rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid rgba(255, 255, 255, 0.6);
}

.post__cta {
  display: inline-block;
  margin-top: 1.2rem;
  font-weight: 600;
  color: var(--primary);
}

@media (max-width: 960px) {
  .site-header .container {
    flex-direction: column;
    gap: 1rem;
    align-items: flex-start;
  }

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

  .post-page main.post {
    grid-template-columns: 1fr;
  }

  .post__aside {
    position: static;
  }
}

@media (max-width: 640px) {
  body {
    font-size: 0.98rem;
  }

  .container {
    width: min(100% - 2rem, var(--max-width));
  }

  .site-header .container {
    padding: 1rem 0;
  }

  .hero {
    padding: 4rem 0 3.5rem;
  }

  .posts {
    padding: 3.5rem 0;
  }

  .post-card {
    padding: 1.6rem;
  }

  .post__container {
    padding: 2.2rem;
  }

  .post__card {
    padding: 2rem;
  }
}
