/* Folio Theme Stylesheet - Enhanced with Fluid Animations */
:root {
  /* Typography */
  --font-heading: 'Playfair Display', Georgia, serif;
  --font-body: 'Lora', Georgia, serif;
  --font-mono: 'SF Mono', Monaco, 'Courier New', monospace;
  
  /* Color Palette */
  --color-bg: #fdfbf7;           /* Warm cream */
  --color-text: #2c2825;         /* Warm dark brown */
  --color-text-muted: #6b6560;   /* Warm gray */
  --color-accent: #8b4513;       /* Saddle brown */
  --color-border: #e8e4df;       /* Warm light gray */
  --color-code-bg: #f5f2ed;      /* Slightly darker cream */
  --color-selection: #d4c4a8;    /* Muted gold */
  
  /* Reading Settings */
  --reading-font-size: 1.125rem;
  --reading-line-height: 1.7;
  --reading-letter-spacing: 0em;
  --reading-word-spacing: 0em;
  --reading-text-color: #2c2825;
  --reading-bg-color: #fdfbf7;
  --reading-font-family: 'Lora', serif;
  --reading-content-width: 680px;
  --reading-para-spacing: 1.5rem;

  /* Animation Easings */
  --ease-out-quad: cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --ease-out-back: cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* Base Styles */
* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  font-family: var(--font-body);
  font-size: var(--reading-font-size);
  line-height: var(--reading-line-height);
  letter-spacing: var(--reading-letter-spacing);
  word-spacing: var(--reading-word-spacing);
  color: var(--reading-text-color);
  background-color: var(--reading-bg-color);
  background-image: 
    radial-gradient(circle at 15% 50%, rgba(212, 196, 168, 0.03) 0%, transparent 50%),
    radial-gradient(circle at 85% 30%, rgba(139, 69, 19, 0.02) 0%, transparent 50%);
  background-attachment: fixed;
  transition: background-color 0.4s ease, color 0.4s ease;
}

::selection {
  background-color: var(--color-selection);
  color: var(--color-text);
}

.container {
  max-width: 900px; /* Increased from 680px for better balance */
  margin: 0 auto;
  padding: 0 1.5rem;
}

.site-header .container,
.site-footer .container {
  max-width: 1200px;
}


.container.single {
  max-width: 100%;
  padding: 0; /* Reset padding for single posts as main-wrapper handles it */
}

.container.single > .main-wrapper {
  max-width: 1400px;
  margin-left: auto;
  margin-right: auto;
}

/* Typography with Fluid Animations */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 600;
  line-height: 1.3;
  margin: 2rem 0 1rem;
  position: relative;
}

h1 {
  font-size: 2.5rem;
  font-weight: 700;
}

h2 {
  font-size: 1.75rem;
}

h3 {
  font-size: 1.25rem;
}

small {
  font-size: 0.875rem;
  line-height: 1.5;
}

/* Header with Sticky Scroll Animation */
.site-header {
  border-bottom: 1px solid var(--color-border);
  position: sticky;
  top: 0;
  background-color: var(--color-bg);
  z-index: 100;
  backdrop-filter: blur(10px);
}

.site-header.scrolled {
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.08);
}

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

.site-title {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 700;
  text-decoration: none;
  color: var(--color-text);
  position: relative;
  overflow: hidden;
  z-index: 1003;
}

.site-title::before {
  content: '';
  position: absolute;
  bottom: 0;
  left: -100%;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--color-accent), transparent);
  transition: left 0.4s var(--ease-out-quad);
}

.site-title:hover::before {
  left: 100%;
}

/* Hamburger Menu Toggle */
.menu-toggle {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  width: 24px;
  height: 18px;
  background: transparent;
  border: none;
  cursor: pointer;
  z-index: 1003;
  padding: 0;
  transition: transform 0.3s var(--ease-out-quad);
}

.menu-toggle:hover {
  transform: scale(1.1);
}

.menu-toggle .bar {
  width: 100%;
  height: 2px;
  background-color: var(--color-text);
  transition: all 0.3s var(--ease-out-quad);
  border-radius: 2px;
}

/* Toggle Animation */
.menu-toggle.active .bar:nth-child(1) {
  transform: translateY(8px) rotate(45deg);
}

