/* =========================================================
   HOME.CSS — CLEAN HOME
   Vain etusivun hero, quote, karhu, guide-avausnappi ja scroll-nappi.
   Guide-profiilin overlay/paneelit ovat home-final.css-tiedostossa.
   ========================================================= */



/* =========================================================
   1. HOME-PERUSTA
   ========================================================= */

#home,
.home-section {
  position: relative !important;
  min-height: 100svh !important;
  min-height: 100dvh !important;
  padding: 0 !important;
  overflow: hidden !important;
  isolation: isolate !important;
  background: transparent !important;
}

#home .home-stack {
  position: relative !important;
  z-index: 10 !important;

  width: 100% !important;
  min-height: 100svh !important;
  min-height: 100dvh !important;

  display: block !important;
  text-align: center !important;
}


/* Tummentava harso vain etusivulle */
#home::before {
  content: "" !important;
  position: absolute !important;
  inset: 0 !important;
  z-index: 2 !important;
  pointer-events: none !important;
  background: rgba(0, 0, 0, 0.22) !important;
}




/* =========================================================
   2. HERO-OTSIKKO
   ========================================================= */

#home .hero-title-block {
  position: absolute !important;
  left: 50% !important;
  top: 25vh !important;
  z-index: 30 !important;

  width: max-content !important;
  max-width: 94vw !important;

  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: flex-start !important;

  margin: 0 !important;
  padding: 0 !important;

  text-align: center !important;
  pointer-events: auto !important;

  transform: translateX(-50%) !important;
}

#home .hero-kicker,
#home .hero-eyebrow,
#home .hero-eyebrow span {
  transform: none !important;
  text-align: center !important;
}

#home .hero-kicker {
  display: block !important;
  width: max-content !important;
  max-width: 92vw !important;

  margin: 0 0 0.45em !important;

  color: rgba(255, 248, 220, 0.94) !important;
  -webkit-text-fill-color: rgba(255, 248, 220, 0.94) !important;

  font-family: var(--font-cinzel, "Cinzel", serif) !important;
  font-size: clamp(11px, 0.85vw, 16px) !important;
  font-weight: 700 !important;
  line-height: 1 !important;
  letter-spacing: 0.32em !important;
  text-transform: uppercase !important;

  text-shadow:
    0 2px 8px rgba(0, 0, 0, 0.92),
    0 0 18px rgba(255, 236, 170, 0.22) !important;
}

#home .hero-eyebrow {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  gap: 0.08em !important;

  width: max-content !important;
  max-width: 94vw !important;
  margin: 0 !important;

  color: #faba00 !important;
  -webkit-text-fill-color: #faba00 !important;

  font-family: var(--font-cinzel, "Cinzel", serif) !important;
  font-size: clamp(44px, 4.1vw, 72px) !important;
  font-weight: 600 !important;
  line-height: 0.88 !important;
  letter-spacing: 0.14em !important;
  text-transform: uppercase !important;
  white-space: normal !important;

  -webkit-text-stroke: 0.45px rgba(0, 0, 0, 0.25) !important;

  text-shadow:
    0 3px 8px rgba(0, 0, 0, 0.95),
    0 0 18px rgba(250, 186, 0, 0.24),
    0 14px 28px rgba(0, 0, 0, 0.72) !important;
}

#home .hero-eyebrow span {
  display: block !important;
  width: 100% !important;
}

#home .hero-title-ornament {
  display: flex !important;
  justify-content: center !important;
  align-items: center !important;
  width: 100% !important;
  margin: 8px auto 0 !important;
  transform: none !important;
}




/* =========================================================
   3. GUIDE-NAPPI OTSIKON ALLA
   Edellyttää, että .guide-select-area on HTML:ssä
   .hero-title-blockin sisällä.
   ========================================================= */

#home .hero-title-block .guide-select-area {
  position: relative !important;
  left: auto !important;
  top: auto !important;
  right: auto !important;
  bottom: auto !important;

  z-index: 35 !important;

  width: auto !important;
  max-width: 92vw !important;

  display: flex !important;
  justify-content: center !important;
  align-items: center !important;

  margin: 14px auto 0 !important;

  transform: none !important;
}

#home .guide-select-buttons {
  position: relative !important;
  z-index: 36 !important;

  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 8px !important;
}

