/* ===== RESET & BASE ===== */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --parchment: #f3e8d0;
  --parchment-deep: #e8d5a3;
  --ink: #1a1208;
  --ink-light: #3d2e1c;
  --gold: #c49a2b;
  --gold-dim: #8b6914;
  --crimson: #6b1d1d;
  --crimson-glow: #a83232;
  --ember: #e8651a;
  --ember-dim: #8b3a0e;
  --frost: #b8d4e3;
  --frost-deep: #2c4a5e;
  --shadow: rgba(0, 0, 0, 0.7);
  --card-width: 40px;
  --card-height: 550px;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: 'EB Garamond', 'Georgia', serif;
  background: #0d0905;
  color: var(--parchment);
  line-height: 1.6;
  overflow-x: hidden;
  position: relative;
}

/* ===== EMBER CANVAS ===== */
#ember-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  opacity: 0.7;
}

/* ===== AMBIENT PARTICLES ===== */
.ambient-particles {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
  overflow: hidden;
}

.particle {
  position: absolute;
  background: radial-gradient(circle, rgba(212, 175, 55, 0.3), transparent);
  border-radius: 50%;
  animation: floatParticle linear infinite;
}

@keyframes floatParticle {
  0% {
    transform: translateY(0) translateX(0) scale(1);
    opacity: 0.3;
  }
  50% {
    transform: translateY(-100px) translateX(20px) scale(1.5);
    opacity: 0.6;
  }
  100% {
    transform: translateY(-200px) translateX(-20px) scale(0.5);
    opacity: 0;
  }
}

/* ===== DECORATION IMAGES :: HERO SECTION ===== */
.hero-top-right-image {
  position: absolute;
  top: -50px;
  right: -50px;
  width: 550px;
  height: 550px;
  z-index: 1;
  object-fit: cover;
  opacity: 0.6;
  filter: blur(1px);
  animation: floatImages 20s ease-in-out infinite;
}

.hero-top-left-image {
  position: absolute;
  top: -50px;
  left: -50px;
  width: 550px;
  height: 550px;
  z-index: 1;
  object-fit: cover;
  opacity: 0.6;
  filter: blur(1px);
  animation: floatImages 20s ease-in-out infinite reverse;
}

.hero-center-image {
  position: absolute;
  top: 50%;
  left: 50%;
  width: auto;
  height: 300px;
  transform: translate(-50%, -50%) scale(0.8);
  z-index: 0;
  object-fit: cover;
  opacity: 0.3;
  filter: blur(2px);
}

@keyframes floatImages {
  0%,
  100% {
    transform: translate(0, 0) scale(1);
  }
  33% {
    transform: translate(-10px, -10px) scale(1.02);
  }
  66% {
    transform: translate(10px, 10px) scale(0.98);
  }
}

/* ===== HERO ===== */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2rem;
  overflow: hidden;
  z-index: 2;
  background: radial-gradient(ellipse at center, #1a0a0a 0%, #0d0905 70%, #000000 100%);
}

.hero-content {
  position: relative;
  z-index: 5;
  max-width: 900px;
  text-align: center;
  padding: 2rem;
}

.hero-glow {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 800px;
  height: 800px;
  background: radial-gradient(circle, rgba(196, 154, 43, 0.08) 0%, transparent 70%);
  pointer-events: none;
  z-index: 1;
  animation: glowPulse 4s ease-in-out infinite;
}

.hero-glow-secondary {
  position: absolute;
  top: 20%;
  right: 10%;
  width: 40%;
  height: 40%;
  background: radial-gradient(circle, rgba(168, 50, 50, 0.05) 0%, transparent 70%);
  pointer-events: none;
  z-index: 1;
}

@keyframes glowPulse {
  0%,
  100% {
    transform: translate(-50%, -50%) scale(1);
    opacity: 0.8;
  }
  50% {
    transform: translate(-50%, -50%) scale(1.2);
    opacity: 1;
  }
}

/* Hero Badge */
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 1rem;
  padding: 0.5rem 1.5rem;
  margin-bottom: 2rem;
  border: 1px solid rgba(212, 175, 55, 0.15);
  border-radius: 50px;
  background: rgba(30, 25, 20, 0.3);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

.badge-icon {
  color: var(--gold);
  font-size: 0.8rem;
  animation: pulseIcon 2s ease-in-out infinite;
}

.badge-text {
  font-family: 'Cinzel', serif;
  font-size: 0.7rem;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: rgba(160, 140, 120, 0.6);
}

@keyframes pulseIcon {
  0%,
  100% {
    opacity: 0.5;
    transform: scale(1);
  }
  50% {
    opacity: 1;
    transform: scale(1.2);
  }
}

