* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Bricolage Grotesque', sans-serif;
}

body {
  font-family: 'Bricolage Grotesque', sans-serif;
  line-height: 1.6;
  font-size: 15.4px;
}

:root {
  --bg-primary: #fff3e6;
  --bg-secondary: #ffe8d6;
  --text-primary: #e85d00;
  --text-hover: #b34700;
  --accent: #e85d00;
}

.dark-mode {
  --bg-primary: #1a1a1a;
  --bg-secondary: #2a2a2a;
  --text-primary: #ff8c42;
  --text-hover: #ffa366;
  --accent: #ff8c42;
}

.page-wrapper {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  transition: background-color 0.3s ease, color 0.3s ease;
}

a {
  color: #e85d00;
  text-decoration: underline;
  text-underline-offset: 2.2px;
}

.dark-mode a {
  color: #ff8c42;
}

a:hover {
  color: #b34700;
}

.dark-mode a:hover {
  color: #ffa366;
}

.container {
  max-width: 1320px;
  margin: 0 auto;
  padding: 44px 26.4px;
}

/* Header */
header {
  margin-bottom: 66px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.header-left {
  display: flex;
  flex-direction: column;
  gap: 8.8px;
}

.site-title {
  font-size: 15.4px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.site-title a {
  text-decoration: none;
}

nav {
  display: flex;
  gap: 26.4px;
  font-size: 13.2px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Theme Toggle */
.theme-toggle {
  background: none;
  border: 1px solid #e85d00;
  color: #e85d00;
  font-family: inherit;
  font-size: 19.8px;
  width: 39.6px;
  height: 39.6px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.dark-mode .theme-toggle {
  border-color: #ff8c42;
  color: #ff8c42;
}

.theme-toggle:hover {
  background-color: #e85d00;
  color: #fff3e6;
}

.dark-mode .theme-toggle:hover {
  background-color: #ff8c42;
  color: #1a1a1a;
}

/* Hero Image */
.hero-image {
  width: 100%;
  max-width: 990px;
  margin: 0 auto 66px;
  position: relative;
  overflow: hidden;
}

.hero-placeholder {
  width: 100%;
  height: 330px;
  background-color: #ffe8d6;
  border: 1px solid #e85d00;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #e85d00;
  font-size: 13.2px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.dark-mode .hero-placeholder {
  background-color: #2a2a2a;
  border-color: #ff8c42;
  color: #ff8c42;
}

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

/* Main Grid */
.main-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 66px;
  margin-bottom: 88px;
}

@media (max-width: 768px) {
  .main-grid {
    grid-template-columns: 1fr;
    gap: 44px;
  }
}

.section-title {
  font-size: 15.4px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 26.4px;
  padding-bottom: 13.2px;
  border-bottom: 1px solid #e85d00;
}

.dark-mode .section-title {
  border-color: #ff8c42;
}

/* About Section */
.about-section p {
  margin-bottom: 17.6px;
}

.about-section .label {
  font-size: 13.2px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  opacity: 0.7;
  margin-bottom: 4.4px;
}

.about-section ul {
  list-style: none;
  margin-bottom: 26.4px;
}

.about-section li {
  padding-left: 17.6px;
  position: relative;
  margin-bottom: 8.8px;
}

.about-section li::before {
  content: "-";
  position: absolute;
  left: 0;
}

/* Writing Section */
.writing-list {
  list-style: none;
}

.writing-list li {
  padding: 13.2px 0;
  border-bottom: 1px dashed #e85d00;
}

.dark-mode .writing-list li {
  border-color: #ff8c42;
}

.writing-list li:last-child {
  border-bottom: none;
}

.writing-list a {
  display: block;
}

.writing-list .source {
  font-size: 12.1px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  opacity: 0.6;
  margin-top: 4.4px;
}

/* Bookshelf Section */
.bookshelf-section {
  margin-bottom: 88px;
}

.year-label {
  font-size: 13.2px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 17.6px;
  margin-top: 44px;
}

.year-label:first-of-type {
  margin-top: 0;
}

.book-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 17.6px;
}

@media (max-width: 600px) {
  .book-grid {
    grid-template-columns: repeat(auto-fill, minmax(88px, 1fr));
    gap: 13.2px;
  }
}

.book-cover {
  aspect-ratio: 2/3;
  background-color: #ffe8d6;
  border: 1px solid #e85d00;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8.8px;
  font-size: 9.9px;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  line-height: 1.3;
  transition: all 0.2s ease;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.dark-mode .book-cover {
  background-color: #2a2a2a;
  border-color: #ff8c42;
}

.book-cover:hover {
  transform: translateY(-2.2px);
  box-shadow: 0 4.4px 13.2px rgba(0, 0, 0, 0.2);
}

.book-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  position: absolute;
  top: 0;
  left: 0;
  transition: transform 0.2s ease;
}

.book-cover:hover img {
  transform: scale(1.05);
}

.book-cover .title-fallback {
  position: relative;
  z-index: 1;
}

.book-cover.has-image .title-fallback {
  display: none;
}

.book-cover .badge {
  position: absolute;
  top: 4.4px;
  right: 4.4px;
  font-size: 11px;
  background-color: #fff3e6;
  padding: 2.2px 4.4px;
  line-height: 1;
  z-index: 2;
}

.dark-mode .book-cover .badge {
  background-color: #1a1a1a;
}

.book-cover .badge.heart {
  color: #e85d00;
}

.dark-mode .book-cover .badge.heart {
  color: #ff8c42;
}

.book-cover .badge.star {
  color: #e85d00;
}

.dark-mode .book-cover .badge.star {
  color: #ff8c42;
}

/* Search Box */
.search-box {
  margin-bottom: 17.6px;
}

.search-box input {
  width: 100%;
  font-family: inherit;
  font-size: 14.3px;
  padding: 11px 13.2px;
  background-color: #ffe8d6;
  border: 1px solid #e85d00;
  color: #e85d00;
  transition: all 0.2s ease;
}

.dark-mode .search-box input {
  background-color: #2a2a2a;
  border-color: #ff8c42;
  color: #ff8c42;
}

.search-box input::placeholder {
  color: #e85d00;
  opacity: 0.5;
}

.dark-mode .search-box input::placeholder {
  color: #ff8c42;
  opacity: 0.5;
}

.search-box input:focus {
  outline: none;
  border-color: #e85d00;
  background-color: #fff3e6;
}

.dark-mode .search-box input:focus {
  border-color: #ff8c42;
  background-color: #0a0a0a;
}

/* Sort Controls */
.sort-controls {
  display: flex;
  gap: 13.2px;
  margin-bottom: 26.4px;
  flex-wrap: wrap;
  align-items: center;
}

.sort-controls span {
  font-size: 12.1px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  opacity: 0.7;
}

.sort-btn {
  font-family: inherit;
  font-size: 12.1px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: none;
  border: 1px solid #e85d00;
  color: #e85d00;
  padding: 6.6px 13.2px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.dark-mode .sort-btn {
  border-color: #ff8c42;
  color: #ff8c42;
}

.sort-btn:hover {
  background-color: #e85d00;
  color: #fff3e6;
}

.dark-mode .sort-btn:hover {
  background-color: #ff8c42;
  color: #1a1a1a;
}

.sort-btn.active {
  background-color: #e85d00;
  color: #fff3e6;
}

.dark-mode .sort-btn.active {
  background-color: #ff8c42;
  color: #1a1a1a;
}

.book-count {
  font-size: 12.1px;
  opacity: 0.6;
  margin-left: auto;
}

/* Movie Shelf */
.movie-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 17.6px;
}

@media (max-width: 600px) {
  .movie-grid {
    grid-template-columns: repeat(auto-fill, minmax(88px, 1fr));
    gap: 13.2px;
  }
}

.movie-poster {
  aspect-ratio: 2/3;
  background-color: #ffe8d6;
  border: 1px solid #e85d00;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8.8px;
  font-size: 9.9px;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  line-height: 1.3;
  transition: all 0.2s ease;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.dark-mode .movie-poster {
  background-color: #2a2a2a;
  border-color: #ff8c42;
}

.movie-poster:hover {
  transform: translateY(-2.2px);
  box-shadow: 0 4.4px 13.2px rgba(0, 0, 0, 0.2);
}

.movie-poster img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  position: absolute;
  top: 0;
  left: 0;
  transition: transform 0.2s ease;
}

.movie-poster:hover img {
  transform: scale(1.05);
}

.movie-poster .title-fallback {
  position: relative;
  z-index: 1;
}

.movie-poster.has-image .title-fallback {
  display: none;
}

.movie-poster .badge {
  position: absolute;
  top: 4.4px;
  right: 4.4px;
  font-size: 11px;
  background-color: #fff3e6;
  padding: 2.2px 4.4px;
  line-height: 1;
  z-index: 2;
}

.dark-mode .movie-poster .badge {
  background-color: #1a1a1a;
}

.movie-poster .badge.heart {
  color: #e85d00;
}

.dark-mode .movie-poster .badge.heart {
  color: #ff8c42;
}

.movie-poster .badge.star {
  color: #e85d00;
}

.dark-mode .movie-poster .badge.star {
  color: #ff8c42;
}

/* Scroll to Top */
.scroll-top {
  position: fixed;
  bottom: 26.4px;
  right: 26.4px;
  width: 44px;
  height: 44px;
  background-color: #e85d00;
  color: #fff3e6;
  border: none;
  cursor: pointer;
  font-size: 19.8px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  z-index: 100;
  font-family: inherit;
}

.dark-mode .scroll-top {
  background-color: #ff8c42;
  color: #1a1a1a;
}

.scroll-top.visible {
  opacity: 1;
  visibility: visible;
}

.scroll-top:hover {
  transform: translateY(-2.2px);
}

/* Review Modal */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  padding: 22px;
}

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

.modal {
  background-color: #fff3e6;
  max-width: 660px;
  width: 100%;
  max-height: 80vh;
  overflow-y: auto;
  padding: 35.2px;
  position: relative;
  border: 2px solid #e85d00;
  transition: background-color 0.3s ease, border-color 0.3s ease;
}

.dark-mode .modal {
  background-color: #1a1a1a;
  border-color: #ff8c42;
}

.modal-close {
  position: absolute;
  top: 17.6px;
  right: 17.6px;
  background: none;
  border: none;
  color: #e85d00;
  font-size: 26.4px;
  cursor: pointer;
  font-family: inherit;
}

.dark-mode .modal-close {
  color: #ff8c42;
}

.modal-close:hover {
  opacity: 0.7;
}

.modal-cover {
  width: 132px;
  height: 198px;
  object-fit: cover;
  margin-bottom: 22px;
  border: 1px solid #e85d00;
}

.dark-mode .modal-cover {
  border-color: #ff8c42;
}

.modal-title {
  font-size: 17.6px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 8.8px;
}

.modal-author {
  font-size: 13.2px;
  opacity: 0.7;
  margin-bottom: 17.6px;
}

.modal-review {
  font-size: 15.4px;
  line-height: 1.7;
}

.modal-no-review {
  font-size: 15.4px;
  opacity: 0.6;
  font-style: italic;
}

/* Footer */
footer {
  padding-top: 44px;
  border-top: 1px solid #e85d00;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 17.6px;
  font-size: 13.2px;
}

.dark-mode footer {
  border-color: #ff8c42;
}

.social-links {
  display: flex;
  gap: 26.4px;
}

/* Essays List */
.essays-list {
  list-style: none;
}

.essay-item {
  padding: 22px 0;
  border-bottom: 1px dashed #e85d00;
}

.dark-mode .essay-item {
  border-color: #ff8c42;
}

.essay-item:last-child {
  border-bottom: none;
}

.essay-title {
  font-size: 15.4px;
  font-weight: 600;
  margin-bottom: 4.4px;
}

.essay-title a {
  text-decoration: none;
}

.essay-title a:hover {
  text-decoration: underline;
}

.essay-meta {
  font-size: 12.1px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  opacity: 0.6;
  margin-bottom: 8.8px;
}

.essay-review {
  font-size: 14.3px;
  line-height: 1.6;
  opacity: 0.9;
}

.essay-badge {
  display: inline-block;
  margin-left: 6.6px;
  font-size: 13.2px;
}

.essay-badge.heart {
  color: #e85d00;
}

.dark-mode .essay-badge.heart {
  color: #ff8c42;
}

.essay-badge.star {
  color: #e85d00;
}

.dark-mode .essay-badge.star {
  color: #ff8c42;
}

/* Shelf Tabs */
.shelf-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 26.4px;
  border-bottom: 1px solid #e85d00;
}

.dark-mode .shelf-tabs {
  border-color: #ff8c42;
}

.shelf-tab {
  font-family: inherit;
  font-size: 15.4px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: none;
  border: none;
  color: #e85d00;
  padding: 13.2px 26.4px;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  opacity: 0.6;
}

.dark-mode .shelf-tab {
  color: #ff8c42;
}

.shelf-tab:hover {
  opacity: 1;
}

.shelf-tab.active {
  opacity: 1;
}

.shelf-tab.active::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 2.2px;
  background-color: #e85d00;
}