#home .guide-select-btn {
  position: relative !important;
  z-index: 37 !important;

  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;

  width: auto !important;
  min-width: 0 !important;

  padding: 8px 18px !important;

  border: 2px solid #f4c75f !important;
  border-radius: 999px !important;

  background:
    linear-gradient(
      to bottom,
      #ffd978 0%,
      #c78327 45%,
      #6b3a10 100%
    ) !important;

  color: #2c1604 !important;
  font-family: "Cinzel", Georgia, serif !important;
  font-size: clamp(0.64rem, 0.78vw, 0.82rem) !important;
  font-weight: 800 !important;
  line-height: 1 !important;
  letter-spacing: 0.16em !important;
  text-transform: uppercase !important;
  white-space: nowrap !important;

  box-shadow:
    0 4px 0 #3b1d06,
    0 10px 18px rgba(0, 0, 0, 0.42),
    inset 0 2px 0 rgba(255, 255, 255, 0.35),
    inset 0 -4px 7px rgba(60, 28, 4, 0.42) !important;

  cursor: pointer !important;
}

#home .guide-select-btn:active {
  transform: translateY(3px) !important;
  box-shadow:
    0 1px 0 #3b1d06,
    0 7px 12px rgba(0, 0, 0, 0.40),
    inset 0 2px 0 rgba(255, 255, 255, 0.25) !important;
}

#home .guide-power-btn {
  position: relative !important;
  z-index: 37 !important;

  width: 34px !important;
  height: 34px !important;
  flex: 0 0 34px !important;

  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;

  border: 2px solid rgba(244, 199, 95, 0.90) !important;
  border-radius: 50% !important;

  background:
    radial-gradient(
      circle at 35% 25%,
      rgba(255, 230, 145, 0.95) 0%,
      rgba(176, 72, 48, 0.95) 42%,
      rgba(67, 20, 15, 1) 100%
    ) !important;

  color: #ffe6a0 !important;
  font-size: 0.95rem !important;
  line-height: 1 !important;
  font-weight: 700 !important;

  box-shadow:
    0 4px 0 rgba(44, 16, 7, 0.95),
    0 9px 16px rgba(0, 0, 0, 0.42),
    inset 0 2px 0 rgba(255, 255, 255, 0.28) !important;

  cursor: pointer !important;
}




/* =========================================================
   4. HOME-LAINAUS
   ========================================================= */

#home .home-quote-wrap,
#home .home-quote-wrap.hero-quote-wrap {
  position: absolute !important;
  left: 50% !important;
  top: 74vh !important;
  z-index: 25 !important;

  width: 67% !important;
  max-width: none !important;

  display: flex !important;
  justify-content: center !important;
  align-items: center !important;

  margin: 0 !important;
  padding: 0 !important;

  text-align: center !important;

  transform: translateX(-50%) !important;
}

#home .hero-forest-quote.home-forest-quote {
  position: relative !important;

  width: min(62vw, 433px) !important;
  aspect-ratio: 3 / 1 !important;

  margin: 0 auto !important;
  padding: 22px 48px !important;

  display: flex !important;
  flex-direction: column !important;
  justify-content: center !important;
  align-items: center !important;

  box-sizing: border-box !important;
  overflow: visible !important;

  text-align: center !important;
  color: #f4ead8 !important;

  background-image: url("../images/kehyskuva.png") !important;
  background-size: 100% 100% !important;
  background-repeat: no-repeat !important;
  background-position: center !important;

  border: none !important;
  box-shadow: none !important;
  opacity: 0.84 !important;
}

#home .hero-forest-quote.home-forest-quote::before,
#home .hero-forest-quote.home-forest-quote::after,
#home .home-quote-wrap::before,
#home .home-quote-wrap::after {
  content: none !important;
  display: none !important;
}

#home .hero-forest-quote.home-forest-quote p,
#home .hero-forest-quote.home-forest-quote footer {
  position: relative !important;
  z-index: 2 !important;
  width: 100% !important;
  text-align: center !important;
}

#home .hero-forest-quote.home-forest-quote p {
  margin: 0 !important;

  font-family: "Cormorant Garamond", Georgia, serif !important;
  font-size: clamp(0.92rem, 1.65vw, 1.35rem) !important;
  font-style: italic !important;
  font-weight: 600 !important;
  line-height: 1.32 !important;
  letter-spacing: 0.01em !important;

  color: #f4ead8 !important;

  text-shadow:
    0 1px 2px rgba(0, 0, 0, 0.82),
    0 0 8px rgba(255, 238, 190, 0.16) !important;
}

