:root {
  --font-sans: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto,
    Noto Sans, Ubuntu, Cantarell, Helvetica Neue, Arial, "Apple Color Emoji",
    "Segoe UI Emoji";
  --radius: 14px;
  --radius-sm: 10px;
  --radius-lg: 20px;
  --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.06),
    0 8px 24px rgba(0, 0, 0, 0.08);
  --shadow-2: 0 1px 2px rgba(0, 0, 0, 0.05),
    0 12px 40px rgba(0, 0, 0, 0.14);
  --container: 1120px;
  --space-0: 0rem;
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-7: 2rem;
  --space-8: 3rem;
  --space-9: 4rem;
  --transition-1: 220ms cubic-bezier(0.2, 0.7, 0.2, 1);
  --transition-2: 500ms cubic-bezier(0.16, 1, 0.3, 1);

  /* Header sizing/config */
  --header-min-h: 64px;

  /* --- GALLERY & HERO CONFIG (easy knobs) --- */
  /* Hero media block (applies to .hero .media elements) */
  --hero-media-h: 400px;        /* height of hero images */
  --hero-media-w: auto;         /* width of hero images (usually auto) */

  /* Mini‑gallery grid (applies to .service .mini-gallery) */
  --gallery-columns: 2;         /* number of columns */
  --gallery-img-h: 300px;       /* height for images in grid */
  --gallery-img-w: auto;        /* width for images in grid (usually auto) */

  /* You can override per section, e.g.:
     .service--lvi { --gallery-columns: 3; --gallery-img-h: 240px; }
  */

  /* Theme half-pill sizing */
  --theme-tab-width: 84px;
  --theme-tab-height: 34px;
  --theme-tab-pad-x: 12px;
  --theme-tab-pad-y: 4px;
  --theme-tab-radius: 999px;
  --theme-tab-reserve: calc(var(--theme-tab-height) + 8px);

  /* Theme toggle icon config */
  --theme-icon-size: 18px;
  --theme-icon-size-mobile: 22px;
  --theme-icon-for-light: url("images/dark.png");
  --theme-icon-for-dark: url("images/light.png");

  /* Logo (96x96) */
  --logo-image: url("images/logo.gif");
  --logo-dark-image: url("images/logo.gif");
  --logo-width: 96px;
  --logo-height: 96px;
  --logo-fit: contain;

  /* Phone ghost button */
  --call-btn-h: 40px;
  --call-btn-pad-x: 12px;
  --call-btn-pad-y: 6px;
  --call-btn-font-size: 1rem;
  --call-btn-radius: 999px;
  --call-btn-margin-x: 0;
  --call-btn-margin-y: 0;

  /* Hero images */
  --hero-a-image: url("images/hero_01v2.jpg");
  --hero-c-image: url("images/hero_03v2.jpg");

  --lvi-img-1: url("images/LVIS_01v2.jpg");
  --lvi-img-2: url("images/LVIS_03v2.jpg");

  --sisustus-img-1: url("images/sisustus_01v2.jpeg");
  --sisustus-img-2: url("images/sisustus_02v2.jpeg");

  --timpuri-img-1: url("images/timpuri_01v2.jpeg");
  --timpuri-img-2: url("images/timpuri_02v2.jpeg");

  --laatoitus-img-1: url("images/laatoitus_01v2.jpeg");
  --laatoitus-img-2: url("images/laatoitus_02v2.jpeg");

  --purku-img-1: url("images/purku_01v2.jpeg");
  --purku-img-2: url("images/purku_02v2.jpeg");

  --vesieristys-img-1: url("images/hero_02v2.jpeg");
  --vesieristys-img-2: url("images/vesieristys_01v2.jpeg");
  --vesieristys-img-3: url("images/vesieristys_02v2.jpeg");

  --muut-img-1: url("images/LVIS_02v2.jpeg");
  --muut-img-2: url("images/muut_01.jpeg");
  --muut-img-3: url("images/muut_02.jpeg");

  /* Image fit */
  --image-fit: cover;
  --hero-image-fit: var(--image-fit);
  --service-image-fit: var(--image-fit);

  /* Nav spacing */
  --nav-gap: var(--space-0);
  --nav-pad-y: 0.5rem;
  --nav-pad-x: 0.5rem;
}

