/* Google Fonts: Bebas Neue (Display), DM Sans (Editorial Body), IBM Plex Mono (Fibonacci Indices) */
@import url('https://fonts.googleapis.com/css2?family=Bebas+Neue&family=DM+Sans:ital,opsz,wght@0,9..40,300..600;1,9..40,300..500&family=IBM+Plex+Mono:wght@400;500&display=swap');

:root {
  --forest: #123D2B;
  --forest-deep: #081D14;
  --growth: #70B98A;
  --living: #D5E8D9;
  --earth: #F4F5EF;
  --phi: 1.618;
}

html {
  background-color: var(--earth);
  color: var(--forest);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  overflow-x: hidden;
}

::selection {
  background-color: var(--growth);
  color: var(--forest-deep);
}

/* Editorial Brand Scrollbar (Fibonacci 8px width) */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--earth);
  border-left: 1px solid rgba(18, 61, 43, 0.08);
}

::-webkit-scrollbar-thumb {
  background-color: var(--forest);
  border: 2px solid var(--earth);
  border-radius: 9999px;
  transition: background-color 0.25s ease;
}

::-webkit-scrollbar-thumb:hover {
  background-color: var(--growth);
}

::-webkit-scrollbar-thumb:active {
  background-color: var(--forest-deep);
}

@supports not selector(::-webkit-scrollbar) {
  html {
    scrollbar-width: thin;
    scrollbar-color: var(--forest) var(--earth);
  }
}

/* Double-exposure Bebas Neue DOLDON wordmark (echoing the book cover) */
.doldon-wordmark {
  font-family: 'Bebas Neue', sans-serif;
  font-size: clamp(4.75rem, 13.5vw, 10.75rem);
  line-height: 0.84;
  letter-spacing: 0.03em;
  background-image:
    linear-gradient(
      180deg,
      rgba(244, 245, 239, 0.28) 0%,
      rgba(112, 185, 138, 0.14) 55%,
      rgba(213, 232, 217, 0.34) 100%
    ),
    url('../images/doldon-text-fill.webp');
  background-size: 118% auto;
  background-position: center 34%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-stroke: 1px rgba(213, 232, 217, 0.32);
  filter: brightness(1.08) contrast(1.06) drop-shadow(0 10px 28px rgba(8, 29, 20, 0.65));
  will-change: background-position;
  animation: wordmarkDrift 26s ease-in-out infinite alternate;
}

@keyframes wordmarkDrift {
  0% {
    background-position: 45% 28%;
  }
  100% {
    background-position: 55% 42%;
  }
}

/* 108BRUM monumental display scale */
.brum-wordmark {
  font-family: 'Bebas Neue', sans-serif;
  font-size: clamp(4.75rem, 11vw, 9.25rem);
  line-height: 0.86;
  letter-spacing: 0.025em;
}

/* Subtle organic ambient float for hero sculpture */
@keyframes organicFloat {
  0%, 100% {
    transform: translate3d(0, 0px, 0) scale(1);
  }
  50% {
    transform: translate3d(0, -10px, 0) scale(1.012);
  }
}

.animate-organic-float {
  animation: organicFloat 9s ease-in-out infinite;
}

/* Soft organic radial breath inside dark bands */
@keyframes canopyPulse {
  0%, 100% {
    opacity: 0.45;
    transform: scale(1);
  }
  50% {
    opacity: 0.72;
    transform: scale(1.08);
  }
}

.canopy-glow {
  animation: canopyPulse 12s ease-in-out infinite;
}

/* Scroll reveal choreography */
.reveal {
  opacity: 0;
  transform: translateY(21px);
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

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

/* Category card hairline accent sweep */
.category-card {
  position: relative;
  transition: background-color 0.35s ease;
}

.category-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background-color: var(--growth);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.42s cubic-bezier(0.16, 1, 0.3, 1);
}

.category-card:hover::before,
.category-card:focus-within::before {
  transform: scaleX(1);
}

/* Header theme switch on scroll */
.site-header {
  transition: background-color 0.35s ease, border-color 0.35s ease, color 0.35s ease, backdrop-filter 0.35s ease;
}

.site-header.is-hero {
  background-color: rgba(8, 29, 20, 0.45);
  border-bottom-color: rgba(213, 232, 217, 0.12);
  color: var(--earth);
}

.site-header.is-light {
  background-color: rgba(244, 245, 239, 0.94);
  border-bottom-color: rgba(18, 61, 43, 0.14);
  color: var(--forest);
}

.site-header.is-light .header-cta {
  background-color: var(--forest);
  color: var(--earth);
  border-color: var(--forest);
}

.site-header.is-light .header-cta:hover {
  background-color: var(--growth);
  color: var(--forest-deep);
  border-color: var(--growth);
}

/* Seamless vignette blend for the hero biomimetic sculpture */
.sculpture-mask {
  mask-image: radial-gradient(circle at 50% 50%, black 62%, transparent 98%);
  -webkit-mask-image: radial-gradient(circle at 50% 50%, black 62%, transparent 98%);
}

/* Fine architectural paper grain texture (ultra-subtle) */
.paper-grain {
  background-image: radial-gradient(rgba(18, 61, 43, 0.035) 1px, transparent 0);
  background-size: 21px 21px;
}

/* Interactive Light Bulb ("Marry Solei" strikethrough toggle) */
.bulb-btn .bulb-rays {
  opacity: 0;
  transform: scale(0.82);
  transform-origin: center;
  transition: opacity 0.3s ease, transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.bulb-btn.is-lit {
  background-color: var(--forest);
  color: var(--earth);
  border-color: var(--forest);
  box-shadow: 0 0 24px rgba(112, 185, 138, 0.28);
}

.bulb-btn.is-lit .bulb-icon {
  color: var(--growth);
  filter: drop-shadow(0 0 6px rgba(112, 185, 138, 0.85));
}

.bulb-btn.is-lit .bulb-rays {
  opacity: 1;
  transform: scale(1);
}

.marry-solei-text {
  position: relative;
  display: inline-block;
}

.marry-solei-text::after {
  content: '';
  position: absolute;
  left: -2px;
  right: -2px;
  top: 52%;
  height: 2px;
  background-color: var(--growth);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.42s cubic-bezier(0.16, 1, 0.3, 1) 0.08s;
}

.bulb-btn.is-lit .marry-solei-text::after {
  transform: scaleX(1);
}

/* Reduced motion accessibility */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .doldon-wordmark,
  .animate-organic-float,
  .canopy-glow {
    animation: none !important;
  }
  .reveal {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
}
