/* ==========================================================
   Silent Hill — atmosphere overlays
   night / intrusion / ambient / map fog / lightbox ritual
   ========================================================== */

/* ---------- Floating chrome ---------- */
.sh-atmosphere-chrome {
  position: fixed;
  right: 16px;
  bottom: 18px;
  z-index: 10050;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  pointer-events: none;
}
.sh-night-badge {
  pointer-events: none;
  font-family: "Courier Prime", ui-monospace, monospace;
  font-size: 10px;
  letter-spacing: .35em;
  color: #e0533a;
  text-shadow: 0 0 12px rgba(224, 83, 58, .55);
  padding: 4px 10px;
  border: 1px solid rgba(224, 83, 58, .45);
  background: rgba(8, 8, 10, .72);
}
.sh-ambient-toggle {
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border: 1px solid rgba(201, 198, 191, .28);
  background: rgba(10, 10, 12, .78);
  color: #d4d0c8;
  font-family: "Courier Prime", ui-monospace, monospace;
  font-size: 11px;
  letter-spacing: .28em;
  cursor: pointer;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: border-color .3s, background .3s, color .3s, box-shadow .3s;
}
.sh-ambient-toggle:hover,
.sh-ambient-toggle:focus-visible {
  border-color: rgba(224, 83, 58, .7);
  color: #fff;
  outline: none;
}
.sh-ambient-toggle.is-on {
  border-color: rgba(224, 83, 58, .85);
  box-shadow: 0 0 18px rgba(179, 54, 31, .35);
  color: #fff;
}
.sh-ambient-icon {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #55524c;
  box-shadow: 0 0 0 0 rgba(224, 83, 58, 0);
}
.sh-ambient-toggle.is-on .sh-ambient-icon {
  background: #e0533a;
  animation: sh-pulse 1.8s ease-in-out infinite;
}
@keyframes sh-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(224, 83, 58, .55); }
  50% { box-shadow: 0 0 0 7px rgba(224, 83, 58, 0); }
}

/* ---------- Night tone ---------- */
html.sh-night body,
body.sh-night {
  --sh-rust: #8a1c12;
  --sh-rust-2: #c43a28;
}
body.sh-night::before {
  opacity: 1.35;
  filter: blur(28px) saturate(.7);
}
body.sh-night::after {
  opacity: .12;
}
body.sh-night #page-wrapper,
body.sh-night.landing #page-wrapper {
  filter: saturate(.72) brightness(.88);
}
body.sh-night .sh-night-copy {
  display: block;
}
.sh-night-copy { display: none; }

/* LP night overrides */
body.sh-night .hero-bg {
  background:
    radial-gradient(ellipse 70% 38% at 50% 72%, rgba(90, 70, 70, .18), transparent 70%),
    radial-gradient(ellipse 90% 30% at 50% 100%, rgba(120, 20, 16, .35), transparent 70%),
    linear-gradient(180deg, #050506 0%, #0c0a0b 62%, #060506 100%) !important;
}
body.sh-night .fog::before,
body.sh-night .fog::after {
  opacity: 1.25;
}
body.sh-night .grain { opacity: .11; }

/* ---------- Rare intrusion ---------- */
.sh-intrusion {
  position: fixed;
  inset: 0;
  z-index: 10040;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity .4s ease, visibility .4s;
}
.sh-intrusion.is-active {
  opacity: 1;
  visibility: visible;
}
.sh-intrusion-fog {
  position: absolute;
  inset: -10%;
  background:
    radial-gradient(ellipse 50% 40% at 40% 60%, rgba(200, 205, 210, .22), transparent 70%),
    radial-gradient(ellipse 45% 35% at 70% 40%, rgba(180, 185, 190, .18), transparent 70%);
  filter: blur(30px);
  animation: sh-intrusion-drift 2.2s ease-out forwards;
}
.sh-intrusion-vignette {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 45%, transparent 20%, rgba(0, 0, 0, .78) 100%);
}
.sh-intrusion-glitch {
  position: absolute;
  left: 50%;
  top: 42%;
  transform: translate(-50%, -50%);
  font-family: "Shippori Mincho", "Hiragino Mincho ProN", serif;
  font-size: clamp(16px, 3vw, 22px);
  letter-spacing: .28em;
  color: rgba(217, 214, 208, .88);
  text-shadow: 2px 0 rgba(224, 83, 58, .45), -2px 0 rgba(80, 120, 160, .35);
  white-space: nowrap;
  animation: sh-glitch-text 2.2s steps(2, end) forwards;
}
@keyframes sh-intrusion-drift {
  0% { transform: scale(1) translate(0, 0); opacity: 0; }
  30% { opacity: 1; }
  100% { transform: scale(1.15) translate(2%, -1%); opacity: .85; }
}
@keyframes sh-glitch-text {
  0% { opacity: 0; letter-spacing: .5em; }
  12% { opacity: 1; transform: translate(-50%, -50%) skewX(-2deg); }
  18% { transform: translate(-48%, -52%) skewX(3deg); opacity: .4; }
  24% { transform: translate(-50%, -50%); opacity: 1; }
  80% { opacity: 1; }
  100% { opacity: 0; }
}
body.sh-intruding {
  animation: sh-body-shake .35s linear 2;
}
@keyframes sh-body-shake {
  0%, 100% { transform: translate(0, 0); }
  25% { transform: translate(-1px, 0.5px); }
  75% { transform: translate(1px, -0.5px); }
}