.dark-mode .shelf-tab.active::after {
  background-color: #ff8c42;
}

.tab-content {
  display: none;
}

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

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(11px); }
  to { opacity: 1; transform: translateY(0); }
}

.fade-in {
  animation: fadeIn 0.5s ease forwards;
  opacity: 0;
}

.fade-in:nth-child(1) { animation-delay: 0.1s; }
.fade-in:nth-child(2) { animation-delay: 0.2s; }
.fade-in:nth-child(3) { animation-delay: 0.3s; }
.fade-in:nth-child(4) { animation-delay: 0.4s; }

/* Writings Page */
.writings-page {
  max-width: 880px;
  margin: 0 auto;
}

.page-title {
  font-size: 22px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 8.8px;
}

.page-subtitle {
  font-size: 14.3px;
  opacity: 0.7;
  margin-bottom: 44px;
  font-style: italic;
}

.writings-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.writing-item {
  padding: 26.4px 0;
  border-bottom: 1px dashed #e85d00;
  transition: all 0.2s ease;
}

.dark-mode .writing-item {
  border-color: #ff8c42;
}

.writing-item:last-child {
  border-bottom: none;
}

.writing-item:hover {
  padding-left: 8.8px;
}

.writing-link {
  text-decoration: none;
  display: block;
}

