/* ============================================
   TRP Tammenrakennuspalvelu Oy
   Single-page website styles
   ============================================ */

/* --- Custom Properties --- */
:root {
  --color-primary: #C41418;
  --color-primary-dark: #9B1015;
  --color-white: #FFFFFF;
  --color-black: #1A1A1A;
  --color-gray: #F5F5F5;
  --color-text: #333333;
  --color-text-light: #666666;
  /* ADOBE FONTS: Vaihda 'adobe-clean' tai vastaava oikeaan fontin nimeen kun projekti on luotu */
  --font-main: "clother", sans-serif;
  --max-width: 1200px;
  --nav-height: 90px;
  --section-padding: 100px 0;
}

/* --- Reset --- */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--nav-height);
  scroll-snap-type: y proximity;
}

body {
  font-family: var(--font-main);
  color: var(--color-text);
  line-height: 1.6;
  overflow-x: hidden;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  text-decoration: none;
  color: inherit;
}

ul {
  list-style: none;
}

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

/* --- Dot Decorators (Triangle SVG Patterns) --- */
.has-dots {
  position: relative;
  z-index: 1;
}

.has-dots::before,
.has-dots::after {
  content: '';
  position: absolute;
  width: 100px;
  height: 100px;
  z-index: 3; /* Yli taustan, mutta ei peitä sisältöä */
  opacity: 1;
  pointer-events: none;
  background-repeat: no-repeat;
  background-size: contain;
}

/* Red dots (for light backgrounds) */
.dots-red::before,
.dots-red::after {
  /* Suorakulmainen kolmio (svg) koodattuna base64:lla var(--color-primary) #C41418 — sama rakenne kuin dots-triangle.svg */
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 80 80" fill="%23C41418"><circle cx="8" cy="8" r="5"/><circle cx="8" cy="28" r="5"/><circle cx="28" cy="28" r="5"/><circle cx="8" cy="48" r="5"/><circle cx="28" cy="48" r="5"/><circle cx="48" cy="48" r="5"/><circle cx="8" cy="68" r="5"/><circle cx="28" cy="68" r="5"/><circle cx="48" cy="68" r="5"/><circle cx="68" cy="68" r="5"/></svg>');
}

/* White dots (for dark/red backgrounds) */
.dots-white::before,
.dots-white::after {
  /* Sama kolmio mutta valkoisena #FFFFFF — sama rakenne kuin dots-triangle.svg */
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 80 80" fill="%23FFFFFF"><circle cx="8" cy="8" r="5"/><circle cx="8" cy="28" r="5"/><circle cx="28" cy="28" r="5"/><circle cx="8" cy="48" r="5"/><circle cx="28" cy="48" r="5"/><circle cx="48" cy="48" r="5"/><circle cx="8" cy="68" r="5"/><circle cx="28" cy="68" r="5"/><circle cx="48" cy="68" r="5"/><circle cx="68" cy="68" r="5"/></svg>');
}

/* Corner Positioning Classes */
/* Top Right & Bottom Left (Classic letter envelope style) */
.dots-tr-bl::before {
  top: 20px;
  right: 20px;
  transform: rotate(180deg); /* Käännetään kärki osoittamaan keskelle */
}
.dots-tr-bl::after {
  bottom: 20px;
  left: 20px;
  transform: rotate(0deg); 
}

/* Top Left & Bottom Right */
.dots-tl-br::before {
  top: 20px;
  left: 20px;
  transform: rotate(-90deg); /* Kärki kohti keskustaa */
}
.dots-tl-br::after {
  bottom: 20px;
  right: 20px;
  transform: rotate(90deg);
}

/* ============================================
   NAVIGATION
   ============================================ */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: var(--nav-height);
  background: var(--color-white);
  z-index: 1000;
  border-bottom: 1px solid rgba(0,0,0,0.06);
  transition: box-shadow 0.3s;
}

.navbar.scrolled {
  box-shadow: 0 2px 20px rgba(0,0,0,0.08);
}

.navbar .container {
  display: flex;
  align-items: center;
  justify-content: flex-start; /* Muutettu space-betweenistä */
  height: 100%;
  position: relative; /* Jotta logo asettuu oikein */
}

.nav-links {
  display: flex;
  gap: 32px;
}