/* ---------- Explore tags / feed ---------- */
.sh-explore-tag {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
  font-family: "Courier Prime", ui-monospace, monospace;
  font-size: 10px;
  letter-spacing: .22em;
  padding: 4px 8px;
  background: rgba(7, 8, 10, .78);
  border: 1px solid rgba(201, 198, 191, .2);
  color: #8a867e;
  pointer-events: none;
}
.sh-unexplored > .sh-explore-tag,
a.sh-unexplored .sh-explore-tag {
  color: #e0533a;
  border-color: rgba(224, 83, 58, .45);
}
.sh-visited > .sh-explore-tag,
a.sh-visited .sh-explore-tag {
  color: #6a6862;
}
.spot,
[data-sh-spot-id] {
  position: relative;
}

.sh-feed {
  margin-top: 48px;
  border: 1px solid rgba(201, 198, 191, .14);
  background: rgba(10, 10, 12, .55);
}
.sh-feed-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  padding: 18px 22px;
  border-bottom: 1px solid rgba(201, 198, 191, .12);
}
.sh-feed-head h3 {
  margin: 0;
  font-size: 15px;
  letter-spacing: .28em;
  font-weight: 600;
}
.sh-feed-head .hint {
  font-family: "Courier Prime", ui-monospace, monospace;
  font-size: 10px;
  letter-spacing: .2em;
  color: #55524c;
}
.sh-feed-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.sh-feed-list li {
  border-top: 1px solid rgba(201, 198, 191, .08);
}
.sh-feed-list li:first-child { border-top: 0; }
.sh-feed-list a {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 22px;
  text-decoration: none;
  color: inherit;
  transition: background .3s;
}
.sh-feed-list a:hover { background: rgba(154, 36, 24, .12); }
.sh-feed-list .meta {
  font-family: "Courier Prime", ui-monospace, monospace;
  font-size: 11px;
  letter-spacing: .18em;
  color: #8a867e;
  flex: none;
  min-width: 5.5em;
}
.sh-feed-list .title {
  flex: 1;
  letter-spacing: .08em;
  font-size: 14px;
}
.sh-feed-list .whisper {
  font-size: 12px;
  color: #55524c;
  letter-spacing: .06em;
}
.sh-feed-list .sh-explore-tag { display: none; }

/* ---------- Map fog + progressive disclosure ---------- */
#spot_map {
  position: relative;
}
#spot_map .ggmap {
  position: relative;
  min-height: 420px;
}
.sh-map-fog {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background:
    radial-gradient(ellipse 70% 55% at 50% 50%, transparent 35%, rgba(8, 9, 11, .55) 100%),
    linear-gradient(180deg, rgba(180, 185, 190, .08), transparent 40%, rgba(180, 185, 190, .1));
  opacity: 0;
  transition: opacity .8s ease;
  mix-blend-mode: soft-light;
}
#spot_map.sh-zoom-far .sh-map-fog { opacity: 1; }
#spot_map.sh-zoom-mid .sh-map-fog { opacity: .55; }
#spot_map.sh-zoom-near .sh-map-fog { opacity: .12; }
/* fog sits over map_canvas wrapper */
#spot_map .ggmap + .sh-map-fog,
#spot_map [style*="position:relative"] > .sh-map-fog {
  border-radius: 0;
}

.sh-map-veil-note {
  position: absolute;
  left: 12px;
  bottom: 12px;
  z-index: 3;
  pointer-events: none;
  font-family: "Courier Prime", ui-monospace, monospace;
  font-size: 10px;
  letter-spacing: .22em;
  color: rgba(212, 208, 200, .7);
  background: rgba(7, 8, 10, .65);
  padding: 6px 10px;
  border: 1px solid rgba(201, 198, 191, .16);
  opacity: 0;
  transition: opacity .5s;
}
#spot_map.sh-zoom-far .sh-map-veil-note,
#spot_map.sh-zoom-mid .sh-map-veil-note { opacity: 1; }