/* COLOR PALETTE CONFIG */
[data-theme="light"] {
  --bg: #f7f8fb;
  --surface-1: rgba(255, 255, 255, 0.8);
  --surface-2: #ffffff;
  --elev: #ffffff;
  --text: #0b1220;
  --muted: #4b5565;
  --border: #e7eaf1;

  --brand: #2d7ff9;
  --brand-rgb: 45 127 249;
  --brand-ink: #0b3a96;
  --accent: #ff6a3d;
  --link: #1f6aff;
  --good: #17b26a;
  --bad: #ef4444;
  --grid: rgba(45, 127, 249, 0.08);
  --tint-15: color-mix(in oklab, var(--brand) 15%, transparent);

  --grad-hero-a-from: #7bdcff;
  --grad-hero-a-to: #5aa2ff;
  --grad-hero-b-from: #ffcf7b;
  --grad-hero-b-to: #ff6a3d;
  --grad-hero-c-from: #c9f27b;
  --grad-hero-c-to: #28d17c;

  --nav-item-text: var(--text);
  --nav-item-text-active: var(--brand-ink);
  --nav-item-bg-hover: color-mix(in oklab, var(--brand) 15%, white);
  --nav-item-bg-active: color-mix(in oklab, var(--brand) 22%, white);

  --theme-tab-bg: var(--surface-2);
  --theme-tab-border: var(--border);
  --theme-tab-color: var(--text);

  --theme-icon: var(--theme-icon-for-light);

  --logo-image-current: var(--logo-image);
}

[data-theme="dark"] {
  --bg: #0b0f19;
  --surface-1: rgba(18, 22, 34, 0.7);
  --surface-2: #0f1422;
  --elev: #151a28;
  --text: #eaf0ff;
  --muted: #a4adbf;
  --border: #1e2433;

  --brand: #5aa2ff;
  --brand-rgb: 90 162 255;
  --brand-ink: #b8d2ff;
  --accent: #ff855f;
  --link: #93b9ff;
  --good: #28d17c;
  --bad: #ff6666;
  --grid: rgba(146, 167, 255, 0.08);
  --tint-15: color-mix(in oklab, var(--brand) 15%, transparent);

  --grad-hero-a-from: #7bdcff;
  --grad-hero-a-to: #5aa2ff;
  --grad-hero-b-from: #ffcf7b;
  --grad-hero-b-to: #ff6a3d;
  --grad-hero-c-from: #c9f27b;
  --grad-hero-c-to: #28d17c;

  --nav-item-text: var(--text);
  --nav-item-text-active: var(--brand-ink);
  --nav-item-bg-hover: color-mix(in oklab, var(--brand) 18%, var(--surface-2));
  --nav-item-bg-active: color-mix(in oklab, var(--brand) 28%, var(--surface-2));

  --theme-tab-bg: var(--surface-2);
  --theme-tab-border: var(--border);
  --theme-tab-color: var(--text);

  --theme-icon: var(--theme-icon-for-dark);

  --logo-image-current: var(--logo-dark-image);
}

/* Base */
html {
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  color-scheme: light dark;
  scroll-behavior: smooth;
}
*,
*::before,
*::after {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
}
img,
svg,
video {
  max-width: 100%;
  height: auto;
}
a {
  color: var(--link);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}
:where(h1, h2, h3, h4) {
  margin: 0 0 var(--space-3);
  line-height: 1.15;
  letter-spacing: -0.02em;
}
h1 {
  font-size: clamp(2rem, 3vw + 1rem, 3.25rem);
}
h2 {
  font-size: clamp(1.5rem, 1.2vw + 1rem, 2rem);
}
h3 {
  font-size: clamp(1.1rem, 0.8vw + 0.9rem, 1.25rem);
}
p {
  margin: 0 0 var(--space-4);
  color: var(--muted);
}
ul {
  margin: 0;
  padding: 0;
  list-style: none;
}
button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}
.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--space-5);
}

/* Sections */
.section {
  padding: var(--space-9) 0;
}
.section--alt {
  background: var(--surface-2);
}
.section-header {
  margin-bottom: var(--space-7);
  text-align: center;
}
.section-header p {
  max-width: 68ch;
  margin: 0 auto;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: saturate(180%) blur(10px);
  background: var(--surface-1);
  border-bottom: 1px solid var(--border);
}
.header-row {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  grid-template-areas: "logo nav actions";
  gap: var(--space-4);
  align-items: center;
  min-height: var(--header-min-h);
  padding-bottom: var(--theme-tab-reserve);
  position: relative;
}

