:root {
  /* Tahko.com -teeman WP-presetit (tahkocom): darkblue, blue */
  --tahko-darkblue: #1e2d4e;
  --tahko-blue: #2b3b5f;
  --sky-top: var(--tahko-darkblue);
  --sky-mid: var(--tahko-blue);
  --snow: #f0f4f8;
  --accent: #7eb8da;
  --text: #e8eef4;
  --muted: #9db4c8;
  /* Maisema: oletus = selkeä yö — tausta Tahkon tummansininen */
  --scene-body-bg: var(--tahko-darkblue);
  --scene-sky-0: #0f1824;
  --scene-sky-45: #162a42;
  --scene-sky-100: var(--tahko-blue);
  --scene-snow-hill-0: #dce8f0;
  --scene-snow-hill-100: #a8bcc8;
  --scene-pine-0: #1e3548;
  --scene-pine-100: #121e2e;
  --scene-mountain-far: #2d4560;
  --scene-mountain-near: #243a52;
  --scene-snow-fore: #eef3f7;
  --scene-lake-0: #a8d4e8;
  --scene-lake-18: #6a9eb4;
  --scene-lake-55: #3d6b7e;
  --scene-lake-100: #182436;
  --scene-lake-shore: rgba(255, 255, 255, 0.45);
  --scene-lake-ripple: rgba(255, 255, 255, 0.14);
  --scene-glow: rgba(126, 184, 218, 0.15);
  --scene-cloud-opacity: 0;
  --scene-sun-opacity: 0;
  --scene-moon-opacity: 0;
  --scene-rain-opacity: 0;
  --scene-fog-opacity: 0;
}

/* Päivä, selkeä — vaalea taivas; aurinko: data-celestial="sun" */
body[data-scene="clear-day"] {
  --scene-body-bg: #243a52;
  --scene-sky-0: #1e2d4e;
  --scene-sky-45: #2a4560;
  --scene-sky-100: #3d5a78;
  --scene-mountain-far: #2d4a5c;
  --scene-mountain-near: #243d4d;
  --scene-glow: rgba(160, 210, 255, 0.22);
}

body[data-celestial="sun"] {
  --scene-sun-opacity: 1;
}

/* Selkeä yö: kuu + tähdet (vain data-celestial="moon") */
body[data-celestial="moon"] {
  --scene-moon-opacity: 1;
}

/* Puolipilvinen — pilvet */
body[data-scene="partly"] {
  --scene-body-bg: #1a2438;
  --scene-sky-0: #121a2e;
  --scene-sky-45: #1a2a42;
  --scene-sky-100: #2b3b5f;
  --scene-mountain-far: #283d4d;
  --scene-mountain-near: #1f3644;
  --scene-glow: rgba(140, 190, 220, 0.12);
  --scene-cloud-opacity: 0.48;
}

/* Puolipilvinen päivä: aurinko näkyy pilvien takaa (Open-Meteo 2 + is_day) */
body[data-scene="partly"][data-celestial="sun"] {
  --scene-sun-opacity: 0.92;
  --scene-body-bg: #1e2a3d;
  --scene-sky-45: #1e3048;
  --scene-sky-100: #324a68;
  --scene-glow: rgba(180, 220, 255, 0.18);
}

/* Pilvinen / synkkä harmaa */
body[data-scene="overcast"] {
  --scene-body-bg: #1a1f24;
  --scene-sky-0: #2a3238;
  --scene-sky-45: #3a4550;
  --scene-sky-100: #4a5662;
  --scene-mountain-far: #3a454e;
  --scene-mountain-near: #2f383f;
  --scene-snow-hill-0: #c8d0d8;
  --scene-snow-hill-100: #98a4b0;
  --scene-snow-fore: #d8dee6;
  --scene-lake-0: #6a7a88;
  --scene-lake-18: #4a5c6a;
  --scene-lake-55: #354550;
  --scene-lake-100: #252e34;
  --scene-lake-shore: rgba(255, 255, 255, 0.22);
  --scene-lake-ripple: rgba(255, 255, 255, 0.08);
  --scene-glow: rgba(180, 200, 220, 0.08);
  --scene-cloud-opacity: 0.78;
}

/* Lumisade — kirkkaampi lumi (hiutaleet vain pakkasella + JS) */
body[data-scene="snow"] {
  --scene-body-bg: #162030;
  --scene-sky-0: #1a2838;
  --scene-sky-45: #243848;
  --scene-sky-100: #345068;
  --scene-snow-hill-0: #f0f6fa;
  --scene-snow-hill-100: #c8d8e4;
  --scene-snow-fore: #fafcfe;
  --scene-mountain-far: #2a4050;
  --scene-mountain-near: #223848;
  --scene-lake-0: #b8d4e8;
  --scene-lake-18: #7aa8c0;
  --scene-lake-55: #4a7088;
  --scene-lake-100: #1a3040;
  --scene-glow: rgba(200, 230, 255, 0.2);
  --scene-cloud-opacity: 0.35;
}