/* List cards: veil photos until zoomed in */
#mission_ichiran.sh-veil-list .image-good-wrap img,
#mission_ichiran.sh-veil-list .spot_detail_image {
  filter: grayscale(1) contrast(1.2) brightness(.25) blur(6px) !important;
  transform: scale(1.08);
}
#mission_ichiran.sh-veil-list .spot-list-title a,
#mission_ichiran.sh-veil-list .spot-list-desc {
  filter: blur(3px);
  opacity: .55;
  user-select: none;
}
#mission_ichiran.sh-veil-list .spot-list-title::after {
  content: " — 近づくと輪郭が現れる";
  display: block;
  font-size: .75em;
  letter-spacing: .12em;
  color: #8a867e;
  filter: none;
  opacity: 1;
  margin-top: .35em;
}
#mission_ichiran.sh-silhouette-list .image-good-wrap img,
#mission_ichiran.sh-silhouette-list .spot_detail_image {
  filter: grayscale(1) contrast(1.3) brightness(.35) !important;
}
#mission_ichiran.sh-silhouette-list .spot-list-desc {
  opacity: .35;
  filter: blur(1.5px);
}

.sh-map-signal {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(224, 83, 58, .85);
  box-shadow: 0 0 10px rgba(224, 83, 58, .55);
  animation: sh-signal 2.4s ease-in-out infinite;
}
@keyframes sh-signal {
  0%, 100% { opacity: .45; transform: scale(.85); }
  50% { opacity: 1; transform: scale(1.15); }
}

/* InfoWindow (custom content) */
.sh-iw {
  max-width: 220px;
  font-family: "Noto Sans JP", sans-serif;
  color: #1a1a1a;
  line-height: 1.5;
}
.sh-iw .sh-iw-dist {
  font-size: 11px;
  letter-spacing: .12em;
  color: #666;
  margin-bottom: 6px;
}
.sh-iw .sh-iw-title {
  font-family: "Shippori Mincho", serif;
  font-size: 14px;
  letter-spacing: .08em;
  margin: 0 0 8px;
}
.sh-iw .sh-iw-photo {
  display: block;
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
  filter: grayscale(.4) brightness(.9);
  margin-bottom: 8px;
  background: #111;
}
.sh-iw .sh-iw-photo.is-veiled {
  filter: grayscale(1) brightness(.2) blur(4px);
}
.sh-iw .sh-iw-link {
  font-size: 12px;
  letter-spacing: .15em;
  color: #9a2418;
  text-decoration: none;
}
.sh-iw .sh-iw-whisper {
  font-size: 11px;
  color: #888;
  margin-top: 4px;
}

/* ---------- Lightbox ritual ---------- */
.lightboxOverlay.sh-lb-deep,
.lightboxOverlay {
  background-color: #000 !important;
  opacity: .94 !important;
}
.lb-outerContainer.sh-lb-ritual,
.lb-outerContainer {
  background-color: transparent !important;
  border-radius: 0 !important;
  box-shadow: none !important;
}
.lb-container { padding: 0 !important; }
.lightbox .lb-image {
  border-radius: 0 !important;
  box-shadow: 0 0 80px rgba(0, 0, 0, .9);
  filter: contrast(1.05) brightness(.92);
}
.lb-dataContainer {
  background: linear-gradient(180deg, transparent, rgba(0, 0, 0, .85));
  padding-top: 24px !important;
}
.lb-caption {
  font-family: "Shippori Mincho", "Hiragino Mincho ProN", serif !important;
  font-size: 14px !important;
  letter-spacing: .18em;
  color: #d9d6d0 !important;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 1.2s ease .45s, transform 1.2s ease .45s;
}
.lb-caption.sh-lb-caption-reveal,
.lb-dataContainer .lb-caption {
  opacity: 1;
  transform: none;
}
.lb-number {
  font-family: "Courier Prime", ui-monospace, monospace !important;
  letter-spacing: .2em;
  color: #8a867e !important;
}
.lb-nav a.lb-prev,
.lb-nav a.lb-next {
  opacity: .35;
  transition: opacity .4s;
}
.lb-nav a.lb-prev:hover,
.lb-nav a.lb-next:hover { opacity: .9; }
.lb-closeContainer .lb-close { opacity: .5; }
.lb-closeContainer .lb-close:hover { opacity: 1; }

/* ---------- Spot detail uncertain copy ---------- */
.sh-uncertain {
  color: #8d8a84;
  font-size: .92em;
  letter-spacing: .06em;
}
.sh-uncertain em {
  font-style: normal;
  color: #d9d6d0;
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .sh-intrusion,
  .sh-ambient-toggle.is-on .sh-ambient-icon,
  .sh-map-signal,
  body.sh-intruding {
    animation: none !important;
  }
  .sh-intrusion { display: none !important; }
  .lb-caption { opacity: 1; transform: none; transition: none; }
}
