/* ==========================================================================
   Surya.website Blog Design System
   Exact match to: blog/Learning_to_Draw_Again_With_AI.html
   Official Fonts: PP Editorial New + PP Neue Montreal + Fragment Mono + Caveat
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Official Embedded Fonts
   -------------------------------------------------------------------------- */
@font-face {
  font-family: 'PP Editorial New';
  src: url('./assets/fonts/PP_Editorial_New_Regular_400_normal.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'PP Editorial New';
  src: url('./assets/fonts/PP_Editorial_New_Ultralight_Italic_200_italic.woff2') format('woff2');
  font-weight: 200;
  font-style: italic;
  font-display: swap;
}

@font-face {
  font-family: 'PP Editorial New';
  src: url('./assets/fonts/PP_Editorial_New_Ultrabold_800_normal.woff2') format('woff2');
  font-weight: 800;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'PP Neue Montreal';
  src: url('./assets/fonts/PP_Neue_Montreal_Book_400_normal.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'PP Neue Montreal';
  src: url('./assets/fonts/PP_Neue_Montreal_Medium_500_normal.woff2') format('woff2');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'PP Neue Montreal';
  src: url('./assets/fonts/PP_Neue_Montreal_Bold_700_normal.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'PP Neue Montreal';
  src: url('./assets/fonts/PP_Neue_Montreal_SemiBold_italic_600_italic.woff2') format('woff2');
  font-weight: 600;
  font-style: italic;
  font-display: swap;
}

@font-face {
  font-family: 'PP Neue Montreal Mono';
  src: url('./assets/fonts/PP_Neue_Montreal_Mono_Book_normal_normal.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Fragment Mono';
  src: url('./assets/fonts/Fragment_Mono_400_normal.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Caveat';
  src: url('./assets/fonts/Caveat_400_normal.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

/* --------------------------------------------------------------------------
   2. Design Tokens
   -------------------------------------------------------------------------- */
:root {
  --surya-bg: #FFFFFF;
  --surya-bg-subtle: #F8F8F8;
  --surya-title: #434343;
  --surya-heading: #333333;
  --surya-body: #4F4F4D;
  --surya-muted: #999999;
  --surya-border: #E8E8E8;
  --surya-link: #434343;
  --surya-nav-link: #555555;
  --surya-nav-link-hover: #111111;
  --accent-pipe: #af67ff;

  --font-serif: 'PP Editorial New', Georgia, serif;
  --font-sans: 'PP Neue Montreal', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fragment Mono', monospace;
  --font-script: 'Caveat', cursive;

  --measure-width: 600px;
  --header-height: 4rem;
}

[data-theme="dark"] {
  --surya-bg: #111111;
  --surya-bg-subtle: #191919;
  --surya-title: #ECECEC;
  --surya-heading: #E0E0E0;
  --surya-body: #B5B5B3;
  --surya-muted: #777777;
  --surya-border: #262626;
  --surya-link: #ECECEC;
  --surya-nav-link: #AAAAAA;
  --surya-nav-link-hover: #FFFFFF;
  --accent-pipe: #c084fc;
}

/* --------------------------------------------------------------------------
   3. Page & Body Reset
   -------------------------------------------------------------------------- */
html, body.surya-body {
  overflow-x: clip;
  max-width: 100vw;
}

body.surya-body {
  background-color: var(--surya-bg) !important;
  color: var(--surya-body) !important;
  font-family: var(--font-sans);
  margin: 0;
  padding: 0 !important;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.6;
  transition: background-color 0.2s ease, color 0.2s ease;
}

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

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

/* --------------------------------------------------------------------------
   4. Top Sticky Header (Exact Match to index.html & media_1790962808380.png)
   -------------------------------------------------------------------------- */
#header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 4rem;
  background-color: var(--surya-bg);
  border-bottom: 1px solid var(--surya-border);
  z-index: 1000;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.header-container {
  max-width: 68rem;
  margin: 0 auto;
  padding: 0 1.5rem;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.header-brand-group {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* Isometric Voxel Logo Button */
.voxel-logo-btn {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  outline: none;
}

.voxel-logo-btn:hover {
  transform: scale(1.1) rotate(-3deg);
}

.voxel-logo-btn:active {
  transform: scale(0.95);
}

.party-bounce {
  animation: partyBounce 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes partyBounce {
  0% { transform: scale(1); }
  50% { transform: scale(1.3) rotate(-8deg); }
  100% { transform: scale(1); }
}

.party-particle {
  position: fixed;
  pointer-events: none;
  z-index: 99999;
  transform-origin: center center;
  animation: partyFly 1.2s cubic-bezier(0.12, 0.8, 0.32, 1) forwards;
}

.party-dot {
  border-radius: 50%;
}

@keyframes partyFly {
  0% {
    opacity: 1;
    transform: translate(0, 0) scale(0.4) rotate(0deg);
  }
  25% {
    opacity: 1;
    transform: translate(calc(var(--dx) * 0.4), calc(var(--dy) * 0.4)) scale(1.25) rotate(calc(var(--rot) * 0.4));
  }
  100% {
    opacity: 0;
    transform: translate(var(--dx), calc(var(--dy) + 40px)) scale(0.6) rotate(var(--rot));
  }
}

.voxel-logo-svg {
  width: 32px;
  height: 38px;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

.header-title {
  font-family: var(--font-mono);
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--surya-title);
  text-decoration: none;
}

/* Pipe-separated Nav (Matching index.html & media_1790962808380.png) */
.header-nav {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  font-weight: 500;
}

.header-nav a {
  color: var(--accent-pipe);
  text-decoration: none;
  transition: opacity 0.15s ease;
}

.header-nav a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
  opacity: 0.85;
}

.header-nav a.active {
  color: var(--surya-title);
  font-weight: 700;
}

.nav-pipe {
  color: var(--accent-pipe);
  opacity: 0.6;
  font-weight: 300;
  user-select: none;
}

.header-controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-minimal {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.35rem 0.6rem;
  border-radius: 4px;
  background-color: var(--surya-bg-subtle);
  border: 1px solid var(--surya-border);
  color: var(--surya-muted);
  cursor: pointer;
  text-decoration: none;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-minimal:hover {
  color: var(--surya-title);
  border-color: var(--surya-muted);
}

.theme-toggle-btn {
  padding: 0.35rem 0.5rem;
  min-width: 32px;
}

/* --------------------------------------------------------------------------
   5. Starting Hero Thing (Exact match to blog/Learning_to_Draw_Again_With_AI.html)
   -------------------------------------------------------------------------- */
.surya-container {
  max-width: var(--measure-width);
  margin: 0 auto;
  padding: calc(4rem + 32px) 1.25rem 6rem 1.25rem;
}

.hero-stuff {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-bottom: 28px;
}

.hero-title-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.hero-title {
  font-family: var(--font-serif);
  font-size: clamp(30px, 5.2vw, 36px);
  font-weight: 400;
  line-height: 1.12;
  letter-spacing: -0.01em;
  color: var(--surya-title);
  margin: 0;
  text-align: left;
}

.hero-date {
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 400;
  color: var(--surya-muted);
  margin: 0;
  text-align: left;
}

/* Hero Banner Image */
.hero-banner {
  width: 100%;
  border-radius: 0;
  overflow: visible;
  background-color: transparent;
  margin: 4px 0 8px 0;
}

.hero-banner img {
  width: 100%;
  height: auto;
  display: block;
}

/* Hero Subtext & Author Block */
.hero-subtext-group {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.hero-subtext {
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.55;
  color: var(--surya-body);
  margin: 0;
}

.hero-subtext .byline a {
  color: var(--surya-title);
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: opacity 0.15s ease;
}

.hero-subtext .byline a:hover {
  opacity: 0.7;
}

.hero-action-links {
  font-family: var(--font-sans);
  font-size: 15px;
  color: var(--surya-body);
  margin: 0;
}

.hero-action-links a {
  color: var(--surya-title);
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: opacity 0.15s ease;
}

.hero-action-links a:hover {
  opacity: 0.7;
}

.hero-action-links .sep {
  color: var(--surya-muted);
  margin: 0 8px;
}

/* --------------------------------------------------------------------------
   5b. Blog Menu Directory (Matching blog/blog menu.html)
   -------------------------------------------------------------------------- */
.blog-menu-container {
  max-width: var(--measure-width);
  margin: 0 auto;
  padding: calc(4rem + 32px) 24px 80px 24px;
}

/* Featured Big Post */
.blog-featured {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
  margin-bottom: 48px;
}

.blog-featured-banner {
  width: 100%;
  max-width: 100%;
  display: block;
  background: transparent;
  margin: 0 0 12px 0;
}

.blog-featured-banner a {
  display: block;
  width: 100%;
  max-width: 100%;
}

.blog-featured-banner img {
  width: 100%;
  max-width: 100%;
  height: auto;
  aspect-ratio: 2400 / 960;
  object-fit: contain;
  display: block;
}

.blog-featured-header {
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 100%;
}

.blog-featured-title {
  font-family: var(--font-serif);
  font-size: 32px;
  line-height: 1.15;
  font-weight: 400;
  color: var(--surya-title);
  margin: 0;
}

.blog-featured-title a {
  color: inherit;
  text-decoration: none;
  transition: color 0.15s ease;
}

.blog-featured-title a:hover {
  text-decoration: underline;
  text-underline-offset: 4px;
}

.blog-featured-date {
  font-family: var(--font-sans);
  font-size: 15px;
  color: var(--surya-muted);
  margin: 0;
}

.blog-featured-excerpt {
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.5;
  color: var(--surya-body);
  margin: 0;
}

.blog-continue-container {
  display: flex;
  align-items: center;
  margin-top: 4px;
}

.blog-continue-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid #ED682B;
  background-color: transparent;
  color: #ED682B;
  border-radius: 100px;
  padding: 6px 14px;
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.2s ease;
}

[data-theme="dark"] .blog-continue-btn {
  border-color: #f2824e;
  color: #f2824e;
}

.blog-continue-btn:hover {
  background-color: rgba(237, 104, 43, 0.08);
  transform: translateX(2px);
}

.blog-continue-btn svg {
  width: 14px;
  height: 14px;
  fill: currentColor;
  transition: transform 0.2s ease;
}

.blog-continue-btn:hover svg {
  transform: translateX(3px);
}

/* All Blogs Section */
.blog-all-section {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
}

.blog-all-heading {
  font-family: var(--font-serif);
  font-size: 26px;
  font-weight: 400;
  color: var(--surya-title);
  margin: 0;
}

.blog-menu-list {
  display: flex;
  flex-direction: column;
  width: 100%;
}

.blog-menu-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  width: 100%;
  padding: 10px 0;
  border-bottom: 1px dashed var(--surya-border);
  text-decoration: none;
  color: inherit;
  transition: opacity 0.15s ease;
}

.blog-menu-item:hover {
  opacity: 0.7;
}

.blog-menu-item-title {
  font-family: var(--font-sans);
  font-size: 16px;
  font-weight: 400;
  color: var(--surya-title);
  margin: 0;
  flex: 1 1 auto;
}

.blog-menu-item-date {
  font-family: var(--font-sans);
  font-size: 14px;
  color: var(--surya-muted);
  white-space: nowrap;
  margin: 0;
  flex: 0 0 auto;
}

/* Breadcrumb for Single Post Pages */
.blog-breadcrumb {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-sans);
  font-size: 14px;
  color: var(--surya-muted);
  text-decoration: none;
  margin-bottom: 24px;
  transition: color 0.15s ease;
}

.blog-breadcrumb:hover {
  color: var(--surya-title);
}

.blog-breadcrumb svg {
  width: 14px;
  height: 14px;
  fill: currentColor;
}

/* --------------------------------------------------------------------------
   6. Article Prose Styling
   -------------------------------------------------------------------------- */
.article-prose {
  margin-top: 2rem;
}

.article-prose h2 {
  font-family: var(--font-serif);
  font-size: 26px;
  font-weight: 400;
  line-height: 1.2;
  color: var(--surya-heading);
  margin: 48px 0 16px 0;
}

.article-prose p {
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.65;
  color: var(--surya-body);
  margin: 0 0 20px 0;
}

.article-prose a {
  color: var(--surya-title);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.article-prose a:hover {
  opacity: 0.75;
}

.article-figure {
  width: 100%;
  margin: 36px 0;
  border-radius: 8px;
  overflow: hidden;
  background-color: var(--surya-bg-subtle);
}

.article-figure img {
  width: 100%;
  height: auto;
  display: block;
}

.article-caption {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--surya-muted);
  padding: 10px 4px 0 4px;
  text-align: center;
  letter-spacing: -0.01em;
}

/* Callout quote */
.article-quote {
  font-family: var(--font-serif);
  font-size: 22px;
  font-style: italic;
  line-height: 1.45;
  color: var(--surya-title);
  margin: 36px 0;
  padding-left: 20px;
  border-left: 2px solid var(--surya-title);
}

/* Hand-written script annotation */
.hand-annotation {
  font-family: var(--font-script);
  font-size: 24px;
  color: var(--surya-title);
  margin: 20px 0;
  display: block;
}

/* Code block */
.article-code {
  background-color: var(--surya-bg-subtle);
  border: 1px solid var(--surya-border);
  border-radius: 6px;
  padding: 16px;
  margin: 24px 0;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--surya-title);
}

/* --------------------------------------------------------------------------
   7. Other Essays Directory / Footer
   -------------------------------------------------------------------------- */
.essays-directory {
  border-top: 1px solid var(--surya-border);
  margin-top: 60px;
  padding-top: 40px;
}

.essays-directory-heading {
  font-family: var(--font-serif);
  font-size: 24px;
  font-weight: 400;
  color: var(--surya-title);
  margin: 0 0 24px 0;
}

.essay-item {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 12px 0;
  border-bottom: 1px solid var(--surya-border);
  text-decoration: none;
  color: inherit;
  transition: opacity 0.15s ease;
}

.essay-item:hover {
  opacity: 0.7;
}

.essay-item-title {
  font-family: var(--font-sans);
  font-size: 15.5px;
  font-weight: 500;
  color: var(--surya-title);
}

.essay-item-date {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--surya-muted);
}

/* Footer */
.surya-footer {
  border-top: 1px solid var(--surya-border);
  padding: 3rem 1.5rem;
  text-align: center;
  font-family: var(--font-sans);
  font-size: 14px;
  color: var(--surya-muted);
}

.surya-footer a {
  color: var(--surya-title);
  text-decoration: none;
  margin: 0 6px;
}

.surya-footer a:hover {
  text-decoration: underline;
}

/* Responsive */
@media (max-width: 640px) {
  .surya-body {
    padding-top: 5.6rem;
  }

  .blog-menu-container,
  .surya-container {
    padding: calc(5.6rem + 1.25rem) 1rem 4rem 1rem;
  }

  #header {
    height: auto;
    min-height: 3.4rem;
    padding: 0.35rem 0;
  }

  .header-container {
    padding: 0 0.75rem;
    flex-wrap: wrap;
    gap: 0.35rem;
  }

  .header-brand-group {
    gap: 0.5rem;
  }

  .voxel-logo-svg {
    width: 26px;
    height: 32px;
  }

  .header-title {
    font-size: 1.05rem;
  }

  .header-nav {
    display: flex;
    order: 3;
    width: 100%;
    justify-content: space-between;
    padding-top: 0.35rem;
    border-top: 1px solid var(--surya-border);
    font-size: 0.75rem;
    gap: 0.15rem;
  }

  .nav-pipe {
    opacity: 0.4;
  }

  .hero-title {
    font-size: 28px;
  }
}

@media (max-width: 480px) {
  .header-container {
    padding: 0 0.5rem;
  }

  .header-title {
    font-size: 0.95rem;
  }

  .header-nav {
    font-size: 0.72rem;
    gap: 0.1rem;
  }
}

/* ==========================================================================
   8. Deep RL Post & Reader System Styles
   Single column 680px layout, sticky TOC, reading progress, key terms box
   ========================================================================== */

/* Reading Progress Bar Fixed at Viewport Top */
#reading-progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0%;
  background-color: #4F46E5;
  z-index: 99999;
  transition: width 0.1s linear;
}

[data-theme="dark"] #reading-progress-bar {
  background-color: #818cf8;
}

/* Layout container */
.rl-layout-container {
  width: 100%;
  padding-top: calc(4rem + 24px);
  padding-bottom: 5rem;
}

.rl-article-wrapper {
  max-width: 980px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  gap: 48px;
  position: relative;
}

/* Main column: single centered column, max-width 680px */
.rl-main-content {
  width: 100%;
  max-width: 680px;
  flex: 1 1 680px;
}

/* Post Header Block */
.rl-post-header {
  margin-bottom: 2rem;
}

.rl-title {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 40px;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: #111111;
  margin: 0 0 12px 0;
}

[data-theme="dark"] .rl-title {
  color: #F3F4F6;
}

.rl-meta {
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 500;
  color: #6B7280;
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 16px 0;
}

[data-theme="dark"] .rl-meta {
  color: #9CA3AF;
}

.rl-meta-sep {
  opacity: 0.7;
}

.rl-subtitle {
  font-family: 'Source Serif 4', Georgia, serif;
  font-size: 19px;
  line-height: 1.5;
  color: #4B5563;
  margin: 0;
  padding-bottom: 24px;
  border-bottom: 1px solid #E5E7EB;
}

[data-theme="dark"] .rl-subtitle {
  color: #D1D5DB;
  border-bottom-color: #2D3748;
}

/* Headings */
.rl-heading {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 28px;
  font-weight: 700;
  line-height: 1.25;
  color: #111111;
  margin-top: 2.5em;
  margin-bottom: 0.75em;
  text-align: left;
  scroll-margin-top: 5rem;
}

[data-theme="dark"] .rl-heading {
  color: #F3F4F6;
}

/* Body Text & Prose */
.rl-prose {
  font-family: 'Source Serif 4', Georgia, serif;
  font-size: 18px;
  line-height: 1.75;
  color: #222222;
}

[data-theme="dark"] .rl-prose {
  color: #E5E7EB;
}

.rl-prose p {
  margin: 0 0 1.25em 0;
}

.rl-prose strong {
  font-weight: 600;
  color: #111111;
}

[data-theme="dark"] .rl-prose strong {
  color: #FFFFFF;
}

.rl-prose a {
  color: #4F46E5;
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: opacity 0.15s ease;
}

.rl-prose a:hover {
  opacity: 0.8;
}

.rl-prose a:focus-visible,
.rl-toc-link:focus-visible,
.btn-minimal:focus-visible {
  outline: 2px solid #4F46E5;
  outline-offset: 2px;
}

/* Analogies and Personal Reflections */
.rl-analogy {
  border-left: 3px solid #4F46E5;
  background-color: #F5F5FF;
  padding: 16px 20px;
  margin: 1.5em 0;
  font-style: italic;
  font-weight: 400;
  border-radius: 0 6px 6px 0;
  color: #222222;
}

[data-theme="dark"] .rl-analogy {
  border-left-color: #818cf8;
  background-color: rgba(79, 70, 229, 0.12);
  color: #E0E7FF;
}

.rl-analogy p {
  margin: 0 0 0.75em 0;
}

.rl-analogy p:last-child {
  margin-bottom: 0;
}

/* Key Terms Summary Box */
.rl-keyterms-box {
  background-color: #F8FAFC;
  border: 1px solid #E2E8F0;
  border-radius: 8px;
  padding: 22px 24px;
  margin: 2.25em 0;
}

[data-theme="dark"] .rl-keyterms-box {
  background-color: #1A202C;
  border-color: #2D3748;
}

.rl-keyterms-title {
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #4F46E5;
  margin-bottom: 16px;
}

[data-theme="dark"] .rl-keyterms-title {
  color: #A5B4FC;
}

.rl-keyterms-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px 24px;
  margin: 0;
}

.rl-keyterm-item dt {
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  font-size: 15px;
  color: #111111;
  margin-bottom: 2px;
}

[data-theme="dark"] .rl-keyterm-item dt {
  color: #F3F4F6;
}

.rl-keyterm-item dd {
  font-family: 'Source Serif 4', Georgia, serif;
  font-size: 14.5px;
  line-height: 1.5;
  color: #4B5563;
  margin: 0;
}

[data-theme="dark"] .rl-keyterm-item dd {
  color: #9CA3AF;
}

/* Desktop Sticky Table of Contents */
.rl-desktop-toc {
  width: 200px;
  flex: 0 0 200px;
  position: sticky;
  top: 5.5rem;
  align-self: flex-start;
  max-height: calc(100vh - 7rem);
  overflow-y: auto;
}

.rl-toc-title {
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #6B7280;
  margin-bottom: 12px;
}

[data-theme="dark"] .rl-toc-title {
  color: #9CA3AF;
}

.rl-toc-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  border-left: 2px solid #E5E7EB;
}

[data-theme="dark"] .rl-toc-list {
  border-left-color: #2D3748;
}

.rl-toc-link {
  display: block;
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  line-height: 1.4;
  color: #6B7280;
  text-decoration: none;
  padding: 4px 0 4px 14px;
  margin-left: -2px;
  border-left: 2px solid transparent;
  transition: all 0.15s ease;
}

[data-theme="dark"] .rl-toc-link {
  color: #9CA3AF;
}

.rl-toc-link:hover {
  color: #4F46E5;
}

[data-theme="dark"] .rl-toc-link:hover {
  color: #A5B4FC;
}

.rl-toc-link.active {
  color: #4F46E5;
  font-weight: 600;
  border-left-color: #4F46E5;
}

[data-theme="dark"] .rl-toc-link.active {
  color: #818cf8;
  border-left-color: #818cf8;
}

/* Mobile Collapsed TOC Dropdown */
.rl-mobile-toc {
  display: none;
  background-color: #F8FAFC;
  border: 1px solid #E2E8F0;
  border-radius: 8px;
  padding: 12px 16px;
  margin-bottom: 2rem;
}

[data-theme="dark"] .rl-mobile-toc {
  background-color: #1A202C;
  border-color: #2D3748;
}

.rl-mobile-toc summary {
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 600;
  color: #111111;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  user-select: none;
}

[data-theme="dark"] .rl-mobile-toc summary {
  color: #F3F4F6;
}

.rl-mobile-toc summary::-webkit-details-marker {
  display: none;
}

.rl-mobile-toc[open] .rl-chevron {
  transform: rotate(180deg);
}

.rl-chevron {
  transition: transform 0.2s ease;
}

.rl-mobile-toc-list {
  list-style: none;
  padding: 12px 0 4px 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.rl-mobile-toc-list a {
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  color: #4F46E5;
  text-decoration: none;
}

[data-theme="dark"] .rl-mobile-toc-list a {
  color: #A5B4FC;
}

/* Sign-off section */
.rl-signoff-divider {
  width: 100%;
  height: 1px;
  background-color: #E5E7EB;
  margin-top: 3em;
  margin-bottom: 1.5em;
}

[data-theme="dark"] .rl-signoff-divider {
  background-color: #2D3748;
}

.rl-signoff {
  font-family: 'Source Serif 4', Georgia, serif;
  font-size: 18px;
  text-align: center;
  color: #111111;
  font-weight: 500;
  margin: 0 0 2em 0;
}

[data-theme="dark"] .rl-signoff {
  color: #F3F4F6;
}

/* Smooth Scrolling Respecting User Preference */
@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

/* Responsive Media Queries */
@media (max-width: 1023px) {
  .rl-desktop-toc {
    display: none;
  }

  .rl-mobile-toc {
    display: block;
  }

  .rl-article-wrapper {
    max-width: 680px;
    padding: 0 20px;
    gap: 0;
  }
}

@media (max-width: 640px) {
  .rl-title {
    font-size: 30px;
  }

  .rl-keyterms-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .rl-article-wrapper {
    padding: 0 20px;
  }
}

/* --------------------------------------------------------------------------
   Deep RL Unit 1 Post Typography & Layout (Mockup Specification)
   -------------------------------------------------------------------------- */
.rl-article p {
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.72;
  color: var(--surya-body);
  margin: 0 0 20px 0;
}

.rl-article h2 {
  font-family: var(--font-serif);
  font-size: 34px;
  font-weight: 400;
  line-height: 1.25;
  color: var(--surya-heading);
  margin-top: 64px;
  margin-bottom: 20px;
}

.rl-article .pull-quote {
  border-left: 2px solid var(--surya-primary, #6366f1);
  padding-left: 24px;
  margin: 36px 0;
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 26px;
  line-height: 1.4;
  color: var(--surya-heading);
}

.rl-article .figure-caption {
  font-family: var(--font-sans);
  font-size: 14px;
  font-style: italic;
  color: #767676;
  text-align: center;
  margin-top: 14px;
}

[data-theme="dark"] .rl-article .figure-caption {
  color: var(--surya-muted);
}

.rl-diagram-figure {
  margin: 44px auto;
  max-width: 580px;
  text-align: center;
}

.rl-diagram-figure svg {
  display: block;
  margin: 0 auto;
  color: var(--surya-heading);
}

@media (max-width: 640px) {
  .rl-article .pull-quote {
    font-size: 20px;
    padding-left: 16px;
    margin: 28px 0;
  }
  .rl-article h2 {
    font-size: 28px;
    margin-top: 48px;
  }
}

/* --------------------------------------------------------------------------
   RL Post Series: Lunar Lander & Leaderboard Components
   -------------------------------------------------------------------------- */
.rl-article a {
  color: var(--surya-heading);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.rl-article a:hover {
  opacity: 0.75;
}

.rl-article .q {
  margin: 36px 0;
  padding-left: 20px;
  border-left: 2px solid var(--surya-heading);
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 26px;
  line-height: 1.3;
  color: var(--surya-heading);
}

.rl-article code {
  font-family: var(--font-mono);
  font-size: 0.84em;
  background: #F3F3F1;
  border-radius: 4px;
  padding: 1px 6px;
  color: var(--surya-heading);
}

[data-theme="dark"] .rl-article code {
  background: #242424;
  color: #ECECEC;
}

.rl-article pre {
  margin: 26px 0;
  padding: 16px 18px;
  background: #F7F7F5;
  border: 1px solid var(--surya-border);
  border-radius: 6px;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 13.5px;
  line-height: 1.62;
  color: #33332f;
  max-width: 100%;
}

[data-theme="dark"] .rl-article pre {
  background: #181818;
  border-color: #2b2b2b;
  color: #d8d8d6;
}

.rl-article pre code {
  background: none !important;
  padding: 0 !important;
  font-size: inherit;
  color: inherit;
  border-radius: 0;
}

.rl-article .gloss {
  margin: 28px 0;
  border-top: 1px solid var(--surya-border);
}

.rl-article .gloss div {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 18px;
  padding: 12px 0;
  border-bottom: 1px solid var(--surya-border);
  align-items: baseline;
}

.rl-article .gloss dt {
  font-family: var(--font-mono);
  font-size: 13.5px;
  color: var(--surya-heading);
}

.rl-article .gloss dd {
  margin: 0;
  font-size: 16px;
  line-height: 1.55;
  color: var(--surya-body);
}

.rl-article .gloss.wide div {
  grid-template-columns: 200px 1fr;
}

.rl-article .result {
  margin: 34px 0;
  padding: 22px 0;
  border-top: 1px solid var(--surya-border);
  border-bottom: 1px solid var(--surya-border);
  text-align: center;
}

.rl-article .result b {
  display: block;
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: 56px;
  line-height: 1.05;
  color: var(--surya-heading);
}

.rl-article .result span {
  font-size: 15px;
  color: var(--surya-muted);
}

.rl-article .end {
  margin-top: 72px;
  padding-top: 26px;
  border-top: 1px solid var(--surya-border);
}

.rl-article .sign {
  font-style: italic;
  color: var(--surya-muted);
  margin: 0;
}

@media (max-width: 560px) {
  .rl-article h2 {
    font-size: 30px;
  }
  .rl-article .q {
    font-size: 22px;
    padding-left: 14px;
  }
  .rl-article .gloss div,
  .rl-article .gloss.wide div {
    grid-template-columns: 1fr;
    gap: 4px;
  }
  .rl-article .result b {
    font-size: 44px;
  }
}