/* Theme half‑pill */
#theme-toggle {
  position: absolute;
  left: 50%;
  bottom: -1px;
  transform: translateX(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--theme-tab-width);
  height: var(--theme-tab-height);
  padding: var(--theme-tab-pad-y) var(--theme-tab-pad-x);
  background: var(--theme-tab-bg);
  color: var(--theme-tab-color);
  border: 1px solid var(--theme-tab-border);
  border-top-left-radius: var(--theme-tab-radius);
  border-top-right-radius: var(--theme-tab-radius);
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
  box-shadow: var(--shadow-1);
  z-index: 70;
}
#theme-toggle svg {
  display: none !important;
}
#theme-toggle::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: var(--theme-icon-size);
  height: var(--theme-icon-size);
  transform: translate(-50%, -50%);
  background-image: var(--theme-icon);
  background-size: contain;
  background-position: center;
  background-repeat: no-repeat;
}

/* Logo */
.logo {
  grid-area: logo;
  display: inline-block;
  width: var(--logo-width);
  height: var(--logo-height);
  background-image: var(--logo-image-current);
  background-size: var(--logo-fit);
  background-repeat: no-repeat;
  background-position: left center;
  color: transparent;
  text-decoration: none;
}

/* Nav */
.primary-nav {
  grid-area: nav;
  justify-self: center;
}
.nav-menu {
  display: flex;
  align-items: center;
  gap: var(--nav-gap);
  flex-wrap: wrap;
}
.nav-menu a {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: var(--nav-pad-y) var(--nav-pad-x);
  border-radius: 999px;
  color: var(--nav-item-text);
  font-weight: 600;
  text-decoration: none;
  transition: background-color var(--transition-1), color var(--transition-1),
    box-shadow var(--transition-1), transform var(--transition-1);
}
.nav-menu a:hover {
  background: var(--nav-item-bg-hover);
  color: var(--nav-item-text-active);
  text-decoration: none;
}
.nav-menu a:active {
  transform: translateY(1px);
}
.nav-menu a:focus-visible {
  outline: none;
  background: var(--nav-item-bg-hover);
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--brand) 35%, transparent);
  color: var(--nav-item-text-active);
}
.nav-menu a.is-active,
.nav-menu a[aria-current="page"],
.nav-menu a[aria-current="true"],
.nav-menu a[aria-current="section"] {
  background: var(--nav-item-bg-active);
  color: var(--nav-item-text-active);
}

/* Actions (phone button) */
.header-actions {
  grid-area: actions;
  justify-self: end;
  display: flex;
  align-items: center;
  gap: var(--space-3);
}
.header-actions .btn--ghost {
  padding: var(--call-btn-pad-y) var(--call-btn-pad-x);
  min-height: var(--call-btn-h);
  font-size: var(--call-btn-font-size);
  border-radius: var(--call-btn-radius);
  margin: var(--call-btn-margin-y) var(--call-btn-margin-x);
  white-space: nowrap;
}

/* Hamburger */
.nav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: 12px;
  color: var(--text);
  border: 1px solid var(--border);
  background: var(--surface-2);
  position: relative;
  z-index: 80;
}
.nav-toggle .icon {
  display: none;
}
.nav-toggle::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 12px;
  width: 22px;
  height: 2px;
  background: currentColor;
  border-radius: 2px;
  transform: translateX(-50%);
  box-shadow: 0 8px 0 0 currentColor, 0 16px 0 0 currentColor;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  white-space: nowrap;
  padding: 0.7rem 1rem;
  border-radius: 999px;
  font-weight: 700;
  border: 1px solid transparent;
  transition: transform var(--transition-1), background var(--transition-1),
    color var(--transition-1), border-color var(--transition-1),
    box-shadow var(--transition-1);
}
.btn:active {
  transform: translateY(1px);
}
.btn--primary {
  background: var(--brand);
  color: #fff;
  box-shadow: 0 8px 20px rgba(var(--brand-rgb), 0.3);
}
.btn--primary:hover {
  text-decoration: none;
  background: color-mix(in oklab, var(--brand), black 10%);
}
.btn--ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--border);
}
.btn--ghost:hover {
  background: var(--surface-2);
  text-decoration: none;
}

