/* ============================================
   CELLAR — Style-Bleed Transitional Page
   Victorian (top) → Cathedral (bottom)
   ============================================ */

/* --- Page Setup --- */
.cellar-page {
  min-height: 200vh;
  position: relative;
  /* Start with Victorian background, JS transitions to stone */
  background:
    radial-gradient(ellipse at 50% 20%, rgba(139, 122, 58, 0.04) 0%, transparent 50%),
    linear-gradient(180deg, var(--vic-bg) 0%, var(--stone-bg) 50%, #0a0806 100%);
  background-color: var(--vic-bg);
  transition: background-color 2s ease;
}

.cellar-column {
  max-width: 640px;
  margin: 0 auto;
  padding: 60px 24px 80px;
}

/* --- Title — Between Two Styles --- */
.cellar-title {
  font-family: var(--font-serif);
  font-size: 2rem;
  font-weight: 400;
  font-style: italic;
  color: var(--cream);
  text-align: center;
  letter-spacing: 0.08em;
  transition: color 2s ease, letter-spacing 2s ease;
}

.cellar-title.stone-mode {
  color: var(--stone-text);
  letter-spacing: 0.12em;
  font-weight: 700;
  font-style: normal;
}

.cellar-subtitle {
  font-family: var(--font-serif);
  font-size: 0.8rem;
  font-style: italic;
  color: var(--vic-dim);
  text-align: center;
  letter-spacing: 0.15em;
  margin-top: 6px;
  transition: color 2s ease;
}

/* --- Section Spacing --- */
.cellar-section {
  margin-bottom: 40px;
}

/* --- Text Styles — Victorian Zone --- */
.cellar-text {
  margin-bottom: 24px;
}

.cellar-text p {
  text-indent: 1.5em;
  margin-bottom: 14px;
}

.cellar-text p:first-child {
  text-indent: 0;
}

.cellar-text em {
  color: var(--cream);
}

/* --- Text Styles — Transition Zone --- */
.cellar-text-transition {
  font-family: var(--font-serif);
  font-size: 0.95rem;
  line-height: 1.9;
  color: var(--vic-text);
  transition: color 1s ease;
}

.cellar-text-transition em {
  color: var(--cream);
}

/* --- Text Styles — Stone Zone --- */
.cellar-text-stone {
  font-family: var(--font-serif);
  font-size: 1rem;
  line-height: 1.9;
  color: var(--stone-text);
  text-align: justify;
}

.cellar-text-stone em {
  color: var(--amber-glow);
}

.cellar-text-stone strong {
  color: var(--stone-text);
  letter-spacing: 0.2em;
  font-weight: 700;
}

/* --- Transition Dividers --- */
.cellar-divider-transition {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin: 32px 0;
  color: var(--vic-dim);
  font-size: 0.8rem;
  transition: color 1s ease;
}

.cellar-divider-transition::before,
.cellar-divider-transition::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--vic-border), transparent);
  transition: background 1s ease;
}

/* --- Scroll Reveal --- */
.cellar-reveal {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 1.2s ease, transform 1.2s ease;
}

.cellar-reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* === THE BOX === */
.cellar-box-container {
  display: flex;
  justify-content: center;
  margin: 40px 0;
}

.cellar-box {
  width: 240px;
  height: 180px;
  cursor: pointer;
  position: relative;
}

.box-surface {
  width: 100%;
  height: 100%;
  background: linear-gradient(
    135deg,
    #1a1614 0%,
    #2a2420 30%,
    #1e1a16 50%,
    #161210 70%,
    #1a1614 100%
  );
  border: 2px solid var(--stone-border);
  box-shadow:
    inset 0 0 20px rgba(0, 0, 0, 0.6),
    0 4px 16px rgba(0, 0, 0, 0.5);
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: border-color 0.5s, box-shadow 0.5s;
}

.box-surface:hover {
  border-color: var(--amber);
  box-shadow:
    inset 0 0 20px rgba(0, 0, 0, 0.6),
    0 4px 16px rgba(0, 0, 0, 0.5),
    0 0 20px rgba(139, 107, 26, 0.08);
}