.writing-link:hover .writing-title {
  text-decoration: underline;
}

.writing-title {
  font-size: 17.6px;
  font-weight: 600;
  margin-bottom: 8.8px;
  line-height: 1.4;
}

.writing-meta {
  display: flex;
  gap: 13.2px;
  margin-bottom: 13.2px;
  font-size: 12.1px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  opacity: 0.6;
}

.writing-source,
.writing-date {
  font-size: 12.1px;
}

.writing-excerpt {
  font-size: 14.3px;
  line-height: 1.6;
  opacity: 0.85;
  margin-top: 8.8px;
}

.view-all-link {
  margin-top: 26.4px;
  padding-top: 17.6px;
  border-top: 1px dashed #e85d00;
}

.dark-mode .view-all-link {
  border-color: #ff8c42;
}

.view-all-link a {
  font-size: 13.2px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  text-decoration: none;
}

.view-all-link a:hover {
  text-decoration: underline;
}

/* Blog Entry Page */
.blog-entry {
  max-width: 770px;
  margin: 0 auto 44px;
}

.blog-header {
  margin-bottom: 44px;
}

.back-link {
  display: inline-block;
  font-size: 13.2px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 44px;
  text-decoration: none;
  opacity: 0.7;
  transition: opacity 0.2s ease;
}