/* Hero Title */
.hero-title {
  font-family: 'Cinzel Decorative', serif;
  font-weight: 900;
  font-size: clamp(2.5rem, 6vw, 5rem);
  line-height: 1.05;
  color: var(--gold);
  text-shadow: 0 0 60px rgba(79, 10, 10, 0.3), 0 2px 8px rgba(0, 0, 0, 0.8);
  letter-spacing: 0.04em;
  position: relative;
  z-index: 2;
  background: linear-gradient(180deg, #f3e8d0 0%, #c49a2b 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.title-line {
  display: block;
}

.title-line-descent {
  font-size: clamp(2rem, 5vw, 4.5rem);
}

/* Hero Divider */
.hero-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  margin: 1.5rem 0;
}

.divider-line {
  width: 60px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(212, 175, 55, 0.3), transparent);
}

.divider-icon {
  color: var(--gold);
  font-size: 1.2rem;
  opacity: 0.4;
}

/* Hero Subtitle */
.hero-sub {
  font-family: 'EB Garamond', serif;
  font-size: 1.3rem;
  color: rgba(160, 140, 120, 0.6);
  font-style: italic;
  margin-bottom: 2rem;
  line-height: 1.8;
  position: relative;
  z-index: 2;
}

.sub-emphasis {
  color: var(--gold);
  font-style: normal;
  font-weight: 500;
}

/* Hero Stats */
.hero-stats {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2rem;
  margin-bottom: 2.5rem;
  padding: 0.5rem 2rem;
  background: rgba(30, 25, 20, 0.2);
  border-radius: 50px;
  border: 1px solid rgba(212, 175, 55, 0.05);
}

.stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0.5rem;
}

.stat-number {
  font-family: 'Cinzel Decorative', serif;
  font-size: 1.8rem;
  color: var(--gold);
  font-weight: 700;
}

.stat-label {
  font-family: 'Cinzel', serif;
  font-size: 0.6rem;
  color: rgba(160, 140, 120, 0.4);
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-top: 0.1rem;
}

.stat-divider {
  color: rgba(212, 175, 55, 0.15);
  font-size: 1.2rem;
}

/* Descend Button */
.descend-cue {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 1.2rem;
  padding: 0.8rem 2.5rem;
  background: transparent;
  border: 1px solid rgba(212, 175, 55, 0.3);
  border-radius: 50px;
  color: var(--parchment);
  font-family: 'Cinzel', serif;
  font-size: 0.9rem;
  letter-spacing: 3px;
  cursor: pointer;
  transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
  z-index: 2;
}

.descend-cue::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(212, 175, 55, 0.1), transparent);
  transition: left 0.5s ease;
}

.descend-cue:hover::before {
  left: 100%;
}

.descend-cue:hover {
  border-color: var(--gold);
  box-shadow: 0 0 40px rgba(212, 175, 55, 0.15), inset 0 0 40px rgba(212, 175, 55, 0.05);
  transform: translateY(-2px);
}

.cue-text {
  position: relative;
  z-index: 2;
}

.cue-arrow {
  position: relative;
  z-index: 2;
  font-size: 1.2rem;
  animation: bounceArrow 2s ease-in-out infinite;
}

.cue-glow {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 0;
  height: 0;
  background: radial-gradient(circle, rgba(212, 175, 55, 0.1), transparent);
  border-radius: 50%;
  transition: all 0.5s ease;
}

.descend-cue:hover .cue-glow {
  width: 200%;
  height: 200%;
}

@keyframes bounceArrow {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(5px);
  }
}
/* ===== GATE ===== */
.gate {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 2;
  padding: 4rem 2rem;
  text-align: center;
  background: radial-gradient(ellipse at center, #1a0a0a 0%, #0d0905 100%);
  border-top: 1px solid rgba(212, 175, 55, 0.05);
  border-bottom: 1px solid rgba(212, 175, 55, 0.05);
  overflow: hidden;
}

/* ===== GATE CONTAINER - Full width ===== */
.gate-container {
  max-width: 1200px;
  margin: 0 auto;
  position: relative;
  width: 100%;
}

/* ===== GATE LINK - Full width clickable overlay ===== */
.gate-link {
  display: block;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 3;
  cursor: pointer;
  text-decoration: none;
  touch-action: manipulation;
}

.gate-link::after {
  content: '↗';
  position: absolute;
  bottom: 30px;
  right: 40px;
  font-size: 2rem;
  color: rgba(212, 175, 55, 0.3);
  opacity: 0;
  transition: all 0.4s ease;
  z-index: 4;
}

.gate-link:hover::after {
  opacity: 0.8;
  transform: translateX(8px) translateY(-8px);
}

/* ===== ABANDON IMAGE - Full width and unrestricted ===== */
#abandon-image {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 1;
  object-fit: cover;
  pointer-events: none;
}