/* Hero */
.hero {
  padding-top: var(--space-9);
  padding-bottom: var(--space-9);
  background:
    radial-gradient(1200px 600px at 80% -10%, var(--grid), transparent 60%),
    radial-gradient(1200px 600px at -10% 30%, var(--grid), transparent 60%);
}
.hero-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: var(--space-8);
  align-items: center;
}
.lead {
  font-size: 1.05rem;
  padding-top: var(--space-3);
}
.badge {
  display: inline-block;
  padding: 0.35rem 0.65rem;
  background: color-mix(in oklab, var(--brand), transparent 85%);
  color: var(--brand-ink);
  border: 1px solid color-mix(in oklab, var(--brand), transparent 60%);
  border-radius: 999px;
  font-weight: 700;
  margin-bottom: var(--space-3);
}
.hero-actions {
  display: flex;
  gap: var(--space-3);
  margin-top: var(--space-4);
}
.hero-media .media-card {
  position: relative;
  display: grid;
  gap: var(--space-4);
}
.media {
  height: var(--hero-media-h, 220px);
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, var(--brand), var(--accent));
  box-shadow: var(--shadow-2);
  background-position: center;
  background-repeat: no-repeat;
  overflow: hidden;

  width: var(--hero-media-w, auto);
}
.media--a {
  --hero-media-h: 200px;
  background: linear-gradient(0deg, var(--tint-15), var(--tint-15)),
    var(--hero-a-image),
    linear-gradient(135deg, var(--grad-hero-a-from), var(--grad-hero-a-to));
  background-size: cover, var(--hero-image-fit, var(--image-fit, cover)),
    cover;
  background-position: center, center, center;
}
.media--b {
  background: linear-gradient(0deg, var(--tint-15), var(--tint-15)),
    var(--hero-b-image),
    linear-gradient(135deg, var(--grad-hero-b-from), var(--grad-hero-b-to));
  background-size: cover, var(--hero-image-fit, var(--image-fit, cover)),
    cover;
  background-position: center, center, center;
}
.media--c {
  background: linear-gradient(0deg, var(--tint-15), var(--tint-15)),
    var(--hero-c-image),
    linear-gradient(135deg, var(--grad-hero-c-from), var(--grad-hero-c-to));
  background-size: cover, var(--hero-image-fit, var(--image-fit, cover)),
    cover;
  background-position: center, center, center;
}