.nav-links a {
  font-size: 1.05rem;
  font-weight: 500;
  color: var(--color-text);
  padding: 4px 0;
  border-bottom: 2px solid transparent;
  transition: color 0.2s, border-color 0.2s;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--color-primary);
  border-bottom-color: var(--color-primary);
}

.nav-logo {
  height: 120px; /* Kasvatettu merkittävästi ylittämään navbar */
  width: auto;
  position: absolute; /* Irrotetaan normaalista flowsta */
  top: 0; /* Kiinni aivan yläreunassa */
  right: 24px; /* Suhteessa containerin oikeaan reunaan, eli on "80% keskellä" -alueella */
  transition: height 0.4s ease, top 0.4s ease, filter 0.3s ease;
  filter: drop-shadow(0 4px 8px rgba(0,0,0,0.1)); /* Lisätään pieni varjo korostamaan "ylitystä" */
  z-index: 1001; /* Varmistetaan että on ylimmäisenä */
}

.nav-logo.shrunk {
  height: 60px; /* Pienenee mahtumaan palkin sisään */
  top: 15px; /* Keskittää logon pystysuunnassa 90px korkeassa navbarissa ( (90-60)/2 = 15 ) */
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.05));
}

/* Hamburger */
.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 8px;
  background: none;
  border: none;
}

.hamburger span {
  display: block;
  width: 26px;
  height: 3px;
  background: var(--color-black);
  border-radius: 2px;
  transition: transform 0.3s, opacity 0.3s;
}

.hamburger.open span:nth-child(1) {
  transform: translateY(8px) rotate(45deg);
}

.hamburger.open span:nth-child(2) {
  opacity: 0;
}

.hamburger.open span:nth-child(3) {
  transform: translateY(-8px) rotate(-45deg);
}

/* ============================================
   HERO SECTION
   ============================================ */
.hero {
  padding-top: var(--nav-height);
  min-height: 100vh;
  display: flex;
  align-items: center;
  position: relative;
  overflow: hidden;
  background: var(--color-white);
}

.hero .container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: center;
  position: relative;
  z-index: 1;
  background: var(--color-white);
  padding-top: 32px;
  padding-bottom: 32px;
  border-radius: 4px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.08);
}

.hero-image {
  position: relative;
}

.hero-image img {
  width: 100%;
  height: 620px;
  object-fit: cover;
  border-radius: 4px;
}

.hero-content {
  padding: 40px 0;
}

.hero-content h1 {
  font-size: 3rem;
  font-weight: 800;
  line-height: 1.1;
  color: var(--color-primary);
  margin-bottom: 24px;
  text-transform: uppercase;
}

.hero-content .subtitle {
  font-size: 1.15rem;
  color: var(--color-text);
  line-height: 1.7;
  margin-bottom: 32px;
}

.hero-content .slogan {
  font-size: 1.1rem;
  color: var(--color-text-light);
  font-style: italic;
}

/* Hero dots — bottom-left, default orientation */
.hero-dots {
  bottom: 40px;
  left: 24px;
}

/* Hero: only bottom-left dots, hide top-right */
.hero.has-dots::before {
  display: none;
}

/* Lift bottom-left dots above the red strip, behind hero content */
.hero.has-dots::after {
  bottom: 52px;
  z-index: 0;
}

/* Full-width red strip at bottom of hero */
.hero-dots-bg {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 44px;
  background: var(--color-primary);
  z-index: 1;
}

/* ============================================
   SECTIONS GENERAL
   ============================================ */
section {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: 80px 0;
  position: relative;
  overflow: hidden;
  scroll-snap-align: start;
}

.section-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  align-items: center;
  position: relative;
  z-index: 2;
}

section > .container {
  width: 100%;
}

.section-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: center;
}

.section-title {
  font-size: 2.4rem;
  font-weight: 800;
  color: var(--color-black);
  margin-bottom: 8px;
  line-height: 1.2;
}

.section-subtitle {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--color-primary);
  margin-bottom: 24px;
}

.section-text {
  font-size: 1rem;
  line-height: 1.8;
  color: var(--color-text);
  margin-bottom: 16px;
}

/* ============================================
   SECTION BACKGROUND DECORATIONS
   ============================================ */

