/* Peltiveikot Oy – sivuston tyylit
   Layout: tumma sininen-musta yläosa (logo + hero), vaaleat sisältöosiot, tumma alatunniste.
   Värit noudattavat logon sinistä ja nykyisen sivuston sini-mustaa linjaa. */

@font-face { font-family: "Archivo"; src: url("../fonts/archivo.woff2") format("woff2"); font-weight: 500 800; font-stretch: 62% 125%; font-display: swap; }
@font-face { font-family: "Source Sans 3"; src: url("../fonts/source-sans-3.woff2") format("woff2"); font-weight: 400 700; font-display: swap; }
@font-face { font-family: "JetBrains Mono"; src: url("../fonts/jetbrains-mono.woff2") format("woff2"); font-weight: 500; font-display: swap; }

:root {
  --ink: #0b131f;          /* hero, ylä- ja alatunniste */
  --ink-2: #13202f;
  --ink-line: #24344a;
  --steel: #82aadc;        /* logon sininen, korosteet tummalla */
  --steel-soft: #b9d0ec;
  --blue: #2c67ad;         /* korosteet ja painikkeet vaalealla */
  --blue-dark: #1f4f88;
  --paper: #f4f6f9;        /* vaalea osiotausta */
  --white: #ffffff;
  --text: #182231;
  --muted: #566274;
  --line: #dbe2ea;
  --on-dark: #e9eef5;
  --on-dark-muted: #a6b3c4;

  --f-display: "Archivo", "Arial Narrow", "Helvetica Neue", Arial, sans-serif;
  --f-body: "Source Sans 3", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --f-mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;

  --wrap: 1200px;
  --gutter: max(20px, env(safe-area-inset-left, 0px));
  --gutter-r: max(20px, env(safe-area-inset-right, 0px));
  --radius: 4px;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { transition: none !important; animation: none !important; } }
body { margin: 0; background: var(--white); color: var(--text); font-family: var(--f-body); font-size: 1.0625rem; line-height: 1.6; }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--blue); text-underline-offset: 3px; }
a:hover { color: var(--blue-dark); }
:focus-visible { outline: 3px solid var(--steel); outline-offset: 2px; }
h1, h2, h3, h4 { font-family: var(--f-display); line-height: 1.08; margin: 0; text-wrap: balance; font-stretch: 88%; letter-spacing: -0.01em; }
h1 { font-size: clamp(2.5rem, 6.4vw, 4.75rem); font-weight: 800; font-stretch: 78%; letter-spacing: -0.015em; }
h2 { font-size: clamp(1.85rem, 3.6vw, 2.75rem); font-weight: 750; }
h3 { font-size: 1.3rem; font-weight: 700; font-stretch: 92%; }
p { margin: 0; }
.prose p + p, .prose p + ul, .prose ul + p, .prose h3 + p, .prose p + h3, .prose ul + h3 { margin-top: 1em; }
.prose h2 + p { margin-top: .75em; }
.prose p + h2, .prose ul + h2 { margin-top: 1.6em; }
.prose { max-width: 68ch; }
.prose ul { padding-left: 1.2em; margin: 0; }
.prose li + li { margin-top: .35em; }
.lead { font-size: 1.22rem; line-height: 1.55; color: var(--muted); max-width: 60ch; }

.wrap { max-width: var(--wrap); margin-inline: auto; padding-left: var(--gutter); padding-right: var(--gutter-r); }
.skip { position: absolute; left: -999px; top: 0; background: var(--steel); color: var(--ink); padding: .6em 1em; z-index: 100; }
.skip:focus { left: 8px; top: 8px; }

/* Etiketti (eyebrow) */
.label { font-family: var(--f-mono); font-size: .78rem; letter-spacing: .12em; text-transform: uppercase; color: var(--blue); }
.on-dark .label, .hero .label { color: var(--steel); }

/* Painikkeet */
.btn { display: inline-flex; align-items: center; gap: .55em; font-family: var(--f-display); font-weight: 700; font-stretch: 92%; font-size: 1rem; letter-spacing: .01em; padding: .85em 1.35em; border-radius: var(--radius); text-decoration: none; border: 2px solid transparent; transition: background-color .15s, color .15s, border-color .15s; line-height: 1.1; }
.btn-primary { background: var(--steel); color: var(--ink); }
.btn-primary:hover { background: var(--steel-soft); color: var(--ink); }
.btn-ghost { border-color: rgba(233,238,245,.45); color: var(--on-dark); }
.btn-ghost:hover { border-color: var(--on-dark); color: var(--white); }
.btn-blue { background: var(--blue); color: var(--white); }
.btn-blue:hover { background: var(--blue-dark); color: var(--white); }
.btn svg { width: 1.05em; height: 1.05em; flex: none; }