/* --- Frost Effect --- */
.box-frost {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(
    ellipse at 50% 50%,
    rgba(180, 200, 220, 0.06) 0%,
    transparent 70%
  );
  pointer-events: none;
}

/* --- Engravings --- */
.box-engravings {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

.box-number {
  font-family: var(--font-mono);
  font-size: 1.2rem;
  color: var(--stone-dim);
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--stone-border);
  cursor: pointer;
  transition: color 0.3s, border-color 0.3s, background 0.3s;
  user-select: none;
}

.box-number:hover {
  color: var(--amber-glow);
  border-color: var(--amber);
}

.box-number.activated {
  color: var(--amber-glow);
  border-color: var(--amber);
  background: rgba(139, 107, 26, 0.1);
  text-shadow: 0 0 6px rgba(187, 154, 42, 0.3);
}

.box-number.complete {
  color: var(--gold-bright);
  border-color: var(--gold-bright);
  background: rgba(139, 122, 58, 0.15);
}

/* --- Box Instruction --- */
.box-instruction {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 0.65rem;
  color: var(--stone-dim);
  letter-spacing: 0.1em;
  opacity: 0.5;
  transition: opacity 0.5s;
}

/* --- Box Progress --- */
.box-progress {
  font-family: var(--font-mono);
  font-size: 0.5rem;
  color: var(--amber);
  letter-spacing: 0.3em;
  margin-top: 8px;
  min-height: 12px;
}

/* --- Box Result --- */
.cellar-box-result {
  text-align: center;
  margin: 24px 0;
  opacity: 0;
  transition: opacity 1.5s ease;
}

.cellar-box-result.visible {
  opacity: 1;
}

.cellar-box-result .box-word {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--amber-glow);
  letter-spacing: 0.3em;
  text-shadow: 0 0 12px rgba(187, 154, 42, 0.2);
  display: block;
  margin-bottom: 16px;
}

.cellar-box-result .box-desc {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 0.8rem;
  color: var(--stone-text);
  line-height: 1.8;
  margin-bottom: 16px;
}

.cellar-box-result .box-link {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 0.75rem;
  color: var(--amber);
  border-bottom: 1px solid var(--stone-border);
  transition: color 0.4s, border-color 0.4s;
}

.cellar-box-result .box-link:hover {
  color: var(--amber-glow);
  border-bottom-color: var(--amber);
}

/* --- Box Unlocked State --- */
.cellar-box.unlocked .box-surface {
  border-color: var(--amber);
  box-shadow:
    inset 0 0 20px rgba(139, 107, 26, 0.1),
    0 4px 16px rgba(0, 0, 0, 0.5),
    0 0 30px rgba(139, 107, 26, 0.1);
}

.cellar-box.unlocked .box-frost {
  opacity: 0;
  transition: opacity 2s ease;
}

/* === LINKS === */
.cellar-links {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  margin: 40px 0;
}

.cellar-link-crypt {
  font-family: var(--font-serif);
  font-size: 0.85rem;
  color: var(--stone-text);
  border-bottom: 1px solid var(--stone-border);
  transition: color 0.4s, border-color 0.4s;
  letter-spacing: 0.05em;
}

.cellar-link-crypt:hover {
  color: var(--amber-glow);
  border-bottom-color: var(--amber);
}

.cellar-link-parlor {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 0.65rem;
  color: var(--stone-dim);
  opacity: 0.3;
  transition: opacity 0.4s, color 0.4s;
}

.cellar-link-parlor:hover {
  opacity: 0.6;
  color: var(--vic-text);
}

/* --- Footer --- */
.cellar-footer {
  text-align: center;
  margin-top: 60px;
  padding-bottom: 40px;
}

.depth-marker {
  font-family: var(--font-mono);
  font-size: 0.45rem;
  color: var(--vic-faint);
  letter-spacing: 0.4em;
  margin-top: 32px;
  opacity: 0.15;
}

/* --- Mobile --- */
@media (max-width: 768px) {
  .cellar-column {
    padding: 40px 16px 60px;
  }

  .cellar-box {
    width: 200px;
    height: 150px;
  }

  .box-number {
    font-size: 1rem;
    width: 24px;
    height: 24px;
  }
}