/* Experts — punainen vino palkki oikeassa reunassa */
.experts::before {
  content: '';
  position: absolute;
  top: 0;
  right: -40px;
  width: 120px;
  height: 100%;
  background: var(--color-primary);
  transform: skewX(-3deg);
  z-index: 0;
}

.experts > .container {
  position: relative;
  z-index: 1;
}

/* Toimintamalli — iso punainen puoliympyrä oikeaan reunaan */
.toimintamalli::after {
  content: '';
  position: absolute;
  right: -120px;
  top: 50%;
  transform: translateY(-50%);
  width: 320px;
  height: 320px;
  border-radius: 50%;
  background: rgba(196, 20, 24, 0.10);
  z-index: 0;
}

/* Isännöinti — punainen vino raita vasemmassa reunassa */
.isannointi::before {
  content: '';
  position: absolute;
  top: 0;
  left: -40px;
  width: 200px;
  height: 100%;
  background: var(--color-primary);
  transform: skewX(3deg);
  z-index: 0;
}

.isannointi > .container {
  position: relative;
  z-index: 1;
}

.miksi > .container {
  position: relative;
  z-index: 1;
}

/* Yhteystiedot — ei pseudo-elementtiä, has-dots hoitaa koristelun */

/* ============================================
   TEAM SECTION
   ============================================ */
.team {
  background: var(--color-white);
  padding: 0;
  overflow: hidden;
  min-height: 100vh;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Punainen blokki — koko tausta vasemmalla, ei liity sisältöön */
.team-red-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 40%;
  height: 100%;
  background: var(--color-primary);
  z-index: 0;
}

/* Sisältödiv — keskitetty viewportissa, padding ympärillä */
.team-layout {
  display: flex;
  align-items: center;
  gap: 48px;
  position: relative;
  z-index: 1;
  width: 90vw;           /* 90% viewportin leveydestä = tilaa reunoissa */
  max-width: 1200px;
  padding-top: var(--nav-height);
  padding-bottom: 40px;
  margin: 0 auto;
}

/* Kuvat: korkeus suhteessa viewporttiin, aina tilaa ympärillä */
.team-images {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px;
  flex-shrink: 0;
  width: 55%;
}

.team-images img {
  width: 100%;
  height: clamp(300px, 65vh, 720px); /* Skaalautuu viewportin mukaan, ei koskaan liian iso tai pieni */
  object-fit: cover;
  object-position: center center;
}

/* Teksti */
.team-content {
  flex: 1;
  padding: 0 24px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.team-content h3 {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--color-primary);
  margin-bottom: 8px;
  margin-top: 28px;
}

.team-content h3:first-of-type {
  margin-top: 0;
}

/* Pisteet: oikeassa yläkulmassa ja oikeassa alakulmassa.
   SVG:n alkuperäinen kolmio: kanta vasemmassa reunassa pystysuoraan,
   kärki oikeassa alakulmassa — eli kanta on vasemmalla, pisteet kasvavat alas-oikealle.
   filter muuntaa mustan SVG:n TRP-punaiseksi. */
.team-dots {
  position: absolute;
  width: 100px;
  height: 100px;
  z-index: 3;
  pointer-events: none;
  filter: invert(14%) sepia(96%) saturate(4000%) hue-rotate(346deg) brightness(85%) contrast(110%);
}

/* Ylä-oikea: SVG kasvaa vasemmasta ylhäältä alas-oikealle.
   Käännetään 180° → kärki on vasemmassa yläkulmassa, kanta oikeassa alakulmassa.
   Visuaalisesti: pisteet täyttävät oikean yläkulman. */
.team-dots-tr {
  top: 20px;
  right: 20px;
  transform: rotate(180deg);
}

/* Ala-oikea: ei käännetä — alkuperäinen SVG kasvaa jo alas-oikealle,
   eli yksi piste on vasemmassa yläkulmassa ja kanta oikeassa alakulmassa.
   90° ero ylä-oikeaan nähden (180° - 90° = 90°). */
.team-dots-br {
  bottom: 160px;
  right: 20px;
  transform: rotate(270deg);
}

/* Team dots — top-right flipped, bottom-right rotated */
.team-dots-top {
  top: 30px;
  right: 30px;
  transform: scaleX(-1);
  color: var(--color-white);
}

.team-dots-bottom {
  bottom: 30px;
  right: 80px;
  transform: rotate(180deg);
  color: var(--color-white);
}