/* Ylätunniste */
.site-header { position: sticky; top: 0; z-index: 50; background: var(--ink); color: var(--on-dark); border-bottom: 1px solid var(--ink-line); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 24px; min-height: 76px; }
.brand { display: block; flex: none; }
.brand img { height: 56px; width: auto; }
.nav { display: flex; align-items: center; gap: 4px; }
.nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 2px; }
.nav a { display: block; color: var(--on-dark); text-decoration: none; font-family: var(--f-display); font-weight: 600; font-stretch: 92%; font-size: .98rem; padding: .55em .8em; border-radius: var(--radius); }
.nav a:hover { color: var(--white); background: var(--ink-2); }
.nav a[aria-current="page"] { color: var(--steel); }
.nav .btn { margin-left: 10px; padding: .65em 1.1em; }
.nav-toggle { display: none; background: none; border: 1px solid var(--ink-line); color: var(--on-dark); border-radius: var(--radius); width: 46px; height: 46px; align-items: center; justify-content: center; cursor: pointer; }
.nav-toggle svg { width: 22px; height: 22px; }

@media (max-width: 1020px) {
  .nav-toggle { display: inline-flex; }
  .nav { position: absolute; left: 0; right: 0; top: 100%; background: var(--ink); border-bottom: 1px solid var(--ink-line); flex-direction: column; align-items: stretch; padding: 8px var(--gutter-r) 20px var(--gutter); display: none; }
  .nav.open { display: flex; }
  .nav ul { flex-direction: column; }
  .nav a { padding: .8em .4em; font-size: 1.1rem; border-bottom: 1px solid var(--ink-2); border-radius: 0; }
  .nav .btn { margin: 14px 0 0; justify-content: center; border-bottom: 0; border-radius: var(--radius); }
  .brand img { height: 48px; }
  .site-header .wrap { min-height: 66px; }
}

