/* ============================================================
   Kangasalan Konehuolto Oy
   Pohjustus: paperikiet, syvä merengonvihreä, amber-huomio
   ============================================================ */

:root {
  --paper:      #F6F3EC;
  --paper-2:    #EFEAE0;
  --surface:    #FFFFFF;
  --ink:        #10201C;
  --ink-soft:   #3D4A46;
  --muted:      #6B7570;
  --line:       #D9D3C6;

  --accent:     #14604A;
  --accent-ink: #FFFFFF;
  --accent-soft:#E3EDE8;

  --hi:         #C9772A;
  --hi-soft:    #F5E7D4;

  --danger:     #A3282B;
  --ok:         #14604A;

  --font-head: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --font-body: "Public Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --wrap: 72rem;
  --pad: clamp(1rem, 4vw, 3rem);
  --radius: 4px;
  --radius-lg: 6px;

  --shadow: 0 1px 2px rgba(16,32,28,.05), 0 12px 32px -16px rgba(16,32,28,.22);
}

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

img, svg { display: block; max-width: 100%; }

h1, h2, h3 {
  font-family: var(--font-head);
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -.015em;
  margin: 0 0 .6em;
  text-wrap: pretty;
}
h1 { font-size: clamp(2rem, 4.6vw, 3.4rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2.2rem); }
h3 { font-size: 1.15rem; }

p { margin: 0 0 1em; text-wrap: pretty; }