/* ============================================
   EXPERTS SECTION
   ============================================ */
.experts {
  background: var(--color-white);
}

.experts-image {
  position: relative;
}

.experts-image img {
  width: 100%;
  height: 450px;
  object-fit: cover;
  border-radius: 2px;
}

.experts-image::after {
  content: '';
  position: absolute;
  top: 0;
  right: -15px;
  width: 40px;
  height: 100%;
  background: var(--color-primary);
  transform: skewX(-3deg);
  z-index: 1;
}

/* Red bar on top */
.experts-image::before {
  content: '';
  position: absolute;
  top: -8px;
  left: 0;
  right: 0;
  height: 8px;
  background: var(--color-primary);
  z-index: 1;
}

/* ============================================
   TOIMINTAMALLI / OPERATING MODEL SECTION
   ============================================ */
.toimintamalli {
  background: var(--color-white);
  border-top: 1px solid rgba(0,0,0,0.04);
}

.toimintamalli-text h4 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--color-black);
  margin-top: 20px;
  margin-bottom: 6px;
}

.toimintamalli-text h4:first-of-type {
  margin-top: 0;
}

.toimintamalli-text p {
  font-size: 0.95rem;
  line-height: 1.7;
  color: var(--color-text);
}

.btn-primary {
  display: inline-block;
  background: var(--color-primary);
  color: var(--color-white);
  padding: 14px 36px;
  border-radius: 4px;
  font-size: 1rem;
  font-weight: 600;
  margin-top: 28px;
  transition: background 0.2s, transform 0.1s;
  border: none;
  cursor: pointer;
}

.btn-primary:hover {
  background: var(--color-primary-dark);
  transform: translateY(-1px);
}

/* Verkosto -> Laatu Container (Replaces Venn) */
.verkosto-laatu-container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  position: relative;
  padding: 40px 0;
  width: 100%;
}

.vl-card {
  flex: 1;
  max-width: 220px;
  height: 120px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  font-weight: 700;
  text-align: center;
  box-shadow: 0 4px 15px rgba(0,0,0,0.08);
  position: relative;
  z-index: 2;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.vl-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 25px rgba(0,0,0,0.12);
}

.vl-card.vl-left {
  background: var(--color-white);
  color: var(--color-black);
  border: 2px solid var(--color-gray);
}

.vl-card.vl-right {
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
  color: var(--color-white);
  border: none;
}

.vl-connector {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  background: var(--color-white);
  border-radius: 50%;
  color: var(--color-primary);
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
  z-index: 3;
}

.vl-connector svg {
  width: 24px;
  height: 24px;
}

/* Big background circle decoration */
.verkosto-laatu-container::before {
  content: '';
  position: absolute;
  right: -60px;
  top: -10px;
  width: 250px;
  height: 250px;
  border-radius: 50%;
  background: rgba(196, 20, 24, 0.06);
  z-index: 0;
}

/* Toimintamalli dots — bottom-left, rotated 90deg */
.toimintamalli-dots {
  bottom: 40px;
  left: 24px;
  transform: rotate(90deg);
}

/* ============================================
   ISANNOINTI / PROPERTY MANAGEMENT SECTION
   ============================================ */
.isannointi {
  background: var(--color-white);
}

.isannointi-image {
  position: relative;
}

.isannointi-image img {
  width: 100%;
  height: 450px;
  object-fit: cover;
}

/* Diagonal red stripe */
.isannointi-image::after {
  content: '';
  position: absolute;
  top: 0;
  right: -15px;
  width: 40px;
  height: 100%;
  background: var(--color-primary);
  transform: skewX(-3deg);
}

.isannointi-content h4 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--color-black);
  margin-top: 24px;
  margin-bottom: 16px;
}

.isannointi-bullets {
  margin-top: 12px;
}

.isannointi-bullets li {
  margin-bottom: 16px;
  padding-left: 0;
}

.isannointi-bullets li strong {
  color: var(--color-black);
}

/* Isannointi dots — bottom-right, flipped */
.isannointi-dots {
  bottom: 30px;
  right: 30px;
  transform: scaleX(-1) rotate(90deg);
}

/* ============================================
   MIKSI MEIDAT / WHY US SECTION
   ============================================ */