/* ===== GATE FRAME - Now just a container for text (no image restriction) ===== */
.gate-frame {
  max-width: auto;
  margin: 0 auto;
  padding: 3rem;
  background: rgba(30, 25, 20, 0.3);
  border-radius: 20px;
  border: 1px solid rgba(212, 175, 55, 0.05);
  position: relative;
  z-index: 2;
  -webkit-backdrop-filter: blur(5px);
  backdrop-filter: blur(5px);
}

/* ===== GATE TEXT CONTENT ===== */
.gate-text-content {
  position: relative;
  z-index: 2; /* Ensure text is above the background and overlay */
}

.gate-inscription-wrapper {
  position: relative;
  z-index: 2;
}

.gate-inscription {
  font-family: 'Cinzel Decorative', serif;
  font-size: clamp(0.85rem, 2vw, 1.2rem);
  line-height: 1.4;
  color: var(--parchment-deep);
  margin-bottom: 2rem;
  opacity: 0.9;
  padding: 1rem;
}

.gate-inscription span {
  display: block;
  opacity: 0.8;
  transition: opacity 0.3s ease;
}

.gate-inscription span:hover {
  opacity: 1;
}

.inscription-spacer {
  opacity: 0.2 !important;
}

.gate-final {
  font-family: 'Cinzel', serif;
  font-size: clamp(1.2rem, 2.5vw, 1.6rem);
  line-height: 1.6;
  color: var(--parchment);
  font-weight: 600;
  padding: 1.2rem;
  border-top: 1px solid rgba(212, 175, 55, 0.15);
  margin-top: 1rem;
  position: relative;
  z-index: 2;
}

.final-line {
  display: block;
}

.final-emphasis {
  color: var(--crimson-glow);
  text-shadow: 0 0 30px rgba(168, 50, 50, 0.3);
}

/* ===== HOVER EFFECT ON GATE LINK ===== */
.gate-link:hover ~ .gate-frame .gate-inscription span {
  opacity: 0.9;
}

.gate-link:hover ~ .gate-frame .final-emphasis {
  text-shadow: 0 0 50px rgba(168, 50, 50, 0.5);
}

/* ===== FEATURED BOOKS ===== */
.featured-books {
  padding: 4rem 2rem;
  background: radial-gradient(ellipse at bottom, #1a0a0a 0%, #0d0905 100%);
  border-bottom: 1px solid rgba(212, 175, 55, 0.05);
}

.featured-container {
  max-width: 1200px;
  margin: 0 auto;
}

.featured-title {
  font-family: 'Cinzel Decorative', serif;
  font-size: 2.5rem;
  text-align: center;
  color: var(--gold);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  margin-bottom: 0.5rem;
}

.featured-icon {
  font-size: 1.2rem;
  opacity: 0.3;
}

.featured-subtitle {
  text-align: center;
  font-family: 'EB Garamond', serif;
  font-size: 1.1rem;
  color: rgba(160, 140, 120, 0.4);
  font-style: italic;
  margin-bottom: 3rem;
}

.featured-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 2rem;
  justify-items: center;
}

.featured-card {
  background: rgba(30, 25, 20, 0.3);
  border-radius: 10px;
  padding: 1.5rem;
  text-align: center;
  border: 1px solid rgba(212, 175, 55, 0.05);
  transition: all 0.4s ease;
  width: 100%;
  max-width: 220px;
}