.menu-toggle.active .bar:nth-child(2) {
  opacity: 0;
}

.menu-toggle.active .bar:nth-child(3) {
  transform: translateY(-8px) rotate(-45deg);
}

/* Side Menu */
.side-menu {
  position: fixed;
  top: 0;
  right: -320px;
  width: 320px;
  height: 100vh;
  background-color: var(--reading-bg-color);
  z-index: 1002;
  transition: right 0.5s var(--ease-out-quad);
  padding: 6rem 2.5rem 2rem;
  box-shadow: -10px 0 40px rgba(0, 0, 0, 0.08);
  display: flex;
  flex-direction: column;
  border-left: 1px solid var(--color-border);
}

.side-menu.active {
  right: 0;
}

.side-menu-header {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
}

.close-menu {
  background: transparent;
  border: none;
  font-size: 2.5rem;
  color: var(--color-text-muted);
  cursor: pointer;
  line-height: 1;
  transition: color 0.3s ease;
  display: none; /* We'll use the hamburger toggle for both open/close */
}

.nav-menu {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.nav-menu a {
  text-decoration: none;
  color: var(--color-text-muted);
  font-family: var(--font-heading);
  font-size: 1.75rem;
  font-weight: 600;
  position: relative;
  padding: 0.5rem 0;
  transition: all 0.3s var(--ease-out-quad);
}

.nav-menu a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--color-accent);
  transition: width 0.3s var(--ease-out-quad);
}

.nav-menu a:hover {
  color: var(--color-accent);
  padding-left: 0.5rem;
}

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

/* Menu Overlay */
.menu-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.15);
  backdrop-filter: blur(8px);
  z-index: 1001;
  opacity: 0;
  visibility: hidden;
  transition: all 0.5s ease;
}

.menu-overlay.active {
  opacity: 1;
  visibility: visible;
}

/* Homepage Hero with Artful Animation */
.home-hero {
  text-align: center;
  padding: 4rem 0 2rem;
  position: relative;
}

.home-hero::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 200px;
  height: 200px;
  background: radial-gradient(circle, rgba(139, 69, 19, 0.1) 0%, transparent 70%);
  z-index: -1;
}

.tagline {
  font-size: 1.25rem;
  color: var(--color-text-muted);
  margin-top: 0.5rem;
}

.home-intro {
  font-size: 1rem;
  color: var(--color-text-muted);
  max-width: 520px;
  margin: 1rem auto 0;
  line-height: 1.7;
}

.home-social {
  margin-top: 0.75rem;
  font-size: 0.9rem;
}

/* Post List with Staggered Animation */
.post-list {
  margin: 2rem 0;
}

.post-preview {
  margin-bottom: 3rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--color-border);
}

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

.post-preview h2 {
  margin: 0 0 0.5rem;
}

.post-preview h2 a {
  text-decoration: none;
  color: var(--color-text);
  position: relative;
  transition: color 0.3s var(--ease-out-quad);
}

.post-preview h2 a::before {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--color-accent), var(--color-selection));
  transition: width 0.4s var(--ease-out-quad);
}

.post-preview h2 a:hover {
  color: var(--color-accent);
}

.post-preview h2 a:hover::before {
  width: 100%;
}

.post-meta {
  color: var(--color-text-muted);
  font-size: 0.875rem;
  margin-bottom: 0.5rem;
  animation: fadeIn 0.6s var(--ease-out-quad) 0.2s both;
}

.tag {
  display: inline-block;
  padding: 0.1rem 0.4rem;
  background-color: var(--color-code-bg);
  border-radius: 4px;
  margin: 0.15rem;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--color-text-muted);
  transition: transform 0.3s var(--ease-out-back), background-color 0.3s var(--ease-out-quad), color 0.3s var(--ease-out-quad);
}

.tag:hover {
  transform: translateY(-2px);
  background-color: var(--color-accent);
  color: white;
}

.post-tags {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 0.5rem;
  animation: fadeIn 0.8s var(--ease-out-quad) 0.3s both;
}

.post-tags.list-tags {
  justify-content: flex-start;
  margin-top: 0.25rem;
  margin-bottom: 0.75rem;
}

/* Single Post with Enhanced Drop Caps */
.post-header {
  text-align: center;
  margin-bottom: 3rem;
}