.miksi {
  background: var(--color-white);
}

.miksi-content ul {
  margin-top: 16px;
}

.miksi-content ul li {
  padding: 8px 0;
  padding-left: 20px;
  position: relative;
  font-size: 1rem;
  line-height: 1.7;
}

.miksi-content ul li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 16px;
  width: 8px;
  height: 8px;
  background: var(--color-primary);
  border-radius: 50%;
}

.miksi-collage {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 12px;
  min-height: 400px;
}

.miksi-collage::before {
  content: '';
  position: absolute;
  top: -15px;
  right: -15px;
  width: 70%;
  height: 60%;
  background: var(--color-primary);
  z-index: 0;
  border-radius: 2px;
}

.miksi-collage img {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 2px;
}

.miksi-collage img:first-child {
  grid-column: 1 / -1;
}

/* Carousel dots — hidden on desktop */
.carousel-dots {
  display: none;
}

/* Miksi dots — top-left, default orientation */
.miksi-dots {
  top: 30px;
  left: 24px;
}

/* ============================================
   PALVELUT / SERVICES SECTION
   ============================================ */
/* Palvelut + Yhteystiedot combined wrapper */
.palvelut-yhteystiedot-wrap {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  scroll-snap-align: start;
}

.palvelut-yhteystiedot-wrap > section {
  min-height: auto;
  scroll-snap-align: none;
  padding: 48px 0;
}

.palvelut {
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
  color: var(--color-white);
}

.palvelut .container {
  text-align: center;
}

.palvelut .section-title {
  margin-bottom: 16px;
  color: var(--color-white);
}

.palvelut-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 24px;
  margin-top: 48px;
  text-align: left;
}

.palvelu-card {
  background: var(--color-white);
  padding: 32px;
  border-radius: 8px;
  border-top: none; /* Poistetaan punainen yläraita, koska tausta on jo punainen */
  box-shadow: 0 8px 24px rgba(0,0,0,0.15); /* Vahvempi varjo erottumaan punaisesta */
  transition: transform 0.3s ease;
}

.palvelu-card:hover {
  transform: translateY(-5px);
}

.palvelu-card h3 {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--color-primary-dark);
  margin-bottom: 10px;
}

.palvelu-card p {
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--color-text);
}

.palvelut-note {
  margin-top: 36px;
  font-size: 1.1rem;
  font-weight: 600;
  color: rgba(255,255,255,0.9);
}

/* ============================================
   YHTEYSTIEDOT / CONTACT SECTION
   ============================================ */
.yhteystiedot {
  background: var(--color-white);
}

.yhteystiedot .section-title {
  text-align: center;
  margin-bottom: 48px;
}

.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  max-width: 800px;
  margin: 0 auto;
}

.contact-person h3 {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--color-black);
  margin-bottom: 16px;
}

.contact-person p {
  font-size: 1rem;
  line-height: 2;
  color: var(--color-text);
}

.contact-person a {
  color: var(--color-primary);
  font-weight: 500;
  transition: color 0.2s;
}

.contact-person a:hover {
  color: var(--color-primary-dark);
}

.contact-shared {
  grid-column: 1 / -1;
  text-align: center;
  margin-top: 8px;
}

.contact-shared a {
  color: var(--color-primary);
  font-weight: 500;
  font-size: 1.05rem;
  transition: color 0.2s;
}

.contact-shared a:hover {
  color: var(--color-primary-dark);
}

.contact-company {
  text-align: center;
  margin-top: 48px;
  padding-top: 32px;
  border-top: 1px solid rgba(0,0,0,0.08);
}

.contact-company p {
  font-size: 1rem;
  color: var(--color-text-light);
  line-height: 2;
}

.contact-company a {
  color: var(--color-primary);
  font-weight: 500;
}

/* Section dots — yksittäiset pisteet eri osioissa */
.section-dots {
  position: absolute;
  width: 100px;
  height: 100px;
  pointer-events: none;
  z-index: 3;
  filter: invert(14%) sepia(96%) saturate(4000%) hue-rotate(346deg) brightness(85%) contrast(110%);
}

/* Toimintamalli — oikea yläkulma, 90° vasempaan (180° - 90° = 90°) */
.toimintamalli-dots {
  top: 20px;
  right: 20px;
  transform: rotate(90deg);
}