/* Hero: kuva oikealla, häivytys vasempaan reunaan */
.hero { position: relative; background: var(--ink); color: var(--on-dark); overflow: hidden; isolation: isolate; }
.hero-media { position: absolute; inset: 0 0 0 auto; width: min(72%, 1150px); z-index: -1;
  background: radial-gradient(ellipse 40% 45% at 62% 55%, rgba(130,170,220,.45), rgba(44,103,173,.18) 45%, transparent 70%), linear-gradient(160deg, #18283c, var(--ink) 70%); }
.hero-media img { width: 100%; height: 100%; object-fit: cover; object-position: 60% 50%; }
.hero-media::after { content: ""; position: absolute; inset: 0;
  background:
    linear-gradient(90deg, var(--ink) 0%, rgba(11,19,31,.92) 14%, rgba(11,19,31,.62) 34%, rgba(11,19,31,.22) 58%, rgba(11,19,31,0) 78%),
    linear-gradient(0deg, rgba(11,19,31,.55) 0%, rgba(11,19,31,0) 30%); }
.hero .wrap { padding-block: clamp(72px, 11vw, 150px) clamp(64px, 9vw, 120px); }
.hero-copy { max-width: 620px; display: grid; gap: 22px; }
.hero h1 { color: var(--white); }
.hero h1 em { font-style: normal; color: var(--steel); }
.hero .lead { color: var(--on-dark-muted); font-size: clamp(1.15rem, 1.6vw, 1.32rem); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 6px; }
.hero-specs { margin-top: clamp(40px, 6vw, 72px); display: flex; flex-wrap: wrap; gap: 10px 28px; font-family: var(--f-mono); font-size: .8rem; letter-spacing: .1em; text-transform: uppercase; color: var(--on-dark-muted); }
.hero-specs span { display: inline-flex; align-items: center; gap: 10px; }
.hero-specs span::before { content: ""; width: 6px; height: 6px; background: var(--steel); display: inline-block; }

.page-hero .wrap { padding-block: clamp(56px, 7vw, 96px) clamp(48px, 6vw, 80px); }
.page-hero h1 { font-size: clamp(2.3rem, 5vw, 3.75rem); }
.page-hero .hero-media { width: min(60%, 900px); }
.page-hero.no-media .hero-media { background: radial-gradient(ellipse 50% 70% at 85% 40%, rgba(130,170,220,.22), transparent 70%), linear-gradient(160deg, var(--ink-2), var(--ink) 70%); width: 100%; }
.page-hero.no-media .hero-media::after { display: none; }
.crumbs { font-family: var(--f-mono); font-size: .78rem; letter-spacing: .08em; text-transform: uppercase; color: var(--on-dark-muted); }
.crumbs a { color: var(--on-dark-muted); text-decoration: none; }
.crumbs a:hover { color: var(--steel); }

@media (max-width: 760px) {
  .hero-media { width: 100%; }
  .hero-media::after { background: linear-gradient(90deg, rgba(11,19,31,.94) 0%, rgba(11,19,31,.78) 55%, rgba(11,19,31,.5) 100%), linear-gradient(0deg, rgba(11,19,31,.7), rgba(11,19,31,0) 50%); }
  .page-hero .hero-media { width: 100%; }
}

/* Osiot */
.section { padding-block: clamp(64px, 8vw, 112px); }
.section.alt { background: var(--paper); }
.section-head { display: grid; gap: 14px; margin-bottom: clamp(32px, 4vw, 52px); max-width: 760px; }
.section-head .lead { margin-top: 2px; }

/* Palvelukortit */
.services { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.service { padding: 30px 28px 34px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); display: grid; gap: 12px; align-content: start; background: var(--white); }
.section.alt .service { background: var(--white); }
.service-icon { width: 44px; height: 44px; color: var(--blue); }
.service p { color: var(--muted); }
a.more { font-family: var(--f-display); font-weight: 700; font-stretch: 92%; text-decoration: none; margin-top: 4px; }
a.more::after { content: " →"; }
@media (max-width: 900px) { .services { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 580px) { .services { grid-template-columns: minmax(0, 1fr); } }

/* Kuva + teksti */
.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(32px, 6vw, 88px); align-items: center; }
.split.reverse .split-media { order: 2; }
.split-copy { display: grid; gap: 18px; align-content: start; min-width: 0; }
.split-copy p { color: var(--muted); }
@media (max-width: 860px) { .split { grid-template-columns: minmax(0, 1fr); } .split.reverse .split-media { order: 0; } }

.media { position: relative; border-radius: var(--radius); overflow: hidden; aspect-ratio: 4 / 3; max-width: 100%;
  background: linear-gradient(115deg, #c9d2dd 0%, #eef2f6 22%, #b7c2cf 45%, #e3e8ee 63%, #aeb9c7 100%); }
.media img { width: 100%; height: 100%; object-fit: cover; }
.media.tall { aspect-ratio: 4 / 5; }
.media.wide { aspect-ratio: 16 / 9; }
.media.square { aspect-ratio: 1 / 1; }
.media-caption { font-family: var(--f-mono); font-size: .75rem; letter-spacing: .06em; color: var(--muted); margin-top: 10px; }

/* Tarkistuslista (konekanta) */
.checklist { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 24px; }
.checklist li { display: flex; gap: 10px; align-items: baseline; font-weight: 600; }
.checklist li::before { content: ""; width: 10px; height: 10px; flex: none; background: var(--blue); transform: translateY(1px); }
@media (max-width: 480px) { .checklist { grid-template-columns: minmax(0, 1fr); } }

/* Faktarivi */
.facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; background: var(--ink); color: var(--on-dark); }
.fact { padding: 34px 28px; border-left: 1px solid var(--ink-line); display: grid; gap: 6px; }
.fact:first-child { border-left: 0; }
.fact b { font-family: var(--f-display); font-weight: 800; font-stretch: 78%; font-size: clamp(2rem, 3.6vw, 2.9rem); line-height: 1; color: var(--white); font-variant-numeric: tabular-nums; }
.fact span { color: var(--on-dark-muted); font-size: .98rem; }
.facts-band { background: var(--ink); }
@media (max-width: 860px) { .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); } .fact:nth-child(3) { border-left: 0; } .fact:nth-child(n+3) { border-top: 1px solid var(--ink-line); } }

/* Erikoistuotteet */
.products { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px; }
.product { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: grid; grid-template-rows: auto 1fr; }
.product .media { border-radius: 0; aspect-ratio: 16 / 9; }
.product-body { padding: 26px 28px 30px; display: grid; gap: 12px; align-content: start; }
.product-body p { color: var(--muted); }
.mirror { background: linear-gradient(105deg, #8d99a8 0%, #f6f8fa 18%, #c3ccd6 32%, #ffffff 48%, #9aa6b4 62%, #e9edf2 78%, #a8b3bf 100%); }
.mirror-mark { position: absolute; inset: auto 22px 18px auto; font-family: var(--f-mono); font-weight: 500; font-size: .85rem; letter-spacing: .12em; color: rgba(11,19,31,.72); }
@media (max-width: 760px) { .products { grid-template-columns: minmax(0, 1fr); } }

/* Uutiset */
.news { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px; }
.news-card { display: grid; gap: 14px; align-content: start; text-decoration: none; color: inherit; }
.news-card .media { aspect-ratio: 3 / 2; background: linear-gradient(160deg, #1b2b40, var(--ink)); }
.news-card h3 { color: var(--text); transition: color .15s; }
.news-card:hover h3 { color: var(--blue); }
.news-card p { color: var(--muted); }
.meta { font-family: var(--f-mono); font-size: .76rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); display: flex; gap: 12px; flex-wrap: wrap; }
.meta .tag { color: var(--blue); }
@media (max-width: 900px) { .news { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .news { grid-template-columns: minmax(0, 1fr); } }

/* Yhteydenotto-kaista */
.cta-band { background: var(--ink-2); color: var(--on-dark); position: relative; overflow: hidden; }
.cta-band::before { content: ""; position: absolute; inset: 0; background: radial-gradient(ellipse 45% 90% at 100% 0%, rgba(130,170,220,.18), transparent 70%); pointer-events: none; }
.cta-band .wrap { position: relative; padding-block: clamp(56px, 7vw, 88px); display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 40px; align-items: center; }
.cta-band h2 { color: var(--white); }
.cta-band p { color: var(--on-dark-muted); margin-top: 12px; max-width: 46ch; }
.cta-contacts { display: grid; gap: 14px; }
.cta-line { display: flex; align-items: center; gap: 14px; color: var(--white); text-decoration: none; font-family: var(--f-display); font-weight: 700; font-stretch: 90%; font-size: clamp(1.25rem, 2.2vw, 1.6rem); }
.cta-line:hover { color: var(--steel); }
.cta-line svg { width: 26px; height: 26px; color: var(--steel); flex: none; }
.cta-contacts .btn { justify-self: start; margin-top: 8px; }
@media (max-width: 820px) { .cta-band .wrap { grid-template-columns: minmax(0, 1fr); } }

/* Varastotuotteet */
.stock-tools { display: flex; flex-wrap: wrap; gap: 12px 16px; align-items: center; margin-bottom: 28px; }
.stock-search { flex: 1 1 260px; max-width: 420px; position: relative; }
.stock-search input { width: 100%; font: inherit; padding: .75em 1em .75em 2.6em; border: 1px solid var(--line); border-radius: var(--radius); background: var(--white); color: var(--text); }
.stock-search svg { position: absolute; left: .85em; top: 50%; width: 18px; height: 18px; transform: translateY(-50%); color: var(--muted); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { font: inherit; font-size: .92rem; font-weight: 600; padding: .45em .95em; border-radius: 999px; border: 1px solid var(--line); background: var(--white); color: var(--text); cursor: pointer; }
.chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--white); }
.stock-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; align-items: start; }
.stock-group { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.stock-group h3 { font-size: 1.08rem; padding: 16px 20px 14px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; gap: 12px; align-items: baseline; }
.stock-group h3 small { font-family: var(--f-mono); font-size: .72rem; font-weight: 500; letter-spacing: .08em; color: var(--muted); text-transform: uppercase; white-space: nowrap; }
.table-scroll { overflow-x: auto; }
.stock-group table { width: 100%; border-collapse: collapse; font-size: .97rem; }
.stock-group th { text-align: left; font-family: var(--f-mono); font-weight: 500; font-size: .7rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); padding: 10px 20px 6px; }
.stock-group td { padding: 8px 20px; border-top: 1px solid var(--paper); vertical-align: baseline; }
.stock-group td.num { font-family: var(--f-mono); font-size: .88rem; white-space: nowrap; font-variant-numeric: tabular-nums; color: var(--text); }
.stock-group tr:hover td { background: var(--paper); }
.stock-empty { padding: 28px; border: 1px dashed var(--line); border-radius: var(--radius); color: var(--muted); }
.swatch { display: inline-block; width: 12px; height: 12px; border-radius: 2px; margin-right: 8px; vertical-align: -1px; border: 1px solid rgba(0,0,0,.15); }
@media (max-width: 860px) { .stock-grid { grid-template-columns: minmax(0, 1fr); } }

/* Yhteystiedot */
.contact-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); gap: clamp(32px, 6vw, 80px); align-items: start; }
.contact-list { display: grid; gap: 26px; }
.contact-item { display: grid; gap: 4px; }
.contact-item .label { color: var(--muted); }
.contact-item strong, .contact-item a.big { font-family: var(--f-display); font-weight: 700; font-stretch: 90%; font-size: 1.35rem; color: var(--text); text-decoration: none; }
.contact-item a.big:hover { color: var(--blue); }
.form { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: clamp(24px, 4vw, 40px); display: grid; gap: 18px; }
.form .row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.field { display: grid; gap: 6px; }
.field label { font-weight: 600; font-size: .95rem; }
.field input, .field textarea { font: inherit; padding: .75em .9em; border: 1px solid #c8d1dc; border-radius: var(--radius); background: var(--white); color: var(--text); width: 100%; }
.field textarea { min-height: 150px; resize: vertical; }
.field input:focus, .field textarea:focus { outline: 2px solid var(--blue); outline-offset: 0; border-color: var(--blue); }
.hp { position: absolute; left: -5000px; width: 1px; height: 1px; overflow: hidden; }
.form-note { font-size: .88rem; color: var(--muted); }
.form-msg { padding: 14px 16px; border-radius: var(--radius); font-weight: 600; }
.form-msg.ok { background: #e3f2e8; color: #1d5a33; }
.form-msg.err { background: #fbe7e5; color: #8a2a1f; }
.form button { justify-self: start; cursor: pointer; }
@media (max-width: 860px) { .contact-grid { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 520px) { .form .row { grid-template-columns: minmax(0, 1fr); } }

.info-table { border-collapse: collapse; width: 100%; max-width: 680px; }
.info-table th, .info-table td { text-align: left; padding: 12px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.info-table th { font-weight: 600; width: 42%; padding-right: 20px; color: var(--muted); }
.info-table td { font-family: var(--f-mono); font-size: .95rem; font-variant-numeric: tabular-nums; }

/* Artikkeli */
.article { max-width: 760px; }
.article .media { margin-bottom: 36px; aspect-ratio: 16 / 9; }
.article blockquote { margin: 1.4em 0; padding: 4px 0 4px 22px; border-left: 3px solid var(--steel); font-family: var(--f-display); font-stretch: 92%; font-size: 1.3rem; font-weight: 600; line-height: 1.35; color: var(--text); }
.article blockquote cite { display: block; margin-top: 8px; font-family: var(--f-body); font-size: .95rem; font-weight: 400; font-style: normal; color: var(--muted); }
.back { display: inline-block; margin-top: 40px; font-family: var(--f-display); font-weight: 700; text-decoration: none; }

/* Alatunniste */
.site-footer { background: var(--ink); color: var(--on-dark-muted); font-size: .98rem; }
.site-footer .wrap { padding-block: 64px 32px; }
.footer-grid { display: grid; grid-template-columns: 1.3fr 1fr 1fr 1fr; gap: 36px; }
.footer-grid h4 { font-family: var(--f-mono); font-weight: 500; font-size: .74rem; letter-spacing: .12em; text-transform: uppercase; color: var(--steel); margin-bottom: 14px; }
.footer-grid ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.site-footer a { color: var(--on-dark); text-decoration: none; }
.site-footer a:hover { color: var(--steel); }
.footer-brand { display: grid; gap: 16px; align-content: start; }
.footer-brand img { height: 64px; width: auto; }
.footer-bottom { margin-top: 48px; padding-top: 22px; border-top: 1px solid var(--ink-line); display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; font-size: .88rem; }
.social { display: inline-flex; align-items: center; gap: 8px; }
.social svg { width: 20px; height: 20px; }
@media (max-width: 900px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .footer-grid { grid-template-columns: minmax(0, 1fr); } }

.center { text-align: center; }
.mt-l { margin-top: clamp(32px, 4vw, 48px); }
.stack { display: grid; gap: 18px; }
.hero-media picture { display: block; width: 100%; height: 100%; }
.media picture { display: block; width: 100%; height: 100%; }
.partner-logo { width: 140px; height: auto; margin-top: 8px; opacity: .92; }
.cf-turnstile { min-height: 65px; }