.post-header h1 {
  margin-bottom: 1rem;
}

.post-content {
  line-height: var(--reading-line-height);
  font-family: var(--reading-font-family);
  animation: fadeInUp 0.8s var(--ease-out-quad) 0.3s both;
  text-align: justify;
  hyphens: auto;
}

.post-content p {
  margin-bottom: var(--reading-para-spacing);
}

/* Enhanced Drop Caps with Animation */
.post-content > p:first-of-type {
  position: relative;
}

.post-content > p:first-of-type::first-letter {
  font-family: var(--font-heading);
  font-size: 4rem;
  font-weight: 700;
  float: left;
  line-height: 0.8;
  margin-right: 0.5rem;
  margin-top: 0.25rem;
  color: var(--color-accent);
  animation: dropCapFloat 2s var(--ease-out-back) 0.5s both;
}

/* Artful Blockquotes */
blockquote {
  border-left: 4px solid var(--color-accent);
  padding-left: 1.5rem;
  margin: 2rem 0;
  font-style: italic;
  font-size: 1.25rem;
  position: relative;
  animation: slideInFromRight 0.8s var(--ease-out-quad) both;
}

blockquote::before {
  content: '"';
  position: absolute;
  left: -2rem;
  top: -1rem;
  font-size: 4rem;
  color: var(--color-selection);
  opacity: 0.3;
  font-family: var(--font-heading);
}

blockquote cite {
  display: block;
  font-size: 0.875rem;
  font-style: normal;
  text-align: right;
  margin-top: 1rem;
  color: var(--color-text-muted);
}

blockquote.pull-quote {
  text-align: center;
  border-left: none;
  border-right: none;
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
  padding: 2rem 0;
  margin: 3rem 0;
}

/* Fluid Link Animations */
a {
  color: var(--color-text);
  text-decoration: none;
  position: relative;
  transition: color 0.3s var(--ease-out-quad);
}

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

/* Elegant Dividers */
hr {
  border: none;
  height: 1px;
  background-color: var(--color-border);
  margin: 3rem 0;
  position: relative;
  animation: fadeIn 1s var(--ease-out-quad) both;
}

hr.divider-ornament::before {
  content: "❦";
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  background-color: var(--color-bg);
  padding: 0 1rem;
  color: var(--color-text-muted);
  animation: spin 4s linear infinite;
}

hr.divider-dots::before {
  content: "• • •";
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  background-color: var(--color-bg);
  padding: 0 1rem;
  color: var(--color-text-muted);
  animation: bounce 2s ease-in-out infinite;
}

/* Enhanced Code Blocks */
code {
  font-family: var(--font-mono);
  background-color: var(--color-code-bg);
  padding: 0.125rem 0.25rem;
  border-radius: 3px;
  transition: background-color 0.3s var(--ease-out-quad);
}

code:hover {
  background-color: var(--color-selection);
}

pre {
  background-color: var(--color-code-bg);
  padding: 1rem;
  border-radius: 5px;
  overflow-x: auto;
  animation: slideInFromLeft 0.8s var(--ease-out-quad) both;
}

/* Footer with Subtle Animation */
.site-footer {
  border-top: 1px solid var(--color-border);
  margin-top: 4rem;
  padding: 2rem 0;
  text-align: center;
  color: var(--color-text-muted);
  animation: fadeInUp 0.8s var(--ease-out-quad) 0.5s both;
}

/* Pagination */
.pagination {
  display: flex;
  justify-content: space-between;
  margin: 3rem 0;
}