/* Isännöinti — vasen alakulma, valkoiset pisteet */
.isannointi-dots {
  bottom: 120px;
  left: 20px;
  transform: rotate(0deg);
  filter: brightness(0) invert(1);
}

/* ============================================
   SCROLL NEXT ARROW (mobile only)
   ============================================ */
.scroll-next {
  display: none;
}

/* Scroll-top button (hidden until scrolled near bottom) */
.scroll-top {
  display: block;
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 44px;
  height: 44px;
  padding: 0;
  background: none;
  border: none;
  cursor: pointer;
  z-index: 99;
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px);
  transition: opacity 0.3s, transform 0.3s, visibility 0.3s;
}

.scroll-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.scroll-top svg {
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.15));
}

/* ============================================
   FOOTER
   ============================================ */
.footer {
  background: var(--color-black);
  color: rgba(255,255,255,0.6);
  text-align: center;
  padding: 24px 0;
  font-size: 0.85rem;
}

.current-section-indicator {
  display: none;
}

/* ============================================
   RESPONSIVE
   ============================================ */

/* Smaller logo for 1000–1100px range */
@media (max-width: 1100px) {
  .nav-logo {
    height: 90px;
  }
  .nav-logo.shrunk {
    height: 50px;
    top: 20px;
  }
}

/* Navbar collapses to hamburger below 1000px */
@media (max-width: 1000px) {
  .nav-links {
    display: none;
    position: fixed;
    top: var(--nav-height);
    left: 0;
    right: 0;
    background: var(--color-white);
    flex-direction: column;
    gap: 0;
    padding: 16px 0;
    box-shadow: 0 8px 24px rgba(0,0,0,0.1);
    border-top: 1px solid rgba(0,0,0,0.06);
  }

  .nav-links.open {
    display: flex;
  }

  .nav-links a {
    padding: 14px 24px;
    border-bottom: none;
    font-size: 1rem;
  }

  .nav-links a:hover,
  .nav-links a.active {
    background: var(--color-gray);
    border-bottom: none;
  }

  .hamburger {
    display: flex;
    margin-right: 16px; /* Erota hieman indikaattorista */
  }

  .current-section-indicator {
    display: block;
    font-size: 1rem;
    font-weight: 600;
    color: var(--color-primary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    opacity: 0;
    transform: translateY(-5px);
    animation: fade-in-down 0.4s ease forwards;
    margin-right: auto; /* Työntää logon oikeaan laitaan */
  }

  @keyframes fade-in-down {
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }

  .nav-logo {
    height: 70px; /* Hieman ylittävä koko tablettiin/mobiiliin */
    top: 0; 
    right: 24px; 
    position: absolute;
  }

  .nav-logo.shrunk {
    height: 50px; /* Mahtuu 90px palkkiin */
    top: 20px;
  }

  /* Disable scroll-snap — long sections cause snap-back issues */
  html {
    scroll-snap-type: none;
  }

  /* Sections: column layout so sticky scroll-next works */
  section {
    flex-direction: column;
    overflow: clip;
    scroll-snap-align: none;
  }

  .palvelut-yhteystiedot-wrap {
    scroll-snap-align: none;
  }

  /* Scroll-next arrow — sticky to bottom of section */
  .scroll-next {
    display: block;
    position: sticky;
    bottom: 16px;
    width: 44px;
    height: 44px;
    margin: 0 auto;
    padding: 0;
    background: none;
    border: none;
    cursor: pointer;
    z-index: 10;
    animation: bounce-arrow 2s ease-in-out infinite;
    flex-shrink: 0;
    transition: opacity 0.3s;
  }

  .scroll-next.hidden {
    opacity: 0;
    pointer-events: none;
  }

  .scroll-next svg {
    width: 100%;
    height: 100%;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.15));
  }

  @keyframes bounce-arrow {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(6px); }
  }

  /* Hero: switch to single column at hamburger breakpoint */
  .hero .container {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .hero-image img {
    height: 380px;
  }

  /* Hide dots below 1000px — only red strip remains */
  .hero.has-dots::after {
    display: none;
  }
}

