/* Base typography */
/* @font-face {
    font-family: 'Futura Nova';
    src: url('../assets/fonts/futuranova.woff2') format('woff2');
} */

@font-face {
  font-family: "Workbench";
  src: url("../fonts/strikefighter.ttf") format("truetype");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --chapter-max-width: 800px;
  --chapter-font-size: 16px;
}

.skip-link {
  position: absolute;
  top: -1000px;
  left: -1000px;
  padding: 0.75rem 1rem;
  background: #4cd1a9;
  color: #03121a;
  font-weight: 600;
  border-radius: 4px;
  z-index: 300;
  text-decoration: none;
  opacity: 0;
  transform: translateY(-10px);
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.skip-link:focus {
  top: 1rem;
  left: 1rem;
  transform: translateY(0);
  opacity: 1;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

body {
  font-family: "Futura Nova", sans-serif;
  background-color: #0a0e17;
  color: #e0e0e0;
  line-height: 1.6;
}

.chapter-nav {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 1.5rem 2rem 0;
}

.chapter-select {
  position: relative;
  display: inline-flex;
  flex-direction: column;
  gap: 0.35rem;
  color: inherit;
}

.chapter-select span {
  font-size: 0.95rem;
  letter-spacing: 0.03em;
}

.chapter-dropdown-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  /* margin-top: 0.75rem; */
}

.chapter-toggle {
  margin-top: 0.5rem;
  background: rgba(255, 255, 255, 0.05);
  color: inherit;
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 0.35rem 0.75rem;
  border-radius: 4px;
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.chapter-toggle:hover,
.chapter-toggle:focus-visible {
  background: rgba(76, 209, 169, 0.12);
  border-color: rgba(76, 209, 169, 0.6);
  outline: none;
}

.chapter-audio-player {
  margin-top: 0.75rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 6px;
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  display: none;
}

.chapter-audio-header {
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.7);
}

.chapter-audio-controls {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.5rem;
}

.chapter-audio-button {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: inherit;
  padding: 0.35rem 0.75rem;
  border-radius: 4px;
  font-size: 0.8rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease;
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.chapter-audio-button:hover,
.chapter-audio-button:focus-visible {
  background: rgba(76, 209, 169, 0.12);
  border-color: rgba(76, 209, 169, 0.6);
  outline: none;
}

.chapter-audio-button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.08);
}

.chapter-audio-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  line-height: 1;
  letter-spacing: normal;
  text-transform: none;
  pointer-events: none;
}

.chapter-audio-timeline {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.chapter-audio-scrubber {
  flex: 1;
  appearance: none;
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.15);
  accent-color: #4cd1a9;
}

.chapter-audio-scrubber::-webkit-slider-thumb {
  appearance: none;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #4cd1a9;
  cursor: pointer;
}

.chapter-audio-scrubber::-moz-range-thumb {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #4cd1a9;
  border: none;
  cursor: pointer;
}

.chapter-audio-scrubber:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.chapter-audio-time {
  font-size: 0.75rem;
  min-width: 3.25rem;
  text-align: center;
  letter-spacing: 0.04em;
  color: rgba(255, 255, 255, 0.7);
}

.home-link {
  margin-top: 0.5rem;
  align-self: flex-start;
  width: 100%;
  background: rgba(255, 255, 255, 0.05);
  color: inherit;
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 0.3rem 0rem;
  border-radius: 4px;
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
}
.home-link:hover,
.home-link:focus-visible {
  background: rgba(76, 209, 169, 0.12);
  border-color: rgba(76, 209, 169, 0.6);
  outline: none;
}

.search-toggle {
  margin-top: 0.5rem;
  align-self: flex-start;
  width: 100%;
  background: rgba(255, 255, 255, 0.05);
  color: inherit;
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 0.35rem 0.75rem;
  border-radius: 4px;
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
}
.search-toggle:hover,
.search-toggle:focus-visible {
  background: rgba(76, 209, 169, 0.12);
  border-color: rgba(76, 209, 169, 0.6);
  outline: none;
}

.search-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(5, 8, 15, 0.7);
  backdrop-filter: blur(4px);
  z-index: 800;
}

.search-backdrop[hidden],
.search-panel[hidden] {
  display: none;
}

.search-panel {
  position: fixed;
  inset: 0;
  padding: 3rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 900;
}

.search-panel.is-visible {
  opacity: 1;
  pointer-events: auto;
}