/* Vesisade — tumma, viileä + sadekerros */
body[data-scene="rain"] {
  --scene-body-bg: #141c28;
  --scene-sky-0: #0a1018;
  --scene-sky-45: #121a28;
  --scene-sky-100: #1e2d42;
  --scene-mountain-far: #1c2832;
  --scene-mountain-near: #141c24;
  --scene-snow-hill-0: #a8b4c0;
  --scene-snow-hill-100: #788898;
  --scene-snow-fore: #c8d4dc;
  --scene-lake-0: #4a6070;
  --scene-lake-18: #354854;
  --scene-lake-55: #243038;
  --scene-lake-100: #101820;
  --scene-lake-shore: rgba(255, 255, 255, 0.18);
  --scene-lake-ripple: rgba(255, 255, 255, 0.06);
  --scene-glow: rgba(100, 140, 180, 0.06);
  --scene-cloud-opacity: 0.55;
  --scene-rain-opacity: 0.92;
}

/* Sumu — himmeä kerros päällä */
body[data-scene="fog"] {
  --scene-body-bg: #1a2228;
  --scene-sky-0: #2a3238;
  --scene-sky-45: #3a4248;
  --scene-sky-100: #4a5258;
  --scene-mountain-far: #3d454c;
  --scene-mountain-near: #343c42;
  --scene-snow-hill-0: #d0d8dc;
  --scene-snow-hill-100: #a8b0b8;
  --scene-snow-fore: #e8ecee;
  --scene-lake-0: #8a98a0;
  --scene-lake-18: #6a7880;
  --scene-lake-55: #485860;
  --scene-lake-100: #303840;
  --scene-glow: rgba(200, 210, 220, 0.06);
  --scene-cloud-opacity: 0.25;
  --scene-fog-opacity: 0.85;
}

/* Lämpötila plussalla: ei valkoista lumikerrosta — rinne + etualus ruohon/maan sävyjä */
body[data-ground="warm"] {
  --scene-snow-hill-0: #4d5c42;
  --scene-snow-hill-100: #3d4838;
  --scene-snow-fore: #566848;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: "Outfit", system-ui, sans-serif;
  background: var(--scene-body-bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  transition: background-color 0.8s ease;
}

.weather-fog {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 2;
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.03) 0%,
    rgba(230, 235, 240, 0.14) 45%,
    rgba(200, 210, 218, 0.12) 100%
  );
  opacity: var(--scene-fog-opacity);
  transition: opacity 1s ease;
}

.rain-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 3;
  overflow: hidden;
  opacity: var(--scene-rain-opacity);
  transition: opacity 0.8s ease;
}
.rain-drop {
  position: absolute;
  top: -30px;
  width: 2px;
  height: 22px;
  border-radius: 1px;
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.95) 0%,
    rgba(200, 230, 255, 0.65) 45%,
    rgba(160, 200, 240, 0.2) 85%,
    transparent 100%
  );
  box-shadow: 0 0 4px rgba(255, 255, 255, 0.35);
  animation: rain-fall linear infinite;
}
@keyframes rain-fall {
  0% {
    transform: translateY(-8vh) translateX(0);
    opacity: 0;
  }
  6% {
    opacity: 1;
  }
  100% {
    transform: translateY(105vh) translateX(-14px);
    opacity: 0.55;
  }
}

.snow-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 3;
  overflow: hidden;
}
.flake {
  position: absolute;
  top: -10px;
  width: 6px;
  height: 6px;
  background: rgba(255,255,255,0.85);
  border-radius: 50%;
  filter: blur(0.5px);
  animation: fall linear infinite;
  opacity: 0.9;
}
@keyframes fall {
  0% { transform: translateY(-5vh) translateX(0) rotate(0deg); opacity: 0; }
  5% { opacity: 1; }
  100% { transform: translateY(105vh) translateX(25px) rotate(360deg); opacity: 0.3; }
}

.hero {
  position: relative;
  min-height: 92vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  padding: 2rem 1.5rem 3rem;
}

.scene-wrap {
  position: absolute;
  inset: 0;
  z-index: 0;
}
.scene-wrap svg {
  width: 100%;
  height: 100%;
  display: block;
}
.scene-wrap svg .weather-sun,
.scene-wrap svg .weather-clouds,
.scene-wrap svg .weather-moon {
  transition: opacity 0.9s ease;
}

