/* Kainulaisen Hautauspalvelu – etusivu
   Two schemes share one system: harmaa (default) and vihreä.
   Colour tokens are registered so a scheme change crossfades instead of snapping. */

@font-face {
  font-family: "Finlandica";
  src: url("../fonts/finlandica-latin.woff2") format("woff2");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Finlandica";
  src: url("../fonts/finlandica-italic-latin.woff2") format("woff2");
  font-weight: 400 700;
  font-style: italic;
  font-display: swap;
}

@property --bg { syntax: "<color>"; inherits: true; initial-value: #fbfbfa; }
@property --surface { syntax: "<color>"; inherits: true; initial-value: #f0f0ee; }
@property --ink { syntax: "<color>"; inherits: true; initial-value: #1c1d1f; }
@property --ink-2 { syntax: "<color>"; inherits: true; initial-value: #5f6266; }
@property --line { syntax: "<color>"; inherits: true; initial-value: #dcdcd8; }
@property --accent { syntax: "<color>"; inherits: true; initial-value: #47484b; }
@property --accent-hover { syntax: "<color>"; inherits: true; initial-value: #2c2d2f; }
@property --heading { syntax: "<color>"; inherits: true; initial-value: #1c1d1f; }
@property --deep { syntax: "<color>"; inherits: true; initial-value: #1f1f1e; }
@property --deep-ink { syntax: "<color>"; inherits: true; initial-value: #f1f1ef; }
@property --deep-ink-2 { syntax: "<color>"; inherits: true; initial-value: #a6a7a4; }
@property --deep-line { syntax: "<color>"; inherits: true; initial-value: #3a3a39; }
@property --tint { syntax: "<color>"; inherits: true; initial-value: #141517; }

:root {
  color-scheme: light;

  /* Harmaa */
  --bg: #fbfbfa;
  --surface: #f0f0ee;
  --ink: #1c1d1f;
  --ink-2: #5f6266;
  --line: #dcdcd8;
  --accent: #47484b;
  --accent-hover: #2c2d2f;
  --accent-ink: #ffffff;
  --heading: #1c1d1f;
  --deep: #1f1f1e;
  --deep-ink: #f1f1ef;
  --deep-ink-2: #a6a7a4;
  --deep-line: #3a3a39;
  --logo-ink: #33393d;
  --logo-leaf: #a88a68;
  --tint: #141517;

  --font: "Finlandica", "Segoe UI", system-ui, -apple-system, sans-serif;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-soft: cubic-bezier(0.33, 0.1, 0.25, 1);
  --scheme-dur: 0.9s;

  --gutter: clamp(20px, 4vw, 48px);
  --maxw: 1240px;
  --header-h: 112px;
  --space-section: clamp(5rem, 3.2rem + 6vw, 8.5rem);
  --radius: 6px;

  transition:
    --bg var(--scheme-dur) var(--ease-soft),
    --surface var(--scheme-dur) var(--ease-soft),
    --ink var(--scheme-dur) var(--ease-soft),
    --ink-2 var(--scheme-dur) var(--ease-soft),
    --line var(--scheme-dur) var(--ease-soft),
    --accent var(--scheme-dur) var(--ease-soft),
    --accent-hover var(--scheme-dur) var(--ease-soft),
    --heading var(--scheme-dur) var(--ease-soft),
    --deep var(--scheme-dur) var(--ease-soft),
    --deep-ink var(--scheme-dur) var(--ease-soft),
    --deep-ink-2 var(--scheme-dur) var(--ease-soft),
    --deep-line var(--scheme-dur) var(--ease-soft),
    --tint var(--scheme-dur) var(--ease-soft);
}

/* Vihreä: the same page, a forest-green undertone */
:root[data-scheme="vihrea"] {
  --bg: #f9faf6;
  --surface: #ebf1ea;
  --ink: #16222a;
  --ink-2: #566873;
  --line: #d4ddd5;
  --accent: #14473a;
  --accent-hover: #0c3128;
  --heading: #134a3c;
  --deep: #113d32;
  --deep-ink: #eef3ee;
  --deep-ink-2: #a9c1b8;
  --deep-line: #2a5446;
  --tint: #0b221c;
}

/* ---------- Base ---------- */

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: var(--header-h);
  scrollbar-color: color-mix(in srgb, var(--ink) 28%, transparent) var(--bg);
}
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.6;
  font-kerning: normal;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  caret-color: var(--accent);
}
body.menu-open { overflow: hidden; }

img, svg { display: block; max-width: 100%; }
img { height: auto; }
h1, h2, h3, p, figure, blockquote, dl, dd, ol, ul { margin: 0; }
ul[role="list"], ol[role="list"] { list-style: none; padding: 0; }
button { font: inherit; color: inherit; }

a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 0.22em; }
a:hover { text-decoration-color: currentColor; }

::selection { background: var(--accent); color: var(--accent-ink); }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
/* Stroke settings live on the <svg>, so they inherit into each <use> clone */
.icon {
  width: 1.25rem;
  height: 1.25rem;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.icon--sm { width: 1.05rem; height: 1.05rem; }

.wrap {
  width: min(100% - 2 * var(--gutter), var(--maxw));
  margin-inline: auto;
}

.nowrap { white-space: nowrap; }

.skip-link {
  position: absolute;
  left: var(--gutter);
  top: -100px;
  z-index: 100;
  padding: 0.75rem 1rem;
  background: var(--accent);
  color: var(--accent-ink);
  border-radius: var(--radius);
  text-decoration: none;
}
.skip-link:focus { top: 12px; }

/* ---------- Type ---------- */

.h2 {
  font-size: clamp(2.125rem, 1.45rem + 2.4vw, 3.5rem);
  line-height: 1.06;
  font-weight: 500;
  letter-spacing: -0.025em;
  color: var(--heading);
  text-wrap: balance;
}
.h3 {
  font-size: clamp(1.375rem, 1.2rem + 0.5vw, 1.625rem);
  line-height: 1.2;
  font-weight: 500;
  letter-spacing: -0.012em;
  color: var(--heading);
  text-wrap: balance;
}
.lead {
  font-size: clamp(1.125rem, 1.05rem + 0.3vw, 1.3125rem);
  line-height: 1.55;
  color: var(--ink-2);
  max-width: 34em;
  text-wrap: pretty;
}

/* Arrow links: the page's one link idiom */
.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 0.55em;
  font-weight: 500;
  color: var(--heading);
  text-decoration: none;
  background: linear-gradient(currentColor, currentColor) 0 100% / 0 1px no-repeat;
  padding-bottom: 2px;
  transition: background-size 0.45s var(--ease);
}
.link-arrow .icon { transition: transform 0.45s var(--ease); }
.link-arrow:hover { background-size: 100% 1px; }
.link-arrow:hover .icon { transform: translateX(4px); }
.link-arrow--light { color: #fff; }
.link-arrow--big { font-size: clamp(1.375rem, 1.2rem + 0.5vw, 1.625rem); }

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6em;
  min-height: 48px;
  padding: 0 1.35rem;
  border: 1px solid transparent;
  border-radius: var(--radius);
  font-weight: 500;
  font-size: 1rem;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 0.25s var(--ease-soft), color 0.25s var(--ease-soft), transform 0.2s var(--ease), box-shadow 0.35s var(--ease);
}
.btn:active { transform: translateY(1px); }
.btn--lg { min-height: 56px; padding: 0 1.6rem; font-size: 1.0625rem; }
.btn--block { width: 100%; }

.btn--accent { background: var(--accent); color: var(--accent-ink); }
.btn--accent:hover { background: var(--accent-hover); box-shadow: 0 10px 24px -14px color-mix(in srgb, var(--accent) 70%, transparent); }

.btn--light { background: var(--bg); color: var(--heading); }
.btn--light:hover { background: #fff; box-shadow: 0 14px 30px -16px rgba(0, 0, 0, 0.55); }

/* ---------- Header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--bg) 94%, transparent);
  -webkit-backdrop-filter: saturate(1.3) blur(12px);
  backdrop-filter: saturate(1.3) blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.4s var(--ease-soft);
}
.site-header.is-scrolled { border-bottom-color: var(--line); }

.site-header__inner {
  display: flex;
  align-items: center;
  gap: 2rem;
  height: var(--header-h);
}

.brand { display: block; flex: none; border-radius: 2px; }
.brand .logo {
  width: 174px;
  height: auto;
  transform-origin: left center;
  transition: transform 0.5s var(--ease);
}

.nav {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: clamp(1.25rem, 2.2vw, 2.25rem);
}
.nav__list { display: flex; align-items: center; gap: clamp(1rem, 1.8vw, 1.9rem); }
.nav__link {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.5rem 0;
  border: 0;
  background: linear-gradient(currentColor, currentColor) 0 calc(100% - 4px) / 0 1px no-repeat;
  font-size: 1rem;
  font-weight: 500;
  color: var(--ink);
  text-decoration: none;
  cursor: pointer;
  transition: background-size 0.4s var(--ease), color 0.3s;
}
.nav__link:hover, .nav__toggle[aria-expanded="true"] { background-size: 100% 1px; color: var(--heading); }
.nav__toggle .icon { transition: transform 0.35s var(--ease); }
.nav__toggle[aria-expanded="true"] .icon { transform: rotate(180deg); }

.nav__phone {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
  font-size: 1rem;
  color: var(--heading);
  text-decoration: none;
  white-space: nowrap;
}
.nav__phone:hover span { text-decoration: underline; }
.nav__cta { min-height: 46px; }

/* Palvelut dropdown */
.dropdown {
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  background: var(--bg);
  border-top: 1px solid var(--line);
  box-shadow: 0 30px 50px -30px rgba(20, 22, 20, 0.28);
  visibility: hidden;
  opacity: 0;
  clip-path: inset(0 0 100% 0);
  transition: clip-path 0.5s var(--ease), opacity 0.3s var(--ease-soft), visibility 0s linear 0.5s;
}
.dropdown.is-open {
  visibility: visible;
  opacity: 1;
  clip-path: inset(0 0 -60px 0);
  transition: clip-path 0.55s var(--ease), opacity 0.3s var(--ease-soft), visibility 0s;
}
.dropdown__inner {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr) minmax(0, 1.1fr);
  gap: clamp(2rem, 4vw, 4rem);
  padding-block: 2.5rem 3rem;
}
.dropdown__label {
  font-size: 1rem;
  font-weight: 600;
  color: var(--ink-2);
  margin-bottom: 0.9rem;
}
.dropdown__links { display: grid; gap: 0.15rem; }
.dropdown__links--cols { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 2rem; }
.dropdown__links a {
  display: block;
  padding: 0.45rem 0;
  font-size: 1.0625rem;
  text-decoration: none;
  color: var(--ink);
  transition: color 0.25s, transform 0.35s var(--ease);
}
.dropdown__links a:hover { color: var(--heading); transform: translateX(4px); }
.dropdown__feature {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  padding: 1.5rem;
  border-radius: var(--radius);
  background: var(--surface);
  text-decoration: none;
  transition: background-color 0.3s;
}
.dropdown__feature-title { font-size: 1.25rem; font-weight: 500; color: var(--heading); line-height: 1.25; }
.dropdown__feature-text { color: var(--ink-2); font-size: 1rem; }
.dropdown__feature .link-arrow { margin-top: auto; }
.dropdown__feature:hover .link-arrow { background-size: 100% 1px; }

/* Mobile header actions */
.header-actions { display: none; margin-left: auto; gap: 0.5rem; align-items: center; }
.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-width: 48px;
  height: 48px;
  padding: 0 0.75rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: transparent;
  color: var(--heading);
  cursor: pointer;
  text-decoration: none;
  transition: background-color 0.25s, border-color 0.25s;
}
.icon-btn:hover { background: var(--surface); }
.icon-btn__label { font-weight: 500; font-size: 1rem; }
.icon-btn--menu .icon-close { display: none; }
.icon-btn--menu[aria-expanded="true"] .icon-open { display: none; }
.icon-btn--menu[aria-expanded="true"] .icon-close { display: block; }

.mobile-menu {
  position: fixed;
  inset: var(--menu-top, 76px) 0 0 0;
  z-index: 49;
  background: var(--bg);
  overflow-y: auto;
  clip-path: inset(0 0 100% 0);
  transition: clip-path 0.55s var(--ease);
}
.mobile-menu.is-open { clip-path: inset(0); }
.mobile-menu__inner {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
  padding-block: 1.5rem 6rem;
}
.mobile-menu__links li { border-bottom: 1px solid var(--line); }
.mobile-menu__links a {
  display: block;
  padding: 1rem 0;
  font-size: clamp(1.375rem, 1.2rem + 0.5vw, 1.625rem);
  font-weight: 500;
  letter-spacing: -0.015em;
  color: var(--heading);
  text-decoration: none;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.5s var(--ease), transform 0.6s var(--ease);
}
.mobile-menu.is-open .mobile-menu__links a { opacity: 1; transform: none; }
.mobile-menu.is-open .mobile-menu__links li:nth-child(2) a { transition-delay: 0.04s; }
.mobile-menu.is-open .mobile-menu__links li:nth-child(3) a { transition-delay: 0.08s; }
.mobile-menu.is-open .mobile-menu__links li:nth-child(4) a { transition-delay: 0.12s; }
.mobile-menu.is-open .mobile-menu__links li:nth-child(5) a { transition-delay: 0.16s; }
.mobile-menu__contact { display: grid; gap: 1rem; color: var(--ink-2); }

/* ---------- Hero ---------- */

.hero {
  position: relative;
  isolation: isolate;
  display: grid;
  align-items: end;
  min-height: clamp(560px, calc(100svh - var(--header-h)), 920px);
  overflow: hidden;
  color: #fff;
  background: var(--tint);
}
.hero__media {
  position: absolute;
  inset: -6% 0 0 0;
  z-index: -3;
}
.hero__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 42%;
  animation: mist-clear 2.8s var(--ease-soft) both;
}
.hero__shade {
  position: absolute;
  inset: 0;
  z-index: -2;
  background:
    linear-gradient(90deg,
      color-mix(in srgb, var(--tint) 74%, transparent) 0%,
      color-mix(in srgb, var(--tint) 46%, transparent) 38%,
      color-mix(in srgb, var(--tint) 0%, transparent) 72%),
    linear-gradient(0deg,
      color-mix(in srgb, var(--tint) 70%, transparent) 0%,
      color-mix(in srgb, var(--tint) 0%, transparent) 46%);
}
/* Morning mist over Koli: it lifts once, then the landscape stays */
.hero__mist {
  position: absolute;
  inset: -10% 0 -30% 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(70% 45% at 22% 72%, rgba(244, 246, 244, 0.95), rgba(244, 246, 244, 0) 70%),
    radial-gradient(80% 50% at 78% 60%, rgba(240, 243, 241, 0.9), rgba(240, 243, 241, 0) 70%),
    linear-gradient(0deg, rgba(242, 244, 242, 0.92) 25%, rgba(236, 240, 238, 0.55));
  animation: mist-lift 3.6s var(--ease-soft) 0.1s both;
}

@keyframes mist-clear {
  from { filter: blur(14px) saturate(0.55) brightness(1.15); transform: scale(1.1); }
  to   { filter: blur(0) saturate(1) brightness(1); transform: scale(1.02); }
}
@keyframes mist-lift {
  from { opacity: 1; transform: translateY(0); }
  to   { opacity: 0; transform: translateY(-14%); }
}
@keyframes rise {
  from { transform: translateY(108%); }
  to   { transform: none; }
}
@keyframes fade-up {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: none; }
}

.hero__content {
  padding-block: clamp(5rem, 14vh, 10rem) clamp(1.75rem, 4vh, 2.75rem);
}
.hero__title {
  font-size: clamp(3.1rem, 1.6rem + 5.4vw, 6rem);
  line-height: 0.98;
  font-weight: 500;
  letter-spacing: -0.032em;
  margin-bottom: 1.4rem;
  text-shadow: 0 2px 30px rgba(0, 0, 0, 0.18);
}
.hero__title .line {
  display: block;
  overflow: hidden;
  padding-bottom: 0.1em;
  margin-bottom: -0.1em;
}
.hero__title .line > span {
  display: inline-block;
  animation: rise 1.3s var(--ease) both;
  animation-delay: calc(1s + var(--i) * 0.14s);
}
.hero__lead {
  max-width: 24em;
  font-size: clamp(1.1875rem, 1.05rem + 0.55vw, 1.5rem);
  line-height: 1.45;
  color: rgba(255, 255, 255, 0.92);
  animation: fade-up 1.1s var(--ease) 1.4s both;
}
.hero__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem 1.75rem;
  margin-top: 2.25rem;
  animation: fade-up 1.1s var(--ease) 1.55s both;
}
.hero__facts {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem 2.5rem;
  margin-top: clamp(3rem, 9vh, 5.5rem);
  padding-top: 1.15rem;
  border-top: 1px solid rgba(255, 255, 255, 0.28);
  font-size: 1rem;
  color: rgba(255, 255, 255, 0.9);
  animation: fade-up 1.1s var(--ease) 1.8s both;
}
.hero__facts li { display: inline-flex; align-items: center; gap: 0.5rem; }
.hero :focus-visible { outline-color: #fff; }
@media (min-width: 1121px) {
  /* the hairline stops short of the floating scheme switch */
  .hero__facts { margin-right: 300px; }
}

/* ---------- Sections ---------- */

.section { padding-block: var(--space-section); }
.section--tight { padding-top: 0; }
.section--band { background: var(--surface); }

.section-head {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  gap: 1.5rem clamp(2rem, 6vw, 6rem);
  align-items: start;
  margin-bottom: clamp(2.5rem, 5vw, 4rem);
}
.section-head__aside { display: grid; gap: 1.25rem; justify-items: start; }

/* Miten aloitan: three lifts */
.start__title { margin-bottom: clamp(1.75rem, 3vw, 2.5rem); }
.lifts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 2.5rem clamp(1.5rem, 3vw, 2.5rem);
}
.lift { display: flex; flex-direction: column; }
.lift__img {
  aspect-ratio: 3 / 2;
  overflow: hidden;
  border-radius: 4px;
  background: var(--surface);
}
.lift__img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 1.2s var(--ease);
}
.lift:hover .lift__img img { transform: scale(1.04); }
.lift__body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  padding-top: 1.5rem;
}
.lift__text { color: var(--ink-2); max-width: 26em; }
.lift__meta {
  display: grid;
  gap: 0.35rem;
  justify-items: start;
  margin-top: auto;
  padding-top: 1.25rem;
  color: var(--ink);
}
.lift__link { color: var(--ink); text-decoration: none; overflow-wrap: anywhere; }
.lift__link:hover { color: var(--heading); text-decoration: underline; }

/* Kun läheinen on kuollut / Palvelut ja hinnasto: two lifts on the band */
.duo { padding-block: clamp(3.5rem, 2.5rem + 3vw, 5.5rem); }
.duo__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 2.5rem clamp(2rem, 6vw, 6.5rem);
}
.duo__item { display: grid; gap: 0.9rem; justify-items: start; align-content: start; }
.duo__title {
  font-size: clamp(1.75rem, 1.35rem + 1.3vw, 2.5rem);
  line-height: 1.1;
  font-weight: 500;
  letter-spacing: -0.02em;
  color: var(--heading);
  text-wrap: balance;
}
.duo__item .link-arrow { margin-top: 0.35rem; }

/* Palvelupaketit */
.pk {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 2.5rem clamp(2rem, 6vw, 6rem);
  align-items: start;
}
.pk__stage {
  position: sticky;
  top: calc(var(--header-h) + 1.5rem);
  aspect-ratio: 4 / 5;
  max-height: calc(100svh - var(--header-h) - 3rem);
  width: 100%;
  overflow: hidden;
  border-radius: 4px;
  background: var(--surface);
}
.pk__stage img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transform: scale(1.06);
  transition: opacity 1s var(--ease-soft), transform 1.8s var(--ease);
}
.pk__stage img.is-active { opacity: 1; transform: scale(1); }
.pk__caption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  padding: 3.5rem 1.5rem 1.25rem;
  background: linear-gradient(0deg, color-mix(in srgb, var(--tint) 62%, transparent), transparent);
  color: #fff;
  font-size: 1.25rem;
  font-weight: 500;
}

.pk__caption.is-changing span { animation: fade-up 0.6s var(--ease) both; }

.pk__list { border-bottom: 1px solid var(--line); }
.pk-item { border-top: 1px solid var(--line); }
.pk-item__heading { font: inherit; }
.pk-item__head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto 1.5rem;
  align-items: baseline;
  gap: 0.35rem 1.25rem;
  width: 100%;
  padding: 1.5rem 0;
  border: 0;
  background: none;
  text-align: left;
  cursor: pointer;
}
.pk-item__name {
  font-size: clamp(1.5rem, 1.3rem + 0.8vw, 2rem);
  line-height: 1.15;
  font-weight: 500;
  letter-spacing: -0.02em;
  color: var(--heading);
  transition: transform 0.5s var(--ease);
}
.pk-item__price {
  font-size: 1.25rem;
  font-weight: 500;
  color: var(--heading);
  white-space: nowrap;
}
.pk-item__tagline { grid-column: 1 / 3; color: var(--ink-2); max-width: 34em; }
.pk-item__icon {
  position: relative;
  grid-column: 3;
  grid-row: 1;
  align-self: center;
  width: 1.1rem;
  height: 1.1rem;
  color: var(--heading);
}
.pk-item__icon::before,
.pk-item__icon::after {
  content: "";
  position: absolute;
  left: 0;
  top: calc(50% - 0.75px);
  width: 100%;
  height: 1.5px;
  background: currentColor;
  transition: transform 0.5s var(--ease);
}
.pk-item__icon::after { transform: rotate(90deg); }
.pk-item.is-open .pk-item__icon::after { transform: rotate(0deg); }
.pk-item__head:hover .pk-item__name { transform: translateX(4px); }

