/* Maantähti — stripped-down customer site.
   Front page: one full-viewport landscape photograph, the wordmark + logo
   top-left, three photo cards (2:1) on the bottom. Nothing else.
   Subpages: plainline (S1 centered typographic measure) for konsultointi and
   pienviljely; mercato-shelf (S2 alternating split panels) for
   perinnesaunoitus — each on its own ground: light blue gradient / soft green
   paper / dark smoke-sauna gradient.
   Type: Syne (wordmark only) · Spectral 400/600 (display) · Spline Sans (body)
   · Spline Sans Mono (section numbers, labels). */

@font-face {
  font-family: "Syne";
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url("/assets/fonts/syne-variable-latin.woff2") format("woff2");
}
@font-face {
  font-family: "Spectral";
  src: url("/assets/fonts/spectral-600-latin.woff2") format("woff2");
  font-weight: 600; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Spectral";
  src: url("/assets/fonts/spectral-400-latin.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Spline Sans";
  src: url("/assets/fonts/spline-sans-variable-latin.woff2") format("woff2");
  font-weight: 300 700; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Spline Sans Mono";
  src: url("/assets/fonts/spline-sans-mono-variable-latin.woff2") format("woff2");
  font-weight: 300 700; font-style: normal; font-display: swap;
}

:root {
  --azure: #4863A0;
  --gold: #F2D48A;
  --display: "Spectral", Georgia, serif;
  --body: "Spline Sans", system-ui, sans-serif;
  --mono: "Spline Sans Mono", ui-monospace, monospace;
  --wordmark: "Syne", "Trebuchet MS", sans-serif;
  --measure: 34rem;
  --shell: 1120px;
  --pad: 1.35rem;

  /* per-page ground; overridden on body.page-* below */
  --ground: #FBFBF9;
  --ink: #16243A;
  --ink-soft: #45566E;
  --line: rgba(22, 36, 58, 0.16);
  --line-strong: rgba(22, 36, 58, 0.38);
  --accent: #4863A0;
  --accent-deep: #34497A;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--body);
  font-size: 1rem;
  line-height: 1.75;
  overflow-x: hidden;
  font-synthesis-weight: none;
  /* the page grounds are gradients: they must reach the viewport bottom even
     when the content is short */
  min-height: 100svh;
}
img { display: block; max-width: 100%; height: auto; }
a { color: var(--accent); text-underline-offset: 0.22em; text-decoration-thickness: 1px; }
a:hover, a:focus-visible { color: var(--accent-deep); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip-path: inset(50%); white-space: nowrap;
}
.skip-link {
  position: absolute; left: -999px; top: 0.5rem; z-index: 100;
  background: #fff; color: #111; padding: 0.6rem 1rem; border-radius: 6px;
  font-weight: 600; text-decoration: none;
}
.skip-link:focus { left: 0.5rem; }

/* ================================================================
   Brand mark — wordmark + logo placeholder (shared by every page)
   ================================================================ */
.brand {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.55rem;
  text-decoration: none;
  color: inherit;
}
.brand-name {
  font-family: var(--wordmark);
  font-weight: 700;
  font-size: 1.0625rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.brand-logo { display: block; width: 3.25rem; height: 3.25rem; color: var(--gold); }
.brand-logo svg { width: 100%; height: 100%; display: block; }

/* ================================================================
   ETUSIVU — the cover is the whole page
   ================================================================ */
body.page-etusivu { background: #0E1522; color: #F4F3FB; }

.cover {
  position: relative;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 2rem;
  overflow: hidden;
  padding: 1.5rem var(--pad) calc(1.5rem + env(safe-area-inset-bottom));
  isolation: isolate;
}
.cover-media { position: absolute; inset: 0; z-index: -2; }
.cover-media img {
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: 50% 45%;
}
/* light scrim: only the top-left corner and the bottom edge, where the
   wordmark and the cards sit */
.cover-scrim {
  position: absolute; inset: 0; z-index: -1;
  background:
    linear-gradient(180deg, rgba(8, 14, 24, 0.42) 0%, rgba(8, 14, 24, 0) 30%),
    linear-gradient(0deg, rgba(8, 14, 24, 0.62) 0%, rgba(8, 14, 24, 0.18) 28%, rgba(8, 14, 24, 0) 48%);
}
.cover .brand { filter: drop-shadow(0 1px 8px rgba(8, 14, 24, 0.55)); }

.siirtymat {
  width: min(100%, var(--shell));
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  list-style: none;
  padding: 0;
  max-width: 58rem;
}
.siirtyma {
  display: block;
  text-decoration: none;
  color: #F4F3FB;
  border-radius: 12px;
  overflow: hidden;
  background: rgba(8, 14, 24, 0.5);
  border: 1px solid rgba(244, 243, 251, 0.18);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  transition: transform 0.3s ease, border-color 0.3s ease;
}
.siirtyma:hover, .siirtyma:focus-visible { color: #fff; transform: translateY(-4px); border-color: rgba(242, 212, 138, 0.75); }
.siirtyma picture { display: block; aspect-ratio: 2 / 1; overflow: hidden; }
.siirtyma img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.9s ease; }
.siirtyma:hover img { transform: scale(1.04); }
.siirtyma-label {
  display: flex; align-items: center; justify-content: space-between; gap: 0.5rem;
  padding: 0.6rem 0.9rem 0.65rem;
  font-family: var(--display);
  font-weight: 600;
  font-size: 1.0625rem;
  letter-spacing: 0.01em;
}
.siirtyma-label .arrow { color: var(--gold); font-family: var(--body); }

@media (prefers-reduced-motion: no-preference) {
  .cover-media img { animation: settle 14s ease-out both; }
  @keyframes settle { from { transform: scale(1.05); } to { transform: none; } }
  .cover .brand, .siirtymat > li { animation: rise 0.9s cubic-bezier(0.2, 0.7, 0.3, 1) both; }
  .siirtymat > li:nth-child(1) { animation-delay: 0.2s; }
  .siirtymat > li:nth-child(2) { animation-delay: 0.3s; }
  .siirtymat > li:nth-child(3) { animation-delay: 0.4s; }
  @keyframes rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
}

@media (min-width: 701px) {
  /* lift the cards off the bottom edge by roughly a tenth of the viewport */
  .cover { padding-bottom: calc(10svh + 1.5rem); }
}

@media (max-width: 700px) {
  /* cards become rows — image left, label right — so all three fit on one
     phone screen without leaving the photograph */
  .siirtymat { grid-template-columns: 1fr; gap: 0.7rem; max-width: 30rem; }
  .siirtyma { display: grid; grid-template-columns: 44% 1fr; align-items: center; }
  .siirtyma picture { aspect-ratio: 2 / 1; height: 100%; }
  .siirtyma-label { padding: 0.75rem 0.9rem; font-size: 1rem; min-width: 0; }
  .siirtyma-label span:first-child { min-width: 0; hyphens: manual; overflow-wrap: anywhere; }
}

/* ================================================================
   SUBPAGES — shared chrome
   ================================================================ */
.topbar {
  max-width: var(--shell);
  margin: 0 auto;
  padding: 1.1rem var(--pad) 0.9rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1.5rem;
}
.topbar .brand { flex-direction: row; align-items: center; gap: 0.7rem; }
.topbar .brand-logo { width: 2rem; height: 2rem; }
.topbar .brand-name { font-size: 0.875rem; }
.topbar nav { display: flex; flex-wrap: wrap; gap: 0.35rem 1.4rem; }
.topbar nav a {
  font-family: var(--mono);
  font-size: 0.74rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-soft);
  text-decoration: none;
  padding-bottom: 2px;
  border-bottom: 1px solid transparent;
  transition: color 0.15s ease, border-color 0.15s ease;
}
.topbar nav a:hover, .topbar nav a:focus-visible { color: var(--ink); border-bottom-color: var(--ink); }
.topbar nav a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--line-strong); }

