@font-face { font-family: "Inter"; src: url(fonts/inter-latin-400-normal.woff2) format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Inter"; src: url(fonts/inter-latin-500-normal.woff2) format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Inter"; src: url(fonts/inter-latin-600-normal.woff2) format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Barlow"; src: url(fonts/barlow-latin-500-normal.woff2) format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Barlow"; src: url(fonts/barlow-latin-600-normal.woff2) format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Barlow"; src: url(fonts/barlow-latin-700-normal.woff2) format("woff2"); font-weight: 700; font-display: swap; }

:root {
  /* Samat arvot kuin sovelluksen styles.css:ssä: sivu näyttää tuotteelta, ei kampanjalta. */
  --bg: #f5f5f5;
  --surface: #ffffff;
  --surface-3: #f4f6f8;
  --border: #dde3ea;
  --border-2: #eef0f3;
  --ink: #16202b;
  --ink-2: #3d4855;
  --muted: #66727e;
  --accent: #2b4a6f;
  --accent-soft: #eaf0f7;
  --rail: #1e2a38;
  --tila-luonnos: #c99700;
  --tila-suunniteltu: #2b6cb0;
  --tila-valettu: #2f855a;
  --tila-toimitettu: #6b46c1;
  --tila-laskutettu: #718096;
  --warn: #b45309;
  --warn-bg: #fdf1e3;
  --sivu: clamp(16px, 4vw, 56px);
  --otsikko: "Barlow", "Inter", system-ui, sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  background: var(--surface);
  color: var(--ink);
  font: 400 16px/1.6 "Inter", system-ui, sans-serif;
}
a { color: inherit; }
h1, h2, h3 { font-family: var(--otsikko); font-weight: 600; margin: 0; letter-spacing: -0.005em; }
p { margin: 0; }
.n { text-align: right; font-variant-numeric: tabular-nums; }

/* ── Yläpalkki ───────────────────────────────────────────────────────────── */
.yla {
  position: fixed; inset: 0 0 auto 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  height: 56px; padding: 0 var(--sivu);
  background: var(--rail); color: #fff;
}
.merkki { display: flex; align-items: center; gap: 10px; text-decoration: none; font: 600 19px/1 var(--otsikko); }
.merkki svg { width: 24px; height: auto; color: #fff; }
.yla nav { display: flex; align-items: center; gap: 26px; font-size: 14px; }
.yla nav a { text-decoration: none; color: rgba(255,255,255,.66); }
.yla nav a:hover { color: #fff; }
.yla nav .nav-cta { color: var(--rail); background: #fff; padding: 7px 14px; border-radius: 6px; font-weight: 500; }
.yla nav .nav-cta:hover { color: var(--rail); background: #dfe7ef; }
@media (max-width: 820px) { .yla nav a:not(.nav-cta) { display: none; } }

/* ── Yhteiset ────────────────────────────────────────────────────────────── */
.ylaotsikko { font-size: 13px; font-weight: 600; color: var(--accent); margin-bottom: 14px; }
.johdanto { margin-top: 18px; font-size: 17px; color: var(--ink-2); max-width: 40rem; }
.nappi { display: inline-block; text-decoration: none; font-weight: 500; font-size: 15px; background: var(--accent); color: #fff; padding: 11px 18px; border-radius: 6px; }
.nappi:hover { background: #22405f; }
.linkki { color: var(--accent); font-size: 15px; text-underline-offset: 3px; }
a:focus-visible { outline: 2px solid var(--tila-suunniteltu); outline-offset: 3px; }

.pilli {
  display: inline-flex; align-items: center; gap: 6px;
  font: 500 12px/1 "Inter", sans-serif; white-space: nowrap;
  padding: 4px 8px 4px 7px; border-radius: 999px;
  color: var(--c); background: color-mix(in srgb, var(--c) 11%, white);
}
.pilli::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--c); }
.pilli[data-tila="luonnos"] { --c: var(--tila-luonnos); color: #8a6800; }
.pilli[data-tila="suunniteltu"] { --c: var(--tila-suunniteltu); }
.pilli[data-tila="valettu"] { --c: var(--tila-valettu); }
.pilli[data-tila="toimitettu"] { --c: var(--tila-toimitettu); }
.pilli[data-tila="laskutettu"] { --c: var(--tila-laskutettu); color: #4a5568; }
.pilli[data-tila="varoitus"] { --c: var(--warn); }

/* ── Tarina: teksti + 3D-näyttämö ────────────────────────────────────────── */
.tarina { display: grid; grid-template-columns: minmax(0, 11fr) minmax(0, 9fr); grid-template-areas: "tekstit nayttamo"; padding-top: 56px; }
.tekstit { grid-area: tekstit; padding: 0 var(--sivu); }
.tekstit::after { content: ""; display: block; height: 45vh; }
.nayttamo {
  grid-area: nayttamo;
  position: sticky; top: 56px; height: calc(100vh - 56px); height: calc(100svh - 56px);
  background-color: var(--surface-3);
  background-image: linear-gradient(var(--border-2) 1px, transparent 1px), linear-gradient(90deg, var(--border-2) 1px, transparent 1px);
  background-size: 32px 32px;
  border-left: 1px solid var(--border);
}
#kohtaus { display: block; width: 100%; height: 100%; }
.tilamerkki {
  position: absolute; left: 20px; bottom: 20px;
  display: flex; align-items: center; gap: 10px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 8px;
  padding: 8px 10px; font-size: 13px; box-shadow: 0 1px 2px rgba(15,23,32,.06);
}
.tm-nro { font-variant-numeric: tabular-nums; color: var(--muted); }
.tm-tunnus { font-weight: 600; }

.avaus { min-height: calc(100vh - 56px); display: flex; flex-direction: column; justify-content: center; padding: 64px 0; max-width: 44rem; }
h1 { font-size: clamp(38px, 4.6vw, 64px); line-height: 1.02; font-weight: 600; letter-spacing: -0.01em; }
.elinkaari { list-style: none; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 28px 0 0; padding: 0; }
.elinkaari li { display: flex; align-items: center; gap: 6px; }
.elinkaari li + li::before { content: "→"; color: var(--muted); font-size: 13px; }
.toiminnot { margin-top: 32px; display: flex; align-items: center; flex-wrap: wrap; gap: 24px; }

.vaihe { min-height: 82vh; display: flex; flex-direction: column; justify-content: center; padding: 72px 0; max-width: 44rem; border-top: 1px solid var(--border); }
.vnro { font-size: 13px; font-weight: 600; color: var(--accent); margin-bottom: 10px; font-variant-numeric: tabular-nums; }
.vaihe h2 { font-size: clamp(28px, 2.8vw, 38px); line-height: 1.08; margin-bottom: 14px; }
.vaihe > p:not(.vnro) { color: var(--ink-2); font-size: 15.5px; }

.spec { margin: 22px 0 0; font-size: 14px; }
.spec > div { display: grid; grid-template-columns: 8.5rem minmax(0, 1fr); gap: 16px; padding: 8px 0; border-top: 1px solid var(--border-2); }
.spec dt { font-weight: 600; }
.spec dd { margin: 0; color: var(--ink-2); }

/* Prosessin sisällysluettelo avauksessa; tarkastukset sisennettyinä. */
.sisalto { list-style: none; margin: 32px 0 0; padding: 0; columns: 2 15rem; column-gap: 32px; font-size: 14px; }
.sisalto li { break-inside: avoid; padding: 3px 0; border-bottom: 1px solid var(--border-2); }
.sisalto a { text-decoration: none; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.sisalto a:hover { color: var(--accent); }
.sisalto li.t a { color: var(--muted); padding-left: 26px; position: relative; }
.sisalto li.t a::before { content: ""; position: absolute; left: 8px; top: 50%; width: 9px; height: 9px; margin-top: -5px; border: 1.5px solid var(--tila-valettu); border-radius: 2px; }

/* Tarkastusvaihe: sama rakenne, vasen reunaviiva erottaa sen tuotantovaiheista. */
.vaihe.tarkastus { border-top: 1px dashed var(--border); padding-left: 22px; margin-left: 2px; box-shadow: inset 3px 0 0 var(--tila-valettu); }
.tmerkki { display: inline-block; font-size: 11px; font-weight: 600; color: var(--tila-valettu); border: 1px solid currentColor; border-radius: 4px; padding: 1px 6px; margin-right: 6px; }
.vaihe.tarkastus .vnro { color: var(--muted); font-weight: 500; }
.tyokalut { font-family: "Inter", sans-serif; font-size: 12px; font-weight: 600; color: var(--muted); margin: 26px 0 0; letter-spacing: 0; }
.tyokalut + .spec { margin-top: 6px; }
.tm-vaihe { font-weight: 500; color: var(--ink-2); padding-right: 10px; border-right: 1px solid var(--border); }

/* Raudoituskuva: kuvan paikalla raudoitusverkko, päällä palvelimen polttama leima. */
.kuva { margin: 24px 0 0; position: relative; width: min(100%, 520px); aspect-ratio: 4 / 3; border-radius: 6px; overflow: hidden; background: #6b6f73; box-shadow: 0 10px 28px -14px rgba(15,23,32,.4); }
.kuva-pinta { position: absolute; inset: 0;
  background:
    repeating-linear-gradient(90deg, transparent 0 34px, #3b2f28 34px 39px),
    repeating-linear-gradient(0deg, transparent 0 34px, #4a3a30 34px 39px),
    linear-gradient(160deg, #8d9196, #5d6166);
  transform: perspective(600px) rotateX(28deg) scale(1.35); transform-origin: 50% 70%; }
.kuva-leima { position: absolute; left: 0; right: 0; bottom: 0; padding: 10px 12px; background: rgba(0,0,0,.55); color: #fff; display: flex; flex-direction: column; gap: 2px; }
.kuva-leima b { font: 700 20px/1.1 var(--otsikko); letter-spacing: .01em; }
.kuva-leima span { font-size: 12px; opacity: .9; font-variant-numeric: tabular-nums; }

.ui-taulu .tarjous td { background: repeating-linear-gradient(135deg, transparent 0 6px, var(--border-2) 6px 7px); }
.ui-taulu td.neg { color: #c0392b; }
.pedit b.nyt { outline: 2px solid var(--ink); outline-offset: -1px; }

/* ── Ohjelmanäkymät (demodata) ───────────────────────────────────────────── */
.ui { margin: 24px 0 0; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; overflow: hidden; box-shadow: 0 1px 2px rgba(15,23,32,.05), 0 8px 24px -12px rgba(15,23,32,.12); }
.ui-otsake { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 9px 12px; border-bottom: 1px solid var(--border); font-size: 13px; font-weight: 600; background: var(--surface-3); }
.ui-hiljainen { color: var(--muted); font-weight: 400; }
.ui > .ui-taulu { display: block; overflow-x: auto; }
.ui-taulu { width: 100%; border-collapse: collapse; font-size: 12.5px; line-height: 1.35; }
.ui-taulu th, .ui-taulu td { padding: 5px 10px; border-bottom: 1px solid var(--border-2); text-align: left; white-space: nowrap; }
.ui-taulu thead th { font-weight: 500; color: var(--muted); background: var(--surface); font-size: 12px; }
.ui-taulu th.n, .ui-taulu td.n { text-align: right; }
.ui-taulu tfoot td { font-weight: 600; background: var(--surface-3); border-bottom: 0; }
.ui-taulu tbody tr:hover td { background: #f6f8fa; }

.pedit td { vertical-align: top; min-width: 92px; }
.pedit tbody th { font-weight: 500; color: var(--ink-2); background: var(--surface-3); }
.pedit b { display: block; font-weight: 500; font-size: 11.5px; padding: 3px 6px; margin: 2px 0; border-radius: 4px; border-left: 3px solid var(--c); background: color-mix(in srgb, var(--c) 9%, white); }
.pedit .v1 { --c: #2b6cb0; } .pedit .v2 { --c: #2f855a; } .pedit .v3 { --c: #6b46c1; } .pedit .v4 { --c: #b7791f; }
.pedit .vapaa { color: var(--muted); font-size: 11.5px; background: repeating-linear-gradient(135deg, transparent 0 6px, var(--border-2) 6px 7px); }

.kaanto { display: inline-block; font-size: 10px; font-weight: 600; color: var(--warn); border: 1px solid currentColor; border-radius: 3px; padding: 0 3px; margin-left: 4px; }
.palkki { display: inline-block; width: 60px; height: 6px; background: var(--border-2); border-radius: 3px; vertical-align: middle; margin-right: 6px; overflow: hidden; }
.palkki i { display: block; height: 100%; background: var(--tila-valettu); }

/* Elementtilappu: 100 × 60 mm -tarran mittasuhteet. */
.lappu {
  margin: 24px 0 0; width: min(100%, 470px); aspect-ratio: 100 / 60;
  display: grid; grid-template-columns: 34% 1fr; grid-template-rows: 1fr auto; gap: 0 14px;
  background: #fff; color: #000; border: 1px solid #c3cbd4; border-radius: 6px; padding: 14px;
  box-shadow: 0 1px 2px rgba(15,23,32,.05), 0 10px 28px -14px rgba(15,23,32,.25);
  font-family: "Inter", sans-serif;
}
.lappu-qr { grid-row: 1 / 3; align-self: center; }
.lappu-qr svg { display: block; width: 100%; height: auto; }
.lappu-tunnus { font: 700 clamp(22px, 3vw, 30px)/1 var(--otsikko); margin-bottom: 4px; }
.lappu-tiedot { font-size: clamp(10px, 1.2vw, 12.5px); line-height: 1.35; min-width: 0; }
.lappu-tiedot table { border-collapse: collapse; margin-top: 6px; }
.lappu-tiedot th { text-align: left; font-weight: 400; color: #444; padding: 1px 10px 1px 0; }
.lappu-tiedot td { font-weight: 600; font-variant-numeric: tabular-nums; padding: 1px 0; }
.lappu-ce { display: flex; align-items: center; gap: 8px; font-size: 11px; font-weight: 600; }
.lappu-ce img { height: 22px; }

/* ── Osiot ───────────────────────────────────────────────────────────────── */
.osio { padding: 112px var(--sivu); border-top: 1px solid var(--border); }
.osio-otsake { max-width: 46rem; margin-bottom: 44px; }
.osio h2 { font-size: clamp(30px, 3.2vw, 44px); line-height: 1.06; }

/* Sovellusikkuna */
#sovellus { background: var(--bg); }
.ikkuna { display: grid; grid-template-columns: 52px minmax(0, 1fr); background: var(--surface); border: 1px solid var(--border); border-radius: 10px; overflow: hidden; box-shadow: 0 30px 70px -30px rgba(15,23,32,.35); }
.kisko { background: var(--rail); display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 14px 0; }
.kisko svg { width: 24px; color: #fff; margin-bottom: 8px; }
.kisko i { width: 22px; height: 22px; border-radius: 5px; background: rgba(255,255,255,.12); }
.kisko i.on { background: #8fbef0; }
.ikkuna-sisalto { min-width: 0; }
.ikkuna-yla { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px 24px; padding: 12px 16px 0; font-size: 14px; border-bottom: 1px solid var(--border); }
.valilehdet { display: flex; gap: 18px; font-size: 13px; color: var(--muted); overflow-x: auto; }
.valilehdet span { padding: 6px 0 10px; border-bottom: 2px solid transparent; white-space: nowrap; }
.valilehdet .on { color: var(--ink); border-bottom-color: var(--accent); font-weight: 500; }
.ikkuna-suodatin { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; padding: 10px 16px; border-bottom: 1px solid var(--border); font-size: 12.5px; }
.kentta { border: 1px solid #a5a8ac; border-radius: 6px; padding: 5px 10px; color: var(--muted); min-width: 200px; }
.suodatin { border: 1px solid var(--border); background: var(--surface-3); border-radius: 6px; padding: 5px 9px; }
.oikealle { margin-left: auto; }
.ikkuna-taulu { overflow-x: auto; }
.kuvateksti { margin-top: 12px; font-size: 13px; color: var(--muted); }

/* Työaika + pääte */
.osio-jaettu { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 4fr); gap: 64px; align-items: center; }
.osio-jaettu .spec { max-width: 44rem; }
.paate { margin: 0; background: #11181f; color: #e9eef3; border-radius: 18px; padding: 18px; border: 10px solid #2b333c; aspect-ratio: 10 / 16; display: flex; flex-direction: column; max-width: 320px; justify-self: center; width: 100%; }
.paate-yla { display: flex; justify-content: space-between; font-size: 13px; color: #9aa6b2; font-variant-numeric: tabular-nums; }
.paate-keski { flex: 1; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; gap: 6px; }
.paate-kuittaus { font: 700 44px/1 var(--otsikko); color: #4ade80; }
.paate-nimi { font-size: 18px; font-weight: 500; }
.paate .ui-hiljainen { color: #9aa6b2; font-size: 13px; font-variant-numeric: tabular-nums; }
.paate-napit { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 14px; }
.paate-napit span { text-align: center; padding: 14px 0; border-radius: 10px; background: #1f2a35; font-weight: 500; font-size: 14px; }
.paate-ala { font-size: 12px; color: #9aa6b2; display: flex; align-items: center; gap: 6px; }
.piste { width: 7px; height: 7px; border-radius: 50%; background: #4ade80; }

/* Moduulit */
.moduulit { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 48px; }
.moduulit > div { border-top: 2px solid var(--ink); padding: 16px 0 36px; }
.moduulit h3 { font-size: 21px; margin-bottom: 10px; }
.moduulit ul { list-style: none; margin: 0; padding: 0; font-size: 14.5px; color: var(--ink-2); }
.moduulit li { padding: 6px 0; border-bottom: 1px solid var(--border-2); }

.moduulit li b { font-weight: 600; color: var(--ink); }
.raportit { margin-top: 12px; border-top: 2px solid var(--ink); padding-top: 16px; }
.raportit h3 { font-size: 21px; margin-bottom: 12px; }
.raportit ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0 24px; font-size: 14px; color: var(--ink-2); }
.raportit li { padding: 6px 0; border-bottom: 1px solid var(--border-2); }
@media (max-width: 1000px) { .raportit ul { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 600px) { .raportit ul { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* Arkkitehtuuri */
.osio-tumma { background: var(--rail); color: #e6ebf0; border-top: 0; }
.osio-tumma .ylaotsikko { color: #8fbef0; }
.arkkitehtuuri { width: 100%; max-width: 64rem; border-collapse: collapse; font-size: 15px; }
.arkkitehtuuri th, .arkkitehtuuri td { text-align: left; vertical-align: top; padding: 11px 0; border-top: 1px solid #2f3d4d; }
.arkkitehtuuri th { width: 13rem; font-weight: 600; color: #fff; padding-right: 24px; }
.arkkitehtuuri td { color: #b9c3cd; }

/* Yhteys */
.yhteys { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 56px; align-items: end; }
.sposti { justify-self: start; font: 600 clamp(24px, 2.8vw, 36px)/1.2 var(--otsikko); text-decoration: none; color: var(--accent); border-bottom: 2px solid var(--accent); padding-bottom: 3px; overflow-wrap: anywhere; }
.sposti:hover { color: #22405f; }

.ala { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; padding: 24px var(--sivu); border-top: 1px solid var(--border); font-size: 13px; color: var(--muted); }

/* ── Kapeat näytöt ───────────────────────────────────────────────────────── */
@media (max-width: 1000px) {
  .moduulit { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .osio-jaettu { grid-template-columns: 1fr; gap: 40px; }
}
@media (max-width: 900px) {
  .tarina { grid-template-columns: minmax(0, 1fr); grid-template-areas: "nayttamo" "tekstit"; }
  .nayttamo { height: 38vh; height: 38svh; z-index: 3; border-left: 0; border-bottom: 1px solid var(--border); }
  .tekstit { position: relative; z-index: 1; }
  .avaus { min-height: auto; padding: 36px 0 56px; }
  .vaihe { min-height: auto; padding: 56px 0; }
  .tekstit::after { height: 30vh; }
  .tilamerkki { left: 12px; bottom: 10px; }
  .yhteys { grid-template-columns: 1fr; gap: 28px; }
  .arkkitehtuuri th { width: 9rem; }
}
@media (max-width: 600px) {
  .moduulit { grid-template-columns: 1fr; }
  .spec > div { grid-template-columns: 1fr; gap: 2px; }
  .arkkitehtuuri th, .arkkitehtuuri td { display: block; width: auto; padding: 4px 0; border: 0; }
  .arkkitehtuuri tr { display: block; border-top: 1px solid #2f3d4d; padding: 8px 0; }
}