.pk-item__body {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.6s var(--ease);
}
.pk-item.is-open .pk-item__body { grid-template-rows: 1fr; }
.pk-item__inner { overflow: hidden; }
.pk-item__inner .ticks { padding-bottom: 1.75rem; }
.pk-item:not(.is-open) .pk-item__inner { visibility: hidden; transition: visibility 0s linear 0.6s; }

.ticks { display: grid; gap: 0.5rem; }
.ticks li {
  position: relative;
  padding-left: 1.6rem;
  color: var(--ink);
  max-width: 36em;
}
.ticks li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.78em;
  width: 0.8rem;
  height: 1px;
  background: var(--heading);
}
.packages__note { margin-top: 2rem; color: var(--ink-2); font-size: 1rem; }

/* Palvelumme */
.svc {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: clamp(2rem, 5vw, 5rem);
}
.svc li { border-top: 1px solid var(--line); }
.svc li:nth-last-child(-n + 2) { border-bottom: 1px solid var(--line); }
.svc__link {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) auto;
  align-items: center;
  gap: 1.25rem;
  padding: 1.1rem 0;
  text-decoration: none;
}
.svc__img {
  width: 72px;
  height: 72px;
  overflow: hidden;
  border-radius: 4px;
  background: var(--surface);
}
.svc__img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(0.85);
  transition: transform 0.8s var(--ease), filter 0.5s;
}
.svc__text { display: grid; gap: 0.15rem; }
.svc__name { font-size: 1.25rem; font-weight: 500; color: var(--heading); line-height: 1.25; }
.svc__desc { color: var(--ink-2); font-size: 1rem; line-height: 1.45; }
.svc__arrow { color: var(--heading); opacity: 0.45; transition: transform 0.45s var(--ease), opacity 0.3s; }
.svc__link:hover .svc__img img { transform: scale(1.1); filter: saturate(1); }
.svc__link:hover .svc__arrow { transform: translateX(5px); opacity: 1; }
.svc__link:hover .svc__name { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.2em; }
.services__note { margin-top: 2rem; color: var(--ink-2); font-size: 1rem; }
.services__note a { color: var(--heading); }