.glow {
  position: absolute;
  bottom: 35%;
  left: 50%;
  transform: translateX(-50%);
  width: min(90vw, 520px);
  height: 180px;
  background: radial-gradient(ellipse at center, var(--scene-glow) 0%, transparent 70%);
  z-index: 1;
  pointer-events: none;
  transition: background 0.8s ease;
}

.fill-mountain-far {
  fill: var(--scene-mountain-far);
  opacity: 0.85;
  transition: fill 0.8s ease;
}
.fill-mountain-near {
  fill: var(--scene-mountain-near);
  opacity: 0.9;
  transition: fill 0.8s ease;
}
.fill-snow-fore {
  fill: var(--scene-snow-fore);
  opacity: 0.95;
  transition: fill 0.8s ease;
}
.lake-shore-line {
  stroke: var(--scene-lake-shore);
  transition: stroke 0.8s ease;
}
.lake-ripple-group {
  stroke: var(--scene-lake-ripple);
  transition: stroke 0.8s ease;
}

/* Sanalogo: ensimmäinen o = valkoinen ympyrä + koirakuva (korkeus = iso D) */
.logo-wordmark {
  --logo-dogs-color: #ffffff;
  --logo-tahko-color: var(--tahko-darkblue);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0;
  font-size: clamp(3.5rem, 14vw, 7.5rem);
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -0.03em;
  text-shadow: 0 4px 24px rgba(0, 0, 0, 0.35);
  filter: drop-shadow(0 8px 28px rgba(0, 0, 0, 0.28));
}
.logo-wordmark .logo-dogs {
  color: var(--logo-dogs-color);
}
.logo-wordmark .logo-tahko {
  color: var(--logo-tahko-color);
  /* Tumma #1e2d4e + kevyt valopiiri, jotta erottuu tummasta maisemasta */
  text-shadow:
    0 0 0.06em rgba(255, 255, 255, 0.5),
    0 0.03em 0.12em rgba(255, 255, 255, 0.22),
    0 4px 22px rgba(0, 0, 0, 0.45);
}
.logo-wordmark-inner {
  display: inline-flex;
  align-items: baseline;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0;
}
.logo-wordmark .logo-o {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  /* Fallback ~ ison kirjaimen korkeus; tarkka = 1cap alla */
  width: 0.82em;
  height: 0.82em;
  margin: 0 0.015em;
  border-radius: 50%;
  background: #fff;
  overflow: hidden;
  flex-shrink: 0;
  align-self: baseline;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.06);
}
@supports (width: 1cap) {
  .logo-wordmark .logo-o {
    width: 1cap;
    height: 1cap;
  }
}
.logo-wordmark .logo-o img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 38%;
  transform: scale(1.22);
  transform-origin: 50% 42%;
  display: block;
}

.content {
  position: relative;
  z-index: 2;
  max-width: min(100%, 56rem);
  padding: 0 0.5rem;
  text-align: center;
}
.badge {
  display: inline-block;
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1rem;
  font-weight: 500;
}
h1 {
  margin-bottom: 1rem;
}
.caption {
  margin-top: 2.5rem;
  font-size: 0.8rem;
  color: rgba(255,255,255,0.35);
  font-weight: 300;
}

section.info {
  position: relative;
  z-index: 4;
  padding: 3rem 1.5rem 4rem;
  background: linear-gradient(180deg, transparent, rgba(30, 45, 78, 0.92) 8%, #1e2d4e 100%);
  border-top: 1px solid rgba(255,255,255,0.06);
}
.info-inner {
  max-width: 36rem;
  margin: 0 auto;
}
.info h2 {
  font-size: 1.15rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: var(--accent);
}
.info p {
  font-size: 0.98rem;
  line-height: 1.7;
  color: var(--muted);
  font-weight: 300;
}

/* OpenStreetMap / Leaflet */
.map-section {
  margin-top: 1.75rem;
  width: 100%;
  text-align: left;
}
.map-heading {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.45rem;
  text-align: center;
}
.map-canvas {
  width: 100%;
  height: min(58vw, 420px);
  min-height: 260px;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
  background: #1a2438;
}
.map-canvas .leaflet-control-attribution {
  font-size: 0.65rem;
  background: rgba(30, 45, 78, 0.92) !important;
  color: var(--muted) !important;
}
.map-canvas .leaflet-control-attribution a {
  color: var(--accent);
}

/* Valinnainen Markdown-runko: content/index.md frontmatterin alta */
.content .dogstahko-prose {
  margin: 0 auto 1.5rem;
  max-width: 36rem;
  text-align: center;
  font-size: 0.98rem;
  line-height: 1.7;
  color: var(--muted);
  font-weight: 300;
}

.content .dogstahko-prose > * + * {
  margin-top: 0.75rem;
}

.content .dogstahko-prose a {
  color: var(--accent);
}
