body {
  margin: 0;
  overflow: hidden;
  height: 100vh;
  background: linear-gradient(to bottom, #d4dceb 0%, #f5e9d7 100%);
  display: flex;
  justify-content: center;
  align-items: center;
}

canvas.neural-bg {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 1;
  width: 100vw;
  pointer-events: none;
}

.book {
  position: relative;
  z-index: 2;
  width: 1000px;
  height: 560px;
  perspective: 2000px;
  transition: transform 2s ease, width 2s ease, height 2s ease, box-shadow 2s ease 1s;
  background: transparent;
  display: flex;
}

.book.zoomed {
  width: 90vw;
  height: 90vh;
  transform: none;
  border-radius: 0;
  box-shadow: 0 60px 120px rgba(0, 0, 0, 0.5);
}

.book.minimized {
  width: 200px;
  height: 120px;
  position: fixed;
  top: 10px;
  right: 20px;
  transform: scale(0.6);
  box-shadow: 0 2px 10px rgba(0,0,0,0.2);
  transition: all 1.5s ease;
  cursor: pointer;
}

.book.minimized .back-link {
  font-size: 12px;
  width: 80px;
  margin-bottom: 8px;
  transform: translateY(0) !important;
}

.book.minimized .menu-list {
  width: 80px;
  gap: 4px;
}

.book.minimized .menu-item {
  font-size: 8px;
}

.book.minimized .content-wrapper {
  transform: scale(0.6);
  transform-origin: center center;
  padding-top: 5%; /* Add some padding to move content down */
}

.book.minimized .logo-link,
.book.minimized .menu-item {
  pointer-events: none;
}

.section-title {
  font-family: 'Courier New', monospace;
  font-size: 48px;
  color: rgba(51, 51, 51, 0.9);
  position: absolute;
  top: 65px;
  left: 80px;
  transform: none;
  z-index: 3;
  opacity: 0;
  transition: opacity 0.6s ease;
  margin: 0;
  padding: 0;
}

.section-title.visible {
  opacity: 1;
}

.page-right {
  width: 50%;
  height: 100%;
  position: absolute;
  right: 0;
  top: 0;
  background: linear-gradient(to left,
    #d8d8d8 0%,
    #ffffff 35%,
    #fdfdfd 70%,
    #eaeaea 100%);
  box-shadow: inset 0 0 10px rgba(0,0,0,0.05);
  display: flex;
  justify-content: center;
  align-items: center;
}

.logo-link {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  height: 100%;
}

.center-logo {
  max-width: 60%;
  max-height: 60%;
  object-fit: contain;
  cursor: pointer;
  transition: transform 0.3s ease;
}

.center-logo:hover {
  transform: scale(1.05);
}

.cover-wrapper {
  position: absolute;
  width: 50%;
  height: 100%;
  right: 0;
  top: 0;
  transform-origin: left center;
  transform-style: preserve-3d;
  transition: transform 2s ease;
  z-index: 5;
}

.cover-face {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  border-radius: 4px;
}

.cover-face.front {
  background-size: cover;
  background-position: center;
  box-shadow: 5px 0 15px rgba(0,0,0,0.3);
  transition: background-image 1s ease-in-out;
}

.cover-face.back {
  background: linear-gradient(to right,
    #d8d8d8 0%,
    #ffffff 35%,
    #fdfdfd 70%,
    #eaeaea 100%);
  border: 1px solid #ccc;
  transform: rotateY(180deg);
  box-shadow: inset 0 0 10px rgba(0,0,0,0.05);
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
}

/* Only show pointer cursor before first interaction */
.cover-face.back:not(.menu-visible) {
  cursor: pointer;
}

.cover-wrapper.flipped {
  transform: rotateY(-180deg);
}

.content-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  padding-top: 0;
}

.back-link {
  font-family: 'Courier New', Courier, monospace;
  font-size: 32px;
  color: #333;
  text-decoration: none;
  text-align: center;
  margin-bottom: 40px;
  width: 220px; /* Increased width to accommodate "Tinke Studio" in one line */
  transform: translateY(60px);
  transition: all 0.5s ease, color 0.3s ease;
  white-space: nowrap; /* Prevent text wrapping */
}

/* Only show pointer cursor before first interaction */
.back-link:not(.moved) {
  cursor: pointer;
}

.back-link:hover {
  color: #666;
}

.back-link.moved {
  transform: translateY(0);
}

.menu-list {
  display: flex;
  flex-direction: column;
  gap: 20px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.5s ease;
  text-align: left;
  width: 220px; /* Match the width of the title */
}

.menu-list.visible {
  opacity: 1;
  visibility: visible;
}

.menu-item {
  font-family: 'Courier New', Courier, monospace;
  font-size: 24px;
  color: #333;
  text-decoration: none;
  cursor: pointer;
  overflow: hidden;
  white-space: nowrap;
  width: 0;
  transition: width 0.8s ease-out;
}

.menu-item.typing {
  width: 100%;
}

.menu-item:hover {
  color: #666;
}

.portfolio-gallery {
  position: absolute;
  top: 55%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 3;
  padding: 2rem 2rem 2rem 0;
  opacity: 0;
  width: 90vw;
  max-width: 1400px;
  overflow-x: auto;
  white-space: nowrap;
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none;  /* IE and Edge */
  transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
}

.portfolio-gallery::-webkit-scrollbar {
  display: none; /* Chrome, Safari and Opera */
}

.categories-wrapper {
  display: inline-flex;
  gap: 2rem;
  padding: 1rem;
  align-items: stretch;
}

.portfolio-gallery.visible {
  opacity: 1;
  transform: translate(-50%, -50%);
}

.category-card {
  background: rgba(255, 255, 255, 0.95);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
  backdrop-filter: blur(5px);
  width: 300px;
  display: inline-block;
  vertical-align: top;
  white-space: normal;
}

.category-card:hover {
  transform: scale(1.03);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
  background: rgba(255, 255, 255, 0.98);
}

.category-image {
  width: 100%;
  height: 300px;
  overflow: hidden;
}

.category-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.category-card:hover .category-image img {
  transform: scale(1.05);
}

.category-info {
  padding: 20px;
}

.category-info h2 {
  font-family: 'Courier New', monospace;
  font-size: 24px;
  color: #333;
  margin: 0 0 10px 0;
}

.category-info p {
  font-family: 'Courier New', monospace;
  font-size: 14px;
  color: #666;
  margin: 0 0 20px 0;
  line-height: 1.5;
}

.steno-link {
  color: #333;
  text-decoration: none;
  display: inline-block;
  margin-top: 8px;
  transition: color 0.3s ease;
  border-bottom: 1px solid transparent;
}

.steno-link:hover {
  color: #666;
  border-bottom: 1px solid #666;
}

.view-more {
  font-family: 'Courier New', monospace;
  background: none;
  border: 2px solid #333;
  padding: 8px 20px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.view-more:hover {
  background: #333;
  color: white;
}

.gallery-back-btn {
  position: absolute;
  top: 20px;
  left: 20px;
  font-family: 'Courier New', monospace;
  background: rgba(255, 255, 255, 0.95);
  border: none;
  padding: 10px 20px;
  border-radius: 4px;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
  transition: all 0.3s ease;
  z-index: 4;
  backdrop-filter: blur(5px);
}

.gallery-back-btn:hover {
  transform: translateX(-3px);
  box-shadow: 0 4px 15px rgba(0,0,0,0.2);
  background: rgba(255, 255, 255, 0.98);
}

.image-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 20px;
  padding: 60px 20px 20px 20px;
}

.gallery-item {
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.5s ease;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  background: white;
  aspect-ratio: 1;
}

.gallery-item.visible {
  opacity: 1;
  transform: translateY(0);
}

.gallery-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.gallery-item:hover img {
  transform: scale(1.1);
}

.gallery-item .loading,
.gallery-item .error {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f5f5f5;
  color: #666;
  font-family: 'Courier New', monospace;
}

.gallery-item .error {
  background: #fee;
  color: #c00;
}

.gallery-close {
  position: fixed;
  top: 20px;
  right: 20px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: white;
  border: none;
  font-size: 24px;
  color: #333;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
}

.gallery-close:hover {
  transform: scale(1.1);
  box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

/* About Us section styles */
.about-section {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 80%;
  max-width: 1000px;
  background: rgba(255, 255, 255, 0.95);
  padding: 40px;
  border-radius: 12px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  opacity: 0;
  transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  backdrop-filter: blur(5px);
}

.about-section.visible {
  opacity: 1;
}

.about-section img {
  width: 100%;
  height: 400px;
  object-fit: cover;
  border-radius: 8px;
  margin-bottom: 30px;
}

.about-section p {
  font-family: 'Courier New', monospace;
  font-size: 16px;
  line-height: 1.6;
  color: #333;
  margin: 0;
  text-align: justify;
}