/* Tule keskustelemaan */
.meet {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  background: var(--surface);
}
.meet__text {
  display: grid;
  gap: 1.5rem;
  align-content: center;
  justify-items: start;
  padding-block: var(--space-section);
  padding-left: max(var(--gutter), (100vw - var(--maxw)) / 2);
  padding-right: clamp(2rem, 6vw, 6rem);
}
.meet__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem 1.75rem; margin-top: 0.5rem; }
.meet__facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.5rem 2rem;
  width: 100%;
  max-width: 32rem;
  margin-top: 1.25rem;
  padding-top: 1.75rem;
  border-top: 1px solid var(--line);
}
.meet__facts dt { font-size: 1rem; font-weight: 600; color: var(--ink-2); margin-bottom: 0.2rem; }
.meet__facts dd { color: var(--ink); }
.meet__facts a { color: var(--heading); text-decoration: none; font-weight: 500; }
.meet__facts a:hover { text-decoration: underline; }
.meet__media { position: relative; min-height: 100%; overflow: hidden; }
.meet__media img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 60%;
}

/* Historia */
.archive {
  display: grid;
  grid-template-columns: minmax(0, 4fr) minmax(0, 7fr);
  gap: 2.5rem clamp(2rem, 6vw, 6.5rem);
  align-items: center;
}
.archive__doc img {
  width: 100%;
  border-radius: 2px;
  box-shadow: 0 24px 50px -28px rgba(40, 32, 20, 0.45), 0 2px 6px -2px rgba(40, 32, 20, 0.2);
  transform: rotate(-1.2deg);
}
.archive__doc figcaption, .eco__media figcaption {
  margin-top: 1rem;
  font-size: 1rem;
  color: var(--ink-2);
}
.archive__quote { display: grid; gap: 1.25rem; }
.archive__quote blockquote p {
  font-size: clamp(1.5rem, 1.15rem + 1.3vw, 2.25rem);
  line-height: 1.32;
  font-style: italic;
  font-weight: 400;
  letter-spacing: -0.012em;
  color: var(--heading);
  text-wrap: pretty;
}
.archive__cite { font-weight: 600; font-size: 1rem; color: var(--ink); }
.archive__after { color: var(--ink-2); max-width: 36em; }

