.page-hero-title em { font-style: italic; color: #ffffff; }

body.writing-page::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("../images/1.jpeg");
  background-position: center center;
  background-size: cover;
  background-repeat: no-repeat;
  opacity: 1;
  z-index: -3;
}

body.writing-page::after {
  content: '';
  position: fixed;
  inset: 0;
  background: linear-gradient(180deg, rgba(2,10,18,0.36), rgba(8,16,28,0.58));
  z-index: -2;
  pointer-events: none;
}

body.writing-page {
  color: #f9fbff;
  min-height: 100vh;
}

body.writing-page nav {
  background: transparent;
  border-bottom: none;
}

body.writing-page .nav-links a {
  color: #ffffff;
  opacity: 1;
}

body.writing-page .nav-links a::after {
  background: rgba(255,255,255,0.7);
}

body.writing-page .nav-links a.active,
body.writing-page .nav-links a:hover {
  color: #ffffff;
}

body.writing-page .eyebrow,
body.writing-page .page-hero-sub,
body.writing-page .page-hero-title,
body.writing-page .wr-title,
body.writing-page .wr-excerpt,
body.writing-page .wr-year,
body.writing-page .wr-type,
body.writing-page .filter-btn,
body.writing-page .wr-read-btn {
  color: #ffffff;
}

.filter-row {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 2rem;
}

.filter-btn {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  padding: 0.35rem 1rem;
  background: transparent;
  border: 1px solid rgba(255,255,255,0.2);
  color: #ffffff;
  cursor: pointer;
  border-radius: 2px;
  transition: all 0.25s;
}

.filter-btn:hover { color: #ffffff; border-color: rgba(255,255,255,0.4); }

.filter-btn.active {
  background: rgba(255,255,255,0.12);
  color: #ffffff;
  border-color: rgba(255,255,255,0.3);
}

.writing-list { display: flex; flex-direction: column; max-width: 820px; }

.writing-row {
  display: grid;
  grid-template-columns: 100px 1fr auto;
  align-items: center;
  gap: 1.5rem;
  padding: 1.4rem 0.8rem;
  border-bottom: 1px solid rgba(255,255,255,0.16);
  position: relative;
  cursor: default;
  background: transparent;
  border-radius: 8px;
  margin-bottom: 0.6rem;
  backdrop-filter: none;
}

.writing-row::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 0;
  background: rgba(255,255,255,0.04);
  transition: width 0.35s cubic-bezier(0.4,0,0.2,1);
  z-index: -1;
}

.writing-row:hover::before { width: 100%; }
.writing-row:last-child { border-bottom: none; }

.wr-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.wr-type {
  font-family: var(--mono);
  font-size: 0.65rem;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 2px;
  display: inline-block;
}

.poem-type {
  background: rgba(255,255,255,0.08);
  color: #ffffff;
  border: 1px solid rgba(255,255,255,0.2);
}

.fiction-type {
  background: rgba(255,255,255,0.08);
  color: #ffffff;
  border: 1px solid rgba(255,255,255,0.2);
}

.diary-type {
  background: rgba(255,255,255,0.08);
  color: #ffffff;
  border: 1px solid rgba(255,255,255,0.2);
}

.wr-year {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: #f3f6f9;
}

.wr-body { flex: 1; }

.wr-title {
  font-family: var(--serif);
  font-size: 1.15rem;
  color: #ffffff;
  font-weight: 400;
  margin-bottom: 0.3rem;
  line-height: 1.3;
}

.wr-excerpt {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: #f3f6f9;
  line-height: 1.6;
  font-style: italic;
}

.wr-read-btn {
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 0.4rem 1rem;
  background: transparent;
  border: 1px solid rgba(255,255,255,0.2);
  color: #ffffff;
  cursor: pointer;
  border-radius: 2px;
  transition: all 0.25s;
  white-space: nowrap;
}

.wr-read-btn:hover {
  background: rgba(255,255,255,0.12);
  color: #ffffff;
  border-color: rgba(255,255,255,0.3);
}

