/* ── Variables ─────────────────────────────────────────── */
:root {
  /* Brand blue at various opacities */
  --brand:     rgb(0, 64, 128);
  --brand-05:  rgba(0, 64, 128, 0.05);
  --brand-12:  rgba(0, 64, 128, 0.12);
  --brand-25:  rgba(0, 64, 128, 0.25);
  --brand-50:  rgba(0, 64, 128, 0.50);
  --brand-75:  rgba(0, 64, 128, 0.75);

  /* Construction palette */
  --orange:    #E8660C;               /* turvaliivi hi-vis */
  --orange-bg: rgba(232,102,12,.10);
  --yellow:    #F4C400;               /* mittanauha */
  --yellow-bg: rgba(244,196,0,.14);
  --teal:      #28BAB2;               /* vedeneristys */
  --teal-bg:   rgba(40,186,178,.10);

  --ink:   #0f0f0f;
  --mid:   #5c5c5c;
  --rule:  rgba(0,64,128,0.10);
  --bg:    #f3f0ec;     /* warm concrete base */
  --sand:  #edeae5;
  --white: #ffffff;
  --mono:  'DM Mono', monospace;
  --sans:  'DM Sans', sans-serif;
  --col:   640px;
}

/* ── Reset ─────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--ink);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

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

/* ── Header ─────────────────────────────────────────────── */
/* two accent lines: orange on top, brand blue below */
header {
  background: var(--white);
  border-top: 3px solid var(--orange);
  border-bottom: 3px solid var(--brand);
  position: sticky;
  top: 0;
  z-index: 100;
  isolation: isolate;
}
.header-inner {
  max-width: var(--col);
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 58px;
}
.logo-wrap { display: flex; align-items: center; gap: 12px; }
.logo-wrap img { height: 32px; width: auto; }
.logo-name {
  font-family: var(--mono);
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--brand);
  letter-spacing: 0.04em;
}
nav { display: flex; gap: 22px; }
nav a {
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--mid);
  letter-spacing: 0.07em;
  text-transform: uppercase;
  transition: color 0.15s;
}
nav a:hover { color: var(--brand); text-decoration: none; }

/* ── Hero ───────────────────────────────────────────────── */
.hero {
  background: var(--white);
  padding: 52px 24px 48px;
  border-bottom: 1px solid var(--rule);
  background-image: linear-gradient(135deg, var(--brand-12) 0%, transparent 55%);
}
.hero .wrap {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 32px;
  align-items: end;
}
.hero-label {
  font-family: var(--mono);
  font-size: 0.69rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--brand-50);
  margin-bottom: 14px;
}
.hero h1 {
  font-size: clamp(1.55rem, 4vw, 2.1rem);
  font-weight: 300;
  line-height: 1.25;
}
.hero h1 strong { font-weight: 500; color: var(--brand); }

/* year badge — orange left border gives it a hi-vis feel */
.hero-since {
  font-family: var(--mono);
  font-size: 0.67rem;
  color: var(--mid);
  text-align: right;
  line-height: 1.7;
  white-space: nowrap;
  border-left: 4px solid var(--brand-50);
  padding-left: 14px;
}
.hero-since .year {
  display: block;
  font-size: 2rem;
  font-weight: 500;
  color: var(--brand);
  letter-spacing: -0.03em;
  line-height: 1;
  margin: 4px 0 2px;
}

/* ── Sections ───────────────────────────────────────────── */
section { padding: 44px 24px; border-bottom: 1px solid var(--rule); }
section:last-of-type { border-bottom: none; }

.section-label {
  font-family: var(--mono);
  font-size: 1.00rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--brand-75);
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.section-label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--rule);
}
p { margin-bottom: 1em; }
p:last-child { margin-bottom: 0; }

/* ── About ──────────────────────────────────────────────── */
#tietoa { background: var(--white); }
#tietoa p { font-size: 1rem; }

/* Photo + text side by side */
.about-intro {
  display: flex;
  gap: 24px;
  align-items: flex-start;
  margin-bottom: 1.5em;
}
.about-photo {
  width: 130px;
  height: 170px;
  object-fit: cover;
  object-position: top center;
  flex-shrink: 0;
  border-left: 4px solid var(--brand-50);
  display: block;
  /* placeholder appearance until real photo is added */
  background: var(--sand);
}
.about-text { flex: 1; }

.tietoa-list {
  list-style: none;
  margin-top: 0.5em;
}
.tietoa-list li {
  display: grid;
  grid-template-columns: 20px 1fr;
  gap: 14px;
  padding: 10px 0;
  border-bottom: 1px solid var(--rule);
  font-size: 0.94rem;
  color: var(--ink);
}
.tietoa-list li:last-child { border-bottom: none; }
.tietoa-list li::before {
  content: '→';
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--orange);
  padding-top: 3px;
}

/* ── Services ───────────────────────────────────────────── */
#palvelut { background: var(--white); 
    background-image: linear-gradient(135deg, var(--brand-12) 0%, transparent 55%);
}

.services-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3px;
  background: var(--rule);
  border: 1px solid var(--rule);
  border-radius: 2px;
  overflow: hidden;
}
.service-card {
  background: var(--white);
  padding: 22px 20px 22px 17px;
  border-left: 4px solid transparent;
  transition: background 0.15s, border-color 0.15s;
}