.timeline {
  position: relative;
  margin-block: clamp(4rem, 8vw, 6.5rem);
  --p: 0;
}
.timeline__track {
  position: absolute;
  left: 0;
  right: 0;
  top: 5px;
  height: 1px;
  background: var(--line);
}
.timeline__progress {
  position: absolute;
  inset: 0;
  background: var(--heading);
  transform-origin: left center;
  transform: scaleX(var(--p));
}
.timeline__list {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 1.5rem;
}
.timeline__item { position: relative; display: grid; gap: 0.4rem; align-content: start; padding-top: 2rem; }
.timeline__item p:not(.timeline__year) { font-size: 1rem; line-height: 1.5; color: var(--ink-2); }
.timeline__dot {
  position: absolute;
  top: 0;
  left: 0;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  border: 1px solid var(--heading);
  background: var(--bg);
  transition: background-color 0.5s var(--ease-soft), transform 0.6s var(--ease);
}
.timeline__year {
  font-size: clamp(1.375rem, 1.2rem + 0.5vw, 1.625rem);
  font-weight: 500;
  letter-spacing: -0.015em;
  color: var(--heading);
  font-variant-numeric: lining-nums;
  transition: opacity 0.6s var(--ease-soft);
}
.timeline__item.is-reached .timeline__dot { background: var(--heading); transform: scale(1.15); }