/* Error Page */
.error-page {
  text-align: center;
  padding: 4rem 0;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideInFromLeft {
  from {
    opacity: 0;
    transform: translateX(-50px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideInFromRight {
  from {
    opacity: 0;
    transform: translateX(50px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes dropCapFloat {
  0% {
    opacity: 0;
    transform: translateY(20px) scale(0.8);
  }
  50% {
    transform: translateY(-5px) scale(1.05);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes pulse {
  0%, 100% { opacity: 0.3; transform: translate(-50%, -50%) scale(1); }
  50% { opacity: 0.6; transform: translate(-50%, -50%) scale(1.1); }
}

@keyframes spin {
  from { transform: translate(-50%, -50%) rotate(0deg); }
  to { transform: translate(-50%, -50%) rotate(360deg); }
}

@keyframes bounce {
  0%, 20%, 50%, 80%, 100% { transform: translate(-50%, -50%); }
  40% { transform: translate(-50%, -55%); }
  60% { transform: translate(-50%, -53%); }
}

/* Mobile Styles */
@media (max-width: 767px) {
  .container {
    padding: 0 1rem;
  }
  
  .post-content > p:first-of-type::first-letter {
    font-size: 2.5rem;
    margin-top: 0.5rem;
  }
  
  h1 {
    font-size: 2rem;
  }
  
  h2 {
    font-size: 1.5rem;
  }
  
  .home-hero::before {
    width: 150px;
    height: 150px;
  }
}

/* Desktop Styles */
@media (min-width: 768px) {
  .container {
    padding: 0 2rem;
  }
}

/* Print Styles */
@media print {
  .site-header,
  .site-footer {
    display: none;
  }
  
  body {
    font-size: 12pt;
    line-height: 1.4;
    background: white;
    color: black;
  }
  
  .container {
    max-width: none;
    padding: 0;
  }
  
  * {
    animation: none !important;
  }
}

/* Main Wrapper for Post and Controls */
.main-wrapper {
  display: flex;
  justify-content: center;
  gap: 4rem;
  padding: 2rem 1.5rem;
  max-width: 1400px;
  margin: 0 auto;
  position: relative;
}

.post {
  flex: 0 1 var(--reading-content-width);
  min-width: 0;
  transition: flex-basis 0.3s ease;
}

.reading-controls-compact {
  position: sticky;
  top: 8rem;
  align-self: flex-start;
  z-index: 1000;
  margin-right: -2rem; /* Move slightly into side margin */
}

/* Adjust wrapper to ensure sticky works correctly */
.container.single > .main-wrapper {
  align-items: flex-start;
}

.reader-toggle {
  width: auto !important;
  height: auto !important;
  padding: 0.6rem 1.1rem !important;
  border-radius: 100px !important;
  background: var(--reading-bg-color);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--color-border);
  color: var(--reading-text-color);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
  opacity: 1;
  transform: translateY(0);
}

.reader-toggle span {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 700;
  text-transform: none;
  border-right: 1px solid var(--color-border);
  padding-right: 0.75rem;
  line-height: 1;
}

.reader-toggle.hidden {
  opacity: 0 !important;
  transform: translateY(20px) !important;
  pointer-events: none !important;
}

.reader-toggle:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
  border-color: var(--color-accent);
}

.reader-toggle.active {
  background: var(--color-text);
  color: var(--color-bg);
  border-color: var(--color-text);
}

.reader-toggle.active span {
  border-color: rgba(255, 255, 255, 0.2);
}

.reader-menu {
  position: absolute;
  top: 60px;
  right: 0;
  width: 320px;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12);
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px) scale(0.95);
  transform-origin: top right;
  transition: all 0.3s var(--ease-out-quad);
  padding: 1.5rem;
}

.reader-menu.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

/* Speed Reading Full Page Mode */
.speed-reading-display.full-page {
  position: fixed;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: 100% !important;
  height: 100% !important;
  background: var(--reading-bg-color);
  z-index: 2000;
  display: flex !important;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  margin: 0 !important;
  border: none;
  border-radius: 0;
  padding: 2rem;
  box-sizing: border-box !important;
  transform: none !important;
}

.speed-reading-display.full-page .speed-word {
  font-size: clamp(3rem, 10vw, 6rem);
  max-width: 90vw;
  line-height: 1.1;
}

.speed-reading-display.full-page .speed-progress {
  max-width: 600px;
  width: 80%;
  height: 8px;
  margin-bottom: 3rem;
}

.speed-reading-display.full-page .speed-buttons {
  margin-top: 1rem;
  gap: 1.5rem;
}

.speed-reading-display.full-page .speed-buttons button {
  padding: 0.8rem 2rem;
  font-size: 1.1rem;
  border-radius: 8px;
}

.speed-close-btn {
  display: none;
  position: absolute;
  top: 2rem;
  right: 2rem;
  background: none;
  border: none;
  font-size: 3rem;
  color: var(--color-text-muted);
  cursor: pointer;
  transition: color 0.2s ease;
}

.speed-reading-display.full-page .speed-close-btn {
  display: block;
}

.speed-close-btn:hover {
  color: var(--color-text);
}

.reader-menu-header {
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--color-border);
  padding-bottom: 0.5rem;
}

.reader-tabs {
  display: flex;
  gap: 1rem;
}

.tab-btn {
  background: none;
  border: none;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--color-text-muted);
  cursor: pointer;
  padding: 0.5rem 0;
  position: relative;
}

.tab-btn::after {
  content: '';
  position: absolute;
  bottom: -0.5rem;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--color-accent);
  transition: width 0.3s var(--ease-out-quad);
}

.tab-btn.active {
  color: var(--color-text);
}

.tab-btn.active::after {
  width: 100%;
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

.control-section {
  margin-bottom: 1.25rem;
}

.control-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-text-muted);
  margin-bottom: 0.75rem;
  font-family: var(--font-mono);
}

.slider {
  width: 100%;
  height: 4px;
  border-radius: 2px;
  background: var(--color-border);
  outline: none;
  -webkit-appearance: none;
  cursor: pointer;
  margin: 1rem 0;
}

.slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--color-text);
  cursor: pointer;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  transition: transform 0.2s ease, background-color 0.2s ease;
  border: 2px solid var(--color-bg);
}