a { color: var(--accent); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }

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

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip {
  position: absolute; left: 1rem; top: -4rem; z-index: 100;
  background: var(--ink); color: #fff; padding: .6rem 1rem; border-radius: var(--radius);
  transition: top .15s;
}
.skip:focus { top: 1rem; color: #fff; }

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

/* ---------------- Napit ---------------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: .5rem; padding: .85rem 1.4rem;
  background: var(--accent); color: var(--accent-ink);
  font-family: var(--font-head); font-weight: 600; font-size: .95rem;
  text-decoration: none; border: 1px solid var(--accent);
  border-radius: var(--radius); cursor: pointer;
  transition: background .15s, transform .15s, box-shadow .15s;
}
.btn:hover { background: #0E4B3A; transform: translateY(-1px); box-shadow: var(--shadow); }
.btn-small { padding: .55rem 1rem; font-size: .875rem; }

.btn-ghost {
  background: transparent; color: var(--ink); border-color: var(--line);
}
.btn-ghost:hover { background: var(--surface); border-color: var(--ink); }

/* ---------------- Ylätunniste ---------------- */

.site-head {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.head-inner {
  display: flex; align-items: center; gap: 1.5rem;
  padding-block: .85rem;
}
.brand {
  display: inline-flex; align-items: center; gap: .65rem;
  color: var(--ink); text-decoration: none;
  font-family: var(--font-head); font-size: .95rem; line-height: 1.15;
}
.brand-mark { width: 2rem; height: 2rem; color: var(--accent); flex: none; }
.brand-text strong { font-weight: 700; }

.nav { display: flex; align-items: center; gap: 1.5rem; margin-left: auto; }
.nav a {
  color: var(--ink-soft); text-decoration: none;
  font-size: .95rem; font-weight: 500;
}
.nav a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 4px; }
.nav .btn { color: var(--accent-ink); }
.nav .btn:hover { text-decoration: none; }

.nav-toggle {
  display: none; margin-left: auto;
  background: none; border: 1px solid var(--line); border-radius: var(--radius);
  width: 44px; height: 44px; cursor: pointer;
  flex-direction: column; align-items: center; justify-content: center; gap: 5px;
}
.nav-toggle-bar { width: 20px; height: 2px; background: var(--ink); transition: transform .18s, opacity .18s; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:first-child { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:last-child { transform: translateY(-7px) rotate(-45deg); }

/* ---------------- Sankkariblokki ---------------- */

.hero {
  position: relative;
  padding-block: clamp(3rem, 8vw, 6rem) clamp(2.5rem, 6vw, 5rem);
  background:
    linear-gradient(180deg, var(--paper) 0%, var(--paper-2) 100%);
  border-bottom: 1px solid var(--line);
  overflow: hidden;
}
.hero::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image:
    linear-gradient(to right, rgba(20,96,74,.06) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(20,96,74,.06) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: linear-gradient(180deg, #000 0%, transparent 82%);
}

.hero-grid {
  position: relative;
  display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(20rem, .85fr);
  gap: clamp(2rem, 5vw, 4.5rem); align-items: start;
}

.eyebrow {
  font-family: var(--font-head); font-size: .78rem; font-weight: 600;
  letter-spacing: .14em; text-transform: uppercase;
  color: var(--accent); margin: 0 0 1rem;
}

.lede {
  font-size: clamp(1.05rem, 1.6vw, 1.2rem);
  color: var(--ink-soft); max-width: 34rem;
}

.hero-actions { display: flex; flex-wrap: wrap; gap: .75rem; margin: 1.75rem 0 2.25rem; }

.hero-facts {
  display: flex; flex-wrap: wrap; gap: 1.5rem;
  margin: 0; padding-top: 1.5rem; border-top: 1px solid var(--line);
}
.hero-facts > div { min-width: 8rem; }
.hero-facts dt {
  font-family: var(--font-head); font-size: .72rem; font-weight: 600;
  letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-bottom: .25rem;
}
.hero-facts dd { margin: 0; font-weight: 600; font-size: .95rem; }

/* Kortti */
.hero-card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-lg); padding: 1.5rem;
  box-shadow: var(--shadow);
}
.hero-card-head { display: flex; align-items: center; gap: .6rem; margin-bottom: .5rem; }
.hero-card-head h2 { font-size: 1rem; margin: 0; }
.dot {
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--ok); box-shadow: 0 0 0 4px var(--accent-soft); flex: none;
}
.hero-card-sub { font-size: .9rem; color: var(--muted); margin-bottom: 1.25rem; }
.hero-card-list { list-style: none; margin: 0 0 1.25rem; padding: 0; }
.hero-card-list li {
  display: flex; justify-content: space-between; gap: 1rem;
  padding: .7rem 0; border-top: 1px solid var(--line); font-size: .9rem;
}
.hero-card-list strong { font-weight: 600; text-align: right; }
.hero-card-link {
  display: inline-flex; align-items: center; gap: .4rem;
  font-family: var(--font-head); font-weight: 600; font-size: .9rem;
  text-decoration: none;
}
.hero-card-link:hover { text-decoration: underline; text-underline-offset: 4px; }

/* ---------------- Osiot ---------------- */

.section { padding-block: clamp(3rem, 7vw, 5.5rem); }
.section-alt { background: var(--ink); color: #EDEAE2; }
.section-alt .section-lede { color: #B9C2BE; }

.section-head { max-width: 44rem; margin-bottom: clamp(2rem, 4vw, 3.5rem); }
.section-lede { font-size: 1.1rem; color: var(--ink-soft); }
.section-alt h2 { color: #fff; }
.section-alt .eyebrow { color: #8FD4BC; }

/* Palvelut — epäsymmetrinen: suuri + sivu + rivi */
.service-lead {
  display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(15rem, .6fr);
  gap: clamp(2rem, 4vw, 3.5rem);
  padding: clamp(1.5rem, 3vw, 2.5rem);
  background: var(--surface); border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius-lg); margin-bottom: 1.5rem;
}
.service-lead h3 { font-size: clamp(1.3rem, 2.4vw, 1.8rem); }
.service-lead p { color: var(--ink-soft); }
.aside-label {
  font-family: var(--font-head); font-size: .72rem; font-weight: 600;
  letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-bottom: .75rem;
}
.aside-list { list-style: none; margin: 0; padding: 0; }
.aside-list li {
  padding: .5rem 0; border-top: 1px solid var(--line); font-size: .92rem;
}

.ticks { list-style: none; margin: 1.25rem 0 0; padding: 0; display: grid; gap: .5rem; }
.ticks li { position: relative; padding-left: 1.5rem; font-size: .95rem; }
.ticks li::before {
  content: ""; position: absolute; left: 0; top: .5rem;
  width: 9px; height: 9px; border-radius: 2px; background: var(--accent);
}

.service-row {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem;
}
.service {
  background: var(--paper); border: 1px solid var(--line);
  border-radius: var(--radius-lg); padding: 1.4rem;
}
.service h3 { font-size: 1.05rem; }
.service p { font-size: .93rem; color: var(--ink-soft); margin-bottom: .75rem; }
.service-meta {
  font-family: var(--font-head); font-size: .8rem; font-weight: 600;
  color: var(--accent); margin: 0;
}

/* Prosessi */
.steps {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1.5rem;
  counter-reset: askel;
}
.steps li {
  position: relative; padding-top: 1.25rem;
  border-top: 2px solid rgba(255,255,255,.16);
}
.step-n {
  display: inline-flex; align-items: center; justify-content: center;
  width: 2.25rem; height: 2.25rem; margin-bottom: .75rem;
  background: var(--hi); color: #20140A;
  font-family: var(--font-head); font-weight: 700; font-size: .95rem;
  border-radius: 50%;
}
.steps h3 { color: #fff; font-size: 1.05rem; }
.steps p { color: #B9C2BE; font-size: .92rem; margin: 0; }

/* Yhteystiedot */
.contact-grid {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(18rem, .9fr);
  gap: clamp(2rem, 5vw, 4rem); align-items: start;
}
.contact-copy h2 { font-size: clamp(1.6rem, 3vw, 2.3rem); max-width: 22rem; }
.contact-list { list-style: none; margin: 2rem 0 0; padding: 0; }
.contact-list li {
  display: grid; grid-template-columns: 9rem 1fr; gap: 1rem;
  padding: .85rem 0; border-top: 1px solid var(--line);
}
.contact-label {
  font-family: var(--font-head); font-size: .74rem; font-weight: 600;
  letter-spacing: .1em; text-transform: uppercase; color: var(--muted);
  padding-top: .2rem;
}
.contact-list a { color: var(--ink); font-weight: 600; }

.contact-form {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-lg); padding: 1.5rem; box-shadow: var(--shadow);
}
.contact-form h3 { font-size: 1.1rem; }
.field { display: block; margin-bottom: 1rem; }
.field span {
  display: block; font-family: var(--font-head); font-size: .8rem;
  font-weight: 600; margin-bottom: .35rem;
}
.field em { color: var(--danger); font-style: normal; }
.field input, .field textarea {
  width: 100%; padding: .7rem .8rem;
  font: inherit; font-size: .95rem; color: var(--ink);
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
}
.field input:focus, .field textarea:focus {
  outline: 3px solid var(--hi-soft); border-color: var(--hi); background: #fff;
}
.field textarea { resize: vertical; min-height: 6rem; }
.form-note { margin: .75rem 0 0; font-size: .88rem; min-height: 1.4em; }
.form-note.ok { color: var(--ok); }
.form-note.err { color: var(--danger); }

/* ---------------- Alatunniste ---------------- */

.site-foot {
  background: var(--ink); color: #B9C2BE;
  padding-block: 2.5rem; border-top: 1px solid var(--line);
}
.foot-grid {
  display: flex; flex-wrap: wrap; align-items: center; gap: 1.5rem 2.5rem;
}
.foot-brand {
  font-family: var(--font-head); font-weight: 700; color: #fff;
  margin: 0; font-size: 1rem;
}
.foot-small { font-size: .85rem; margin: 0; }
.foot-hosting {
  font-size: .8rem; color: #8E9B95; text-align: center; margin: 1.5rem auto 0;
}
.foot-nav { display: flex; flex-wrap: wrap; gap: 1.25rem; margin-left: auto; }
.foot-nav a { color: #B9C2BE; text-decoration: none; font-size: .9rem; }
.foot-nav a:hover { color: #fff; text-decoration: underline; text-underline-offset: 4px; }

/* ---------------- Responsiivisuus ---------------- */

@media (max-width: 62rem) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-card { max-width: 30rem; }
  .service-lead { grid-template-columns: 1fr; }
  .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .contact-grid { grid-template-columns: 1fr; }
}

@media (max-width: 40rem) {
  .nav-toggle { display: inline-flex; }
  .nav {
    position: absolute; left: 0; right: 0; top: 100%;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--surface); border-bottom: 1px solid var(--line);
    padding: .5rem var(--pad) 1rem;
    display: none;
  }
  .nav[data-open="true"] { display: flex; }
  .nav a { padding: .85rem 0; border-top: 1px solid var(--line); }
  .nav .btn { margin-top: .75rem; border-top: 0; }
  .service-row { grid-template-columns: 1fr; }
  .steps { grid-template-columns: 1fr; }
  .contact-list li { grid-template-columns: 1fr; gap: .15rem; }
  .hero-facts { gap: 1rem; }
  .hero-facts > div { min-width: 6rem; }
}

/* ---------------- Liike ---------------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