/* Tablet */
@media (max-width: 1024px) {
  .section-title {
    font-size: 2rem;
  }

  .hero-content h1 {
    font-size: 2.4rem;
  }

  .hero-image img {
    height: 480px;
  }

  .team-images img {
    height: 420px;
  }

  .section-grid {
    gap: 40px;
  }

  .verkosto-laatu-container {
    gap: 16px;
  }

  .vl-card {
    height: 100px;
    font-size: 1rem;
  }
}

/* Mobile */
@media (max-width: 768px) {
  :root {
    --nav-height: 60px;
  }

  .nav-links {
    top: var(--nav-height);
  }

  .nav-logo.shrunk {
    height: 44px; /* Mahtuu 60px palkkiin */
    top: 8px;
  }

  /* Sections on mobile — additional padding adjustments */
  section {
    padding: 60px 0 16px;
    align-items: stretch;
    padding-top: calc(var(--nav-height) + 20px);
  }

  /* Hero — centered and focused on mobile */
  .hero {
    min-height: 100svh;
    padding-top: calc(var(--nav-height) + 24px);
    padding-bottom: 72px; /* tilaa sticky-nuolelle */
    justify-content: center;
  }

  /* White card behind text on mobile for readability */
  .team-content,
  .experts-text,
  .toimintamalli-text,
  .isannointi-content,
  .miksi-content {
    background: var(--color-white);
    padding: 24px;
    border-radius: 8px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
    position: relative;
    z-index: 2;
  }

  /* Scale down section decorations on mobile */
  .team::before {
    width: 30%;
  }

  .experts::before {
    width: 80px;
    right: -30px;
  }

  .isannointi::before {
    width: 80px;
    left: -30px;
  }

  .miksi::before {
    width: 40%;
    height: 30%;
  }

  .hero .container {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .hero-image img {
    height: 280px;
  }

  .hero-content h1 {
    font-size: 2rem;
  }

  .hero-content {
    padding: 0;
  }

  .hero-dots {
    display: none;
  }

  /* hero-dots-bg (red strip) intentionally kept visible on mobile */

  /* Section grids stack */
  .section-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .section-title {
    font-size: 1.8rem;
  }

  /* Team — mobiilissa pino pystyyn */
  .team-layout {
    flex-direction: column;
    min-height: auto;
  }

  .team-red-bg {
    width: 100%;
    height: 300px; /* Vain kuvien yläosa punaisella mobiilissa */
  }

  .team-images {
    width: 100%;
    grid-template-columns: 1fr 1fr;
    gap: 2px;
  }

  .team-images img {
    height: 260px;
    max-height: 260px;
  }

  .team-content {
    padding: 32px 24px;
    align-self: auto;
  }

  .team-dots {
    display: none;
  }

  /* Experts */
  .experts .section-grid {
    direction: ltr;
  }

  .experts-image img {
    height: 300px;
  }

  /* Verkosto-Laatu on mobile - Hide completely as requested */
  .verkosto-laatu-container {
    display: none;
  }

  /* Isannointi */
  .isannointi-image img {
    height: 300px;
  }

  /* Miksi collage — horizontal carousel on mobile */
  .miksi-collage {
    min-height: auto;
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    position: relative;
    z-index: 2;
    height: 250px;
    gap: 0;
    scrollbar-width: none;
  }

  .miksi-collage::-webkit-scrollbar {
    display: none;
  }

  .miksi-collage::before {
    display: none;
  }

  .miksi-collage img {
    flex: 0 0 100%;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 4px;
    scroll-snap-align: center;
  }

  /* Carousel dots indicator */
  .carousel-dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 12px;
    position: relative;
    z-index: 2;
  }

  .carousel-dots span {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255,255,255,0.5);
    border: 1.5px solid var(--color-primary);
    transition: background 0.3s;
    cursor: pointer;
  }

  .carousel-dots span.active {
    background: var(--color-primary);
  }

  /* Contact */
  .contact-grid {
    grid-template-columns: 1fr;
    gap: 32px;
    text-align: center;
  }

  /* Hide CSS grid dots on mobile */
  .has-dots::before,
  .has-dots::after {
    display: none;
  }

  .section-dots {
    display: none;
  }
}

/* Small mobile */
@media (max-width: 480px) {
  .hero-content h1 {
    font-size: 1.7rem;
  }

  .section-title {
    font-size: 1.5rem;
  }

  .palvelut-grid {
    grid-template-columns: 1fr;
  }
}