.modal-overlay {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1010;
  background: rgba(2, 10, 18, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.modal-box {
  position: relative;
  z-index: 1020;
  max-width: 800px;
  width: 100%;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  background: transparent;
  padding: 2rem;
}

.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 2rem;
}

.modal-title {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: clamp(2rem, 5vw, 3.2rem);
  color: #ffffff;
  font-weight: 500;
  font-style: italic;
  line-height: 1.1;
  letter-spacing: 0.01em;
  margin: 0;
  flex: 1;
}

.modal-close {
  display: inline-flex;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  align-items: center;
  justify-content: center;
  background: transparent;
  color: #ffffff;
  border: 1px solid rgba(255,255,255,0.25);
  cursor: pointer;
  z-index: 6;
  transition: all 0.35s cubic-bezier(0.4,0,0.2,1);
  flex-shrink: 0;
  margin-left: 1rem;
}

.modal-close:hover {
  background: rgba(255,255,255,0.08);
  border-color: rgba(255,255,255,0.6);
  transform: rotate(90deg);
}

.modal-close svg { 
  width: 16px; 
  height: 16px; 
  stroke: #ffffff; 
  stroke-width: 1.5; 
}

.reader-nav {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  z-index: 1030;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.15);
  color: #ffffff;
  font-size: 1.5rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  pointer-events: auto;
}

.reader-prev {
  left: clamp(1rem, 3vw, 3rem);
}

.reader-next {
  right: clamp(1rem, 3vw, 3rem);
}

.reader-nav:hover {
  background: rgba(255,255,255,0.12);
  border-color: rgba(255,255,255,0.4);
  transform: translateY(-50%) scale(1.05);
}

.reader-nav:active {
  transform: translateY(-50%) scale(0.95);
}

.modal-content {
  padding: 0 0.5rem 2rem;
  overflow-y: auto;
  overflow-x: hidden;
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 1.25rem;
  color: rgba(255,255,255,0.95);
  line-height: 1.9;
  letter-spacing: 0.01em;
  max-width: 680px;
  width: 100%;
  margin: 0 auto;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
}

.modal-content::-webkit-scrollbar {
  width: 4px;
}

.modal-content::-webkit-scrollbar-track {
  background: transparent;
}

.modal-content::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.2);
  border-radius: 2px;
}

.modal-content p {
  margin-bottom: 1.2rem;
}

.modal-content br {
  content: '';
  display: block;
  margin-bottom: 0.4rem;
}

.letter-content {
  font-family: 'Lato', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 1.05rem;
  line-height: 1.85;
  letter-spacing: 0.015em;
  color: rgba(255,255,255,0.9);
}

.modal-note {
  margin-top: 3rem;
  padding: 1.5rem 1.8rem;
  border-left: 2px solid rgba(255,255,255,0.4);
  font-family: var(--mono);
  font-size: 0.85rem;
  color: rgba(255,255,255,0.85);
  font-style: italic;
  background: rgba(255,255,255,0.03);
  letter-spacing: 0.02em;
  line-height: 1.7;
}

@media (max-width: 768px) {
  .modal-box {
    padding: 1.5rem;
  }
  
  .modal-content {
    padding: 0 0.5rem 1.5rem;
    font-size: 1.1rem;
    line-height: 1.8;
  }
  
  .modal-title {
    font-size: 1.8rem;
  }
  
  .modal-close {
    width: 38px;
    height: 38px;
  }
  
  .letter-content {
    font-size: 0.95rem;
  }
  
  .reader-nav {
    width: 40px;
    height: 40px;
    font-size: 1.2rem;
  }
  
  .reader-prev {
    left: 0.5rem;
  }
  
  .reader-next {
    right: 0.5rem;
  }
}

@media (max-width: 480px) {
  .modal-box {
    padding: 1rem;
  }
  
  .modal-content {
    font-size: 1rem;
    line-height: 1.75;
  }
  
  .modal-title {
    font-size: 1.5rem;
  }
  
  .reader-nav {
    width: 36px;
    height: 36px;
  }
}