.back-link:hover {
  opacity: 1;
}

.blog-title {
  font-size: 26.4px;
  font-weight: 700;
  text-transform: none;
  letter-spacing: 0;
  margin-bottom: 17.6px;
  line-height: 1.3;
}

.blog-meta {
  display: flex;
  gap: 13.2px;
  font-size: 13.2px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  opacity: 0.7;
  margin-bottom: 8.8px;
}

.blog-source,
.blog-date {
  font-size: 13.2px;
}

.blog-content {
  font-size: 15.4px;
  line-height: 1.8;
  margin-top: 44px;
}

.blog-content p {
  margin-bottom: 22px;
}

.blog-content p:last-child {
  margin-bottom: 0;
}

.blog-content a {
  text-decoration: underline;
  text-underline-offset: 2.2px;
}

.blog-content strong {
  font-weight: 600;
}

.blog-content em {
  font-style: italic;
}

.blog-content h2 {
  font-size: 19.8px;
  font-weight: 700;
  margin-top: 44px;
  margin-bottom: 17.6px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.blog-content h3 {
  font-size: 17.6px;
  font-weight: 600;
  margin-top: 35.2px;
  margin-bottom: 13.2px;
}

.blog-content ul,
.blog-content ol {
  margin-left: 26.4px;
  margin-bottom: 22px;
}

.blog-content li {
  margin-bottom: 8.8px;
}

.blog-content blockquote {
  border-left: 2px solid #e85d00;
  padding-left: 22px;
  margin: 22px 0;
  font-style: italic;
  opacity: 0.9;
}

.dark-mode .blog-content blockquote {
  border-color: #ff8c42;
}

.blog-content code {
  background-color: #ffe8d6;
  padding: 2.2px 4.4px;
  border-radius: 2.2px;
  font-size: 13.2px;
  font-family: monospace;
}

.dark-mode .blog-content code {
  background-color: #2a2a2a;
}

.blog-content pre {
  background-color: #ffe8d6;
  padding: 17.6px;
  border-radius: 4.4px;
  overflow-x: auto;
  margin: 22px 0;
  border: 1px solid #e85d00;
}

.dark-mode .blog-content pre {
  background-color: #2a2a2a;
  border-color: #ff8c42;
}

.blog-content pre code {
  background: none;
  padding: 0;
}

@media (max-width: 768px) {
  .blog-title {
    font-size: 22px;
  }
  
  .blog-content {
    font-size: 14.3px;
  }
  
  .writing-title {
    font-size: 15.4px;
  }
}