#home .hero-forest-quote.home-forest-quote footer {
  margin-top: 6px !important;

  font-family: "Cormorant Garamond", Georgia, serif !important;
  font-size: clamp(0.76rem, 1.18vw, 0.95rem) !important;
  font-style: italic !important;
  font-weight: 600 !important;

  color: #dec795 !important;
  letter-spacing: 0.04em !important;

  text-shadow:
    0 1px 2px rgba(0, 0, 0, 0.82),
    0 0 8px rgba(255, 238, 190, 0.12) !important;
}

#home .source-ref-link {
  color: inherit !important;
  text-decoration: none !important;
}

#home .source-ref {
  font-size: 0.52em !important;
  opacity: 0.78 !important;
}




/* =========================================================
   5. HERO-KARHU
   ========================================================= */

#home .hero-bear-fade {
    display: block !important;
    position: absolute !important;
    z-index: 5 !important;
    top: -10px !important;
    right: -9vw !important;
    width: clamp(430px, 34vw, 660px) !important;
    height: auto !important;
    max-width: none !important;
    opacity: 0.92 !important;
    visibility: visible !important;
    pointer-events: none !important;
    user-select: none !important;
    -webkit-mask-image: linear-gradient(
      to right,
      transparent 0%,
      rgba(0, 0, 0, 0.08) 8%,
      rgba(0, 0, 0, 0.45) 18%,
      black 32%,
      black 58%,
      rgba(0, 0, 0, 0.45) 74%,
      rgba(0, 0, 0, 0.08) 88%,
      transparent 100%
    ),
    linear-gradient(
      to bottom,
      transparent 0%,
      rgba(0, 0, 0, 0.08) 8%,
      rgba(0, 0, 0, 0.45) 18%,
      black 32%,
      black 60%,
      rgba(0, 0, 0, 0.45) 76%,
      rgba(0, 0, 0, 0.08) 90%,
      transparent 100%
    ) !important;
    -webkit-mask-composite: source-in !important;
    mask-image: linear-gradient(
      to right,
      transparent 2%,
      rgba(0, 0, 0, 0.08) 4%,
      rgba(0, 0, 0, 0.45) 11%,
      black 23%,
      black 74%,
      rgba(0, 0, 0, 0.45) 74%,
      rgba(0, 0, 0, 0.08) 88%,
      transparent 102%
    ),
    linear-gradient(
      to bottom,
      transparent -15%,
      rgba(0, 0, 0, 0.08) -12%,
      rgba(0, 0, 0, 0.45) -7%,
      black 4%,
      black 69%,
      rgba(0, 0, 0, 0.45) 82%,
      rgba(0, 0, 0, 0.08) 92%,
      transparent 61%
    ) !important;
    mask-composite: intersect !important;
    filter: sepia(0.22) saturate(1.32) hue-rotate(
338deg) brightness(0.76) contrast(1.06) drop-shadow(0 20px 42px rgba(0, 0, 0, 0.58)) !important;
}



/* =========================================================
   7. SCROLL-NAPPI
   ========================================================= */

.fixed-gold-scroll {
  position: fixed !important;
  left: 50% !important;
  bottom: 34px !important;
  z-index: 100001 !important;

  display: grid !important;
  place-items: center !important;

  width: 36px !important;
  height: 36px !important;
  padding: 0 !important;

  border: 1px solid rgba(250, 186, 0, 0.92) !important;
  border-radius: 999px !important;

  background: rgba(8, 12, 11, 0.72) !important;

  box-shadow:
    0 12px 28px rgba(0, 0, 0, 0.46),
    inset 0 0 0 1px rgba(255, 222, 140, 0.14) !important;

  cursor: pointer !important;

  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: auto !important;

  transform: translateX(-50%) !important;
  animation: scrollPulse 1.8s ease-in-out infinite !important;
}

.fixed-gold-scroll span {
  width: 14px !important;
  height: 14px !important;

  border-right: 3px solid #faba00 !important;
  border-bottom: 3px solid #faba00 !important;

  transform: rotate(45deg) translate(-2px, -2px) !important;
}

.fixed-gold-scroll.is-hidden,
body.tours-window-open .fixed-gold-scroll,
body.guide-open .fixed-gold-scroll,
body.overlay-open .fixed-gold-scroll {
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
}




/* =========================================================
   8. BREAKPOINTIT — HOME
   ========================================================= */

/* Isot desktopit */
@media (min-width: 1801px) {
  #home .hero-title-block {
    top: 25vh !important;
    left: 50% !important;
  }

  #home .hero-bear-fade {
    top: -10px !important;
    right: -7vw !important;
    width: clamp(520px, 32vw, 760px) !important;
  }
}

