/* ===========================
   RESET & BASE
   =========================== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Inter', system-ui, sans-serif;
  background: #f5f0e8;
  color: #1a1a1a;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ===========================
   HERO
   =========================== */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: #1a1a2e;
  color: #fff;
  overflow: hidden;
  padding: 2rem;
}

.hero-bg {
  position: absolute; inset: 0; overflow: hidden; z-index: 0;
}
.floating-shape {
  position: absolute;
  border-radius: 50%;
  opacity: 0.08;
  animation: floatShape 12s ease-in-out infinite;
}
.s1 { width: 500px; height: 500px; background: #e74c3c; top: -100px; left: -150px; animation-delay: 0s; }
.s2 { width: 400px; height: 400px; background: #3498db; bottom: -100px; right: -100px; animation-delay: -4s; }
.s3 { width: 300px; height: 300px; background: #f39c12; top: 40%; left: 60%; animation-delay: -8s; }

@keyframes floatShape {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-30px) rotate(10deg); }
}

.hero-content {
  position: relative; z-index: 1;
  text-align: center;
  max-width: 700px;
}
.hero-eyebrow {
  font-size: 0.85rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.5);
  margin-bottom: 1rem;
}
.hero-name {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: clamp(4rem, 12vw, 9rem);
  line-height: 0.9;
  font-weight: 700;
  margin-bottom: 1.5rem;
}
.hero-name em {
  font-style: italic;
  color: #e8c49a;
}
.hero-tagline {
  font-size: clamp(1rem, 2.5vw, 1.3rem);
  color: rgba(255,255,255,0.7);
  line-height: 1.6;
  margin-bottom: 2.5rem;
}
.cta-btn {
  display: inline-block;
  padding: 1rem 2.5rem;
  background: #e8c49a;
  color: #1a1a2e;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 0.05em;
  border-radius: 4px;
  transition: transform 0.2s, box-shadow 0.2s;
}
.cta-btn:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0,0,0,0.3); }

.hero-stats {
  position: relative; z-index: 1;
  display: flex; gap: 3rem;
  margin-top: 4rem;
}
.stat { display: flex; flex-direction: column; align-items: center; }
.stat-num {
  font-family: 'Playfair Display', serif;
  font-size: 2.2rem;
  font-weight: 700;
  color: #e8c49a;
}
.stat-label { font-size: 0.8rem; letter-spacing: 0.1em; color: rgba(255,255,255,0.5); text-transform: uppercase; }

/* ===========================
   SHELF SECTION
   =========================== */