/* Services */
.service .mini-gallery {
  display: grid;
  grid-template-columns: repeat(var(--gallery-columns, 2), minmax(0, 1fr));
  gap: var(--space-3);
}
.service .mini-gallery .img {
  height: var(--gallery-img-h, 280px);
  border-radius: var(--radius);
  background-image: linear-gradient(135deg, var(--brand), var(--accent));
  background-size: var(--service-image-fit, var(--image-fit, cover));
  background-position: center;
  background-repeat: no-repeat;
  box-shadow: var(--shadow-1);
  overflow: hidden;

  width: var(--gallery-img-w, auto);
}
.service--lvi .mini-gallery .img:nth-child(1) {
  background-image: var(--lvi-img-1),
    linear-gradient(135deg, var(--brand), var(--accent));
}
.service--lvi .mini-gallery .img:nth-child(2) {
  background-image: var(--lvi-img-2),
    linear-gradient(135deg, var(--brand), var(--accent));
}
.service--lvi .mini-gallery .img:nth-child(3) {
  background-image: var(--lvi-img-3),
    linear-gradient(135deg, var(--brand), var(--accent));
}
.service--sisustus .mini-gallery .img:nth-child(1) {
  background-image: var(--sisustus-img-1),
    linear-gradient(135deg, var(--brand), var(--accent));
}
.service--sisustus .mini-gallery .img:nth-child(2) {
  background-image: var(--sisustus-img-2),
    linear-gradient(135deg, var(--brand), var(--accent));
}
.service--sisustus .mini-gallery .img:nth-child(3) {
  background-image: var(--sisustus-img-3),
    linear-gradient(135deg, var(--brand), var(--accent));
}
.service--timpuri .mini-gallery .img:nth-child(1) {
  background-image: var(--timpuri-img-1),
    linear-gradient(135deg, var(--brand), var(--accent));
}
.service--timpuri .mini-gallery .img:nth-child(2) {
  background-image: var(--timpuri-img-2),
    linear-gradient(135deg, var(--brand), var(--accent));
}
.service--timpuri .mini-gallery .img:nth-child(3) {
  background-image: var(--timpuri-img-3),
    linear-gradient(135deg, var(--brand), var(--accent));
}
.service--laatoitus .mini-gallery .img:nth-child(1) {
  background-image: var(--laatoitus-img-1),
    linear-gradient(135deg, var(--brand), var(--accent));
}
.service--laatoitus .mini-gallery .img:nth-child(2) {
  background-image: var(--laatoitus-img-2),
    linear-gradient(135deg, var(--brand), var(--accent));
}
.service--laatoitus .mini-gallery .img:nth-child(3) {
  background-image: var(--laatoitus-img-3),
    linear-gradient(135deg, var(--brand), var(--accent));
}
.service--purku .mini-gallery .img:nth-child(1) {
  background-image: var(--purku-img-1),
    linear-gradient(135deg, var(--brand), var(--accent));
}
.service--purku .mini-gallery .img:nth-child(2) {
  background-image: var(--purku-img-2),
    linear-gradient(135deg, var(--brand), var(--accent));
}
.service--purku .mini-gallery .img:nth-child(3) {
  background-image: var(--purku-img-3),
    linear-gradient(135deg, var(--brand), var(--accent));
}
.service--vesieristys {
  --gallery-columns: 3; --gallery-img-h: 240px;
}
.service--vesieristys .mini-gallery .img:nth-child(1) {
  background-image: var(--vesieristys-img-1),
    linear-gradient(135deg, var(--brand), var(--accent));
}
.service--vesieristys .mini-gallery .img:nth-child(2) {
  background-image: var(--vesieristys-img-2),
    linear-gradient(135deg, var(--brand), var(--accent));
}
.service--vesieristys .mini-gallery .img:nth-child(3) {
  background-image: var(--vesieristys-img-3),
    linear-gradient(135deg, var(--brand), var(--accent));
}
.service--muut {
  --gallery-columns: 3; --gallery-img-h: 240px;
}
.service--muut .mini-gallery .img:nth-child(1) {
  background-image: var(--muut-img-1),
    linear-gradient(135deg, var(--brand), var(--accent));
}
.service--muut .mini-gallery .img:nth-child(2) {
  background-image: var(--muut-img-2),
    linear-gradient(135deg, var(--brand), var(--accent));
}
.service--muut .mini-gallery .img:nth-child(3) {
  background-image: var(--muut-img-3),
    linear-gradient(135deg, var(--brand), var(--accent));
}

/* Cards */
.card {
  background: var(--elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--space-5);
  box-shadow: var(--shadow-1);
}

/* About split */
.feature {
  background: var(--elev);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  box-shadow: var(--shadow-1);
}
.feature--split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-9);
  align-items: start;
}

/* Contact cards */
.contact-cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-5);
  margin-top: var(--space-7);
}
.contact-card h3 {
  margin-bottom: var(--space-3);
}
.contact-card address {
  font-style: normal;
  color: var(--muted);
}

/* CTA */
.section--cta {
  background:
    radial-gradient(1000px 400px at 10% -10%, var(--grid), transparent 60%),
    radial-gradient(1000px 400px at 110% 110%, var(--grid), transparent 60%);
}
.cta {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: var(--space-6);
  align-items: start;
  background: var(--elev);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  box-shadow: var(--shadow-2);
}
.cta-form {
  display: grid;
  gap: var(--space-4);
}
.form-row {
  display: grid;
  gap: 0.4rem;
}
input,
textarea {
  width: 100%;
  padding: 0.8rem 0.9rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  outline: none;
  transition: border-color var(--transition-1), box-shadow var(--transition-1);
  accent-color: var(--brand);
}
input:focus,
textarea:focus {
  border-color: color-mix(in oklab, var(--brand), white 30%);
  box-shadow: 0 0 0 4px color-mix(in oklab, var(--brand), transparent 85%);
}
.form-actions {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}
.fineprint {
  color: var(--muted);
  font-size: 0.9rem;
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  background: var(--surface-2);
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.2fr repeat(3, 1fr);
  gap: var(--space-6);
  padding: var(--space-8) 0 var(--space-6);
}
.footer-col h4 {
  margin-bottom: var(--space-3);
}
.footer-col a {
  color: var(--muted);
}
.footer-col a:hover {
  color: var(--text);
  text-decoration: none;
}
.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-5) 0;
  border-top: 1px solid var(--border);
}
.muted {
  color: var(--muted);
}


