/* =====================================================================
   TYYLITIEDOSTO (styles.css)
   ===================================================================== */

/* ============ FONTIT (omalta palvelimelta, ei ulkopuolisia pyyntöjä) ============ */
@font-face { font-family: "Inter"; font-style: normal; font-weight: 400; font-display: swap; src: url("fonts/inter-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 500; font-display: swap; src: url("fonts/inter-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 600; font-display: swap; src: url("fonts/inter-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Source Serif 4"; font-style: normal; font-weight: 500; font-display: swap; src: url("fonts/source-serif-4-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Source Serif 4"; font-style: normal; font-weight: 600; font-display: swap; src: url("fonts/source-serif-4-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Source Serif 4"; font-style: normal; font-weight: 700; font-display: swap; src: url("fonts/source-serif-4-latin-700-normal.woff2") format("woff2"); }

:root {
  --sininen: #0a2a5e;
  --sininen-tumma: #071d42;
  --sininen-hero: #14418a;
  --esittely-pohja: #e3eaf6;
  --oranssi: #e8731a;
  --oranssi-tumma: #cc6212;
  --valkoinen: #ffffff;
  --vaalea: #f2f5fa;
  --teksti: #1b2433;
  --harmaa: #5a6478;
  --reuna: #d9e0ec;
  --pyoristys: 12px;
  --otsikkofontti: "Source Serif 4", Georgia, "Times New Roman", serif;
  --tekstifontti: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
}

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

html { scroll-behavior: smooth; scroll-padding-top: 76px; }

body {
  margin: 0;
  font-family: var(--tekstifontti);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--teksti);
  background: var(--valkoinen);
}

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

a { color: inherit; }

.wrap { width: min(1120px, 100% - 2.5rem); margin-inline: auto; }

h1, h2, h3 { font-family: var(--otsikkofontti); line-height: 1.2; margin: 0 0 .6em; }
h1 { font-size: clamp(2.6rem, 6vw, 4.4rem); font-weight: 700; letter-spacing: -.01em; }
h2 { font-size: clamp(1.8rem, 3.4vw, 2.4rem); font-weight: 600; }
h3 { font-size: 1.25rem; font-weight: 600; }

p { margin: 0 0 1em; max-width: 68ch; }

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

/* ============ PAINIKKEET (oranssi) ============ */
.nappi {
  display: inline-block;
  background: var(--oranssi);
  color: var(--valkoinen);
  font: 600 .95rem var(--tekstifontti);
  text-decoration: none;
  padding: .7rem 1.4rem;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  transition: background .15s;
}
.nappi:hover { background: var(--oranssi-tumma); }
.nappi-pieni { font-size: .85rem; padding: .4rem .9rem; border-radius: 6px; }

/* ============ YLÄPALKKI (tummansininen) ============ */
.header {
  position: sticky; top: 0; z-index: 10;
  background: var(--sininen);
  color: var(--valkoinen);
  box-shadow: 0 1px 0 rgba(255,255,255,.12);
}
.header-in { display: flex; align-items: center; gap: 1.5rem; min-height: 68px; }

.logo { text-decoration: none; display: flex; align-items: center; gap: .75rem; }
.logo img { height: 40px; width: auto; }
.logo-nimi { font-family: var(--otsikkofontti); font-weight: 700; font-size: 1.3rem; color: var(--valkoinen); white-space: nowrap; }

.nav { display: flex; gap: 1.6rem; margin-left: auto; }
.nav a { text-decoration: none; font-weight: 500; font-size: .98rem; padding: .3rem 0; border-bottom: 2px solid transparent; }
.nav a:hover { border-bottom-color: var(--oranssi); }

.header-oikea { display: flex; align-items: center; gap: .9rem; }
.some { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; color: var(--valkoinen); }
.some:hover { background: rgba(255,255,255,.15); }

/* ============ ETUSIVUN YLÄOSA ============ */
.hero { background: var(--sininen-hero); color: var(--valkoinen); padding: clamp(3rem, 8vw, 6rem) 0 0; }
.hero-in { display: grid; grid-template-columns: 1.1fr .9fr; gap: 3rem; align-items: stretch; }
.hero-teksti { align-self: center; padding-bottom: clamp(3rem, 8vw, 6rem); }
/* Taustaton muotokuva seisoo hero-osion alareunassa */
.hero-kuva { align-self: end; width: 100%; height: auto; }
.hero-rivi { color: #b9c8e6; font-weight: 500; margin-bottom: .8rem; }
.hero h1 { margin-bottom: .2em; }
.hero-vaali { font-size: 1.25rem; margin-bottom: 1rem; }
.hero-vaali strong { font-family: var(--otsikkofontti); font-size: 1.6rem; }
.hero-lause { font-family: var(--otsikkofontti); font-size: 1.5rem; font-style: italic; color: #dbe5f7; margin-bottom: 1.8rem; }

/* ============ KUVAT ============ */
.kuva { border-radius: var(--pyoristys); overflow: hidden; width: 100%; object-fit: cover; }
.kuva-paikka {
  aspect-ratio: 4 / 5;
  display: grid; place-items: center;
  background: #e3e9f4; color: var(--harmaa);
  border: 2px dashed #aab7d0;
  font-size: .95rem; text-align: center; padding: 1rem;
}
.hero .kuva-paikka { background: rgba(255,255,255,.08); color: #b9c8e6; border-color: rgba(255,255,255,.35); }
.esittely-kuva { aspect-ratio: 4 / 5; height: auto; }

/* ============ OSIOT ============ */
.osio { padding: clamp(3rem, 7vw, 5.5rem) 0; }
.osio-vaalea { background: var(--vaalea); }
.osio-esittely { background: var(--esittely-pohja); }
.osion-otsikko { text-align: center; margin-bottom: 2.5rem; }
.osion-otsikko h2 { margin-bottom: .3em; }
.osion-otsikko h2::after { content: ""; display: block; width: 56px; height: 4px; background: var(--oranssi); border-radius: 2px; margin: .6rem auto 0; }
.osion-otsikko .johdanto { margin: 0 auto; font-size: 1.15rem; color: var(--harmaa); }
.kaksi { display: grid; grid-template-columns: 1fr 1fr; gap: 3rem; align-items: start; }

/* ============ KORTIT ============ */
.kortit { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr)); gap: 1.4rem; }
.kortti {
  background: var(--valkoinen);
  border: 1px solid var(--reuna);
  border-radius: var(--pyoristys);
  padding: 1.6rem;
  display: flex; flex-direction: column; align-items: flex-start;
}
.kortti svg { color: var(--sininen); margin-bottom: 1rem; }
.kortti h3 { width: 100%; }
.kortti h3::after { content: ""; display: block; width: 100%; height: 2px; background: var(--oranssi); border-radius: 2px; margin-top: .7rem; }
.kortti p { color: var(--harmaa); font-size: .98rem; }

/* ============ LISTAT ============ */
.lista { margin: 0 0 1em; padding-left: 1.2rem; }
.lista li { margin-bottom: .5em; padding-left: .2rem; }
.lista li::marker { color: var(--oranssi); }
.kortti .lista { color: var(--harmaa); font-size: .98rem; }
.kortti .kortti-lause { color: var(--teksti); font-weight: 500; }

/* ============ ALAPALKKI ============ */
.footer { background: var(--sininen-tumma); color: #b9c8e6; padding: 1.6rem 0; font-size: .9rem; }
.footer-in { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem 2rem; }
.footer p { margin: 0; max-width: none; }
.footer-oikea { display: flex; align-items: center; gap: .9rem; }
.footer p a { color: inherit; text-underline-offset: 3px; }
.footer p a:hover { color: var(--valkoinen); }
.some-teksti { display: inline-flex; align-items: center; gap: .5rem; color: inherit; text-decoration: none; }
.some-teksti:hover { color: var(--valkoinen); text-decoration: underline; text-underline-offset: 3px; }

/* ============ PUHELIN JA TABLETTI ============ */
@media (max-width: 860px) {
  .hero-in, .kaksi { grid-template-columns: 1fr; gap: 2rem; }
  .hero-in > .kuva, .kaksi > .kuva { order: -1; }
  .hero .kuva-paikka { aspect-ratio: 16 / 10; }
  .hero-teksti { padding-bottom: 0; }
  .hero-kuva { max-width: 420px; margin-inline: auto; }
  .esittely-kuva { aspect-ratio: 1 / 1; object-position: 50% 25%; }
  .header-in { flex-wrap: wrap; padding: .6rem 0; }
  .header-oikea { margin-left: auto; }
  .nav { order: 3; width: 100%; margin: 0; gap: 1.2rem; overflow-x: auto; padding-bottom: .3rem; }
  .nav a { padding: .5rem 0; }
  html { scroll-padding-top: 120px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .nappi { transition: none; }
}