.shelf-section {
  background: linear-gradient(180deg, #f5f0e8 0%, #ede8dc 100%);
  padding: 5rem 2rem 4rem;
  min-height: 100vh;
}
.shelf-header {
  text-align: center;
  margin-bottom: 3rem;
}
.shelf-header h2 {
  font-family: 'Playfair Display', serif;
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  color: #2c2416;
  margin-bottom: 0.5rem;
}
.shelf-header p {
  color: #7a6e5f;
  font-size: 1.1rem;
}

.bookshelf-wrap {
  max-width: 1200px;
  margin: 0 auto;
  position: relative;
}

.shelf-decor {
  position: absolute;
  bottom: -10px;
  right: 2rem;
  display: flex; gap: 1rem;
  font-size: 2rem;
  opacity: 0.5;
  pointer-events: none;
}

/* ===========================
   SHELF ROW
   =========================== */
.shelf-row {
  display: flex;
  align-items: flex-end;
  margin-bottom: 2.5rem;
  position: relative;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s, transform 0.5s;
}
.shelf-row.visible { opacity: 1; transform: translateY(0); }

.shelf-label {
  width: 120px;
  min-width: 120px;
  font-family: 'Space Mono', monospace;
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #9a8e7f;
  text-align: right;
  padding-right: 1.5rem;
  padding-bottom: 1.5rem;
}

.books-row {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  flex: 1;
  padding-bottom: 0;
}

.shelf-plank {
  position: absolute;
  bottom: 0;
  left: 120px;
  right: 0;
  height: 18px;
  background: linear-gradient(180deg, #c4a97a 0%, #a8855a 40%, #8b6a3a 100%);
  border-radius: 3px;
  box-shadow: 0 6px 20px rgba(0,0,0,0.25), inset 0 1px 0 rgba(255,255,255,0.2);
}

/* ===========================
   BOOK
   =========================== */
.book {
  --spine-color: #333;
  --page-color: #fff;
  position: relative;
  cursor: pointer;
  transform-origin: bottom center;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  opacity: 0;
  margin-bottom: 18px; /* sits on plank */
  /* 3D perspective per book */
}
.book.visible { opacity: 1; }
.book:hover { transform: translateY(-12px) rotate(-1deg); }

/* Book spine (visible part on shelf) */
.book-spine {
  width: 42px;
  height: 160px;
  background: var(--spine-color);
  border-radius: 3px 0 0 3px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  position: relative;
  box-shadow:
    inset -3px 0 8px rgba(0,0,0,0.3),
    2px 0 0 rgba(255,255,255,0.05),
    4px 0 0 rgba(0,0,0,0.1),
    6px 2px 12px rgba(0,0,0,0.3);
  transition: box-shadow 0.3s;
}
.book:hover .book-spine {
  box-shadow:
    inset -3px 0 8px rgba(0,0,0,0.4),
    2px 0 0 rgba(255,255,255,0.05),
    8px 4px 20px rgba(0,0,0,0.4);
}

.spine-title {
  writing-mode: vertical-rl;
  text-orientation: mixed;
  transform: rotate(180deg);
  font-family: 'Inter', sans-serif;
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: rgba(255,255,255,0.9);
  text-transform: uppercase;
  max-height: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.spine-year {
  font-family: 'Space Mono', monospace;
  font-size: 0.55rem;
  color: rgba(255,255,255,0.5);
}

/* Book cover (hidden, shown on hover hint) */
.book-cover {
  display: none;
}

/* Tall book variant */
.book:nth-child(odd) .book-spine { height: 175px; }
.book:nth-child(3n) .book-spine { height: 145px; }

/* ===========================
   BOOK READER MODAL
   =========================== */
.book-reader-overlay {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(10, 10, 20, 0.85);
  backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  opacity: 0;
  transition: opacity 0.4s;
}
.book-reader-overlay.open { display: flex; }
.book-reader-overlay.visible { opacity: 1; }

.book-reader {
  position: relative;
  width: 100%;
  max-width: 900px;
  max-height: 90vh;
  transform: scale(0.92) translateY(20px);
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.book-reader-overlay.visible .book-reader { transform: scale(1) translateY(0); }

.reader-close {
  position: absolute;
  top: -3rem;
  right: 0;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.2);
  color: #fff;
  font-size: 1.1rem;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.2s;
}
.reader-close:hover { background: rgba(255,255,255,0.25); }

.reader-book-wrap {
  display: flex;
  height: 68vh;
  max-height: 580px;
  box-shadow: 0 40px 80px rgba(0,0,0,0.6), 0 0 0 1px rgba(255,255,255,0.05);
  border-radius: 4px;
  overflow: hidden;
  position: relative;
}

/* Pages */
.reader-page {
  flex: 1;
  overflow: hidden;
  position: relative;
  background: #fdfaf5;
}
.left-page {
  border-radius: 4px 0 0 4px;
}
.right-page {
  border-radius: 0 4px 4px 0;
}

.page-content {
  height: 100%;
  overflow-y: auto;
  padding: 2.5rem;
  scrollbar-width: thin;
  scrollbar-color: #ccc transparent;
}
.page-content::-webkit-scrollbar { width: 4px; }
.page-content::-webkit-scrollbar-track { background: transparent; }
.page-content::-webkit-scrollbar-thumb { background: #ccc; border-radius: 4px; }

.page-number {
  position: absolute;
  bottom: 0.8rem;
  font-family: 'Space Mono', monospace;
  font-size: 0.65rem;
  color: #aaa;
}
.left-num { right: 1.5rem; }
.right-num { left: 1.5rem; }

/* Center spine */
.reader-spine {
  width: 18px;
  min-width: 18px;
  background: #333;
  box-shadow: inset -3px 0 6px rgba(0,0,0,0.4), inset 3px 0 6px rgba(0,0,0,0.4);
  position: relative;
  z-index: 2;
}
.reader-spine::before, .reader-spine::after {
  content: '';
  position: absolute;
  top: 0; bottom: 0;
  width: 3px;
  background: rgba(255,255,255,0.05);
}
.reader-spine::before { left: 4px; }
.reader-spine::after { right: 4px; }

/* Page turn animation layer */
.page-turn-layer {
  position: absolute;
  top: 0; right: 0; bottom: 0;
  width: 100%;
  pointer-events: none;
  transform-origin: left center;
  perspective: 1000px;
}
.page-turn-layer.turning-forward {
  animation: turnForward 0.5s ease-in-out;
}
.page-turn-layer.turning-backward {
  animation: turnBackward 0.5s ease-in-out;
}
@keyframes turnForward {
  0% { background: transparent; transform: rotateY(0deg); }
  30% { background: rgba(0,0,0,0.12); }
  100% { background: transparent; transform: rotateY(-20deg); }
}
@keyframes turnBackward {
  0% { background: transparent; transform: rotateY(0deg); }
  30% { background: rgba(0,0,0,0.1); }
  100% { background: transparent; transform: rotateY(20deg); }
}

/* Reader controls */
.reader-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  margin-top: 1.2rem;
}
.page-btn {
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.2);
  color: #fff;
  padding: 0.6rem 1.4rem;
  font-size: 0.9rem;
  border-radius: 4px;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  font-weight: 500;
  transition: background 0.2s, transform 0.1s;
  letter-spacing: 0.03em;
}
.page-btn:not(:disabled):hover { background: rgba(255,255,255,0.22); transform: scale(1.03); }
.page-btn:disabled { cursor: default; }
.page-indicator {
  font-family: 'Space Mono', monospace;
  font-size: 0.75rem;
  color: rgba(255,255,255,0.5);
  min-width: 60px;
  text-align: center;
}

/* ===========================
   PAGE CONTENT TYPES
   =========================== */
.pg { height: 100%; display: flex; flex-direction: column; }

/* Cover page */
.pg-cover { align-items: flex-start; justify-content: flex-end; padding-bottom: 0.5rem; }
.pg-cover-icon { font-size: 3.5rem; margin-bottom: 1rem; }
.pg-cover-title {
  font-family: 'Playfair Display', serif;
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  font-weight: 700;
  line-height: 1.1;
  margin-bottom: 0.4rem;
  color: #1a1a1a;
}
.pg-cover-subtitle { font-size: 0.9rem; color: #888; margin-bottom: 1rem; font-weight: 500; }
.pg-cover-desc { font-size: 0.9rem; color: #555; line-height: 1.6; margin-bottom: 1.2rem; }
.pg-tags { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.pg-tag {
  font-size: 0.7rem;
  padding: 0.3rem 0.7rem;
  background: rgba(0,0,0,0.07);
  border-radius: 2rem;
  color: #555;
  font-weight: 500;
}

/* Cover left panel */
.cover-left-inner {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2.5rem;
}
.cover-left-content { color: #fff; }
.cover-cat { font-size: 0.75rem; letter-spacing: 0.2em; text-transform: uppercase; opacity: 0.6; margin-bottom: 1rem; }
.cover-title {
  font-family: 'Playfair Display', serif;
  font-size: clamp(1.8rem, 4vw, 3rem);
  font-weight: 700;
  line-height: 1.05;
  margin-bottom: 0.5rem;
}
.cover-year { font-family: 'Space Mono', monospace; font-size: 0.9rem; opacity: 0.6; margin-bottom: 1.5rem; }
.cover-divider { width: 40px; height: 2px; background: rgba(255,255,255,0.4); margin-bottom: 1.5rem; }
.cover-hint { font-size: 0.85rem; opacity: 0.5; font-style: italic; }

/* Brief page */
.pg-brief {}
.pg-heading {
  font-family: 'Playfair Display', serif;
  font-size: 1.4rem;
  margin-bottom: 1rem;
  color: #1a1a1a;
}
.pg-body { font-size: 0.88rem; line-height: 1.75; color: #444; margin-bottom: 1.5rem; }
.pg-quote {
  border-left: 3px solid currentColor;
  padding: 0.8rem 1rem;
  margin: 1rem 0;
  background: rgba(0,0,0,0.03);
  border-radius: 0 4px 4px 0;
}
.pg-quote p { font-style: italic; font-size: 0.88rem; color: #555; margin-bottom: 0.4rem; line-height: 1.6; }
.pg-quote cite { font-size: 0.75rem; color: #888; font-style: normal; }

/* Palette page */
.pg-palette {}
.pg-intro { font-size: 0.88rem; color: #666; line-height: 1.6; margin-bottom: 1.2rem; }
.color-swatches { display: flex; flex-wrap: wrap; gap: 0.8rem; }
.swatch { display: flex; flex-direction: column; align-items: center; width: calc(20% - 0.64rem); min-width: 52px; }
.swatch-color {
  width: 100%;
  padding-top: 100%;
  border-radius: 6px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  margin-bottom: 0.4rem;
}
.swatch-hex { font-family: 'Space Mono', monospace; font-size: 0.6rem; color: #888; }
.swatch-name { font-size: 0.65rem; color: #aaa; text-align: center; }

/* Typography page */
.pg-type {}
.font-specs { margin-bottom: 1rem; }
.font-spec {
  border: 1px solid #eee;
  border-radius: 6px;
  padding: 1rem;
  margin-bottom: 0.8rem;
}
.font-name { font-size: 1.3rem; font-weight: 600; color: #1a1a1a; margin-bottom: 0.3rem; }
.font-role { font-size: 0.78rem; color: #888; }
.pg-note { font-size: 0.82rem; color: #777; font-style: italic; line-height: 1.6; padding: 0.8rem; background: rgba(0,0,0,0.03); border-radius: 6px; }

/* Mockups page */
.pg-mockups {}
.mockup-grid { display: flex; flex-direction: column; gap: 0.7rem; }
.mockup-item {
  display: flex;
  align-items: flex-start;
  gap: 0.8rem;
  padding: 0.8rem;
  background: rgba(0,0,0,0.03);
  border-radius: 6px;
  border: 1px solid rgba(0,0,0,0.06);
}
.mockup-icon { font-size: 1.6rem; flex-shrink: 0; }
.mockup-info strong { display: block; font-size: 0.85rem; color: #1a1a1a; margin-bottom: 0.2rem; }
.mockup-info p { font-size: 0.78rem; color: #777; line-height: 1.5; }

/* Outcome page */
.pg-outcome {}
.outcome-stats {
  display: flex;
  gap: 0.8rem;
  margin: 1rem 0 1.2rem;
  flex-wrap: wrap;
}
.outcome-stat {
  flex: 1;
  min-width: 70px;
  text-align: center;
  padding: 1rem 0.5rem;
  background: rgba(0,0,0,0.04);
  border-radius: 8px;
  border: 1px solid rgba(0,0,0,0.06);
}
.outcome-num {
  display: block;
  font-family: 'Playfair Display', serif;
  font-size: 1.4rem;
  font-weight: 700;
  color: #1a1a1a;
}
.outcome-label { font-size: 0.7rem; color: #888; }

/* End page */
.pg-end {
  align-items: center;
  justify-content: center;
  text-align: center;
}
.end-inner {}
.end-thanks { font-family: 'Playfair Display', serif; font-style: italic; font-size: 1.2rem; color: #888; margin-bottom: 1.5rem; }
.end-cta { font-size: 0.9rem; color: #555; margin-bottom: 0.8rem; }
.end-link {
  display: inline-block;
  padding: 0.7rem 1.6rem;
  background: #1a1a2e;
  color: #fff;
  text-decoration: none;
  border-radius: 4px;
  font-size: 0.85rem;
  font-weight: 600;
  transition: opacity 0.2s;
}
.end-link:hover { opacity: 0.85; }

/* ===========================
   ABOUT STRIP
   =========================== */
.about-strip {
  background: #1a1a2e;
  padding: 5rem 2rem;
  color: #fff;
}
.about-inner {
  max-width: 1000px;
  margin: 0 auto;
  display: flex;
  gap: 4rem;
  align-items: center;
}
.about-text { flex: 1; }
.about-text h2 {
  font-family: 'Playfair Display', serif;
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  margin-bottom: 1.2rem;
  color: #e8c49a;
}
.about-text p { font-size: 1rem; line-height: 1.8; color: rgba(255,255,255,0.7); margin-bottom: 1.5rem; }
.skills-pills { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.skills-pills span {
  padding: 0.4rem 0.9rem;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 2rem;
  font-size: 0.8rem;
  color: rgba(255,255,255,0.7);
}

.about-portrait { flex-shrink: 0; }
.portrait-frame {
  width: 200px;
  height: 200px;
  border-radius: 50%;
  background: linear-gradient(135deg, #e8c49a, #c0392b);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 20px 60px rgba(0,0,0,0.4);
}
.portrait-placeholder {
  font-family: 'Playfair Display', serif;
  font-size: 5rem;
  font-weight: 700;
  color: #fff;
  line-height: 1;
}

/* ===========================
   CONTACT FOOTER
   =========================== */
.contact-footer {
  background: #0f0f1a;
  color: #fff;
  padding: 5rem 2rem;
  text-align: center;
}
.contact-footer h2 {
  font-family: 'Playfair Display', serif;
  font-size: clamp(1.8rem, 4vw, 3rem);
  margin-bottom: 1.5rem;
  color: #e8c49a;
}
.contact-email {
  display: block;
  font-size: 1.2rem;
  color: rgba(255,255,255,0.7);
  text-decoration: none;
  margin-bottom: 2rem;
  transition: color 0.2s;
}
.contact-email:hover { color: #e8c49a; }
.social-links { display: flex; justify-content: center; gap: 2rem; margin-bottom: 3rem; }
.social-links a {
  color: rgba(255,255,255,0.4);
  text-decoration: none;
  font-size: 0.9rem;
  letter-spacing: 0.05em;
  transition: color 0.2s;
}
.social-links a:hover { color: #fff; }
.footer-copy { font-size: 0.75rem; color: rgba(255,255,255,0.25); }

/* ===========================
   RESPONSIVE
   =========================== */
@media (max-width: 768px) {
  .shelf-label { width: 70px; min-width: 70px; font-size: 0.6rem; padding-right: 0.8rem; }
  .shelf-plank { left: 70px; }
  .book-spine { width: 34px; height: 130px !important; }
  .spine-title { font-size: 0.55rem; }

  .reader-book-wrap { height: 55vh; flex-direction: column; }
  .left-page { border-radius: 4px 4px 0 0; }
  .right-page { border-radius: 0 0 4px 4px; }
  .reader-spine { width: 100%; height: 12px; min-width: unset; }
  .reader-spine::before, .reader-spine::after { display: none; }

  .about-inner { flex-direction: column; gap: 2rem; }
  .about-portrait { display: none; }

  .hero-stats { gap: 1.5rem; }

  .page-content { padding: 1.5rem; }
}

@media (max-width: 480px) {
  .books-row { gap: 4px; }
  .book-spine { width: 28px; }
  .spine-title { font-size: 0.5rem; }
}
