/* foryou.reviews - Skeuomorphic Zen Review Platform */
/* Colors from DESIGN.md:
   #5C4A3A Dark Walnut (primary text, shadows)
   #8B7355 Toasted Almond (secondary text, hover, progress)
   #C4A77D Golden Flax (accent, wax seals, highlights)
   #D9CDB8 Parchment (card bg, journal base)
   #E8DFD0 Warm Linen (sanctuary base)
   #A3B18A Dried Sage (nature accents)
   #8E6F5E Terracotta Clay (blobs, card backs)
   #F5F0E8 Cream Vellum (inner card, highlight bg)
   #E8D9C0 Aged Parchment (back face bg)
*/

:root {
  --dark-walnut: #5C4A3A;
  --toasted-almond: #8B7355;
  --golden-flax: #C4A77D;
  --parchment: #D9CDB8;
  --warm-linen: #E8DFD0;
  --dried-sage: #A3B18A;
  --terracotta: #8E6F5E;
  --cream-vellum: #F5F0E8;
  --aged-parchment: #E8D9C0;
}

*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  background: var(--warm-linen);
  color: var(--dark-walnut);
  overflow: hidden;
  height: 100vh;
  width: 100vw;
}

.playfair {
  font-family: 'Playfair Display', Georgia, serif;
}

.source-serif {
  font-family: 'Source Serif 4', 'Georgia', serif;
}

.dm-sans {
  font-family: 'DM Sans', 'Helvetica Neue', sans-serif;
}

/* ===== DIPTYCH LAYOUT ===== */
#diptych {
  display: flex;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  position: relative;
}

/* ===== SANCTUARY (Left Panel) ===== */
#sanctuary {
  width: 45vw;
  height: 100vh;
  position: fixed;
  left: 0;
  top: 0;
  background: var(--warm-linen);
  overflow: hidden;
  z-index: 1;
}

#blob-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}

.blob {
  opacity: 0;
  mix-blend-mode: multiply;
  transition: opacity 1.2s ease-out, fill 0.8s ease;
}

#blob1 { fill: rgba(142, 111, 94, 0.45); }
#blob2 { fill: rgba(196, 167, 125, 0.4); }
#blob3 { fill: rgba(163, 177, 138, 0.35); }

#particle-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
  pointer-events: none;
}

/* ===== JOURNAL (Right Panel) ===== */
#journal {
  width: 55vw;
  margin-left: 45vw;
  height: 100vh;
  overflow-y: auto;
  overflow-x: hidden;
  background: var(--parchment);
  position: relative;
  z-index: 2;
  /* Paper texture via CSS noise */
  background-image:
    radial-gradient(ellipse at 20% 50%, rgba(139, 115, 85, 0.03) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 20%, rgba(196, 167, 125, 0.04) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 80%, rgba(92, 74, 58, 0.02) 0%, transparent 50%);
  background-color: var(--parchment);
}

#journal::-webkit-scrollbar {
  width: 0;
}

/* ===== THRESHOLD (Title) ===== */
#threshold {
  padding: clamp(4rem, 12vh, 8rem) clamp(2rem, 4vw, 4rem) clamp(2rem, 4vh, 4rem);
  min-height: 50vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

#site-title {
  font-family: 'Playfair Display', Georgia, serif;
  font-weight: 700;
  font-size: clamp(3rem, 6vw, 5rem);
  letter-spacing: -0.02em;
  color: var(--dark-walnut);
  line-height: 1.1;
  /* Emboss effect */
  text-shadow: 1px 1px 0px rgba(255,255,255,0.4), -1px -1px 0px rgba(0,0,0,0.1);
}

#site-subtitle {
  font-family: 'DM Sans', sans-serif;
  font-weight: 500;
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--toasted-almond);
  margin-top: 1.5rem;
  opacity: 0;
  transition: opacity 0.6s ease;
}

/* ===== CARD CONTAINER ===== */
#card-container {
  padding: 0 clamp(2rem, 4vw, 4rem) clamp(3rem, 5vh, 6rem);
}