.slider::-webkit-slider-thumb:hover {
  transform: scale(1.1);
  background: var(--color-accent);
}

.setting-group input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.1);
}

.setting-group input[type="range"]::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--color-accent);
  cursor: pointer;
  border: none;
  box-shadow: 0 2px 6px rgba(139, 69, 19, 0.3);
}

#reset-settings {
  background: var(--color-accent);
  color: white;
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: 6px;
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 500;
  width: 100%;
  margin-top: 1.5rem;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(139, 69, 19, 0.2);
}

#reset-settings:hover {
  background: #6b3a0f;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(139, 69, 19, 0.3);
}

/* Speed Reading Section Separator */
.controls-divider {
  border: none;
  border-top: 1px solid var(--color-border);
  margin: 1.5rem 0;
  opacity: 0.5;
}

.controls-container hr {
  border: none;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--color-border), transparent);
  margin: 2.5rem 0;
}

/* Speed Reading Toggle */
#speed-reading-toggle {
  margin-right: 0.75rem;
  transform: scale(0.9);
}

/* Speed Reading */
.speed-reading-display {
  display: none;
  text-align: center;
  margin-top: 2rem;
  padding: 2.5rem;
  background: linear-gradient(135deg, var(--color-code-bg) 0%, rgba(245, 242, 237, 0.8) 100%);
  border-radius: 12px;
  border: 1px solid rgba(232, 228, 223, 0.8);
  position: relative;
  overflow: hidden;
}

.speed-reading-display::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--color-accent), var(--color-selection));
}

.speed-word {
  font-size: 2rem;
  font-weight: 600;
  color: var(--reading-text-color);
  min-height: 3rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.5rem;
  font-family: var(--font-heading);
  position: relative;
}

.speed-word::after {
  display: none;
}

.speed-progress {
  width: 100%;
  height: 4px;
  background: var(--color-border);
  border-radius: 2px;
  margin-bottom: 1.5rem;
  overflow: hidden;
  box-shadow: none;
}

.speed-progress-bar {
  height: 100%;
  background: var(--color-accent);
  width: 0%;
  transition: width 0.2s ease;
  border-radius: 2px;
}

.speed-buttons {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  align-items: center;
}

.speed-buttons button {
  background: var(--reading-text-color);
  color: var(--reading-bg-color);
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 500;
  font-family: var(--font-body);
  transition: all 0.2s ease;
}

.speed-buttons button:hover {
  opacity: 0.8;
}

.speed-reading-mode .post-content {
  display: none;
}