/* Normaali desktop */
@media (min-width: 1401px) and (max-width: 1800px) {
  #home .hero-title-block {
    top: 25vh !important;
    left: 47% !important;
  }

  #home .hero-title-block .guide-select-area {
    margin-top: 14px !important;
  }

  #home .home-quote-wrap {
    top: 47vh !important;
  }

  #home .hero-bear-fade {
    top: 0 !important;
    right: -9vw !important;
    width: clamp(460px, 81vw, 782px) !important;
  }
}

/* Laptop */
@media (min-width: 1200px) and (max-width: 1400px) {
  #home .hero-title-block {
    top: 23vh !important;
    left: 50% !important;
  }

  #home .hero-eyebrow {
    font-size: clamp(42px, 4.2vw, 58px) !important;
    letter-spacing: 0.14em !important;
  }

  #home .hero-title-block .guide-select-area {
    margin-top: 13px !important;
  }

  #home .home-quote-wrap {
    top: 48vh !important;
  }

  #home .hero-bear-fade {
    top: 5px !important;
    right: -11vw !important;
    width: clamp(437px, 65vw, 689px) !important;
  }
}

/* Kapea desktop / tabletti vaakana */
@media (min-width: 901px) and (max-width: 1199px) {
  #home .hero-title-block {
    top: 24vh !important;
    left: 50% !important;
  }

  #home .hero-eyebrow {
    font-size: clamp(38px, 5.2vw, 58px) !important;
  }

  #home .hero-title-block .guide-select-area {
    margin-top: 12px !important;
  }

  #home .home-quote-wrap {
    top: 49vh !important;
  }

  #home .hero-bear-fade {
    top: 24px !important;
    right: -13vw !important;
    width: clamp(390px, 79vw, 620px) !important;
  }
}

/* Tabletti + mobiili */
@media (max-width: 900px) {
  #home {
    background-image:
      linear-gradient(
        to bottom,
        rgba(0, 0, 0, 0.10) 0%,
        rgba(0, 0, 0, 0.16) 45%,
        rgba(0, 0, 0, 0.28) 100%
      ),
      url("../images/pystytausta.png") !important;
    background-position: center top !important;
    background-size: cover !important;
    background-repeat: no-repeat !important;
    background-attachment: scroll !important;
  }

  #home .hero-title-block {
    top: 180px !important;
    left: 50vw !important;

    width: 100vw !important;
    max-width: 100vw !important;

    padding: 0 14px !important;
  }

  #home .hero-kicker {
    font-size: clamp(10px, 2.6vw, 13px) !important;
    letter-spacing: 0.18em !important;
  }

  #home .hero-eyebrow {
    font-size: clamp(34px, 9vw, 56px) !important;
    line-height: 0.9 !important;
    letter-spacing: 0.08em !important;
  }

  #home .hero-title-block .guide-select-area {
    margin-top: 12px !important;
  }

  #home .guide-select-btn {
    padding: 8px 14px !important;
    font-size: 0.64rem !important;
    letter-spacing: 0.11em !important;
  }

  #home .guide-power-btn {
    width: 32px !important;
    height: 32px !important;
    flex-basis: 32px !important;
    font-size: 0.9rem !important;
  }

  #home .home-quote-wrap {
    top: 392px !important;
    width: min(86vw, 330px) !important;
    max-width: 330px !important;
  }

  #home .hero-forest-quote.home-forest-quote {
    width: 100% !important;
    max-width: 100% !important;
    padding: 13px 16px 12px !important;
    font-size: 19px !important;
    line-height: 1.35 !important;
  }

  #home .hero-forest-quote.home-forest-quote p {
    font-size: 16px !important;
    line-height: 1.35 !important;
  }

  #home .hero-forest-quote.home-forest-quote footer {
    margin-top: 6px !important;
    font-size: 9px !important;
    line-height: 1.2 !important;
  }

  #home .hero-bear-fade {
    top: 62px !important;
    right: -13vw !important;
    width: 81vw !important;
    max-width: none !important;
  }
}

/* Normaali kännykkä */
@media (max-width: 600px) {
  #home::after {
    content: "" !important;
    position: absolute !important;
    inset: 0 !important;
    z-index: 3 !important;
    pointer-events: none !important;
    background:
      linear-gradient(
        to bottom,
        rgba(0, 0, 0, 0.06) 0%,
        rgba(0, 0, 0, 0.10) 36%,
        rgba(0, 0, 0, 0.28) 66%,
        rgba(0, 0, 0, 0.48) 100%
      ) !important;
  }

  #home .hero-title-block {
    top: 152px !important;
  }

  #home .hero-title-block .guide-select-area {
    margin-top: 10px !important;
  }

  #home .guide-select-btn {
    max-width: calc(100vw - 88px) !important;
  }

  #home .home-quote-wrap {
    top: 392px !important;
  }

  #home .hero-bear-fade {
    top: 72px !important;
    right: -18vw !important;
    width: 85vw !important;
    max-width: none !important;
  }
}