.featured-card:hover {
  transform: translateY(-10px);
  border-color: rgba(212, 175, 55, 0.2);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.card-spine {
  padding: 2rem 1rem;
  border-radius: 5px;
  margin-bottom: 1rem;
  min-height: 150px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.card-title {
  font-family: 'Cinzel', serif;
  font-size: 1rem;
  color: var(--gold);
  font-weight: 600;
  line-height: 1.4;
}

.card-author {
  font-family: 'EB Garamond', serif;
  font-size: 0.8rem;
  color: rgba(160, 140, 120, 0.4);
  font-style: italic;
  margin-top: 0.5rem;
}

.card-info {
  display: flex;
  justify-content: center;
}

.card-circle {
  font-family: 'Cinzel', serif;
  font-size: 0.7rem;
  color: rgba(160, 140, 120, 0.3);
  letter-spacing: 2px;
  background: rgba(212, 175, 55, 0.05);
  padding: 0.3rem 1rem;
  border-radius: 20px;
  border: 1px solid rgba(212, 175, 55, 0.05);
}

/* ===== FOOTER / COLOPHON ===== */
.colophon {
  padding: 4rem 2rem 3rem;
  text-align: center;
  position: relative;
  z-index: 2;
  background: radial-gradient(ellipse at center, #0d0905 0%, #000000 100%);
  border-top: 1px solid rgba(212, 175, 55, 0.05);
}

.colophon-inner {
  max-width: 800px;
  margin: 0 auto;
  padding: 2rem;
}

.colophon-decoration {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2rem;
  margin-bottom: 2rem;
}

.colophon-line {
  flex: 1;
  max-width: 100px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(212, 175, 55, 0.2), transparent);
}

.colophon-mark {
  color: var(--gold);
  font-size: 1.2rem;
  opacity: 0.4;
  display: block;
  animation: spinMark 10s linear infinite;
}

@keyframes spinMark {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

.colophon-text {
  font-family: 'EB Garamond', serif;
  font-size: 1.2rem;
  font-style: italic;
  color: var(--parchment-deep);
  line-height: 1.7;
  margin-bottom: 1rem;
  opacity: 0.7;
}

.colophon-text strong {
  color: var(--gold);
  font-style: normal;
}

.colophon-emphasis {
  color: rgba(160, 140, 120, 0.7);
  font-style: italic;
}

.colophon-details {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem 1rem;
  margin-bottom: 1.5rem;
  padding: 1rem;
  border-top: 1px solid rgba(212, 175, 55, 0.05);
  border-bottom: 1px solid rgba(212, 175, 55, 0.05);
}

.detail-item {
  font-family: 'Cinzel', serif;
  font-size: 0.65rem;
  color: rgba(160, 140, 120, 0.3);
  letter-spacing: 1px;
}

.detail-divider {
  color: rgba(212, 175, 55, 0.1);
}

.colophon-fine {
  font-family: 'Cinzel', serif;
  font-size: 0.7rem;
  color: rgba(160, 140, 120, 0.2);
  letter-spacing: 2px;
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(212, 175, 55, 0.05);
}

/* ===== SECTION DIVIDER ===== */
.section-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  padding: 0.5rem 0;
  position: relative;
  z-index: 2;
}

.section-divider-line {
  width: 100px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(212, 175, 55, 0.2), transparent);
}

.section-divider-icon {
  color: var(--gold-dim);
  font-size: 0.8rem;
  opacity: 0.3;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 992px) {
  .hero-top-right-image,
  .hero-top-left-image {
    width: 350px;
    height: 350px;
    opacity: 0.3;
  }

  .hero-center-image {
    height: 200px;
  }

  .hero-title {
    font-size: 4rem;
  }

  .title-line-descent {
    font-size: 3.5rem;
  }
}

@media (max-width: 768px) {
  .hero-top-right-image,
  .hero-top-left-image {
    width: 250px;
    height: 250px;
    opacity: 0.2;
  }

  .hero-center-image {
    height: 150px;
  }

  .hero-title {
    font-size: 3rem;
  }

  .title-line-descent {
    font-size: 2.8rem;
  }

  .hero-badge {
    padding: 0.3rem 1rem;
  }

  .badge-text {
    font-size: 0.6rem;
  }

  .hero-stats {
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
  }

  .stat-number {
    font-size: 1.4rem;
  }

  .stat-divider {
    display: none;
  }

  .gate-frame {
    padding: 1.5rem;
  }

  .gate-inscription {
    font-size: 0.8rem;
    line-height: 1.8;
  }

  .final-line {
    font-size: 1rem;
  }

  .final-emphasis {
    font-size: 1.2rem;
  }

  .featured-title {
    font-size: 2rem;
  }

  .featured-grid {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
  }

  .colophon-details {
    flex-direction: column;
    gap: 0.3rem;
  }

  .detail-divider {
    display: none;
  }
}

@media (max-width: 480px) {
  .hero-top-right-image,
  .hero-top-left-image {
    width: 150px;
    height: 150px;
    opacity: 0.15;
  }

  .hero-center-image {
    height: 100px;
  }

  .hero-title {
    font-size: 2.2rem;
  }

  .title-line-descent {
    font-size: 2rem;
  }

  .hero-sub {
    font-size: 1rem;
  }

  .descend-cue {
    padding: 0.6rem 1.5rem;
    font-size: 0.8rem;
  }

  .hero-stats {
    flex-direction: column;
    gap: 0.2rem;
    background: none;
    border: none;
    padding: 0;
  }

  .stat-item {
    flex-direction: row;
    gap: 0.5rem;
    padding: 0.2rem;
  }

  .stat-number {
    font-size: 1.2rem;
  }

  .gate-ornament {
    font-size: 0.6rem;
    gap: 0.5rem;
  }

  .featured-title {
    font-size: 1.5rem;
    flex-direction: column;
    gap: 0.5rem;
  }

  .featured-icon {
    display: none;
  }
}