/* Mobile Styles */
@media (max-width: 767px) {
  .container {
    padding: 0 1rem;
  }
  
  .post-content > p:first-of-type::first-letter {
    font-size: 2.5rem;
    margin-top: 0.5rem;
  }
  
  h1 {
    font-size: 2rem;
  }
  
  h2 {
    font-size: 1.5rem;
  }
  
  .nav-menu {
    gap: 1rem;
  }
  
  .home-hero::before {
    width: 150px;
    height: 150px;
  }

  /* Reading controls on mobile */
  .main-wrapper {
    flex-direction: column;
    padding: 1rem;
  }

  .post {
    flex: 1 1 auto;
    width: 100%;
  }

  .reading-controls-compact {
    position: fixed;
    top: 5rem;
    right: 1.5rem;
    bottom: auto;
    left: auto;
    z-index: 1100;
  }

  .reader-toggle {
    /* New Pill design inherited */
  }

  .reader-toggle.active {
    /* Inherited */
  }

  .reader-menu {
    position: absolute;
    top: 60px;
    right: 0;
    bottom: auto;
    left: auto;
    width: calc(100vw - 3rem);
    max-width: 320px;
    border-radius: 12px;
    padding: 1.5rem;
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.15);
    transform: translateY(10px) scale(0.95);
    transition: all 0.3s var(--ease-out-quad);
    opacity: 0;
    visibility: hidden;
    z-index: 1101;
    max-height: 70vh;
    overflow-y: auto;
  }

  .reader-menu-handle {
    display: none;
  }

  .reader-menu.show {
    transform: translateY(0) scale(1);
    opacity: 1;
    visibility: visible;
  }

  .reader-menu-header {
    margin-bottom: 1.5rem;
  }

  .reader-tabs {
    justify-content: flex-start;
  }

  .control-section {
    margin-bottom: 1.25rem;
  }

  .size-buttons, .color-buttons, .temp-buttons {
    gap: 0.5rem;
  }

  .size-btn, .color-btn, .temp-btn {
    height: 40px;
    border-radius: 6px;
    font-size: 0.85rem;
  }

  .slider {
    height: 4px;
    margin: 1rem 0;
  }

  .slider::-webkit-slider-thumb {
    width: 18px;
    height: 18px;
  }
}

.size-buttons,
.color-buttons,
.temp-buttons,
.font-buttons {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.5rem;
  justify-content: space-between;
}

.font-buttons {
  flex-wrap: wrap;
}

.size-btn,
.color-btn,
.temp-btn,
.font-btn {
  flex: 1;
  padding: 0.25rem;
  border: 2px solid var(--color-border);
  background: var(--color-bg);
  border-radius: 6px;
  cursor: pointer;
  font-weight: 500;
  transition: all 200ms ease;
  font-size: 0.85rem;
  min-height: 32px;
}

.font-btn {
  min-width: 60px;
  font-size: 0.75rem;
  margin-bottom: 0.25rem;
}

.size-btn.active,
.color-btn.active,
.temp-btn.active,
.font-btn.active {
  border-color: var(--color-text);
  background: rgba(0, 0, 0, 0.05);
}

.color-btn,
.temp-btn {
  width: 40px;
  height: 40px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  font-size: 1.2rem;
}

.checkbox-label {
  display: flex;
  align-items: center;
  font-size: 0.9rem;
  margin-bottom: 0.75rem;
  cursor: pointer;
  color: var(--color-text);
}

.checkbox-label input[type="checkbox"] {
  margin-right: 0.5rem;
  cursor: pointer;
  width: 16px;
  height: 16px;
}

.control-btn {
  padding: 0.5rem 1rem;
  background: var(--color-text);
  color: var(--color-bg);
  border: none;
  border-radius: 4px;
  font-size: 0.85rem;
  cursor: pointer;
  font-weight: 500;
  transition: all 200ms ease;
}

.control-btn:hover {
  opacity: 0.8;
}

.reset-btn {
  width: 100%;
  padding: 0.75rem;
  background: transparent;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  color: var(--color-text-muted);
  font-size: 0.85rem;
  cursor: pointer;
  font-weight: 500;
  transition: all 200ms ease;
  margin-top: 1rem;
}

.reset-btn:hover {
  border-color: var(--color-text);
  color: var(--color-text);
}

/* Responsive Design */
@media (max-width: 1200px) {
  .main-wrapper {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  
  .post {
    grid-column: 1;
  }
  
  .reading-controls {
    grid-column: 1;
    position: static;
    width: 100%;
  }
}