/* --- Mini‑gallery item limit utilities (optional) ---
   Add .show-N to .mini-gallery to render exactly N items without editing CSS further.
   Example: <div class="mini-gallery show-3"> will display only the first three .img blocks.
*/
.mini-gallery.show-1 .img:nth-child(n+2) { display: none; }
.mini-gallery.show-2 .img:nth-child(n+3) { display: none; }
.mini-gallery.show-3 .img:nth-child(n+4) { display: none; }
.mini-gallery.show-4 .img:nth-child(n+5) { display: none; }
.mini-gallery.show-5 .img:nth-child(n+6) { display: none; }
.mini-gallery.show-6 .img:nth-child(n+7) { display: none; }
.mini-gallery.show-7 .img:nth-child(n+8) { display: none; }
.mini-gallery.show-8 .img:nth-child(n+9) { display: none; }

/* Hero media: limit number of tiles inside .hero-media .media-card */
.hero-media .media-card.show-1 .media:nth-child(n+2) { display: none; }
.hero-media .media-card.show-2 .media:nth-child(n+3) { display: none; }
.hero-media .media-card.show-3 .media:nth-child(n+4) { display: none; }

/* Responsive */
@media (max-width: 980px) {
  .feature--split {
    grid-template-columns: 1fr;
  }
  .hero-grid {
    grid-template-columns: 1fr;
  }
  .cta {
    grid-template-columns: 1fr;
  }
  .contact-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  /* Exact mobile header layout: logo | phone | burger; theme tab below */
  .header-row {
    grid-template-columns: auto minmax(0, 1fr) auto;
    grid-template-areas: "logo call burger";
  }
  .logo {
    grid-area: logo;
    justify-self: start;
  }
  .header-actions {
    grid-area: call;
    justify-self: center;
  }
  .primary-nav {
    grid-area: burger;
    justify-self: end;
  }
  .nav-toggle {
    display: inline-flex;
  }

  /* Drawer */
  .primary-nav .nav-menu {
    position: fixed;
    top: var(--header-h, var(--header-min-h));
    left: 0;
    right: 0;
    background: var(--surface-2);
    border-top: 1px solid var(--border);
    box-shadow: var(--shadow-2);
    display: grid;
    gap: var(--space-2);
    padding: var(--space-4);
    opacity: 0;
    transform: translateY(-10px);
    pointer-events: none;
    transition: opacity var(--transition-1), transform var(--transition-1);
    z-index: 60;
  }
  .primary-nav .nav-menu.is-open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }
  .primary-nav .nav-menu li {
    padding: 0.35rem 0.4rem;
  }
  .primary-nav .nav-menu a {
    display: block;
    width: 100%;
    padding: calc(var(--nav-pad-y) + 0.4rem)
      calc(var(--nav-pad-x) + 0.2rem);
    border-radius: 12px;
  }

  /* Bigger theme icon on mobile */
  #theme-toggle::after {
    width: var(--theme-icon-size-mobile);
    height: var(--theme-icon-size-mobile);
  }

  /* Mobile footer: logo + Yhteystiedot only */
  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }
  .footer-col--services,
  .footer-col--about {
    display: none !important;
  }

  .contact-cards {
    grid-template-columns: 1fr;
  }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  [data-reveal] {
    opacity: 1;
    transform: none;
    transition: none;
  }
}


/* --- Form flash + honeypot (accessibility-friendly) --- */
.flash {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.8rem 1rem;
  margin-bottom: var(--space-4);
  background: var(--surface-2);
}
.flash.success { border-color: color-mix(in oklab, var(--good), transparent 60%); }
.flash.error { border-color: color-mix(in oklab, var(--bad), transparent 60%); }

/* Keep honeypot in DOM but off-screen */
.hp { position: absolute !important; left: -10000px; top: auto; width: 1px; height: 1px; overflow: hidden; }


/* === Axis-contain utilities (used by JS auto fitter) =======================
   JS toggles these on tiles with background images.
   - .bg-contain-width  → background-size: 100% auto  (fill width, crop vertical)
   - .bg-contain-height → background-size: auto 100%  (fill height, crop horizontal)
   They do not change positioning or repeat behavior from your base rules.
============================================================================= */
.bg-contain-width,
.bg-contain-height {
  background-position: center;
  background-repeat: no-repeat;
}
.bg-contain-width  { background-size: 100% auto; }
.bg-contain-height { background-size: auto 100%; }