@media (min-width: 381px) and (max-width: 480px) {
  #home .hero-bear-fade {
    top: 1px !important;
    right: -22vw !important;
    width: 76vw !important;
  }
}

@media (max-width: 380px) {
  #home .hero-title-block {
    top: 148px !important;
  }

  #home .hero-eyebrow {
    letter-spacing: 0.07em !important;
  }

  #home .home-quote-wrap {
    top: 382px !important;
  }

  #home .hero-bear-fade {
    top: 18px !important;
    right: -26vw !important;
    width: 82vw !important;
  }
}




/* =========================================================
   9. ANIMAATIOT
   ========================================================= */

@keyframes characterRiseSelect {
  0% {
    opacity: 0;
    transform:
      translateX(-50%)
      translateY(130px)
      scale(0.45);
    filter:
      brightness(2.2)
      contrast(1.5)
      blur(5px)
      drop-shadow(0 0 34px rgba(255, 210, 90, 0.95));
  }

  18% {
    opacity: 0.35;
  }

  38% {
    opacity: 1;
    transform:
      translateX(-50%)
      translateY(-18px)
      scale(1.06);
    filter:
      brightness(1.8)
      contrast(1.3)
      blur(1px)
      drop-shadow(0 0 28px rgba(255, 210, 90, 0.8));
  }

  58% {
    transform:
      translateX(-50%)
      translateY(6px)
      scale(0.97);
  }

  76% {
    transform:
      translateX(-50%)
      translateY(-4px)
      scale(1.01);
  }

  100% {
    opacity: 1;
    transform:
      translateX(-50%)
      translateY(0)
      scale(1);
    filter:
      brightness(1.12)
      contrast(1.08)
      blur(0)
      drop-shadow(0 0 14px rgba(255, 190, 70, 0.45))
      drop-shadow(0 16px 20px rgba(0, 0, 0, 0.55));
  }
}

@keyframes characterLightRise {
  0% {
    opacity: 0;
    transform: translateX(-50%) scaleY(0.05);
  }

  35% {
    opacity: 1;
  }

  100% {
    opacity: 0.85;
    transform: translateX(-50%) scaleY(1);
  }
}

@keyframes scanlineAppear {
  from {
    opacity: 0;
  }

  to {
    opacity: 0.55;
  }
}

@keyframes scanlineMove {
  from {
    background-position-y: 0;
  }

  to {
    background-position-y: 7px;
  }
}

@keyframes characterShadow {
  0% {
    opacity: 0;
    transform: translateX(-50%) scaleX(0.2);
  }

  100% {
    opacity: 1;
    transform: translateX(-50%) scaleX(1);
  }
}

@keyframes scrollPulse {
  0% {
    transform: translateX(-50%) scale(1);
    box-shadow: 0 0 0 0 rgba(250, 186, 0, 0.42);
  }

  50% {
    transform: translateX(-50%) scale(1.08);
    box-shadow: 0 0 0 9px rgba(250, 186, 0, 0);
  }

  100% {
    transform: translateX(-50%) scale(1);
    box-shadow: 0 0 0 0 rgba(250, 186, 0, 0);
  }
}
@media (min-width: 580px) {
#home .home-quote-wrap, #home .home-quote-wrap.hero-quote-wrap {
width:40%!important;
    margin-left: auto !important;
    margin-right: auto !important;
  }
}
/* Korjaus: pääpainike keskelle, power/piilota-nappi ei vaikuta keskitykseen */
@media (max-width: 600px) {
  #home .hero-title-block .guide-select-area {
    width: 100% !important;
    max-width: 100% !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
  }

  #home .guide-select-buttons {
    position: relative !important;
    width: 100% !important;
    max-width: 100% !important;

    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
  }

  #home .guide-select-btn {
    position: relative !important;
    z-index: 2 !important;
    margin: 0 auto !important;
  }

  #home .guide-power-btn {
    position: absolute !important;
    left: calc(50% + 92px) !important;
    top: 50% !important;
    transform: translateY(-50%) !important;

    margin: 0 !important;
    z-index: 3 !important;
  }
}