.search-panel__inner {
  width: min(680px, 100%);
  background: rgba(8, 12, 20, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45);
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.search-panel__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.search-panel__header h2 {
  margin: 0;
  font-size: 1.35rem;
  letter-spacing: 0.06em;
}

.search-close {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: inherit;
  padding: 0.4rem 0.85rem;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.search-close:hover,
.search-close:focus-visible {
  background: rgba(76, 209, 169, 0.18);
  border-color: rgba(76, 209, 169, 0.6);
  outline: none;
}

.search-label {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: rgba(255, 255, 255, 0.65);
}

.search-input {
  width: 100%;
  padding: 0.8rem 1rem;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(13, 18, 28, 0.85);
  color: inherit;
  font-size: 1rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.search-input:focus {
  border-color: rgba(76, 209, 169, 0.7);
  box-shadow: 0 0 0 2px rgba(76, 209, 169, 0.25);
  outline: none;
}

.search-status {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.7);
}

.search-results {
  margin: 0;
  padding: 0;
  list-style: none;
  max-height: 340px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.search-result a {
  display: block;
  padding: 0.65rem 0.75rem;
  border-radius: 6px;
  border: 1px solid transparent;
  background: rgba(255, 255, 255, 0.05);
  color: inherit;
  text-decoration: none;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.search-result a:hover,
.search-result a:focus-visible {
  border-color: rgba(76, 209, 169, 0.5);
  background: rgba(76, 209, 169, 0.12);
  outline: none;
}

.search-result__title {
  display: block;
  font-weight: 600;
  letter-spacing: 0.04em;
  margin-bottom: 0.3rem;
}

.search-result__snippet {
  display: block;
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.75);
  line-height: 1.5;
}

mark {
  background: rgba(76, 209, 169, 0.4);
  color: inherit;
  padding: 0 0.15rem;
  border-radius: 3px;
}

.chapter-dropdown {
  position: absolute;
  top: calc(100% + 0.5rem);
  left: 0;
  list-style: none;
  margin: 0;
  min-width: 220px;
  padding: 0.75rem;
  border-radius: 6px;
  background: rgba(7, 11, 19, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(8px);
  z-index: 200;
}

.chapter-dropdown[hidden] {
  display: none;
}

.chapter-dropdown li {
  margin: 0;
  padding: 0;
  list-style: none;
  width: 100%;
}

.chapter-link {
  color: inherit;
  text-decoration: none;
  font-size: 0.9rem;
  letter-spacing: 0.04em;
  transition: color 0.2s ease;
}

.chapter-link:hover {
  color: #4cd1a9;
}

.chapter-link[aria-current="page"] {
  color: #4cd1a9;
  cursor: default;
}

.chapter-voice-control {
  margin-top: 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.chapter-voice-item {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.chapter-voice-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.chapter-voice-mode {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(255, 255, 255, 0.56);
}

.chapter-voice-toggle-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.chapter-voice-option {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(255, 255, 255, 0.45);
}

.chapter-voice-switch {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.chapter-voice-switch input {
  position: absolute;
  inset: 0;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.chapter-voice-slider {
  position: relative;
  width: 48px;
  height: 24px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.15);
  transition: background 0.2s ease, border-color 0.2s ease;
}

.chapter-voice-slider::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #0a0e17;
  box-shadow: 0 0 0 1px rgba(76, 209, 169, 0.25);
  transition: transform 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.chapter-voice-switch input:checked + .chapter-voice-slider {
  background: rgba(76, 209, 169, 0.35);
  border-color: rgba(76, 209, 169, 0.6);
}

.chapter-voice-switch input:checked + .chapter-voice-slider::after {
  transform: translateX(24px);
  background: #4cd1a9;
  box-shadow: 0 0 0 1px rgba(76, 209, 169, 0.5);
}

.chapter-voice-switch input:focus-visible + .chapter-voice-slider {
  outline: 2px solid #4cd1a9;
  outline-offset: 2px;
}

.chapter-voice-description {
  font-size: 0.75rem;
  line-height: 1.4;
  color: rgba(255, 255, 255, 0.45);
}

.chapter-width-control {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.chapter-width-item {
  margin-top: 0.5rem;
}

.chapter-font-item {
  margin-top: 0.5rem;
}

.chapter-width-label {
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.7);
}

.chapter-width-slider {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.chapter-font-slider {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.chapter-width-slider input[type="range"] {
  -webkit-appearance: none;
  /* width: 140px; */
  width: 100%;
  height: 4px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 999px;
  outline: none;
  cursor: pointer;
  transition: background 0.2s ease;
}

.chapter-width-slider input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #4cd1a9;
  border: none;
  box-shadow: 0 0 0 2px rgba(76, 209, 169, 0.35);
  transition: transform 0.2s ease;
}

.chapter-width-slider input[type="range"]::-moz-range-thumb {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #4cd1a9;
  border: none;
  box-shadow: 0 0 0 2px rgba(76, 209, 169, 0.35);
  transition: transform 0.2s ease;
}

.chapter-font-slider input[type="range"] {
  -webkit-appearance: none;
  width: 140px;
  height: 4px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 999px;
  outline: none;
  cursor: pointer;
  transition: background 0.2s ease;
}

.chapter-font-slider input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #4cd1a9;
  border: none;
  box-shadow: 0 0 0 2px rgba(76, 209, 169, 0.35);
  transition: transform 0.2s ease;
}

.chapter-font-slider input[type="range"]::-moz-range-thumb {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #4cd1a9;
  border: none;
  box-shadow: 0 0 0 2px rgba(76, 209, 169, 0.35);
  transition: transform 0.2s ease;
}

.chapter-width-slider input[type="range"]:hover::-webkit-slider-thumb,
.chapter-width-slider input[type="range"]:focus-visible::-webkit-slider-thumb,
.chapter-width-slider input[type="range"]:hover::-moz-range-thumb,
.chapter-width-slider input[type="range"]:focus-visible::-moz-range-thumb {
  transform: scale(1.1);
}

.chapter-font-slider input[type="range"]:hover::-webkit-slider-thumb,
.chapter-font-slider input[type="range"]:focus-visible::-webkit-slider-thumb,
.chapter-font-slider input[type="range"]:hover::-moz-range-thumb,
.chapter-font-slider input[type="range"]:focus-visible::-moz-range-thumb {
  transform: scale(1.1);
}

.chapter-width-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 4px;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.65);
  background: rgba(255, 255, 255, 0.02);
}

.chapter-width-slider input[type="range"]:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.chapter-font-slider input[type="range"]:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.chapter-font-icon-small {
  font-size: 0.55rem !important;
  line-height: 1;
}

.chapter-font-icon-large {
  font-size: 1.1rem;
  line-height: 1;
}

.home-link {
  color: white;
}

.previous-chapter {
  color: white;
}
.next-chapter {
  color: white;
}

/* Emotional text styling */
.text-mysterious {
  color: #8a7cce;
  font-style: italic;
}

.text-tense {
  color: #d1594c;
  font-weight: 500;
  letter-spacing: 0.03em;
}

.text-romantic {
  color: #c27ba0;
  font-style: italic;
  letter-spacing: 0.02em;
}

.text-terminal {
  font-family: "Courier New", monospace;
  color: #4cd1a9;
  background-color: rgba(10, 30, 40, 0.3);
  padding: 0.5em;
  border-radius: 4px;
  font-size: 0.9em;
}

.chapter-body {
  font-size: var(--chapter-font-size, 16px);
  line-height: 1.7;
  text-align: justify;
  text-justify: inter-word;
}

.chapter-body p,
.chapter-body blockquote,
.chapter-body li {
  font-size: inherit;
}

/* Responsive layout */
.chapter-content {
  max-width: min(100%, var(--chapter-max-width, 800px));
  margin: 0 auto;
  padding: 2rem;
}

@media (max-width: 768px) {
  .chapter-content {
    padding: 0.5rem;
  }

  .chapter-nav {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
    padding: 1.25rem 0.5rem 0;
  }

  .chapter-select {
    width: 100%;
    gap: 0.5rem;
  }

  .chapter-dropdown {
    width: 95%;
    position: static;
    box-shadow: none;
    backdrop-filter: none;
  }

  .chapter-width-control {
    margin-top: 0.75rem;
    padding-top: 0.5rem;
    border-top: none;
  }

  .chapter-width-item {
    display: none;
  }

  .search-panel {
    align-items: flex-start;
    padding-top: 4rem;
  }

  .search-panel__inner {
    padding: 1.25rem;
    gap: 1rem;
  }
  .chapter-font-slider input[type="range"] {
  
  width: 90%;

}
}

.reading-progress-container {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 12px;
  background-color: rgba(15, 20, 30, 0.7);
  z-index: 1000;
}

.reading-progress-bar {
  height: 100%;
  width: 0;
  background-color: #4cd1a9; /* Using the same terminal green color */
  transition: width 0.2s ease;
}
.scramble {
  font-size: clamp(28px, 6vw, 64px);
  letter-spacing: 0.02em;
  line-height: 1.2;
  cursor: default;
  user-select: none;
  font-family: "Workbench", sans-serif;
}
.scramble span {
  display: inline-block; /* allows per-char transforms */
  will-change: transform, filter;
  font-family: "Workbench", sans-serif;
}


/* Optional: Make it more subtle on smaller screens */
@media (max-width: 768px) {
  .reading-progress-container {
    height: 6px;
  }
  .scramble {
  font-size: clamp(32px, 10vw, 128px);
  letter-spacing: 0.02em;
  line-height: 1.2;
  cursor: default;
  user-select: none;
  font-family: "Workbench", sans-serif;
}
.scramble span {
  display: inline-block; /* allows per-char transforms */
  will-change: transform, filter;
  font-family: "Workbench", sans-serif;
}

}

/* Adjust footer padding to prevent overlap with progress bar */
.chapter-footer {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding-bottom: 20px;
  align-items: center;
}

pre,
code {
  color: #d3b633;
}

body.search-open {
  overflow: hidden;
}