/* colour-coded accents from the construction palette */
.service-card:nth-child(4n+1)       { border-color: var(--brand-25); }
.service-card:nth-child(4n+1):hover { border-color: var(--brand); background: var(--brand-05); }

.service-card:nth-child(4n+2)       { border-color: rgba(232,102,12,.35); }
.service-card:nth-child(4n+2):hover { border-color: var(--orange); background: var(--orange-bg); }

.service-card:nth-child(4n+3)       { border-color: rgba(244,196,0,.55); }
.service-card:nth-child(4n+3):hover { border-color: var(--yellow); background: var(--yellow-bg); }

.service-card:nth-child(4n+4)       { border-color: rgba(40,186,178,.40); }
.service-card:nth-child(4n+4):hover { border-color: var(--teal); background: var(--teal-bg); }

/* 05 spans full width — use class instead of nth-child so it's robust */
.service-card--wide {
  grid-column: 1 / -1;
  border-color: var(--brand-25);
}
.service-card--wide:hover { border-color: var(--brand); background: var(--brand-05); }

.service-num {
  font-family: var(--mono);
  font-size: 0.61rem;
  letter-spacing: 0.12em;
  color: var(--brand-50);
  margin-bottom: 7px;
}
.service-title { font-size: 0.92rem; font-weight: 500; margin-bottom: 5px; }
.service-desc  { font-size: 0.83rem; color: var(--mid); line-height: 1.55; margin: 0; }
.service-desc + .service-desc { margin-top: 0.6em; }

/* ── Why ────────────────────────────────────────────────── */
#miksi { background: var(--white); }
.why-list { list-style: none; }
.why-list li {
  display: grid;
  grid-template-columns: 20px 1fr;
  gap: 14px;
  padding: 13px 0;
  border-bottom: 1px solid var(--rule);
  align-items: start;
  font-size: 0.94rem;
}
.why-list li:last-child { border-bottom: none; }
.why-arrow {
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--orange);
  padding-top: 3px;
}

/* ── Contact ─────────────────────────────────────────────── */
#yhteystiedot { background: var(--white); 
    background-image: linear-gradient(135deg, var(--brand-12) 0%, transparent 55%);
}

.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 36px;
}
.contact-block dt {
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--brand-75);
  margin-bottom: 3px;
}
.contact-block dd {
  font-size: 0.92rem;
  color: var(--ink);
  margin-bottom: 16px;
}
.contact-block dd a { color: var(--ink); }
.contact-block dd a:hover { color: var(--orange); text-decoration: none; }

.cta-label {
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--brand-75);
  margin-bottom: 8px;
}
.cta-note { font-size: 0.86rem; color: var(--mid); margin-bottom: 18px; }

.cta-button {
  display: inline-block;
  background: var(--brand);
  color: var(--white) !important;
  font-family: var(--mono);
  font-size: 0.74rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 12px 22px;
  text-decoration: none !important;
  transition: background 0.15s;
}
.cta-button:hover { background: var(--orange); }

/* ── Footer ─────────────────────────────────────────────── */
footer {
  padding: 14px 24px;
  background: rgb(0,24,56);
  border-top: 3px solid var(--orange);
}
.footer-inner {
  max-width: var(--col);
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
footer p {
  font-family: var(--mono);
  font-size: 0.63rem;
  color: rgba(255,255,255,.30);
  margin: 0;
  letter-spacing: 0.06em;
}

/* ── Animations ─────────────────────────────────────────── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}
.hero .wrap         { animation: fadeUp 0.4s ease 0.05s both; }
#tietoa .wrap       { animation: fadeUp 0.4s ease 0.10s both; }
#palvelut .wrap     { animation: fadeUp 0.4s ease 0.15s both; }
#miksi .wrap        { animation: fadeUp 0.4s ease 0.20s both; }
#yhteystiedot .wrap { animation: fadeUp 0.4s ease 0.25s both; }

/* ── Mobile ──────────────────────────────────────────────── */

/* Hamburger button — hidden on desktop */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  width: 32px;
  height: 32px;
}
.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--brand);
  border-radius: 1px;
  transition: transform 0.2s ease, opacity 0.2s ease;
}
/* Animate to ✕ when open */
.nav-toggle--open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle--open span:nth-child(2) { opacity: 0; }
.nav-toggle--open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

@media (max-width: 540px) {
  /* Show hamburger, hide inline nav */
  .nav-toggle { display: flex; }
  nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--white);
    border-bottom: 3px solid var(--brand);
    flex-direction: column;
    gap: 0;
    padding: 8px 0;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
  }
  nav.nav-open { display: flex; }
  nav a {
    padding: 13px 24px;
    font-size: 0.78rem;
    border-bottom: 1px solid var(--rule);
  }
  nav a:last-child { border-bottom: none; }

  /* Stack photo above text on small screens */
  .about-intro   { flex-direction: column; }
  .about-photo   { width: 100%; height: auto; aspect-ratio: 3 / 4; border-left: none; border-top: 4px solid var(--orange); }

  /* Rest of mobile layout tweaks */
  .hero .wrap    { grid-template-columns: 1fr; }
  .hero-since    { text-align: left; border-left: none; border-top: 4px solid var(--orange); padding-left: 0; padding-top: 10px; margin-top: 8px; }
  .services-grid { grid-template-columns: 1fr; }
  .contact-grid  { grid-template-columns: 1fr; }
}