.eco {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  gap: 2.5rem clamp(2rem, 6vw, 6.5rem);
  align-items: center;
}
.eco__media img { width: 100%; border-radius: 2px; filter: sepia(0.15); }
.eco__text { display: grid; gap: 1rem; justify-items: start; }
.eco__text p { color: var(--ink-2); max-width: 34em; }
.eco__links { display: flex; flex-wrap: wrap; gap: 0.75rem 2.25rem; margin-top: 0.5rem; }

/* ---------- Footer ---------- */

.site-footer {
  --logo-ink: var(--deep-ink);
  --logo-leaf: #c8aa86;
  background: var(--deep);
  color: var(--deep-ink);
  /* the bottom clears the floating scheme switch, which returns at the page end */
  padding-block: clamp(3.5rem, 6vw, 5rem) 5.5rem;
}
.site-footer ::selection { background: var(--deep-ink); color: var(--deep); }
.site-footer :focus-visible { outline-color: var(--deep-ink); }
.footer__top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 2.5rem clamp(2rem, 5vw, 5rem);
  align-items: center;
}
.footer__call { display: grid; gap: 0.25rem; justify-items: start; }
.footer__title { font-size: clamp(1.375rem, 1.2rem + 0.5vw, 1.625rem); font-weight: 400; margin-bottom: 0.5rem; }
.footer__phone {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  font-size: clamp(1.5rem, 1.3rem + 0.8vw, 2rem);
  line-height: 1.15;
  font-weight: 500;
  letter-spacing: -0.02em;
  text-decoration: none;
}
.footer__phone .icon { width: 1.6rem; height: 1.6rem; }
.footer__phone--2 { padding-left: 2.35rem; font-size: clamp(1.375rem, 1.2rem + 0.5vw, 1.625rem); color: var(--deep-ink-2); }
.footer__phone:hover { text-decoration: underline; text-decoration-thickness: 1px; }
.footer__brand { display: block; border-radius: 2px; }
.footer__brand .logo { width: 220px; }
.footer__contact { display: grid; gap: 1rem; justify-self: end; }
.footer__contact li { display: flex; align-items: center; gap: 0.9rem; }
.footer__contact .icon { color: var(--deep-ink-2); }
.footer__contact a { text-decoration: none; }
.footer__contact a:hover { text-decoration: underline; }