/* ===== REVIEW CARDS ===== */
.review-card {
  perspective: 1200px;
  margin-bottom: clamp(3rem, 5vh, 6rem);
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s ease, transform 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.review-card.visible {
  opacity: 1;
  transform: translateY(0);
}

.review-card.filtered-out {
  opacity: 0;
  transform: scale(0.9);
  height: 0;
  margin: 0;
  overflow: hidden;
  transition: all 0.5s ease;
}

.card-inner {
  position: relative;
  width: 100%;
  min-height: 280px;
  transition: transform 0.6s cubic-bezier(0.4, 0.0, 0.2, 1);
  transform-style: preserve-3d;
  cursor: pointer;
}

.card-inner.flipped {
  transform: rotateY(180deg);
}

.card-front,
.card-back {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  min-height: 280px;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  border-radius: 12px;
  padding: clamp(1.5rem, 3vw, 2.5rem);
  /* Physical card shadow */
  box-shadow:
    4px 4px 12px rgba(92, 74, 58, 0.15),
    1px 1px 3px rgba(92, 74, 58, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.card-front {
  background-color: var(--cream-vellum);
  /* Fresh linen texture */
  background-image:
    radial-gradient(ellipse at 30% 40%, rgba(139, 115, 85, 0.03) 0%, transparent 60%),
    radial-gradient(ellipse at 70% 60%, rgba(196, 167, 125, 0.03) 0%, transparent 60%);
  z-index: 2;
}

.card-back {
  background-color: var(--aged-parchment);
  /* Aged parchment texture */
  background-image:
    radial-gradient(ellipse at 25% 35%, rgba(139, 115, 85, 0.05) 0%, transparent 50%),
    radial-gradient(ellipse at 75% 65%, rgba(92, 74, 58, 0.04) 0%, transparent 50%);
  transform: rotateY(180deg);
  z-index: 1;
  /* Flipped shadow direction */
  box-shadow:
    -4px 4px 12px rgba(92, 74, 58, 0.15),
    -1px 1px 3px rgba(92, 74, 58, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

/* ===== WAX SEALS ===== */
.wax-seal {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--golden-flax);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.2), 0 1px 2px rgba(0,0,0,0.1);
  border: none;
  cursor: pointer;
  color: var(--dark-walnut);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  margin-bottom: 1rem;
}

.wax-seal:hover {
  transform: scale(0.96);
}

.seal-icon {
  width: 20px;
  height: 20px;
}

/* ===== CARD TYPOGRAPHY ===== */
.card-title {
  font-family: 'Playfair Display', Georgia, serif;
  font-weight: 700;
  font-size: clamp(1.8rem, 3.5vw, 3rem);
  letter-spacing: -0.02em;
  color: var(--dark-walnut);
  line-height: 1.2;
  margin-bottom: 1rem;
  /* Emboss / letterpress effect */
  text-shadow: 1px 1px 0px rgba(255,255,255,0.4), -1px -1px 0px rgba(0,0,0,0.1);
}

.card-excerpt {
  font-family: 'Source Serif 4', Georgia, serif;
  font-weight: 400;
  font-size: clamp(1rem, 1.2vw, 1.15rem);
  line-height: 1.72;
  color: var(--dark-walnut);
  margin-bottom: 1.5rem;
}

.card-hint {
  font-family: 'DM Sans', sans-serif;
  font-weight: 500;
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--toasted-almond);
  opacity: 0.6;
}

.card-back-title {
  font-family: 'Playfair Display', Georgia, serif;
  font-weight: 400;
  font-size: clamp(1.4rem, 2.5vw, 2rem);
  letter-spacing: -0.02em;
  color: var(--dark-walnut);
  margin-bottom: 1.5rem;
  text-shadow: 1px 1px 0px rgba(255,255,255,0.3), -1px -1px 0px rgba(0,0,0,0.08);
}

.card-back-text {
  font-family: 'Source Serif 4', Georgia, serif;
  font-weight: 300;
  font-size: clamp(0.9rem, 1.1vw, 1.05rem);
  line-height: 1.85;
  color: var(--dark-walnut);
  margin-bottom: 1.5rem;
}

/* ===== PROGRESS INDICATOR ===== */
#progress-track {
  position: fixed;
  right: 12px;
  top: 10%;
  height: 80%;
  width: 2px;
  background: var(--parchment);
  z-index: 10;
  border-radius: 1px;
}

#progress-fill {
  width: 100%;
  height: 0%;
  background: var(--toasted-almond);
  border-radius: 1px;
  transition: height 0.15s ease;
}

#progress-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--toasted-almond);
  position: absolute;
  left: -2px;
  top: 0;
  transition: top 0.15s ease;
  animation: pulse-attention 2s ease-in-out infinite;
}

@keyframes pulse-attention {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.4); opacity: 0.7; }
}

/* ===== CATEGORY SEAL BUTTON ===== */
#category-seal {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 48px;
  height: 48px;
  z-index: 20;
}

#category-seal .seal-icon {
  width: 24px;
  height: 24px;
}

/* ===== CATEGORY DRAWER ===== */
#category-drawer {
  position: fixed;
  right: -220px;
  top: 0;
  height: 100vh;
  width: 200px;
  background: var(--cream-vellum);
  box-shadow: -4px 0 16px rgba(92, 74, 58, 0.1);
  z-index: 15;
  padding: 4rem 1.5rem 2rem;
  transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

#category-drawer.open {
  right: 0;
}

.drawer-title {
  font-family: 'DM Sans', sans-serif;
  font-weight: 500;
  font-size: 0.7rem;
  letter-spacing: 0.15em;
  color: var(--toasted-almond);
  margin-bottom: 2rem;
}

.category-list {
  list-style: none;
}

.category-list li {
  margin-bottom: 0.75rem;
}

.category-btn {
  background: none;
  border: none;
  font-family: 'DM Sans', sans-serif;
  font-weight: 500;
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--dark-walnut);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0;
  opacity: 0.6;
  transition: opacity 0.3s ease;
}

.category-btn.active,
.category-btn:hover {
  opacity: 1;
}

.cat-seal {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--golden-flax);
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.15);
  display: inline-block;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  #diptych {
    flex-direction: column;
  }

  #sanctuary {
    width: 100vw;
    height: 35vh;
    position: relative;
  }

  #journal {
    width: 100vw;
    margin-left: 0;
    height: 65vh;
  }

  #progress-track {
    display: none;
  }

  #threshold {
    min-height: 30vh;
  }
}