.kicker {
  margin: 0 0 1.25rem;
  font-family: var(--mono);
  font-size: 0.74rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.num {
  margin: 0 0 0.9rem;
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.16em;
  color: var(--ink-soft);
}
h1, h2, h3 { margin: 0; font-family: var(--display); font-weight: 600; text-wrap: balance; }
h1 { font-size: clamp(2.1rem, 8.5vw, 3.1rem); line-height: 1.18; letter-spacing: -0.015em; }
h2 { font-size: clamp(1.5rem, 5.5vw, 1.95rem); line-height: 1.3; letter-spacing: -0.01em; }
h3 { font-size: 1.2rem; line-height: 1.35; }
p { margin: 0; }
.rule { border: 0; border-top: 1px solid var(--line); margin: 0; }

/* full-measure photograph (plainline: one photo, nothing else) */
.photo {
  margin: 2.5rem 0 0;
  border-radius: 6px;
  overflow: hidden;
  aspect-ratio: 4 / 5;
  background: var(--line);
}
.photo img { width: 100%; height: 100%; object-fit: cover; }

/* contact rows — plain definition rows, no buttons */
.contact { margin: 2.25rem 0 0; text-align: left; }
.contact > div {
  border-top: 1px solid var(--line);
  padding: 0.9rem 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.1rem;
}
.contact dt {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.contact dd { margin: 0; }

.footer {
  padding: 3.5rem var(--pad) 1rem;
  text-align: center;
  color: var(--ink-soft);
  font-size: 0.85rem;
}
.footer p { margin: 0 0 0.4rem; }
.footer .rule { margin: 0 auto 2rem; max-width: var(--measure); }
.footer .small { font-size: 0.8rem; }
.footer a { color: inherit; }

/* --- Tekoälyilmoitus (EU AI Act 50 art.) — webpages/kit/ai-disclosure/ --- */
.ai-note {
  margin: 1.5rem auto 0;
  max-width: 62ch;
  padding: 0 1rem 2rem;
  font-size: 0.75rem;
  line-height: 1.55;
}
.footer .ai-note { margin: 1.5rem auto 0; }
.ai-note strong { font-weight: 600; }

/* ================================================================
   PLAINLINE pages — konsultointi, pienviljely (S1 centered measure)
   ================================================================ */
.stage, .block { max-width: var(--measure); margin: 0 auto; padding-left: var(--pad); padding-right: var(--pad); }
.stage { padding-top: 3.5rem; text-align: center; }
.lede {
  margin: 1.6rem auto 0;
  max-width: 30rem;
  font-size: 1.06rem;
  line-height: 1.8;
  color: var(--ink-soft);
}
.stage .rule { margin-top: 3.25rem; }

.block { padding-top: 3.25rem; padding-bottom: 0.5rem; text-align: center; }
.block-lede { margin: 1rem auto 0; max-width: 30rem; color: var(--ink-soft); }
.block > p { text-wrap: pretty; }
.prose { text-align: left; }
.prose p { margin: 1.25rem 0 0; color: var(--ink-soft); }
.prose p:first-child { margin-top: 1.75rem; }
.prose .note { font-family: var(--mono); font-size: 0.78rem; letter-spacing: 0.03em; }

/* hairline-separated rows (never cards) */
.list { list-style: none; counter-reset: item; margin: 2.5rem 0 0; padding: 0; text-align: left; }
.list > li { counter-increment: item; border-top: 1px solid var(--line); padding: 1.4rem 0 1.5rem; }
.list > li::before {
  content: counter(item, decimal-leading-zero);
  display: block;
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  color: var(--line-strong);
  margin-bottom: 0.4rem;
}
.list h3 { margin: 0 0 0.5rem; }
.list p { margin: 0; color: var(--ink-soft); }

.bullets {
  margin: 1.25rem 0 0; padding: 0.9rem 0; list-style: none; text-align: left;
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
}
.bullets li {
  position: relative; padding: 0.3rem 0 0.3rem 1.4rem; color: var(--ink-soft);
}
.bullets li::before { content: "•"; position: absolute; left: 0.3rem; color: var(--ink); }
.bullets + .rule { display: none; } /* the list's own bottom line closes the stage */
.bullets-intro { margin: 1.75rem 0 0; text-align: left; color: var(--ink); }

/* ---- konsultointi: light blue, not a flat colour ---- */
body.page-konsultointi {
  --ground: #DCE9F4;
  --ink: #16243A;
  --ink-soft: #45566E;
  --line: rgba(22, 36, 58, 0.16);
  --line-strong: rgba(22, 36, 58, 0.38);
  --accent: #34497A;
  --accent-deep: #22335A;
  background:
    radial-gradient(120% 55% at 50% 0%, rgba(255, 255, 255, 0.85) 0%, rgba(255, 255, 255, 0) 65%),
    linear-gradient(180deg, #EEF5FA 0%, #D9E7F3 42%, #C3D7EA 100%);
  background-color: #D9E7F3;
}

/* ---- pienviljely: soft green paper ---- */
body.page-pienviljely {
  --ground: #EEF2E6;
  --ink: #1F2A1C;
  --ink-soft: #4C5A46;
  --line: rgba(31, 42, 28, 0.16);
  --line-strong: rgba(31, 42, 28, 0.38);
  --accent: #3C5A2E;
  --accent-deep: #2A4020;
  background:
    radial-gradient(120% 55% at 50% 0%, rgba(255, 255, 255, 0.8) 0%, rgba(255, 255, 255, 0) 65%),
    linear-gradient(180deg, #F6F8F1 0%, #E7EEDC 50%, #D6E2C8 100%);
  background-color: #E7EEDC;
}

/* ================================================================
   MERCATO-SHELF page — perinnesaunoitus (S2 alternating split panels)
   on a dark smoke-sauna ground
   ================================================================ */
body.page-sauna {
  --ground: #100C0A;
  --ink: #F1E9DC;
  --ink-soft: #C9BBA8;
  --line: rgba(241, 233, 220, 0.16);
  --line-strong: rgba(241, 233, 220, 0.4);
  --accent: #E0AC72;
  --accent-deep: #F1C892;
  --ember: #D9A066;
  background:
    radial-gradient(80% 50% at 85% 0%, rgba(150, 88, 36, 0.32) 0%, rgba(150, 88, 36, 0) 70%),
    radial-gradient(60% 40% at 10% 100%, rgba(120, 70, 30, 0.18) 0%, rgba(120, 70, 30, 0) 70%),
    linear-gradient(180deg, #1E1613 0%, #120D0B 40%, #0A0807 100%);
  background-color: #120D0B;
}
body.page-sauna .brand-logo { color: var(--ember); }
body.page-sauna .topbar { border-bottom: 1px solid var(--line); }
body.page-sauna .kicker, body.page-sauna .num { color: var(--ember); }
body.page-sauna .skip-link { background: #F1E9DC; color: #100C0A; }

.hero {
  max-width: var(--shell);
  margin: 0 auto;
  padding: 2.5rem var(--pad) 3rem;
  display: grid;
  gap: 2rem;
}
.hero-text h1 { margin-bottom: 1.1rem; }
.hero .lede { margin: 0; max-width: 46ch; }
.hero-media, .split-media { border-radius: 6px; overflow: hidden; aspect-ratio: 4 / 5; background: rgba(255, 255, 255, 0.04); }
.hero-media img, .split-media img { width: 100%; height: 100%; object-fit: cover; }

.split {
  max-width: var(--shell);
  margin: 0 auto;
  padding: 2.5rem var(--pad);
  display: grid;
  gap: 1.75rem;
  border-top: 1px solid var(--line);
}
.split-body .kicker { margin-bottom: 0.75rem; }
.split-body h2 { margin-bottom: 0.85rem; }
.split-body p { color: var(--ink-soft); margin: 0 0 1.1rem; max-width: 52ch; }
.split-body p:last-child { margin-bottom: 0; }
.split-body .contact { margin-top: 1.25rem; max-width: 34rem; }

@media (min-width: 860px) {
  .hero { grid-template-columns: 1.05fr 0.95fr; align-items: center; gap: 3.5rem; padding: 4rem 1.5rem 4.5rem; }
  .split { grid-template-columns: 1fr 1fr; align-items: center; gap: 3.5rem; padding: 4rem 1.5rem; }
  .split--flip .split-media { order: 2; }
  .split-media { max-width: 30rem; justify-self: center; }
  .hero-media { max-width: 32rem; justify-self: center; }
}

/* ================================================================
   Desktop sizes for the plainline pages
   ================================================================ */
@media (min-width: 720px) {
  :root { --pad: 2rem; }
  body { font-size: 1.02rem; }
  .stage { padding-top: 5rem; }
  .stage .rule { margin-top: 4.5rem; }
  .block { padding-top: 5rem; }
  .footer { padding-top: 5rem; }
  h1 { font-size: 3.2rem; }
  h2 { font-size: 2.05rem; }
  .lede { font-size: 1.12rem; }
  .contact > div { grid-template-columns: 11rem 1fr; gap: 1rem; align-items: baseline; }
  .list > li { padding: 1.9rem 0 2rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    transform: none !important;
  }
}