.footer__nav { margin-top: clamp(3rem, 5vw, 4rem); padding-block: 1.5rem; border-block: 1px solid var(--deep-line); }
.footer__nav ul { display: flex; flex-wrap: wrap; gap: 0.75rem 2rem; }
.footer__nav a { color: var(--deep-ink-2); text-decoration: none; font-size: 1rem; transition: color 0.25s; }
.footer__nav a:hover { color: var(--deep-ink); text-decoration: underline; }

.footer__bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 1rem 2rem;
  padding-top: 1.5rem;
  font-size: 1rem;
  color: var(--deep-ink-2);
}
.footer__member { display: inline-flex; align-items: center; gap: 0.75rem; }
.footer__member img { width: 36px; height: 36px; filter: invert(1); opacity: 0.75; }

/* ---------- Scheme switch ---------- */

.scheme {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 60;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 5px 5px 5px 1rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  box-shadow: 0 12px 30px -14px rgba(10, 20, 15, 0.35);
  font-size: 1rem;
  /* backwards, not both: a held end-state would override the tuck transform */
  animation: fade-up 0.8s var(--ease) 2.2s backwards;
  transition: transform 0.5s var(--ease), opacity 0.35s var(--ease-soft);
}
.scheme.is-tucked:not(:focus-within) { transform: translateY(calc(100% + 24px)); opacity: 0; pointer-events: none; }
.scheme__label { color: var(--ink-2); font-weight: 500; }
.scheme__options { position: relative; display: flex; }
.scheme__thumb {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: var(--thumb-w, 50%);
  border-radius: 999px;
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--line);
  transform: translateX(var(--thumb-x, 0));
  transition: transform 0.55s var(--ease);
}
.scheme__opt {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-height: 36px;
  padding: 0 0.85rem;
  border: 0;
  border-radius: 999px;
  background: none;
  color: var(--ink-2);
  font-weight: 500;
  cursor: pointer;
  transition: color 0.3s;
}
.scheme__opt[aria-checked="true"] { color: var(--heading); }
.scheme__opt:focus-visible { outline-offset: 0; border-radius: 999px; }
.scheme__swatch {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ink) 14%, transparent);
}
.scheme__swatch--harmaa { background: #47484b; }
.scheme__swatch--vihrea { background: #14473a; }

/* ---------- Reveals (only when main.js is running) ---------- */

.reveal-ready [data-reveal="stagger"] > * > * { opacity: 0; transform: translateY(16px); }
.reveal-ready [data-reveal="stagger"] > *::before { transform: scaleX(0); }
.reveal-ready [data-reveal="stagger"].is-in > * > * {
  opacity: 1;
  transform: none;
  transition: opacity 0.9s var(--ease-soft), transform 1.1s var(--ease);
  transition-delay: calc(var(--i, 0) * 0.16s + 0.15s);
}
.reveal-ready [data-reveal="stagger"].is-in > *::before {
  transform: scaleX(1);
  transition: transform 1.2s var(--ease);
  transition-delay: calc(var(--i, 0) * 0.16s);
}

.reveal-ready [data-reveal="clip"] img { clip-path: inset(0 0 0 100%); transform: scale(1.08); }
.reveal-ready [data-reveal="clip"].is-in img {
  clip-path: inset(0);
  transform: none;
  transition: clip-path 1.5s var(--ease), transform 2.2s var(--ease);
}

.reveal-ready [data-reveal="fade"] { opacity: 0; transform: translateY(20px); }
.reveal-ready [data-reveal="fade"].is-in {
  opacity: 1;
  transform: none;
  transition: opacity 1s var(--ease-soft), transform 1.2s var(--ease);
}

/* ---------- Responsive ---------- */

@media (max-width: 1120px) {
  .nav { display: none; }
  .header-actions { display: flex; }
  :root { --header-h: 92px; }
  .brand .logo { width: 142px; }
  .timeline__list { grid-template-columns: repeat(4, minmax(0, 1fr)); row-gap: 2.5rem; }
  .timeline__track { display: none; }
  .timeline__item::before {
    content: "";
    position: absolute;
    top: 5px;
    left: 0;
    right: -1.5rem;
    height: 1px;
    background: var(--line);
  }
}

@media (max-width: 900px) {
  .section-head,
  .archive,
  .eco { grid-template-columns: minmax(0, 1fr); }

  .lifts { grid-template-columns: minmax(0, 1fr); gap: 3rem; }
  .lift__img { aspect-ratio: 16 / 9; }
  .duo__grid { grid-template-columns: minmax(0, 1fr); }
  .pk { grid-template-columns: minmax(0, 1fr); }
  .pk__stage { position: relative; top: 0; aspect-ratio: 3 / 2; max-height: none; }

  .meet { grid-template-columns: minmax(0, 1fr); }
  .meet__media { min-height: 0; aspect-ratio: 3 / 2; order: -1; }
  .meet__text { padding-inline: var(--gutter); padding-block: clamp(3.5rem, 8vw, 5rem); }

  .archive__doc { max-width: 22rem; }
  .eco__media { order: 1; }

  .footer__top { grid-template-columns: minmax(0, 1fr); justify-items: start; }
  .footer__brand { order: -1; }
  .footer__contact { justify-self: start; }
}

@media (max-width: 720px) {
  .svc { grid-template-columns: minmax(0, 1fr); }
  .svc li:nth-last-child(2) { border-bottom: 0; }
  .svc__link { grid-template-columns: 60px minmax(0, 1fr) auto; gap: 1rem; }
  .svc__img { width: 60px; height: 60px; }

  .timeline__list { grid-template-columns: minmax(0, 1fr); row-gap: 0; }
  .timeline__item { padding: 0 0 2rem 2.25rem; }
  .timeline__item::before { top: 0; bottom: 0; left: 5px; right: auto; width: 1px; height: auto; }
  .timeline__item:last-child::before { display: none; }
  .timeline__item:last-child { padding-bottom: 0; }
  .timeline__item::after {
    content: "";
    position: absolute;
    top: 0;
    left: 5px;
    width: 1px;
    height: 100%;
    background: var(--heading);
    transform-origin: top center;
    transform: scaleY(0);
    transition: transform 0.8s var(--ease);
  }
  .timeline__item.is-reached::after { transform: scaleY(1); }
  .timeline__item:last-child::after { display: none; }
}

@media (max-width: 560px) {
  :root { --header-h: 80px; }
  .brand .logo { width: 124px; }
  .icon-btn__label { display: none; }

  .hero { min-height: max(560px, calc(100svh - var(--header-h) - 40px)); }
  .hero__shade {
    background: linear-gradient(0deg,
      color-mix(in srgb, var(--tint) 80%, transparent) 0%,
      color-mix(in srgb, var(--tint) 52%, transparent) 42%,
      color-mix(in srgb, var(--tint) 0%, transparent) 68%);
  }
  .hero__media { inset: -38% 0 0 0; }
  .hero__media img { object-position: 64% 100%; }
  .hero__actions { flex-direction: column; align-items: stretch; }
  .hero__actions .btn { width: 100%; }
  .hero__actions .link-arrow { align-self: flex-start; }
  .hero__facts { flex-direction: column; gap: 0.35rem; margin-top: 2.5rem; }

  .meet__facts { grid-template-columns: minmax(0, 1fr); }
  .meet__actions .btn { width: 100%; }

  .pk__caption { padding: 2.5rem 1.1rem 1rem; font-size: 1.0625rem; }
  .pk-item__head { padding: 1.25rem 0; }

  .footer__bottom { flex-direction: column; align-items: flex-start; }

  .scheme { right: 12px; bottom: 12px; padding-left: 5px; }
  .scheme__label { display: none; }
}

/* ---------- Reduced motion: keep state changes, drop travel ---------- */

@media (prefers-reduced-motion: reduce) {
  :root { --scheme-dur: 0.3s; }
  .hero__media img { animation: none; }
  .hero__mist { animation: fade-out 0.6s linear both; }
  .hero__title .line > span,
  .hero__lead,
  .hero__actions,
  .hero__facts { animation: fade-in 0.5s linear both; }
  .scheme { animation: fade-in 0.5s linear backwards; }
  .reveal-ready [data-reveal] *,
  .reveal-ready [data-reveal],
  .reveal-ready [data-reveal] > *::before { transform: none !important; clip-path: none !important; }
  .pk__stage img { transform: none; transition: opacity 0.4s linear; }
  .mobile-menu { transition: none; }
  .mobile-menu__links a { transform: none; }
  .dropdown, .dropdown.is-open { clip-path: none; }
  *, *::before, *::after { scroll-behavior: auto; }
}
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes fade-out { from { opacity: 1; } to { opacity: 0; } }
